From 72d264de03813779f9535bb6bc4815a2c4faf809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Fri, 10 Dec 2021 23:48:21 +0800 Subject: [PATCH] fix(build): copy README (#4782) --- build/gulpfile.ts | 27 ++++++++------------------- scripts/publish.sh | 4 +--- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/build/gulpfile.ts b/build/gulpfile.ts index 1c1aa3f5eb..ae74bc8f58 100644 --- a/build/gulpfile.ts +++ b/build/gulpfile.ts @@ -4,13 +4,7 @@ import { copy } from 'fs-extra' import { series, parallel } from 'gulp' import { run } from './utils/process' import { withTaskName } from './utils/gulp' -import { - buildOutput, - epOutput, - epPackage, - epRoot, - projRoot, -} from './utils/paths' +import { buildOutput, epOutput, epPackage, projRoot } from './utils/paths' import { buildConfig } from './build-info' import type { TaskFunction } from 'gulp' import type { Module } from './build-info' @@ -18,23 +12,18 @@ import type { Module } from './build-info' const runTask = (name: string) => withTaskName(name, () => run(`pnpm run build ${name}`)) -export const copyFiles = () => { - const copyTypings = async () => { - await copyFile( - path.resolve(projRoot, 'typings/global.d.ts'), - path.resolve(epOutput, 'global.d.ts') - ) - } - - return Promise.all([ +export const copyFiles = () => + Promise.all([ copyFile(epPackage, path.join(epOutput, 'package.json')), copyFile( - path.resolve(epRoot, 'README.md'), + path.resolve(projRoot, '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) => { const src = path.resolve(buildOutput, 'types') diff --git a/scripts/publish.sh b/scripts/publish.sh index 9cb3a99b62..e1555f505c 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -7,10 +7,8 @@ pnpm update:version pnpm build -find dist/element-plus/packages -type d -name node_modules -print0 | xargs -0 -I {} rm -rf {} - cd dist/element-plus npm publish --access public cd - -echo "Publish completed" +echo "✅ Publish completed"