Skip to content

Commit e6b55d6

Browse files
committed
chore: release v1.3.3
1 parent ebdc5f7 commit e6b55d6

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-ccui",
3-
"version": "1.3.1",
3+
"version": "1.3.3",
44
"scripts": {
55
"dev": "pnpm --filter docs dev",
66
"docs:build": "pnpm --filter docs predev && pnpm --filter docs docs:build",
@@ -35,4 +35,4 @@
3535
"vue-demi"
3636
]
3737
}
38-
}
38+
}

packages/ccui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-ccui",
3-
"version": "1.2.2",
3+
"version": "1.3.3",
44
"license": "MIT",
55
"description": "vue3-ccui components based on Vite and Vue3",
66
"type": "module",
@@ -47,4 +47,4 @@
4747
"vitest": "^4.0.6",
4848
"vue-tsc": "^3.1.3"
4949
}
50-
}
50+
}

packages/cli/commands/release.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ async function createPackageJson(version) {
3434
}
3535

3636
exports.release = async ({ version }) => {
37+
// 更新版本号
38+
const newVersion = getVersion(version)
39+
console.log(`Updating version to ${newVersion}`)
40+
41+
// 更新根目录 package.json 版本号
42+
const rootPackageJson = require('../../../package.json')
43+
rootPackageJson.version = newVersion
44+
await fsExtra.outputFile(
45+
path.resolve(__dirname, '../../../package.json'),
46+
JSON.stringify(rootPackageJson, null, 2),
47+
'utf-8',
48+
)
49+
50+
// 更新 ccui package.json 版本号
51+
packageJson.version = newVersion
52+
await fsExtra.outputFile(
53+
path.resolve(__dirname, '../../ccui/package.json'),
54+
JSON.stringify(packageJson, null, 2),
55+
'utf-8',
56+
)
57+
3758
await createPackageJson(version)
3859
shell.sed('-i', 'workspace:', '', path.resolve(outputDir, 'package.json'))
3960
shell.cp('-R', path.resolve(__dirname, '../../ccui/README.md'), outputDir)
@@ -49,5 +70,16 @@ exports.release = async ({ version }) => {
4970
path.resolve(__dirname, '../../theme/darkTheme.css'),
5071
path.resolve(outputDir, 'theme'),
5172
)
52-
// shell.exec('npm publish');
73+
74+
// 提交版本更新
75+
shell.cd(path.resolve(__dirname, '../../../'))
76+
shell.exec('git add .')
77+
shell.exec(`git commit -m "chore: release v${newVersion}"`)
78+
shell.exec(`git tag v${newVersion}`)
79+
shell.exec('git push origin master --tags')
80+
81+
// 发布到 npm
82+
console.log('Publishing to npm...')
83+
shell.cd(outputDir)
84+
shell.exec('npm publish')
5385
}

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ccui-cli",
3-
"version": "1.0.0",
3+
"version": "1.3.2",
44
"description": "ccui-cli",
55
"keywords": [
66
"cli"

packages/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs",
3-
"version": "1.2.2",
3+
"version": "1.3.2",
44
"license": "MIT",
55
"description": "vue3-ccui components based on Vite and Vue3",
66
"type": "module",

packages/theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "theme",
3-
"version": "1.2.2",
3+
"version": "1.3.2",
44
"license": "MIT",
55
"description": "vue3-ccui components based on Vite and Vue3",
66
"type": "module",

0 commit comments

Comments
 (0)