1
0
mirror of synced 2026-03-22 10:28:36 +08:00

build: package.json 中files增加src,移除sideEffects

This commit is contained in:
roymondchen
2024-06-17 16:24:06 +08:00
parent 80e42cc997
commit e4a06bd12d
16 changed files with 55 additions and 63 deletions

View File

@@ -187,6 +187,17 @@ async function main() {
}
}
if (!skipGit) {
const { stdout } = await run('git', ['diff'], { stdio: 'pipe' });
if (stdout) {
step('\nCommitting changes...');
await runIfNotDry('git', ['add', '-A']);
await runIfNotDry('git', ['commit', '-m', `chore: release v${targetVersion}`, '--verify']);
} else {
console.log('No changes to commit.');
}
}
// publish packages
step('\nPublishing packages...');
@@ -194,7 +205,9 @@ async function main() {
if (isDryRun) {
additionalPublishFlags.push('--dry-run');
}
if (isDryRun || skipGit) {
additionalPublishFlags.push('--no-git-checks');
}
// bypass the pnpm --publish-branch restriction which isn't too useful to us
// otherwise it leads to a prompt and blocks the release script
const branch = await getBranch();
@@ -215,7 +228,7 @@ async function main() {
if (stdout) {
step('\nCommitting changes...');
await runIfNotDry('git', ['add', '-A']);
await runIfNotDry('git', ['commit', '-m', `chore: release v${targetVersion}`, '--verify']);
await runIfNotDry('git', ['commit', '-m', `chore: update lockfile v${targetVersion}`, '--verify']);
} else {
console.log('No changes to commit.');
}
@@ -362,14 +375,7 @@ async function publishPackage(pkgName, version, additionalFlags) {
// workspace:* deps
await run(
'pnpm',
[
'publish',
...(releaseTag ? ['--tag', releaseTag] : []),
'--access',
'public',
'--no-git-checks',
...additionalFlags,
],
['publish', ...(releaseTag ? ['--tag', releaseTag] : []), '--access', 'public', ...additionalFlags],
{
cwd: getPkgRoot(pkgName),
stdio: 'pipe',