rolldown-pnpm-config 0.1.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/bin/rolldown-pnpm-config.js +21 -0
  4. package/catalogs.js +27 -0
  5. package/cli/commands/export.js +118 -0
  6. package/cli/commands/preview.js +73 -0
  7. package/cli/commands/upgrade.js +437 -0
  8. package/cli/diff/build.js +122 -0
  9. package/cli/diff/render.js +103 -0
  10. package/cli/discover.js +128 -0
  11. package/cli/drift.js +22 -0
  12. package/cli/edits.js +41 -0
  13. package/cli/effective.js +42 -0
  14. package/cli/evaluate.js +91 -0
  15. package/cli/interop.js +285 -0
  16. package/cli/local-merge.js +75 -0
  17. package/cli/peer-range.js +34 -0
  18. package/cli/plan.js +66 -0
  19. package/cli/preview-views.js +34 -0
  20. package/cli/release-age.js +74 -0
  21. package/cli/resolve.js +109 -0
  22. package/cli/rewrite.js +22 -0
  23. package/cli/select-file.js +64 -0
  24. package/cli/summary.js +137 -0
  25. package/cli/ui/Preview.js +60 -0
  26. package/cli/ui/Walk.js +55 -0
  27. package/cli/ui/ansi.js +20 -0
  28. package/cli/ui/env.js +20 -0
  29. package/cli/ui/run-preview.js +23 -0
  30. package/cli/ui/run-walk.js +29 -0
  31. package/cli/ui/styled.js +27 -0
  32. package/cli/walk-plan.js +35 -0
  33. package/cli/walk-reducer.js +61 -0
  34. package/cli/workspace-file.js +58 -0
  35. package/cli/workspace-overlay.js +21 -0
  36. package/descriptors/build.js +248 -0
  37. package/descriptors/hoisting.js +175 -0
  38. package/descriptors/index.js +38 -0
  39. package/descriptors/lockfile.js +117 -0
  40. package/descriptors/misc.js +144 -0
  41. package/descriptors/network.js +108 -0
  42. package/descriptors/resolution.js +250 -0
  43. package/descriptors/runtime-cfg.js +90 -0
  44. package/descriptors/schemas.js +26 -0
  45. package/descriptors/workspace.js +116 -0
  46. package/index.d.ts +363 -0
  47. package/index.js +3 -0
  48. package/package.json +60 -0
  49. package/plugin/freeze.js +79 -0
  50. package/plugin/index.js +48 -0
  51. package/plugin/serialize.js +26 -0
  52. package/registry.js +8 -0
  53. package/runtime/ctx.js +39 -0
  54. package/runtime/enforcement.js +36 -0
  55. package/runtime/strategies/arrays.js +37 -0
  56. package/runtime/strategies/catalogs.js +36 -0
  57. package/runtime/strategies/maps.js +46 -0
  58. package/runtime/strategies/overrides.js +57 -0
  59. package/runtime/strategies/scalar.js +57 -0
  60. package/runtime/strategies/table.js +27 -0
  61. package/runtime/warnings.js +61 -0
  62. package/runtime.d.ts +111 -0
  63. package/runtime.js +54 -0
  64. package/tsdoc-metadata.json +11 -0
  65. package/virtual.d.ts +18 -0
