rolldown-pnpm-config 3.0.7 → 3.2.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/cli/commands/export.js +1 -1
- package/cli/commands/sync.js +623 -0
- package/cli/commands/upgrade.js +2 -2
- package/cli/effective.js +12 -2
- package/cli/exit-codes.js +9 -2
- package/cli/local-merge.js +66 -1
- package/cli/main.js +3 -2
- package/cli/preview-views.js +1 -1
- package/cli/root.js +3 -1
- package/cli/sync/commit-message.js +22 -0
- package/cli/sync/config.js +83 -0
- package/cli/sync/floors.js +146 -0
- package/cli/sync/local-gate.js +69 -0
- package/cli/sync/membership.js +118 -0
- package/cli/sync/release-plan.js +49 -0
- package/cli/sync/ripples.js +59 -0
- package/cli/sync/running-list.js +153 -0
- package/cli/version.js +1 -1
- package/index.d.ts +76 -9
- package/package.json +5 -5
- package/plugin/freeze.js +2 -1
- package/runtime/strategies/arrays.js +15 -10
- package/skills/rolldown-pnpm-config/SKILL.md +47 -0
- package/skills/rolldown-pnpm-config/assets/catalog-sync.yml +287 -0
- package/skills/rolldown-pnpm-config/assets/pre-push.sh +32 -0
- package/skills/rolldown-pnpm-config/references/catalogs.md +95 -0
- package/skills/rolldown-pnpm-config/references/options.md +314 -0
- package/skills/rolldown-pnpm-config/references/sync.md +142 -0
- package/skills/rolldown-pnpm-config/references/wiring.md +194 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# Plugin options
|
|
2
|
+
|
|
3
|
+
Every key `PnpmConfigPlugin({...})` accepts, and what each does. The
|
|
4
|
+
config is read statically by the CLI and frozen at build time into a
|
|
5
|
+
`{ base, manifest, name }` payload for the pnpmfile. Types come from
|
|
6
|
+
`PluginConfig` in `define-plugin.ts`; where its TSDoc and the code disagree,
|
|
7
|
+
this file follows the code.
|
|
8
|
+
|
|
9
|
+
## Top-level keys
|
|
10
|
+
|
|
11
|
+
Besides the managed pnpm settings (see "Managed settings" below), the config
|
|
12
|
+
takes five keys. Any other key that is a pnpm 12 setting the plugin does not
|
|
13
|
+
manage fails the build.
|
|
14
|
+
|
|
15
|
+
| Key | Type | Meaning |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `name` | `string`, required | Identifier for the config dependency; tags runtime warnings as `[name]`. Conventionally the package's npm name. Never written to `pnpm-workspace.yaml` |
|
|
18
|
+
| `catalogs` | `Record<string, CatalogDeclaration>`, required | The catalogs served to consumers, keyed by catalog name. Keep the literal inline |
|
|
19
|
+
| `sync` | `SyncConfig` | Settings for `rolldown-pnpm-config sync`, which moves one catalog's entries for the workspace's own packages to their next release versions. CLI-only: never reaches `base` or the pnpmfile |
|
|
20
|
+
| `local` | object | Export-only overrides for `pnpm:export`. Ignored by the build and the pnpmfile |
|
|
21
|
+
| `overridesFromCatalogs` | directive or array | Derive `overrides` from a catalog. Build-time only; `local` does not accept it |
|
|
22
|
+
|
|
23
|
+
### `catalogs`
|
|
24
|
+
|
|
25
|
+
Each catalog is `{ exact?, packages: { <pkg>: spec } }`. A `spec` is a bare
|
|
26
|
+
range string, or an object:
|
|
27
|
+
|
|
28
|
+
| Spec field | Meaning |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `range` | The install range (required in the object form) |
|
|
31
|
+
| `peer` | A materialized peer range. Emitted verbatim into the `<name>:peers` twin (colon-delimited), which exists only when at least one entry sets it |
|
|
32
|
+
| `strategy` | `"lock"`, `"lock-minor"` or `"interop"`: how `upgrade` recomputes `peer` when `range` moves. CLI-only |
|
|
33
|
+
| `source` | `"registry"` (default) or `"workspace"`: where `upgrade` and `sync` read the next version. `"workspace"` uses current manifest versions overlaid with pending changesets. CLI-only |
|
|
34
|
+
| `exact` | The entry's value in `<name>:exact`, or `false` to leave it out. Valid only when the catalog sets `exact: true`; a plain version is rejected where one derives from `range` |
|
|
35
|
+
|
|
36
|
+
Catalog field `exact: true` also emits `<name>:exact`: each range with its
|
|
37
|
+
operator stripped (`^0.34.0` becomes `0.34.0`). Only one comparator (`^`, `~`,
|
|
38
|
+
`>=`, `=` or none) on one version derives; any other range fails the build
|
|
39
|
+
unless the entry sets `exact`. A consumer writes `catalog:<name>:exact`. The
|
|
40
|
+
`:peers` and `:exact` twins are never declarations: neither directive nor
|
|
41
|
+
`upgrade` accepts them as a catalog name.
|
|
42
|
+
|
|
43
|
+
### `sync`
|
|
44
|
+
|
|
45
|
+
Unknown keys are rejected, and `sync` with no block is a usage error (exit 64)
|
|
46
|
+
when the CLI needs it. `sync.catalog` names the catalog that lists the
|
|
47
|
+
members; `sync` moves its entries to the members' next release versions.
|
|
48
|
+
`members.scope` and `members.exclude` match package names; an empty
|
|
49
|
+
`members.scope` is a usage error (exit 64), and one that matches no workspace
|
|
50
|
+
package fails membership as a `SyncWorkspaceError`. `members.packages` matches workspace-relative paths. A member counts when
|
|
51
|
+
its `publishConfig.access` is `"public"`; the plugin package is always
|
|
52
|
+
excluded.
|
|
53
|
+
|
|
54
|
+
| Key | Type | Default | Meaning |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| `catalog` | `string`, required | none | The catalog `sync` owns and rewrites |
|
|
57
|
+
| `members` | object, required | none | Which workspace packages are synced |
|
|
58
|
+
| `members.scope` | `string`, required | none | Package-name glob selecting members, e.g. `"@acme/*"` |
|
|
59
|
+
| `members.packages` | `string[]` | every workspace package | Globs over workspace-relative paths (`"packages/*"`) narrowing discovery |
|
|
60
|
+
| `members.exclude` | `string[]` | `[]` | Package names or globs over names left out of the scope |
|
|
61
|
+
| `changeset` | object | see below | The running-list changeset |
|
|
62
|
+
| `changeset.path` | `string` | `.changeset/catalog-sync.md` | Where the running list is written |
|
|
63
|
+
| `changeset.bump` | `"patch" \| "minor"` | `"patch"` | The plugin's bump in the running list |
|
|
64
|
+
| `commit` | object | see below | The commit message `sync` writes |
|
|
65
|
+
| `commit.scope` | `string` | the `catalog` name | Scope of `chore(<scope>): sync catalog to the next release versions` |
|
|
66
|
+
| `commit.messagePath` | `string` | `.changeset/catalog-sync.commit.txt` | Where the message file is written |
|
|
67
|
+
| `floors` | `boolean` | `false` | Manage breaking-floor changesets (`.changeset/breaking-floor-*.md`). `sync --check` reports a `floors` section when they differ from the release plan; a write-mode `sync` raises them (writes or deletes the files) before reading the plan |
|
|
68
|
+
| `local` | object | see below | The `sync --local` gate |
|
|
69
|
+
| `local.pnpmfile` | `string` | `dist/prod/npm/pkg/pnpmfile.mjs` | The built pnpmfile `--local` imports, relative to the plugin package |
|
|
70
|
+
| `local.catalogs` | `string[]` | every served catalog except `<catalog>`, `<catalog>:peers` and `<catalog>:exact` | The catalogs `--local` compares with `pnpm-workspace.yaml` |
|
|
71
|
+
|
|
72
|
+
### `local`
|
|
73
|
+
|
|
74
|
+
Export-only (`export` and `preview`). Typed as `localPatchesDir` plus any
|
|
75
|
+
managed setting, `catalogs` included (not `name`, `local`,
|
|
76
|
+
`overridesFromCatalogs` or `sync`). A value is a bare value, which replaces
|
|
77
|
+
the generated one, or a `LocalDirective` (see below). Only managed settings
|
|
78
|
+
reach `pnpm-workspace.yaml`: `localPatchesDir` steers patch discovery and is
|
|
79
|
+
never written, and any other key that is not a setting is ignored.
|
|
80
|
+
|
|
81
|
+
| Key | Meaning |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `local.localPatchesDir` | Root searched for distributed patches. Default `public/patches/` beside the build file. The local-only `patches/` folder detection is independent |
|
|
84
|
+
| `local.catalogs` | Replaces the managed `catalogs` map before it is overlaid on the file; the overlay then replaces each catalog it names and keeps the file's other catalogs |
|
|
85
|
+
| `local.<setting>` | A managed setting's override; see "Value forms" |
|
|
86
|
+
|
|
87
|
+
### `overridesFromCatalogs`
|
|
88
|
+
|
|
89
|
+
One directive or an array. Pins every selected member of a catalog to its exact
|
|
90
|
+
catalog version across the whole consumer graph, merged under `overrides` at
|
|
91
|
+
build time. An authored `overrides` entry wins on a selector clash. A pinned
|
|
92
|
+
member's catalog value is frozen to the pinned version in the shipped output;
|
|
93
|
+
the authored range stays what `upgrade` rewrites.
|
|
94
|
+
|
|
95
|
+
| Field | Default | Meaning |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `catalog` | required | The catalog whose members are pinned |
|
|
98
|
+
| `include` | every member | Names or globs (`@effect/*`) to pin; the rest are skipped. Empty list is rejected |
|
|
99
|
+
| `exclude` | none | Names or globs left out; wins over `include` |
|
|
100
|
+
| `scope` | `"line"` | `"line"` selects `name@^X.0.0` (the member's release line); `"any"` emits the bare name, pinning every request |
|
|
101
|
+
|
|
102
|
+
Every `include` or `exclude` entry must match a member, or the build throws.
|
|
103
|
+
Prerelease and compound-range members are skipped rather than widened.
|
|
104
|
+
|
|
105
|
+
## Value forms
|
|
106
|
+
|
|
107
|
+
Every managed setting takes a bare value, or `{ value, enforcement }`. The
|
|
108
|
+
wrapper is recognized only when the object has a `value` key and no keys
|
|
109
|
+
beyond `value`, `enforcement` and (for `publicHoistPattern`) `excludeByRepo`;
|
|
110
|
+
anything else is a bare value, so a record that merely contains a `value` key
|
|
111
|
+
is safe.
|
|
112
|
+
|
|
113
|
+
### Enforcement
|
|
114
|
+
|
|
115
|
+
How a divergence between the managed value and the consumer's local one is
|
|
116
|
+
reported at install time. The default per setting is in the table below.
|
|
117
|
+
|
|
118
|
+
| Level | Meaning |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| `absent` | Silent. The merge result is used and nothing is printed |
|
|
121
|
+
| `warn` | Prints each divergence; the merge result is still used |
|
|
122
|
+
| `error` | Throws once if any divergence is found, naming every divergent setting, and fails the install |
|
|
123
|
+
|
|
124
|
+
Only strategies that detect divergence ever report: `catalogs`, `overrides`,
|
|
125
|
+
`peerDependencyRules`, `securityFlag`, `securityMin` and `allowBuilds`. For
|
|
126
|
+
the rest, enforcement has no effect.
|
|
127
|
+
|
|
128
|
+
### `LocalDirective` (consumer-side, in `local`)
|
|
129
|
+
|
|
130
|
+
`{ value?, strategy?, preserve? }`, every key optional. Applied only by
|
|
131
|
+
`export`.
|
|
132
|
+
|
|
133
|
+
| Form | Effect |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| bare value, or `{ value }` | Replaces the managed value |
|
|
136
|
+
| `{ strategy: "union", value }` | Records: `{ ...managed, ...value }`. Arrays: set union |
|
|
137
|
+
| `{ strategy: "difference", value }` | Removes `value`'s keys or elements from the managed record or array. On a map field (`mapChildWins`, `sectionMerge`), `value` is a list of key names or a map whose keys are removed, from the managed and kept file entries alike |
|
|
138
|
+
| `{ strategy: "merge", value }` | Same as `union`; used for `patchedDependencies` to upsert owned keys |
|
|
139
|
+
| `{ strategy: "rewrite" }` | No value: keeps the managed value, and opts a union field out of keeping the file's entries |
|
|
140
|
+
| `preserve` | `overrides` only. Protocols whose existing file entries are kept (default `file`, `link`, `workspace`, `portal`) |
|
|
141
|
+
|
|
142
|
+
Fields whose strategy is `arrayUnion` or `arrayRecordUnion` also keep the
|
|
143
|
+
existing `pnpm-workspace.yaml` entries on export, as install does, unless the
|
|
144
|
+
directive is `rewrite`. Fields whose strategy is `mapChildWins` or
|
|
145
|
+
`sectionMerge` keep the keys only the file holds; on a key both hold the
|
|
146
|
+
managed value wins, so a managed change is exported. A section's list keys
|
|
147
|
+
are unioned, and its other keys are `managed ?? file`. A bare value or a
|
|
148
|
+
`union` directive applies first, and the file-only keys are kept under the
|
|
149
|
+
result. A deliberate repo-specific value for a managed key goes in `local`.
|
|
150
|
+
A directive is recognized only when its keys are a non-empty subset of
|
|
151
|
+
`value`, `strategy`, `preserve`.
|
|
152
|
+
|
|
153
|
+
## Specially shaped settings
|
|
154
|
+
|
|
155
|
+
| Setting | Extra shape |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `publicHoistPattern` | Wrapped form adds `excludeByRepo: { [consumingRepoName]: patterns[] }`. The key is the consuming repo's root `package.json` name; its patterns are dropped from the merged list in that repo only |
|
|
158
|
+
| `overrides` | A plain `Record<string, string>`. Fed by `overridesFromCatalogs`; setting only the directive still creates `overrides` |
|
|
159
|
+
| `peerDependencyRules` | Adds `allowedVersionsFromCatalogs` beside `allowedVersions`, `ignoreMissing`, `allowAny` (see below) |
|
|
160
|
+
| `patchedDependencies` | Also accepts `{ strategy: "rewrite" }`, the default when `public/patches/` has files: discovers patches and rewrites their paths to `node_modules/.pnpm-config/<name>/` |
|
|
161
|
+
| `audit`, `update` | Sections. List keys union with the consumer's; other keys are the consumer's when set |
|
|
162
|
+
| `catalogs` | Not a settings value: built from the top-level `catalogs` key; enforcement `warn` |
|
|
163
|
+
|
|
164
|
+
### `peerDependencyRules.allowedVersionsFromCatalogs`
|
|
165
|
+
|
|
166
|
+
One directive or an array. For each catalog entry with an exact pinned
|
|
167
|
+
version, emits `"<name>@<pin>><peer>"` valued at the peer package's catalog
|
|
168
|
+
version. Merged into `allowedVersions` at build time, then stripped; an
|
|
169
|
+
authored entry wins on a clash.
|
|
170
|
+
|
|
171
|
+
| Field | Default | Meaning |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| `catalog` | required | The catalog supplying the rules |
|
|
174
|
+
| `peer` | required | The peer package each rule targets; it gets no rule of its own |
|
|
175
|
+
| `prefix` | verbatim | Operator applied to the peer value: `"^"`, `"~"`, `">="`; `null` or `""` strips to exact |
|
|
176
|
+
|
|
177
|
+
## Strategies
|
|
178
|
+
|
|
179
|
+
How the pnpmfile merges the managed value with the consumer's local one.
|
|
180
|
+
`local` below is the consumer's `pnpm-workspace.yaml` value.
|
|
181
|
+
|
|
182
|
+
| Strategy | Merge |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| `scalar` | `local ?? managed`. Quiet |
|
|
185
|
+
| `mapChildWins` | `{ ...managed, ...local }`. Quiet |
|
|
186
|
+
| `arrayUnion` | Union of both lists, deduped and sorted. Quiet |
|
|
187
|
+
| `arrayRecordUnion` | Per-key union of string-array records, sorted, empty keys dropped. Quiet |
|
|
188
|
+
| `sectionMerge` | List-valued keys union like `arrayUnion`; any other key is `local ?? managed`. Quiet |
|
|
189
|
+
| `overrides` | Local wins per key; a differing key is an override divergence |
|
|
190
|
+
| `peerDependencyRules` | `allowedVersions` like `overrides`; `ignoreMissing` and `allowAny` union |
|
|
191
|
+
| `catalogs` | Each catalog merged, local wins per package, with override divergences. A local change that names one version re-derives `<name>:exact`; `<name>:peers` keeps its managed value |
|
|
192
|
+
| `securityFlag` | `local ?? managed`; diverges when local sets `false` over a managed `true` |
|
|
193
|
+
| `securityMin` | `local ?? managed`; diverges when local lowers a managed number |
|
|
194
|
+
| `allowBuilds` | `{ ...managed, ...local }`; diverges when local enables a build the managed config blocked |
|
|
195
|
+
|
|
196
|
+
## Managed settings
|
|
197
|
+
|
|
198
|
+
One row per managed setting: its strategy, its default enforcement, and what it
|
|
199
|
+
means (from the pnpm settings catalog). Each takes a bare value or
|
|
200
|
+
`{ value, enforcement }`. The `catalogs` row is built from the top-level
|
|
201
|
+
`catalogs` key, not set directly.
|
|
202
|
+
|
|
203
|
+
| Setting | Strategy | Enforcement | Meaning |
|
|
204
|
+
| --- | --- | --- | --- |
|
|
205
|
+
| `catalogs` | `catalogs` | `warn` | The named catalogs, each mapping dependency names to the ranges `catalog:<name>` resolves to. |
|
|
206
|
+
| `packageExtensions` | `mapChildWins` | `absent` | Extra manifest fields (dependencies, peerDependencies and so on) merged into matching packages' definitions, keyed by package selector. |
|
|
207
|
+
| `allowedDeprecatedVersions` | `mapChildWins` | `absent` | Deprecated package versions whose deprecation warning is muted, keyed by package. |
|
|
208
|
+
| `publicHoistPattern` | `arrayUnion` | `absent` | Patterns hoisted to the root `node_modules` (unlike `hoistPattern`, which hoists inside the virtual store). |
|
|
209
|
+
| `minimumReleaseAgeExclude` | `arrayUnion` | `absent` | Dependencies that always install the newest version, exempt from `minimumReleaseAge`. |
|
|
210
|
+
| `supportedArchitectures` | `arrayRecordUnion` | `absent` | Architectures (`os`, `cpu`, `libc`) to install optional dependencies for, whatever the host is. |
|
|
211
|
+
| `audit` | `sectionMerge` | `absent` | The `pnpm audit` section: the minimum `level` to report, the advisories to `ignore`, and whether to prune stale ignores. |
|
|
212
|
+
| `auditConfig` | `arrayRecordUnion` | `absent` | The deprecated spelling of `audit.ignore`: the GitHub advisory IDs (`ignoreGhsas`) `pnpm audit` ignores. |
|
|
213
|
+
| `overrides` | `overrides` | `warn` | This field allows you to instruct pnpm to override any dependency in the dependency graph, including peer dependencies. |
|
|
214
|
+
| `peerDependencyRules` | `peerDependencyRules` | `warn` | Deprecated: `peerDependencyRules` only suppresses peer dependency warnings after resolution without changing `peerDependencies`. |
|
|
215
|
+
| `strictDepBuilds` | `securityFlag` | `warn` | Exit non-zero when any dependency has an unreviewed build script. |
|
|
216
|
+
| `blockExoticSubdeps` | `securityFlag` | `warn` | Only direct dependencies may use exotic sources (git repositories, tarball URLs). |
|
|
217
|
+
| `minimumReleaseAge` | `securityMin` | `warn` | Minutes a release must age before pnpm installs it, delaying newly published versions. |
|
|
218
|
+
| `allowBuilds` | `allowBuilds` | `warn` | Packages whose build scripts are allowed (`true`) or refused (`false`), by name or `name@version`. |
|
|
219
|
+
| `ignoredOptionalDependencies` | `arrayUnion` | `absent` | Deprecated: use `overrides` with `:optional` and `"-"` instead (for example, `"fsevents:optional": "-"` and `"@esbuild/*:optional": "-"`). |
|
|
220
|
+
| `update` | `sectionMerge` | `absent` | The `pnpm update` and `pnpm outdated` section: patterns to skip, change intent, GitHub Actions updates. |
|
|
221
|
+
| `updateConfig` | `mapChildWins` | `absent` | Deprecated spelling of `update`; use `update`. |
|
|
222
|
+
| `catalog` | `mapChildWins` | `warn` | The default catalog: dependency names and the version ranges the `catalog:` protocol resolves to. |
|
|
223
|
+
| `minimumReleaseAgeStrict` | `scalar` | `warn` | Whether resolution fails when no version in the requested range satisfies `minimumReleaseAge`. |
|
|
224
|
+
| `minimumReleaseAgeIgnoreMissingTime` | `scalar` | `warn` | Skip the `minimumReleaseAge` check for a package whose registry metadata has no `time` field. |
|
|
225
|
+
| `trustPolicy` | `scalar` | `warn` | `no-downgrade` makes pnpm fail when a package's trust level dropped compared with earlier releases. |
|
|
226
|
+
| `trustPolicyExclude` | `arrayUnion` | `warn` | Package selectors excluded from the trust policy check. |
|
|
227
|
+
| `trustPolicyIgnoreAfter` | `scalar` | `warn` | Skip the trust policy check for releases published more than this many minutes ago. |
|
|
228
|
+
| `trustLockfile` | `scalar` | `warn` | Skip the supply-chain pass that re-applies `minimumReleaseAge` and `trustPolicy` to the loaded lockfile. |
|
|
229
|
+
| `hoist` | `scalar` | `absent` | When `true`, all dependencies are hoisted to `node_modules/.pnpm/node_modules`. |
|
|
230
|
+
| `hoistWorkspacePackages` | `scalar` | `absent` | When `true`, workspace projects are hoisting candidates too, not only registry packages. |
|
|
231
|
+
| `hoistPattern` | `arrayUnion` | `absent` | Packages hoisted to `node_modules/.pnpm/node_modules`. |
|
|
232
|
+
| `shamefullyHoist` | `scalar` | `absent` | Hoist every dependency to the root `node_modules` (a flat layout). |
|
|
233
|
+
| `hoistingLimits` | `scalar` | `absent` | How far dependencies are hoisted under `nodeLinker: hoisted`. |
|
|
234
|
+
| `modulesDir` | `scalar` | `absent` | Directory dependencies install into instead of `node_modules`. |
|
|
235
|
+
| `nodeLinker` | `scalar` | `absent` | Which linker installs packages: `isolated`, `hoisted`, `pnp`, `loaded`, or `{ type: loaded, excluded }`. |
|
|
236
|
+
| `symlink` | `scalar` | `absent` | When `false`, pnpm creates the virtual store directory without any symlinks. |
|
|
237
|
+
| `enableModulesDir` | `scalar` | `absent` | When `false`, pnpm writes no files to the modules directory (`node_modules`). |
|
|
238
|
+
| `virtualStoreDir` | `scalar` | `absent` | Directory of links to the store; every direct and indirect dependency is linked into it. |
|
|
239
|
+
| `virtualStoreDirMaxLength` | `scalar` | `absent` | Maximum length of directory names inside the virtual store (`node_modules/.pnpm`). |
|
|
240
|
+
| `virtualStoreOnly` | `scalar` | `absent` | Populate the virtual store only: no importer symlinks, hoisting, bin links or lifecycle scripts. |
|
|
241
|
+
| `packageImportMethod` | `scalar` | `absent` | How packages are imported from the store into `node_modules`. To disable symlinks change `nodeLinker`, not this. |
|
|
242
|
+
| `modulesCacheMaxAge` | `scalar` | `absent` | Minutes after which orphan packages are removed from the modules directory. |
|
|
243
|
+
| `dlxCacheMaxAge` | `scalar` | `absent` | Minutes after which the `pnpm dlx` cache expires; until then a repeated dlx call skips installation. |
|
|
244
|
+
| `verifyStoreIntegrity` | `scalar` | `warn` | Check a store file's content before linking it into a project's `node_modules`, in case it was modified. |
|
|
245
|
+
| `strictStorePkgContentCheck` | `scalar` | `warn` | Verify package content against its name and version, since some registries serve identical content under several names or versions. |
|
|
246
|
+
| `lockfile` | `scalar` | `absent` | When `false`, pnpm neither reads nor writes `pnpm-lock.yaml`. |
|
|
247
|
+
| `preferFrozenLockfile` | `scalar` | `absent` | When `pnpm-lock.yaml` satisfies the `package.json` dependencies, perform a headless install. |
|
|
248
|
+
| `lockfileIncludeTarballUrl` | `scalar` | `absent` | Add the full tarball URL to every `pnpm-lock.yaml` entry. |
|
|
249
|
+
| `gitBranchLockfile` | `scalar` | `absent` | Name the generated lockfile after the current branch, to avoid merge conflicts. |
|
|
250
|
+
| `mergeGitBranchLockfilesBranchPattern` | `arrayUnion` | `absent` | Branch name patterns whose git-branch lockfiles are merged into the main lockfile on install. |
|
|
251
|
+
| `peersSuffixMaxLength` | `scalar` | `absent` | Maximum length of the peer-ID suffix on dependency keys in the lockfile. |
|
|
252
|
+
| `sharedWorkspaceLockfile` | `scalar` | `absent` | Whether the workspace uses a single root `pnpm-lock.yaml` (default `true`). |
|
|
253
|
+
| `autoInstallPeers` | `scalar` | `absent` | Automatically install missing non-optional peer dependencies. |
|
|
254
|
+
| `dedupePeerDependents` | `scalar` | `absent` | Deduplicate packages with peer dependencies after peers are resolved. |
|
|
255
|
+
| `dedupePeers` | `scalar` | `absent` | Peer suffixes use `name@version` instead of full dep paths, removing nested suffixes like `(foo@1.0.0(bar@2.0.0))`. |
|
|
256
|
+
| `strictPeerDependencies` | `scalar` | `absent` | Commands fail when a peer dependency is missing or invalid in the tree. |
|
|
257
|
+
| `resolvePeersFromWorkspaceRoot` | `scalar` | `absent` | Resolve any workspace project's peer dependencies from the root project's dependencies. |
|
|
258
|
+
| `dangerouslyAllowAllBuilds` | `scalar` | `warn` | Run every dependency build script (`preinstall`, `install`, `postinstall`) automatically, without approval. |
|
|
259
|
+
| `ignoreScripts` | `scalar` | `absent` | Run no scripts defined in the project `package.json` or its dependencies. |
|
|
260
|
+
| `childConcurrency` | `scalar` | `absent` | Maximum child processes allocated at once to build `node_modules`. |
|
|
261
|
+
| `sideEffectsCache` | `scalar` | `absent` | Use and cache (pre/post)install hook results: a boolean, or `{ read, write, remote, exclude }`. |
|
|
262
|
+
| `sideEffectsCacheReadonly` | `scalar` | `absent` | Use the side effects cache when present but never create it for new packages. |
|
|
263
|
+
| `nodeOptions` | `scalar` | `absent` | Options passed to Node.js through `NODE_OPTIONS` when running scripts. |
|
|
264
|
+
| `verifyDepsBeforeRun` | `scalar` | `absent` | Whether `pnpm run` and `pnpm exec` check the state of dependencies first, and what they do when it is stale: `install`, `warn`, `error`, `prompt`, `true` (check only) or `false`. |
|
|
265
|
+
| `enablePrePostScripts` | `scalar` | `absent` | Run `pre` and `post` scripts automatically around the main script. |
|
|
266
|
+
| `scriptShell` | `scalar` | `absent` | Shell used to run scripts with `pnpm run`. |
|
|
267
|
+
| `shellEmulator` | `scalar` | `absent` | Run scripts in pnpm's built-in cross-platform, bash-like shell. |
|
|
268
|
+
| `requiredScripts` | `arrayUnion` | `absent` | Scripts that must exist in every project selected by `pnpm -r run <script>`. |
|
|
269
|
+
| `patchedDependencies` | `mapChildWins` | `warn` | Patches to apply to dependencies: keys are `name` or `name@version`, values are patch file paths, relative to the workspace root or absolute. |
|
|
270
|
+
| `allowUnusedPatches` | `scalar` | `absent` | When `true`, patches matching no installed dependency warn instead of failing with `ERR_PNPM_UNUSED_PATCH`. |
|
|
271
|
+
| `patchesDir` | `scalar` | `absent` | Directory `pnpm patch-commit` writes patch files to; `patches` when unset. |
|
|
272
|
+
| `configDependencies` | `mapChildWins` | `absent` | Packages pnpm installs before reading the rest of the configuration, keyed by name, each value a version with its integrity. |
|
|
273
|
+
| `injectWorkspacePackages` | `scalar` | `absent` | When `true`, workspace-package resolutions materialize as `file:` (hard-linked copies into the virtual store) instead of `link:` symlinks back to the source. |
|
|
274
|
+
| `syncInjectedDepsAfterScripts` | `arrayUnion` | `absent` | The scripts after which pnpm re-syncs injected workspace dependencies into the projects that inject them. |
|
|
275
|
+
| `dedupeInjectedDeps` | `scalar` | `absent` | Rewrite injected workspace dependencies back to symlinks when their children are a subset of the target project's direct dependencies. |
|
|
276
|
+
| `pmOnFail` | `scalar` | `absent` | Overrides `onFail` of the `packageManager` field and `devEngines.packageManager` when the running pnpm version differs from the declared one. |
|
|
277
|
+
| `runtimeOnFail` | `scalar` | `absent` | Overrides `onFail` of `devEngines.runtime` (and `engines.runtime`) in the root `package.json`. |
|
|
278
|
+
| `nodeVersion` | `scalar` | `absent` | Node.js version used when checking a package's `engines` field. |
|
|
279
|
+
| `nodeDownloadMirrors` | `mapChildWins` | `absent` | Custom Node.js download mirrors, keyed by release channel (`release`, `rc`, `nightly`, ...), each value the complete base URL for its channel. |
|
|
280
|
+
| `catalogMode` | `scalar` | `absent` | Whether and how `pnpm add` adds dependencies to the default catalog. |
|
|
281
|
+
| `cleanupUnusedCatalogs` | `scalar` | `absent` | Former name of `catalogPrune`, which removes catalog entries no project uses; `catalogPrune` wins when both are set. |
|
|
282
|
+
| `linkWorkspacePackages` | `scalar` | `absent` | Whether a bare version range resolves to a matching workspace package: `true`, `false`, or `deep` to link in dependencies of dependencies too. |
|
|
283
|
+
| `preferWorkspacePackages` | `scalar` | `absent` | When `true`, prefer a workspace package over a registry pick even when the registry version is newer than the workspace one. |
|
|
284
|
+
| `saveWorkspaceProtocol` | `scalar` | `absent` | How `pnpm add` and `pnpm update` write a dependency linked to a workspace package: `true` saves `workspace:` with the range, `false` saves the range alone, `rolling` saves `workspace:^`/`workspace:~`. |
|
|
285
|
+
| `includeWorkspaceRoot` | `scalar` | `absent` | Whether a recursive command also runs on the workspace root project. |
|
|
286
|
+
| `ignoreWorkspaceCycles` | `scalar` | `absent` | Suppress the report a recursive install makes when the selected workspace projects depend on each other in a cycle. |
|
|
287
|
+
| `disallowWorkspaceCycles` | `scalar` | `absent` | Make a cycle among the selected workspace projects an error (`ERR_PNPM_DISALLOW_WORKSPACE_CYCLES`) rather than a warning. |
|
|
288
|
+
| `workspaceConcurrency` | `scalar` | `absent` | How many projects a recursive command processes at once; a zero or negative value is subtracted from the available parallelism. |
|
|
289
|
+
| `auditLevel` | `scalar` | `absent` | The deprecated spelling of `audit.level`: the lowest advisory severity `pnpm audit` reports. |
|
|
290
|
+
| `resolutionMode` | `scalar` | `absent` | Resolution algorithm: `highest` (default), `time-based` or `lowest-direct`. |
|
|
291
|
+
| `savePrefix` | `scalar` | `absent` | Prefix on versions `pnpm add` saves to `package.json` (`^`, `~` or empty). |
|
|
292
|
+
| `saveExact` | `scalar` | `absent` | When set to `true`, `pnpm add` saves the resolved version without a range operator, as the `--save-exact` CLI option does. |
|
|
293
|
+
| `tag` | `scalar` | `absent` | Dist-tag `pnpm add` resolves when no version is given. |
|
|
294
|
+
| `preferOffline` | `scalar` | `absent` | Prefer the local store on read, falling back to the network on a cache miss. |
|
|
295
|
+
| `dedupeDirectDeps` | `scalar` | `absent` | Skip symlinking a dependency into a project's `node_modules` when it is already symlinked in the workspace root's. |
|
|
296
|
+
| `deployAllFiles` | `scalar` | `absent` | Copy every file of a deployed or locally installed package, not only the published set. |
|
|
297
|
+
| `forceLegacyDeploy` | `scalar` | `absent` | Force `pnpm deploy` to use the legacy install-based implementation even when a shared workspace lockfile is available. |
|
|
298
|
+
| `extendNodePath` | `scalar` | `absent` | Set `NODE_PATH` in command shims (the wrapper scripts in `node_modules/.bin`). |
|
|
299
|
+
| `preferSymlinkedExecutables` | `scalar` | `absent` | Symlink executables in `node_modules/.bin` instead of writing command shims. |
|
|
300
|
+
| `ignoreCompatibilityDb` | `scalar` | `absent` | Skip the built-in compatibility database that automatically patches some packages' dependencies on install. |
|
|
301
|
+
| `optimisticRepeatInstall` | `scalar` | `absent` | Run a fast up-to-date check before installing and skip the install when nothing changed. |
|
|
302
|
+
| `recursiveInstall` | `scalar` | `absent` | Make `pnpm install` behave like `pnpm install -r`, installing every workspace project. |
|
|
303
|
+
| `engineStrict` | `scalar` | `absent` | Fail installation when the project or a dependency's `engines.node` rejects the current Node.js version. |
|
|
304
|
+
| `networkConcurrency` | `scalar` | `absent` | Maximum HTTP(S) requests processed at once. |
|
|
305
|
+
| `fetchRetries` | `scalar` | `absent` | Times pnpm retries a failed registry fetch. |
|
|
306
|
+
| `fetchRetryFactor` | `scalar` | `absent` | Exponential factor of the retry backoff. |
|
|
307
|
+
| `fetchRetryMintimeout` | `scalar` | `absent` | Lower bound, in milliseconds, of the retry backoff. |
|
|
308
|
+
| `fetchRetryMaxtimeout` | `scalar` | `absent` | Upper bound, in milliseconds, of the retry backoff. |
|
|
309
|
+
| `fetchTimeout` | `scalar` | `absent` | Milliseconds an HTTP request may stall without receiving data; the clock resets on every chunk. |
|
|
310
|
+
| `gitShallowHosts` | `arrayUnion` | `absent` | Git hosts from which dependencies are cloned shallowly, fetching only the needed commit. |
|
|
311
|
+
| `provenance` | `scalar` | `absent` | Whether `pnpm publish` attaches a provenance attestation; unset lets trusted publishing decide. |
|
|
312
|
+
| `gitChecks` | `scalar` | `absent` | Before `pnpm publish`, verify the git tree is clean, on the expected branch and up to date (default `true`). |
|
|
313
|
+
| `embedReadme` | `scalar` | `absent` | Add the package README to the `readme` field of the packed `package.json` on `pnpm pack` and `pnpm publish`, unless already set. |
|
|
314
|
+
| `publishBranch` | `scalar` | `absent` | Branch `pnpm publish` allows when git checks run; unset allows `master` or `main`. |
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Operating `rolldown-pnpm-config sync`
|
|
2
|
+
|
|
3
|
+
`sync` keeps the plugin's own catalog (`sync.catalog`) at the versions the
|
|
4
|
+
next release will publish, and records every move in a running-list
|
|
5
|
+
changeset. It reads the `sync` block of the config; the wiring reference
|
|
6
|
+
lists the fields.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
rolldown-pnpm-config sync [config] [--check | --local] [--floors-only] [--format json]
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`config` defaults to the single top-level `.ts` file in the current directory
|
|
13
|
+
that calls `PnpmConfigPlugin(...)`.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
| Mode | Writes | Network | Sections, in report order | Run by |
|
|
18
|
+
| --- | --- | --- | --- | --- |
|
|
19
|
+
| `sync` | yes | registry | membership refusal, then the write | the Catalog Sync workflow; you only when the user asks |
|
|
20
|
+
| `sync --check` | never | registry | `versions`, `membership`, `floors` (only with `sync.floors: true`), `running-list`, `ripples` | the Catalog Sync workflow, as its gate |
|
|
21
|
+
| `sync --local` | never | none | `membership`, `export` | the pre-push hook; safe for you to run |
|
|
22
|
+
| `sync --floors-only` | yes | none | the floors step alone: write or delete `.changeset/breaking-floor-*.md` | a floors script or hook; needs `sync.floors: true` |
|
|
23
|
+
| `sync --check --floors-only` | never | none | `floors` | a floors gate; safe for you to run |
|
|
24
|
+
|
|
25
|
+
`--check` and `--local` together are a usage error, and so is
|
|
26
|
+
`--floors-only` with `--local`. Every gate section is
|
|
27
|
+
evaluated; none stops the others.
|
|
28
|
+
|
|
29
|
+
What plain `sync` does, in order: refuse if a publishable member is missing
|
|
30
|
+
(before any write); raise breaking floors when `sync.floors` is on; read the
|
|
31
|
+
release plan; run `upgrade --yes` scoped to `sync.catalog`; repair ripples
|
|
32
|
+
(entries behind a version the plan releases only as a dependency ripple);
|
|
33
|
+
merge this run's moves into the running list (or rewrite a stale list when
|
|
34
|
+
nothing moved); write the commit message to `sync.commit.messagePath`.
|
|
35
|
+
|
|
36
|
+
## Exit codes
|
|
37
|
+
|
|
38
|
+
| Code | Meaning |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| 0 | every section ok, or the write succeeded |
|
|
41
|
+
| 1 | a finding, a section that could not be evaluated, or a failed write (membership, release plan, upgrade, workspace) |
|
|
42
|
+
| 64 | usage: `--check --local` or `--floors-only --local`; `--floors-only` with `sync.floors` off; a config that does not parse or has no `PnpmConfigPlugin(...)` call; or no or an invalid `sync` block |
|
|
43
|
+
|
|
44
|
+
Exit 1 does not mean drift. Read the report or the JSON before acting.
|
|
45
|
+
|
|
46
|
+
## Reading `--format json`
|
|
47
|
+
|
|
48
|
+
The gates print one single-line JSON document on stdout in every outcome
|
|
49
|
+
but one: `--check --local` is a usage error (exit 64) that prints nothing on
|
|
50
|
+
stdout. The document, wrapped here:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{"command":"sync","mode":"check","evaluated":true,"sections":[
|
|
54
|
+
{"section":"versions","status":"ok"},
|
|
55
|
+
{"section":"membership","status":"findings","rows":[" - @acme/new"],"remedy":"..."},
|
|
56
|
+
{"section":"ripples","status":"error","kind":"ReleasePlanError","message":"..."}
|
|
57
|
+
]}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- `status: "findings"` is an answer: the tree is out of sync, and `remedy`
|
|
61
|
+
says what clears it.
|
|
62
|
+
- `status: "error"` is not an answer: the section could not be evaluated
|
|
63
|
+
(registry or auth failure, a malformed pending changeset, an unreadable
|
|
64
|
+
release plan, an unreadable workspace). `kind` names the cause.
|
|
65
|
+
- `evaluated` is `false` when any section is `error`. Branch on it first:
|
|
66
|
+
never report drift, and never run a remedy, for an unevaluated run. Fix the
|
|
67
|
+
cause and rerun.
|
|
68
|
+
- A config that cannot be found, read or decoded prints
|
|
69
|
+
`{"command":"sync","mode":"check","evaluated":false,"sections":[],"error":{"kind":"...","message":"..."}}`
|
|
70
|
+
(`mode` is `"check"` or `"local"`). `kind` is the failure's tag, such as
|
|
71
|
+
`SyncConfigError` (a config that does not parse, has no
|
|
72
|
+
`PnpmConfigPlugin(...)` call, or has no or an invalid `sync` block; exit 64) or
|
|
73
|
+
`UpgradeError` (the config file cannot be read, exit 1).
|
|
74
|
+
- Plain `sync --format json` prints
|
|
75
|
+
`{"command":"sync","mode":"write","moves":[...],"ripples":[...],"membership":{...},"wrote":true,"listWritten":true}`.
|
|
76
|
+
Branch on the presence of `error` first. With `error` the run failed, and
|
|
77
|
+
`wrote` and `listWritten` are always `false`: they say the running list and
|
|
78
|
+
commit message were not written, not that nothing was. A run that fails
|
|
79
|
+
after its floors step or its upgrade may already have written
|
|
80
|
+
breaking-floor changesets or the config; check `git status` before
|
|
81
|
+
rerunning. `wrote: false` without `error` means the catalog was already
|
|
82
|
+
current and nothing needed writing.
|
|
83
|
+
|
|
84
|
+
The text view prints only failing sections: a heading, the rows, then the
|
|
85
|
+
remedy. An `error` section is headed "could not be evaluated (`<kind>`, not a
|
|
86
|
+
finding)"; the versions section uses "Catalog check failed before drift
|
|
87
|
+
could be evaluated (resolution error, not drift)".
|
|
88
|
+
|
|
89
|
+
## Remedies
|
|
90
|
+
|
|
91
|
+
| Section | Finding means | Do |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| `versions` | A `sync.catalog` entry is behind its next release version | Expected on any branch with a changeset. The workflow runs `sync` on the release PR. Run `pnpm catalog:sync` only if the user asks |
|
|
94
|
+
| `membership` | A publishable member in `members.scope` is not in the catalog | Add an entry at the `PnpmConfigPlugin(...)` call site with `source: "workspace"`, or add it to `members.exclude` if it must not be catalogued |
|
|
95
|
+
| `floors` | The `.changeset/breaking-floor-*.md` files differ from what the plan derives | Run `sync` (the workflow does) |
|
|
96
|
+
| `running-list` | `.changeset/catalog-sync.md` disagrees with the catalog (hand-edited, or carried over a merge) | Run `sync`; it rewrites the list. Do not hand-edit the list |
|
|
97
|
+
| `ripples` | An entry is behind a version the plan releases only as a dependency bump | Run `sync` (the workflow does) |
|
|
98
|
+
| `export`, `not built` | The built pnpmfile is missing | Build the plugin (`pnpm exec turbo run build --filter=<plugin>`), then rerun `--local` |
|
|
99
|
+
| `export`, served vs yaml rows | `pnpm-workspace.yaml` does not match what the built plugin serves | Ask the user to run `pnpm pnpm:export`, then rebuild. Never run `pnpm:export` yourself |
|
|
100
|
+
|
|
101
|
+
The `rows` of each section name the packages; copy them into your report to
|
|
102
|
+
the user.
|
|
103
|
+
|
|
104
|
+
Error kinds you will meet: `resolution` (a registry lookup failed: network,
|
|
105
|
+
auth, or a package that does not exist), `catalog` (`sync.catalog` names a
|
|
106
|
+
catalog the config does not declare), `changeset` (a pending changeset will
|
|
107
|
+
not parse), `peer-strategy`, `ReleasePlanError`, `SyncWorkspaceError` (no
|
|
108
|
+
`pnpm-workspace.yaml`, a bad glob, a `members.scope` that matches no workspace
|
|
109
|
+
package (a typo), or no publishable member while the catalog names some:
|
|
110
|
+
check `publishConfig.access`), `LocalGateError` (the built
|
|
111
|
+
pnpmfile cannot be evaluated), `UpgradeError` (the running list or the config
|
|
112
|
+
cannot be read, in `running-list` or `ripples`). Any other kind in `export`
|
|
113
|
+
(a `PlatformError`, a YAML parse failure) means `pnpm-workspace.yaml` or the
|
|
114
|
+
plugin's `package.json` cannot be read or parsed.
|
|
115
|
+
|
|
116
|
+
## Why `--local` skips the sync catalog
|
|
117
|
+
|
|
118
|
+
By default `--local` compares every catalog the built pnpmfile serves except
|
|
119
|
+
`sync.catalog` and its derived `<sync.catalog>:peers` and
|
|
120
|
+
`<sync.catalog>:exact` twins. The workflow's sync commits only
|
|
121
|
+
the config literal and the changesets; it never re-exports
|
|
122
|
+
`pnpm-workspace.yaml`, because `pnpm:export` is run by the user only. The
|
|
123
|
+
yaml's copy of the sync catalog therefore lags by design, and comparing it
|
|
124
|
+
would block every push. Version drift is `--check`'s question, and needs the
|
|
125
|
+
network. Override the list with `sync.local.catalogs` only when the user asks.
|
|
126
|
+
|
|
127
|
+
## Why a repaired Catalog Sync check stays red
|
|
128
|
+
|
|
129
|
+
On the release PR the workflow runs `catalog:check` first, then `sync`, then
|
|
130
|
+
commits the repair, then writes the `Catalog Sync` check run once, at the end,
|
|
131
|
+
with its conclusion already decided. A check that found drift reports
|
|
132
|
+
failure even when the repair commit landed ("Catalog was out of date,
|
|
133
|
+
synced"): the run is never updated after it is written, and the drift was
|
|
134
|
+
real at that ref.
|
|
135
|
+
|
|
136
|
+
- Do not try to fix a red check whose summary says it synced. Confirm the
|
|
137
|
+
sync commit landed (the summary links it).
|
|
138
|
+
- The next run on a ref that contains the sync commit goes green. When the
|
|
139
|
+
sync commit went to `main`, the release PR's next update reruns the check;
|
|
140
|
+
otherwise rerun the workflow.
|
|
141
|
+
- A red check whose summary says the check and sync disagree, or that the
|
|
142
|
+
sync did not complete, is a real failure. Read the run log.
|