@pnpm/napi 12.10.0 → 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 CHANGED
@@ -1,5 +1,25 @@
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
+
17
+ ## 12.10.1
18
+
19
+ ### Patch Changes
20
+
21
+ - `rebuild()` no longer fails with `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` on a lockfile that records a `pnpmfileChecksum` or was resolved with other settings. Of the settings the lockfile records, `rebuild()` now checks only `patchedDependencies`.
22
+
3
23
  ## 12.10.0
4
24
 
5
25
  ## 12.9.1
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). |
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,14 +378,28 @@ 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 same options shape as `install`.
391
+ * `node_modules` (frozen path). Takes the options of `install`, plus
392
+ * `skipIfHasSideEffectsCache`.
393
+ * Nothing is resolved, so of the settings the lockfile records only the
394
+ * patches have to match the options, as in pnpm v11's `rebuild`: a lockfile
395
+ * resolved with other `readPackage` hooks or overrides is still rebuilt. The
396
+ * projects' manifests still have to match the lockfile, unless
397
+ * `ignorePackageManifest` is set.
384
398
  * @param selectedNames restrict the rebuild to these package names / build
385
399
  * keys; omit (or pass an empty array) to rebuild every build-needing package.
386
400
  */
387
401
  export function rebuild(
388
- options: InstallOptions,
402
+ options: RebuildOptions,
389
403
  onLog?: LogListener,
390
404
  selectedNames?: string[],
391
405
  onOutput?: OutputListener,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/napi",
3
- "version": "12.10.0",
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.10.0",
32
- "@pnpm/napi.win32-arm64": "12.10.0",
33
- "@pnpm/napi.darwin-x64": "12.10.0",
34
- "@pnpm/napi.darwin-arm64": "12.10.0",
35
- "@pnpm/napi.linux-x64": "12.10.0",
36
- "@pnpm/napi.linux-arm64": "12.10.0",
37
- "@pnpm/napi.linux-riscv64": "12.10.0",
38
- "@pnpm/napi.linux-ppc64": "12.10.0",
39
- "@pnpm/napi.linux-s390x": "12.10.0",
40
- "@pnpm/napi.linux-x64-musl": "12.10.0",
41
- "@pnpm/napi.linux-arm64-musl": "12.10.0",
42
- "@pnpm/napi.freebsd-x64": "12.10.0",
43
- "@pnpm/napi.android-arm64": "12.10.0",
44
- "@pnpm/napi.android-x64": "12.10.0"
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"