Skip to content

Repo: "*" should not be used which maybe broken with yarn-berry-deduplicate #11266

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

Open
JounQin opened this issue Jun 1, 2025 · 4 comments
Open
Labels
repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look

Comments

@JounQin
Copy link
Contributor

JounQin commented Jun 1, 2025

Suggestion

https://github.com/search?q=repo%3Atypescript-eslint%2Ftypescript-eslint+%2F%3A+%5C%22%5C*%5C%22%2F+path%3A**%2Fpackage.json&type=code

related #11216

"make-dir": "*" currently installs 5.0.0, but there is also a make-dir@npm:^4.0.0 installed by istanbul-lib-report -> istanbul-reports -> @vitest/coverage-v8, so with yarn-berry-deduplicate, "make-dir": "*" will be narrowed into make-dir@npm:^4.0.0 which is unexpected for website package actually.

Additional Info

No response

@JounQin JounQin added triage Waiting for team members to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs labels Jun 1, 2025
@bradzacher
Copy link
Member

bradzacher commented Jun 1, 2025

The intent behind "*" was for us to avoid accidentally declaring multiple versions in multiple packages. We had a few issues with this where we'd bump a semver range in one package and due to lockfile pinning the other package didn't get the new version and we'd have multiple versions in our repo until we deleted the lockfile or ran yarn-deduplicate.

We would declare one version in the root and then use * in the packages and then the package managers pick the root version to satisfy both.

Pnpm has catalogs to solve this -- https://pnpm.io/catalogs -- so we'd just be able to do eg "make-dir": "catalog:" and it'd use the shared root version.

But it looks like yarn2 doesn't have a catalogs feature -- yarnpkg/berry#6400

@JounQin
Copy link
Contributor Author

JounQin commented Jun 1, 2025

@bradzacher https://github.com/toss/yarn-plugin-catalogs can be used in this case?

We would declare one version in the root and then use * in the packages and then the package managers pick the root version to satisfy both.

makr-dir is not declared in the root package.json?

@bradzacher
Copy link
Member

It would have been declared in the root at one point! But we removed it at some point.

That was the danger with this style. Really no matter what you did you had danger of out-of-sync deps.

We could use that plugin if it supports the same syntax as pnpm! That would be hugely valuable!

@JounQin
Copy link
Contributor Author

JounQin commented Jun 1, 2025

@bradzacher Should I raise two PRs or one which uses yarn-plugin-catalogs instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repo maintenance things to do with maintenance of the repo, and not with code/docs triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

2 participants