Skip to content

--exclude-current also excludes dependenciesΒ #227

@occidens

Description

@occidens

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:

  • OS: macOS 11.6.7 Darwin Kernel Version 20.6.0: Tue Apr 19 21:04:45 PDT 2022; root:xnu-7195.141.29~1/RELEASE_X86_64 x86_64
  • node: 16.13.0
  • yarn: 3.2.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions