From d5856115308d3ff8e244449c32859ce4918e55ae Mon Sep 17 00:00:00 2001 From: Soybean Date: Thu, 1 Aug 2024 01:29:22 +0800 Subject: [PATCH] chore(projects): update script --- scripts/release.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/release.ts b/scripts/release.ts index 349d23a..e93c203 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -12,12 +12,16 @@ async function updateTemplateVersion() { const { version: newVersion } = JSON.parse(pkgJson); + const pkgVersionReg = /"version": "\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?"/; + const soybeanJsCliVersionReg = /"@soybeanjs\/cli": "\d+\.\d+\.\d+(-(beta|alpha)\.\d+)?"/; for await (const glob of globs) { const json = await readFile(glob, 'utf-8'); - const newPkgJson = json.replace(soybeanJsCliVersionReg, `"@soybeanjs/cli": "${newVersion}"`); + const newPkgJson = json + .replace(pkgVersionReg, `"version": "0.0.0"`) + .replace(soybeanJsCliVersionReg, `"@soybeanjs/cli": "${newVersion}"`); await writeFile(glob, newPkgJson); }