deno
6f0eff64 - fix: drop config-only unstable features from unstable_args() (#33452)

Commit
115 days ago
fix: drop config-only unstable features from unstable_args() (#33452) ## Summary `CliOptions::unstable_args()` (`cli/args/mod.rs:1363`) formatted every entry from `unstable_features()` as `--unstable-{name}`. But the set of valid `unstable` config entries is wider than the set of registered CLI flags — `fmt-component`, `fmt-sql`, and `npm-lazy-caching` are explicitly tolerated as config-only entries (`cli/args/mod.rs:1342`), and `fmt-component` / `fmt-sql` have no corresponding `--unstable-*` arg on `deno run`. `deno x` then forwarded those bogus flags into the spawned `deno run` subprocess (`cli/tools/x.rs:153, 539, 546`), which clap rejected: ``` error: unexpected argument '--unstable-fmt-component' found tip: a similar argument exists: '--unstable-cron' Usage: deno run [OPTIONS] [SCRIPT_ARG]... ``` That broke `deno x` for any project whose `deno.json` had `"unstable": ["fmt-component"]` (or `fmt-sql`) — including the issue reporter's `deno x shadcn-svelte@latest init` command. Filter `unstable_args()` against the actual CLI flag set from `deno_runtime::UNSTABLE_FEATURES`. Config-only features still apply normally — the child process loads the same `deno.json` and turns them on from there — they just don't need to be re-emitted as flags. Fixes #33115.
Author
Parents
Loading