Skip to content

Commit 62b61c0

Browse files
authored
ci(plugin-swc): bump version number in package.json when release (#446)
1 parent 9b1b510 commit 62b61c0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/plugin-react-swc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-react-swc",
3-
"version": "3.8.1",
3+
"version": "3.9.0-beta.0",
44
"license": "MIT",
55
"author": "Arnaud Barré (https://github.com/ArnaudBarre)",
66
"description": "Speed up your Vite dev server with SWC",

scripts/release.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ release({
2525
)
2626
},
2727
generateChangelog: async (pkgName, version) => {
28+
if (pkgName === 'plugin-react-swc') {
29+
console.log(colors.cyan('\nUpdating package.json version...'))
30+
const pkgJsonPath = `packages/${pkgName}/package.json`
31+
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'))
32+
pkg.version = version
33+
writeFileSync(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`)
34+
}
35+
2836
const changelog = readFileSync(`packages/${pkgName}/CHANGELOG.md`, 'utf-8')
2937
console.log(colors.cyan('\nUpdating CHANGELOG.md...'))
3038
const date = new Date().toISOString().slice(0, 10)

0 commit comments

Comments
 (0)