Files
pnpm/package.json
Zoltan Kochan 98a126699c fix: resolve peer of peer from the deps of direct dependent package (#7606)
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`.
2024-02-09 00:50:08 +01:00

169 lines
5.5 KiB
JSON

{
"name": "monorepo-root",
"private": true,
"scripts": {
"bump": "changeset version && pnpm update-manifests",
"changeset": "changeset",
"preinstall": "npx only-allow pnpm",
"prepare": "husky install",
"pretest": "pnpm run compile-only && pnpm --dir=__fixtures__ run prepareFixtures",
"lint": "pnpm run spellcheck && pnpm lint:meta && syncpack list-mismatches --workspace false && pnpm run lint:ts",
"spellcheck": "cspell \"**/*.ts\" \"**/README.md\" \".changeset/*.md\" --no-progress",
"lint:ts": "eslint \"**/src/**/*.ts\" \"**/test/**/*.ts\"",
"test-main": "pnpm pretest && pnpm lint --quiet && pnpm run test-pkgs-main",
"remove-temp-dir": "shx rm -rf ../pnpm_tmp",
"test-pkgs-main": "pnpm remove-temp-dir && pnpm run --no-sort --workspace-concurrency=1 -r _test",
"test-branch": "pnpm pretest && pnpm lint --quiet && git remote set-branches --add origin main && git fetch && pnpm run test-pkgs-branch",
"test-pkgs-branch": "pnpm remove-temp-dir && pnpm --workspace-concurrency=1 --filter=...[origin/main] run --no-sort _test",
"compile-only": "pnpm --workspace-concurrency=1 --filter=pnpm --filter=@pnpm/make-dedicated-lockfile --filter=@pnpm/mount-modules run compile",
"compile": "pnpm compile-only && pnpm run update-manifests",
"watch": "pnpm --filter=@pnpm/fetch run compile && pnpm --filter=pnpm run compile --watch",
"make-lcov": "shx mkdir -p coverage && lcov-result-merger './packages/*/coverage/lcov.info' 'coverage/lcov.info'",
"update-manifests": "pnpm run meta-updater && pnpm install",
"meta-updater": "pnpm --filter=@pnpm-private/updater compile && pnpm --config.use-node-version=16.4.0 exec meta-updater",
"lint:meta": "pnpm run meta-updater --test",
"copy-artifacts": "ts-node __utils__/scripts/src/copy-artifacts.ts",
"make-release-description": "pnpm --filter=@pnpm/get-release-text run write-release-text",
"release": "pnpm --filter=@pnpm/exe publish --tag=next-9 --access=public && pnpm publish --filter=!pnpm --filter=!@pnpm/exe --access=public && pnpm publish --filter=pnpm --tag=next-9 --access=public",
"dev-setup": "pnpm -C=./pnpm/dev link -g"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/plugin-proposal-dynamic-import": "^7.18.6",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/types": "^7.23.3",
"@changesets/cli": "^2.26.2",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@commitlint/prompt-cli": "^17.8.1",
"@pnpm/eslint-config": "workspace:*",
"@pnpm/meta-updater": "1.0.0",
"@pnpm/registry-mock": "3.25.0",
"@pnpm/tsconfig": "workspace:*",
"@pnpm/worker": "workspace:*",
"@types/jest": "^29.5.8",
"@types/node": "^18.14.6",
"c8": "^7.14.0",
"concurrently": "8.2.1",
"cross-env": "^7.0.3",
"cspell": "7.3.8",
"eslint": "^8.56.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"keyv": "4.5.4",
"lcov-result-merger": "^3.3.0",
"publish-packed": "^4.1.2",
"rimraf": "^3.0.2",
"shx": "^0.3.4",
"syncpack": "^8.5.14",
"ts-jest": "29.1.1",
"ts-node": "^10.9.2",
"typescript": "5.3.3",
"verdaccio": "5.20.1"
},
"engines": {
"pnpm": ">=9"
},
"packageManager": "pnpm@9.0.0-alpha.1",
"pnpm": {
"overrides": {
"clipanion": "3.2.0-rc.6",
"debug@<3.1.0": ">=3.1.0",
"glob-parent@<5.1.2": ">=5.1.2",
"hosted-git-info@1": "npm:@pnpm/hosted-git-info@1.0.0",
"istanbul-reports": "npm:@zkochan/istanbul-reports",
"js-yaml@^4.0.0": "npm:@zkochan/js-yaml@0.0.6",
"json5@<2.2.2": ">=2.2.2",
"jsonwebtoken@<=8.5.1": ">=9.0.0",
"nopt@5": "npm:@pnpm/nopt@^0.2.1",
"verdaccio": "5.20.1",
"yaml@<2.2.2": ">=2.2.2",
"semver@<7.5.2": ">=7.5.2",
"tough-cookie@<4.1.3": ">=4.1.3"
},
"packageExtensions": {
"@babel/parser": {
"peerDependencies": {
"@babel/types": "*"
}
},
"jest-circus": {
"dependencies": {
"slash": "3"
}
},
"remark-stringify": {
"peerDependencies": {
"unified": "*"
}
},
"remark-parse": {
"peerDependencies": {
"unified": "*"
}
}
},
"neverBuiltDependencies": [
"core-js",
"level"
],
"peerDependencyRules": {
"allowedVersions": {
"eslint": "*"
},
"ignoreMissing": []
},
"patchedDependencies": {
"pkg@5.8.1": "__patches__/pkg.patch",
"graceful-fs@4.2.11": "__patches__/graceful-fs@4.2.11.patch"
},
"updateConfig": {
"ignoreDependencies": [
"boxen",
"camelcase",
"camelcase-keys",
"chalk",
"detect-indent",
"escape-string-regexp",
"filenamify",
"find-up",
"get-port",
"is-port-reachable",
"load-json-file",
"mem",
"npm-packlist",
"node-fetch",
"normalize-newline",
"p-any",
"p-defer",
"p-filter",
"p-limit",
"p-memoize",
"p-queue",
"p-settle",
"parse-json",
"path-exists",
"pretty-bytes",
"pretty-ms",
"process-exists",
"ps-list",
"sort-keys",
"string-length",
"strip-ansi",
"strip-bom",
"tempy",
"unique-string",
"wrap-ansi",
"write-json-file",
"write-pkg"
]
},
"auditConfig": {
"ignoreCves": [
"CVE-2023-28155"
]
}
}
}