pnpm 12.8.2 → 12.9.1
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/CHANGELOG.md +163 -0
- package/bin/pnpm.mjs +3 -0
- package/bin/pnpx.mjs +1 -1
- package/dist/node_modules/.bin/get-pnpm +10 -6
- package/dist/node_modules/.bin/node-gyp +10 -6
- package/dist/node_modules/.bin/node-which +10 -6
- package/dist/node_modules/.bin/nopt +10 -6
- package/dist/node_modules/.bin/semver +10 -6
- package/dist/node_modules/.pnpm-workspace-state-v1.json +6 -2
- package/install.js +11 -21
- package/package.json +15 -15
- package/pn +2 -74
- package/pnpm +2 -94
- package/pnpx +2 -74
- package/pnx +2 -74
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,168 @@
|
|
|
1
1
|
# pnpm
|
|
2
2
|
|
|
3
|
+
## 12.9.1
|
|
4
|
+
|
|
5
|
+
This release moves the WebContainer build into a separate `@pnpm/wasm` package, shrinks the `pnpm` package back to about 4 MB, and fixes `pnpm publish` with provenance from GitLab CI.
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- The WebAssembly build for StackBlitz WebContainers now ships as a separate `@pnpm/wasm` package. The `pnpm` and `@pnpm/exe` packages no longer include it, which brings their unpacked size back from about 55 MB to about 4 MB. In a WebContainer, install `@pnpm/wasm` with npm to get the `pnpm` command.
|
|
10
|
+
|
|
11
|
+
- `pnpm publish` with provenance from GitLab CI is no longer rejected by the npm registry with a 422 error. The provenance statement now includes the GitLab CI variables in `invocation.parameters`, as npm does [#16551](https://github.com/pnpm/pnpm/issues/16551).
|
|
12
|
+
|
|
13
|
+
- `pnpm audit signatures` now uses the TLS settings of the redirect target when a registry redirects its signing-keys request, for example to registry.npmjs.org. A `cafile` scoped to a private registry no longer makes the redirected request fail [#16541](https://github.com/pnpm/pnpm/issues/16541).
|
|
14
|
+
|
|
15
|
+
- Fixed `pnpm install --frozen-lockfile` rejecting an up-to-date lockfile when an injected workspace package uses a catalog entry in `peerDependencies` [#16557](https://github.com/pnpm/pnpm/issues/16557).
|
|
16
|
+
|
|
17
|
+
- The `[<since>]` filter selector works again with Git 2.24 through 2.27 [#16561](https://github.com/pnpm/pnpm/issues/16561). With Git older than 2.24, the selector now fails with an error that names the required Git version.
|
|
18
|
+
|
|
19
|
+
It also detects changes in projects whose directory names contain non-ASCII characters. Such a change used to be credited to the parent project. `changedFilesIgnorePattern` and `testPattern` now match changed files whose names contain non-ASCII characters.
|
|
20
|
+
|
|
21
|
+
- The `pnpm` executable is about 10% smaller. On macOS arm64 it went from 45.1 MB to 40.3 MB.
|
|
22
|
+
|
|
23
|
+
- Sped up trust downgrade checks for packages with long release histories.
|
|
24
|
+
|
|
25
|
+
- With `optimisticRepeatInstall: false`, `pnpm install` now runs the projects' own lifecycle scripts, such as `prepare`, even when `node_modules` is already up to date [#16545](https://github.com/pnpm/pnpm/issues/16545).
|
|
26
|
+
|
|
27
|
+
- `pnpm self-update` now fails for Homebrew-installed pnpm and prints the `brew upgrade` command for the installed formula, such as `brew upgrade pnpm` or `brew upgrade pnpm@11`. It used to install a second copy of pnpm that the Homebrew one kept shadowing [#16547](https://github.com/pnpm/pnpm/issues/16547).
|
|
28
|
+
|
|
29
|
+
## 12.9.0
|
|
30
|
+
|
|
31
|
+
This release runs pnpm in StackBlitz WebContainers, adds a per-registry `networkConcurrency` setting, and records every installed project in the store. It also carries a security fix for `pnpm login`.
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- pnpm now automatically uses WebAssembly in StackBlitz WebContainers, including when installation scripts are disabled. Native installations continue to use the native executable when installation scripts are enabled.
|
|
36
|
+
|
|
37
|
+
- A `registries` entry can now set `networkConcurrency`, the most requests pnpm keeps in flight to that registry's origin. Requests to other registries keep the overall limit. The setting may live in `pnpm-workspace.yaml` or the global `config.yaml`.
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
registries:
|
|
41
|
+
https://npm.corp.example.com/:
|
|
42
|
+
scopes: ["@acme"]
|
|
43
|
+
networkConcurrency: 4
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `pnpm install` now records every project it installs in the store's `projects` directory, as a symlink to the project directory. A `--frozen-store` install without the global virtual store still records nothing. Only projects that used the global virtual store were recorded before [#6929](https://github.com/pnpm/pnpm/issues/6929).
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- `pnpm login` no longer forwards credentials in its request body to another origin during redirects.
|
|
51
|
+
|
|
52
|
+
#### Installing packages
|
|
53
|
+
|
|
54
|
+
- Fixed `pnpm install` failing on Android with `ERR_PNPM_STORE_DIR_ACQUIRE_OPERATION_LOCK` [#16508](https://github.com/pnpm/pnpm/issues/16508).
|
|
55
|
+
|
|
56
|
+
- `pnpm install --frozen-lockfile` again succeeds when a workspace project recorded in `pnpm-lock.yaml` has no directory, such as a project left out of a Docker build context. It still fails if the project's directory exists without a `package.json` [#16453](https://github.com/pnpm/pnpm/issues/16453).
|
|
57
|
+
|
|
58
|
+
- `pnpm install --frozen-lockfile` no longer requires a `pnpm-lock.yaml` in a project that has no dependencies. It also succeeds when `pnpm-lock.yaml` records only the pinned pnpm version, as other commands write it when they run before the first install [#16477](https://github.com/pnpm/pnpm/issues/16477).
|
|
59
|
+
|
|
60
|
+
- Fixed `pnpm install --frozen-lockfile` rejecting a fresh lockfile when an injected workspace dependency has an optional peer supplied by another workspace project [#16428](https://github.com/pnpm/pnpm/issues/16428).
|
|
61
|
+
|
|
62
|
+
- With `nodeLinker: hoisted`, a filtered install now keeps the packages of the workspace projects an earlier install put in `node_modules`. This also covers the install that `pnpm --filter <selector> run` and `pnpm --filter <selector> exec` start before the command. Before, these installs removed every package that only the unselected projects needed [#16483](https://github.com/pnpm/pnpm/issues/16483).
|
|
63
|
+
|
|
64
|
+
- `pnpm install` with `nodeLinker: hoisted` now refreshes directories supplied by custom fetchers when reinstalling. pnpm also keeps the symlinks inside those directories.
|
|
65
|
+
|
|
66
|
+
- With `enableGlobalVirtualStore` on, scripts can run entry points that a CommonJS require hook loads again, such as `ts-node index.ts`. They failed with `ERR_UNKNOWN_FILE_EXTENSION` on Node.js versions without built-in TypeScript support [#16436](https://github.com/pnpm/pnpm/issues/16436).
|
|
67
|
+
|
|
68
|
+
- pnpm now keeps each project's current lockfile and hidden hoisted dependencies in its own `node_modules/.pnpm` when `virtualStoreDir` points at a shared global virtual store. `--virtual-store-dir` now sets the global virtual store's location too [pnpm/tasks#47](https://github.com/pnpm/tasks/issues/47).
|
|
69
|
+
|
|
70
|
+
- `pnpm clean` no longer deletes the project when `virtualStoreDir` or `globalVirtualStoreDir` is set to the project directory. It also leaves a directory outside the project alone when the setting reaches it through a symlink. It now removes a global virtual store that `globalVirtualStoreDir` places inside the project, as it does for `virtualStoreDir`.
|
|
71
|
+
|
|
72
|
+
#### Optional dependencies
|
|
73
|
+
|
|
74
|
+
- `pnpm install` no longer fails when a dependency of an optional dependency is missing from the registry. Like npm, pnpm now leaves out the nearest optional dependency above it, together with its subtree [#16511](https://github.com/pnpm/pnpm/issues/16511).
|
|
75
|
+
|
|
76
|
+
- When an optional dependency fails to build, pnpm now removes its link from `node_modules`. A repeat `pnpm install` then reports "Already up to date" and no longer reruns the failing build [#16468](https://github.com/pnpm/pnpm/issues/16468).
|
|
77
|
+
|
|
78
|
+
- `pnpm install` now prints a warning with the error when an optional dependency cannot be fetched and is skipped. The skipped package is no longer counted in the `Packages: +N` summary. The `pnpm:skipped-optional-dependency` log reports the skip with the `fetch_failure` reason [#16514](https://github.com/pnpm/pnpm/issues/16514).
|
|
79
|
+
|
|
80
|
+
#### Resolving dependencies
|
|
81
|
+
|
|
82
|
+
- Fixed `pnpm install` changing an unchanged project's direct dependency to a sibling workspace's pinned version when its dependency tree contains a cycle [#16417](https://github.com/pnpm/pnpm/issues/16417).
|
|
83
|
+
|
|
84
|
+
- With `autoDedupe` enabled, downgrading a dependency in one workspace project now moves the other projects to that version when it satisfies their ranges. This also applies to a filtered `pnpm --filter <project> add` [#16432](https://github.com/pnpm/pnpm/issues/16432).
|
|
85
|
+
|
|
86
|
+
- `pnpm install` and `pnpm dedupe` now move an optional peer to the version already in the dependency graph when no other package provides its locked version anymore. After a bump such as `vue` 3.5.40 to 3.5.43, the lockfile kept a second copy of `@vue/server-renderer` for `@vue/test-utils` [#16443](https://github.com/pnpm/pnpm/issues/16443).
|
|
87
|
+
|
|
88
|
+
- `pnpm dedupe --check` no longer fails right after `pnpm install` when a project's optional peer is satisfied by a package another workspace project installs. `pnpm dedupe` now picks the same versions for that package's dependencies as `pnpm install` [#16447](https://github.com/pnpm/pnpm/issues/16447).
|
|
89
|
+
|
|
90
|
+
- `pnpm install` no longer re-resolves an up-to-date lockfile on every run when a patched package is a peer in a peer cycle [#16418](https://github.com/pnpm/pnpm/issues/16418).
|
|
91
|
+
|
|
92
|
+
- With `autoDedupe` enabled, `pnpm install --lockfile-only` no longer resolves the dependency graph again when nothing changed since an earlier `--lockfile-only` install deduplicated the lockfile. Such an install keeps the lockfile even if versions were published since it was written, or if only a setting such as `resolutionMode` changed. Run `pnpm dedupe` to apply such a change [#16458](https://github.com/pnpm/pnpm/issues/16458).
|
|
93
|
+
|
|
94
|
+
#### Speed and network
|
|
95
|
+
|
|
96
|
+
- A repeat `pnpm install` in a large workspace reports "Already up to date" faster [#16487](https://github.com/pnpm/pnpm/issues/16487).
|
|
97
|
+
|
|
98
|
+
- Sped up dependency resolution of workspaces with many peer dependencies.
|
|
99
|
+
|
|
100
|
+
- `pnpm install` sends fewer registry metadata requests when the lockfile already decides which version a range resolves to. This now also covers ranges that several locked versions satisfy when one of them outranks the others, and direct dependencies kept at their locked version. Packages that `minimumReleaseAgeExclude` lists without a version now reuse cached registry metadata the same way they do when `minimumReleaseAge` is not set [#16458](https://github.com/pnpm/pnpm/issues/16458).
|
|
101
|
+
|
|
102
|
+
- pnpm no longer downloads every packument again on each install from a registry whose metadata responses forbid caching, such as `Cache-Control: no-store`. pnpm revalidates the cached metadata with a conditional request, so a registry that supports conditional requests answers with a 304 when the package has not changed [#16528](https://github.com/pnpm/pnpm/issues/16528).
|
|
103
|
+
|
|
104
|
+
- Cached metadata for a package published within `minimumReleaseAge` is now revalidated with its ETag, so the npm registry can answer `304 Not Modified`. Before, the next install that checked the cache downloaded the whole document again [#16506](https://github.com/pnpm/pnpm/issues/16506).
|
|
105
|
+
|
|
106
|
+
- A fetch timeout while other downloads from the same host are still running now lowers concurrency for that host to one connection. Retries of that request, and later downloads from that host, use the lower concurrency. Other hosts keep the configured concurrency [#12791](https://github.com/pnpm/pnpm/issues/12791).
|
|
107
|
+
|
|
108
|
+
- Sped up `pnpm install --offline` when the version a range picks is not in the store. While it looks for a version the store holds, pnpm now reads only the versions the range admits [#16495](https://github.com/pnpm/pnpm/issues/16495).
|
|
109
|
+
|
|
110
|
+
- `pnpm install --offline` now reuses config dependency tarballs that are already present in the store [pnpm/tasks#46](https://github.com/pnpm/tasks/issues/46).
|
|
111
|
+
|
|
112
|
+
#### Running scripts
|
|
113
|
+
|
|
114
|
+
- `pnpm -s <script>` runs the script again, with `-s` meaning `--sequential` as it does for `pnpm run -s <script>`. pnpm rejected it with "unexpected argument '-s' found" [#16446](https://github.com/pnpm/pnpm/issues/16446).
|
|
115
|
+
|
|
116
|
+
- `pnpm run` and `pnpm exec` now warn and run the command when the install that `verifyDepsBeforeRun` starts fails. This lets scripts run in sandboxes where pnpm cannot install, such as containers with a read-only store or no network [#15173](https://github.com/pnpm/pnpm/issues/15173).
|
|
117
|
+
|
|
118
|
+
- A filtered `pnpm run` or `pnpm exec` now finds dependencies out of date when a workspace dependency of a selected project has no `node_modules` directory, as after a filtered install. With `verifyDepsBeforeRun: install`, pnpm installs that dependency before running the command [pnpm/tasks#45](https://github.com/pnpm/tasks/issues/45).
|
|
119
|
+
|
|
120
|
+
- Scripts run without a terminal no longer start a second `sh` each. One watchdog per pnpm command now ends every script's process group if pnpm is killed, so `pnpm -r run` across many projects starts half as many processes [#16489](https://github.com/pnpm/pnpm/issues/16489).
|
|
121
|
+
|
|
122
|
+
- `Terminate batch job (Y/N)?` no longer appears after pressing Ctrl+C in a script started with `pnpm` from PowerShell or cmd on Windows [#16502](https://github.com/pnpm/pnpm/issues/16502).
|
|
123
|
+
|
|
124
|
+
- `pnpm rebuild` and `pnpm approve-builds` refresh command launchers when a build changes a command's interpreter or replaces it with a native executable. Dependent packages' build scripts use the refreshed launchers.
|
|
125
|
+
|
|
126
|
+
- When `pnpm run <script>` or `pnpm <script>` finds nothing to run and `--filter` follows the script name, the error now suggests putting the filter option before the script name [#4655](https://github.com/pnpm/pnpm/issues/4655).
|
|
127
|
+
|
|
128
|
+
- Package-name filters now support `?` to match one character [#2817](https://github.com/pnpm/pnpm/issues/2817).
|
|
129
|
+
|
|
130
|
+
#### The pinned pnpm and `pnpm self-update`
|
|
131
|
+
|
|
132
|
+
- pnpm no longer downloads the project's pinned pnpm version again on every command when `nodeVersion` in `pnpm-workspace.yaml` names a different Node.js major than the `node` on `PATH`. Before, each of those commands took about a second longer and failed without network access [#16497](https://github.com/pnpm/pnpm/issues/16497).
|
|
133
|
+
|
|
134
|
+
- Several `pnpm` commands started at once in a project that pins `packageManager` no longer fail with `The process cannot access the file because it is being used by another process` on Windows while the pinned pnpm is being installed.
|
|
135
|
+
|
|
136
|
+
- pnpm can now switch to a `packageManager` version below 11 on x64 musl Linux, such as Alpine [#16467](https://github.com/pnpm/pnpm/issues/16467).
|
|
137
|
+
|
|
138
|
+
- A `devEngines.packageManager` range no longer makes pnpm replace the version recorded in `pnpm-lock.yaml` with the running pnpm while the recorded version still satisfies the range. When pnpm does record a version, it records the running pnpm only if it meets `minimumReleaseAge`. Otherwise it records the newest version in the range that meets it, or the running pnpm if none does [#16431](https://github.com/pnpm/pnpm/issues/16431).
|
|
139
|
+
|
|
140
|
+
- On Windows, `pnpm self-update` now replaces a `pnpm.exe` left in `PNPM_HOME` or in `PNPM_HOME\bin`. Windows ran that executable in place of the updated `pnpm.cmd` shim, so `pnpm --version` kept printing the old version after a successful update. If the executable was in `PNPM_HOME`, `self-update` now asks you to run `pnpm setup` [#9094](https://github.com/pnpm/pnpm/issues/9094).
|
|
141
|
+
|
|
142
|
+
- `pnpm self-update` now checks that a version installed as the JavaScript `pnpm` can start before making it the global `pnpm`. If Node.js is missing, the update fails and the current `pnpm` stays in place.
|
|
143
|
+
|
|
144
|
+
#### Other commands
|
|
145
|
+
|
|
146
|
+
- `pnpm deploy` now finds patches and local dependencies when the target directory sits under a symlink, such as `/tmp` on macOS. It failed with `ERR_PNPM_PATCH_NOT_FOUND` [#16470](https://github.com/pnpm/pnpm/issues/16470).
|
|
147
|
+
|
|
148
|
+
- `pnpm deploy --legacy` now resolves the deployed project's relative `file:`, `link:`, and path dependencies from the project's own directory [#16475](https://github.com/pnpm/pnpm/issues/16475).
|
|
149
|
+
|
|
150
|
+
- `pnpm update --global` now removes hard-linked executables from `PNPM_HOME` when migrating packages from the old global layout [#16420](https://github.com/pnpm/pnpm/issues/16420).
|
|
151
|
+
|
|
152
|
+
- `pnpm store prune` no longer fails on store index entries that pnpm 11 wrote for git-hosted packages without a `package.json`. Entries that still cannot be read are kept and counted in the prune summary.
|
|
153
|
+
|
|
154
|
+
- `pnpm store prune` now aborts when an error other than a missing directory occurs while scanning project directories in the mark phase.
|
|
155
|
+
|
|
156
|
+
- `pnpm config get` and `pnpm config list` now report a setting given on the command line with `--config.<name>=<value>`. Before, a value such as `--config.node-linker=hoisted` reached the install but was absent from the reported configuration [#16276](https://github.com/pnpm/pnpm/issues/16276).
|
|
157
|
+
|
|
158
|
+
- `pnpm -r pkg get` now reports every selected project when several share a package name. Projects with the same name are keyed by their directory relative to the workspace root. Before, only one of them appeared in the output.
|
|
159
|
+
|
|
160
|
+
- The install summary shows a `link:` dependency as `+ name <- path`, and the Node.js API's `hideLinkedPkgsDiff` reporter option leaves matching linked dependencies out of the summary.
|
|
161
|
+
|
|
162
|
+
- The `--force` help text of `pnpm install` and `pnpm add` now says that `--force` keeps skipping optional dependencies built for other platforms. It points to `forceIgnoresPlatform` and the `--os`, `--cpu`, and `--libc` options for installing them [#16435](https://github.com/pnpm/pnpm/issues/16435).
|
|
163
|
+
|
|
164
|
+
- The `homepage` field of the published `pnpm` package points to https://pnpm.io again.
|
|
165
|
+
|
|
3
166
|
## 12.8.2
|
|
4
167
|
|
|
5
168
|
pnpm 12.8.2 fixes a startup crash on Linux ppc64le and `UnknownIssuer` errors on systems without CA certificates. `pnpm run` no longer installs before every script on CI when `autoDedupe` is enabled, and resolution and hoisted installs on macOS are faster.
|
package/bin/pnpm.mjs
CHANGED
|
@@ -38,6 +38,9 @@ const DOWNLOADED_BINARY = path.join(
|
|
|
38
38
|
const GET_PNPM = new URL('../dist/node_modules/get-pnpm/lib/index.js', import.meta.url)
|
|
39
39
|
const DEFAULT_REGISTRY = 'https://registry.npmjs.org'
|
|
40
40
|
|
|
41
|
+
if ('webcontainer' in process.versions) {
|
|
42
|
+
fail('The pnpm package runs a native binary, which WebContainers cannot execute. Install @pnpm/wasm instead.')
|
|
43
|
+
}
|
|
41
44
|
run(await nativeBinary())
|
|
42
45
|
|
|
43
46
|
function run (binary) {
|
package/bin/pnpx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Corepack's `pnpx` entry point; see ./pnpm.mjs. The native binary infers the
|
|
3
3
|
// `dlx` subcommand from the name it was launched under, which does not survive
|
|
4
|
-
// being spawned from here, so
|
|
4
|
+
// being spawned from here, so the Node entry point injects it.
|
|
5
5
|
import process from 'node:process'
|
|
6
6
|
|
|
7
7
|
process.argv = [...process.argv.slice(0, 2), 'dlx', ...process.argv.slice(2)]
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
9
|
# which needs no helper at all.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
# instead,
|
|
13
|
-
# PATH.
|
|
11
|
+
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
12
|
+
# instead, with node_modules and relative entries dropped from it.
|
|
14
13
|
caller_path_set=${PATH+set}
|
|
15
14
|
caller_path=${PATH-}
|
|
16
15
|
helper_path=
|
|
@@ -25,6 +24,11 @@ while [ -n "$rest" ]; do
|
|
|
25
24
|
done
|
|
26
25
|
# An empty PATH searches the current directory.
|
|
27
26
|
PATH=${helper_path:-/}
|
|
27
|
+
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
28
|
+
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
29
|
+
run_helper() {
|
|
30
|
+
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
31
|
+
}
|
|
28
32
|
link="$0"
|
|
29
33
|
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
30
34
|
# and stands for a file in the current directory.
|
|
@@ -35,13 +39,13 @@ esac
|
|
|
35
39
|
hops=0
|
|
36
40
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
37
41
|
hops=$((hops+1))
|
|
38
|
-
target=$(
|
|
42
|
+
target=$(run_helper readlink "$link")
|
|
39
43
|
case "$target" in
|
|
40
44
|
/*) link="$target" ;;
|
|
41
45
|
*) link="${link%/*}/$target" ;;
|
|
42
46
|
esac
|
|
43
47
|
done
|
|
44
|
-
basedir=$(
|
|
48
|
+
basedir=$(run_helper printf '%s\n' "$link" | run_helper sed -e 's,\\,/,g')
|
|
45
49
|
basedir="${basedir%/*}"
|
|
46
50
|
basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $?
|
|
47
51
|
basedir="$basedir_abs"
|
|
@@ -49,7 +53,7 @@ basedir_win="$basedir"
|
|
|
49
53
|
exe=""
|
|
50
54
|
msys=""
|
|
51
55
|
|
|
52
|
-
case `
|
|
56
|
+
case `run_helper uname -a` in
|
|
53
57
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
54
58
|
if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then
|
|
55
59
|
basedir_win="$converted"
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
9
|
# which needs no helper at all.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
# instead,
|
|
13
|
-
# PATH.
|
|
11
|
+
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
12
|
+
# instead, with node_modules and relative entries dropped from it.
|
|
14
13
|
caller_path_set=${PATH+set}
|
|
15
14
|
caller_path=${PATH-}
|
|
16
15
|
helper_path=
|
|
@@ -25,6 +24,11 @@ while [ -n "$rest" ]; do
|
|
|
25
24
|
done
|
|
26
25
|
# An empty PATH searches the current directory.
|
|
27
26
|
PATH=${helper_path:-/}
|
|
27
|
+
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
28
|
+
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
29
|
+
run_helper() {
|
|
30
|
+
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
31
|
+
}
|
|
28
32
|
link="$0"
|
|
29
33
|
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
30
34
|
# and stands for a file in the current directory.
|
|
@@ -35,13 +39,13 @@ esac
|
|
|
35
39
|
hops=0
|
|
36
40
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
37
41
|
hops=$((hops+1))
|
|
38
|
-
target=$(
|
|
42
|
+
target=$(run_helper readlink "$link")
|
|
39
43
|
case "$target" in
|
|
40
44
|
/*) link="$target" ;;
|
|
41
45
|
*) link="${link%/*}/$target" ;;
|
|
42
46
|
esac
|
|
43
47
|
done
|
|
44
|
-
basedir=$(
|
|
48
|
+
basedir=$(run_helper printf '%s\n' "$link" | run_helper sed -e 's,\\,/,g')
|
|
45
49
|
basedir="${basedir%/*}"
|
|
46
50
|
basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $?
|
|
47
51
|
basedir="$basedir_abs"
|
|
@@ -49,7 +53,7 @@ basedir_win="$basedir"
|
|
|
49
53
|
exe=""
|
|
50
54
|
msys=""
|
|
51
55
|
|
|
52
|
-
case `
|
|
56
|
+
case `run_helper uname -a` in
|
|
53
57
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
54
58
|
if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then
|
|
55
59
|
basedir_win="$converted"
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
9
|
# which needs no helper at all.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
# instead,
|
|
13
|
-
# PATH.
|
|
11
|
+
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
12
|
+
# instead, with node_modules and relative entries dropped from it.
|
|
14
13
|
caller_path_set=${PATH+set}
|
|
15
14
|
caller_path=${PATH-}
|
|
16
15
|
helper_path=
|
|
@@ -25,6 +24,11 @@ while [ -n "$rest" ]; do
|
|
|
25
24
|
done
|
|
26
25
|
# An empty PATH searches the current directory.
|
|
27
26
|
PATH=${helper_path:-/}
|
|
27
|
+
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
28
|
+
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
29
|
+
run_helper() {
|
|
30
|
+
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
31
|
+
}
|
|
28
32
|
link="$0"
|
|
29
33
|
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
30
34
|
# and stands for a file in the current directory.
|
|
@@ -35,13 +39,13 @@ esac
|
|
|
35
39
|
hops=0
|
|
36
40
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
37
41
|
hops=$((hops+1))
|
|
38
|
-
target=$(
|
|
42
|
+
target=$(run_helper readlink "$link")
|
|
39
43
|
case "$target" in
|
|
40
44
|
/*) link="$target" ;;
|
|
41
45
|
*) link="${link%/*}/$target" ;;
|
|
42
46
|
esac
|
|
43
47
|
done
|
|
44
|
-
basedir=$(
|
|
48
|
+
basedir=$(run_helper printf '%s\n' "$link" | run_helper sed -e 's,\\,/,g')
|
|
45
49
|
basedir="${basedir%/*}"
|
|
46
50
|
basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $?
|
|
47
51
|
basedir="$basedir_abs"
|
|
@@ -49,7 +53,7 @@ basedir_win="$basedir"
|
|
|
49
53
|
exe=""
|
|
50
54
|
msys=""
|
|
51
55
|
|
|
52
|
-
case `
|
|
56
|
+
case `run_helper uname -a` in
|
|
53
57
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
54
58
|
if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then
|
|
55
59
|
basedir_win="$converted"
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
9
|
# which needs no helper at all.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
# instead,
|
|
13
|
-
# PATH.
|
|
11
|
+
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
12
|
+
# instead, with node_modules and relative entries dropped from it.
|
|
14
13
|
caller_path_set=${PATH+set}
|
|
15
14
|
caller_path=${PATH-}
|
|
16
15
|
helper_path=
|
|
@@ -25,6 +24,11 @@ while [ -n "$rest" ]; do
|
|
|
25
24
|
done
|
|
26
25
|
# An empty PATH searches the current directory.
|
|
27
26
|
PATH=${helper_path:-/}
|
|
27
|
+
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
28
|
+
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
29
|
+
run_helper() {
|
|
30
|
+
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
31
|
+
}
|
|
28
32
|
link="$0"
|
|
29
33
|
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
30
34
|
# and stands for a file in the current directory.
|
|
@@ -35,13 +39,13 @@ esac
|
|
|
35
39
|
hops=0
|
|
36
40
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
37
41
|
hops=$((hops+1))
|
|
38
|
-
target=$(
|
|
42
|
+
target=$(run_helper readlink "$link")
|
|
39
43
|
case "$target" in
|
|
40
44
|
/*) link="$target" ;;
|
|
41
45
|
*) link="${link%/*}/$target" ;;
|
|
42
46
|
esac
|
|
43
47
|
done
|
|
44
|
-
basedir=$(
|
|
48
|
+
basedir=$(run_helper printf '%s\n' "$link" | run_helper sed -e 's,\\,/,g')
|
|
45
49
|
basedir="${basedir%/*}"
|
|
46
50
|
basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $?
|
|
47
51
|
basedir="$basedir_abs"
|
|
@@ -49,7 +53,7 @@ basedir_win="$basedir"
|
|
|
49
53
|
exe=""
|
|
50
54
|
msys=""
|
|
51
55
|
|
|
52
|
-
case `
|
|
56
|
+
case `run_helper uname -a` in
|
|
53
57
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
54
58
|
if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then
|
|
55
59
|
basedir_win="$converted"
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
# the shim before it reaches its target. Directories come from `${link%/*}`,
|
|
9
9
|
# which needs no helper at all.
|
|
10
10
|
#
|
|
11
|
-
#
|
|
12
|
-
# instead,
|
|
13
|
-
# PATH.
|
|
11
|
+
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
12
|
+
# instead, with node_modules and relative entries dropped from it.
|
|
14
13
|
caller_path_set=${PATH+set}
|
|
15
14
|
caller_path=${PATH-}
|
|
16
15
|
helper_path=
|
|
@@ -25,6 +24,11 @@ while [ -n "$rest" ]; do
|
|
|
25
24
|
done
|
|
26
25
|
# An empty PATH searches the current directory.
|
|
27
26
|
PATH=${helper_path:-/}
|
|
27
|
+
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
28
|
+
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
29
|
+
run_helper() {
|
|
30
|
+
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
31
|
+
}
|
|
28
32
|
link="$0"
|
|
29
33
|
# `${link%/*}` needs a separator to strip. A bare name came from a PATH lookup
|
|
30
34
|
# and stands for a file in the current directory.
|
|
@@ -35,13 +39,13 @@ esac
|
|
|
35
39
|
hops=0
|
|
36
40
|
while [ -L "$link" ] && [ "$hops" -lt 40 ]; do
|
|
37
41
|
hops=$((hops+1))
|
|
38
|
-
target=$(
|
|
42
|
+
target=$(run_helper readlink "$link")
|
|
39
43
|
case "$target" in
|
|
40
44
|
/*) link="$target" ;;
|
|
41
45
|
*) link="${link%/*}/$target" ;;
|
|
42
46
|
esac
|
|
43
47
|
done
|
|
44
|
-
basedir=$(
|
|
48
|
+
basedir=$(run_helper printf '%s\n' "$link" | run_helper sed -e 's,\\,/,g')
|
|
45
49
|
basedir="${basedir%/*}"
|
|
46
50
|
basedir_abs=$(CDPATH= cd -P -- "$basedir" && pwd -P) || exit $?
|
|
47
51
|
basedir="$basedir_abs"
|
|
@@ -49,7 +53,7 @@ basedir_win="$basedir"
|
|
|
49
53
|
exe=""
|
|
50
54
|
msys=""
|
|
51
55
|
|
|
52
|
-
case `
|
|
56
|
+
case `run_helper uname -a` in
|
|
53
57
|
*CYGWIN*|*MINGW*|*MSYS*)
|
|
54
58
|
if converted=$(command -p cygpath -w "$basedir" 2>/dev/null) && [ -n "$converted" ]; then
|
|
55
59
|
basedir_win="$converted"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"lastValidatedTimestamp":
|
|
2
|
+
"lastValidatedTimestamp": 1791058509474,
|
|
3
3
|
"projects": {
|
|
4
4
|
"/home/runner/_work/pnpm/pnpm/pnpm/npm/pnpm/temp-deploy": {
|
|
5
5
|
"name": "pacquet",
|
|
6
|
-
"version": "12.
|
|
6
|
+
"version": "12.9.1",
|
|
7
7
|
"hasModulesDir": true
|
|
8
8
|
}
|
|
9
9
|
},
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@commitlint/config-conventional": "^21.2.3",
|
|
29
29
|
"@commitlint/prompt-cli": "^21.2.3",
|
|
30
30
|
"@cyclonedx/cyclonedx-library": "10.3.0",
|
|
31
|
+
"@emnapi/wasi-threads": "1.2.1",
|
|
31
32
|
"@eslint/js": "^10.0.1",
|
|
32
33
|
"@inquirer/prompts": "^8.7.2",
|
|
33
34
|
"@jest/globals": "30.4.1",
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"@reflink/reflink": "0.1.19",
|
|
48
49
|
"@rushstack/worker-pool": "0.7.28",
|
|
49
50
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
51
|
+
"@tybys/wasm-util": "0.10.4",
|
|
50
52
|
"@types/adm-zip": "^0.5.8",
|
|
51
53
|
"@types/archy": "0.0.36",
|
|
52
54
|
"@types/cross-spawn": "^6.0.6",
|
|
@@ -94,6 +96,7 @@
|
|
|
94
96
|
"@yarnpkg/fslib": "^3.1.5",
|
|
95
97
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
96
98
|
"@yarnpkg/nm": "4.1.1",
|
|
99
|
+
"@yarnpkg/parsers": "3.1.0",
|
|
97
100
|
"@yarnpkg/pnp": "^4.1.7",
|
|
98
101
|
"@yarnpkg/shell": "4.1.3",
|
|
99
102
|
"@zkochan/retry": "^0.2.0",
|
|
@@ -331,6 +334,7 @@
|
|
|
331
334
|
"nodeLinker": "hoisted",
|
|
332
335
|
"optional": true,
|
|
333
336
|
"patchedDependencies": {
|
|
337
|
+
"@tybys/wasm-util@0.10.4": "../../../../__patches__/@tybys__wasm-util@0.10.4.patch",
|
|
334
338
|
"graceful-fs@4.2.11": "../../../../__patches__/graceful-fs@4.2.11.patch",
|
|
335
339
|
"normalize-registry-url@2.0.1": "../../../../__patches__/normalize-registry-url@2.0.1.patch"
|
|
336
340
|
},
|
package/install.js
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// stay shebang-less because pnpm 11 records its interpreter before installing
|
|
6
|
-
// the native binary at the same path. npm's global Windows shims still target
|
|
7
|
-
// the extensionless path after the `bin` rewrite, so postinstall asks npm to
|
|
8
|
-
// regenerate them against `pnpm.exe`. A global install uses `npm rebuild
|
|
9
|
-
// --global`. A project install passes the project prefix, because the
|
|
10
|
-
// script's working directory is the installed package. Any other install,
|
|
11
|
-
// such as `npm exec`, keeps its shims. When lifecycle scripts are blocked
|
|
12
|
-
// (`--ignore-scripts`, pnpm/Bun default), the placeholder remains and runs pnpm
|
|
13
|
-
// through Node.js wherever a shell reaches it (see the `pnpm` file).
|
|
14
|
-
//
|
|
15
|
-
// `pn`/`pnpx`/`pnx` are committed `#!/bin/sh` scripts on Unix (so only `pnpm` is
|
|
16
|
-
// relinked); on Windows the native binary is hardlinked onto each and
|
|
17
|
-
// self-detects its launch name to inject `dlx` (see `argv_with_alias_subcommand`
|
|
18
|
-
// in the cli crate).
|
|
19
|
-
//
|
|
20
|
-
// Corepack runs no lifecycle scripts, so it never gets here; it enters through
|
|
21
|
-
// `bin/pnpm.mjs` instead.
|
|
2
|
+
// Native installs replace the Node entry points with the host binary. npm's
|
|
3
|
+
// Windows shims must then be regenerated against pnpm.exe; Corepack and
|
|
4
|
+
// installations that block lifecycle scripts keep the Node entry points.
|
|
22
5
|
import console from 'node:console'
|
|
23
6
|
import { spawnSync } from 'node:child_process'
|
|
24
7
|
import fs from 'node:fs'
|
|
@@ -49,6 +32,11 @@ function setup () {
|
|
|
49
32
|
return
|
|
50
33
|
}
|
|
51
34
|
|
|
35
|
+
// The Node launchers stay in place there and point to `@pnpm/wasm`.
|
|
36
|
+
if ('webcontainer' in process.versions) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
52
40
|
const candidates = getBinCandidates()
|
|
53
41
|
if (candidates.length === 0) {
|
|
54
42
|
fail(`pnpm does not ship a prebuilt binary for ${hostTarget()}.`)
|
|
@@ -75,7 +63,9 @@ function setup () {
|
|
|
75
63
|
}
|
|
76
64
|
rewriteBin(newBin)
|
|
77
65
|
} else {
|
|
78
|
-
|
|
66
|
+
for (const name of BIN_NAMES) {
|
|
67
|
+
placeBinary(nativeBinary, path.join(wrapperDir, name), 0o755)
|
|
68
|
+
}
|
|
79
69
|
}
|
|
80
70
|
}
|
|
81
71
|
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"./dist/node_modules/node-gyp/gyp/gyp"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
|
-
"version": "12.
|
|
12
|
+
"version": "12.9.1",
|
|
13
13
|
"description": "Fast, disk space efficient package manager",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"pnpm",
|
|
@@ -46,20 +46,20 @@
|
|
|
46
46
|
"THIRD-PARTY-NOTICES.md"
|
|
47
47
|
],
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@pnpm/exe.win32-x64": "12.
|
|
50
|
-
"@pnpm/exe.win32-arm64": "12.
|
|
51
|
-
"@pnpm/exe.darwin-x64": "12.
|
|
52
|
-
"@pnpm/exe.darwin-arm64": "12.
|
|
53
|
-
"@pnpm/exe.linux-x64": "12.
|
|
54
|
-
"@pnpm/exe.linux-arm64": "12.
|
|
55
|
-
"@pnpm/exe.linux-riscv64": "12.
|
|
56
|
-
"@pnpm/exe.linux-ppc64": "12.
|
|
57
|
-
"@pnpm/exe.linux-s390x": "12.
|
|
58
|
-
"@pnpm/exe.linux-x64-musl": "12.
|
|
59
|
-
"@pnpm/exe.linux-arm64-musl": "12.
|
|
60
|
-
"@pnpm/exe.freebsd-x64": "12.
|
|
61
|
-
"@pnpm/exe.android-arm64": "12.
|
|
62
|
-
"@pnpm/exe.android-x64": "12.
|
|
49
|
+
"@pnpm/exe.win32-x64": "12.9.1",
|
|
50
|
+
"@pnpm/exe.win32-arm64": "12.9.1",
|
|
51
|
+
"@pnpm/exe.darwin-x64": "12.9.1",
|
|
52
|
+
"@pnpm/exe.darwin-arm64": "12.9.1",
|
|
53
|
+
"@pnpm/exe.linux-x64": "12.9.1",
|
|
54
|
+
"@pnpm/exe.linux-arm64": "12.9.1",
|
|
55
|
+
"@pnpm/exe.linux-riscv64": "12.9.1",
|
|
56
|
+
"@pnpm/exe.linux-ppc64": "12.9.1",
|
|
57
|
+
"@pnpm/exe.linux-s390x": "12.9.1",
|
|
58
|
+
"@pnpm/exe.linux-x64-musl": "12.9.1",
|
|
59
|
+
"@pnpm/exe.linux-arm64-musl": "12.9.1",
|
|
60
|
+
"@pnpm/exe.freebsd-x64": "12.9.1",
|
|
61
|
+
"@pnpm/exe.android-arm64": "12.9.1",
|
|
62
|
+
"@pnpm/exe.android-x64": "12.9.1"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"preinstall": "node install.js",
|
package/pn
CHANGED
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
#!/bin/
|
|
2
|
-
|
|
3
|
-
# found relative to this file: a `PATH` lookup would run whatever other pnpm
|
|
4
|
-
# comes first there, and would find nothing at all when the directory holding
|
|
5
|
-
# these bins is not on `PATH`.
|
|
6
|
-
#
|
|
7
|
-
# $0 is whatever shim or symlink `pn` was launched through, so walk to the file
|
|
8
|
-
# itself first. The hop cap matches the kernel's ELOOP limit, so a cycle cannot
|
|
9
|
-
# hang the script. Directories come from `${self%/*}` and `readlink` runs through
|
|
10
|
-
# `command -p`, so the caller's `PATH` decides nothing here.
|
|
11
|
-
#
|
|
12
|
-
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
13
|
-
# instead, with node_modules and relative entries dropped from it.
|
|
14
|
-
caller_path_set=${PATH+set}
|
|
15
|
-
caller_path=${PATH-}
|
|
16
|
-
helper_path=
|
|
17
|
-
rest=$caller_path:
|
|
18
|
-
while [ -n "$rest" ]; do
|
|
19
|
-
dir=${rest%%:*}
|
|
20
|
-
rest=${rest#*:}
|
|
21
|
-
case "$dir" in
|
|
22
|
-
*/node_modules/*|*/node_modules) ;;
|
|
23
|
-
/*) helper_path=${helper_path:+$helper_path:}$dir ;;
|
|
24
|
-
esac
|
|
25
|
-
done
|
|
26
|
-
# An empty PATH searches the current directory.
|
|
27
|
-
PATH=${helper_path:-/}
|
|
28
|
-
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
29
|
-
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
30
|
-
run_helper() {
|
|
31
|
-
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
32
|
-
}
|
|
33
|
-
self=$0
|
|
34
|
-
# MSYS and Cygwin can launch this with a native Windows path, which has no slash
|
|
35
|
-
# for `${self%/*}` to strip. Only a drive letter or a UNC prefix marks one; a
|
|
36
|
-
# backslash anywhere else is an ordinary character in a Unix file name, so the
|
|
37
|
-
# path is left alone. The separators are swapped in the shell rather than through
|
|
38
|
-
# `echo`, which mangles a `\t` or `\b` in a path under dash.
|
|
39
|
-
case $self in
|
|
40
|
-
[A-Za-z]:\\*|\\\\*)
|
|
41
|
-
while :; do
|
|
42
|
-
case $self in
|
|
43
|
-
*\\*) self=${self%%\\*}/${self#*\\} ;;
|
|
44
|
-
*) break ;;
|
|
45
|
-
esac
|
|
46
|
-
done
|
|
47
|
-
;;
|
|
48
|
-
esac
|
|
49
|
-
# `${self%/*}` needs a slash to strip. A bare name came from a `PATH` lookup and
|
|
50
|
-
# stands for a file in the current directory.
|
|
51
|
-
case $self in
|
|
52
|
-
*/*) ;;
|
|
53
|
-
*) self=./$self ;;
|
|
54
|
-
esac
|
|
55
|
-
hops=0
|
|
56
|
-
while [ -L "$self" ] && [ "$hops" -lt 40 ]; do
|
|
57
|
-
hops=$((hops + 1))
|
|
58
|
-
link=$(run_helper readlink "$self")
|
|
59
|
-
case $link in
|
|
60
|
-
/*) self=$link ;;
|
|
61
|
-
*) self=${self%/*}/$link ;;
|
|
62
|
-
esac
|
|
63
|
-
done
|
|
64
|
-
if [ -n "$caller_path_set" ]; then PATH=$caller_path; else unset PATH; fi
|
|
65
|
-
# The walk has to end at a regular file. Running out of hops leaves $self a
|
|
66
|
-
# symlink; a chain that changed under us can leave it dangling or a directory, and
|
|
67
|
-
# a failed readlink leaves a trailing slash. Each case would take `pnpm` from the
|
|
68
|
-
# wrong directory — the substitution this script exists to prevent.
|
|
69
|
-
if [ -L "$self" ] || [ ! -f "$self" ]; then
|
|
70
|
-
echo "pn: could not resolve $0 to a regular file within 40 symlink hops." >&2
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
exec "${self%/*}/pnpm" "$@"
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './bin/pnpm.mjs'
|
package/pnpm
CHANGED
|
@@ -1,94 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# installed binary or downloads one and spawns it.
|
|
4
|
-
#
|
|
5
|
-
# Shebang-less on purpose, and therefore an `sh` script: a bin shim generated
|
|
6
|
-
# from a shebang records that interpreter, and pnpm 11 generates the shim before
|
|
7
|
-
# it puts the native binary at this path.
|
|
8
|
-
#
|
|
9
|
-
# Something has to retry this file under a shell, because the kernel answers
|
|
10
|
-
# ENOEXEC for it. A bin shim and a shell both do, and so does glibc's `execvp`.
|
|
11
|
-
# Apple's libc does not, so on macOS a program that spawns this path itself gets
|
|
12
|
-
# ENOEXEC; Windows has neither and cannot reach it at all.
|
|
13
|
-
if ! command -v node > /dev/null 2>&1; then
|
|
14
|
-
echo "pnpm's native binary was not installed, and there is no Node.js to run pnpm without it." >&2
|
|
15
|
-
echo "Reinstall pnpm with build scripts enabled (allow-list pnpm's build under pnpm or Bun, or drop --ignore-scripts)." >&2
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
if [ -t 2 ]; then
|
|
20
|
-
echo "pnpm is running through Node.js because the script that installs its native binary was skipped." >&2
|
|
21
|
-
echo "Reinstall pnpm with its build scripts allowed to run the binary directly." >&2
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# $0 is whatever shim or symlink pnpm was launched through; ./bin/pnpm.mjs is
|
|
25
|
-
# found relative to this file. The hop cap matches the kernel's ELOOP limit, so
|
|
26
|
-
# a cycle cannot hang the script.
|
|
27
|
-
#
|
|
28
|
-
# `readlink` runs through `command -p`, which searches the system default path,
|
|
29
|
-
# and directories come from `${self%/*}`, which runs nothing at all. The caller's
|
|
30
|
-
# PATH therefore decides only which `node` runs, which is what it is for.
|
|
31
|
-
#
|
|
32
|
-
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
33
|
-
# instead, with node_modules and relative entries dropped from it.
|
|
34
|
-
caller_path_set=${PATH+set}
|
|
35
|
-
caller_path=${PATH-}
|
|
36
|
-
helper_path=
|
|
37
|
-
rest=$caller_path:
|
|
38
|
-
while [ -n "$rest" ]; do
|
|
39
|
-
dir=${rest%%:*}
|
|
40
|
-
rest=${rest#*:}
|
|
41
|
-
case "$dir" in
|
|
42
|
-
*/node_modules/*|*/node_modules) ;;
|
|
43
|
-
/*) helper_path=${helper_path:+$helper_path:}$dir ;;
|
|
44
|
-
esac
|
|
45
|
-
done
|
|
46
|
-
# An empty PATH searches the current directory.
|
|
47
|
-
PATH=${helper_path:-/}
|
|
48
|
-
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
49
|
-
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
50
|
-
run_helper() {
|
|
51
|
-
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
52
|
-
}
|
|
53
|
-
self=$0
|
|
54
|
-
# MSYS and Cygwin can launch this with a native Windows path, which has no slash
|
|
55
|
-
# for `${self%/*}` to strip. Only a drive letter or a UNC prefix marks one; a
|
|
56
|
-
# backslash anywhere else is an ordinary character in a Unix file name, so the
|
|
57
|
-
# path is left alone. The separators are swapped in the shell rather than through
|
|
58
|
-
# `echo`, which mangles a `\t` or `\b` in a path under dash.
|
|
59
|
-
case $self in
|
|
60
|
-
[A-Za-z]:\\*|\\\\*)
|
|
61
|
-
while :; do
|
|
62
|
-
case $self in
|
|
63
|
-
*\\*) self=${self%%\\*}/${self#*\\} ;;
|
|
64
|
-
*) break ;;
|
|
65
|
-
esac
|
|
66
|
-
done
|
|
67
|
-
;;
|
|
68
|
-
esac
|
|
69
|
-
# `${self%/*}` needs a slash to strip. A bare name came from a PATH lookup and
|
|
70
|
-
# stands for a file in the current directory.
|
|
71
|
-
case $self in
|
|
72
|
-
*/*) ;;
|
|
73
|
-
*) self=./$self ;;
|
|
74
|
-
esac
|
|
75
|
-
hops=0
|
|
76
|
-
while [ -L "$self" ] && [ "$hops" -lt 40 ]; do
|
|
77
|
-
hops=$((hops + 1))
|
|
78
|
-
link=$(run_helper readlink "$self")
|
|
79
|
-
case $link in
|
|
80
|
-
/*) self=$link ;;
|
|
81
|
-
*) self=${self%/*}/$link ;;
|
|
82
|
-
esac
|
|
83
|
-
done
|
|
84
|
-
if [ -n "$caller_path_set" ]; then PATH=$caller_path; else unset PATH; fi
|
|
85
|
-
# The walk has to end at a regular file. Running out of hops leaves $self a
|
|
86
|
-
# symlink; a chain that changed under us can leave it dangling or a directory, and
|
|
87
|
-
# a failed readlink leaves a trailing slash. Each case would take `bin/pnpm.mjs`
|
|
88
|
-
# from the wrong directory.
|
|
89
|
-
if [ -L "$self" ] || [ ! -f "$self" ]; then
|
|
90
|
-
echo "pnpm: could not resolve $0 to a regular file within 40 symlink hops." >&2
|
|
91
|
-
exit 1
|
|
92
|
-
fi
|
|
93
|
-
|
|
94
|
-
exec node "${self%/*}/bin/pnpm.mjs" "$@"
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './bin/pnpm.mjs'
|
package/pnpx
CHANGED
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
#!/bin/
|
|
2
|
-
|
|
3
|
-
# it, found relative to this file: a `PATH` lookup would run whatever other pnpm
|
|
4
|
-
# comes first there, and would find nothing at all when the directory holding
|
|
5
|
-
# these bins is not on `PATH`.
|
|
6
|
-
#
|
|
7
|
-
# $0 is whatever shim or symlink `pnpx` was launched through, so walk to the file
|
|
8
|
-
# itself first. The hop cap matches the kernel's ELOOP limit, so a cycle cannot
|
|
9
|
-
# hang the script. Directories come from `${self%/*}` and `readlink` runs through
|
|
10
|
-
# `command -p`, so the caller's `PATH` decides nothing here.
|
|
11
|
-
#
|
|
12
|
-
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
13
|
-
# instead, with node_modules and relative entries dropped from it.
|
|
14
|
-
caller_path_set=${PATH+set}
|
|
15
|
-
caller_path=${PATH-}
|
|
16
|
-
helper_path=
|
|
17
|
-
rest=$caller_path:
|
|
18
|
-
while [ -n "$rest" ]; do
|
|
19
|
-
dir=${rest%%:*}
|
|
20
|
-
rest=${rest#*:}
|
|
21
|
-
case "$dir" in
|
|
22
|
-
*/node_modules/*|*/node_modules) ;;
|
|
23
|
-
/*) helper_path=${helper_path:+$helper_path:}$dir ;;
|
|
24
|
-
esac
|
|
25
|
-
done
|
|
26
|
-
# An empty PATH searches the current directory.
|
|
27
|
-
PATH=${helper_path:-/}
|
|
28
|
-
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
29
|
-
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
30
|
-
run_helper() {
|
|
31
|
-
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
32
|
-
}
|
|
33
|
-
self=$0
|
|
34
|
-
# MSYS and Cygwin can launch this with a native Windows path, which has no slash
|
|
35
|
-
# for `${self%/*}` to strip. Only a drive letter or a UNC prefix marks one; a
|
|
36
|
-
# backslash anywhere else is an ordinary character in a Unix file name, so the
|
|
37
|
-
# path is left alone. The separators are swapped in the shell rather than through
|
|
38
|
-
# `echo`, which mangles a `\t` or `\b` in a path under dash.
|
|
39
|
-
case $self in
|
|
40
|
-
[A-Za-z]:\\*|\\\\*)
|
|
41
|
-
while :; do
|
|
42
|
-
case $self in
|
|
43
|
-
*\\*) self=${self%%\\*}/${self#*\\} ;;
|
|
44
|
-
*) break ;;
|
|
45
|
-
esac
|
|
46
|
-
done
|
|
47
|
-
;;
|
|
48
|
-
esac
|
|
49
|
-
# `${self%/*}` needs a slash to strip. A bare name came from a `PATH` lookup and
|
|
50
|
-
# stands for a file in the current directory.
|
|
51
|
-
case $self in
|
|
52
|
-
*/*) ;;
|
|
53
|
-
*) self=./$self ;;
|
|
54
|
-
esac
|
|
55
|
-
hops=0
|
|
56
|
-
while [ -L "$self" ] && [ "$hops" -lt 40 ]; do
|
|
57
|
-
hops=$((hops + 1))
|
|
58
|
-
link=$(run_helper readlink "$self")
|
|
59
|
-
case $link in
|
|
60
|
-
/*) self=$link ;;
|
|
61
|
-
*) self=${self%/*}/$link ;;
|
|
62
|
-
esac
|
|
63
|
-
done
|
|
64
|
-
if [ -n "$caller_path_set" ]; then PATH=$caller_path; else unset PATH; fi
|
|
65
|
-
# The walk has to end at a regular file. Running out of hops leaves $self a
|
|
66
|
-
# symlink; a chain that changed under us can leave it dangling or a directory, and
|
|
67
|
-
# a failed readlink leaves a trailing slash. Each case would take `pnpm` from the
|
|
68
|
-
# wrong directory — the substitution this script exists to prevent.
|
|
69
|
-
if [ -L "$self" ] || [ ! -f "$self" ]; then
|
|
70
|
-
echo "pnpx: could not resolve $0 to a regular file within 40 symlink hops." >&2
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
exec "${self%/*}/pnpm" dlx "$@"
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './bin/pnpx.mjs'
|
package/pnx
CHANGED
|
@@ -1,74 +1,2 @@
|
|
|
1
|
-
#!/bin/
|
|
2
|
-
|
|
3
|
-
# it, found relative to this file: a `PATH` lookup would run whatever other pnpm
|
|
4
|
-
# comes first there, and would find nothing at all when the directory holding
|
|
5
|
-
# these bins is not on `PATH`.
|
|
6
|
-
#
|
|
7
|
-
# $0 is whatever shim or symlink `pnx` was launched through, so walk to the file
|
|
8
|
-
# itself first. The hop cap matches the kernel's ELOOP limit, so a cycle cannot
|
|
9
|
-
# hang the script. Directories come from `${self%/*}` and `readlink` runs through
|
|
10
|
-
# `command -p`, so the caller's `PATH` decides nothing here.
|
|
11
|
-
#
|
|
12
|
-
# A helper the default path lacks, as in a Nix build sandbox, comes from PATH
|
|
13
|
-
# instead, with node_modules and relative entries dropped from it.
|
|
14
|
-
caller_path_set=${PATH+set}
|
|
15
|
-
caller_path=${PATH-}
|
|
16
|
-
helper_path=
|
|
17
|
-
rest=$caller_path:
|
|
18
|
-
while [ -n "$rest" ]; do
|
|
19
|
-
dir=${rest%%:*}
|
|
20
|
-
rest=${rest#*:}
|
|
21
|
-
case "$dir" in
|
|
22
|
-
*/node_modules/*|*/node_modules) ;;
|
|
23
|
-
/*) helper_path=${helper_path:+$helper_path:}$dir ;;
|
|
24
|
-
esac
|
|
25
|
-
done
|
|
26
|
-
# An empty PATH searches the current directory.
|
|
27
|
-
PATH=${helper_path:-/}
|
|
28
|
-
# A helper comes from PATH only when the default path lacks it and PATH has it.
|
|
29
|
-
# The bash 3.2 that macOS ships as sh answers `command -p -v` from PATH.
|
|
30
|
-
run_helper() {
|
|
31
|
-
if command -p -v "$1" >/dev/null 2>&1 || ! command -v "$1" >/dev/null 2>&1; then command -p "$@"; else command "$@"; fi
|
|
32
|
-
}
|
|
33
|
-
self=$0
|
|
34
|
-
# MSYS and Cygwin can launch this with a native Windows path, which has no slash
|
|
35
|
-
# for `${self%/*}` to strip. Only a drive letter or a UNC prefix marks one; a
|
|
36
|
-
# backslash anywhere else is an ordinary character in a Unix file name, so the
|
|
37
|
-
# path is left alone. The separators are swapped in the shell rather than through
|
|
38
|
-
# `echo`, which mangles a `\t` or `\b` in a path under dash.
|
|
39
|
-
case $self in
|
|
40
|
-
[A-Za-z]:\\*|\\\\*)
|
|
41
|
-
while :; do
|
|
42
|
-
case $self in
|
|
43
|
-
*\\*) self=${self%%\\*}/${self#*\\} ;;
|
|
44
|
-
*) break ;;
|
|
45
|
-
esac
|
|
46
|
-
done
|
|
47
|
-
;;
|
|
48
|
-
esac
|
|
49
|
-
# `${self%/*}` needs a slash to strip. A bare name came from a `PATH` lookup and
|
|
50
|
-
# stands for a file in the current directory.
|
|
51
|
-
case $self in
|
|
52
|
-
*/*) ;;
|
|
53
|
-
*) self=./$self ;;
|
|
54
|
-
esac
|
|
55
|
-
hops=0
|
|
56
|
-
while [ -L "$self" ] && [ "$hops" -lt 40 ]; do
|
|
57
|
-
hops=$((hops + 1))
|
|
58
|
-
link=$(run_helper readlink "$self")
|
|
59
|
-
case $link in
|
|
60
|
-
/*) self=$link ;;
|
|
61
|
-
*) self=${self%/*}/$link ;;
|
|
62
|
-
esac
|
|
63
|
-
done
|
|
64
|
-
if [ -n "$caller_path_set" ]; then PATH=$caller_path; else unset PATH; fi
|
|
65
|
-
# The walk has to end at a regular file. Running out of hops leaves $self a
|
|
66
|
-
# symlink; a chain that changed under us can leave it dangling or a directory, and
|
|
67
|
-
# a failed readlink leaves a trailing slash. Each case would take `pnpm` from the
|
|
68
|
-
# wrong directory — the substitution this script exists to prevent.
|
|
69
|
-
if [ -L "$self" ] || [ ! -f "$self" ]; then
|
|
70
|
-
echo "pnx: could not resolve $0 to a regular file within 40 symlink hops." >&2
|
|
71
|
-
exit 1
|
|
72
|
-
fi
|
|
73
|
-
|
|
74
|
-
exec "${self%/*}/pnpm" dlx "$@"
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import './bin/pnpx.mjs'
|