Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #2450
colinhacks opened this issue Jan 17, 2023 · 5 comments · Fixed by #2240
Closed
Tracked by #2450

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

colinhacks opened this issue Jan 17, 2023 · 5 comments · Fixed by #2240
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@colinhacks
Copy link
Contributor

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 colinhacks added the bug Something isn't working label Jan 17, 2023
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Jan 17, 2023
@Electroid
Copy link
Contributor

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

@jwhear
Copy link
Contributor

jwhear commented Feb 27, 2023

This is currently blocked by Hejsil/zig-clap#84, which in turn is blocked by ziglang/zig#13779

@Electroid
Copy link
Contributor

@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
Copy link
Contributor

jwhear commented Feb 27, 2023

@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 was referenced Feb 28, 2023
@jwhear jwhear reopened this Mar 2, 2023
@Parzival-3141
Copy link
Contributor

Parzival-3141 commented Sep 7, 2023

This seems to be fixed as of 4b63ced.

> bun-debug install zod -d                                       
bun add v0.8.2_debug (4b63ced7)
  🔍 Resolving [1/1] [uws] connect(registry.npmjs.org, 443)
  🔒 Saving lockfile...

 installed zod@3.22.2


 1 packages installed [159.00ms]
"devDependencies": {
    "zod": "^3.22.2"
  }

It also works for -D, --dev, and --optional, and when passing package URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants