Skip to content

Commit 8ff2499

Browse files
shisamaarcanis
andauthored
fix: bin file name for pnpm >=6.0 (#35)
* fix: bin file name for pnpm >=6.0 * Adds test * Adds nock entry Co-authored-by: Maël Nison <nison.mael@gmail.com>
1 parent ee2d45d commit 8ff2499

17 files changed

+22
-2
lines changed

config.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
]
3232
},
3333
"ranges": {
34-
"*": {
34+
"<6.0.0": {
3535
"url": "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz",
3636
"bin": {
3737
"pnpm": "./bin/pnpm.js",
@@ -41,6 +41,17 @@
4141
"type": "npm",
4242
"package": "pnpm"
4343
}
44+
},
45+
">=6.0.0": {
46+
"url": "https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz",
47+
"bin": {
48+
"pnpm": "./bin/pnpm.cjs",
49+
"pnpx": "./bin/pnpx.cjs"
50+
},
51+
"tags": {
52+
"type": "npm",
53+
"package": "pnpm"
54+
}
4455
}
4556
}
4657
},

tests/main.test.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ beforeEach(async () => {
88
process.env.COREPACK_HOME = npath.fromPortablePath(await xfs.mktempPromise());
99
});
1010

11-
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`]]) {
11+
const testedPackageManagers: [string, string][] = [
12+
[`yarn`, `1.22.4`],
13+
[`yarn`, `2.0.0-rc.30`],
14+
[`yarn`, `3.0.0-rc.2`],
15+
[`pnpm`, `4.11.6`],
16+
[`pnpm`, `6.6.2`],
17+
[`npm`, `6.14.2`],
18+
];
19+
20+
for (const [name, version] of testedPackageManagers) {
1221
it(`should use the right package manager version for a given project (${name}@${version})`, async () => {
1322
await xfs.mktempPromise(async cwd => {
1423
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as Filename), {
5.17 MB
Binary file not shown.
-1 Bytes
Binary file not shown.
Binary file not shown.
-2 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-3 Bytes
Binary file not shown.
-2 Bytes
Binary file not shown.
Binary file not shown.
-2 Bytes
Binary file not shown.
-2 Bytes
Binary file not shown.
-2 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)