From 31603e7ff51abd3bca2b5d196789c7a583932295 Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Fri, 29 May 2026 12:08:17 -0700 Subject: [PATCH] fix(cli): drop redundant --minimum-release-age flag on re-exec We only ever invoke `npx` (the npm binary), whose cooldown config is `min-release-age`. The camelCase `--minimum-release-age` is pnpm/bun's spelling, and those aren't reached via npx (they use `pnpm dlx` / `bunx`), so the extra flag was dead weight npm silently ignored. Keep only `--min-release-age=0`. --- packages/stack-cli/src/lib/self-update.test.ts | 9 +++------ packages/stack-cli/src/lib/self-update.ts | 14 +++++--------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/stack-cli/src/lib/self-update.test.ts b/packages/stack-cli/src/lib/self-update.test.ts index 50068d96d..fd33f9cb1 100644 --- a/packages/stack-cli/src/lib/self-update.test.ts +++ b/packages/stack-cli/src/lib/self-update.test.ts @@ -118,7 +118,6 @@ describe("buildNpxInvocation", () => { expect(args).toEqual([ "--yes", "--min-release-age=0", - "--minimum-release-age=0", "-p", "@hexclave/cli@2.8.110", "stack", @@ -139,10 +138,8 @@ describe("buildNpxInvocation", () => { binName: "stack", forwardArgs: [], }); - // Both keys npm has shipped: `min-release-age` (days, >=11.10.0) and the - // earlier `minimumReleaseAge` (minutes, >=11.6.1). + // npm's `min-release-age` (>=11.10.0) would otherwise block the latest. expect(args).toContain("--min-release-age=0"); - expect(args).toContain("--minimum-release-age=0"); }); it("preserves args that start with dashes or contain spaces as individual argv elements", () => { @@ -153,7 +150,7 @@ describe("buildNpxInvocation", () => { forwardArgs: ["dev", "--flag=a b", "--", "echo", "hello world"], }); expect(args).toEqual([ - "--yes", "--min-release-age=0", "--minimum-release-age=0", "-p", "@hexclave/cli@2.8.110", "stack", + "--yes", "--min-release-age=0", "-p", "@hexclave/cli@2.8.110", "stack", "dev", "--flag=a b", "--", "echo", "hello world", ]); }); @@ -205,7 +202,7 @@ describe("decideReexec", () => { expect(decision.reexec).toBe(true); if (decision.reexec) { expect(decision.invocation.args).toEqual([ - "--yes", "--min-release-age=0", "--minimum-release-age=0", "-p", "@hexclave/cli@2.8.110", "stack", "dev", "--config-file", "x", + "--yes", "--min-release-age=0", "-p", "@hexclave/cli@2.8.110", "stack", "dev", "--config-file", "x", ]); } }); diff --git a/packages/stack-cli/src/lib/self-update.ts b/packages/stack-cli/src/lib/self-update.ts index 0fb3efc97..39bddec34 100644 --- a/packages/stack-cli/src/lib/self-update.ts +++ b/packages/stack-cli/src/lib/self-update.ts @@ -155,16 +155,12 @@ export function buildNpxInvocation(opts: { command, args: [ "--yes", - // Override any global "cooldown" for this call only — we always want the - // just-published latest, and a pinned version newer than the cooldown - // window otherwise fails with ETARGET (which would kill `stack dev`). - // npm's real config is `min-release-age` (days, npm >=11.10.0), so - // `--min-release-age=0` is what matters for npx. We also pass the - // camelCase `--minimum-release-age=0` (the spelling pnpm/bun use, in case - // npx is shimmed to them) defensively — npm silently ignores config flags - // it doesn't recognize, so the extra flag is harmless. + // Override any global npm "cooldown" for this call only — we always want + // the just-published latest, and npx of a pinned version newer than the + // cooldown window otherwise fails with ETARGET (which would kill + // `stack dev`). npm's config is `min-release-age` (days, npm >=11.10.0); + // older npm silently ignores the unknown flag. "--min-release-age=0", - "--minimum-release-age=0", "-p", `${opts.packageName}@${opts.version}`, opts.binName,