@@ -0,0 +1,90 @@
1
+ import { Bool, Str, UnknownRecord } from "./schemas.js";
2
+ import { Schema } from "effect";
3
+
4
+ //#region src/descriptors/runtime-cfg.ts
5
+ /** The 8 package-manager version + node-version fields. @internal */
6
+ const runtimeCfg = {
7
+ packageManagerStrict: {
8
+ schema: Bool,
9
+ kind: "boolean",
10
+ strategy: "scalar",
11
+ enforcement: "absent",
12
+ doc: "Whether pnpm enforces use of the package manager specified in packageManager.",
13
+ workspaceYaml: true,
14
+ anchor: "packagemanagerstrict"
15
+ },
16
+ packageManagerStrictVersion: {
17
+ schema: Bool,
18
+ kind: "boolean",
19
+ strategy: "scalar",
20
+ enforcement: "absent",
21
+ doc: "Whether pnpm enforces the exact version of the package manager specified in packageManager.",
22
+ workspaceYaml: true,
23
+ anchor: "packagemanagerstrictversion"
24
+ },
25
+ managePackageManagerVersions: {
26
+ schema: Bool,
27
+ kind: "boolean",
28
+ strategy: "scalar",
29
+ enforcement: "absent",
30
+ doc: "Whether pnpm automatically downloads and uses the version of pnpm specified in packageManager.",
31
+ workspaceYaml: true,
32
+ anchor: "managepackagemanagerversions"
33
+ },
34
+ pmOnFail: {
35
+ schema: Schema.Literal("download", "error", "warn", "ignore"),
36
+ kind: "enum",
37
+ strategy: "scalar",
38
+ enforcement: "absent",
39
+ doc: "Action taken when the package manager version does not match the packageManager field.",
40
+ workspaceYaml: true,
41
+ anchor: "pmonfail",
42
+ samples: {
43
+ valid: ["download"],
44
+ invalid: ["x"]
45
+ }
46
+ },
47
+ runtimeOnFail: {
48
+ schema: Schema.Literal("download", "error", "warn", "ignore"),
49
+ kind: "enum",
50
+ strategy: "scalar",
51
+ enforcement: "absent",
52
+ doc: "Action taken when the Node.js version does not match the engines.node field.",
53
+ workspaceYaml: true,
54
+ anchor: "runtimeonfail",
55
+ samples: {
56
+ valid: ["error"],
57
+ invalid: ["x"]
58
+ }
59
+ },
60
+ nodeVersion: {
61
+ schema: Str,
62
+ kind: "string",
63
+ strategy: "scalar",
64
+ enforcement: "absent",
65
+ doc: "The Node.js version to use when checking packages' engines field.",
66
+ workspaceYaml: true,
67
+ anchor: "nodeversion"
68
+ },
69
+ useNodeVersion: {
70
+ schema: Str,
71
+ kind: "string",
72
+ strategy: "scalar",
73
+ enforcement: "absent",
74
+ doc: "The exact Node.js version that pnpm should use for running scripts.",
75
+ workspaceYaml: true,
76
+ anchor: "usenodeversion"
77
+ },
78
+ nodeDownloadMirrors: {
79
+ schema: UnknownRecord,
80
+ kind: "unknownRecord",
81
+ strategy: "mapChildWins",
82
+ enforcement: "absent",
83
+ doc: "Mirror URLs for downloading Node.js, keyed by distribution name.",
84
+ workspaceYaml: true,
85
+ anchor: "nodedownloadmirrors"
86
+ }
87
+ };
88
+
89
+ //#endregion
90
+ export { runtimeCfg };
@@ -0,0 +1,26 @@
1
+ import { Schema } from "effect";
2
+
3
+ //#region src/descriptors/schemas.ts
4
+ /** @internal */ const Bool = Schema.Boolean;
5
+ /** @internal */ const Num = Schema.Number;
6
+ /** @internal */ const Str = Schema.String;
7
+ /** @internal */ const StringArray = Schema.Array(Schema.String);
8
+ /** @internal */ const StringRecord = Schema.Record({
9
+ key: Schema.String,
10
+ value: Schema.String
11
+ });
12
+ /** @internal */ const BooleanRecord = Schema.Record({
13
+ key: Schema.String,
14
+ value: Schema.Boolean
15
+ });
16
+ /** @internal */ const UnknownRecord = Schema.Record({
17
+ key: Schema.String,
18
+ value: Schema.Unknown
19
+ });
20
+ /** @internal */ const StringArrayRecord = Schema.Record({
21
+ key: Schema.String,
22
+ value: StringArray
23
+ });
24
+
25
+ //#endregion
26
+ export { Bool, BooleanRecord, Num, Str, StringArray, StringArrayRecord, StringRecord, UnknownRecord };
@@ -0,0 +1,116 @@
1
+ import { Bool, Num } from "./schemas.js";
2
+ import { Schema } from "effect";
3
+
4
+ //#region src/descriptors/workspace.ts
5
+ /** The 10 catalog + workspace + audit fields. @internal */
6
+ const workspace = {
7
+ catalogMode: {
8
+ schema: Schema.Literal("strict", "prefer", "manual"),
9
+ kind: "enum",
10
+ strategy: "scalar",
11
+ enforcement: "absent",
12
+ doc: "Controls how dependencies are resolved against entries defined in the catalogs field.",
13
+ workspaceYaml: true,
14
+ anchor: "catalogmode",
15
+ samples: {
16
+ valid: ["manual"],
17
+ invalid: ["x"]
18
+ }
19
+ },
20
+ cleanupUnusedCatalogs: {
21
+ schema: Bool,
22
+ kind: "boolean",
23
+ strategy: "scalar",
24
+ enforcement: "absent",
25
+ doc: "Whether pnpm removes catalog entries that are not used by any project in the workspace.",
26
+ workspaceYaml: true,
27
+ anchor: "cleanupunusedcatalogs"
28
+ },
29
+ linkWorkspacePackages: {
30
+ schema: Schema.Union(Schema.Boolean, Schema.Literal("deep")),
31
+ kind: "union",
32
+ strategy: "scalar",
33
+ enforcement: "absent",
34
+ doc: "Whether workspace packages are linked from the workspace, not downloaded from the registry.",
35
+ workspaceYaml: true,
36
+ anchor: "linkworkspacepackages",
37
+ samples: {
38
+ valid: [true, "deep"],
39
+ invalid: ["x"]
40
+ }
41
+ },
42
+ preferWorkspacePackages: {
43
+ schema: Bool,
44
+ kind: "boolean",
45
+ strategy: "scalar",
46
+ enforcement: "absent",
47
+ doc: "Whether versions of packages from the workspace are preferred over versions from the registry.",
48
+ workspaceYaml: true,
49
+ anchor: "preferworkspacepackages"
50
+ },
51
+ saveWorkspaceProtocol: {
52
+ schema: Schema.Union(Schema.Boolean, Schema.Literal("rolling")),
53
+ kind: "union",
54
+ strategy: "scalar",
55
+ enforcement: "absent",
56
+ doc: "Controls whether the workspace: range protocol is used when saving workspace package versions.",
57
+ workspaceYaml: true,
58
+ anchor: "saveworkspaceprotocol",
59
+ samples: {
60
+ valid: [false, "rolling"],
61
+ invalid: ["x"]
62
+ }
63
+ },
64
+ includeWorkspaceRoot: {
65
+ schema: Bool,
66
+ kind: "boolean",
67
+ strategy: "scalar",
68
+ enforcement: "absent",
69
+ doc: "Whether tasks of the root workspace project are included when executing commands recursively.",
70
+ workspaceYaml: true,
71
+ anchor: "includeworkspaceroot"
72
+ },
73
+ ignoreWorkspaceCycles: {
74
+ schema: Bool,
75
+ kind: "boolean",
76
+ strategy: "scalar",
77
+ enforcement: "absent",
78
+ doc: "Whether workspace dependency cycles are silently ignored.",
79
+ workspaceYaml: true,
80
+ anchor: "ignoreworkspacecycles"
81
+ },
82
+ disallowWorkspaceCycles: {
83
+ schema: Bool,
84
+ kind: "boolean",
85
+ strategy: "scalar",
86
+ enforcement: "absent",
87
+ doc: "Whether an error is thrown when a workspace dependency cycle is detected.",
88
+ workspaceYaml: true,
89
+ anchor: "disallowworkspacecycles"
90
+ },
91
+ workspaceConcurrency: {
92
+ schema: Num,
93
+ kind: "number",
94
+ strategy: "scalar",
95
+ enforcement: "absent",
96
+ doc: "Number of projects built in parallel when running commands recursively.",
97
+ workspaceYaml: true,
98
+ anchor: "workspaceconcurrency"
99
+ },
100
+ auditLevel: {
101
+ schema: Schema.Literal("low", "moderate", "high", "critical"),
102
+ kind: "enum",
103
+ strategy: "scalar",
104
+ enforcement: "absent",
105
+ doc: "Minimum severity level for audit reports (low, moderate, high, critical).",
106
+ workspaceYaml: true,
107
+ anchor: "auditlevel",
108
+ samples: {
109
+ valid: ["low"],
110
+ invalid: ["x"]
111
+ }
112
+ }
113
+ };
114
+
115
+ //#endregion
116
+ export { workspace };
package/index.d.ts ADDED
@@ -0,0 +1,363 @@
1
+ import { Plugin } from "rolldown";
2
+
3
+ //#region src/catalogs.d.ts
4
+ /**
5
+ * How the `upgrade` CLI recomputes a materialized peer range when the package
6
+ * range is bumped. CLI-only metadata; the runtime ignores it.
7
+ *
8
+ * @public
9
+ */
10
+ type PeerStrategy = "lock" | "lock-minor" | "interop";
11
+ /**
12
+ * A package's version: a bare range, or an object carrying a materialized peer
13
+ * range (`peer`) and optional CLI recompute `strategy`.
14
+ *
15
+ * @public
16
+ */
17
+ type CatalogPackageSpec = string | {
18
+ readonly range: string;
19
+ readonly peer?: string;
20
+ readonly strategy?: PeerStrategy;
21
+ };
22
+ /**
23
+ * One catalog's declaration: a map of package name to version spec.
24
+ *
25
+ * @public
26
+ */
27
+ interface CatalogDeclaration {
28
+ /** Map of package name to version spec or range object. */
29
+ readonly packages: Record<string, CatalogPackageSpec>;
30
+ }
31
+ //#endregion
32
+ //#region src/runtime/types.d.ts
33
+ /**
34
+ * How a field's divergences are enforced: silent, console warning, or a thrown
35
+ * error that fails the install. Part of the public authoring API via
36
+ * `FieldInput` and the runtime `createHooks` manifest.
37
+ *
38
+ * @public
39
+ */
40
+ type Enforcement = "absent" | "warn" | "error";
41
+ //#endregion
42
+ //#region src/define-plugin.d.ts
43
+ /**
44
+ * A field value, bare or wrapped with an explicit enforcement override.
45
+ *
46
+ * @public
47
+ */
48
+ type FieldInput<T> = T | {
49
+ readonly value: T;
50
+ readonly enforcement?: Enforcement;
51
+ };
52
+ /**
53
+ * Per-field local merge directive applied only by `rolldown-pnpm-config export`.
54
+ * All keys optional: `value` alone overwrites; `strategy` unions/differences
55
+ * `value` with the managed value; `preserve` (overrides only) keeps existing
56
+ * file entries whose value starts with a listed protocol.
57
+ *
58
+ * @public
59
+ */
60
+ interface LocalDirective<T> {
61
+ readonly preserve?: readonly string[];
62
+ readonly value?: T;
63
+ readonly strategy?: "union" | "difference";
64
+ }
65
+ /**
66
+ * The declarative plugin configuration.
67
+ *
68
+ * @public
69
+ */
70
+ interface PluginConfig {
71
+ /**
72
+ * Identifier for this config dependency, surfaced in runtime warnings as a
73
+ * `[name]` tag. Conventionally the config package's npm name,
74
+ * e.g. `"@acme/pnpm-config"`. Required.
75
+ *
76
+ * @public
77
+ */
78
+ readonly name: string;
79
+ /** The catalogs to inject into pnpm config, keyed by catalog name. */
80
+ readonly catalogs: Record<string, CatalogDeclaration>;
81
+ /**
82
+ * Export-only overrides. Each field set here replaces the corresponding
83
+ * generated field when running `rolldown-pnpm-config export`. Ignored by the
84
+ * build and the shipped pnpmfile.
85
+ */
86
+ readonly local?: { readonly [K in keyof PluginConfig]?: PluginConfig[K] | LocalDirective<PluginConfig[K]> };
87
+ /** Whether pnpm prompts before purging `node_modules`. */
88
+ readonly confirmModulesPurge?: FieldInput<boolean>;
89
+ /** Per-package manifest overrides merged into the dependency graph. */
90
+ readonly packageExtensions?: FieldInput<Record<string, unknown>>;
91
+ /** Deprecated versions explicitly allowed, keyed by package. */
92
+ readonly allowedDeprecatedVersions?: FieldInput<Record<string, string>>;
93
+ /**
94
+ * Glob patterns hoisted to the root `node_modules`.
95
+ *
96
+ * The optional `excludeByRepo` refine is a map **keyed by consuming-repo name**
97
+ * (the root `package.json` `name` of the repo where this config runs); each
98
+ * value is the list of hoist patterns to drop in that repo. Example — drop
99
+ * `@savvy-web/cli`/`@savvy-web/mcp` only in the `savvy-web-systems` repo:
100
+ *
101
+ * ```ts
102
+ * publicHoistPattern: {
103
+ * value: ["@types/*", "@savvy-web/cli", "@savvy-web/mcp"],
104
+ * excludeByRepo: { "savvy-web-systems": ["@savvy-web/cli", "@savvy-web/mcp"] },
105
+ * }
106
+ * ```
107
+ */
108
+ readonly publicHoistPattern?: string[] | {
109
+ readonly value: string[];
110
+ readonly enforcement?: Enforcement;
111
+ readonly excludeByRepo?: Record<string, string[]>;
112
+ };
113
+ /** Packages excluded from the minimum-release-age quarantine. */
114
+ readonly minimumReleaseAgeExclude?: FieldInput<string[]>;
115
+ /** Supported architectures, keyed by axis (`os`/`cpu`/`libc`). */
116
+ readonly supportedArchitectures?: FieldInput<Record<string, string[]>>;
117
+ /** Audit config exclusions, keyed by axis (`ignoreGhsas`/`ignoreCves`). */
118
+ readonly auditConfig?: FieldInput<Record<string, string[]>>;
119
+ /** Security version overrides, keyed by package selector. */
120
+ readonly overrides?: FieldInput<Record<string, string>>;
121
+ /** Peer dependency rules: allowed versions plus ignore/allow-any lists. */
122
+ readonly peerDependencyRules?: FieldInput<{
123
+ readonly allowedVersions?: Record<string, string>;
124
+ readonly ignoreMissing?: string[];
125
+ readonly allowAny?: string[];
126
+ }>;
127
+ /** Whether dependency build scripts are blocked unless explicitly allowed. */
128
+ readonly strictDepBuilds?: FieldInput<boolean>;
129
+ /** Whether exotic (non-registry) subdependencies are blocked. */
130
+ readonly blockExoticSubdeps?: FieldInput<boolean>;
131
+ /** Minimum age (minutes) a release must reach before it is installable. */
132
+ readonly minimumReleaseAge?: FieldInput<number>;
133
+ /** Packages whose build scripts are explicitly allowed to run. */
134
+ readonly allowBuilds?: FieldInput<Record<string, boolean>>;
135
+ /** Optional dependencies excluded from installation entirely. */
136
+ readonly ignoredOptionalDependencies?: FieldInput<string[]>;
137
+ /** Per-dependency update behavior: which packages to ignore during updates. */
138
+ readonly updateConfig?: FieldInput<{
139
+ ignoreDependencies?: string[];
140
+ }>;
141
+ /** Default version catalog entries merged as a single `default` catalog. */
142
+ readonly catalog?: FieldInput<Record<string, string>>;
143
+ /** Whether any resolution fails when a package violates minimum-release-age. */
144
+ readonly minimumReleaseAgeStrict?: FieldInput<boolean>;
145
+ /** Whether to skip the release-age check when publish-time metadata is absent. */
146
+ readonly minimumReleaseAgeIgnoreMissingTime?: FieldInput<boolean>;
147
+ /** Defines what package integrity verification is enforced on installs. */
148
+ readonly trustPolicy?: FieldInput<"off" | "no-downgrade">;
149
+ /** Packages excluded from trust-policy enforcement. */
150
+ readonly trustPolicyExclude?: FieldInput<string[]>;
151
+ /** Minutes after installation after which the trust check is skipped. */
152
+ readonly trustPolicyIgnoreAfter?: FieldInput<number>;
153
+ /** Whether the lockfile alone is trusted without re-verifying each package's integrity. */
154
+ readonly trustLockfile?: FieldInput<boolean>;
155
+ /** Whether packages are hoisted to the virtual store root node_modules. */
156
+ readonly hoist?: FieldInput<boolean>;
157
+ /** Whether workspace packages are hoisted to the root node_modules. */
158
+ readonly hoistWorkspacePackages?: FieldInput<boolean>;
159
+ /** Glob patterns describing which packages are hoisted to the virtual store root. */
160
+ readonly hoistPattern?: FieldInput<string[]>;
161
+ /** Whether all packages are hoisted to the root node_modules (shameful flat layout). */
162
+ readonly shamefullyHoist?: FieldInput<boolean>;
163
+ /** Defines the scope to which dependencies are hoisted. */
164
+ readonly hoistingLimits?: FieldInput<"none" | "workspaces" | "dependencies">;
165
+ /** The directory in which node_modules will be created. */
166
+ readonly modulesDir?: FieldInput<string>;
167
+ /** Defines which linker is used for installing Node.js packages. */
168
+ readonly nodeLinker?: FieldInput<"isolated" | "hoisted" | "pnp">;
169
+ /** Whether symlinks are created when linking packages from the store. */
170
+ readonly symlink?: FieldInput<boolean>;
171
+ /** Whether the local node_modules directory should be created during install. */
172
+ readonly enableModulesDir?: FieldInput<boolean>;
173
+ /** The directory with links to the store (default: node_modules/.pnpm). */
174
+ readonly virtualStoreDir?: FieldInput<string>;
175
+ /** Maximum allowed length of directory names inside the virtual store. */
176
+ readonly virtualStoreDirMaxLength?: FieldInput<number>;
177
+ /** Whether packages are written only to the virtual store without a local modules dir. */
178
+ readonly virtualStoreOnly?: FieldInput<boolean>;
179
+ /** Controls how packages are imported from the content-addressable store. */
180
+ readonly packageImportMethod?: FieldInput<"auto" | "hardlink" | "copy" | "clone" | "clone-or-copy">;
181
+ /** Maximum age (minutes) of unused modules directories before they are pruned. */
182
+ readonly modulesCacheMaxAge?: FieldInput<number>;
183
+ /** Maximum age (minutes) of cached dlx command results before re-fetch. */
184
+ readonly dlxCacheMaxAge?: FieldInput<number>;
185
+ /** Whether integrity checksums in the store are verified before using a package. */
186
+ readonly verifyStoreIntegrity?: FieldInput<boolean>;
187
+ /** Whether store package content checksums are verified strictly on each access. */
188
+ readonly strictStorePkgContentCheck?: FieldInput<boolean>;
189
+ /** Whether a lockfile is used and generated when running commands that install packages. */
190
+ readonly lockfile?: FieldInput<boolean>;
191
+ /** If true, pnpm does not generate a lockfile and fails if the lockfile is out of date. */
192
+ readonly preferFrozenLockfile?: FieldInput<boolean>;
193
+ /** Whether the lockfile includes the full tarball URL for each resolved dependency. */
194
+ readonly lockfileIncludeTarballUrl?: FieldInput<boolean>;
195
+ /** When enabled, the generated lockfile name is based on the current branch name. */
196
+ readonly gitBranchLockfile?: FieldInput<boolean>;
197
+ /** Branch name patterns whose lockfiles are merged into the main lockfile on install. */
198
+ readonly mergeGitBranchLockfilesBranchPattern?: FieldInput<string[]>;
199
+ /** Maximum length of the peers suffix appended to dependency directory names in the virtual store. */
200
+ readonly peersSuffixMaxLength?: FieldInput<number>;
201
+ /** Whether a single shared lockfile is used for all projects in the workspace. */
202
+ readonly sharedWorkspaceLockfile?: FieldInput<boolean>;
203
+ /** Whether missing peer dependencies are installed automatically. */
204
+ readonly autoInstallPeers?: FieldInput<boolean>;
205
+ /** Whether packages with peer dependencies are deduplicated after peers are resolved. */
206
+ readonly dedupePeerDependents?: FieldInput<boolean>;
207
+ /** Whether peer dependencies are deduplicated during resolution. */
208
+ readonly dedupePeers?: FieldInput<boolean>;
209
+ /** If true, commands fail when there are missing or invalid peer dependencies. */
210
+ readonly strictPeerDependencies?: FieldInput<boolean>;
211
+ /** Whether peer dependencies are resolved using packages installed in the workspace root. */
212
+ readonly resolvePeersFromWorkspaceRoot?: FieldInput<boolean>;
213
+ /** Packages whose build scripts are allowed to run; others are blocked. */
214
+ readonly onlyBuiltDependencies?: FieldInput<string[]>;
215
+ /** Path to a JSON file listing packages whose build scripts are allowed. */
216
+ readonly onlyBuiltDependenciesFile?: FieldInput<string>;
217
+ /** Packages whose build scripts are never executed. */
218
+ readonly neverBuiltDependencies?: FieldInput<string[]>;
219
+ /** Packages excluded from the list of dependencies to build. */
220
+ readonly ignoredBuiltDependencies?: FieldInput<string[]>;
221
+ /** When true, all build scripts are allowed to run without restriction. */
222
+ readonly dangerouslyAllowAllBuilds?: FieldInput<boolean>;
223
+ /** Whether lifecycle scripts of packages in node_modules are not executed. */
224
+ readonly ignoreScripts?: FieldInput<boolean>;
225
+ /** Whether lifecycle scripts of dependencies are ignored during install. */
226
+ readonly ignoreDepScripts?: FieldInput<boolean>;
227
+ /** Maximum number of child processes that build scripts can spawn concurrently. */
228
+ readonly childConcurrency?: FieldInput<number>;
229
+ /** Whether the results of running install scripts are cached. */
230
+ readonly sideEffectsCache?: FieldInput<boolean>;
231
+ /** Whether the side effects cache is used but never updated. */
232
+ readonly sideEffectsCacheReadonly?: FieldInput<boolean>;
233
+ /** Options passed to Node.js via NODE_OPTIONS when running scripts. */
234
+ readonly nodeOptions?: FieldInput<string>;
235
+ /** Whether pnpm verifies that the install is up to date before running scripts. */
236
+ readonly verifyDepsBeforeRun?: FieldInput<"install" | "warn" | "error" | "prompt" | boolean>;
237
+ /** Whether pre/post lifecycle scripts are run automatically alongside the main script. */
238
+ readonly enablePrePostScripts?: FieldInput<boolean>;
239
+ /** The shell used to execute scripts. */
240
+ readonly scriptShell?: FieldInput<string>;
241
+ /** Whether a POSIX shell emulator is used when running scripts on Windows. */
242
+ readonly shellEmulator?: FieldInput<boolean>;
243
+ /** Scripts that must exist in every project matching the current filter. */
244
+ readonly requiredScripts?: FieldInput<string[]>;
245
+ /** Patches applied to dependencies, keyed by package identifier. */
246
+ readonly patchedDependencies?: FieldInput<Record<string, string>>;
247
+ /** Whether unused patches (patches that apply to no installed package) are allowed. */
248
+ readonly allowUnusedPatches?: FieldInput<boolean>;
249
+ /** Whether non-applied patches (patches that fail to apply) are allowed. */
250
+ readonly allowNonAppliedPatches?: FieldInput<boolean>;
251
+ /** Whether patch failures are silently ignored during installation. */
252
+ readonly ignorePatchFailures?: FieldInput<boolean>;
253
+ /** Directory where patch files are stored (default: patches). */
254
+ readonly patchesDir?: FieldInput<string>;
255
+ /** Packages installed before other packages so their config scripts can run first. */
256
+ readonly configDependencies?: FieldInput<Record<string, string>>;
257
+ /** Environment variables applied when running scripts. */
258
+ readonly executionEnv?: FieldInput<Record<string, unknown>>;
259
+ /** Whether local workspace packages are injected instead of symlinked. */
260
+ readonly injectWorkspacePackages?: FieldInput<boolean>;
261
+ /** Scripts after which injected dependencies are re-synced. */
262
+ readonly syncInjectedDepsAfterScripts?: FieldInput<string[]>;
263
+ /** Whether injected workspace packages are deduplicated. */
264
+ readonly dedupeInjectedDeps?: FieldInput<boolean>;
265
+ /** Whether pnpm enforces use of the package manager specified in packageManager. */
266
+ readonly packageManagerStrict?: FieldInput<boolean>;
267
+ /** Whether pnpm enforces the exact version of the package manager specified in packageManager. */
268
+ readonly packageManagerStrictVersion?: FieldInput<boolean>;
269
+ /** Whether pnpm automatically downloads and uses the version of pnpm specified in packageManager. */
270
+ readonly managePackageManagerVersions?: FieldInput<boolean>;
271
+ /** Action taken when the package manager version does not match the packageManager field. */
272
+ readonly pmOnFail?: FieldInput<"download" | "error" | "warn" | "ignore">;
273
+ /** Action taken when the Node.js version does not match the engines.node field. */
274
+ readonly runtimeOnFail?: FieldInput<"download" | "error" | "warn" | "ignore">;
275
+ /** The Node.js version to use when checking packages' engines field. */
276
+ readonly nodeVersion?: FieldInput<string>;
277
+ /** The exact Node.js version that pnpm should use for running scripts. */
278
+ readonly useNodeVersion?: FieldInput<string>;
279
+ /** Mirror URLs for downloading Node.js, keyed by distribution name. */
280
+ readonly nodeDownloadMirrors?: FieldInput<Record<string, unknown>>;
281
+ /** Controls how dependencies are resolved against entries defined in the catalogs field. */
282
+ readonly catalogMode?: FieldInput<"strict" | "prefer" | "manual">;
283
+ /** Whether pnpm removes catalog entries that are not used by any project in the workspace. */
284
+ readonly cleanupUnusedCatalogs?: FieldInput<boolean>;
285
+ /** Whether workspace packages are linked from the workspace, not downloaded from the registry. */
286
+ readonly linkWorkspacePackages?: FieldInput<boolean | "deep">;
287
+ /** Whether versions of packages from the workspace are preferred over versions from the registry. */
288
+ readonly preferWorkspacePackages?: FieldInput<boolean>;
289
+ /** Controls whether the workspace: range protocol is used when saving workspace package versions. */
290
+ readonly saveWorkspaceProtocol?: FieldInput<boolean | "rolling">;
291
+ /** Whether tasks of the root workspace project are included when executing commands recursively. */
292
+ readonly includeWorkspaceRoot?: FieldInput<boolean>;
293
+ /** Whether workspace dependency cycles are silently ignored. */
294
+ readonly ignoreWorkspaceCycles?: FieldInput<boolean>;
295
+ /** Whether an error is thrown when a workspace dependency cycle is detected. */
296
+ readonly disallowWorkspaceCycles?: FieldInput<boolean>;
297
+ /** Number of projects built in parallel when running commands recursively. */
298
+ readonly workspaceConcurrency?: FieldInput<number>;
299
+ /** Minimum severity level for audit reports (low, moderate, high, critical). */
300
+ readonly auditLevel?: FieldInput<"low" | "moderate" | "high" | "critical">;
301
+ /** Algorithm used to resolve dependencies from the registry. */
302
+ readonly resolutionMode?: FieldInput<"highest" | "time-based" | "lowest-direct">;
303
+ /** Version prefix prepended to package versions saved in package.json. */
304
+ readonly savePrefix?: FieldInput<"^" | "~" | "">;
305
+ /** Whether packages are saved with an exact version instead of a semver range. */
306
+ readonly saveExact?: FieldInput<boolean>;
307
+ /** The default tag used when adding packages without a specified version. */
308
+ readonly tag?: FieldInput<string>;
309
+ /** Whether cached data is used without network requests, failing only if data is missing. */
310
+ readonly preferOffline?: FieldInput<boolean>;
311
+ /** Whether direct dependencies are deduplicated when they can be satisfied by an existing dependency. */
312
+ readonly dedupeDirectDeps?: FieldInput<boolean>;
313
+ /** Whether all files of a deployed package are copied including those in node_modules. */
314
+ readonly deployAllFiles?: FieldInput<boolean>;
315
+ /** Whether the legacy deployment algorithm (copying files) is used instead of the default. */
316
+ readonly forceLegacyDeploy?: FieldInput<boolean>;
317
+ /** Whether the NODE_PATH environment variable is set when running scripts. */
318
+ readonly extendNodePath?: FieldInput<boolean>;
319
+ /** Whether symlinks to executables are created instead of shell shims on non-Windows systems. */
320
+ readonly preferSymlinkedExecutables?: FieldInput<boolean>;
321
+ /** Whether the built-in compatibility database of lifecycle script overrides is ignored. */
322
+ readonly ignoreCompatibilityDb?: FieldInput<boolean>;
323
+ /** Whether pnpm skips integrity checks when the lockfile is up to date to speed up repeat installs. */
324
+ readonly optimisticRepeatInstall?: FieldInput<boolean>;
325
+ /** Whether pnpm installs all projects in the workspace when running install in a workspace. */
326
+ readonly recursiveInstall?: FieldInput<boolean>;
327
+ /** Whether pnpm fails if a dependency's engines field is incompatible with the current Node.js version. */
328
+ readonly engineStrict?: FieldInput<boolean>;
329
+ /** Maximum number of concurrent network requests pnpm is allowed to make. */
330
+ readonly networkConcurrency?: FieldInput<number>;
331
+ /** Number of times pnpm retries fetching a package from the registry on failure. */
332
+ readonly fetchRetries?: FieldInput<number>;
333
+ /** Exponential factor used when calculating retry delays for failed fetches. */
334
+ readonly fetchRetryFactor?: FieldInput<number>;
335
+ /** Minimum timeout (ms) for a single fetch retry attempt. */
336
+ readonly fetchRetryMintimeout?: FieldInput<number>;
337
+ /** Maximum timeout (ms) for a single fetch retry attempt. */
338
+ readonly fetchRetryMaxtimeout?: FieldInput<number>;
339
+ /** Maximum amount of time (ms) to wait for an HTTP response from the registry. */
340
+ readonly fetchTimeout?: FieldInput<number>;
341
+ /** Hosts from which git-protocol dependencies are cloned using a shallow fetch. */
342
+ readonly gitShallowHosts?: FieldInput<string[]>;
343
+ /** Whether packages are published with provenance attestation when supported by the registry. */
344
+ readonly provenance?: FieldInput<boolean>;
345
+ /** Whether pnpm checks that the repository is clean before publishing. */
346
+ readonly gitChecks?: FieldInput<boolean>;
347
+ /** Whether the README file is embedded in the package tarball on publish. */
348
+ readonly embedReadme?: FieldInput<boolean>;
349
+ /** Branch that is allowed to publish packages; publishing from other branches is blocked. */
350
+ readonly publishBranch?: FieldInput<string>;
351
+ }
352
+ //#endregion
353
+ //#region src/plugin/index.d.ts
354
+ /**
355
+ * Rolldown plugin that serves the two virtual pnpm-config modules. Pass a
356
+ * `PluginConfig` object and the plugin handles the rest.
357
+ *
358
+ * @public
359
+ */
360
+ declare function PnpmConfigPlugin(config: PluginConfig): Plugin;
361
+ //#endregion
362
+ export { type CatalogDeclaration, type CatalogPackageSpec, type Enforcement, type FieldInput, type LocalDirective, type PeerStrategy, type PluginConfig, PnpmConfigPlugin };
363
+ //# sourceMappingURL=index.d.ts.map
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { PnpmConfigPlugin } from "./plugin/index.js";
2
+
3
+ export { PnpmConfigPlugin };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "rolldown-pnpm-config",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "A dogfooding example of our plugin",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/spencerbeggs/rolldown-pnpm-config.git",
9
+ "directory": "package"
10
+ },
11
+ "license": "MIT",
12
+ "author": {
13
+ "name": "C. Spencer Beggs",
14
+ "email": "spencer@beggs.codes",
15
+ "url": "https://spencerbeg.gs"
16
+ },
17
+ "type": "module",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./index.d.ts",
21
+ "import": "./index.js"
22
+ },
23
+ "./runtime": {
24
+ "types": "./runtime.d.ts",
25
+ "import": "./runtime.js"
26
+ },
27
+ "./virtual": {
28
+ "types": "./virtual.d.ts"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "bin": {
33
+ "rolldown-pnpm-config": "bin/rolldown-pnpm-config.js"
34
+ },
35
+ "dependencies": {
36
+ "@effect/cli": "^0.75.2",
37
+ "@effect/platform": "^0.96.2",
38
+ "@effect/platform-node": "^0.107.0",
39
+ "effect": "^3.21.4",
40
+ "ink": "^7.1.0",
41
+ "ink-tab": "^5.2.0",
42
+ "oxc-parser": "^0.137.0",
43
+ "react": "^19.2.7",
44
+ "semver-effect": "^0.2.1",
45
+ "std-env": "^4.1.0",
46
+ "std-osc8": "^0.1.0",
47
+ "yaml": "^2.9.0"
48
+ },
49
+ "peerDependencies": {
50
+ "rolldown": "^1.1.0"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "rolldown": {
54
+ "optional": true
55
+ }
56
+ },
57
+ "engines": {
58
+ "node": ">=24.11.0"
59
+ }
60
+ }