From bedc89586031c848b209871046ee0b96cdae2aa1 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Wed, 18 Feb 2026 11:22:34 +0100 Subject: [PATCH] feat(scripts): add --ignore-scripts option for dependency upgrades Add an optional flag to pass --ignore-scripts to yarn install when running the upgrade-workspace-dependency script. This is useful for skipping potentially slow or problematic post-install scripts during dependency updates. Issue: BTC-0 Co-authored-by: llm-git --- scripts/upgrade-workspace-dependency.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade-workspace-dependency.ts b/scripts/upgrade-workspace-dependency.ts index f5411f3721..688f8a5cd3 100644 --- a/scripts/upgrade-workspace-dependency.ts +++ b/scripts/upgrade-workspace-dependency.ts @@ -89,9 +89,13 @@ async function updatePackageJson( await fs.writeFile(packagePath, JSON.stringify(packageJson, null, 2) + '\n'); } -async function runYarnInstall(): Promise { - console.log('\nRunning yarn install to update lock file...'); - await execa('yarn', ['install'], { +async function runYarnInstall({ ignoreScripts }: { ignoreScripts: boolean }): Promise { + const args = ['install']; + if (ignoreScripts) { + args.push('--ignore-scripts'); + } + console.log(`\nRunning yarn ${args.join(' ')} to update lock file...`); + await execa('yarn', args, { stdio: 'inherit', }); } @@ -101,6 +105,7 @@ async function cmdUpgrade(opts: { version?: string; versionPrefix?: string; dryRun: boolean; + ignoreScripts: boolean; }): Promise { const { package: depName, version: targetVersion, dryRun } = opts; @@ -133,7 +138,7 @@ async function cmdUpgrade(opts: { for (const pkg of packagesWithDep) { console.log(` ${pkg.packageName}: ${pkg.currentVersion} → ${newVersion}`); } - console.log('\nThen run: yarn install'); + console.log(`\nThen run: yarn install${opts.ignoreScripts ? ' --ignore-scripts' : ''}`); return; } @@ -145,7 +150,7 @@ async function cmdUpgrade(opts: { console.log('\nāœ… Updated all package.json files'); - await runYarnInstall(); + await runYarnInstall({ ignoreScripts: opts.ignoreScripts }); console.log('\nāœ… Done!'); } @@ -178,6 +183,11 @@ yargs describe: 'Show what would be updated without making changes', alias: 'd', }, + ignoreScripts: { + type: 'boolean', + default: false, + describe: 'Pass --ignore-scripts to yarn install', + }, }); }, async handler(a) {