Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 635b5ca

Browse files
authored
Exposes packages to constraints (#5555)
**What's the problem this PR addresses?** Constraints can only operate on the workspaces' listed dependencies, but have no idea about the shape of the global dependency tree. In general it's enough, but I wanted to write a constraint autofixing missing peer dependencies, and this wasn't possible without knowing the dependencies of our dependencies. **How did you fix it?** I added a concept of "package" to the constraint API. Some of their characteristics: - They are based on the resolved dependency tree; as a result, there is no direct concept of devDependency / dependency (just like in the core `Package` type). - They somewhat look like the `Package` type, but with fewer information (just the dependencies & peer dependencies, at the moment), and with a slightly different format (no need for serialization, so it directly references other data structure rather than go through string hashes). - They don't provide any autofix (or even reporting) capability at the moment. Perhaps later I'll add an `error` API, like regular dependencies, but that'll probably require to enhance them so they are able to access the packages' filesystems, so it'll have to be a follow-up. Testing is currently lacking ... like the rest of the JS constraints engine 😶‍🌫️ **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
1 parent 1031f31 commit 635b5ca

File tree

16 files changed

+418
-199
lines changed

16 files changed

+418
-199
lines changed

‎.pnp.cjs‎

Lines changed: 8 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.yarn/versions/d431919c.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
releases:
2+
"@yarnpkg/cli": major
3+
"@yarnpkg/plugin-constraints": major
4+
"@yarnpkg/types": major
5+
6+
declined:
7+
- "@yarnpkg/eslint-config"
8+
- "@yarnpkg/plugin-compat"
9+
- "@yarnpkg/plugin-dlx"
10+
- "@yarnpkg/plugin-essentials"
11+
- "@yarnpkg/plugin-init"
12+
- "@yarnpkg/plugin-interactive-tools"
13+
- "@yarnpkg/plugin-nm"
14+
- "@yarnpkg/plugin-npm-cli"
15+
- "@yarnpkg/plugin-pack"
16+
- "@yarnpkg/plugin-patch"
17+
- "@yarnpkg/plugin-pnp"
18+
- "@yarnpkg/plugin-pnpm"
19+
- "@yarnpkg/plugin-stage"
20+
- "@yarnpkg/plugin-typescript"
21+
- "@yarnpkg/plugin-version"
22+
- "@yarnpkg/plugin-workspace-tools"
23+
- "@yarnpkg/builder"
24+
- "@yarnpkg/core"
25+
- "@yarnpkg/doctor"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /