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

in workspaces you can not use a ! to exclude and errors out on install #4621

Open
joshstevens19 opened this issue Sep 8, 2023 · 5 comments
Assignees
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@joshstevens19
Copy link

joshstevens19 commented Sep 8, 2023

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

  1. setup a workspace
  2. map this
  "workspaces": [
    "packages/!(*-standlone)"
  ],

try to run bun install

bun install v1.0.0 (822a00c4)


error: TODO glob star * in the middle of a path. For now, try something like "packages/*", at the end of the path.

    "packages/!(*-standlone)"
    ^

What is the expected behavior?

For it to install

What do you see instead?

An error

@joshstevens19 joshstevens19 added the bug Something isn't working label Sep 8, 2023
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Sep 8, 2023
@Electroid
Copy link
Contributor

Thanks for reporting! We haven't implemented negated-globs yet, but this is something we will implement.

@joshstevens19 joshstevens19 changed the title in workspaces you can not use a ! errors out in workspaces you can not use a ! to exclude and errors out on install Sep 8, 2023
@joshstevens19
Copy link
Author

gotcha any workaround for now so we can use bun on the repo?

@joshstevens19
Copy link
Author

guess only way is to manually list all the packages - thanks for coming back fast anyway

@attila
Copy link

attila commented Sep 17, 2023

Also, as the error suggests, this isn't only a problem with negation but with glob stars in the middle of a path in general.
We have a sizeable monorepo that has workspace definitions like this, and the same error is thrown.

{
  "workspaces": [
    "slices/*.lambda",
    "slices/*.stepfunction"
  ]
}

@Swimburger
Copy link

I was hoping to move to bun for package management from pnpm in our large monorepo, but unfortunately, the lack of exclusions means we can't move yet.

This is what our pnpm workspaces file looks like:

packages:     
  - "packages/**"
  - "!packages/**/lib"
  - "!packages/**/dist"
  - "!packages/**/generated"
  - "generators/**"
  - "!generators/**/lib"
  - "!generators/**/dist"
  - "!packages/cli/cli/dist/dev"
  - "!packages/cli/cli/dist/prod"

Since bun says no exclusions yet, I tried rolling the negations into the glob itself like this, but no luck:

  "workspaces": [
    "packages/**/!(dist|lib)**",
    "generators/**/!(dist|lib)**"
  ]

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

No branches or pull requests

5 participants