* feat: create new @pnpm/catalogs.types package (#8026)
* feat: read catalog configs from workspace manifest (#8123)
* refactor: move InvalidWorkspaceManifestError to its own file
* feat: read catalogs config from workspace manifest
* chore: add changeset for new catalog config parsing
* feat: create new `@pnpm/catalogs.protocol-parser` package (#8124)
This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.
https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304
* refactor: factor out isWantedDepPrefSame to extend in a future commit (#8125)
* feat: create new `@pnpm/catalogs.config` package (#8220)
* refactor: remove single default catalog check
This check will happen in `@pnpm/catalogs.config` instead.
* feat: create new @pnpm/catalogs.config package
* fix: work around CI setup not compiling orphan packages before testing
This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.
https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304
* feat: create new `@pnpm/catalogs.resolver` package (#8219)
* feat: create new @pnpm/catalogs.resolver package
* fix: work around CI setup not compiling orphan packages before testing
This works around a problem with pnpm's CI setup not compiling
packages that are not dependencies of the main pnpm package before
running these tests.
https://github.com/pnpm/pnpm/pull/8027#issuecomment-2081650304
* feat: implement catalog protocol for publish (#8225)
* feat: implement catalog protocol for install (#8221)
* feat: add catalogs to @pnpm/config
* refactor: factor out resolveDependenciesOfImporterDependency function
* feat: implement catalog resolver and replace prefs
* revert: work around CI setup not compiling orphan packages before testing
* feat: record catalog lookup snapshots through propagated metadata
* feat: update projects when catalogs config changes
* test: add catalog protocol install tests
* refactor: remove filter-packages-from-dir dependency from core tests (#8244)
* refactor: remove filter-packages-from-dir dependency from core tests
* test: refactor
* test: refactor
---------
Co-authored-by: Zoltan Kochan <z@kochan.io>
---------
Co-authored-by: Zoltan Kochan <z@kochan.io>
* refactor: store link values before converting to references
* fix: use .sort() without localeCompare
https://github.com/pnpm/pnpm/pull/8128#discussion_r1614031566
> Nit, but you probably just want to call sort without a comparison
> function; these are already strings and locale compare is not a good
> comparison for anything but human readable strings since it will
> differ on different people's machines based on their language setting.
> I've hit this too many times before for code gen.
* feat: configure meta-updater to write test/tsconfig.json files
* fix: relative imports for __typings__
* chore: `pnpm run meta-updater`
* fix: explicitly use test/tsconfig.json for ts-jest
close#7444
Peer dependencies of peer dependencies are now resolved correctly. When peer dependencies have peer dependencies of their own, the peer dependencies are grouped with their own peer dependencies before being linked to their dependents.
For instance, if `card` has `react` in peer dependencies and `react` has `typescript` in its peer dependencies, then the same version of `react` may be linked from different places if there are multiple versions of `typescript`. For instance:
```
project1/package.json
{
"dependencies": {
"card": "1.0.0",
"react": "16.8.0",
"typescript": "7.0.0"
}
}
project2/package.json
{
"dependencies": {
"card": "1.0.0",
"react": "16.8.0",
"typescript": "8.0.0"
}
}
node_modules
.pnpm
card@1.0.0(react@16.8.0(typescript@7.0.0))
node_modules
card
react --> ../../react@16.8.0(typescript@7.0.0)/node_modules/react
react@16.8.0(typescript@7.0.0)
node_modules
react
typescript --> ../../typescript@7.0.0/node_modules/typescript
typescript@7.0.0
node_modules
typescript
card@1.0.0(react@16.8.0(typescript@8.0.0))
node_modules
card
react --> ../../react@16.8.0(typescript@8.0.0)/node_modules/react
react@16.8.0(typescript@8.0.0)
node_modules
react
typescript --> ../../typescript@8.0.0/node_modules/typescript
typescript@8.0.0
node_modules
typescript
```
In the above example, both projects have `card` in dependencies but the projects use different versions of `typescript`. Hence, even though the same version of `card` is used, `card` in `project1` will reference `react` from a directory where it is placed with `typescript@7.0.0` (because it resolves `typescript` from the dependencies of `project1`), while `card` in `project2` will reference `react` with `typescript@8.0.0`.