Open
Conversation
🦋 Changeset detectedLatest commit: 985be11 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
…uild commands) Fixes issue where flags like --host were not being passed through to Vite, Next.js, and other build tools. Changes: - Added .passThroughOptions() to dev, start, and build commands - Added .enablePositionalOptions() to parent command (required for passThroughOptions) - Flags like --host, --port, --open now correctly passed to underlying tools Example usage: npm run dev -- --host npm run dev -- --port 3001 npm run build -- --sourcemap
Updates all 198 example package.json files to include -- after refine commands. This allows users to pass flags without needing the double dash separator. Before: npm run dev -- --host After: npm run dev --host Also adds a utility script to automate these updates in the future.
e8b52b0 to
8f65585
Compare
alicanerdurmaz
requested changes
Jan 26, 2026
Member
alicanerdurmaz
left a comment
There was a problem hiding this comment.
I believe we can remove this scripts/update-refine-scripts.js
Member
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.





PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
When users try to pass command-line flags to the underlying build tools (Vite, Next.js, Remix, etc.) using
refine dev,refine start, orrefine build, the flags are not passed through.Example:
npm run dev -- --host # Flags are ignored, --host never reaches ViteThis happens because:
.allowUnknownOption(true)accepts the flags but doesn't capture them in the variadic[args...]parameternpm run dev -- --hostsyntax (double dash).passThroughOptions()configurationWhat is the new behavior?
Users can now pass flags directly to the underlying build tools with improved UX:
Changes made:
Part 1: CLI Code (4 files)
.passThroughOptions()todev,start, andbuildcommands inpackages/cli/src/commands/runner/{dev,start,build}/index.ts.enablePositionalOptions()to parent command inpackages/cli/src/cli.tsPart 2: Package.json Scripts (198 examples + 1 utility script)
package.jsonfiles:"dev": "refine dev"→"dev": "refine dev --"--at the end of the script, npm automatically treats everything after as arguments to pass throughscripts/update-refine-scripts.jsfor future maintenanceWhy both changes are needed:
npm run dev -- --hostnpm run dev --host✨Notes for reviewers
Testing completed locally:
--hostflag - confirmed network exposure worksPending CI verification:
Security: No concerns - this only affects argument passing to already-trusted build tools (vite, next, remix) resolved from
node_modules/.bin. Arguments are properly escaped byexeca.Example flags this enables:
--host,--port,--open,--strictPort--turbo,--port,--hostname--sourcemap,--minify,--watch