@pnpm/napi 12.10.1 → 12.11.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @pnpm/napi
2
2
 
3
+ ## 12.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - `enable-modules-dir=false` (`enableModulesDir: false` through the Node.js addon) fetches the registry packages the host can install into the store again, as pnpm v10 did, while still writing nothing under `node_modules`. The setting exists for a `node_modules` that something else mounts from the store, such as a FUSE daemon, and that consumer no longer has to download each package on first access. A plain `--lockfile-only` run still fetches nothing.
8
+
9
+ ## 12.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - `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.
14
+
15
+ ### Patch Changes
16
+
17
+ - `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.
18
+
19
+ - `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.
20
+
21
+ - 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).
22
+
3
23
  ## 12.10.1
4
24
 
5
25
  ### 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
@@ -208,7 +208,9 @@ export interface InstallOptions extends SharedEngineOptions {
208
208
  nodeVersion?: string
209
209
  /**
210
210
  * `false` installs without creating a `node_modules` directory: the graph
211
- * resolves and the lockfile is written, but nothing is materialized.
211
+ * resolves, the lockfile is written, and the registry packages the host can
212
+ * install are fetched into the store, but nothing is materialized. For a `node_modules` that something
213
+ * else mounts from the store.
212
214
  */
213
215
  enableModulesDir?: boolean
214
216
  /**
@@ -378,9 +380,18 @@ export function install(
378
380
  onOutput?: OutputListener,
379
381
  ): Promise<InstallResult>
380
382
 
383
+ export interface RebuildOptions extends InstallOptions {
384
+ /**
385
+ * Skip the build of a package that the side-effects cache already holds a
386
+ * build of, and restore that build instead of running its scripts.
387
+ */
388
+ skipIfHasSideEffectsCache?: boolean
389
+ }
390
+
381
391
  /**
382
392
  * Rebuild dependency build scripts against the already-materialized
383
- * `node_modules` (frozen path). Takes the same options shape as `install`.
393
+ * `node_modules` (frozen path). Takes the options of `install`, plus
394
+ * `skipIfHasSideEffectsCache`.
384
395
  * Nothing is resolved, so of the settings the lockfile records only the
385
396
  * patches have to match the options, as in pnpm v11's `rebuild`: a lockfile
386
397
  * resolved with other `readPackage` hooks or overrides is still rebuilt. The
@@ -390,7 +401,7 @@ export function install(
390
401
  * keys; omit (or pass an empty array) to rebuild every build-needing package.
391
402
  */
392
403
  export function rebuild(
393
- options: InstallOptions,
404
+ options: RebuildOptions,
394
405
  onLog?: LogListener,
395
406
  selectedNames?: string[],
396
407
  onOutput?: OutputListener,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/napi",
3
- "version": "12.10.1",
3
+ "version": "12.11.1",
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.1",
32
- "@pnpm/napi.win32-arm64": "12.10.1",
33
- "@pnpm/napi.darwin-x64": "12.10.1",
34
- "@pnpm/napi.darwin-arm64": "12.10.1",
35
- "@pnpm/napi.linux-x64": "12.10.1",
36
- "@pnpm/napi.linux-arm64": "12.10.1",
37
- "@pnpm/napi.linux-riscv64": "12.10.1",
38
- "@pnpm/napi.linux-ppc64": "12.10.1",
39
- "@pnpm/napi.linux-s390x": "12.10.1",
40
- "@pnpm/napi.linux-x64-musl": "12.10.1",
41
- "@pnpm/napi.linux-arm64-musl": "12.10.1",
42
- "@pnpm/napi.freebsd-x64": "12.10.1",
43
- "@pnpm/napi.android-arm64": "12.10.1",
44
- "@pnpm/napi.android-x64": "12.10.1"
31
+ "@pnpm/napi.win32-x64": "12.11.1",
32
+ "@pnpm/napi.win32-arm64": "12.11.1",
33
+ "@pnpm/napi.darwin-x64": "12.11.1",
34
+ "@pnpm/napi.darwin-arm64": "12.11.1",
35
+ "@pnpm/napi.linux-x64": "12.11.1",
36
+ "@pnpm/napi.linux-arm64": "12.11.1",
37
+ "@pnpm/napi.linux-riscv64": "12.11.1",
38
+ "@pnpm/napi.linux-ppc64": "12.11.1",
39
+ "@pnpm/napi.linux-s390x": "12.11.1",
40
+ "@pnpm/napi.linux-x64-musl": "12.11.1",
41
+ "@pnpm/napi.linux-arm64-musl": "12.11.1",
42
+ "@pnpm/napi.freebsd-x64": "12.11.1",
43
+ "@pnpm/napi.android-arm64": "12.11.1",
44
+ "@pnpm/napi.android-x64": "12.11.1"
45
45
  },
46
46
  "scripts": {
47
47
  "generate-packages": "node scripts/generate-packages.mjs"