fix(build): copy README (#4782)

This commit is contained in:
三咲智子 2021-12-10 23:48:21 +08:00 committed by GitHub
parent 31ca8e0560
commit 72d264de03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 22 deletions

View File

@ -4,13 +4,7 @@ import { copy } from 'fs-extra'
import { series, parallel } from 'gulp' import { series, parallel } from 'gulp'
import { run } from './utils/process' import { run } from './utils/process'
import { withTaskName } from './utils/gulp' import { withTaskName } from './utils/gulp'
import { import { buildOutput, epOutput, epPackage, projRoot } from './utils/paths'
buildOutput,
epOutput,
epPackage,
epRoot,
projRoot,
} from './utils/paths'
import { buildConfig } from './build-info' import { buildConfig } from './build-info'
import type { TaskFunction } from 'gulp' import type { TaskFunction } from 'gulp'
import type { Module } from './build-info' import type { Module } from './build-info'
@ -18,23 +12,18 @@ import type { Module } from './build-info'
const runTask = (name: string) => const runTask = (name: string) =>
withTaskName(name, () => run(`pnpm run build ${name}`)) withTaskName(name, () => run(`pnpm run build ${name}`))
export const copyFiles = () => { export const copyFiles = () =>
const copyTypings = async () => { Promise.all([
await copyFile(
path.resolve(projRoot, 'typings/global.d.ts'),
path.resolve(epOutput, 'global.d.ts')
)
}
return Promise.all([
copyFile(epPackage, path.join(epOutput, 'package.json')), copyFile(epPackage, path.join(epOutput, 'package.json')),
copyFile( copyFile(
path.resolve(epRoot, 'README.md'), path.resolve(projRoot, 'README.md'),
path.resolve(epOutput, 'README.md') path.resolve(epOutput, 'README.md')
), ),
copyTypings(), copyFile(
path.resolve(projRoot, 'typings/global.d.ts'),
path.resolve(epOutput, 'global.d.ts')
),
]) ])
}
export const copyTypesDefinitions: TaskFunction = (done) => { export const copyTypesDefinitions: TaskFunction = (done) => {
const src = path.resolve(buildOutput, 'types') const src = path.resolve(buildOutput, 'types')

View File

@ -7,10 +7,8 @@ pnpm update:version
pnpm build pnpm build
find dist/element-plus/packages -type d -name node_modules -print0 | xargs -0 -I {} rm -rf {}
cd dist/element-plus cd dist/element-plus
npm publish --access public npm publish --access public
cd - cd -
echo "Publish completed" echo "Publish completed"