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); }