-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
const nextVersion = process.argv[2]; | ||
|
||
const packageEntry = process.cwd(); | ||
|
||
const packageName = path.basename(packageEntry); | ||
const srcEntry = path.resolve(packageEntry, './src/index.ts'); | ||
|
||
function generateNextVersion() { | ||
const versionCode = `\nexport const version = '${nextVersion}';\n`; | ||
fs.writeFileSync(srcEntry, versionCode, { encoding: 'utf8', flag: 'a+' }); | ||
} | ||
|
||
function build() { | ||
// 直接运行 yarn build 要报错,用一下蠢办法 | ||
execSync(`yarn clean`, { | ||
stdio: 'inherit', | ||
}); | ||
|
||
execSync(`yarn build:umd & yarn build:cjs & yarn build:esm`, { | ||
stdio: 'inherit', | ||
}); | ||
|
||
execSync(`yarn dts:build && yarn dts:extract`, { | ||
stdio: 'inherit', | ||
}); | ||
} | ||
|
||
function restoreVersionChange() { | ||
execSync(`git restore ${srcEntry}`, { stdio: 'inherit' }); | ||
} | ||
|
||
console.log(`🔖 ${packageName} 添加 nextVersion: ${nextVersion}\n`); | ||
|
||
generateNextVersion(); | ||
build(); | ||
restoreVersionChange(); | ||
|
||
console.log(`✅ ${packageName} nextVersion(${nextVersion}) 添加成功 \n`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb2801
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
antvis-s2 – ./
antvis-s2.vercel.app
antvis-s2-git-master-xuexiao-family.vercel.app
antvis-s2-xuexiao-family.vercel.app