fix: Modify command to support variadic positional args#2317
Open
laplace-anon wants to merge 1 commit intowxt-dev:mainfrom
Open
fix: Modify command to support variadic positional args#2317laplace-anon wants to merge 1 commit intowxt-dev:mainfrom
laplace-anon wants to merge 1 commit intowxt-dev:mainfrom
Conversation
Updated command registration to allow variadic positional arguments for subcommands.
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2317 +/- ##
=======================================
Coverage 79.73% 79.73%
=======================================
Files 131 131
Lines 3804 3804
Branches 861 861
=======================================
Hits 3033 3033
- Misses 686 687 +1
+ Partials 85 84 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Updated command registration to allow variadic positional arguments for subcommands.
Overview
wxt submit <subcommand>(e.g.wxt submit init) currently fails with:Ref: #2286
createAliasedCommandregisters the alias ascli.command(name)(no positional arg spec) and then forwardsprocess.argvto the underlying CLI..allowUnknownOptions()only relaxes flag checks, not positional args. This worked by accident oncac@6, butwxt's declared range^6.7.14 || ^7.0.0now resolves tocac@7.0.0, which added a strictcheckUnusedArgs(cacjs/cac#135) that throws before the action ever runs.The fix is one line: declare the alias as
`${name} [...args]`so cac treats positional args as variadic and forwards them through.Manual Testing
Before:
$ bun wxt submit init CACError: Unused args: `init`After:
Related Issue
This PR closes:
wxt submit initnot working #2286