bun icon indicating copy to clipboard operation
bun copied to clipboard

Support `bun install <pkg> {--d|--optional}`

Open colinhacks opened this issue 2 years ago • 4 comments

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

colinhacks avatar Jan 17 '23 22:01 colinhacks

This is blocked until we update zig-clap, which seems to have added support for lowecase flags.

Electroid avatar Feb 14 '23 00:02 Electroid

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 avatar Feb 27 '23 17:02 jwhear

@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?

Electroid avatar Feb 27 '23 17:02 Electroid

@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.

jwhear avatar Feb 27 '23 18:02 jwhear

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.

Parzival-3141 avatar Sep 07 '23 20:09 Parzival-3141