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
package/cli/ui/env.js ADDED
@@ -0,0 +1,20 @@
1
+ import { hasTTY, isAgent, isCI, isColorSupported } from "std-env";
2
+ import { supportsHyperlinks } from "std-osc8";
3
+
4
+ //#region src/cli/ui/env.ts
5
+ /**
6
+ * Detect color / interactivity / hyperlink support once, at the command edge.
7
+ * The render layer consumes the returned flags and never reads the environment.
8
+ *
9
+ * @internal
10
+ */
11
+ function detectCapabilities() {
12
+ return {
13
+ color: isColorSupported,
14
+ interactive: hasTTY && !isCI && !isAgent,
15
+ hyperlinks: supportsHyperlinks
16
+ };
17
+ }
18
+
19
+ //#endregion
20
+ export { detectCapabilities, supportsHyperlinks };
@@ -0,0 +1,23 @@
1
+ import { Preview } from "./Preview.js";
2
+ import { Effect } from "effect";
3
+ import { render } from "ink";
4
+ import { createElement } from "react";
5
+
6
+ //#region src/cli/ui/run-preview.ts
7
+ /**
8
+ * Render the interactive Preview inside an Effect, resolving once the user
9
+ * exits and Ink has fully torn down.
10
+ *
11
+ * @internal
12
+ */
13
+ function runPreview(views) {
14
+ return Effect.async((resume) => {
15
+ render(createElement(Preview, {
16
+ views,
17
+ onExit: () => {}
18
+ })).waitUntilExit().then(() => resume(Effect.void));
19
+ });
20
+ }
21
+
22
+ //#endregion
23
+ export { runPreview };
@@ -0,0 +1,29 @@
1
+ import { Walk } from "./Walk.js";
2
+ import { Effect } from "effect";
3
+ import { render } from "ink";
4
+ import { createElement } from "react";
5
+
6
+ //#region src/cli/ui/run-walk.ts
7
+ /**
8
+ * Render the interactive Walk inside an Effect, resolving with the collected
9
+ * decisions once the user finishes (or immediately when nothing is actionable),
10
+ * after Ink has fully exited.
11
+ *
12
+ * @internal
13
+ */
14
+ function runWalk(items) {
15
+ return Effect.async((resume) => {
16
+ let collected = [];
17
+ render(createElement(Walk, {
18
+ items,
19
+ onDone: (d) => {
20
+ collected = d;
21
+ }
22
+ })).waitUntilExit().then(() => {
23
+ resume(Effect.succeed([...collected]));
24
+ });
25
+ });
26
+ }
27
+
28
+ //#endregion
29
+ export { runWalk };
@@ -0,0 +1,27 @@
1
+ //#region src/cli/ui/styled.ts
2
+ /** SGR open/close codes per style (close is always 0=reset for simplicity). @internal */
3
+ const ANSI_OPEN = {
4
+ added: "\x1B[32m",
5
+ removed: "\x1B[31m",
6
+ changed: "\x1B[33m",
7
+ warn: "\x1B[31m",
8
+ local: "\x1B[35m",
9
+ unmanaged: "\x1B[2m",
10
+ unchanged: "\x1B[2m",
11
+ plain: ""
12
+ };
13
+ const ANSI_RESET = "\x1B[0m";
14
+ /** Apply (or omit) the SGR code for a style. @internal */
15
+ function paint(text, style, color) {
16
+ if (!color || style === "plain" || ANSI_OPEN[style] === "") return text;
17
+ return `${ANSI_OPEN[style]}${text}${ANSI_RESET}`;
18
+ }
19
+ /** The trailing annotation for a tag, e.g. " (local)". @internal */
20
+ function tagSuffix(tag) {
21
+ if (tag === "local") return " (local)";
22
+ if (tag === "unmanaged") return " (unmanaged)";
23
+ return "";
24
+ }
25
+
26
+ //#endregion
27
+ export { ANSI_OPEN, paint, tagSuffix };
@@ -0,0 +1,35 @@
1
+ import { derivePeerRange } from "./peer-range.js";
2
+ import { detectPeerDrift } from "./drift.js";
3
+ import { planEntry } from "./plan.js";
4
+ import { Effect } from "effect";
5
+
6
+ //#region src/cli/walk-plan.ts
7
+ /**
8
+ * Build the interactive walk items: for each entry, its candidate list (from
9
+ * planEntry against the resolved versions), an up-to-date flag (only the keep
10
+ * candidate remains), and any peer drift resync target.
11
+ *
12
+ * @internal
13
+ */
14
+ function buildWalkItems(entries, versionsByPkg) {
15
+ return Effect.gen(function* () {
16
+ const items = [];
17
+ for (const entry of entries) {
18
+ const candidates = yield* planEntry(entry, [...versionsByPkg.get(entry.pkg) ?? []]);
19
+ const driftPeer = yield* detectPeerDrift(entry);
20
+ const materializePeer = entry.strategy && !entry.peer ? yield* derivePeerRange(entry.currentRange, entry.strategy) : null;
21
+ const upToDate = candidates.length === 1 && driftPeer === null && materializePeer === null;
22
+ items.push({
23
+ entry,
24
+ candidates,
25
+ upToDate,
26
+ driftPeer,
27
+ materializePeer
28
+ });
29
+ }
30
+ return items;
31
+ });
32
+ }
33
+
34
+ //#endregion
35
+ export { buildWalkItems };
@@ -0,0 +1,61 @@
1
+ //#region src/cli/walk-reducer.ts
2
+ /** Index of the next actionable (not up-to-date) item at or after `from`, or -1. */
3
+ function nextActionable(items, from) {
4
+ for (let i = from; i < items.length; i++) if (!items[i].upToDate) return i;
5
+ return -1;
6
+ }
7
+ /**
8
+ * Initialize the walk on the first actionable item (auto-skipping up-to-date
9
+ * items). If none are actionable, the walk is immediately done.
10
+ *
11
+ * @internal
12
+ */
13
+ function initWalk(items) {
14
+ const index = nextActionable(items, 0);
15
+ return {
16
+ index: index === -1 ? items.length : index,
17
+ cursor: 0,
18
+ decisions: [],
19
+ done: index === -1
20
+ };
21
+ }
22
+ /**
23
+ * Advance the walk by a key. up/down move the cursor within the current item's
24
+ * candidates; enter records the highlighted candidate and moves to the next
25
+ * actionable item (or completes).
26
+ *
27
+ * @internal
28
+ */
29
+ function walkStep(state, items, key) {
30
+ if (state.done) return state;
31
+ const item = items[state.index];
32
+ const count = item.candidates.length;
33
+ if (key === "up") return {
34
+ ...state,
35
+ cursor: (state.cursor - 1 + count) % count
36
+ };
37
+ if (key === "down") return {
38
+ ...state,
39
+ cursor: (state.cursor + 1) % count
40
+ };
41
+ const chosen = item.candidates[state.cursor];
42
+ const decisions = [...state.decisions, {
43
+ item,
44
+ chosen
45
+ }];
46
+ const next = nextActionable(items, state.index + 1);
47
+ if (next === -1) return {
48
+ ...state,
49
+ decisions,
50
+ done: true
51
+ };
52
+ return {
53
+ index: next,
54
+ cursor: 0,
55
+ decisions,
56
+ done: false
57
+ };
58
+ }
59
+
60
+ //#endregion
61
+ export { initWalk, walkStep };
@@ -0,0 +1,58 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { parse, stringify } from "yaml";
4
+
5
+ //#region src/cli/workspace-file.ts
6
+ const FILENAME = "pnpm-workspace.yaml";
7
+ const STRINGIFY_OPTIONS = {
8
+ indent: 2,
9
+ lineWidth: 0,
10
+ singleQuote: false
11
+ };
12
+ /** True when every element is a string/number/boolean (safe to sort). */
13
+ function allPrimitive(arr) {
14
+ return arr.every((v) => v === null || typeof v !== "object" && typeof v !== "function");
15
+ }
16
+ /**
17
+ * Canonical form for deterministic output and diffing: object keys alpha-sorted
18
+ * recursively; arrays of all-primitive elements sorted lexicographically;
19
+ * arrays containing objects keep their order.
20
+ *
21
+ * @internal
22
+ */
23
+ function canonicalize(value) {
24
+ if (Array.isArray(value)) {
25
+ const mapped = value.map(canonicalize);
26
+ return allPrimitive(mapped) ? [...mapped].sort((a, b) => String(a).localeCompare(String(b))) : mapped;
27
+ }
28
+ if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([k, v]) => [k, canonicalize(v)]));
29
+ return value;
30
+ }
31
+ /**
32
+ * Walk up from `startDir` to the nearest directory containing a
33
+ * pnpm-workspace.yaml; returns the file path or null.
34
+ *
35
+ * @internal
36
+ */
37
+ function findWorkspaceFile(startDir) {
38
+ let dir = startDir;
39
+ for (;;) {
40
+ const candidate = join(dir, FILENAME);
41
+ if (existsSync(candidate)) return candidate;
42
+ const parent = dirname(dir);
43
+ if (parent === dir) return null;
44
+ dir = parent;
45
+ }
46
+ }
47
+ /** Parse pnpm-workspace.yaml source; empty/whitespace yields an empty object. @internal */
48
+ function parseWorkspace(source) {
49
+ const parsed = parse(source);
50
+ return parsed && typeof parsed === "object" ? parsed : {};
51
+ }
52
+ /** Render a workspace object: deterministic key sort + yaml.stringify. @internal */
53
+ function renderWorkspace(obj) {
54
+ return stringify(canonicalize(obj), STRINGIFY_OPTIONS);
55
+ }
56
+
57
+ //#endregion
58
+ export { canonicalize, findWorkspaceFile, parseWorkspace, renderWorkspace };
@@ -0,0 +1,21 @@
1
+ //#region src/cli/workspace-overlay.ts
2
+ /**
3
+ * Overlay the plugin's managed fields onto a parsed pnpm-workspace.yaml object.
4
+ * Managed top-level fields overwrite; `catalogs` is overlaid by catalog name
5
+ * (plugin names replace, local names are preserved); every other key in the
6
+ * parsed file is kept verbatim. Nothing is deleted. Pure.
7
+ *
8
+ * @internal
9
+ */
10
+ function overlayWorkspace(managed, parsed) {
11
+ const out = { ...parsed };
12
+ for (const [key, value] of Object.entries(managed)) if (key === "catalogs" && value && typeof value === "object") out.catalogs = {
13
+ ...parsed.catalogs && typeof parsed.catalogs === "object" ? parsed.catalogs : {},
14
+ ...value
15
+ };
16
+ else out[key] = value;
17
+ return out;
18
+ }
19
+
20
+ //#endregion
21
+ export { overlayWorkspace };
@@ -0,0 +1,248 @@
1
+ import { Bool, Num, Str, StringArray, StringRecord, UnknownRecord } from "./schemas.js";
2
+ import { Schema } from "effect";
3
+
4
+ //#region src/descriptors/build.ts
5
+ /** The 26 build / scripts + patches + injection fields. @internal */
6
+ const build = {
7
+ onlyBuiltDependencies: {
8
+ schema: StringArray,
9
+ kind: "stringArray",
10
+ strategy: "arrayUnion",
11
+ enforcement: "warn",
12
+ doc: "Packages whose build scripts are allowed to run; others are blocked.",
13
+ workspaceYaml: true,
14
+ anchor: "onlybuiltdependencies"
15
+ },
16
+ onlyBuiltDependenciesFile: {
17
+ schema: Str,
18
+ kind: "string",
19
+ strategy: "scalar",
20
+ enforcement: "warn",
21
+ doc: "Path to a JSON file listing packages whose build scripts are allowed.",
22
+ workspaceYaml: true,
23
+ anchor: "onlybuiltdependenciesfile"
24
+ },
25
+ neverBuiltDependencies: {
26
+ schema: StringArray,
27
+ kind: "stringArray",
28
+ strategy: "arrayUnion",
29
+ enforcement: "absent",
30
+ doc: "Packages whose build scripts are never executed.",
31
+ workspaceYaml: true,
32
+ anchor: "neverbuiltdependencies"
33
+ },
34
+ ignoredBuiltDependencies: {
35
+ schema: StringArray,
36
+ kind: "stringArray",
37
+ strategy: "arrayUnion",
38
+ enforcement: "absent",
39
+ doc: "Packages excluded from the list of dependencies to build.",
40
+ workspaceYaml: true,
41
+ anchor: "ignoredbuiltdependencies"
42
+ },
43
+ dangerouslyAllowAllBuilds: {
44
+ schema: Bool,
45
+ kind: "boolean",
46
+ strategy: "scalar",
47
+ enforcement: "warn",
48
+ doc: "When true, all build scripts are allowed to run without restriction.",
49
+ workspaceYaml: true,
50
+ anchor: "dangerouslyallowallbuilds"
51
+ },
52
+ ignoreScripts: {
53
+ schema: Bool,
54
+ kind: "boolean",
55
+ strategy: "scalar",
56
+ enforcement: "absent",
57
+ doc: "Whether lifecycle scripts of packages in node_modules are not executed.",
58
+ workspaceYaml: true,
59
+ anchor: "ignorescripts"
60
+ },
61
+ ignoreDepScripts: {
62
+ schema: Bool,
63
+ kind: "boolean",
64
+ strategy: "scalar",
65
+ enforcement: "absent",
66
+ doc: "Whether lifecycle scripts of dependencies are ignored during install.",
67
+ workspaceYaml: true,
68
+ anchor: "ignoredepscripts"
69
+ },
70
+ childConcurrency: {
71
+ schema: Num,
72
+ kind: "number",
73
+ strategy: "scalar",
74
+ enforcement: "absent",
75
+ doc: "Maximum number of child processes that build scripts can spawn concurrently.",
76
+ workspaceYaml: true,
77
+ anchor: "childconcurrency"
78
+ },
79
+ sideEffectsCache: {
80
+ schema: Bool,
81
+ kind: "boolean",
82
+ strategy: "scalar",
83
+ enforcement: "absent",
84
+ doc: "Whether the results of running install scripts are cached.",
85
+ workspaceYaml: true,
86
+ anchor: "sideeffectscache"
87
+ },
88
+ sideEffectsCacheReadonly: {
89
+ schema: Bool,
90
+ kind: "boolean",
91
+ strategy: "scalar",
92
+ enforcement: "absent",
93
+ doc: "Whether the side effects cache is used but never updated.",
94
+ workspaceYaml: true,
95
+ anchor: "sideeffectscachereadonly"
96
+ },
97
+ nodeOptions: {
98
+ schema: Str,
99
+ kind: "string",
100
+ strategy: "scalar",
101
+ enforcement: "absent",
102
+ doc: "Options passed to Node.js via NODE_OPTIONS when running scripts.",
103
+ workspaceYaml: true,
104
+ anchor: "nodeoptions"
105
+ },
106
+ verifyDepsBeforeRun: {
107
+ schema: Schema.Union(Schema.Literal("install", "warn", "error", "prompt"), Schema.Boolean),
108
+ kind: "union",
109
+ strategy: "scalar",
110
+ enforcement: "absent",
111
+ doc: "Whether pnpm verifies that the install is up to date before running scripts.",
112
+ workspaceYaml: true,
113
+ anchor: "verifydepsbeforerun",
114
+ samples: {
115
+ valid: ["install", false],
116
+ invalid: ["x"]
117
+ }
118
+ },
119
+ enablePrePostScripts: {
120
+ schema: Bool,
121
+ kind: "boolean",
122
+ strategy: "scalar",
123
+ enforcement: "absent",
124
+ doc: "Whether pre/post lifecycle scripts are run automatically alongside the main script.",
125
+ workspaceYaml: true,
126
+ anchor: "enableprepostscripts"
127
+ },
128
+ scriptShell: {
129
+ schema: Str,
130
+ kind: "string",
131
+ strategy: "scalar",
132
+ enforcement: "absent",
133
+ doc: "The shell used to execute scripts.",
134
+ workspaceYaml: true,
135
+ anchor: "scriptshell"
136
+ },
137
+ shellEmulator: {
138
+ schema: Bool,
139
+ kind: "boolean",
140
+ strategy: "scalar",
141
+ enforcement: "absent",
142
+ doc: "Whether a POSIX shell emulator is used when running scripts on Windows.",
143
+ workspaceYaml: true,
144
+ anchor: "shellemulator"
145
+ },
146
+ requiredScripts: {
147
+ schema: StringArray,
148
+ kind: "stringArray",
149
+ strategy: "arrayUnion",
150
+ enforcement: "absent",
151
+ doc: "Scripts that must exist in every project matching the current filter.",
152
+ workspaceYaml: true,
153
+ anchor: "requiredscripts"
154
+ },
155
+ patchedDependencies: {
156
+ schema: StringRecord,
157
+ kind: "stringRecord",
158
+ strategy: "mapChildWins",
159
+ enforcement: "warn",
160
+ doc: "Patches applied to dependencies, keyed by package identifier.",
161
+ workspaceYaml: true,
162
+ anchor: "patcheddependencies"
163
+ },
164
+ allowUnusedPatches: {
165
+ schema: Bool,
166
+ kind: "boolean",
167
+ strategy: "scalar",
168
+ enforcement: "absent",
169
+ doc: "Whether unused patches (patches that apply to no installed package) are allowed.",
170
+ workspaceYaml: true,
171
+ anchor: "allowunusedpatches"
172
+ },
173
+ allowNonAppliedPatches: {
174
+ schema: Bool,
175
+ kind: "boolean",
176
+ strategy: "scalar",
177
+ enforcement: "absent",
178
+ doc: "Whether non-applied patches (patches that fail to apply) are allowed.",
179
+ workspaceYaml: true,
180
+ anchor: "allownonappliedpatches"
181
+ },
182
+ ignorePatchFailures: {
183
+ schema: Bool,
184
+ kind: "boolean",
185
+ strategy: "scalar",
186
+ enforcement: "absent",
187
+ doc: "Whether patch failures are silently ignored during installation.",
188
+ workspaceYaml: true,
189
+ anchor: "ignorepatchfailures"
190
+ },
191
+ patchesDir: {
192
+ schema: Str,
193
+ kind: "string",
194
+ strategy: "scalar",
195
+ enforcement: "absent",
196
+ doc: "Directory where patch files are stored (default: patches).",
197
+ workspaceYaml: true,
198
+ anchor: "patchesdir"
199
+ },
200
+ configDependencies: {
201
+ schema: StringRecord,
202
+ kind: "stringRecord",
203
+ strategy: "mapChildWins",
204
+ enforcement: "absent",
205
+ doc: "Packages installed before other packages so their config scripts can run first.",
206
+ workspaceYaml: true,
207
+ anchor: "configdependencies"
208
+ },
209
+ executionEnv: {
210
+ schema: UnknownRecord,
211
+ kind: "unknownRecord",
212
+ strategy: "mapChildWins",
213
+ enforcement: "absent",
214
+ doc: "Environment variables applied when running scripts.",
215
+ workspaceYaml: true,
216
+ anchor: "executionenv"
217
+ },
218
+ injectWorkspacePackages: {
219
+ schema: Bool,
220
+ kind: "boolean",
221
+ strategy: "scalar",
222
+ enforcement: "absent",
223
+ doc: "Whether local workspace packages are injected instead of symlinked.",
224
+ workspaceYaml: true,
225
+ anchor: "injectworkspacepackages"
226
+ },
227
+ syncInjectedDepsAfterScripts: {
228
+ schema: StringArray,
229
+ kind: "stringArray",
230
+ strategy: "arrayUnion",
231
+ enforcement: "absent",
232
+ doc: "Scripts after which injected dependencies are re-synced.",
233
+ workspaceYaml: true,
234
+ anchor: "syncinjecteddepsafterscripts"
235
+ },
236
+ dedupeInjectedDeps: {
237
+ schema: Bool,
238
+ kind: "boolean",
239
+ strategy: "scalar",
240
+ enforcement: "absent",
241
+ doc: "Whether injected workspace packages are deduplicated.",
242
+ workspaceYaml: true,
243
+ anchor: "dedupeinjecteddeps"
244
+ }
245
+ };
246
+
247
+ //#endregion
248
+ export { build };
@@ -0,0 +1,175 @@
1
+ import { Bool, Num, Str, StringArray } from "./schemas.js";
2
+ import { Schema } from "effect";
3
+
4
+ //#region src/descriptors/hoisting.ts
5
+ /** The 17 hoisting + node-modules + store fields. @internal */
6
+ const hoisting = {
7
+ hoist: {
8
+ schema: Bool,
9
+ kind: "boolean",
10
+ strategy: "scalar",
11
+ enforcement: "absent",
12
+ doc: "Whether packages are hoisted to the virtual store root node_modules.",
13
+ workspaceYaml: true,
14
+ anchor: "hoist"
15
+ },
16
+ hoistWorkspacePackages: {
17
+ schema: Bool,
18
+ kind: "boolean",
19
+ strategy: "scalar",
20
+ enforcement: "absent",
21
+ doc: "Whether workspace packages are hoisted to the root node_modules.",
22
+ workspaceYaml: true,
23
+ anchor: "hoistworkspacepackages"
24
+ },
25
+ hoistPattern: {
26
+ schema: StringArray,
27
+ kind: "stringArray",
28
+ strategy: "arrayUnion",
29
+ enforcement: "absent",
30
+ doc: "Glob patterns describing which packages are hoisted to the virtual store root.",
31
+ workspaceYaml: true,
32
+ anchor: "hoistpattern"
33
+ },
34
+ shamefullyHoist: {
35
+ schema: Bool,
36
+ kind: "boolean",
37
+ strategy: "scalar",
38
+ enforcement: "absent",
39
+ doc: "Whether all packages are hoisted to the root node_modules (shameful flat layout).",
40
+ workspaceYaml: true,
41
+ anchor: "shamefullyhoist"
42
+ },
43
+ hoistingLimits: {
44
+ schema: Schema.Literal("none", "workspaces", "dependencies"),
45
+ kind: "enum",
46
+ strategy: "scalar",
47
+ enforcement: "absent",
48
+ doc: "Defines the scope to which dependencies are hoisted.",
49
+ workspaceYaml: true,
50
+ anchor: "hoistinglimits",
51
+ samples: {
52
+ valid: ["none"],
53
+ invalid: ["x"]
54
+ }
55
+ },
56
+ modulesDir: {
57
+ schema: Str,
58
+ kind: "string",
59
+ strategy: "scalar",
60
+ enforcement: "absent",
61
+ doc: "The directory in which node_modules will be created.",
62
+ workspaceYaml: true,
63
+ anchor: "modulesdir"
64
+ },
65
+ nodeLinker: {
66
+ schema: Schema.Literal("isolated", "hoisted", "pnp"),
67
+ kind: "enum",
68
+ strategy: "scalar",
69
+ enforcement: "absent",
70
+ doc: "Defines which linker is used for installing Node.js packages.",
71
+ workspaceYaml: true,
72
+ anchor: "nodelinker",
73
+ samples: {
74
+ valid: ["isolated"],
75
+ invalid: ["x"]
76
+ }
77
+ },
78
+ symlink: {
79
+ schema: Bool,
80
+ kind: "boolean",
81
+ strategy: "scalar",
82
+ enforcement: "absent",
83
+ doc: "Whether symlinks are created when linking packages from the store.",
84
+ workspaceYaml: true,
85
+ anchor: "symlink"
86
+ },
87
+ enableModulesDir: {
88
+ schema: Bool,
89
+ kind: "boolean",
90
+ strategy: "scalar",
91
+ enforcement: "absent",
92
+ doc: "Whether the local node_modules directory should be created during install.",
93
+ workspaceYaml: true,
94
+ anchor: "enablemodulesdir"
95
+ },
96
+ virtualStoreDir: {
97
+ schema: Str,
98
+ kind: "string",
99
+ strategy: "scalar",
100
+ enforcement: "absent",
101
+ doc: "The directory with links to the store (default: node_modules/.pnpm).",
102
+ workspaceYaml: true,
103
+ anchor: "virtualstoredir"
104
+ },
105
+ virtualStoreDirMaxLength: {
106
+ schema: Num,
107
+ kind: "number",
108
+ strategy: "scalar",
109
+ enforcement: "absent",
110
+ doc: "Maximum allowed length of directory names inside the virtual store.",
111
+ workspaceYaml: true,
112
+ anchor: "virtualstoredirmaxlength"
113
+ },
114
+ virtualStoreOnly: {
115
+ schema: Bool,
116
+ kind: "boolean",
117
+ strategy: "scalar",
118
+ enforcement: "absent",
119
+ doc: "Whether packages are written only to the virtual store without a local modules dir.",
120
+ workspaceYaml: true,
121
+ anchor: "virtualstoreonly"
122
+ },
123
+ packageImportMethod: {
124
+ schema: Schema.Literal("auto", "hardlink", "copy", "clone", "clone-or-copy"),
125
+ kind: "enum",
126
+ strategy: "scalar",
127
+ enforcement: "absent",
128
+ doc: "Controls how packages are imported from the content-addressable store.",
129
+ workspaceYaml: true,
130
+ anchor: "packageimportmethod",
131
+ samples: {
132
+ valid: ["auto"],
133
+ invalid: ["x"]
134
+ }
135
+ },
136
+ modulesCacheMaxAge: {
137
+ schema: Num,
138
+ kind: "number",
139
+ strategy: "scalar",
140
+ enforcement: "absent",
141
+ doc: "Maximum age (minutes) of unused modules directories before they are pruned.",
142
+ workspaceYaml: true,
143
+ anchor: "modulescachemaxage"
144
+ },
145
+ dlxCacheMaxAge: {
146
+ schema: Num,
147
+ kind: "number",
148
+ strategy: "scalar",
149
+ enforcement: "absent",
150
+ doc: "Maximum age (minutes) of cached dlx command results before re-fetch.",
151
+ workspaceYaml: true,
152
+ anchor: "dlxcachemaxage"
153
+ },
154
+ verifyStoreIntegrity: {
155
+ schema: Bool,
156
+ kind: "boolean",
157
+ strategy: "scalar",
158
+ enforcement: "warn",
159
+ doc: "Whether integrity checksums in the store are verified before using a package.",
160
+ workspaceYaml: true,
161
+ anchor: "verifystoreintegrity"
162
+ },
163
+ strictStorePkgContentCheck: {
164
+ schema: Bool,
165
+ kind: "boolean",
166
+ strategy: "scalar",
167
+ enforcement: "warn",
168
+ doc: "Whether store package content checksums are verified strictly on each access.",
169
+ workspaceYaml: true,
170
+ anchor: "strictstorepkgcontentcheck"
171
+ }
172
+ };
173
+
174
+ //#endregion
175
+ export { hoisting };