* 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`.