From ddb179743febfddb621024927516754a9ab41da1 Mon Sep 17 00:00:00 2001 From: zxfan Date: Wed, 20 Nov 2024 13:26:16 +0800 Subject: [PATCH] Support pnpm v9 --- ...ature-support_pnpmv9_2024-11-19-08-24.json | 10 + .../rush/browser-approved-packages.json | 4 + .../build-tests-subspace/pnpm-lock.yaml | 424 +++++++++++++++++- .../build-tests-subspace/repo-state.json | 4 +- .../config/subspaces/default/pnpm-lock.yaml | 46 ++ .../config/subspaces/default/repo-state.json | 2 +- libraries/rush-lib/package.json | 2 + .../pnpm/PnpmShrinkWrapFileConverters.ts | 95 ++++ .../src/logic/pnpm/PnpmShrinkwrapFile.ts | 270 ++++++----- .../test/PnpmShrinkwrapConverters.test.ts | 41 ++ .../pnpm/test/PnpmShrinkwrapFile.test.ts | 153 ++++++- .../pnpm-lock-v9/inconsistent-dep-devDep.yaml | 26 ++ .../test/yamlFiles/pnpm-lock-v9/modified.yaml | 35 ++ .../yamlFiles/pnpm-lock-v9/not-modified.yaml | 35 ++ .../pnpm-lock-v9/overrides-not-modified.yaml | 38 ++ .../yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml | 39 ++ .../src/logic/test/ShrinkwrapFile.test.ts | 62 ++- .../__snapshots__/ShrinkwrapFile.test.ts.snap | 50 +++ .../non-workspace-pnpm-lock-v9.yaml | 196 ++++++++ .../workspace-pnpm-lock-v9.yaml | 83 ++++ libraries/rush-sdk/package.json | 1 + 21 files changed, 1494 insertions(+), 122 deletions(-) create mode 100644 common/changes/@microsoft/rush/feature-support_pnpmv9_2024-11-19-08-24.json create mode 100644 libraries/rush-lib/src/logic/pnpm/PnpmShrinkWrapFileConverters.ts create mode 100644 libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapConverters.test.ts create mode 100644 libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/inconsistent-dep-devDep.yaml create mode 100644 libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/modified.yaml create mode 100644 libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/not-modified.yaml create mode 100644 libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/overrides-not-modified.yaml create mode 100644 libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml create mode 100644 libraries/rush-lib/src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml create mode 100644 libraries/rush-lib/src/logic/test/shrinkwrapFile/workspace-pnpm-lock-v9.yaml diff --git a/common/changes/@microsoft/rush/feature-support_pnpmv9_2024-11-19-08-24.json b/common/changes/@microsoft/rush/feature-support_pnpmv9_2024-11-19-08-24.json new file mode 100644 index 00000000000..436d627374e --- /dev/null +++ b/common/changes/@microsoft/rush/feature-support_pnpmv9_2024-11-19-08-24.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "Support pnpm lockfile v9", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/config/rush/browser-approved-packages.json b/common/config/rush/browser-approved-packages.json index 64c497e90f4..f98662233c6 100644 --- a/common/config/rush/browser-approved-packages.json +++ b/common/config/rush/browser-approved-packages.json @@ -18,6 +18,10 @@ "name": "@microsoft/rush-sdk", "allowedCategories": [ "tests" ] }, + { + "name": "@pnpm/lockfile.types", + "allowedCategories": [ "libraries" ] + }, { "name": "@radix-ui/colors", "allowedCategories": [ "libraries" ] diff --git a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml index 32c196d54a4..8288dc95e27 100644 --- a/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml +++ b/common/config/subspaces/build-tests-subspace/pnpm-lock.yaml @@ -877,6 +877,19 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + /@pnpm/constants@9.0.0: + resolution: {integrity: sha512-cyZ12A7j1BzeQ9nr5HBdlSLxN1VWnCG/1xjdgDUL/WDlgmVa3k6TI2CktTHjR5w/rWbKudpIaMAmJJk9w+cTRQ==} + engines: {node: '>=18.12'} + + /@pnpm/core-loggers@10.0.7(@pnpm/logger@5.1.0): + resolution: {integrity: sha512-evM0PRk8Wz8pUQ+kSDgepLEA2Pm1jYMSiy7grjTiCx+8y89K8lMaycAemZk9BfZTr0m+/rBlwUZliDIEKWuisA==} + engines: {node: '>=18.12'} + peerDependencies: + '@pnpm/logger': ^5.1.0 + dependencies: + '@pnpm/logger': 5.1.0 + '@pnpm/types': 12.2.0 + /@pnpm/crypto.base32-hash@1.0.1: resolution: {integrity: sha512-pzAXNn6KxTA3kbcI3iEnYs4vtH51XEVqmK/1EiD18MaPKylhqy8UvMJK3zKG+jeP82cqQbozcTGm4yOQ8i3vNw==} engines: {node: '>=14.6'} @@ -889,6 +902,17 @@ packages: dependencies: rfc4648: 1.5.3 + /@pnpm/crypto.base32-hash@3.0.1: + resolution: {integrity: sha512-DM4RR/tvB7tMb2FekL0Q97A5PCXNyEC+6ht8SaufAUFSJNxeozqHw9PHTZR03mzjziPzNQLOld0pNINBX3srtw==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/crypto.polyfill': 1.0.0 + rfc4648: 1.5.3 + + /@pnpm/crypto.polyfill@1.0.0: + resolution: {integrity: sha512-WbmsqqcUXKKaAF77ox1TQbpZiaQcr26myuMUu+WjUtoWYgD3VP6iKYEvSx35SZ6G2L316lu+pv+40A2GbWJc1w==} + engines: {node: '>=18.12'} + /@pnpm/dependency-path@2.1.8: resolution: {integrity: sha512-ywBaTjy0iSEF7lH3DlF8UXrdL2bw4AQFV2tTOeNeY7wc1W5CE+RHSJhf9MXBYcZPesqGRrPiU7Pimj3l05L9VA==} engines: {node: '>=16.14'} @@ -898,10 +922,76 @@ packages: encode-registry: 3.0.1 semver: 7.5.4 + /@pnpm/dependency-path@5.1.7: + resolution: {integrity: sha512-MKCyaTy1r9fhBXAnhDZNBVgo6ThPnicwJEG203FDp7pGhD7NruS/FhBI+uMd7GNsK3D7aIFCDAgbWpNTXn/eWw==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/crypto.base32-hash': 3.0.1 + '@pnpm/types': 12.2.0 + semver: 7.6.2 + /@pnpm/error@1.4.0: resolution: {integrity: sha512-vxkRrkneBPVmP23kyjnYwVOtipwlSl6UfL+h+Xa3TrABJTz5rYBXemlTsU5BzST8U4pD7YDkTb3SQu+MMuIDKA==} engines: {node: '>=10.16'} + /@pnpm/error@6.0.2: + resolution: {integrity: sha512-3/wWJYjUyO9ToLaZpBASYIBg87C4DBZ8yfzrt0cSCTbRFDBUNdH0dzwfVKEqhR7A9tpRMyeoRIzPUVxWc+U+RQ==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/constants': 9.0.0 + + /@pnpm/fetch@8.0.7(@pnpm/logger@5.1.0): + resolution: {integrity: sha512-tOAO29OtslESua6vWNClSZ3ITKmrWxG0PqsGG4Xd5rDggxB3tppgRqdB0oj9tnQhJHcqU1uhM6sCBKKwxmTS+A==} + engines: {node: '>=18.12'} + peerDependencies: + '@pnpm/logger': ^5.1.0 + dependencies: + '@pnpm/core-loggers': 10.0.7(@pnpm/logger@5.1.0) + '@pnpm/fetching-types': 6.0.0 + '@pnpm/logger': 5.1.0 + '@pnpm/network.agent': 2.0.0 + '@pnpm/types': 12.2.0 + '@zkochan/retry': 0.2.0 + node-fetch: /@pnpm/node-fetch@1.0.0 + transitivePeerDependencies: + - domexception + - supports-color + + /@pnpm/fetching-types@6.0.0: + resolution: {integrity: sha512-fnsaegb+0q7Ku6AyCmoVtBeCuO8ytB7YMEaGHC+0MGoRsxxa6EVLgi2H4abKr8LLslf5tHJBnOH24DjST3UNfQ==} + engines: {node: '>=18.12'} + dependencies: + '@zkochan/retry': 0.2.0 + node-fetch: /@pnpm/node-fetch@1.0.0 + transitivePeerDependencies: + - domexception + + /@pnpm/git-resolver@9.0.8(@pnpm/logger@5.1.0): + resolution: {integrity: sha512-KfWze6PlvUEm1m9QDCALMrYkFCpyLhEV2AXBA1f8dizuyJaqOZTjaryi0jXnUVzhfSpLTLKwRaCTFU70QUrYwQ==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/fetch': 8.0.7(@pnpm/logger@5.1.0) + '@pnpm/resolver-base': 13.0.4 + graceful-git: 4.0.0 + hosted-git-info: /@pnpm/hosted-git-info@1.0.0 + semver: 7.6.2 + transitivePeerDependencies: + - '@pnpm/logger' + - domexception + - supports-color + + /@pnpm/git-utils@2.0.0: + resolution: {integrity: sha512-k1rv4Zvno/5zJAqE/Mh9V0ehlm14NsYwpXTdaGMtyhkoHvlSckRfr23OIOIM7Q/TRX+LhqyJ2kep50SY2TsZ+g==} + engines: {node: '>=18.12'} + dependencies: + execa: /safe-execa@0.1.2 + + /@pnpm/hosted-git-info@1.0.0: + resolution: {integrity: sha512-QzmNiLShTnNyeTHr+cykG5hYjwph0+v49KHV36Dh8uA2rRMWw30qoZMARuxd00SYdoTwT8bIouqqmzi6TWfJHQ==} + engines: {node: '>=10'} + dependencies: + lru-cache: 6.0.0 + /@pnpm/link-bins@5.3.25: resolution: {integrity: sha512-9Xq8lLNRHFDqvYPXPgaiKkZ4rtdsm7izwM/cUsFDc5IMnG0QYIVBXQbgwhz2UvjUotbJrvfKLJaCfA3NGBnLDg==} engines: {node: '>=10.16'} @@ -920,6 +1010,110 @@ packages: p-settle: 4.1.1 ramda: 0.27.2 + /@pnpm/lockfile.fs@1.1.0(@pnpm/logger@5.1.0): + resolution: {integrity: sha512-uhHE1CNIidFSrHUGqJ0fXcY56ECr9np9SIhVFrFe0DlR6gEtRadLqakcTzklTTvwRGalqgs62ZtqX2SBRaVeqA==} + engines: {node: '>=18.12'} + peerDependencies: + '@pnpm/logger': ^5.1.0 + dependencies: + '@pnpm/constants': 9.0.0 + '@pnpm/dependency-path': 5.1.7 + '@pnpm/error': 6.0.2 + '@pnpm/git-resolver': 9.0.8(@pnpm/logger@5.1.0) + '@pnpm/git-utils': 2.0.0 + '@pnpm/lockfile.merger': 1.0.3 + '@pnpm/lockfile.types': 1.0.3 + '@pnpm/lockfile.utils': 1.0.4 + '@pnpm/logger': 5.1.0 + '@pnpm/types': 12.2.0 + '@pnpm/util.lex-comparator': 3.0.0 + '@zkochan/rimraf': 3.0.2 + comver-to-semver: 1.0.0 + js-yaml: /@zkochan/js-yaml@0.0.7 + normalize-path: 3.0.0 + ramda: /@pnpm/ramda@0.28.1 + semver: 7.6.2 + sort-keys: 4.2.0 + strip-bom: 4.0.0 + write-file-atomic: 5.0.1 + transitivePeerDependencies: + - domexception + - supports-color + + /@pnpm/lockfile.merger@1.0.3: + resolution: {integrity: sha512-8Gl8zr5BNS7OLSXANFr5R74w87AlwhjrlWBh7sumoyFrkiLaxwg0/wsVd55fEL9LxQpD9nFy4+T2plffnacxJg==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/lockfile.types': 1.0.3 + '@pnpm/types': 12.2.0 + comver-to-semver: 1.0.0 + ramda: /@pnpm/ramda@0.28.1 + semver: 7.6.2 + + /@pnpm/lockfile.types@1.0.3: + resolution: {integrity: sha512-A7vUWktnhDkrIs+WmXm7AdffJVyVYJpQUEouya/DYhB+Y+tQ3BXjZ6CV0KybqLgI/8AZErgCJqFxA0GJH6QDjA==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/patching.types': 1.0.0 + '@pnpm/types': 12.2.0 + + /@pnpm/lockfile.utils@1.0.4: + resolution: {integrity: sha512-ptHO2muziYyNCwpsuaPtaRgKiHMrE/lkGI4nqbHnRWWgfdJbTeL1tq+b/EUsxjlKlJ/a9Q4z2C+t38g+9bhTJg==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/dependency-path': 5.1.7 + '@pnpm/lockfile.types': 1.0.3 + '@pnpm/pick-fetcher': 3.0.0 + '@pnpm/resolver-base': 13.0.4 + '@pnpm/types': 12.2.0 + get-npm-tarball-url: 2.1.0 + ramda: /@pnpm/ramda@0.28.1 + + /@pnpm/logger@5.1.0: + resolution: {integrity: sha512-qNk+4uMTLKIVfpZLvT8T5ptGHjNLLaCz9mu4y1+vqYnJVECBWDckh+ToEX22vzaGvl6oUg4x/T2pf3NGv6e8fQ==} + engines: {node: '>=12.17'} + dependencies: + bole: 5.0.17 + ndjson: 2.0.0 + + /@pnpm/network.agent@2.0.0: + resolution: {integrity: sha512-CqONDs5W6vaAdgQEHyFSr4vj25Pv8eVzwI+oUvId/FBHOcTCgHndLIJGON39JnyQS40+yT9kpEj21la3rcJK2w==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/network.config': 2.0.0 + '@pnpm/network.proxy-agent': 2.0.0 + agentkeepalive: 4.2.1 + lru-cache: 7.10.1 + transitivePeerDependencies: + - supports-color + + /@pnpm/network.config@2.0.0: + resolution: {integrity: sha512-DpTQTz4KBUgR0NNo/+/WXFlE4dy4+vgINhR9Eb+qo/Kb9RzGbhTN0ypv3sRYa6YG4UO5ft47rvEtHJ9i6VBwzA==} + engines: {node: '>=18.12'} + dependencies: + nerf-dart: 1.0.0 + + /@pnpm/network.proxy-agent@2.0.0: + resolution: {integrity: sha512-gCShibUggQS1vveAzr84PhDvwoChR4HrHHdvTB8CqXHQu12eoXO8R01awalZWERrHL3fDkUQcqLqCospm2O/QQ==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/error': 6.0.2 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + lru-cache: 7.10.1 + socks-proxy-agent: 6.1.1 + transitivePeerDependencies: + - supports-color + + /@pnpm/node-fetch@1.0.0: + resolution: {integrity: sha512-eYwrzhKUBGFdq78rJStGjaHTUHA2VH+Avr//CVx/T+EJkI7hnFmOy6YghvcB2clj8HpO4V8tXRNuFNfRX08ayw==} + engines: {node: ^10.17 || >=12.3} + dependencies: + data-uri-to-buffer: 3.0.1 + fetch-blob: 2.1.2 + transitivePeerDependencies: + - domexception + /@pnpm/package-bins@4.1.0: resolution: {integrity: sha512-57/ioGYLBbVRR80Ux9/q2i3y8Q+uQADc3c+Yse8jr/60YLOi3jcWz13e2Jy+ANYtZI258Qc5wk2X077rp0Ly/Q==} engines: {node: '>=10.16'} @@ -928,6 +1122,17 @@ packages: fast-glob: 3.3.2 is-subdir: 1.2.0 + /@pnpm/patching.types@1.0.0: + resolution: {integrity: sha512-juCdQCC1USqLcOhVPl1tYReoTO9YH4fTullMnFXXcmpsDM7Dkn3tzuOQKC3oPoJ2ozv+0EeWWMtMGqn2+IM3pQ==} + engines: {node: '>=18.12'} + + /@pnpm/pick-fetcher@3.0.0: + resolution: {integrity: sha512-2eisylRAU/jeuxFEPnS1gjLZKJGbYc4QEtEW6MVUYjO4Xi+2ttkSm7825S0J5IPpUIvln8HYPCUS0eQWSfpOaQ==} + engines: {node: '>=18.12'} + + /@pnpm/ramda@0.28.1: + resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} + /@pnpm/read-modules-dir@2.0.3: resolution: {integrity: sha512-i9OgRvSlxrTS9a2oXokhDxvQzDtfqtsooJ9jaGoHkznue5aFCTSrNZFQ6M18o8hC03QWfnxaKi0BtOvNkKu2+A==} engines: {node: '>=10.13'} @@ -960,6 +1165,16 @@ packages: sort-keys: 4.2.0 strip-bom: 4.0.0 + /@pnpm/resolver-base@13.0.4: + resolution: {integrity: sha512-d6GtsaXDN1VmVdeB6ohrhwGwQfvYpEX/XkBZyRT0Hp772WabWVfaulvicwdh/8o7Rpzy7IV/2hKnDpodUY00lw==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/types': 12.2.0 + + /@pnpm/types@12.2.0: + resolution: {integrity: sha512-5RtwWhX39j89/Tmyv2QSlpiNjErA357T/8r1Dkg+2lD3P7RuS7Xi2tChvmOC3VlezEFNcWnEGCOeKoGRkDuqFA==} + engines: {node: '>=18.12'} + /@pnpm/types@6.4.0: resolution: {integrity: sha512-nco4+4sZqNHn60Y4VE/fbtlShCBqipyUO+nKRPvDHqLrecMW9pzHWMVRxk4nrMRoeowj3q0rX3GYRBa8lsHTAg==} engines: {node: '>=10.16'} @@ -972,6 +1187,10 @@ packages: resolution: {integrity: sha512-g1hcF8Nv4gd76POilz9gD4LITAPXOe5nX4ijgr8ixCbLQZfcpYiMfJ+C1RlMNRUDo8vhlNB4O3bUlxmT6EAQXA==} engines: {node: '>=16.14'} + /@pnpm/util.lex-comparator@3.0.0: + resolution: {integrity: sha512-ead+l3IiuVXwKDf/QJPX6G93cwhXki3yOVEA/VdAO7AhZ5vUuSBxHe6gQKEbB0QacJ4H5VsYxeM1xUgwjjOO/Q==} + engines: {node: '>=18.12'} + /@pnpm/write-project-manifest@1.1.7: resolution: {integrity: sha512-OLkDZSqkA1mkoPNPvLFXyI6fb0enCuFji6Zfditi/CLAo9kmIhQFmEUDu4krSB8i908EljG8YwL5Xjxzm5wsWA==} engines: {node: '>=10.16'} @@ -1008,6 +1227,10 @@ packages: dependencies: defer-to-connect: 2.0.1 + /@tootallnate/once@2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + /@types/argparse@1.0.38: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} @@ -1548,6 +1771,27 @@ packages: graceful-fs: 4.2.11 is-windows: 1.0.2 + /@zkochan/js-yaml@0.0.7: + resolution: {integrity: sha512-nrUSn7hzt7J6JWgWGz78ZYI8wj+gdIJdk0Ynjpp8l+trkn58Uqsf6RYrYkEK+3X18EX+TNdtJI0WxAtc+L84SQ==} + hasBin: true + dependencies: + argparse: 2.0.1 + + /@zkochan/retry@0.2.0: + resolution: {integrity: sha512-WhB+2B/ZPlW2Xy/kMJBrMbqecWXcbDDgn0K0wKBAgO2OlBTz1iLJrRWduo+DGGn0Akvz1Lu4Xvls7dJojximWw==} + engines: {node: '>=10'} + + /@zkochan/rimraf@3.0.2: + resolution: {integrity: sha512-GBf4ua7ogWTr7fATnzk/JLowZDBnBJMm8RkMaC/KcvxZ9gxbMWix0/jImd815LmqKyIHZ7h7lADRddGMdGBuCA==} + engines: {node: '>=18.12'} + + /@zkochan/which@2.0.3: + resolution: {integrity: sha512-C1ReN7vt2/2O0fyTsx5xnbQuxBrmG5NMSbcIkPKCCfCTJgpZBsuRYzFXHj3nVq8vTfK7vxHUmzfCpSHgO7j4rg==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1570,6 +1814,16 @@ packages: transitivePeerDependencies: - supports-color + /agentkeepalive@4.2.1: + resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==} + engines: {node: '>= 8.0.0'} + dependencies: + debug: 4.3.4 + depd: 1.1.2 + humanize-ms: 1.2.1 + transitivePeerDependencies: + - supports-color + /ajv-draft-04@1.0.0(ajv@8.13.0): resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} peerDependencies: @@ -1851,6 +2105,12 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 + /bole@5.0.17: + resolution: {integrity: sha512-q6F82qEcUQTP178ZEY4WI1zdVzxy+fOnSF1dOMyC16u1fc0c24YrDPbgxA6N5wGHayCUdSBWsF8Oy7r2AKtQdA==} + dependencies: + fast-safe-stringify: 2.1.1 + individual: 3.0.0 + /boxen@5.1.2: resolution: {integrity: sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==} engines: {node: '>=10'} @@ -2116,6 +2376,10 @@ packages: engines: {node: '>= 12.0.0'} dev: true + /comver-to-semver@1.0.0: + resolution: {integrity: sha512-gcGtbRxjwROQOdXLUWH1fQAXqThUVRZ219aAwgtX3KfYw429/Zv6EIJRf5TBSzWdAGwePmqH7w70WTaX4MDqag==} + engines: {node: '>=12.17'} + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -2159,6 +2423,10 @@ packages: resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} engines: {node: '>=8'} + /data-uri-to-buffer@3.0.1: + resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} + engines: {node: '>= 6'} + /data-view-buffer@1.0.1: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} @@ -2314,6 +2582,10 @@ packages: transitivePeerDependencies: - supports-color + /depd@1.1.2: + resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} + engines: {node: '>= 0.6'} + /dependency-path@9.2.8: resolution: {integrity: sha512-S0OhIK7sIyAsph8hVH/LMCTDL3jozKtlrPx3dMQrlE2nAlXTquTT+AcOufphDMTQqLkfn4acvfiem9I1IWZ4jQ==} engines: {node: '>=14.6'} @@ -2851,6 +3123,9 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + /fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} dependencies: @@ -2862,6 +3137,15 @@ packages: bser: 2.1.1 dev: true + /fetch-blob@2.1.2: + resolution: {integrity: sha512-YKqtUDwqLyfyMnmbw8XD6Q8j9i/HggKtPEI+pZ1+8bvheBu78biSmNaXWusx1TauGqtUUGx/cBb1mKdq2rLYow==} + engines: {node: ^10.17.0 || >=12.3.0} + peerDependencies: + domexception: '*' + peerDependenciesMeta: + domexception: + optional: true + /figures@3.0.0: resolution: {integrity: sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==} engines: {node: '>=8'} @@ -2999,6 +3283,10 @@ packages: hasown: 2.0.2 dev: true + /get-npm-tarball-url@2.1.0: + resolution: {integrity: sha512-ro+DiMu5DXgRBabqXupW38h7WPZ9+Ad8UjwhvsmmN8w1sU7ab0nzAXvVZ4kqYg57OrqomRtJvepX5/xvFKNtjA==} + engines: {node: '>=12.17'} + /get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -3158,6 +3446,13 @@ packages: /graceful-fs@4.2.4: resolution: {integrity: sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==} + /graceful-git@4.0.0: + resolution: {integrity: sha512-zK/rCH/I0DMKpPBLCElXGI7za3EnXeQFdiK6CTP02Tt1N1L+bMLghZY7cXozlx9M2bx4Q0zrY9ADYP3eI8haIw==} + engines: {node: '>=18.12'} + dependencies: + retry: 0.13.1 + safe-execa: 0.1.4 + /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true @@ -3245,6 +3540,16 @@ packages: /http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + /http-proxy-agent@5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + /http2-wrapper@1.0.3: resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} engines: {node: '>=10.19.0'} @@ -3265,6 +3570,11 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + /humanize-ms@1.2.1: + resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} + dependencies: + ms: 2.1.3 + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -3313,6 +3623,9 @@ packages: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} + /individual@3.0.0: + resolution: {integrity: sha512-rUY5vtT748NMRbEMrTNiFfy29BgGZwGXUi2NFUVMWQrogSLzlJvQV9eeMWi+g1aVaQ53tpyLAQtd5x/JH0Nh1g==} + /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: @@ -3356,6 +3669,13 @@ packages: side-channel: 1.0.6 dev: true + /ip-address@9.0.5: + resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + engines: {node: '>= 12'} + dependencies: + jsbn: 1.1.0 + sprintf-js: 1.1.3 + /is-array-buffer@3.0.4: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -4125,6 +4445,9 @@ packages: dependencies: argparse: 2.0.1 + /jsbn@1.1.0: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + /jsdoc-type-pratt-parser@2.2.5: resolution: {integrity: sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==} engines: {node: '>=12.0.0'} @@ -4156,6 +4479,9 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true + /json-stringify-safe@5.0.1: + resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + /json5@1.0.2: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true @@ -4250,7 +4576,7 @@ packages: engines: {node: '>=6'} dependencies: graceful-fs: 4.2.11 - js-yaml: 3.13.1 + js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 @@ -4303,6 +4629,10 @@ packages: dependencies: yallist: 4.0.0 + /lru-cache@7.10.1: + resolution: {integrity: sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A==} + engines: {node: '>=12'} + /magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} dependencies: @@ -4488,7 +4818,6 @@ packages: /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true /multimatch@5.0.0: resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} @@ -4519,6 +4848,20 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true + /ndjson@2.0.0: + resolution: {integrity: sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==} + engines: {node: '>=10'} + hasBin: true + dependencies: + json-stringify-safe: 5.0.1 + minimist: 1.2.8 + readable-stream: 3.6.2 + split2: 3.2.2 + through2: 4.0.2 + + /nerf-dart@1.0.0: + resolution: {integrity: sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==} + /node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} dependencies: @@ -4557,7 +4900,7 @@ packages: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.13.1 - semver: 7.5.4 + semver: 7.6.2 validate-npm-package-license: 3.0.4 /normalize-path@3.0.0: @@ -4836,6 +5179,9 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + /path-name@1.0.0: + resolution: {integrity: sha512-/dcAb5vMXH0f51yvMuSUqFpxUcA8JelbRmE5mW/p4CUJxrNgK24IkstnV7ENtg2IDGBOu6izKTG6eilbnbNKWQ==} + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -5186,6 +5532,10 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 + /retry@0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -5231,6 +5581,22 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + /safe-execa@0.1.2: + resolution: {integrity: sha512-vdTshSQ2JsRCgT8eKZWNJIL26C6bVqy1SOmuCMlKHegVeo8KYRobRrefOdUq9OozSPUUiSxrylteeRmLOMFfWg==} + engines: {node: '>=12'} + dependencies: + '@zkochan/which': 2.0.3 + execa: 5.1.1 + path-name: 1.0.0 + + /safe-execa@0.1.4: + resolution: {integrity: sha512-GI3k4zl4aLC3lxZNEEXAxxcXE6E3TfOsJ5xxJPhcAv9MWwnH2O9I0HrDmZFsVnu/C8wzRYSsTHdoVRmL0VicDw==} + engines: {node: '>=12'} + dependencies: + '@zkochan/which': 2.0.3 + execa: 5.1.1 + path-name: 1.0.0 + /safe-regex-test@1.0.3: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} @@ -5271,7 +5637,6 @@ packages: resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} hasBin: true - dev: true /set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} @@ -5322,10 +5687,35 @@ packages: /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + /smart-buffer@4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + + /socks-proxy-agent@6.1.1: + resolution: {integrity: sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==} + engines: {node: '>= 10'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + socks: 2.8.3 + transitivePeerDependencies: + - supports-color + + /socks@2.8.3: + resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + dependencies: + ip-address: 9.0.5 + smart-buffer: 4.2.0 + /sort-keys@4.2.0: resolution: {integrity: sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==} engines: {node: '>=8'} @@ -5366,9 +5756,17 @@ packages: /spdx-license-ids@3.0.17: resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} + /split2@3.2.2: + resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} + dependencies: + readable-stream: 3.6.2 + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + /sprintf-js@1.1.3: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -5571,6 +5969,11 @@ packages: /throat@6.0.2: resolution: {integrity: sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ==} + /through2@4.0.2: + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} + dependencies: + readable-stream: 3.6.2 + /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -5995,6 +6398,13 @@ packages: signal-exit: 3.0.7 dev: true + /write-file-atomic@5.0.1: + resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 4.1.0 + /write-yaml-file@4.2.0: resolution: {integrity: sha512-LwyucHy0uhWqbrOkh9cBluZBeNVxzHjDaE9mwepZG3n3ZlbM4v3ndrFw51zW/NXYFFqP+QWZ72ihtLWTh05e4Q==} engines: {node: '>=10.13'} @@ -6457,7 +6867,10 @@ packages: engines: {node: '>=5.6.0'} dependencies: '@pnpm/dependency-path': 2.1.8 + '@pnpm/dependency-path9': /@pnpm/dependency-path@5.1.7 '@pnpm/link-bins': 5.3.25 + '@pnpm/lockfile.fs': 1.1.0(@pnpm/logger@5.1.0) + '@pnpm/logger': 5.1.0 '@rushstack/heft-config-file': file:../../../libraries/heft-config-file(@types/node@18.17.15) '@rushstack/lookup-by-path': file:../../../libraries/lookup-by-path(@types/node@18.17.15) '@rushstack/node-core-library': file:../../../libraries/node-core-library(@types/node@18.17.15) @@ -6503,6 +6916,9 @@ packages: id: file:../../../libraries/rush-sdk name: '@rushstack/rush-sdk' dependencies: + '@pnpm/lockfile.fs': 1.1.0(@pnpm/logger@5.1.0) + '@pnpm/lockfile.types': 1.0.3 + '@pnpm/logger': 5.1.0 '@rushstack/lookup-by-path': file:../../../libraries/lookup-by-path(@types/node@18.17.15) '@rushstack/node-core-library': file:../../../libraries/node-core-library(@types/node@18.17.15) '@rushstack/package-deps-hash': file:../../../libraries/package-deps-hash(@types/node@18.17.15) diff --git a/common/config/subspaces/build-tests-subspace/repo-state.json b/common/config/subspaces/build-tests-subspace/repo-state.json index e1c0cdd4686..12c125aec87 100644 --- a/common/config/subspaces/build-tests-subspace/repo-state.json +++ b/common/config/subspaces/build-tests-subspace/repo-state.json @@ -1,6 +1,6 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "acf7c4f1de794be2d70dca29f989124eddfc541f", + "pnpmShrinkwrapHash": "f16a645bd4f696c98342857c93a485c296743f01", "preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648", - "packageJsonInjectedDependenciesHash": "d8e3c0d28dcafaa568a71417fa3485ab58cbf829" + "packageJsonInjectedDependenciesHash": "3402b23418838154e269f05432188e752e94bd0b" } diff --git a/common/config/subspaces/default/pnpm-lock.yaml b/common/config/subspaces/default/pnpm-lock.yaml index e604781bb54..4e5477543d6 100644 --- a/common/config/subspaces/default/pnpm-lock.yaml +++ b/common/config/subspaces/default/pnpm-lock.yaml @@ -3333,6 +3333,9 @@ importers: '@pnpm/dependency-path': specifier: ~2.1.2 version: 2.1.8 + '@pnpm/dependency-path9': + specifier: npm:@pnpm/dependency-path@~5.1.7 + version: /@pnpm/dependency-path@5.1.7 '@pnpm/link-bins': specifier: ~5.3.7 version: 5.3.25 @@ -3442,6 +3445,9 @@ importers: specifier: ~8.3.2 version: 8.3.2 devDependencies: + '@pnpm/lockfile.types': + specifier: ~1.0.3 + version: 1.0.3 '@pnpm/logger': specifier: 4.0.0 version: 4.0.0 @@ -3502,6 +3508,9 @@ importers: ../../../libraries/rush-sdk: dependencies: + '@pnpm/lockfile.types': + specifier: ~1.0.3 + version: 1.0.3 '@rushstack/lookup-by-path': specifier: workspace:* version: link:../lookup-by-path @@ -9724,6 +9733,19 @@ packages: rfc4648: 1.5.3 dev: false + /@pnpm/crypto.base32-hash@3.0.1: + resolution: {integrity: sha512-DM4RR/tvB7tMb2FekL0Q97A5PCXNyEC+6ht8SaufAUFSJNxeozqHw9PHTZR03mzjziPzNQLOld0pNINBX3srtw==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/crypto.polyfill': 1.0.0 + rfc4648: 1.5.3 + dev: false + + /@pnpm/crypto.polyfill@1.0.0: + resolution: {integrity: sha512-WbmsqqcUXKKaAF77ox1TQbpZiaQcr26myuMUu+WjUtoWYgD3VP6iKYEvSx35SZ6G2L316lu+pv+40A2GbWJc1w==} + engines: {node: '>=18.12'} + dev: false + /@pnpm/dependency-path@2.1.8: resolution: {integrity: sha512-ywBaTjy0iSEF7lH3DlF8UXrdL2bw4AQFV2tTOeNeY7wc1W5CE+RHSJhf9MXBYcZPesqGRrPiU7Pimj3l05L9VA==} engines: {node: '>=16.14'} @@ -9734,6 +9756,15 @@ packages: semver: 7.5.4 dev: false + /@pnpm/dependency-path@5.1.7: + resolution: {integrity: sha512-MKCyaTy1r9fhBXAnhDZNBVgo6ThPnicwJEG203FDp7pGhD7NruS/FhBI+uMd7GNsK3D7aIFCDAgbWpNTXn/eWw==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/crypto.base32-hash': 3.0.1 + '@pnpm/types': 12.2.0 + semver: 7.6.3 + dev: false + /@pnpm/error@1.4.0: resolution: {integrity: sha512-vxkRrkneBPVmP23kyjnYwVOtipwlSl6UfL+h+Xa3TrABJTz5rYBXemlTsU5BzST8U4pD7YDkTb3SQu+MMuIDKA==} engines: {node: '>=10.16'} @@ -9765,6 +9796,13 @@ packages: '@pnpm/types': 9.4.2 dev: true + /@pnpm/lockfile.types@1.0.3: + resolution: {integrity: sha512-A7vUWktnhDkrIs+WmXm7AdffJVyVYJpQUEouya/DYhB+Y+tQ3BXjZ6CV0KybqLgI/8AZErgCJqFxA0GJH6QDjA==} + engines: {node: '>=18.12'} + dependencies: + '@pnpm/patching.types': 1.0.0 + '@pnpm/types': 12.2.0 + /@pnpm/logger@4.0.0: resolution: {integrity: sha512-SIShw+k556e7S7tLZFVSIHjCdiVog1qWzcKW2RbLEHPItdisAFVNIe34kYd9fMSswTlSRLS/qRjw3ZblzWmJ9Q==} engines: {node: '>=12.17'} @@ -9782,6 +9820,10 @@ packages: is-subdir: 1.2.0 dev: false + /@pnpm/patching.types@1.0.0: + resolution: {integrity: sha512-juCdQCC1USqLcOhVPl1tYReoTO9YH4fTullMnFXXcmpsDM7Dkn3tzuOQKC3oPoJ2ozv+0EeWWMtMGqn2+IM3pQ==} + engines: {node: '>=18.12'} + /@pnpm/read-modules-dir@2.0.3: resolution: {integrity: sha512-i9OgRvSlxrTS9a2oXokhDxvQzDtfqtsooJ9jaGoHkznue5aFCTSrNZFQ6M18o8hC03QWfnxaKi0BtOvNkKu2+A==} engines: {node: '>=10.13'} @@ -9817,6 +9859,10 @@ packages: strip-bom: 4.0.0 dev: false + /@pnpm/types@12.2.0: + resolution: {integrity: sha512-5RtwWhX39j89/Tmyv2QSlpiNjErA357T/8r1Dkg+2lD3P7RuS7Xi2tChvmOC3VlezEFNcWnEGCOeKoGRkDuqFA==} + engines: {node: '>=18.12'} + /@pnpm/types@6.4.0: resolution: {integrity: sha512-nco4+4sZqNHn60Y4VE/fbtlShCBqipyUO+nKRPvDHqLrecMW9pzHWMVRxk4nrMRoeowj3q0rX3GYRBa8lsHTAg==} engines: {node: '>=10.16'} diff --git a/common/config/subspaces/default/repo-state.json b/common/config/subspaces/default/repo-state.json index 4b98b2c83d0..4b785ad30f4 100644 --- a/common/config/subspaces/default/repo-state.json +++ b/common/config/subspaces/default/repo-state.json @@ -1,5 +1,5 @@ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { - "pnpmShrinkwrapHash": "eca705e24ac99810f28fecff4de2d89706db9065", + "pnpmShrinkwrapHash": "728bee3f3cf7c7038b7efbf889305a753921216b", "preferredVersionsHash": "ce857ea0536b894ec8f346aaea08cfd85a5af648" } diff --git a/libraries/rush-lib/package.json b/libraries/rush-lib/package.json index 76e38975eae..832f01f38a4 100644 --- a/libraries/rush-lib/package.json +++ b/libraries/rush-lib/package.json @@ -30,6 +30,7 @@ "license": "MIT", "dependencies": { "@pnpm/dependency-path": "~2.1.2", + "@pnpm/dependency-path9": "npm:@pnpm/dependency-path@~5.1.7", "@pnpm/link-bins": "~5.3.7", "@rushstack/heft-config-file": "workspace:*", "@rushstack/lookup-by-path": "workspace:*", @@ -68,6 +69,7 @@ "pnpm-sync-lib": "0.2.9" }, "devDependencies": { + "@pnpm/lockfile.types": "~1.0.3", "@pnpm/logger": "4.0.0", "local-node-rig": "workspace:*", "@rushstack/heft-webpack5-plugin": "workspace:*", diff --git a/libraries/rush-lib/src/logic/pnpm/PnpmShrinkWrapFileConverters.ts b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkWrapFileConverters.ts new file mode 100644 index 00000000000..3f866401cd9 --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkWrapFileConverters.ts @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +// fork from https://github.com/pnpm/pnpm/blob/main/lockfile/fs/src/lockfileFormatConverters.ts +import { removeSuffix } from '@pnpm/dependency-path9'; +import type { + InlineSpecifiersProjectSnapshot, + InlineSpecifiersResolvedDependencies, + Lockfile, + LockfileFile, + LockfileFileV9, + PackageSnapshots, + ProjectSnapshot, + ResolvedDependencies +} from '@pnpm/lockfile.types'; + +type DepPath = string & { __brand: 'DepPath' }; +// eslint-disable-next-line @typescript-eslint/typedef +const DEPENDENCIES_FIELDS = ['optionalDependencies', 'dependencies', 'devDependencies'] as const; + +function revertProjectSnapshot(from: InlineSpecifiersProjectSnapshot): ProjectSnapshot { + const specifiers: ResolvedDependencies = {}; + + function moveSpecifiers(fromDep: InlineSpecifiersResolvedDependencies): ResolvedDependencies { + const resolvedDependencies: ResolvedDependencies = {}; + for (const [depName, { specifier, version }] of Object.entries(fromDep)) { + const existingValue: string = specifiers[depName]; + if (existingValue != null && existingValue !== specifier) { + throw new Error( + `Project snapshot lists the same dependency more than once with conflicting versions: ${depName}` + ); + } + + specifiers[depName] = specifier; + resolvedDependencies[depName] = version; + } + return resolvedDependencies; + } + + const dependencies: ResolvedDependencies | undefined = + from.dependencies == null ? from.dependencies : moveSpecifiers(from.dependencies); + const devDependencies: ResolvedDependencies | undefined = + from.devDependencies == null ? from.devDependencies : moveSpecifiers(from.devDependencies); + const optionalDependencies: ResolvedDependencies | undefined = + from.optionalDependencies == null ? from.optionalDependencies : moveSpecifiers(from.optionalDependencies); + + return { + ...from, + specifiers, + dependencies, + devDependencies, + optionalDependencies + }; +} + +function convertFromLockfileFileMutable(lockfileFile: LockfileFile): LockfileFileV9 { + if (typeof lockfileFile?.importers === 'undefined') { + lockfileFile.importers = { + '.': { + dependenciesMeta: lockfileFile.dependenciesMeta, + publishDirectory: lockfileFile.publishDirectory + } + }; + for (const depType of DEPENDENCIES_FIELDS) { + if (lockfileFile[depType] != null) { + lockfileFile.importers['.'][depType] = lockfileFile[depType]; + delete lockfileFile[depType]; + } + } + } + return lockfileFile as LockfileFileV9; +} + +function mapValues(obj: Record, mapper: (val: T, key: string) => U): Record { + const result: Record = {}; + for (const [key, value] of Object.entries(obj)) { + result[key] = mapper(value, key); + } + return result; +} + +export function convertLockfileV9ToLockfileObject(lockfile: LockfileFileV9): Lockfile { + const { importers, ...rest } = convertFromLockfileFileMutable(lockfile); + + const packages: PackageSnapshots = {}; + for (const [depPath, pkg] of Object.entries(lockfile.snapshots ?? {})) { + const pkgId: string = removeSuffix(depPath); + packages[depPath as DepPath] = Object.assign(pkg, lockfile.packages?.[pkgId]); + } + return { + ...rest, + packages, + importers: mapValues(importers ?? {}, revertProjectSnapshot) + }; +} diff --git a/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts index 5801d1dc1cc..80fa5beb31b 100644 --- a/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts +++ b/libraries/rush-lib/src/logic/pnpm/PnpmShrinkwrapFile.ts @@ -15,6 +15,7 @@ import { } from '@rushstack/node-core-library'; import { Colorize, type ITerminal } from '@rushstack/terminal'; import * as dependencyPath from '@pnpm/dependency-path'; +import * as dependencyPath9 from '@pnpm/dependency-path9'; import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile'; import { DependencySpecifier } from '../DependencySpecifier'; @@ -32,9 +33,22 @@ import { PnpmOptionsConfiguration } from './PnpmOptionsConfiguration'; import type { IPnpmfile, IPnpmfileContext } from './IPnpmfile'; import type { Subspace } from '../../api/Subspace'; import { CustomTipId, type CustomTipsConfiguration } from '../../api/CustomTipsConfiguration'; +import type { + ProjectId, + Lockfile, + PackageSnapshot, + ProjectSnapshot, + LockfileFileV9 +} from '@pnpm/lockfile.types'; +import { convertLockfileV9ToLockfileObject } from './PnpmShrinkWrapFileConverters'; const yamlModule: typeof import('js-yaml') = Import.lazy('js-yaml', require); +export enum ShrinkwrapFileMajorVersion { + V6 = 6, + V9 = 9 +} + export interface IPeerDependenciesMetaYaml { optional?: boolean; } @@ -47,11 +61,14 @@ export interface IPnpmV8VersionSpecifier { version: string; specifier: string; } -export type IPnpmVersionSpecifier = IPnpmV7VersionSpecifier | IPnpmV8VersionSpecifier; - -export interface IPnpmShrinkwrapDependencyYaml { - /** Information about the resolved package */ - resolution?: { +export type IPnpmV9VersionSpecifier = string; +export type IPnpmVersionSpecifier = + | IPnpmV7VersionSpecifier + | IPnpmV8VersionSpecifier + | IPnpmV9VersionSpecifier; + +export interface IPnpmShrinkwrapDependencyYaml extends Omit { + resolution: { /** The directory this package should clone, for injected dependencies */ directory?: string; /** The hash of the tarball, to ensure archive integrity */ @@ -59,103 +76,110 @@ export interface IPnpmShrinkwrapDependencyYaml { /** The name of the tarball, if this was from a TGZ file */ tarball?: string; }; - /** The list of bundled dependencies in this package */ - bundledDependencies?: ReadonlyArray; - /** The list of dependencies and the resolved version */ - dependencies?: Record; - /** The list of optional dependencies and the resolved version */ - optionalDependencies?: Record; - /** The list of peer dependencies and the resolved version */ - peerDependencies?: Record; - /** - * Used to indicate optional peer dependencies, as described in this RFC: - * https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-optional-peer-dependencies.md - */ - peerDependenciesMeta?: Record; - /** The name of the package, if the package is a local tarball */ - name?: string; - /** If this is an optional dependency */ - optional?: boolean; - /** The values of process.platform supported by this package */ - os?: readonly string[]; - /** The values of process.arch supported by this package */ - cpu?: readonly string[]; - /** The libc runtimes supported by this package */ - libc?: readonly string[]; } -export interface IPnpmShrinkwrapImporterYaml { - /** The list of resolved version numbers for direct dependencies */ - dependencies?: Record; - /** The list of resolved version numbers for dev dependencies */ - devDependencies?: Record; - /** The list of resolved version numbers for optional dependencies */ - optionalDependencies?: Record; - /** The list of metadata for dependencies declared inside dependencies, optionalDependencies, and devDependencies. */ - dependenciesMeta?: Record; +export type IPnpmShrinkwrapImporterYaml = ProjectSnapshot; + +export interface IPnpmShrinkwrapYaml extends Lockfile { /** - * The list of specifiers used to resolve dependency versions - * - * @remarks - * This has been removed in PNPM v8 + * This interface represents the raw pnpm-lock.YAML file + * Example: + * { + * "dependencies": { + * "@rush-temp/project1": "file:./projects/project1.tgz" + * }, + * "packages": { + * "file:projects/library1.tgz": { + * "dependencies: { + * "markdown": "0.5.0" + * }, + * "name": "@rush-temp/library1", + * "resolution": { + * "tarball": "file:projects/library1.tgz" + * }, + * "version": "0.0.0" + * }, + * "markdown/0.5.0": { + * "resolution": { + * "integrity": "sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=" + * } + * } + * }, + * "registry": "http://localhost:4873/", + * "shrinkwrapVersion": 3, + * "specifiers": { + * "@rush-temp/project1": "file:./projects/project1.tgz" + * } + * } */ - specifiers?: Record; -} - -/** - * This interface represents the raw pnpm-lock.YAML file - * Example: - * { - * "dependencies": { - * "@rush-temp/project1": "file:./projects/project1.tgz" - * }, - * "packages": { - * "file:projects/library1.tgz": { - * "dependencies: { - * "markdown": "0.5.0" - * }, - * "name": "@rush-temp/library1", - * "resolution": { - * "tarball": "file:projects/library1.tgz" - * }, - * "version": "0.0.0" - * }, - * "markdown/0.5.0": { - * "resolution": { - * "integrity": "sha1-KCBbVlqK51kt4gdGPWY33BgnIrI=" - * } - * } - * }, - * "registry": "http://localhost:4873/", - * "shrinkwrapVersion": 3, - * "specifiers": { - * "@rush-temp/project1": "file:./projects/project1.tgz" - * } - * } - */ -export interface IPnpmShrinkwrapYaml { - /** The version of the lockfile format */ - lockfileVersion?: string | number; /** The list of resolved version numbers for direct dependencies */ - dependencies: Record; - /** The list of importers for local workspace projects */ - importers: Record; - /** The description of the solved graph */ - packages: Record; - /** URL of the registry which was used */ - registry: string; + dependencies?: Record; /** The list of specifiers used to resolve direct dependency versions */ - specifiers: Record; - /** The list of override version number for dependencies */ - overrides?: { [dependency: string]: string }; - /** The checksum of package extensions fields for extending dependencies */ - packageExtensionsChecksum?: string; + specifiers?: Record; + /** URL of the registry which was used */ + registry?: string; } export interface ILoadFromFileOptions { withCaching?: boolean; } +export function parsePnpm9DependencyKey( + dependencyName: string, + versionSpecifier: IPnpmVersionSpecifier +): DependencySpecifier | undefined { + if (!versionSpecifier) { + return undefined; + } + + const dependencyKey: string = normalizePnpmVersionSpecifier(versionSpecifier); + + // Example: file:projects/project2 + // Example: project-2@file:projects/project2 + // Example: link:../projects/project1 + if (/(file|link):/.test(dependencyKey)) { + // If it starts with an NPM scheme such as "file:projects/my-app.tgz", we don't support that + return undefined; + } + + const { peersIndex } = dependencyPath9.indexOfPeersSuffix(dependencyKey); + if (peersIndex !== -1) { + // Remove peer suffix + const key: string = dependencyKey.slice(0, peersIndex); + + // Example: 7.26.0 + if (semver.valid(key)) { + return new DependencySpecifier(dependencyName, key); + } + } + + // Example: @babel/preset-env@7.26.0 -> name=@babel/preset-env version=7.26.0 + // Example: @babel/preset-env@7.26.0(peer@1.2.3) -> name=@babel/preset-env version=7.26.0 + // Example: https://github.com/jonschlinkert/pad-left/tarball/2.1.0 -> name=undefined version=undefined + // Example: pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0 -> name=pad-left nonSemverVersion=https://xxxx + // Example: pad-left@https://codeload.github.com/jonschlinkert/pad-left/tar.gz/7798d648225aa5 -> name=pad-left nonSemverVersion=https://xxxx + const dependency: dependencyPath9.DependencyPath = dependencyPath9.parse(dependencyKey); + + const name: string = dependency.name ?? dependencyName; + const version: string = dependency.version ?? dependency.nonSemverVersion ?? dependencyKey; + + // Example: https://xxxx/pad-left/tarball/2.1.0 + // Example: https://github.com/jonschlinkert/pad-left/tarball/2.1.0 + // Example: https://codeload.github.com/jonschlinkert/pad-left/tar.gz/7798d648225aa5d879660a37c408ab4675b65ac7 + if (/^https?:/.test(version)) { + return new DependencySpecifier(name, version); + } + + // Is it an alias for a different package? + if (name === dependencyName) { + // No, it's a regular dependency + return new DependencySpecifier(name, version); + } else { + // If the parsed package name is different from the dependencyName, then this is an NPM package alias + return new DependencySpecifier(dependencyName, `npm:${name}@${version}`); + } +} + /** * Given an encoded "dependency key" from the PNPM shrinkwrap file, this parses it into an equivalent * DependencySpecifier. @@ -309,8 +333,11 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { this.overrides = new Map(Object.entries(shrinkwrapJson.overrides || {})); this.packageExtensionsChecksum = shrinkwrapJson.packageExtensionsChecksum; - // Importers only exist in workspaces - this.isWorkspaceCompatible = this.importers.size > 0; + // LockfileV9 always has "." in importers filed. + this.isWorkspaceCompatible = + this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9 + ? this.importers.size > 1 + : this.importers.size > 0; this._integrities = new Map(); } @@ -342,8 +369,18 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { } public static loadFromString(shrinkwrapContent: string): PnpmShrinkwrapFile { - const parsedData: IPnpmShrinkwrapYaml = yamlModule.safeLoad(shrinkwrapContent); - return new PnpmShrinkwrapFile(parsedData); + const shrinkwrapJson: IPnpmShrinkwrapYaml = yamlModule.safeLoad(shrinkwrapContent); + if ((shrinkwrapJson as LockfileFileV9).snapshots) { + const lockfile: IPnpmShrinkwrapYaml | null = convertLockfileV9ToLockfileObject( + shrinkwrapJson as LockfileFileV9 + ); + if (lockfile) { + lockfile.dependencies = lockfile.importers['.' as ProjectId]?.dependencies; + } + return new PnpmShrinkwrapFile(lockfile); + } + + return new PnpmShrinkwrapFile(shrinkwrapJson); } public getShrinkwrapHash(experimentsConfig?: IExperimentsJson): string { @@ -974,7 +1011,7 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { } } } else { - // PNPM v8 + // >= PNPM v8 const importerOptionalDependencies: Set = new Set( Object.keys(importer.optionalDependencies ?? {}) ); @@ -1022,20 +1059,32 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { return true; } } else { - if (typeof specifierFromLockfile === 'string') { - throw new Error( - `The PNPM lockfile is in an unexpected format. The "${name}" package is specified as ` + - `"${specifierFromLockfile}" instead of an object.` - ); - } else { + if (this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9) { // TODO: Emit an error message when someone tries to override a version of something in one of their // local repo packages. let resolvedVersion: string = this.overrides.get(name) ?? version; // convert path in posix style, otherwise pnpm install will fail in subspace case resolvedVersion = Path.convertToSlashes(resolvedVersion); - if (specifierFromLockfile.specifier !== resolvedVersion && !isDevDepFallThrough && !isOptional) { + const specifier: string = importer.specifiers[name]; + if (specifier !== resolvedVersion && !isDevDepFallThrough && !isOptional) { return true; } + } else { + if (typeof specifierFromLockfile === 'string') { + throw new Error( + `The PNPM lockfile is in an unexpected format. The "${name}" package is specified as ` + + `"${specifierFromLockfile}" instead of an object.` + ); + } else { + // TODO: Emit an error message when someone tries to override a version of something in one of their + // local repo packages. + let resolvedVersion: string = this.overrides.get(name) ?? version; + // convert path in posix style, otherwise pnpm install will fail in subspace case + resolvedVersion = Path.convertToSlashes(resolvedVersion); + if (specifierFromLockfile.specifier !== resolvedVersion && !isDevDepFallThrough && !isOptional) { + return true; + } + } } } } @@ -1151,7 +1200,14 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { private _getPackageId(name: string, versionSpecifier: IPnpmVersionSpecifier): string { const version: string = normalizePnpmVersionSpecifier(versionSpecifier); - if (this.shrinkwrapFileMajorVersion >= 6) { + + if (this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9) { + if (/https?:/.test(version)) { + return version; + } else { + return `${name}@${version}`; + } + } else if (this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V6) { if (version.startsWith('@github')) { // This is a github repo reference return version; @@ -1169,10 +1225,10 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile { pnpmDependencyKey: IPnpmVersionSpecifier ): DependencySpecifier | undefined { if (pnpmDependencyKey) { - const result: DependencySpecifier | undefined = parsePnpmDependencyKey( - dependencyName, - pnpmDependencyKey - ); + const result: DependencySpecifier | undefined = + this.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9 + ? parsePnpm9DependencyKey(dependencyName, pnpmDependencyKey) + : parsePnpmDependencyKey(dependencyName, pnpmDependencyKey); if (!result) { throw new Error( diff --git a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapConverters.test.ts b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapConverters.test.ts new file mode 100644 index 00000000000..7234f7721fc --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapConverters.test.ts @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import type { LockfileFileV9, PackageSnapshot, ProjectSnapshot } from '@pnpm/lockfile.types'; +import { convertLockfileV9ToLockfileObject } from '../PnpmShrinkWrapFileConverters'; +import { FileSystem } from '@rushstack/node-core-library'; +import yamlModule from 'js-yaml'; + +describe(convertLockfileV9ToLockfileObject.name, () => { + const lockfileContent: string = FileSystem.readFile( + `${__dirname}/yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml` + ); + const lockfileJson: LockfileFileV9 = yamlModule.safeLoad(lockfileContent); + const lockfile = convertLockfileV9ToLockfileObject(lockfileJson); + + it('merge packages and snapshots', () => { + const packages = new Map(Object.entries(lockfile.packages || {})); + const padLeftPackage = packages.get('pad-left@2.1.0'); + expect(padLeftPackage).toBeDefined(); + expect(padLeftPackage?.dependencies).toEqual({ + 'repeat-string': '1.6.1' + }); + }); + + it("importers['.']", () => { + const importers = new Map(Object.entries(lockfile.importers || {})); + + const currentPackage = importers.get('.'); + expect(currentPackage).toBeDefined(); + + expect(currentPackage?.dependencies).toEqual({ + jquery: '3.7.1', + 'pad-left': '2.1.0' + }); + + expect(currentPackage?.specifiers).toEqual({ + jquery: '^3.7.1', + 'pad-left': '^2.1.0' + }); + }); +}); diff --git a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts index 91f787e57b5..aa1170e999b 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts +++ b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts @@ -2,7 +2,7 @@ // See LICENSE in the project root for license information. import { type DependencySpecifier, DependencySpecifierType } from '../../DependencySpecifier'; -import { PnpmShrinkwrapFile, parsePnpmDependencyKey } from '../PnpmShrinkwrapFile'; +import { PnpmShrinkwrapFile, parsePnpm9DependencyKey, parsePnpmDependencyKey } from '../PnpmShrinkwrapFile'; import { RushConfiguration } from '../../../api/RushConfiguration'; import type { RushConfigurationProject } from '../../../api/RushConfigurationProject'; @@ -126,6 +126,99 @@ describe(PnpmShrinkwrapFile.name, () => { }); }); + describe(parsePnpm9DependencyKey.name, () => { + it('Does not support file:// specifiers', () => { + expect(parsePnpm9DependencyKey(DEPENDENCY_NAME, 'file:///path/to/file')).toBeUndefined(); + expect(parsePnpm9DependencyKey(DEPENDENCY_NAME, 'pad-left@file:///path/to/file')).toBeUndefined(); + expect(parsePnpm9DependencyKey(DEPENDENCY_NAME, 'link:///path/to/file')).toBeUndefined(); + }); + + it('Supports a variety of non-aliased package specifiers', () => { + function testSpecifiers(specifiers: string[], expectedName: string, expectedVersion: string): void { + for (const specifier of specifiers) { + const parsedSpecifier: DependencySpecifier | undefined = parsePnpm9DependencyKey( + expectedName, + specifier + ); + expect(parsedSpecifier).toBeDefined(); + expect(parsedSpecifier!.specifierType).toBe(DependencySpecifierType.Version); + expect(parsedSpecifier!.packageName).toBe(expectedName); + expect(parsedSpecifier!.versionSpecifier).toBe(expectedVersion); + } + } + + // non-scoped, non-prerelease + testSpecifiers( + [`${DEPENDENCY_NAME}@${VERSION}`, `${DEPENDENCY_NAME}@${VERSION}(peer@3.5.0+peer2@1.17.7)`], + DEPENDENCY_NAME, + VERSION + ); + + // scoped, non-prerelease + testSpecifiers( + [ + `${SCOPED_DEPENDENCY_NAME}@${VERSION}`, + `${SCOPED_DEPENDENCY_NAME}@${VERSION}(peer@3.5.0+peer2@1.17.7)` + ], + SCOPED_DEPENDENCY_NAME, + VERSION + ); + + // non-scoped, prerelease + testSpecifiers( + [ + `${DEPENDENCY_NAME}@${PRERELEASE_VERSION}`, + `${DEPENDENCY_NAME}@${PRERELEASE_VERSION}(peer@3.5.0+peer2@1.17.7)` + ], + DEPENDENCY_NAME, + PRERELEASE_VERSION + ); + + // scoped, prerelease + testSpecifiers( + [ + `${SCOPED_DEPENDENCY_NAME}@${PRERELEASE_VERSION}`, + `${SCOPED_DEPENDENCY_NAME}@${PRERELEASE_VERSION}(peer@3.5.0+peer2@1.17.7)` + ], + SCOPED_DEPENDENCY_NAME, + PRERELEASE_VERSION + ); + }); + + it('Supports aliased package specifiers (v9)', () => { + const parsedSpecifier: DependencySpecifier | undefined = parsePnpm9DependencyKey( + SCOPED_DEPENDENCY_NAME, + `${DEPENDENCY_NAME}@${VERSION}` + ); + expect(parsedSpecifier).toBeDefined(); + expect(parsedSpecifier!.specifierType).toBe(DependencySpecifierType.Alias); + expect(parsedSpecifier!.packageName).toBe(SCOPED_DEPENDENCY_NAME); + expect(parsedSpecifier!.versionSpecifier).toMatchInlineSnapshot(`"npm:${DEPENDENCY_NAME}@${VERSION}"`); + }); + + it('Supports URL package specifiers', () => { + const specifiers: string[] = [ + 'https://github.com/jonschlinkert/pad-left/tarball/2.1.0', + 'https://xxx.xxxx.org/pad-left/-/pad-left-2.1.0.tgz', + 'https://codeload.github.com/jonschlinkert/pad-left/tar.gz/7798d648225aa5d879660a37c408ab4675b65ac7', + `${SCOPED_DEPENDENCY_NAME}@http://abc.com/jonschlinkert/pad-left/tarball/2.1.0`, + `${SCOPED_DEPENDENCY_NAME}@https://xxx.xxxx.org/pad-left/-/pad-left-2.1.0.tgz`, + `${SCOPED_DEPENDENCY_NAME}@https://codeload.github.com/jonschlinkert/pad-left/tar.gz/7798d648225aa5d879660a37c408ab4675b65ac7` + ]; + + for (const specifier of specifiers) { + const parsedSpecifier: DependencySpecifier | undefined = parsePnpm9DependencyKey( + SCOPED_DEPENDENCY_NAME, + specifier + ); + expect(parsedSpecifier).toBeDefined(); + expect(parsedSpecifier!.specifierType).toBe(DependencySpecifierType.Remote); + expect(parsedSpecifier!.packageName).toBe(SCOPED_DEPENDENCY_NAME); + expect(parsedSpecifier!.versionSpecifier).toBe(specifier.replace(`${SCOPED_DEPENDENCY_NAME}@`, '')); + } + }); + }); + describe('Check is workspace project modified', () => { describe('pnpm lockfile major version 5', () => { it('can detect not modified', async () => { @@ -228,6 +321,64 @@ describe(PnpmShrinkwrapFile.name, () => { ).resolves.toBe(false); }); }); + + describe('pnpm lockfile major version 9', () => { + it('can detect not modified', async () => { + const project = getMockRushProject(); + const pnpmShrinkwrapFile = getPnpmShrinkwrapFileFromFile( + `${__dirname}/yamlFiles/pnpm-lock-v9/not-modified.yaml` + ); + await expect( + pnpmShrinkwrapFile.isWorkspaceProjectModifiedAsync( + project, + project.rushConfiguration.defaultSubspace, + undefined + ) + ).resolves.toBe(false); + }); + + it('can detect modified', async () => { + const project = getMockRushProject(); + const pnpmShrinkwrapFile = getPnpmShrinkwrapFileFromFile( + `${__dirname}/yamlFiles/pnpm-lock-v9/modified.yaml` + ); + await expect( + pnpmShrinkwrapFile.isWorkspaceProjectModifiedAsync( + project, + project.rushConfiguration.defaultSubspace, + undefined + ) + ).resolves.toBe(true); + }); + + it('can detect overrides', async () => { + const project = getMockRushProject(); + const pnpmShrinkwrapFile = getPnpmShrinkwrapFileFromFile( + `${__dirname}/yamlFiles/pnpm-lock-v9/overrides-not-modified.yaml` + ); + await expect( + pnpmShrinkwrapFile.isWorkspaceProjectModifiedAsync( + project, + project.rushConfiguration.defaultSubspace, + undefined + ) + ).resolves.toBe(false); + }); + + it('can handle the inconsistent version of a package declared in dependencies and devDependencies', async () => { + const project = getMockRushProject2(); + const pnpmShrinkwrapFile = getPnpmShrinkwrapFileFromFile( + `${__dirname}/yamlFiles/pnpm-lock-v9/inconsistent-dep-devDep.yaml` + ); + await expect( + pnpmShrinkwrapFile.isWorkspaceProjectModifiedAsync( + project, + project.rushConfiguration.defaultSubspace, + undefined + ) + ).resolves.toBe(false); + }); + }); }); }); diff --git a/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/inconsistent-dep-devDep.yaml b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/inconsistent-dep-devDep.yaml new file mode 100644 index 00000000000..7f26989631c --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/inconsistent-dep-devDep.yaml @@ -0,0 +1,26 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + ../../apps/bar: + dependencies: + prettier: + specifier: ~2.3.0 + version: 2.3.2 + +packages: + + prettier@2.3.2: + resolution: {integrity: sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==} + engines: {node: '>=10.13.0'} + hasBin: true + +snapshots: + + prettier@2.3.2: {} diff --git a/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/modified.yaml b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/modified.yaml new file mode 100644 index 00000000000..71509e89efe --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/modified.yaml @@ -0,0 +1,35 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + ../../apps/foo: + dependencies: + tslib: + specifier: ~2.3.0 + version: 2.3.1 + devDependencies: + typescript: + specifier: ~5.0.4 + version: 5.0.4 + +packages: + + tslib@2.3.1: + resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} + + typescript@5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} + engines: {node: '>=12.20'} + hasBin: true + +snapshots: + + tslib@2.3.1: {} + + typescript@5.0.4: {} diff --git a/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/not-modified.yaml b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/not-modified.yaml new file mode 100644 index 00000000000..47ef29262c3 --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/not-modified.yaml @@ -0,0 +1,35 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + ../../apps/foo: + dependencies: + tslib: + specifier: ~2.3.1 + version: 2.3.1 + devDependencies: + typescript: + specifier: ~5.0.4 + version: 5.0.4 + +packages: + + tslib@2.3.1: + resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} + + typescript@5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} + engines: {node: '>=12.20'} + hasBin: true + +snapshots: + + tslib@2.3.1: {} + + typescript@5.0.4: {} diff --git a/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/overrides-not-modified.yaml b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/overrides-not-modified.yaml new file mode 100644 index 00000000000..d21630b1d81 --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/overrides-not-modified.yaml @@ -0,0 +1,38 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +overrides: + typescript: 5.0.4 + +importers: + + .: {} + + ../../apps/foo: + dependencies: + tslib: + specifier: ~2.3.1 + version: 2.3.1 + devDependencies: + typescript: + specifier: 5.0.4 + version: 5.0.4 + +packages: + + tslib@2.3.1: + resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} + + typescript@5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} + engines: {node: '>=12.20'} + hasBin: true + +snapshots: + + tslib@2.3.1: {} + + typescript@5.0.4: {} diff --git a/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml new file mode 100644 index 00000000000..9fe144e1b91 --- /dev/null +++ b/libraries/rush-lib/src/logic/pnpm/test/yamlFiles/pnpm-lock-v9/pnpm-lock-v9.yaml @@ -0,0 +1,39 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + jquery: + specifier: ^3.7.1 + version: 3.7.1 + pad-left: + specifier: ^2.1.0 + version: 2.1.0 + +packages: + + jquery@3.7.1: + resolution: {integrity: sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==} + + pad-left@2.1.0: + resolution: {integrity: sha512-HJxs9K9AztdIQIAIa/OIazRAUW/L6B9hbQDxO4X07roW3eo9XqZc2ur9bn1StH9CnbbI9EgvejHQX7CBpCF1QA==} + engines: {node: '>=0.10.0'} + + repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + +snapshots: + + jquery@3.7.1: {} + + pad-left@2.1.0: + dependencies: + repeat-string: 1.6.1 + + repeat-string@1.6.1: {} diff --git a/libraries/rush-lib/src/logic/test/ShrinkwrapFile.test.ts b/libraries/rush-lib/src/logic/test/ShrinkwrapFile.test.ts index 1c4996a6fab..cfd986b947c 100644 --- a/libraries/rush-lib/src/logic/test/ShrinkwrapFile.test.ts +++ b/libraries/rush-lib/src/logic/test/ShrinkwrapFile.test.ts @@ -6,7 +6,11 @@ import { JsonFile } from '@rushstack/node-core-library'; import type { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile'; import { ShrinkwrapFileFactory } from '../ShrinkwrapFileFactory'; -import { parsePnpmDependencyKey, PnpmShrinkwrapFile } from '../pnpm/PnpmShrinkwrapFile'; +import { + parsePnpmDependencyKey, + PnpmShrinkwrapFile, + ShrinkwrapFileMajorVersion +} from '../pnpm/PnpmShrinkwrapFile'; import { DependencySpecifier } from '../DependencySpecifier'; import { NpmShrinkwrapFile } from '../npm/NpmShrinkwrapFile'; import type { RushConfigurationProject } from '../../api/RushConfigurationProject'; @@ -73,12 +77,28 @@ describe(PnpmShrinkwrapFile.name, () => { '@rush-temp/project1' ) ).toEqual(false); - expect( - shrinkwrapFile.tryEnsureCompatibleDependency( - new DependencySpecifier('@scope/testDep', '>=2.0.0 <3.0.0'), - '@rush-temp/project3' - ) - ).toEqual(true); + + if ( + shrinkwrapFile instanceof PnpmShrinkwrapFile && + shrinkwrapFile.shrinkwrapFileMajorVersion >= ShrinkwrapFileMajorVersion.V9 + ) { + expect( + shrinkwrapFile.tryEnsureCompatibleDependency( + new DependencySpecifier( + '@scope/testDep', + 'https://github.com/jonschlinkert/pad-left/tarball/2.1.0' + ), + '@rush-temp/project3' + ) + ).toEqual(true); + } else { + expect( + shrinkwrapFile.tryEnsureCompatibleDependency( + new DependencySpecifier('@scope/testDep', '>=2.0.0 <3.0.0'), + '@rush-temp/project3' + ) + ).toEqual(true); + } }); it('extracts temp projects successfully', () => { @@ -133,6 +153,19 @@ describe(PnpmShrinkwrapFile.name, () => { validateNonWorkspaceLockfile(shrinkwrapFile); }); + + describe('V9 lockfile', () => { + const filename: string = path.resolve( + __dirname, + '../../../src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml' + ); + const shrinkwrapFile: BaseShrinkwrapFile = ShrinkwrapFileFactory.getShrinkwrapFile( + 'pnpm', + {}, + filename + )!; + validateNonWorkspaceLockfile(shrinkwrapFile); + }); }); describe('workspace', () => { @@ -201,6 +234,21 @@ describe(PnpmShrinkwrapFile.name, () => { validateWorkspaceLockfile(shrinkwrapFile); }); + + describe('V9 lockfile', () => { + const filename: string = path.resolve( + __dirname, + '../../../src/logic/test/shrinkwrapFile/workspace-pnpm-lock-v9.yaml' + ); + + const shrinkwrapFile: BaseShrinkwrapFile = ShrinkwrapFileFactory.getShrinkwrapFile( + 'pnpm', + {}, + filename + )!; + + validateWorkspaceLockfile(shrinkwrapFile); + }); }); }); diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/ShrinkwrapFile.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/ShrinkwrapFile.test.ts.snap index 5192b36bf2f..c4f9d4453dd 100644 --- a/libraries/rush-lib/src/logic/test/__snapshots__/ShrinkwrapFile.test.ts.snap +++ b/libraries/rush-lib/src/logic/test/__snapshots__/ShrinkwrapFile.test.ts.snap @@ -99,3 +99,53 @@ Array [ ], ] `; + +exports[`PnpmShrinkwrapFile workspace V9 lockfile verifies project dependencies: project1 1`] = ` +Array [ + Array [ + Object { + "../../project1": "../../project1:6yFTI2g+Ny0Au80xpo6zIY61TCNDUuLUd6EgLlbOBtc=:", + "jquery@1.12.3": "sha512-FzM42/Ew+Hb8ha2OlhHRBLgWIZS32gZ0+NvWTf+ZvVvGaIlJkOiXQyb7VBjv4L6fJfmTrRf3EsAmbfsHDhfemw==", + "pad-left@1.0.2": "sha512-saxSV1EYAytuZDtQYEwi0DPzooG6aN18xyHrnJtzwjVwmMauzkEecd7hynVJGolNGk1Pl9tltmZqfze4TZTCxg==", + "repeat-string@1.6.1": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + }, + "project1/.rush/temp/shrinkwrap-deps.json", + Object { + "ensureFolderExists": true, + }, + ], +] +`; + +exports[`PnpmShrinkwrapFile workspace V9 lockfile verifies project dependencies: project2 1`] = ` +Array [ + Array [ + Object { + "../../project2": "../../project2:l6v/HWUhScMI0m4k6D5qHiCOFj3Z0GoIFJEcp4I63w0=:", + "jquery@2.2.4": "sha512-lBHj60ezci2u1v2FqnZIraShGgEXq35qCzMv4lITyHGppTnA13rwR0MgwyNJh9TnDs3aXUvd1xjAotfraMHX/Q==", + "q@1.5.0": "sha512-VVMcd+HnuWZalHPycK7CsbVJ+sSrrrnCvHcW38YJVK9Tywnb5DUWJjONi81bLUj7aqDjIXnePxBl5t1r/F/ncg==", + }, + "project2/.rush/temp/shrinkwrap-deps.json", + Object { + "ensureFolderExists": true, + }, + ], +] +`; + +exports[`PnpmShrinkwrapFile workspace V9 lockfile verifies project dependencies: project3 1`] = ` +Array [ + Array [ + Object { + "../../project3": "../../project3:vMoje8cXfsHYOc6EXbxEw/qyBGXGUL1RApmNfwl7oA8=:", + "pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0": "pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0:bKrL+SvVYubL0HwTq/GOOXq1d05LTQ+HGqlXabzGEAU=:", + "q@1.5.0": "sha512-VVMcd+HnuWZalHPycK7CsbVJ+sSrrrnCvHcW38YJVK9Tywnb5DUWJjONi81bLUj7aqDjIXnePxBl5t1r/F/ncg==", + "repeat-string@1.6.1": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + }, + "project3/.rush/temp/shrinkwrap-deps.json", + Object { + "ensureFolderExists": true, + }, + ], +] +`; diff --git a/libraries/rush-lib/src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml b/libraries/rush-lib/src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml new file mode 100644 index 00000000000..b74c0511f12 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/shrinkwrapFile/non-workspace-pnpm-lock-v9.yaml @@ -0,0 +1,196 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@pnpm/dependency-path': + specifier: ^5.1.7 + version: 5.1.7 + '@pnpm/lockfile.utils': + specifier: ^1.0.4 + version: 1.0.4 + '@rush-temp/project1': + specifier: file:./projects/project1 + version: project1@file:projects/project1 + '@rush-temp/project2': + specifier: file:./projects/project2 + version: project2@file:projects/project2 + '@rush-temp/project3': + specifier: file:./projects/project3 + version: project3@file:projects/project3 + pad-left: + specifier: 1.0.0 + version: 1.0.0 + +packages: + + '@pnpm/crypto.base32-hash@3.0.1': + resolution: {integrity: sha512-DM4RR/tvB7tMb2FekL0Q97A5PCXNyEC+6ht8SaufAUFSJNxeozqHw9PHTZR03mzjziPzNQLOld0pNINBX3srtw==} + engines: {node: '>=18.12'} + + '@pnpm/crypto.polyfill@1.0.0': + resolution: {integrity: sha512-WbmsqqcUXKKaAF77ox1TQbpZiaQcr26myuMUu+WjUtoWYgD3VP6iKYEvSx35SZ6G2L316lu+pv+40A2GbWJc1w==} + engines: {node: '>=18.12'} + + '@pnpm/dependency-path@5.1.7': + resolution: {integrity: sha512-MKCyaTy1r9fhBXAnhDZNBVgo6ThPnicwJEG203FDp7pGhD7NruS/FhBI+uMd7GNsK3D7aIFCDAgbWpNTXn/eWw==} + engines: {node: '>=18.12'} + + '@pnpm/lockfile.types@1.0.3': + resolution: {integrity: sha512-A7vUWktnhDkrIs+WmXm7AdffJVyVYJpQUEouya/DYhB+Y+tQ3BXjZ6CV0KybqLgI/8AZErgCJqFxA0GJH6QDjA==} + engines: {node: '>=18.12'} + + '@pnpm/lockfile.utils@1.0.4': + resolution: {integrity: sha512-ptHO2muziYyNCwpsuaPtaRgKiHMrE/lkGI4nqbHnRWWgfdJbTeL1tq+b/EUsxjlKlJ/a9Q4z2C+t38g+9bhTJg==} + engines: {node: '>=18.12'} + + '@pnpm/patching.types@1.0.0': + resolution: {integrity: sha512-juCdQCC1USqLcOhVPl1tYReoTO9YH4fTullMnFXXcmpsDM7Dkn3tzuOQKC3oPoJ2ozv+0EeWWMtMGqn2+IM3pQ==} + engines: {node: '>=18.12'} + + '@pnpm/pick-fetcher@3.0.0': + resolution: {integrity: sha512-2eisylRAU/jeuxFEPnS1gjLZKJGbYc4QEtEW6MVUYjO4Xi+2ttkSm7825S0J5IPpUIvln8HYPCUS0eQWSfpOaQ==} + engines: {node: '>=18.12'} + + '@pnpm/ramda@0.28.1': + resolution: {integrity: sha512-zcAG+lvU0fMziNeGXpPyCyCJYp5ZVrPElEE4t14jAmViaihohocZ+dDkcRIyAomox8pQsuZnv1EyHR+pOhmUWw==} + + '@pnpm/resolver-base@13.0.4': + resolution: {integrity: sha512-d6GtsaXDN1VmVdeB6ohrhwGwQfvYpEX/XkBZyRT0Hp772WabWVfaulvicwdh/8o7Rpzy7IV/2hKnDpodUY00lw==} + engines: {node: '>=18.12'} + + '@pnpm/types@12.2.0': + resolution: {integrity: sha512-5RtwWhX39j89/Tmyv2QSlpiNjErA357T/8r1Dkg+2lD3P7RuS7Xi2tChvmOC3VlezEFNcWnEGCOeKoGRkDuqFA==} + engines: {node: '>=18.12'} + + get-npm-tarball-url@2.1.0: + resolution: {integrity: sha512-ro+DiMu5DXgRBabqXupW38h7WPZ9+Ad8UjwhvsmmN8w1sU7ab0nzAXvVZ4kqYg57OrqomRtJvepX5/xvFKNtjA==} + engines: {node: '>=12.17'} + + jquery@1.12.3: + resolution: {integrity: sha512-FzM42/Ew+Hb8ha2OlhHRBLgWIZS32gZ0+NvWTf+ZvVvGaIlJkOiXQyb7VBjv4L6fJfmTrRf3EsAmbfsHDhfemw==} + + jquery@2.2.4: + resolution: {integrity: sha512-lBHj60ezci2u1v2FqnZIraShGgEXq35qCzMv4lITyHGppTnA13rwR0MgwyNJh9TnDs3aXUvd1xjAotfraMHX/Q==} + + pad-left@1.0.0: + resolution: {integrity: sha512-VIgD7DviaDL6QCj+jEU1jpjXlu0z/sl4yzAmFLmM7YvM3ZRKLaxZAe+sZ1hKHeYUeI4zoZHfMetDpazu/uAwsw==} + engines: {node: '>=0.10.0'} + + pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0: + resolution: {tarball: https://github.com/jonschlinkert/pad-left/tarball/2.1.0} + version: 2.1.0 + engines: {node: '>=0.10.0'} + + project1@file:projects/project1: + resolution: {directory: projects/project1, type: directory} + + project2@file:projects/project2: + resolution: {directory: projects/project2, type: directory} + + project3@file:projects/project3: + resolution: {directory: projects/project3, type: directory} + + q@1.5.1: + resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} + engines: {node: '>=0.6.0', teleport: '>=0.2.0'} + deprecated: |- + You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + + (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) + + repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + + rfc4648@1.5.3: + resolution: {integrity: sha512-MjOWxM065+WswwnmNONOT+bD1nXzY9Km6u3kzvnx8F8/HXGZdz3T6e6vZJ8Q/RIMUSp/nxqjH3GwvJDy8ijeQQ==} + + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + +snapshots: + + '@pnpm/crypto.base32-hash@3.0.1': + dependencies: + '@pnpm/crypto.polyfill': 1.0.0 + rfc4648: 1.5.3 + + '@pnpm/crypto.polyfill@1.0.0': {} + + '@pnpm/dependency-path@5.1.7': + dependencies: + '@pnpm/crypto.base32-hash': 3.0.1 + '@pnpm/types': 12.2.0 + semver: 7.6.3 + + '@pnpm/lockfile.types@1.0.3': + dependencies: + '@pnpm/patching.types': 1.0.0 + '@pnpm/types': 12.2.0 + + '@pnpm/lockfile.utils@1.0.4': + dependencies: + '@pnpm/dependency-path': 5.1.7 + '@pnpm/lockfile.types': 1.0.3 + '@pnpm/pick-fetcher': 3.0.0 + '@pnpm/resolver-base': 13.0.4 + '@pnpm/types': 12.2.0 + get-npm-tarball-url: 2.1.0 + ramda: '@pnpm/ramda@0.28.1' + + '@pnpm/patching.types@1.0.0': {} + + '@pnpm/pick-fetcher@3.0.0': {} + + '@pnpm/ramda@0.28.1': {} + + '@pnpm/resolver-base@13.0.4': + dependencies: + '@pnpm/types': 12.2.0 + + '@pnpm/types@12.2.0': {} + + get-npm-tarball-url@2.1.0: {} + + jquery@1.12.3: {} + + jquery@2.2.4: {} + + pad-left@1.0.0: + dependencies: + repeat-string: 1.6.1 + + pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0: + dependencies: + repeat-string: 1.6.1 + + project1@file:projects/project1: + dependencies: + jquery: 1.12.3 + pad-left: 1.0.0 + + project2@file:projects/project2: + dependencies: + jquery: 2.2.4 + q: 1.5.1 + + project3@file:projects/project3: + dependencies: + '@scope/testDep': pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0 + q: 1.5.1 + + q@1.5.1: {} + + repeat-string@1.6.1: {} + + rfc4648@1.5.3: {} + + semver@7.6.3: {} diff --git a/libraries/rush-lib/src/logic/test/shrinkwrapFile/workspace-pnpm-lock-v9.yaml b/libraries/rush-lib/src/logic/test/shrinkwrapFile/workspace-pnpm-lock-v9.yaml new file mode 100644 index 00000000000..ad160af09b8 --- /dev/null +++ b/libraries/rush-lib/src/logic/test/shrinkwrapFile/workspace-pnpm-lock-v9.yaml @@ -0,0 +1,83 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + ../../project1: + dependencies: + jquery: + specifier: 1.12.3 + version: 1.12.3 + pad-left: + specifier: ^1.0.0 + version: 1.0.2 + + ../../project2: + dependencies: + jquery: + specifier: 2.2.4 + version: 2.2.4 + q: + specifier: ~1.5.0 + version: 1.5.0 + + ../../project3: + dependencies: + '@scope/testDep': + specifier: https://github.com/jonschlinkert/pad-left/tarball/2.1.0 + version: pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0 + q: + specifier: 1.5.0 + version: 1.5.0 + +packages: + + jquery@1.12.3: + resolution: {integrity: sha512-FzM42/Ew+Hb8ha2OlhHRBLgWIZS32gZ0+NvWTf+ZvVvGaIlJkOiXQyb7VBjv4L6fJfmTrRf3EsAmbfsHDhfemw==} + + jquery@2.2.4: + resolution: {integrity: sha512-lBHj60ezci2u1v2FqnZIraShGgEXq35qCzMv4lITyHGppTnA13rwR0MgwyNJh9TnDs3aXUvd1xjAotfraMHX/Q==} + + pad-left@1.0.2: + resolution: {integrity: sha512-saxSV1EYAytuZDtQYEwi0DPzooG6aN18xyHrnJtzwjVwmMauzkEecd7hynVJGolNGk1Pl9tltmZqfze4TZTCxg==} + engines: {node: '>=0.10.0'} + + pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0: + resolution: {tarball: https://github.com/jonschlinkert/pad-left/tarball/2.1.0} + version: 2.1.0 + engines: {node: '>=0.10.0'} + + q@1.5.0: + resolution: {integrity: sha512-VVMcd+HnuWZalHPycK7CsbVJ+sSrrrnCvHcW38YJVK9Tywnb5DUWJjONi81bLUj7aqDjIXnePxBl5t1r/F/ncg==} + engines: {node: '>=0.6.0', teleport: '>=0.2.0'} + deprecated: |- + You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. + + (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) + + repeat-string@1.6.1: + resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==} + engines: {node: '>=0.10'} + +snapshots: + + jquery@1.12.3: {} + + jquery@2.2.4: {} + + pad-left@1.0.2: + dependencies: + repeat-string: 1.6.1 + + pad-left@https://github.com/jonschlinkert/pad-left/tarball/2.1.0: + dependencies: + repeat-string: 1.6.1 + + q@1.5.0: {} + + repeat-string@1.6.1: {} diff --git a/libraries/rush-sdk/package.json b/libraries/rush-sdk/package.json index 8a2d21231b8..01386d37634 100644 --- a/libraries/rush-sdk/package.json +++ b/libraries/rush-sdk/package.json @@ -38,6 +38,7 @@ }, "license": "MIT", "dependencies": { + "@pnpm/lockfile.types": "~1.0.3", "@rushstack/lookup-by-path": "workspace:*", "@rushstack/node-core-library": "workspace:*", "@rushstack/package-deps-hash": "workspace:*",