bun
bun copied to clipboard
Support `bun install <pkg> {--d|--optional}`
What version of Bun is running?
No response
What platform is your computer?
No response
What steps can reproduce the bug?
$ bun install zod -d
Failed to parse argument due to unexpected single dash
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
This is blocked until we update zig-clap, which seems to have added support for lowecase flags.
This is currently blocked by https://github.com/Hejsil/zig-clap/issues/84, which in turn is blocked by https://github.com/ziglang/zig/issues/13779
@jwhear Could we still workaround the issue if we provide a long name for every flag? Do we have any flags that are single char only?
@jwhear Could we still workaround the issue if we provide a long name for every flag? Do we have any flags that are single char only?
Probably, I'm working on that now. The only parameter that was short-form only is
-i Automatically install dependencies and use global cache in bun's runtime, equivalent to --install=fallback
I am adding long-form --install-fallback for now.
This seems to be fixed as of 4b63ced72.
> bun-debug install zod -d
bun add v0.8.2_debug (4b63ced7)
🔍 Resolving [1/1] [uws] connect(registry.npmjs.org, 443)
🔒 Saving lockfile...
installed [email protected]
1 packages installed [159.00ms]
"devDependencies": {
"zod": "^3.22.2"
}
It also works for -D, --dev, and --optional, and when passing package URLs.