@pnpm/exe 11.0.0-beta.4 → 11.0.0-beta.4-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pnpm.mjs CHANGED
@@ -1000,7 +1000,7 @@ var init_lib2 = __esm({
1000
1000
  "use strict";
1001
1001
  defaultManifest = {
1002
1002
  name: true ? "pnpm" : "pnpm",
1003
- version: true ? "11.0.0-beta.4" : "0.0.0"
1003
+ version: true ? "11.0.0-beta.4-0" : "0.0.0"
1004
1004
  };
1005
1005
  pkgJson = defaultManifest;
1006
1006
  packageManager = {
@@ -201449,6 +201449,20 @@ function linkExePlatformBinary(installDir) {
201449
201449
  if (!fs88.existsSync(src2))
201450
201450
  return;
201451
201451
  const dest = path161.join(exePkgDir, executable);
201452
+ forceLink(src2, dest);
201453
+ const pnExecutable = platform3 === "win" ? "pn.exe" : "pn";
201454
+ forceLink(src2, path161.join(exePkgDir, pnExecutable));
201455
+ if (platform3 === "win") {
201456
+ const exePkgJsonPath = path161.join(exePkgDir, "package.json");
201457
+ const exePkg = JSON.parse(fs88.readFileSync(exePkgJsonPath, "utf8"));
201458
+ exePkg.bin.pnpm = "pnpm.exe";
201459
+ exePkg.bin.pn = "pn.exe";
201460
+ exePkg.bin.pnpx = "pnpx.cmd";
201461
+ exePkg.bin.pnx = "pnx.cmd";
201462
+ fs88.writeFileSync(exePkgJsonPath, JSON.stringify(exePkg, null, 2));
201463
+ }
201464
+ }
201465
+ function forceLink(src2, dest) {
201452
201466
  try {
201453
201467
  fs88.unlinkSync(dest);
201454
201468
  } catch (err) {
@@ -201458,14 +201472,6 @@ function linkExePlatformBinary(installDir) {
201458
201472
  }
201459
201473
  fs88.linkSync(src2, dest);
201460
201474
  fs88.chmodSync(dest, 493);
201461
- if (platform3 === "win") {
201462
- const exePkgJsonPath = path161.join(exePkgDir, "package.json");
201463
- const exePkg = JSON.parse(fs88.readFileSync(exePkgJsonPath, "utf8"));
201464
- fs88.writeFileSync(path161.join(exePkgDir, "pnpm"), "This file intentionally left blank");
201465
- exePkg.bin.pnpm = "pnpm.exe";
201466
- exePkg.bin.pn = "pn.exe";
201467
- fs88.writeFileSync(exePkgJsonPath, JSON.stringify(exePkg, null, 2));
201468
- }
201469
201475
  }
201470
201476
  function buildLockfileFromEnvLockfile(envLockfile, pkgName, version2) {
201471
201477
  const dependencies = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/exe",
3
- "version": "11.0.0-beta.4",
3
+ "version": "11.0.0-beta.4-0",
4
4
  "description": "Fast, disk space efficient package manager",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -18,23 +18,32 @@
18
18
  "files": [
19
19
  "setup.js",
20
20
  "prepare.js",
21
- "dist/"
21
+ "dist/",
22
+ "pnpx.cmd",
23
+ "pnpx.ps1",
24
+ "pnx.cmd",
25
+ "pnx.ps1"
22
26
  ],
23
27
  "dependencies": {
24
28
  "@reflink/reflink": "0.1.19"
25
29
  },
26
30
  "optionalDependencies": {
27
- "@pnpm/linux-arm64": "11.0.0-beta.4",
28
- "@pnpm/linux-x64": "11.0.0-beta.4",
29
- "@pnpm/macos-arm64": "11.0.0-beta.4",
30
- "@pnpm/macos-x64": "11.0.0-beta.4",
31
- "@pnpm/win-x64": "11.0.0-beta.4",
32
- "@pnpm/win-arm64": "11.0.0-beta.4"
31
+ "@pnpm/macos-arm64": "11.0.0-beta.4-0",
32
+ "@pnpm/linux-x64": "11.0.0-beta.4-0",
33
+ "@pnpm/linux-arm64": "11.0.0-beta.4-0",
34
+ "@pnpm/macos-x64": "11.0.0-beta.4-0",
35
+ "@pnpm/win-x64": "11.0.0-beta.4-0",
36
+ "@pnpm/win-arm64": "11.0.0-beta.4-0"
33
37
  },
34
38
  "devDependencies": {
39
+ "@jest/globals": "30.3.0",
35
40
  "execa": "npm:safe-execa@0.3.0",
36
41
  "tar": "^7.5.10",
37
- "@pnpm/exe": "11.0.0-beta.4"
42
+ "@pnpm/exe": "11.0.0-beta.4-0",
43
+ "@pnpm/jest-config": "1000.0.5"
44
+ },
45
+ "jest": {
46
+ "preset": "@pnpm/jest-config"
38
47
  },
39
48
  "preferGlobal": true,
40
49
  "publishConfig": {
package/pnpx CHANGED
@@ -1 +1,2 @@
1
- This file intentionally left blank
1
+ #!/bin/sh
2
+ exec pnpm dlx "$@"
package/pnpx.cmd ADDED
@@ -0,0 +1,2 @@
1
+ @echo off
2
+ pnpm dlx %*
package/pnpx.ps1 ADDED
@@ -0,0 +1 @@
1
+ pnpm dlx @args
package/pnx CHANGED
@@ -1 +1,2 @@
1
- This file intentionally left blank
1
+ #!/bin/sh
2
+ exec pnpm dlx "$@"
package/pnx.cmd ADDED
@@ -0,0 +1,2 @@
1
+ @echo off
2
+ pnpm dlx %*
package/pnx.ps1 ADDED
@@ -0,0 +1 @@
1
+ pnpm dlx @args
package/prepare.js CHANGED
@@ -4,7 +4,8 @@ import path from 'path'
4
4
  const ownDir = import.meta.dirname
5
5
  const placeholder = 'This file intentionally left blank'
6
6
 
7
- for (const name of ['pnpm', 'pn', 'pnpx', 'pnx']) {
7
+ // pnpm and pn are placeholders replaced with hardlinks by setup.js
8
+ for (const name of ['pnpm', 'pn']) {
8
9
  const file = path.join(ownDir, name)
9
10
  try {
10
11
  fs.unlinkSync(file)
@@ -13,3 +14,16 @@ for (const name of ['pnpm', 'pn', 'pnpx', 'pnx']) {
13
14
  }
14
15
  fs.writeFileSync(file, placeholder, 'utf8')
15
16
  }
17
+
18
+ // pnpx and pnx — write the real shell scripts and Windows wrappers
19
+ for (const [name, command] of [['pnpx', 'pnpm dlx'], ['pnx', 'pnpm dlx']]) {
20
+ const file = path.join(ownDir, name)
21
+ try {
22
+ fs.unlinkSync(file)
23
+ } catch (e) {
24
+ if (e.code !== 'ENOENT') throw e
25
+ }
26
+ fs.writeFileSync(file, `#!/bin/sh\nexec ${command} "$@"\n`, { mode: 0o755 })
27
+ fs.writeFileSync(path.join(ownDir, name + '.cmd'), `@echo off\n${command} %*\n`)
28
+ fs.writeFileSync(path.join(ownDir, name + '.ps1'), `${command} @args\n`)
29
+ }
package/setup.js CHANGED
@@ -25,10 +25,6 @@ linkSync(bin, path.resolve(ownDir, executable))
25
25
  const pnExecutable = platform === 'win' ? 'pn.exe' : 'pn'
26
26
  linkSync(bin, path.resolve(ownDir, pnExecutable))
27
27
 
28
- // Create pnpx and pnx scripts
29
- createShellScript(ownDir, 'pnpx', 'pnpm dlx')
30
- createShellScript(ownDir, 'pnx', 'pnpm dlx')
31
-
32
28
  if (platform === 'win') {
33
29
  // On Windows, also hardlink the binary as 'pnpm' and 'pn' (no .exe
34
30
  // extension). npm's bin shims point to the name from publishConfig.bin,
@@ -57,12 +53,3 @@ function linkSync(src, dest) {
57
53
  }
58
54
  return fs.linkSync(src, dest)
59
55
  }
60
-
61
- function createShellScript(dir, name, command) {
62
- fs.writeFileSync(path.resolve(dir, name), `#!/bin/sh\nexec ${command} "$@"\n`, { mode: 0o755 })
63
-
64
- if (platform === 'win') {
65
- fs.writeFileSync(path.resolve(dir, name + '.cmd'), `@echo off\n${command} %*\n`)
66
- fs.writeFileSync(path.resolve(dir, name + '.ps1'), `${command} @args\n`)
67
- }
68
- }