@pnpm/napi 12.10.1 → 12.11.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/index.d.ts +11 -2
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pnpm/napi
|
|
2
2
|
|
|
3
|
+
## 12.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- `rebuild` accepts `skipIfHasSideEffectsCache`. With it set, a package whose build the side-effects cache already holds is restored from the cache, and its build scripts do not run again.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- `rebuild` with `selectedNames` no longer reads the manifest of every installed package to find build scripts. Only the selected packages are inspected and built. On a large `node_modules` served lazily, such as over a network or FUSE mount, this turned a rebuild of a few packages into a fetch of every package.
|
|
12
|
+
|
|
13
|
+
- `rebuild` no longer removes and recreates `node_modules` when the settings recorded in `node_modules/.modules.yaml` differ from the options. The rebuild runs the build scripts against the installed packages as they are.
|
|
14
|
+
|
|
15
|
+
- The addon now sizes its worker thread pool the way the `pnpm` command does, with at most 16 threads. It started one thread per CPU core [pnpm/tasks#54](https://github.com/pnpm/tasks/issues/54).
|
|
16
|
+
|
|
3
17
|
## 12.10.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ See [`index.d.ts`](./index.d.ts) for the full typed contract.
|
|
|
27
27
|
| Export | Purpose |
|
|
28
28
|
| --- | --- |
|
|
29
29
|
| `install(options, onLog?, readPackageHook?, onOutput?)` | Install in-memory importers (single or workspace); `readPackageHook` transforms each resolved dependency manifest (must be synchronous). Pass `options.readPackageHookChecksum` so installs reuse the lockfile while the hook is unchanged. Returns `{ stats, depsRequiringBuild?, storeDir }`. |
|
|
30
|
-
| `rebuild(options, onLog?, selectedNames?, onOutput?)` | Re-run dependency build scripts against a materialized install (frozen path). Of the settings the lockfile records, only the patches have to match the options; nothing is resolved. |
|
|
30
|
+
| `rebuild(options, onLog?, selectedNames?, onOutput?)` | Re-run dependency build scripts against a materialized install (frozen path). Of the settings the lockfile records, only the patches have to match the options; nothing is resolved. With `skipIfHasSideEffectsCache`, a package the side-effects cache already holds a build of is restored from the cache instead of rebuilt. |
|
|
31
31
|
| `resolveDependency(wanted, options)` | Resolve an npm-registry specifier to `{ id, manifest, resolvedVia, … }`. |
|
|
32
32
|
| `pack(options, onLog?)` | Build a publishable `.tgz` from a project directory. |
|
|
33
33
|
| `parseBareSpecifier(spec, alias?)` | Split/validate a dependency specifier; `null` when unparsable. |
|
package/index.d.ts
CHANGED
|
@@ -378,9 +378,18 @@ export function install(
|
|
|
378
378
|
onOutput?: OutputListener,
|
|
379
379
|
): Promise<InstallResult>
|
|
380
380
|
|
|
381
|
+
export interface RebuildOptions extends InstallOptions {
|
|
382
|
+
/**
|
|
383
|
+
* Skip the build of a package that the side-effects cache already holds a
|
|
384
|
+
* build of, and restore that build instead of running its scripts.
|
|
385
|
+
*/
|
|
386
|
+
skipIfHasSideEffectsCache?: boolean
|
|
387
|
+
}
|
|
388
|
+
|
|
381
389
|
/**
|
|
382
390
|
* Rebuild dependency build scripts against the already-materialized
|
|
383
|
-
* `node_modules` (frozen path). Takes the
|
|
391
|
+
* `node_modules` (frozen path). Takes the options of `install`, plus
|
|
392
|
+
* `skipIfHasSideEffectsCache`.
|
|
384
393
|
* Nothing is resolved, so of the settings the lockfile records only the
|
|
385
394
|
* patches have to match the options, as in pnpm v11's `rebuild`: a lockfile
|
|
386
395
|
* resolved with other `readPackage` hooks or overrides is still rebuilt. The
|
|
@@ -390,7 +399,7 @@ export function install(
|
|
|
390
399
|
* keys; omit (or pass an empty array) to rebuild every build-needing package.
|
|
391
400
|
*/
|
|
392
401
|
export function rebuild(
|
|
393
|
-
options:
|
|
402
|
+
options: RebuildOptions,
|
|
394
403
|
onLog?: LogListener,
|
|
395
404
|
selectedNames?: string[],
|
|
396
405
|
onOutput?: OutputListener,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/napi",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.11.0",
|
|
4
4
|
"description": "Node.js addon bindings for the pnpm v12 Rust engine (pacquet)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"THIRD-PARTY-NOTICES.md"
|
|
29
29
|
],
|
|
30
30
|
"optionalDependencies": {
|
|
31
|
-
"@pnpm/napi.win32-x64": "12.
|
|
32
|
-
"@pnpm/napi.win32-arm64": "12.
|
|
33
|
-
"@pnpm/napi.darwin-x64": "12.
|
|
34
|
-
"@pnpm/napi.darwin-arm64": "12.
|
|
35
|
-
"@pnpm/napi.linux-x64": "12.
|
|
36
|
-
"@pnpm/napi.linux-arm64": "12.
|
|
37
|
-
"@pnpm/napi.linux-riscv64": "12.
|
|
38
|
-
"@pnpm/napi.linux-ppc64": "12.
|
|
39
|
-
"@pnpm/napi.linux-s390x": "12.
|
|
40
|
-
"@pnpm/napi.linux-x64-musl": "12.
|
|
41
|
-
"@pnpm/napi.linux-arm64-musl": "12.
|
|
42
|
-
"@pnpm/napi.freebsd-x64": "12.
|
|
43
|
-
"@pnpm/napi.android-arm64": "12.
|
|
44
|
-
"@pnpm/napi.android-x64": "12.
|
|
31
|
+
"@pnpm/napi.win32-x64": "12.11.0",
|
|
32
|
+
"@pnpm/napi.win32-arm64": "12.11.0",
|
|
33
|
+
"@pnpm/napi.darwin-x64": "12.11.0",
|
|
34
|
+
"@pnpm/napi.darwin-arm64": "12.11.0",
|
|
35
|
+
"@pnpm/napi.linux-x64": "12.11.0",
|
|
36
|
+
"@pnpm/napi.linux-arm64": "12.11.0",
|
|
37
|
+
"@pnpm/napi.linux-riscv64": "12.11.0",
|
|
38
|
+
"@pnpm/napi.linux-ppc64": "12.11.0",
|
|
39
|
+
"@pnpm/napi.linux-s390x": "12.11.0",
|
|
40
|
+
"@pnpm/napi.linux-x64-musl": "12.11.0",
|
|
41
|
+
"@pnpm/napi.linux-arm64-musl": "12.11.0",
|
|
42
|
+
"@pnpm/napi.freebsd-x64": "12.11.0",
|
|
43
|
+
"@pnpm/napi.android-arm64": "12.11.0",
|
|
44
|
+
"@pnpm/napi.android-x64": "12.11.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"generate-packages": "node scripts/generate-packages.mjs"
|