fix(cli): expose vpr package bin#1838
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cc1028c2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| process.argv.splice(2, 0, 'run'); | ||
| import '../dist/bin.js'; |
There was a problem hiding this comment.
Load the CLI only after injecting
run
Because this is a static ESM import, Node links and evaluates ../dist/bin.js before any of this wrapper's body runs, so process.argv.splice(2, 0, 'run') has not executed when the CLI reads process.argv. In any clean install using the new node_modules/.bin/vpr, vpr hello is therefore dispatched like vp hello instead of vp run hello; use a dynamic await import('../dist/bin.js') after mutating process.argv to preserve the shorthand behavior.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Follow-up pushed.
|
|
Please take the time to understand the problem you’re trying to solve, rather than handing everything over to AI as a substitute for your own thinking. We can’t do the validation and review for you. |
Summary
Fixes #1827.
Verification
Note: I attempted pnpm -F vite-plus build-ts before running the snap test, but this local checkout cannot build because the vendored rolldown workspace has no generated dist/native binding after sync-remote failed with git index-pack errors. The change itself is covered by static checks and mirrors the existing global command-vpr snap fixture.