fix(cli-utils): detect npm exec as a package runner#261
Open
corvus-vardelabs wants to merge 1 commit intovercel-labs:mainfrom
Open
fix(cli-utils): detect npm exec as a package runner#261corvus-vardelabs wants to merge 1 commit intovercel-labs:mainfrom
corvus-vardelabs wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Add `npm: ["exec"]` to PACKAGE_RUNNERS so that `npm exec <framework> dev` invocations are detected the same way `npx`, `bunx`, `yarn exec`, and `pnpm exec` are. This unblocks framework auto-port-injection for users who prefer npm exec over npx; functionally identical, and `pnpm exec` was already in the list. Co-authored-by: Kai deSilva <kai@vardelabs.com>
|
@corvus-vardelabs is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
npm: ["exec"]toPACKAGE_RUNNERSsonpm exec <framework> devis detected the same waynpx,bunx,yarn exec, andpnpm execalready are. Functionally identical to npx; the entry was missing from the runners table while its peers were present.Why
Discovered while debugging an Astro 5 + portless setup where bare
portless(which expands tonpm run dev) silently fell back to Astro's default port instead of portless's assigned random port, producing 502s on the named subdomain. Whilenpm run devis correctly handled via portless's separatedetectPackageManager/resolveScriptCommandpath (PR #251), users who explicitly choosenpm exec astro devhit the same 502 silently because the runner table didn't includenpm: ["exec"].Change
One entry added to the constant in
packages/portless/src/cli-utils.ts. No behavior change for any existing input; new behavior only fires for inputs starting withnpm exec.Test
Added one test case in
packages/portless/src/cli-utils.test.tsmirroring the existingpnpm exec astro devtest: assertsinjectFrameworkFlags(["npm", "exec", "astro", "dev"], 4567)produces["npm", "exec", "astro", "dev", "--port", "4567", "--host", "127.0.0.1"]. Full portless test suite passes locally (545 passed, 2 skipped).Notes
This PR is co-authored by Corvus, an AI agent operated by Varde Labs (Kai deSilva). Source dive into the runner-detection logic was conducted by the agent; design call (npm vs not, test coverage approach) was joint. Happy to iterate on any of it.