From 70a58c078c1ff1630f5162696ae628e9eed87eab Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Thu, 26 Jun 2025 07:13:32 +0000 Subject: [PATCH] feat: align yarn pnp implementation (#576) ported from https://github.com/unrs/unrs-resolver --- .github/actions/pnpm/action.yml | 3 + Cargo.lock | 60 ++- Cargo.toml | 1 + fixtures/global-pnp/.gitignore | 7 + fixtures/global-pnp/.yarnrc.yml | 1 + fixtures/global-pnp/package.json | 7 + fixtures/global-pnp/test.js | 1 + fixtures/global-pnp/yarn.lock | 38 ++ fixtures/pnp/.yarnrc.yml | 2 +- fixtures/pnp/package.json | 12 +- fixtures/pnp/shared/lib.js | 3 + fixtures/pnp/yarn.lock | 811 +++++++++++++++++++++++++++++++ justfile | 1 + napi/index.d.ts | 2 + napi/src/lib.rs | 2 +- napi/src/options.rs | 3 + src/cache.rs | 2 +- src/lib.rs | 132 +++-- src/options.rs | 10 +- src/tests/pnp.rs | 156 +++++- 20 files changed, 1211 insertions(+), 43 deletions(-) create mode 100644 fixtures/global-pnp/.gitignore create mode 100644 fixtures/global-pnp/.yarnrc.yml create mode 100644 fixtures/global-pnp/package.json create mode 100644 fixtures/global-pnp/test.js create mode 100644 fixtures/global-pnp/yarn.lock create mode 100644 fixtures/pnp/shared/lib.js diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml index b6824762..ae7b5c99 100644 --- a/.github/actions/pnpm/action.yml +++ b/.github/actions/pnpm/action.yml @@ -13,3 +13,6 @@ runs: cd fixtures/pnp corepack enable yarn install + + cd ../global-pnp + yarn install diff --git a/Cargo.lock b/Cargo.lock index 621b1ea9..39def028 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -343,6 +343,27 @@ dependencies = [ "serde", ] +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.59.0", +] + [[package]] name = "document-features" version = "0.2.11" @@ -420,6 +441,17 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.3.3" @@ -429,7 +461,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", - "wasi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -723,12 +755,19 @@ version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "oxc_resolver" version = "11.2.1" dependencies = [ "cfg-if", "criterion2", + "dirs", "document-features", "indexmap 2.9.0", "json-strip-comments", @@ -886,6 +925,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror", +] + [[package]] name = "ref-cast" version = "1.0.24" @@ -1218,7 +1268,7 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ - "getrandom", + "getrandom 0.3.3", "js-sys", "wasm-bindgen", ] @@ -1242,6 +1292,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + [[package]] name = "wasi" version = "0.14.2+wasi-0.2.4" diff --git a/Cargo.toml b/Cargo.toml index 5392e021..407c866a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,6 +97,7 @@ document-features = { version = "0.2.11", optional = true } [dev-dependencies] criterion2 = { version = "3.0.0", default-features = false } +dirs = { version = "6.0.0" } normalize-path = { version = "0.2.1" } pico-args = "0.5.0" rayon = { version = "1.10.0" } diff --git a/fixtures/global-pnp/.gitignore b/fixtures/global-pnp/.gitignore new file mode 100644 index 00000000..836120c1 --- /dev/null +++ b/fixtures/global-pnp/.gitignore @@ -0,0 +1,7 @@ +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/fixtures/global-pnp/.yarnrc.yml b/fixtures/global-pnp/.yarnrc.yml new file mode 100644 index 00000000..85e88a8f --- /dev/null +++ b/fixtures/global-pnp/.yarnrc.yml @@ -0,0 +1 @@ +enableGlobalCache: true diff --git a/fixtures/global-pnp/package.json b/fixtures/global-pnp/package.json new file mode 100644 index 00000000..ec7b79ca --- /dev/null +++ b/fixtures/global-pnp/package.json @@ -0,0 +1,7 @@ +{ + "name": "global-pnp", + "packageManager": "yarn@4.9.2", + "dependencies": { + "source-map-support": "^0.5.21" + } +} diff --git a/fixtures/global-pnp/test.js b/fixtures/global-pnp/test.js new file mode 100644 index 00000000..c09fd579 --- /dev/null +++ b/fixtures/global-pnp/test.js @@ -0,0 +1 @@ +console.log(require.resolve('source-map-support')) diff --git a/fixtures/global-pnp/yarn.lock b/fixtures/global-pnp/yarn.lock new file mode 100644 index 00000000..33e9820c --- /dev/null +++ b/fixtures/global-pnp/yarn.lock @@ -0,0 +1,38 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 10c0/124fff9d66d691a86d3b062eff4663fe437a9d9ee4b47b1b9e97f5a5d14f6d5399345db80f796827be7c95e70a8e765dd404b7c3ff3b3324f98e9b0c8826cc34 + languageName: node + linkType: hard + +"global-pnp@workspace:.": + version: 0.0.0-use.local + resolution: "global-pnp@workspace:." + dependencies: + source-map-support: "npm:^0.5.21" + languageName: unknown + linkType: soft + +"source-map-support@npm:^0.5.21": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard diff --git a/fixtures/pnp/.yarnrc.yml b/fixtures/pnp/.yarnrc.yml index 6a6b24d8..4f0649b0 100644 --- a/fixtures/pnp/.yarnrc.yml +++ b/fixtures/pnp/.yarnrc.yml @@ -1 +1 @@ -enableGlobalCache: 0 +enableGlobalCache: false diff --git a/fixtures/pnp/package.json b/fixtures/pnp/package.json index 5d119379..a3d5ffe3 100644 --- a/fixtures/pnp/package.json +++ b/fixtures/pnp/package.json @@ -1,8 +1,16 @@ { "name": "pnp", - "packageManager": "yarn@4.3.1", + "packageManager": "yarn@4.9.2", "dependencies": { + "@atlaskit/pragmatic-drag-and-drop": "^1.5.2", + "@custom/pragmatic-drag-and-drop": "npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2", + "beachball": "^2.52.0", + "custom-minimist": "npm:minimist@^1.2.8", "is-even": "^1.0.0", - "is-odd": "^3.0.1" + "is-odd": "^3.0.1", + "lib": "link:./shared", + "lodash.zip": "^4.2.0", + "pragmatic-drag-and-drop": "npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2", + "preact": "^10.26.5" } } diff --git a/fixtures/pnp/shared/lib.js b/fixtures/pnp/shared/lib.js new file mode 100644 index 00000000..a93d0b33 --- /dev/null +++ b/fixtures/pnp/shared/lib.js @@ -0,0 +1,3 @@ +module.exports = function(){ + return 42; +} diff --git a/fixtures/pnp/yarn.lock b/fixtures/pnp/yarn.lock index ba89514d..f63a01c4 100644 --- a/fixtures/pnp/yarn.lock +++ b/fixtures/pnp/yarn.lock @@ -5,6 +5,365 @@ __metadata: version: 8 cacheKey: 10c0 +"@atlaskit/pragmatic-drag-and-drop@npm:^1.5.2, @custom/pragmatic-drag-and-drop@npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2, pragmatic-drag-and-drop@npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2": + version: 1.7.3 + resolution: "@atlaskit/pragmatic-drag-and-drop@npm:1.7.3" + dependencies: + "@babel/runtime": "npm:^7.0.0" + bind-event-listener: "npm:^3.0.0" + raf-schd: "npm:^4.0.3" + checksum: 10c0/d7c6e1a2e421c9da9134af403bc0f3eacf21c5bce56c2d5434093b559b0dd3ac87238c1d2f043fa55750201a7d859fdea00916f6280ea23a27b7726c7a78dd63 + languageName: node + linkType: hard + +"@babel/code-frame@npm:^7.0.0": + version: 7.27.1 + resolution: "@babel/code-frame@npm:7.27.1" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.27.1" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.1.1" + checksum: 10c0/5dd9a18baa5fce4741ba729acc3a3272c49c25cb8736c4b18e113099520e7ef7b545a4096a26d600e4416157e63e87d66db46aa3fbf0a5f2286da2705c12da00 + languageName: node + linkType: hard + +"@babel/helper-validator-identifier@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-validator-identifier@npm:7.27.1" + checksum: 10c0/c558f11c4871d526498e49d07a84752d1800bf72ac0d3dad100309a2eaba24efbf56ea59af5137ff15e3a00280ebe588560534b0e894a4750f8b1411d8f78b84 + languageName: node + linkType: hard + +"@babel/runtime@npm:^7.0.0": + version: 7.27.6 + resolution: "@babel/runtime@npm:7.27.6" + checksum: 10c0/89726be83f356f511dcdb74d3ea4d873a5f0cf0017d4530cb53aa27380c01ca102d573eff8b8b77815e624b1f8c24e7f0311834ad4fb632c90a770fda00bd4c8 + languageName: node + linkType: hard + +"@nodelib/fs.scandir@npm:2.1.5": + version: 2.1.5 + resolution: "@nodelib/fs.scandir@npm:2.1.5" + dependencies: + "@nodelib/fs.stat": "npm:2.0.5" + run-parallel: "npm:^1.1.9" + checksum: 10c0/732c3b6d1b1e967440e65f284bd06e5821fedf10a1bea9ed2bb75956ea1f30e08c44d3def9d6a230666574edbaf136f8cfd319c14fd1f87c66e6a44449afb2eb + languageName: node + linkType: hard + +"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": + version: 2.0.5 + resolution: "@nodelib/fs.stat@npm:2.0.5" + checksum: 10c0/88dafe5e3e29a388b07264680dc996c17f4bda48d163a9d4f5c1112979f0ce8ec72aa7116122c350b4e7976bc5566dc3ddb579be1ceaacc727872eb4ed93926d + languageName: node + linkType: hard + +"@nodelib/fs.walk@npm:^1.2.3": + version: 1.2.8 + resolution: "@nodelib/fs.walk@npm:1.2.8" + dependencies: + "@nodelib/fs.scandir": "npm:2.1.5" + fastq: "npm:^1.6.0" + checksum: 10c0/db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 + languageName: node + linkType: hard + +"@types/parse-path@npm:^7.0.0": + version: 7.0.3 + resolution: "@types/parse-path@npm:7.0.3" + checksum: 10c0/8344b6c7acba4e4e5a8d542f56f53c297685fa92f9b0c085d7532cc7e1b661432cecfc1c75c76cdb0d161c95679b6ecfe0573d9fef7c836962aacf604150a984 + languageName: node + linkType: hard + +"@yarnpkg/lockfile@npm:^1.1.0": + version: 1.1.0 + resolution: "@yarnpkg/lockfile@npm:1.1.0" + checksum: 10c0/0bfa50a3d756623d1f3409bc23f225a1d069424dbc77c6fd2f14fb377390cd57ec703dc70286e081c564be9051ead9ba85d81d66a3e68eeb6eb506d4e0c0fbda + languageName: node + linkType: hard + +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 10c0/c5640c2d89045371c7cedd6a70212a04e360fd34d6edeae32f6952c63949e3525ea77dbec0289d8213a99bbaeab5abfa860b5c12cf88a2e6cf8106e90dd27a7e + languageName: node + linkType: hard + +"array-union@npm:^2.1.0": + version: 2.1.0 + resolution: "array-union@npm:2.1.0" + checksum: 10c0/429897e68110374f39b771ec47a7161fc6a8fc33e196857c0a396dc75df0b5f65e4d046674db764330b6bb66b39ef48dd7c53b6a2ee75cfb0681e0c1a7033962 + languageName: node + linkType: hard + +"balanced-match@npm:^1.0.0": + version: 1.0.2 + resolution: "balanced-match@npm:1.0.2" + checksum: 10c0/9308baf0a7e4838a82bbfd11e01b1cb0f0cf2893bc1676c27c2a8c0e70cbae1c59120c3268517a8ae7fb6376b4639ef81ca22582611dbee4ed28df945134aaee + languageName: node + linkType: hard + +"beachball@npm:^2.52.0": + version: 2.54.0 + resolution: "beachball@npm:2.54.0" + dependencies: + cosmiconfig: "npm:^8.3.6" + execa: "npm:^5.0.0" + fs-extra: "npm:^11.1.1" + lodash: "npm:^4.17.15" + minimatch: "npm:^3.0.4" + p-graph: "npm:^1.1.2" + p-limit: "npm:^3.0.2" + prompts: "npm:^2.4.2" + semver: "npm:^7.0.0" + toposort: "npm:^2.0.2" + workspace-tools: "npm:^0.38.2" + yargs-parser: "npm:^21.0.0" + bin: + beachball: bin/beachball.js + checksum: 10c0/4dd08576af53e4fa2bc5d8a2804d4c6bb0c364bbffc69f36dafd75380f76730696b8d02664e39b5283c946552b219081d0a109ce1976a593ff2f545f6c24dd70 + languageName: node + linkType: hard + +"bind-event-listener@npm:^3.0.0": + version: 3.0.0 + resolution: "bind-event-listener@npm:3.0.0" + checksum: 10c0/08eadf1c7d3a58633f25c2bbd8dc066f77ef4e5df1049e81ff2f43a40c00f6581aba37387caa4878782b1f1f7c337b827757f52b637052a465ad74a7e1db8def + languageName: node + linkType: hard + +"brace-expansion@npm:^1.1.7": + version: 1.1.12 + resolution: "brace-expansion@npm:1.1.12" + dependencies: + balanced-match: "npm:^1.0.0" + concat-map: "npm:0.0.1" + checksum: 10c0/975fecac2bb7758c062c20d0b3b6288c7cc895219ee25f0a64a9de662dbac981ff0b6e89909c3897c1f84fa353113a721923afdec5f8b2350255b097f12b1f73 + languageName: node + linkType: hard + +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: "npm:^7.1.1" + checksum: 10c0/7c6dfd30c338d2997ba77500539227b9d1f85e388a5f43220865201e407e076783d0881f2d297b9f80951b4c957fcf0b51c1d2d24227631643c3f7c284b0aa04 + languageName: node + linkType: hard + +"callsites@npm:^3.0.0": + version: 3.1.0 + resolution: "callsites@npm:3.1.0" + checksum: 10c0/fff92277400eb06c3079f9e74f3af120db9f8ea03bad0e84d9aede54bbe2d44a56cccb5f6cf12211f93f52306df87077ecec5b712794c5a9b5dac6d615a3f301 + languageName: node + linkType: hard + +"concat-map@npm:0.0.1": + version: 0.0.1 + resolution: "concat-map@npm:0.0.1" + checksum: 10c0/c996b1cfdf95b6c90fee4dae37e332c8b6eb7d106430c17d538034c0ad9a1630cb194d2ab37293b1bdd4d779494beee7786d586a50bd9376fd6f7bcc2bd4c98f + languageName: node + linkType: hard + +"cosmiconfig@npm:^8.3.6": + version: 8.3.6 + resolution: "cosmiconfig@npm:8.3.6" + dependencies: + import-fresh: "npm:^3.3.0" + js-yaml: "npm:^4.1.0" + parse-json: "npm:^5.2.0" + path-type: "npm:^4.0.0" + peerDependencies: + typescript: ">=4.9.5" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10c0/0382a9ed13208f8bfc22ca2f62b364855207dffdb73dc26e150ade78c3093f1cf56172df2dd460c8caf2afa91c0ed4ec8a88c62f8f9cd1cf423d26506aa8797a + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.3": + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" + dependencies: + path-key: "npm:^3.1.0" + shebang-command: "npm:^2.0.0" + which: "npm:^2.0.1" + checksum: 10c0/053ea8b2135caff68a9e81470e845613e374e7309a47731e81639de3eaeb90c3d01af0e0b44d2ab9d50b43467223b88567dfeb3262db942dc063b9976718ffc1 + languageName: node + linkType: hard + +"custom-minimist@npm:minimist@^1.2.8": + version: 1.2.8 + resolution: "minimist@npm:1.2.8" + checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6 + languageName: node + linkType: hard + +"dir-glob@npm:^3.0.1": + version: 3.0.1 + resolution: "dir-glob@npm:3.0.1" + dependencies: + path-type: "npm:^4.0.0" + checksum: 10c0/dcac00920a4d503e38bb64001acb19df4efc14536ada475725e12f52c16777afdee4db827f55f13a908ee7efc0cb282e2e3dbaeeb98c0993dd93d1802d3bf00c + languageName: node + linkType: hard + +"error-ex@npm:^1.3.1": + version: 1.3.2 + resolution: "error-ex@npm:1.3.2" + dependencies: + is-arrayish: "npm:^0.2.1" + checksum: 10c0/ba827f89369b4c93382cfca5a264d059dfefdaa56ecc5e338ffa58a6471f5ed93b71a20add1d52290a4873d92381174382658c885ac1a2305f7baca363ce9cce + languageName: node + linkType: hard + +"execa@npm:^5.0.0": + version: 5.1.1 + resolution: "execa@npm:5.1.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^6.0.0" + human-signals: "npm:^2.1.0" + is-stream: "npm:^2.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^4.0.1" + onetime: "npm:^5.1.2" + signal-exit: "npm:^3.0.3" + strip-final-newline: "npm:^2.0.0" + checksum: 10c0/c8e615235e8de4c5addf2fa4c3da3e3aa59ce975a3e83533b4f6a71750fb816a2e79610dc5f1799b6e28976c9ae86747a36a606655bf8cb414a74d8d507b304f + languageName: node + linkType: hard + +"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.1": + version: 3.3.3 + resolution: "fast-glob@npm:3.3.3" + dependencies: + "@nodelib/fs.stat": "npm:^2.0.2" + "@nodelib/fs.walk": "npm:^1.2.3" + glob-parent: "npm:^5.1.2" + merge2: "npm:^1.3.0" + micromatch: "npm:^4.0.8" + checksum: 10c0/f6aaa141d0d3384cf73cbcdfc52f475ed293f6d5b65bfc5def368b09163a9f7e5ec2b3014d80f733c405f58e470ee0cc451c2937685045cddcdeaa24199c43fe + languageName: node + linkType: hard + +"fastq@npm:^1.6.0": + version: 1.19.1 + resolution: "fastq@npm:1.19.1" + dependencies: + reusify: "npm:^1.0.4" + checksum: 10c0/ebc6e50ac7048daaeb8e64522a1ea7a26e92b3cee5cd1c7f2316cdca81ba543aa40a136b53891446ea5c3a67ec215fbaca87ad405f102dd97012f62916905630 + languageName: node + linkType: hard + +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: "npm:^5.0.1" + checksum: 10c0/b75b691bbe065472f38824f694c2f7449d7f5004aa950426a2c28f0306c60db9b880c0b0e4ed819997ffb882d1da02cfcfc819bddc94d71627f5269682edf018 + languageName: node + linkType: hard + +"fs-extra@npm:^11.1.1": + version: 11.3.0 + resolution: "fs-extra@npm:11.3.0" + dependencies: + graceful-fs: "npm:^4.2.0" + jsonfile: "npm:^6.0.1" + universalify: "npm:^2.0.0" + checksum: 10c0/5f95e996186ff45463059feb115a22fb048bdaf7e487ecee8a8646c78ed8fdca63630e3077d4c16ce677051f5e60d3355a06f3cd61f3ca43f48cc58822a44d0a + languageName: node + linkType: hard + +"get-stream@npm:^6.0.0": + version: 6.0.1 + resolution: "get-stream@npm:6.0.1" + checksum: 10c0/49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 + languageName: node + linkType: hard + +"git-up@npm:^8.1.0": + version: 8.1.1 + resolution: "git-up@npm:8.1.1" + dependencies: + is-ssh: "npm:^1.4.0" + parse-url: "npm:^9.2.0" + checksum: 10c0/2cc4461d8565a3f7a1ecd3d262a58ddb8df0a67f7f7d4915df2913c460b2e88ae570a6ea810700a6d22fb3b9e4bea8dd10a8eb469900ddc12e35c62208608c03 + languageName: node + linkType: hard + +"git-url-parse@npm:^16.0.0": + version: 16.1.0 + resolution: "git-url-parse@npm:16.1.0" + dependencies: + git-up: "npm:^8.1.0" + checksum: 10c0/b8f5ebcbd5b2baf9f1bb77a217376f0247c47fe1d42811ccaac3015768eebb0759a59051f758e50e70adf5c67ae059d1975bf6b750164f36bfd39138d11b940b + languageName: node + linkType: hard + +"glob-parent@npm:^5.1.2": + version: 5.1.2 + resolution: "glob-parent@npm:5.1.2" + dependencies: + is-glob: "npm:^4.0.1" + checksum: 10c0/cab87638e2112bee3f839ef5f6e0765057163d39c66be8ec1602f3823da4692297ad4e972de876ea17c44d652978638d2fd583c6713d0eb6591706825020c9ee + languageName: node + linkType: hard + +"globby@npm:^11.0.0": + version: 11.1.0 + resolution: "globby@npm:11.1.0" + dependencies: + array-union: "npm:^2.1.0" + dir-glob: "npm:^3.0.1" + fast-glob: "npm:^3.2.9" + ignore: "npm:^5.2.0" + merge2: "npm:^1.4.1" + slash: "npm:^3.0.0" + checksum: 10c0/b39511b4afe4bd8a7aead3a27c4ade2b9968649abab0a6c28b1a90141b96ca68ca5db1302f7c7bd29eab66bf51e13916b8e0a3d0ac08f75e1e84a39b35691189 + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 + languageName: node + linkType: hard + +"human-signals@npm:^2.1.0": + version: 2.1.0 + resolution: "human-signals@npm:2.1.0" + checksum: 10c0/695edb3edfcfe9c8b52a76926cd31b36978782062c0ed9b1192b36bebc75c4c87c82e178dfcb0ed0fc27ca59d434198aac0bd0be18f5781ded775604db22304a + languageName: node + linkType: hard + +"ignore@npm:^5.2.0": + version: 5.3.2 + resolution: "ignore@npm:5.3.2" + checksum: 10c0/f9f652c957983634ded1e7f02da3b559a0d4cc210fca3792cb67f1b153623c9c42efdc1c4121af171e295444459fc4a9201101fb041b1104a3c000bccb188337 + languageName: node + linkType: hard + +"import-fresh@npm:^3.3.0": + version: 3.3.1 + resolution: "import-fresh@npm:3.3.1" + dependencies: + parent-module: "npm:^1.0.0" + resolve-from: "npm:^4.0.0" + checksum: 10c0/bf8cc494872fef783249709385ae883b447e3eb09db0ebd15dcead7d9afe7224dad7bd7591c6b73b0b19b3c0f9640eb8ee884f01cfaf2887ab995b0b36a0cbec + languageName: node + linkType: hard + +"is-arrayish@npm:^0.2.1": + version: 0.2.1 + resolution: "is-arrayish@npm:0.2.1" + checksum: 10c0/e7fb686a739068bb70f860b39b67afc62acc62e36bb61c5f965768abce1873b379c563e61dd2adad96ebb7edf6651111b385e490cf508378959b0ed4cac4e729 + languageName: node + linkType: hard + "is-buffer@npm:^1.1.5": version: 1.1.6 resolution: "is-buffer@npm:1.1.6" @@ -21,6 +380,22 @@ __metadata: languageName: node linkType: hard +"is-extglob@npm:^2.1.1": + version: 2.1.1 + resolution: "is-extglob@npm:2.1.1" + checksum: 10c0/5487da35691fbc339700bbb2730430b07777a3c21b9ebaecb3072512dfd7b4ba78ac2381a87e8d78d20ea08affb3f1971b4af629173a6bf435ff8a4c47747912 + languageName: node + linkType: hard + +"is-glob@npm:^4.0.1": + version: 4.0.3 + resolution: "is-glob@npm:4.0.3" + dependencies: + is-extglob: "npm:^2.1.1" + checksum: 10c0/17fb4014e22be3bbecea9b2e3a76e9e34ff645466be702f1693e8f1ee1adac84710d0be0bd9f967d6354036fd51ab7c2741d954d6e91dae6bb69714de92c197a + languageName: node + linkType: hard + "is-number@npm:^3.0.0": version: 3.0.0 resolution: "is-number@npm:3.0.0" @@ -37,6 +412,13 @@ __metadata: languageName: node linkType: hard +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 10c0/b4686d0d3053146095ccd45346461bc8e53b80aeb7671cc52a4de02dbbf7dc0d1d2a986e2fe4ae206984b4d34ef37e8b795ebc4f4295c978373e6575e295d811 + languageName: node + linkType: hard + "is-odd@npm:^0.1.2": version: 0.1.2 resolution: "is-odd@npm:0.1.2" @@ -55,6 +437,74 @@ __metadata: languageName: node linkType: hard +"is-ssh@npm:^1.4.0": + version: 1.4.1 + resolution: "is-ssh@npm:1.4.1" + dependencies: + protocols: "npm:^2.0.1" + checksum: 10c0/021a7355cb032625d58db3cc8266ad9aa698cbabf460b71376a0307405577fd7d3aa0826c0bf1951d7809f134c0ee80403306f6d7633db94a5a3600a0106b398 + languageName: node + linkType: hard + +"is-stream@npm:^2.0.0": + version: 2.0.1 + resolution: "is-stream@npm:2.0.1" + checksum: 10c0/7c284241313fc6efc329b8d7f08e16c0efeb6baab1b4cd0ba579eb78e5af1aa5da11e68559896a2067cd6c526bd29241dda4eb1225e627d5aa1a89a76d4635a5 + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 10c0/228cfa503fadc2c31596ab06ed6aa82c9976eec2bfd83397e7eaf06d0ccf42cd1dfd6743bf9aeb01aebd4156d009994c5f76ea898d2832c1fe342da923ca457d + languageName: node + linkType: hard + +"jju@npm:^1.4.0": + version: 1.4.0 + resolution: "jju@npm:1.4.0" + checksum: 10c0/f3f444557e4364cfc06b1abf8331bf3778b26c0c8552ca54429bc0092652172fdea26cbffe33e1017b303d5aa506f7ede8571857400efe459cb7439180e2acad + languageName: node + linkType: hard + +"js-tokens@npm:^4.0.0": + version: 4.0.0 + resolution: "js-tokens@npm:4.0.0" + checksum: 10c0/e248708d377aa058eacf2037b07ded847790e6de892bbad3dac0abba2e759cb9f121b00099a65195616badcb6eca8d14d975cb3e89eb1cfda644756402c8aeed + languageName: node + linkType: hard + +"js-yaml@npm:^4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" + dependencies: + argparse: "npm:^2.0.1" + bin: + js-yaml: bin/js-yaml.js + checksum: 10c0/184a24b4eaacfce40ad9074c64fd42ac83cf74d8c8cd137718d456ced75051229e5061b8633c3366b8aada17945a7a356b337828c19da92b51ae62126575018f + languageName: node + linkType: hard + +"json-parse-even-better-errors@npm:^2.3.0": + version: 2.3.1 + resolution: "json-parse-even-better-errors@npm:2.3.1" + checksum: 10c0/140932564c8f0b88455432e0f33c4cb4086b8868e37524e07e723f4eaedb9425bdc2bafd71bd1d9765bd15fd1e2d126972bc83990f55c467168c228c24d665f3 + languageName: node + linkType: hard + +"jsonfile@npm:^6.0.1": + version: 6.1.0 + resolution: "jsonfile@npm:6.1.0" + dependencies: + graceful-fs: "npm:^4.1.6" + universalify: "npm:^2.0.0" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10c0/4f95b5e8a5622b1e9e8f33c96b7ef3158122f595998114d1e7f03985649ea99cb3cd99ce1ed1831ae94c8c8543ab45ebd044207612f31a56fd08462140e46865 + languageName: node + linkType: hard + "kind-of@npm:^3.0.2": version: 3.2.2 resolution: "kind-of@npm:3.2.2" @@ -64,11 +514,372 @@ __metadata: languageName: node linkType: hard +"kleur@npm:^3.0.3": + version: 3.0.3 + resolution: "kleur@npm:3.0.3" + checksum: 10c0/cd3a0b8878e7d6d3799e54340efe3591ca787d9f95f109f28129bdd2915e37807bf8918bb295ab86afb8c82196beec5a1adcaf29042ce3f2bd932b038fe3aa4b + languageName: node + linkType: hard + +"lib@link:./shared::locator=pnp%40workspace%3A.": + version: 0.0.0-use.local + resolution: "lib@link:./shared::locator=pnp%40workspace%3A." + languageName: node + linkType: soft + +"lines-and-columns@npm:^1.1.6": + version: 1.2.4 + resolution: "lines-and-columns@npm:1.2.4" + checksum: 10c0/3da6ee62d4cd9f03f5dc90b4df2540fb85b352081bee77fe4bbcd12c9000ead7f35e0a38b8d09a9bb99b13223446dd8689ff3c4959807620726d788701a83d2d + languageName: node + linkType: hard + +"lodash.zip@npm:^4.2.0": + version: 4.2.0 + resolution: "lodash.zip@npm:4.2.0" + checksum: 10c0/e596da80a6138e369998b50c78b51ed6cf984b4f239e59056aa18dca5972a213c491c511caf5888a2dec603c67265caf942099bec554a86a5c7ff1937d57f0e4 + languageName: node + linkType: hard + +"lodash@npm:^4.17.15": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: 10c0/d8cbea072bb08655bb4c989da418994b073a608dffa608b09ac04b43a791b12aeae7cd7ad919aa4c925f33b48490b5cfe6c1f71d827956071dae2e7bb3a6b74c + languageName: node + linkType: hard + +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 10c0/867fdbb30a6d58b011449b8885601ec1690c3e41c759ecd5a9d609094f7aed0096c37823ff4a7190ef0b8f22cc86beb7049196ff68c016e3b3c671d0dac91ce5 + languageName: node + linkType: hard + +"merge2@npm:^1.3.0, merge2@npm:^1.4.1": + version: 1.4.1 + resolution: "merge2@npm:1.4.1" + checksum: 10c0/254a8a4605b58f450308fc474c82ac9a094848081bf4c06778200207820e5193726dc563a0d2c16468810516a5c97d9d3ea0ca6585d23c58ccfff2403e8dbbeb + languageName: node + linkType: hard + +"micromatch@npm:^4.0.0, micromatch@npm:^4.0.8": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: "npm:^3.0.3" + picomatch: "npm:^2.3.1" + checksum: 10c0/166fa6eb926b9553f32ef81f5f531d27b4ce7da60e5baf8c021d043b27a388fb95e46a8038d5045877881e673f8134122b59624d5cecbd16eb50a42e7a6b5ca8 + languageName: node + linkType: hard + +"mimic-fn@npm:^2.1.0": + version: 2.1.0 + resolution: "mimic-fn@npm:2.1.0" + checksum: 10c0/b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 + languageName: node + linkType: hard + +"minimatch@npm:^3.0.4": + version: 3.1.2 + resolution: "minimatch@npm:3.1.2" + dependencies: + brace-expansion: "npm:^1.1.7" + checksum: 10c0/0262810a8fc2e72cca45d6fd86bd349eee435eb95ac6aa45c9ea2180e7ee875ef44c32b55b5973ceabe95ea12682f6e3725cbb63d7a2d1da3ae1163c8b210311 + languageName: node + linkType: hard + +"npm-run-path@npm:^4.0.1": + version: 4.0.1 + resolution: "npm-run-path@npm:4.0.1" + dependencies: + path-key: "npm:^3.0.0" + checksum: 10c0/6f9353a95288f8455cf64cbeb707b28826a7f29690244c1e4bb61ec573256e021b6ad6651b394eb1ccfd00d6ec50147253aba2c5fe58a57ceb111fad62c519ac + languageName: node + linkType: hard + +"onetime@npm:^5.1.2": + version: 5.1.2 + resolution: "onetime@npm:5.1.2" + dependencies: + mimic-fn: "npm:^2.1.0" + checksum: 10c0/ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f + languageName: node + linkType: hard + +"p-graph@npm:^1.1.2": + version: 1.1.2 + resolution: "p-graph@npm:1.1.2" + checksum: 10c0/8a78883c2d315a91e9187d1dd6595ca9dfdad62239fcdeafbbaa949baa375ae236a96ebd27f76b86d45eb678d70ec8cda02f1840c0dc9369243e53ec3d628049 + languageName: node + linkType: hard + +"p-limit@npm:^3.0.2": + version: 3.1.0 + resolution: "p-limit@npm:3.1.0" + dependencies: + yocto-queue: "npm:^0.1.0" + checksum: 10c0/9db675949dbdc9c3763c89e748d0ef8bdad0afbb24d49ceaf4c46c02c77d30db4e0652ed36d0a0a7a95154335fab810d95c86153105bb73b3a90448e2bb14e1a + languageName: node + linkType: hard + +"parent-module@npm:^1.0.0": + version: 1.0.1 + resolution: "parent-module@npm:1.0.1" + dependencies: + callsites: "npm:^3.0.0" + checksum: 10c0/c63d6e80000d4babd11978e0d3fee386ca7752a02b035fd2435960ffaa7219dc42146f07069fb65e6e8bf1caef89daf9af7535a39bddf354d78bf50d8294f556 + languageName: node + linkType: hard + +"parse-json@npm:^5.2.0": + version: 5.2.0 + resolution: "parse-json@npm:5.2.0" + dependencies: + "@babel/code-frame": "npm:^7.0.0" + error-ex: "npm:^1.3.1" + json-parse-even-better-errors: "npm:^2.3.0" + lines-and-columns: "npm:^1.1.6" + checksum: 10c0/77947f2253005be7a12d858aedbafa09c9ae39eb4863adf330f7b416ca4f4a08132e453e08de2db46459256fb66afaac5ee758b44fe6541b7cdaf9d252e59585 + languageName: node + linkType: hard + +"parse-path@npm:^7.0.0": + version: 7.1.0 + resolution: "parse-path@npm:7.1.0" + dependencies: + protocols: "npm:^2.0.0" + checksum: 10c0/8c8c8b3019323d686e7b1cd6fd9653bc233404403ad68827836fbfe59dfe26aaef64ed4e0396d0e20c4a7e1469312ec969a679618960e79d5e7c652dc0da5a0f + languageName: node + linkType: hard + +"parse-url@npm:^9.2.0": + version: 9.2.0 + resolution: "parse-url@npm:9.2.0" + dependencies: + "@types/parse-path": "npm:^7.0.0" + parse-path: "npm:^7.0.0" + checksum: 10c0/b8f56cdb01e76616255dff82544f4b5ab4378f6f4bac8604ed6fde03a75b0f71c547d92688386d8f22f38fad3c928c075abf69458677c6185da76c841bfd7a93 + languageName: node + linkType: hard + +"path-key@npm:^3.0.0, path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c + languageName: node + linkType: hard + +"path-type@npm:^4.0.0": + version: 4.0.0 + resolution: "path-type@npm:4.0.0" + checksum: 10c0/666f6973f332f27581371efaf303fd6c272cc43c2057b37aa99e3643158c7e4b2626549555d88626e99ea9e046f82f32e41bbde5f1508547e9a11b149b52387c + languageName: node + linkType: hard + +"picocolors@npm:^1.1.1": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 + languageName: node + linkType: hard + +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be + languageName: node + linkType: hard + "pnp@workspace:.": version: 0.0.0-use.local resolution: "pnp@workspace:." dependencies: + "@atlaskit/pragmatic-drag-and-drop": "npm:^1.5.2" + "@custom/pragmatic-drag-and-drop": "npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2" + beachball: "npm:^2.52.0" + custom-minimist: "npm:minimist@^1.2.8" is-even: "npm:^1.0.0" is-odd: "npm:^3.0.1" + lib: "link:./shared" + lodash.zip: "npm:^4.2.0" + pragmatic-drag-and-drop: "npm:@atlaskit/pragmatic-drag-and-drop@^1.5.2" + preact: "npm:^10.26.5" languageName: unknown linkType: soft + +"preact@npm:^10.26.5": + version: 10.26.9 + resolution: "preact@npm:10.26.9" + checksum: 10c0/15f187e3278ae749b70e887f88bb01be63ebcc2eea46ffa86be69180716db40b8b4304e9768767fd68a5910ef5fd1f9ea6389e17cd25e950be76574d568e8fc3 + languageName: node + linkType: hard + +"prompts@npm:^2.4.2": + version: 2.4.2 + resolution: "prompts@npm:2.4.2" + dependencies: + kleur: "npm:^3.0.3" + sisteransi: "npm:^1.0.5" + checksum: 10c0/16f1ac2977b19fe2cf53f8411cc98db7a3c8b115c479b2ca5c82b5527cd937aa405fa04f9a5960abeb9daef53191b53b4d13e35c1f5d50e8718c76917c5f1ea4 + languageName: node + linkType: hard + +"protocols@npm:^2.0.0, protocols@npm:^2.0.1": + version: 2.0.2 + resolution: "protocols@npm:2.0.2" + checksum: 10c0/b87d78c1fcf038d33691da28447ce94011d5c7f0c7fd25bcb5fb4d975991c99117873200c84f4b6a9d7f8b9092713a064356236960d1473a7d6fcd4228897b60 + languageName: node + linkType: hard + +"queue-microtask@npm:^1.2.2": + version: 1.2.3 + resolution: "queue-microtask@npm:1.2.3" + checksum: 10c0/900a93d3cdae3acd7d16f642c29a642aea32c2026446151f0778c62ac089d4b8e6c986811076e1ae180a694cedf077d453a11b58ff0a865629a4f82ab558e102 + languageName: node + linkType: hard + +"raf-schd@npm:^4.0.3": + version: 4.0.3 + resolution: "raf-schd@npm:4.0.3" + checksum: 10c0/ecabf0957c05fad059779bddcd992f1a9d3a35dfea439a6f0935c382fcf4f7f7fa60489e467b4c2db357a3665167d2a379782586b59712bb36c766e02824709b + languageName: node + linkType: hard + +"resolve-from@npm:^4.0.0": + version: 4.0.0 + resolution: "resolve-from@npm:4.0.0" + checksum: 10c0/8408eec31a3112ef96e3746c37be7d64020cda07c03a920f5024e77290a218ea758b26ca9529fd7b1ad283947f34b2291c1c0f6aa0ed34acfdda9c6014c8d190 + languageName: node + linkType: hard + +"reusify@npm:^1.0.4": + version: 1.1.0 + resolution: "reusify@npm:1.1.0" + checksum: 10c0/4eff0d4a5f9383566c7d7ec437b671cc51b25963bd61bf127c3f3d3f68e44a026d99b8d2f1ad344afff8d278a8fe70a8ea092650a716d22287e8bef7126bb2fa + languageName: node + linkType: hard + +"run-parallel@npm:^1.1.9": + version: 1.2.0 + resolution: "run-parallel@npm:1.2.0" + dependencies: + queue-microtask: "npm:^1.2.2" + checksum: 10c0/200b5ab25b5b8b7113f9901bfe3afc347e19bb7475b267d55ad0eb86a62a46d77510cb0f232507c9e5d497ebda569a08a9867d0d14f57a82ad5564d991588b39 + languageName: node + linkType: hard + +"semver@npm:^7.0.0": + version: 7.7.2 + resolution: "semver@npm:7.7.2" + bin: + semver: bin/semver.js + checksum: 10c0/aca305edfbf2383c22571cb7714f48cadc7ac95371b4b52362fb8eeffdfbc0de0669368b82b2b15978f8848f01d7114da65697e56cd8c37b0dab8c58e543f9ea + languageName: node + linkType: hard + +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: "npm:^3.0.0" + checksum: 10c0/a41692e7d89a553ef21d324a5cceb5f686d1f3c040759c50aab69688634688c5c327f26f3ecf7001ebfd78c01f3c7c0a11a7c8bfd0a8bc9f6240d4f40b224e4e + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 10c0/1dbed0726dd0e1152a92696c76c7f06084eb32a90f0528d11acd764043aacf76994b2fb30aa1291a21bd019d6699164d048286309a278855ee7bec06cf6fb690 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.3": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 + languageName: node + linkType: hard + +"sisteransi@npm:^1.0.5": + version: 1.0.5 + resolution: "sisteransi@npm:1.0.5" + checksum: 10c0/230ac975cca485b7f6fe2b96a711aa62a6a26ead3e6fb8ba17c5a00d61b8bed0d7adc21f5626b70d7c33c62ff4e63933017a6462942c719d1980bb0b1207ad46 + languageName: node + linkType: hard + +"slash@npm:^3.0.0": + version: 3.0.0 + resolution: "slash@npm:3.0.0" + checksum: 10c0/e18488c6a42bdfd4ac5be85b2ced3ccd0224773baae6ad42cfbb9ec74fc07f9fa8396bd35ee638084ead7a2a0818eb5e7151111544d4731ce843019dab4be47b + languageName: node + linkType: hard + +"strip-final-newline@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-final-newline@npm:2.0.0" + checksum: 10c0/bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f + languageName: node + linkType: hard + +"to-regex-range@npm:^5.0.1": + version: 5.0.1 + resolution: "to-regex-range@npm:5.0.1" + dependencies: + is-number: "npm:^7.0.0" + checksum: 10c0/487988b0a19c654ff3e1961b87f471702e708fa8a8dd02a298ef16da7206692e8552a0250e8b3e8759270f62e9d8314616f6da274734d3b558b1fc7b7724e892 + languageName: node + linkType: hard + +"toposort@npm:^2.0.2": + version: 2.0.2 + resolution: "toposort@npm:2.0.2" + checksum: 10c0/ab9ca91fce4b972ccae9e2f539d755bf799a0c7eb60da07fd985fce0f14c159ed1e92305ff55697693b5bc13e300f5417db90e2593b127d421c9f6c440950222 + languageName: node + linkType: hard + +"universalify@npm:^2.0.0": + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: 10c0/73e8ee3809041ca8b818efb141801a1004e3fc0002727f1531f4de613ea281b494a40909596dae4a042a4fb6cd385af5d4db2e137b1362e0e91384b828effd3a + languageName: node + linkType: hard + +"which@npm:^2.0.1": + version: 2.0.2 + resolution: "which@npm:2.0.2" + dependencies: + isexe: "npm:^2.0.0" + bin: + node-which: ./bin/node-which + checksum: 10c0/66522872a768b60c2a65a57e8ad184e5372f5b6a9ca6d5f033d4b0dc98aff63995655a7503b9c0a2598936f532120e81dd8cc155e2e92ed662a2b9377cc4374f + languageName: node + linkType: hard + +"workspace-tools@npm:^0.38.2": + version: 0.38.4 + resolution: "workspace-tools@npm:0.38.4" + dependencies: + "@yarnpkg/lockfile": "npm:^1.1.0" + fast-glob: "npm:^3.3.1" + git-url-parse: "npm:^16.0.0" + globby: "npm:^11.0.0" + jju: "npm:^1.4.0" + js-yaml: "npm:^4.1.0" + micromatch: "npm:^4.0.0" + checksum: 10c0/a61e8bbd2fb4e6c9c8d01b1f1527e2954f14abbcdf5c253ac9538ba462d844ffbf557ce8d262b9b79cfbdc34307a5b37b927725e01a976b3bf9da1bcef22bfe2 + languageName: node + linkType: hard + +"yargs-parser@npm:^21.0.0": + version: 21.1.1 + resolution: "yargs-parser@npm:21.1.1" + checksum: 10c0/f84b5e48169479d2f402239c59f084cfd1c3acc197a05c59b98bab067452e6b3ea46d4dd8ba2985ba7b3d32a343d77df0debd6b343e5dae3da2aab2cdf5886b2 + languageName: node + linkType: hard + +"yocto-queue@npm:^0.1.0": + version: 0.1.0 + resolution: "yocto-queue@npm:0.1.0" + checksum: 10c0/dceb44c28578b31641e13695d200d34ec4ab3966a5729814d5445b194933c096b7ced71494ce53a0e8820685d1d010df8b2422e5bf2cdea7e469d97ffbea306f + languageName: node + linkType: hard diff --git a/justfile b/justfile index 9e47174a..58dc4de1 100644 --- a/justfile +++ b/justfile @@ -15,6 +15,7 @@ init: install: pnpm install cd fixtures/pnp && yarn + cd fixtures/global-pnp && yarn # When ready, run the same CI commands ready: diff --git a/napi/index.d.ts b/napi/index.d.ts index 269e9fdd..49b9f45c 100644 --- a/napi/index.d.ts +++ b/napi/index.d.ts @@ -57,6 +57,8 @@ export interface NapiResolveOptions { * Default `None` */ tsconfig?: TsconfigOptions + /** Enable Yarn Plug'n'Play */ + yarnPnp?: boolean /** * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. * diff --git a/napi/src/lib.rs b/napi/src/lib.rs index c97a3dc2..b1b0b9cf 100644 --- a/napi/src/lib.rs +++ b/napi/src/lib.rs @@ -279,7 +279,7 @@ impl ResolverFactory { .allow_package_exports_in_directory_resolve .unwrap_or(default.allow_package_exports_in_directory_resolve), #[cfg(feature = "yarn_pnp")] - pnp_manifest: default.pnp_manifest, + yarn_pnp: op.yarn_pnp.unwrap_or(default.yarn_pnp), } } } diff --git a/napi/src/options.rs b/napi/src/options.rs index 541a7140..30eb3208 100644 --- a/napi/src/options.rs +++ b/napi/src/options.rs @@ -16,6 +16,9 @@ pub struct NapiResolveOptions { /// Default `None` pub tsconfig: Option, + /// Enable Yarn Plug'n'Play + pub yarn_pnp: Option, + /// Alias for [ResolveOptions::alias] and [ResolveOptions::fallback]. /// /// For the second value of the tuple, `None -> AliasValue::Ignore`, Some(String) -> diff --git a/src/cache.rs b/src/cache.rs index 2b35bae0..f6f2b813 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -8,7 +8,7 @@ use crate::{Ctx, PackageJson, ResolveError, ResolveOptions, TsConfig}; #[allow(clippy::missing_errors_doc)] // trait impls should be free to return any typesafe error pub trait Cache: Sized { - type Cp: CachedPath + Clone + Debug; + type Cp: CachedPath + Debug + Clone + Eq + std::hash::Hash; type Pj: PackageJson + Debug; type Tc: TsConfig + Debug; diff --git a/src/lib.rs b/src/lib.rs index c4886e60..9b934835 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,6 +135,8 @@ pub type Resolver = ResolverGeneric>; pub struct ResolverGeneric { options: ResolveOptions, cache: Arc, + #[cfg(feature = "yarn_pnp")] + pnp_cache: Arc>>, } impl fmt::Debug for ResolverGeneric { @@ -152,19 +154,34 @@ impl Default for ResolverGeneric { impl ResolverGeneric { #[must_use] pub fn new(options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::new(C::default()) } + Self { + options: options.sanitize(), + cache: Arc::new(C::default()), + #[cfg(feature = "yarn_pnp")] + pnp_cache: Arc::new(papaya::HashMap::default()), + } } } impl ResolverGeneric { pub fn new_with_cache(cache: Arc, options: ResolveOptions) -> Self { - Self { cache, options: options.sanitize() } + Self { + cache, + options: options.sanitize(), + #[cfg(feature = "yarn_pnp")] + pnp_cache: Arc::new(papaya::HashMap::default()), + } } /// Clone the resolver using the same underlying cache. #[must_use] pub fn clone_with_options(&self, options: ResolveOptions) -> Self { - Self { options: options.sanitize(), cache: Arc::clone(&self.cache) } + Self { + options: options.sanitize(), + cache: Arc::clone(&self.cache), + #[cfg(feature = "yarn_pnp")] + pnp_cache: Arc::clone(&self.pnp_cache), + } } /// Returns the options. @@ -780,7 +797,7 @@ impl ResolverGeneric { ctx: &mut Ctx, ) -> ResolveResult { #[cfg(feature = "yarn_pnp")] - { + if self.options.yarn_pnp { if let Some(resolved_path) = self.load_pnp(cached_path, specifier, ctx)? { return Ok(Some(resolved_path)); } @@ -866,35 +883,92 @@ impl ResolverGeneric { specifier: &str, ctx: &mut Ctx, ) -> Result, ResolveError> { - let Some(pnp_manifest) = &self.options.pnp_manifest else { return Ok(None) }; - let resolution = - pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, cached_path.path()); - match resolution { - Ok(pnp::Resolution::Resolved(path, subpath)) => { - let cached_path = self.cache.value(&path); - let export_resolution = self.load_package_exports( - specifier, - &subpath.unwrap_or_default(), - &cached_path, - ctx, - )?; - if export_resolution.is_some() { - return Ok(export_resolution); - } - let file_or_directory_resolution = - self.load_as_file_or_directory(&cached_path, specifier, ctx)?; - if file_or_directory_resolution.is_some() { - return Ok(file_or_directory_resolution); - } - Err(ResolveError::NotFound(specifier.to_string())) + let pnp_cache = self.pnp_cache.pin(); + let pnp_manifest = pnp_cache.get_or_insert_with(cached_path.clone(), || { + if let Some(path) = pnp::find_pnp_manifest(cached_path.path()).unwrap() { + return Some(path); + } + self.options.roots.iter().find_map(|root| pnp::find_pnp_manifest(root).unwrap()) + }); + + if let Some(pnp_manifest) = pnp_manifest.as_ref() { + // "pnpapi" in a P'n'P builtin module + if specifier == "pnpapi" { + return Ok(Some(self.cache.value(pnp_manifest.manifest_path.as_path()))); } - Ok(pnp::Resolution::Skipped) => Ok(None), + // `resolve_to_unqualified` requires a trailing slash + let mut path = cached_path.to_path_buf(); + path.push(""); - Err(_) => { - // Todo: Add a ResolveError::Pnp variant? - Err(ResolveError::NotFound(specifier.to_string())) + let resolution = + pnp::resolve_to_unqualified_via_manifest(pnp_manifest, specifier, path); + + match resolution { + Ok(pnp::Resolution::Resolved(path, subpath)) => { + let cached_path = self.cache.value(&path); + let cached_path_string = cached_path.path().to_string_lossy(); + + let export_resolution = self.load_package_self(&cached_path, specifier, ctx)?; + // can be found in pnp cached folder + if export_resolution.is_some() { + return Ok(export_resolution); + } + + // symbol linked package doesn't have node_modules structure + let pkg_name = cached_path_string.rsplit_once("node_modules/").map_or( + "", + // remove trailing slash + |(_, last)| last.strip_suffix('/').unwrap_or(last), + ); + + let inner_request = if pkg_name.is_empty() { + subpath.map_or_else( + || ".".to_string(), + |mut p| { + p.insert_str(0, "./"); + p + }, + ) + } else { + let (first, rest) = specifier.split_once('/').unwrap_or((specifier, "")); + // the original `pkg_name` in cached path could be different with specifier + // due to alias like `"custom-minimist": "npm:minimist@^1.2.8"` + // in this case, `specifier` is `pkg_name`'s source of truth + let pkg_name = if first.starts_with('@') { + &format!("{first}/{}", rest.split_once('/').unwrap_or((rest, "")).0) + } else { + first + }; + let inner_specifier = specifier.strip_prefix(pkg_name).unwrap(); + String::from("./") + + inner_specifier.strip_prefix("/").unwrap_or(inner_specifier) + }; + + // it could be a directory with `package.json` that redirects to another file, + // take `@atlaskit/pragmatic-drag-and-drop` for example, as described at import-js/eslint-import-resolver-typescript#409 + if let Ok(Some(result)) = self.load_as_directory( + &self.cache.value(&path.join(inner_request.clone()).normalize()), + ctx, + ) { + return Ok(Some(result)); + } + + let inner_resolver = self.clone_with_options(self.options().clone()); + + // try as file or directory `path` in the pnp folder + let Ok(inner_resolution) = inner_resolver.resolve(&path, &inner_request) else { + return Err(ResolveError::NotFound(specifier.to_string())); + }; + + Ok(Some(self.cache.value(inner_resolution.path()))) + } + + Ok(pnp::Resolution::Skipped) => Ok(None), + Err(_) => Err(ResolveError::NotFound(specifier.to_string())), } + } else { + Ok(None) } } diff --git a/src/options.rs b/src/options.rs index b2b972a4..c02c0624 100644 --- a/src/options.rs +++ b/src/options.rs @@ -113,11 +113,11 @@ pub struct ResolveOptions { /// Default `["node_modules"]` pub modules: Vec, - /// A manifest loaded from pnp::load_pnp_manifest. + /// Whether the resolver should check for the presence of a .pnp.cjs file up the dependency tree. /// - /// Default `None` + /// Default `true` #[cfg(feature = "yarn_pnp")] - pub pnp_manifest: Option, + pub yarn_pnp: bool, /// Resolve to a context instead of a file. /// @@ -485,7 +485,7 @@ impl Default for ResolveOptions { main_files: vec!["index".into()], modules: vec!["node_modules".into()], #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, + yarn_pnp: true, resolve_to_context: false, prefer_relative: false, prefer_absolute: false, @@ -645,7 +645,7 @@ mod test { main_files: vec![], modules: vec![], #[cfg(feature = "yarn_pnp")] - pnp_manifest: None, + yarn_pnp: true, prefer_absolute: false, prefer_relative: false, resolve_to_context: false, diff --git a/src/tests/pnp.rs b/src/tests/pnp.rs index 170bf66c..2ca2c6a2 100644 --- a/src/tests/pnp.rs +++ b/src/tests/pnp.rs @@ -3,15 +3,16 @@ //! enhanced_resolve's test //! cannot be ported over because it uses mocks on `pnpApi` provided by the runtime. +use crate::ResolveError::NotFound; use crate::{ResolveOptions, Resolver}; #[test] -fn pnp1() { +fn pnp_basic() { let fixture = super::fixture_root().join("pnp"); let resolver = Resolver::new(ResolveOptions { extensions: vec![".js".into()], - pnp_manifest: Some(pnp::load_pnp_manifest(fixture.join(".pnp.cjs")).unwrap()), + condition_names: vec!["import".into()], ..ResolveOptions::default() }); @@ -22,6 +23,13 @@ fn pnp1() { )) ); + assert_eq!( + resolver.resolve(&fixture, "lodash.zip").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/lodash.zip-npm-4.2.0-5299417ec8-e596da80a6.zip/node_modules/lodash.zip/index.js" + )) + ); + assert_eq!( resolver .resolve( @@ -42,4 +50,148 @@ fn pnp1() { ".yarn/cache/is-odd-npm-3.0.1-93c3c3f41b-89ee2e353c.zip/node_modules/is-odd/index.js" )), ); + + assert_eq!( + resolver.resolve(&fixture, "preact").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/preact-npm-10.26.9-90e1df1a58-15f187e327.zip/node_modules/preact/dist/preact.mjs" + )), + ); + + assert_eq!( + resolver.resolve(&fixture, "preact/devtools").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/preact-npm-10.26.9-90e1df1a58-15f187e327.zip/node_modules/preact/devtools/dist/devtools.mjs" + )), + ); + + assert_eq!( + resolver.resolve(&fixture, "pnpapi").map(|r| r.full_path()), + Ok(fixture.join(".pnp.cjs")), + ); +} + +#[test] +fn resolve_in_pnp_linked_folder() { + let fixture = super::fixture_root().join("pnp"); + + let resolver = Resolver::new(ResolveOptions { + extensions: vec![".js".into()], + condition_names: vec!["import".into()], + ..ResolveOptions::default() + }); + + assert_eq!( + resolver.resolve(&fixture, "lib/lib.js").map(|r| r.full_path()), + Ok(fixture.join("shared/lib.js")) + ); +} + +#[test] +fn resolve_pnp_pkg_should_failed_while_disable_pnp_mode() { + let fixture = super::fixture_root().join("pnp"); + + let resolver = Resolver::new(ResolveOptions { yarn_pnp: false, ..ResolveOptions::default() }); + + assert_eq!( + resolver.resolve(&fixture, "is-even").map(|r| r.full_path()), + Err(NotFound("is-even".to_string())) + ); +} + +#[test] +fn resolve_package_deep_link() { + let fixture = super::fixture_root().join("pnp"); + + let resolver = Resolver::new(ResolveOptions::default()); + + assert_eq!( + resolver.resolve(fixture.join("shared"), "beachball/lib/commands/bump.js").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/beachball-npm-2.54.0-050eafd5c8-4dd08576af.zip/node_modules/beachball/lib/commands/bump.js" + )), + ); +} + +#[test] +fn resolve_pnp_nested_package_json() { + let fixture = super::fixture_root().join("pnp"); + + let resolver = Resolver::new({ + ResolveOptions { + main_fields: vec!["module".into(), "main".into()], + ..ResolveOptions::default() + } + }); + + assert_eq!( + resolver.resolve(&fixture, "@atlaskit/pragmatic-drag-and-drop/combine").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/@atlaskit-pragmatic-drag-and-drop-npm-1.7.3-a09c04b71c-d7c6e1a2e4.zip/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js" + )) + ); +} + +#[test] +fn resolve_npm_protocol_alias() { + let fixture = super::fixture_root().join("pnp"); + + let resolver = Resolver::default(); + + assert_eq!( + resolver.resolve(&fixture, "custom-minimist").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/minimist-npm-1.2.8-d7af7b1dce-19d3fcdca0.zip/node_modules/minimist/index.js" + )) + ); + + assert_eq!( + resolver.resolve(&fixture, "@custom/pragmatic-drag-and-drop").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/@atlaskit-pragmatic-drag-and-drop-npm-1.7.3-a09c04b71c-d7c6e1a2e4.zip/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/cjs/index.js" + )) + ); + + assert_eq!( + resolver.resolve(&fixture, "pragmatic-drag-and-drop").map(|r| r.full_path()), + Ok(fixture.join( + ".yarn/cache/@atlaskit-pragmatic-drag-and-drop-npm-1.7.3-a09c04b71c-d7c6e1a2e4.zip/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/cjs/index.js" + )) + ); +} + +// Windows is blocked by upstream +// see also https://github.com/yarnpkg/pnp-rs/pull/10 +#[cfg(not(windows))] +#[test] +fn resolve_global_cache() { + let home_dir = dirs::home_dir().unwrap(); + + #[cfg(windows)] + let global_cache = home_dir.join("AppData\\Local\\Yarn\\Berry"); + #[cfg(not(windows))] + let global_cache = home_dir.join(".yarn/berry/cache"); + + let resolver = Resolver::new(ResolveOptions { + roots: vec![super::fixture_root().join("global-pnp")], + ..ResolveOptions::default() + }); + + assert_eq!( + resolver + .resolve( + global_cache + .join("source-map-support-npm-0.5.21-09ca99e250-10c0.zip") + .join("node_modules") + .join("source-map-support") + .join(""), + "source-map" + ) + .map(|r| r.full_path()), + Ok(global_cache + .join("source-map-npm-0.6.1-1a3621db16-10c0.zip") + .join("node_modules") + .join("source-map") + .join("source-map.js")), + ); }