Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CLI arg parsing to allow usage with no arguments #12925

Merged
merged 2 commits into from
Jan 31, 2025
Merged

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Jan 31, 2025

Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 6e86d6d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brophdawg11 brophdawg11 linked an issue Jan 31, 2025 that may be closed by this pull request
@brophdawg11 brophdawg11 merged commit 570658c into dev Jan 31, 2025
8 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/cli branch January 31, 2025 19:35
@@ -5,8 +5,8 @@ let arg = require("arg");
// default `NODE_ENV` so React loads the proper version in it's CJS entry script.
// We have to do this before importing `run.ts` since that is what imports
// `react` (indirectly via `react-router`)
let args = arg({}, { argv: process.argv.slice(2), stopAtPositional: true });
if (args._[0] === "dev") {
let args = arg({}, { argv: process.argv.slice(2), permissive: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argv already defaults to process.argv.slice(2), so we could remove that

Suggested change
let args = arg({}, { argv: process.argv.slice(2), permissive: true });
let args = arg({}, { permissive: true });

Copy link
Contributor

🤖 Hello there,

We just published version 7.2.0-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 7.2.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

github-actions bot commented Mar 6, 2025

🤖 Hello there,

We just published version 7.3.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#12578 breaks command react-router dev --any-param
2 participants