[Bug?]: If you set `workspace:*` in a catalog, topological-dev doesn't pick it up.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
If you use use workspace:* inside a catalog, packages that use that catalog won't know they need to build that dependency.
To reproduce
In .yarnrc.yml:
catalog:
myDep: "workspace:*"
In myPackage/package.json:
"dependencies": {
"myDep": "catalog:"
},
yarn workspaces foreach -R --topological-dev --from myPackage --exclude myPackage run build
Doesn't build myDep.
Environment
System:
OS: macOS 26.4.1
CPU: (14) arm64 Apple M4 Pro
Binaries:
Node: 22.21.1 - /private/var/folders/sw/qdv4560138q02fljbtpk0m_r0000gp/T/xfs-415dc03d/node
Yarn: 4.14.1 - /private/var/folders/sw/qdv4560138q02fljbtpk0m_r0000gp/T/xfs-415dc03d/yarn
Additional context
Doesn't work in turborepo either. Would be nice if it did.
Here's my use case:
We have a large project with a lot of workspace packages.
We have a UI library that is published to codeartifacts. It is used in many of those packages but is allowed to lag behind in versions so upgrading to it can be done more incrementally.
However, sometimes typechecking issues force us to upgrade it for all packages.
But we can't reference a version that isn't published yet, so it'd be nice to be able to make the catolog version be workspace:* temporarily so we can create and use the fix in the same PR.
It'd be nice if yarn knew that this means it needs to build the dependency if it resolves to workspace:*, so we don't need to special case this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior using .yarnrc.yml, myPackage/package.json, and the yarn workspaces foreach command shown in the issue. Start by tracing how topological-dev resolves catalog: dependencies and workspace:* references. Done means myDep is built before myPackage when the dependency resolves to workspace:*.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100