ojkelly / yarn.build

Build 🛠 and Bundle 📦 your local workspaces. Like Bazel, Buck, Pants and Please but for Yarn Berry. Build any language, mix javascript, typescript, golang and more in one polyglot repo. Ship your bundles to AWS Lambda, Docker, or any nodejs runtime.
https://yarn.BUILD
MIT License
326 stars 28 forks source link

`--exclude-current` also excludes dependencies #227

Open occidens opened 2 years ago

occidens commented 2 years ago

Describe the bug The --exclude-current switch causes yarn.build to also exclude the dependencies of the current workspace. This does not appear to be the intended functionality based on the description in the docs

# For Dev
# this one is really useful at the start of a dev command or similar where you
# are watching for changes in the current workspace but need to ensure your
# dependencies are built
yarn build --exclude-current

In the scenario described, for typical monorepo setup, the --exclude-current results in nothing being built.

To Reproduce

# Using the examples in this repo, with a fresh checkout:
$ cd packages/examples/lorem-ipsum

$ yarn build --dry-run
# Shows 12 packages to be built

$ yarn build --dry-run --exclude-current
# Shows 0 packages to be build; expected 11

$ yarn build --exclude-current
# Shows 1 package excluded, 0 packages built or skipped

$ yarn build
# Successfully builds 12 packages

Expected behavior Based on the description in the docs, I would expect yarn build --exclude-current to build the same set of packages as yarn build, minus the current workspace.

Screencast of the above repoduction https://asciinema.org/a/511484

Desktop: