Skip to content

Commit

Permalink
fix: bin file name for pnpm >=6.0 (#35)
Browse files Browse the repository at this point in the history
* fix: bin file name for pnpm >=6.0

* Adds test

* Adds nock entry

Co-authored-by: Maël Nison <[email protected]>
  • Loading branch information
shisama and arcanis authored May 31, 2021
1 parent ee2d45d commit 8ff2499
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
]
},
"ranges": {
"*": {
"<6.0.0": {
"url": "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz",
"bin": {
"pnpm": "./bin/pnpm.js",
Expand All @@ -41,6 +41,17 @@
"type": "npm",
"package": "pnpm"
}
},
">=6.0.0": {
"url": "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz",
"bin": {
"pnpm": "./bin/pnpm.cjs",
"pnpx": "./bin/pnpx.cjs"
},
"tags": {
"type": "npm",
"package": "pnpm"
}
}
}
},
Expand Down
11 changes: 10 additions & 1 deletion tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ beforeEach(async () => {
process.env.COREPACK_HOME = npath.fromPortablePath(await xfs.mktempPromise());
});

for (const [name, version] of [[`yarn`, `1.22.4`], [`yarn`, `2.0.0-rc.30`], [`yarn`, `3.0.0-rc.2`], [`pnpm`, `4.11.6`], [`npm`, `6.14.2`]]) {
const testedPackageManagers: [string, string][] = [
[`yarn`, `1.22.4`],
[`yarn`, `2.0.0-rc.30`],
[`yarn`, `3.0.0-rc.2`],
[`pnpm`, `4.11.6`],
[`pnpm`, `6.6.2`],
[`npm`, `6.14.2`],
];

for (const [name, version] of testedPackageManagers) {
it(`should use the right package manager version for a given project (${name}@${version})`, async () => {
await xfs.mktempPromise(async cwd => {
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), {
Expand Down
Binary file added tests/nock/2b6ea0b916d81bdbd9610c20154e651e.dat
Binary file not shown.
Binary file modified tests/nock/31547e0cfc442fb8d013d69eb40efdd5.dat
Binary file not shown.
Binary file modified tests/nock/33cd8454d05733cc85927ead3827e530.dat
Binary file not shown.
Binary file modified tests/nock/56d313acc6b3c9facc9880412df746cc.dat
Binary file not shown.
Binary file modified tests/nock/726d31626ab89c98bcf7a4fdd9e56c2c.dat
Binary file not shown.
Binary file modified tests/nock/803df9e3e921c591cdf0824fadeea2ab.dat
Binary file not shown.
Binary file modified tests/nock/954dd4b8cba8adecfd4338925211a0f2.dat
Binary file not shown.
Binary file modified tests/nock/b6b52de887cdae78fcc91926b018cd8f.dat
Binary file not shown.
Binary file modified tests/nock/cc8a8d48e90ac9d95b6720b8be9165ba.dat
Binary file not shown.
Binary file modified tests/nock/cef51e93f92c7c41705919c0254b8e17.dat
Binary file not shown.
Binary file modified tests/nock/d95b9c8791279b33c455e9750d661f3d.dat
Binary file not shown.
Binary file modified tests/nock/da2b6ea88217b10514e65d926523110d.dat
Binary file not shown.
Binary file modified tests/nock/e087e0c28c4d479255e5b0688d2dba2a.dat
Binary file not shown.
Binary file modified tests/nock/eff64a4911c6ece7e446f3c91d8a716d.dat
Binary file not shown.
Binary file modified tests/nock/fdbda9c68c89e4c0d0a7090f6689e6be.dat
Binary file not shown.

0 comments on commit 8ff2499

Please sign in to comment.