fix: use spaces for JSON formatting in version sync script

This commit is contained in:
Simon
2026-01-21 01:23:07 +08:00
parent bc7ccf47ff
commit 3a3bb0e58c

View File

@@ -34,7 +34,7 @@ console.log(chalk.cyan.bold('\n📦 Syncing version\n'))
// Update root package.json if new version specified // Update root package.json if new version specified
if (versionArg) { if (versionArg) {
rootPkg.version = newVersion rootPkg.version = newVersion
writeFileSync(rootPkgPath, JSON.stringify(rootPkg, null, '\t') + '\n') writeFileSync(rootPkgPath, JSON.stringify(rootPkg, null, ' ') + '\n')
console.log(chalk.green('✓') + ` ${chalk.bold('root')}${chalk.yellow(newVersion)}`) console.log(chalk.green('✓') + ` ${chalk.bold('root')}${chalk.yellow(newVersion)}`)
} else { } else {
console.log(chalk.dim(' root:') + ` ${chalk.yellow(newVersion)} ${chalk.dim('(source)')}`) console.log(chalk.dim(' root:') + ` ${chalk.yellow(newVersion)} ${chalk.dim('(source)')}`)
@@ -94,7 +94,7 @@ for (const pkg of packages) {
continue continue
} }
writeFileSync(pkgPath, JSON.stringify(pkgJson, null, '\t') + '\n') writeFileSync(pkgPath, JSON.stringify(pkgJson, null, ' ') + '\n')
console.log( console.log(
chalk.green('✓') + chalk.green('✓') +
` ${chalk.bold(pkgJson.name)}: ${chalk.dim(oldVersion)}${chalk.yellow(newVersion)}` ` ${chalk.bold(pkgJson.name)}: ${chalk.dim(oldVersion)}${chalk.yellow(newVersion)}`