feat(deploy): forward unknown CLI flags to wrangler deploy#104
Open
dragonkhoi wants to merge 2 commits into
Open
feat(deploy): forward unknown CLI flags to wrangler deploy#104dragonkhoi wants to merge 2 commits into
dragonkhoi wants to merge 2 commits into
Conversation
Allow users to pass wrangler-specific flags (e.g. --keep-vars, --config) through `vinext deploy` without vinext needing to explicitly define each one. Unknown flags and positional args are collected via parseArgs tokens and appended to the wrangler deploy command. Co-Authored-By: Claude Opus 4.6 (Claude helped me a lot!) <noreply@anthropic.com>
Author
|
Claude wrote it but I had it go through twice and I reviewed it. I basically tried to yarn deploy --keep-vars and it didn't pass the args to wrangler deploy, so this is a patch for that. |
With strict:false, parseArgs widens all value types to string | boolean. Cast known fields back to their declared types to satisfy tsc. Co-Authored-By: Claude Opus 4.6 (Claude helped me a lot!) <noreply@anthropic.com>
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
--keep-vars,--config) throughvinext deploywithout vinext needing to explicitly define each oneparseDeployArgsfromstrict: truetostrict: falsewith token-based collection of unknown flags and positionalswrangler deploycommand after vinext's own--envflagDesign note
Positional arguments are intentionally forwarded to wrangler alongside unknown flags. This gives users full passthrough capability (e.g.
vinext deploy -- --keep-vars --config=custom.toml). Sincewrangler deploydoes not accept meaningful positionals, stray positionals will surface as wrangler errors rather than being silently swallowed.Test plan
--keep-vars) collected as passthrough--config my-wrangler.toml) collected correctly--config=my-wrangler.toml) reconstructed correctly--envin wrangler command🤖 Generated with Claude Code