rolldown-pnpm-config 3.1.0 → 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/sync.js +113 -17
- package/cli/commands/upgrade.js +2 -2
- package/cli/main.js +3 -2
- package/cli/sync/commit-message.js +5 -2
- package/cli/sync/local-gate.js +8 -2
- package/cli/version.js +1 -1
- package/package.json +5 -5
- package/skills/rolldown-pnpm-config/references/options.md +1 -1
- package/skills/rolldown-pnpm-config/references/sync.md +8 -4
- package/skills/rolldown-pnpm-config/references/wiring.md +1 -1
package/cli/commands/sync.js
CHANGED
|
@@ -4,6 +4,7 @@ import { AtomicFile } from "@effected/files";
|
|
|
4
4
|
import { PnpmWorkspaceFile } from "@effected/pnpm";
|
|
5
5
|
import { Data, Effect, FileSystem, Option, Path, Result } from "effect";
|
|
6
6
|
import { Argument, Command, Flag } from "effect/cli";
|
|
7
|
+
import { WorkingDirectory } from "../cwd.js";
|
|
7
8
|
import { evaluatePluginConfig } from "../evaluate.js";
|
|
8
9
|
import { failureDoc, warningDoc } from "../render/report.js";
|
|
9
10
|
import { RegistryResolver } from "../resolve.js";
|
|
@@ -176,8 +177,13 @@ const runSyncWrite = Effect.fn("Sync.runSyncWrite")(function* (opts) {
|
|
|
176
177
|
listWritten: true
|
|
177
178
|
};
|
|
178
179
|
});
|
|
179
|
-
/**
|
|
180
|
-
|
|
180
|
+
/**
|
|
181
|
+
* The remedy for everything a plain `sync` repairs. `displayFile` is the
|
|
182
|
+
* config path as the reader should type it (the command passes it relative to
|
|
183
|
+
* the working directory), never an absolute path that leaks the machine's
|
|
184
|
+
* layout into CI logs.
|
|
185
|
+
*/
|
|
186
|
+
const syncRemedy = (displayFile) => `Run \`rolldown-pnpm-config sync ${displayFile}\`.`;
|
|
181
187
|
/** The remedy for export drift: the export writes the yaml, the rebuild serves what it wrote. */
|
|
182
188
|
const EXPORT_REMEDY = "Run `pnpm pnpm:export`, then rebuild the plugin.";
|
|
183
189
|
/** A section with nothing to report. */
|
|
@@ -214,7 +220,7 @@ function driftRow(row) {
|
|
|
214
220
|
* Also returns the rows the upgrade would move (none when it errored), which
|
|
215
221
|
* the ripples section lays over the config.
|
|
216
222
|
*/
|
|
217
|
-
function versionsSection(opts, sync) {
|
|
223
|
+
function versionsSection(opts, sync, remedy) {
|
|
218
224
|
return runUpgrade({
|
|
219
225
|
file: opts.configFile,
|
|
220
226
|
resolver: opts.resolver,
|
|
@@ -234,7 +240,7 @@ function versionsSection(opts, sync) {
|
|
|
234
240
|
};
|
|
235
241
|
const changed = Result.isSuccess(result) ? result.success.changed : [];
|
|
236
242
|
return {
|
|
237
|
-
section: findings("versions", changed.map(driftRow),
|
|
243
|
+
section: findings("versions", changed.map(driftRow), remedy),
|
|
238
244
|
changed
|
|
239
245
|
};
|
|
240
246
|
}));
|
|
@@ -244,17 +250,17 @@ function membershipSection(configFile, rootDir, sync) {
|
|
|
244
250
|
return evaluate("membership", checkMembership(configFile, rootDir, sync).pipe(Effect.map((m) => findings("membership", m.missing.map((name) => ` - ${name}`), MEMBERSHIP_REMEDY))));
|
|
245
251
|
}
|
|
246
252
|
/** Floors: the breaking-floor changesets on disk differ from the ones the plan derives. */
|
|
247
|
-
function floorsSection(
|
|
248
|
-
return evaluate("floors", planFloorEdits(rootDir).pipe(Effect.map(({ raised, edits }) => findings("floors", describeFloorEdits(raised, edits).split("\n").filter((line) => line !== ""),
|
|
253
|
+
function floorsSection(rootDir, remedy) {
|
|
254
|
+
return evaluate("floors", planFloorEdits(rootDir).pipe(Effect.map(({ raised, edits }) => findings("floors", describeFloorEdits(raised, edits).split("\n").filter((line) => line !== ""), remedy))));
|
|
249
255
|
}
|
|
250
256
|
/** The running list: a pending list whose moves disagree with the config. Absent is in sync. */
|
|
251
|
-
function runningListSection(configFile, rootDir, sync) {
|
|
257
|
+
function runningListSection(configFile, rootDir, sync, remedy) {
|
|
252
258
|
return evaluate("running-list", Effect.gen(function* () {
|
|
253
259
|
const existing = yield* readRunningList((yield* Path.Path).join(rootDir, sync.changesetPath));
|
|
254
260
|
if (Option.isNone(existing)) return ok("running-list");
|
|
255
261
|
const { entries } = yield* readCatalogSource(configFile);
|
|
256
262
|
const stale = staleMoves(parseChangeset(existing.value), currentCatalogs(entries));
|
|
257
|
-
return findings("running-list", stale,
|
|
263
|
+
return findings("running-list", stale, remedy);
|
|
258
264
|
}));
|
|
259
265
|
}
|
|
260
266
|
/**
|
|
@@ -269,7 +275,7 @@ function runningListSection(configFile, rootDir, sync) {
|
|
|
269
275
|
* targets come from the plan before any floor is raised (write mode raises
|
|
270
276
|
* floors first), so a row can differ from what a sync would write.
|
|
271
277
|
*/
|
|
272
|
-
function ripplesSection(configFile, rootDir, sync, upgraded) {
|
|
278
|
+
function ripplesSection(configFile, rootDir, sync, upgraded, remedy) {
|
|
273
279
|
return evaluate("ripples", Effect.gen(function* () {
|
|
274
280
|
const plan = yield* readReleasePlan(rootDir);
|
|
275
281
|
const { entries } = yield* readCatalogSource(configFile, sync.catalog);
|
|
@@ -282,7 +288,7 @@ function ripplesSection(configFile, rootDir, sync, upgraded) {
|
|
|
282
288
|
};
|
|
283
289
|
});
|
|
284
290
|
const rows = (yield* rippleMismatches(afterUpgrade, plan)).map((r) => ` ${r.catalog}.${r.pkg} ${r.from} -> ${r.to}`);
|
|
285
|
-
return findings("ripples", rows,
|
|
291
|
+
return findings("ripples", rows, remedy);
|
|
286
292
|
}));
|
|
287
293
|
}
|
|
288
294
|
/**
|
|
@@ -339,13 +345,14 @@ function checkDoc(mode, sections) {
|
|
|
339
345
|
*/
|
|
340
346
|
const runSyncCheck = Effect.fn("Sync.runSyncCheck")(function* (opts) {
|
|
341
347
|
const file = opts.configFile;
|
|
348
|
+
const remedy = syncRemedy(opts.displayFile ?? file);
|
|
342
349
|
const { sync, rootDir } = yield* gateContext(file);
|
|
343
|
-
const versions = yield* versionsSection(opts, sync);
|
|
350
|
+
const versions = yield* versionsSection(opts, sync, remedy);
|
|
344
351
|
const rest = yield* Effect.all([
|
|
345
352
|
membershipSection(file, rootDir, sync),
|
|
346
|
-
...sync.floors ? [floorsSection(
|
|
347
|
-
runningListSection(file, rootDir, sync),
|
|
348
|
-
ripplesSection(file, rootDir, sync, versions.changed)
|
|
353
|
+
...sync.floors ? [floorsSection(rootDir, remedy)] : [],
|
|
354
|
+
runningListSection(file, rootDir, sync, remedy),
|
|
355
|
+
ripplesSection(file, rootDir, sync, versions.changed, remedy)
|
|
349
356
|
]);
|
|
350
357
|
return checkDoc("check", [versions.section, ...rest]);
|
|
351
358
|
});
|
|
@@ -366,6 +373,48 @@ const runSyncLocal = Effect.fn("Sync.runSyncLocal")(function* (opts) {
|
|
|
366
373
|
const { sync, rootDir } = yield* gateContext(file);
|
|
367
374
|
return checkDoc("local", yield* Effect.all([membershipSection(file, rootDir, sync), exportSection(file, rootDir, sync)]));
|
|
368
375
|
});
|
|
376
|
+
/**
|
|
377
|
+
* Fail unless the `sync` block manages breaking floors: `--floors-only` on a
|
|
378
|
+
* config with `floors: false` would otherwise write or pass on files this
|
|
379
|
+
* config never asked `sync` to own.
|
|
380
|
+
*/
|
|
381
|
+
function requireFloors(sync, configFile) {
|
|
382
|
+
return sync.floors ? Effect.void : Effect.fail(new SyncConfigError({ message: `--floors-only needs \`sync.floors: true\` in ${configFile}; this config does not manage breaking floors` }));
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* `sync --floors-only`: raise the breaking-floor changesets and stop. No
|
|
386
|
+
* registry, no upgrade, no running list or commit message: the floors step
|
|
387
|
+
* of {@link runSyncWrite} alone, for a repository that keeps a separate
|
|
388
|
+
* floors script or hook.
|
|
389
|
+
*
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
392
|
+
const runSyncFloors = Effect.fn("Sync.runSyncFloors")(function* (opts) {
|
|
393
|
+
const { sync, rootDir } = yield* gateContext(opts.configFile);
|
|
394
|
+
yield* requireFloors(sync, opts.configFile);
|
|
395
|
+
const { edits } = yield* planFloorEdits(rootDir);
|
|
396
|
+
yield* applyFloorEdits(rootDir, edits).pipe(Effect.mapError(() => new UpgradeError({ message: `Cannot write the breaking-floor changesets in ${rootDir}` })));
|
|
397
|
+
return { edits: edits.map((edit) => ({
|
|
398
|
+
path: edit.path,
|
|
399
|
+
deleted: edit.content === null
|
|
400
|
+
})) };
|
|
401
|
+
});
|
|
402
|
+
/**
|
|
403
|
+
* `sync --check --floors-only`: the floors section of the gate alone. Offline;
|
|
404
|
+
* writes nothing.
|
|
405
|
+
*
|
|
406
|
+
* @internal
|
|
407
|
+
*/
|
|
408
|
+
const runSyncFloorsCheck = Effect.fn("Sync.runSyncFloorsCheck")(function* (opts) {
|
|
409
|
+
const { sync, rootDir } = yield* gateContext(opts.configFile);
|
|
410
|
+
yield* requireFloors(sync, opts.configFile);
|
|
411
|
+
return checkDoc("check", [yield* floorsSection(rootDir, `Run \`rolldown-pnpm-config sync --floors-only ${opts.displayFile ?? opts.configFile}\`.`)]);
|
|
412
|
+
});
|
|
413
|
+
/** The human view of a `--floors-only` write. @internal */
|
|
414
|
+
function syncFloorsDoc(result) {
|
|
415
|
+
if (result.edits.length === 0) return [Doc.line("Breaking floors are current; nothing written.")];
|
|
416
|
+
return [Doc.line(`Updated ${Fmt.plural(result.edits.length, "breaking-floor changeset")}:`), Doc.lines(result.edits.map((edit) => ` ${edit.path}${edit.deleted ? " (deleted)" : ""}`), { wrap: false })];
|
|
417
|
+
}
|
|
369
418
|
/** The gate's exit code: 0 when every section is ok, 1 for any finding or error. @internal */
|
|
370
419
|
function syncCheckExit(doc) {
|
|
371
420
|
return doc.sections.every((s) => s.status === "ok") ? 0 : 1;
|
|
@@ -451,11 +500,25 @@ function syncWriteJson(result) {
|
|
|
451
500
|
const configArg = Argument.File("config").pipe(Argument.withDescription("The plugin config holding the `sync` block (autodetected in the current directory when omitted)"), Argument.optional);
|
|
452
501
|
const checkFlag = Flag.Boolean("check").pipe(Flag.withDescription("Report whether a sync would change anything, and why (a gate; never writes)"), Flag.withDefault(false));
|
|
453
502
|
const localFlag = Flag.Boolean("local").pipe(Flag.withDescription("Compare the built pnpmfile's catalogs with pnpm-workspace.yaml (offline; never writes)"), Flag.withDefault(false));
|
|
503
|
+
const floorsOnlyFlag = Flag.Boolean("floors-only").pipe(Flag.withDescription("Only the breaking-floor changesets: raise them, or with --check report them (offline; needs sync.floors)"), Flag.withDefault(false));
|
|
454
504
|
const formatFlag = CliFormat.flag(["json"], {
|
|
455
505
|
aliases: { text: "auto" },
|
|
456
506
|
default: "text",
|
|
457
507
|
description: "Output format: text (for whoever is reading) or json (one JSON document on stdout)"
|
|
458
508
|
});
|
|
509
|
+
/**
|
|
510
|
+
* `file` as the reader should type it: relative to the working directory. A
|
|
511
|
+
* contributor copies the remedy from a CI log or a terminal, and an absolute
|
|
512
|
+
* path is neither portable nor private.
|
|
513
|
+
*/
|
|
514
|
+
function displayPath(file) {
|
|
515
|
+
return Effect.gen(function* () {
|
|
516
|
+
const cwd = yield* WorkingDirectory;
|
|
517
|
+
const path = yield* Path.Path;
|
|
518
|
+
const relative = path.relative(cwd, path.resolve(cwd, file));
|
|
519
|
+
return relative === "" ? file : relative;
|
|
520
|
+
});
|
|
521
|
+
}
|
|
459
522
|
/** JSON mode writes one single-line document, so a bash gate can pipe it straight into jq. */
|
|
460
523
|
const ONE_LINE = { indent: 0 };
|
|
461
524
|
/**
|
|
@@ -469,13 +532,46 @@ const syncCommand = Command.make("sync", {
|
|
|
469
532
|
config: configArg,
|
|
470
533
|
check: checkFlag,
|
|
471
534
|
local: localFlag,
|
|
535
|
+
floorsOnly: floorsOnlyFlag,
|
|
472
536
|
format: formatFlag
|
|
473
|
-
}, ({ config, check, local, format }) => Effect.gen(function* () {
|
|
537
|
+
}, ({ config, check, local, floorsOnly, format }) => Effect.gen(function* () {
|
|
474
538
|
if (check && local) return yield* new SyncUsageError({ message: "--check and --local cannot be combined; pass one" });
|
|
539
|
+
if (floorsOnly && local) return yield* new SyncUsageError({ message: "--floors-only cannot be combined with --local; pass it alone or with --check" });
|
|
540
|
+
if (floorsOnly && !check) {
|
|
541
|
+
const result = yield* resolveTargetFile(config).pipe(Effect.flatMap((file) => runSyncFloors({ configFile: file })), Effect.result);
|
|
542
|
+
if (format === "json") {
|
|
543
|
+
const json = Result.isFailure(result) ? {
|
|
544
|
+
command: "sync",
|
|
545
|
+
mode: "floors",
|
|
546
|
+
wrote: false,
|
|
547
|
+
error: {
|
|
548
|
+
kind: result.failure._tag,
|
|
549
|
+
message: result.failure.message
|
|
550
|
+
}
|
|
551
|
+
} : {
|
|
552
|
+
command: "sync",
|
|
553
|
+
mode: "floors",
|
|
554
|
+
wrote: result.success.edits.length > 0,
|
|
555
|
+
edits: result.success.edits
|
|
556
|
+
};
|
|
557
|
+
yield* CliFormat.print("json", {
|
|
558
|
+
doc: () => [],
|
|
559
|
+
json: () => json
|
|
560
|
+
}, ONE_LINE);
|
|
561
|
+
}
|
|
562
|
+
if (Result.isFailure(result)) return yield* Effect.fail(result.failure);
|
|
563
|
+
if (format === "json") return;
|
|
564
|
+
yield* Doc.print(syncFloorsDoc(result.success));
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
475
567
|
if (check || local) {
|
|
476
568
|
const mode = check ? "check" : "local";
|
|
477
|
-
const result = yield* resolveTargetFile(config).pipe(Effect.flatMap((file) =>
|
|
569
|
+
const result = yield* resolveTargetFile(config).pipe(Effect.flatMap((file) => floorsOnly ? Effect.flatMap(displayPath(file), (displayFile) => runSyncFloorsCheck({
|
|
570
|
+
configFile: file,
|
|
571
|
+
displayFile
|
|
572
|
+
})) : check ? Effect.flatMap(Effect.all([RegistryResolver, displayPath(file)]), ([resolver, displayFile]) => runSyncCheck({
|
|
478
573
|
configFile: file,
|
|
574
|
+
displayFile,
|
|
479
575
|
resolver,
|
|
480
576
|
workspaceResolver: makeWorkspaceResolver(findWorkspaceRoot(dirname(file)))
|
|
481
577
|
})) : runSyncLocal({ configFile: file })), Effect.result);
|
|
@@ -524,4 +620,4 @@ const syncCommand = Command.make("sync", {
|
|
|
524
620
|
if (success.wrote) yield* CliMessage.success("Sync written.");
|
|
525
621
|
})).pipe(Command.withDescription("Sync the plugin's own catalog to the next release versions"));
|
|
526
622
|
|
|
527
|
-
export { MembershipError, SyncUsageError, runSyncCheck, runSyncLocal, runSyncWrite, syncCheckExit, syncCheckView, syncCommand, syncWriteDoc, syncWriteJson };
|
|
623
|
+
export { MembershipError, SyncUsageError, runSyncCheck, runSyncFloors, runSyncFloorsCheck, runSyncLocal, runSyncWrite, syncCheckExit, syncCheckView, syncCommand, syncFloorsDoc, syncWriteDoc, syncWriteJson };
|
package/cli/commands/upgrade.js
CHANGED
|
@@ -3,7 +3,7 @@ import { CliDoc, CliExit, CliFormat, CliInteractive, CliMessage, Doc, Fmt } from
|
|
|
3
3
|
import { CliUi } from "@effected/cli-kit/ui";
|
|
4
4
|
import { AtomicFile } from "@effected/files";
|
|
5
5
|
import { ReleaseAgeGate } from "@effected/pnpm";
|
|
6
|
-
import { Clock, Data, Effect,
|
|
6
|
+
import { Clock, Data, Effect, Option, Result } from "effect";
|
|
7
7
|
import { Argument, Command, Flag } from "effect/cli";
|
|
8
8
|
import { bareVersion } from "../../semver-util.js";
|
|
9
9
|
import { WorkingDirectory } from "../cwd.js";
|
|
@@ -94,7 +94,7 @@ function writeSource(file, next) {
|
|
|
94
94
|
*/
|
|
95
95
|
function readCatalogSource(file, catalog) {
|
|
96
96
|
return Effect.gen(function* () {
|
|
97
|
-
const source = yield*
|
|
97
|
+
const { text: source } = yield* AtomicFile.readText(file).pipe(Effect.mapError(() => new UpgradeError({ message: `Cannot read ${file}` })));
|
|
98
98
|
const { entries, skipped, skippedRefs, catalogs } = yield* Effect.try({
|
|
99
99
|
try: () => discoverCatalogEntries(source, file),
|
|
100
100
|
catch: (e) => new UpgradeError({ message: Fmt.describe(e) })
|
package/cli/main.js
CHANGED
|
@@ -16,8 +16,9 @@ import { CLI_VERSION } from "./version.js";
|
|
|
16
16
|
* kit reads it from when `env.stderrIsTerminal` is omitted.
|
|
17
17
|
*
|
|
18
18
|
* The registry resolver is provided here, at the edge, so a test drives the
|
|
19
|
-
* same command tree against a stub resolver. It
|
|
20
|
-
*
|
|
19
|
+
* same command tree against a stub resolver. It reads the registry through
|
|
20
|
+
* `@effected/npm`'s `NpmRegistry` (npmrc routing, auth, proxy and CA settings
|
|
21
|
+
* as pnpm applies them), reads pnpm's settings from
|
|
21
22
|
* `process.cwd()` / `process.env` / `process.platform`, and takes `FileSystem`
|
|
22
23
|
* and `Path` from `NodeServices.layer`, provided by `main`.
|
|
23
24
|
*
|
|
@@ -6,14 +6,17 @@ import { byCatalog } from "./running-list.js";
|
|
|
6
6
|
* blank line, then one bullet per package.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* With no moves the message is the headline alone.
|
|
9
|
+
* With no moves the message is the headline alone. Package names are written
|
|
10
|
+
* bare, never as inline code: commitlint presets such as
|
|
11
|
+
* `@savvy-web/commitlint`'s `silk/body-no-markdown` reject a body with more
|
|
12
|
+
* than a couple of code spans, and a sync can move dozens of packages.
|
|
10
13
|
*
|
|
11
14
|
* @internal
|
|
12
15
|
*/
|
|
13
16
|
function renderCommitMessage(scope, moves) {
|
|
14
17
|
const headline = `chore(${scope}): sync catalog to the next release versions`;
|
|
15
18
|
if (moves.length === 0) return `${headline}\n`;
|
|
16
|
-
return `${headline}\n\n${byCatalog(moves).flatMap(([, group]) => group.map((move) => `-
|
|
19
|
+
return `${headline}\n\n${byCatalog(moves).flatMap(([, group]) => group.map((move) => `- ${move.pkg} ${move.from} -> ${move.to}`)).join("\n")}\n`;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
export { renderCommitMessage };
|
package/cli/sync/local-gate.js
CHANGED
|
@@ -29,13 +29,19 @@ function readServedCatalogs(pnpmfilePath) {
|
|
|
29
29
|
/**
|
|
30
30
|
* The catalogs the export writes into this repo's own workspace file: an
|
|
31
31
|
* explicit `local.catalogs` wins, otherwise every served catalog except the
|
|
32
|
-
* sync catalog and its `:peers`
|
|
32
|
+
* sync catalog and its derived `:peers` and `:exact` siblings, which lag it
|
|
33
|
+
* between releases in exactly the same way.
|
|
33
34
|
*
|
|
34
35
|
* @internal
|
|
35
36
|
*/
|
|
36
37
|
function exportedCatalogNames(served, sync) {
|
|
37
38
|
if (sync.localCatalogs !== void 0) return sync.localCatalogs;
|
|
38
|
-
|
|
39
|
+
const managed = /* @__PURE__ */ new Set([
|
|
40
|
+
sync.catalog,
|
|
41
|
+
`${sync.catalog}:peers`,
|
|
42
|
+
`${sync.catalog}:exact`
|
|
43
|
+
]);
|
|
44
|
+
return Object.keys(served).filter((name) => !managed.has(name));
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
47
|
* Per exported catalog, the packages whose served range differs from the
|
package/cli/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown-pnpm-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A dogfooding example of our plugin",
|
|
6
6
|
"repository": {
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@effect/platform-node": "4.1.7",
|
|
39
|
-
"@effected/changesets": "0.
|
|
40
|
-
"@effected/cli-kit": "0.33.
|
|
39
|
+
"@effected/changesets": "0.10.0",
|
|
40
|
+
"@effected/cli-kit": "0.33.1",
|
|
41
41
|
"@effected/env": "0.12.0",
|
|
42
|
-
"@effected/files": "0.
|
|
42
|
+
"@effected/files": "0.5.0",
|
|
43
43
|
"@effected/glob": "0.23.1",
|
|
44
44
|
"@effected/npm": "0.35.1",
|
|
45
45
|
"@effected/pnpm": "0.1.3",
|
|
46
46
|
"@effected/semver": "0.24.0",
|
|
47
47
|
"@effected/walker": "0.32.0",
|
|
48
|
-
"@effected/workspaces": "0.49.
|
|
48
|
+
"@effected/workspaces": "0.49.4",
|
|
49
49
|
"@effected/yaml": "0.31.0",
|
|
50
50
|
"effect": "4.1.7",
|
|
51
51
|
"ink": "^8.0.0",
|
|
@@ -67,7 +67,7 @@ excluded.
|
|
|
67
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
68
|
| `local` | object | see below | The `sync --local` gate |
|
|
69
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
|
|
70
|
+
| `local.catalogs` | `string[]` | every served catalog except `<catalog>`, `<catalog>:peers` and `<catalog>:exact` | The catalogs `--local` compares with `pnpm-workspace.yaml` |
|
|
71
71
|
|
|
72
72
|
### `local`
|
|
73
73
|
|
|
@@ -6,7 +6,7 @@ changeset. It reads the `sync` block of the config; the wiring reference
|
|
|
6
6
|
lists the fields.
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
rolldown-pnpm-config sync [config] [--check | --local] [--format json]
|
|
9
|
+
rolldown-pnpm-config sync [config] [--check | --local] [--floors-only] [--format json]
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
`config` defaults to the single top-level `.ts` file in the current directory
|
|
@@ -19,8 +19,11 @@ that calls `PnpmConfigPlugin(...)`.
|
|
|
19
19
|
| `sync` | yes | registry | membership refusal, then the write | the Catalog Sync workflow; you only when the user asks |
|
|
20
20
|
| `sync --check` | never | registry | `versions`, `membership`, `floors` (only with `sync.floors: true`), `running-list`, `ripples` | the Catalog Sync workflow, as its gate |
|
|
21
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 |
|
|
22
24
|
|
|
23
|
-
`--check` and `--local` together are a usage error
|
|
25
|
+
`--check` and `--local` together are a usage error, and so is
|
|
26
|
+
`--floors-only` with `--local`. Every gate section is
|
|
24
27
|
evaluated; none stops the others.
|
|
25
28
|
|
|
26
29
|
What plain `sync` does, in order: refuse if a publishable member is missing
|
|
@@ -36,7 +39,7 @@ nothing moved); write the commit message to `sync.commit.messagePath`.
|
|
|
36
39
|
| --- | --- |
|
|
37
40
|
| 0 | every section ok, or the write succeeded |
|
|
38
41
|
| 1 | a finding, a section that could not be evaluated, or a failed write (membership, release plan, upgrade, workspace) |
|
|
39
|
-
| 64 | usage: `--check --local`; a config that does not parse or has no `PnpmConfigPlugin(...)` call; or no or an invalid `sync` block |
|
|
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 |
|
|
40
43
|
|
|
41
44
|
Exit 1 does not mean drift. Read the report or the JSON before acting.
|
|
42
45
|
|
|
@@ -113,7 +116,8 @@ plugin's `package.json` cannot be read or parsed.
|
|
|
113
116
|
## Why `--local` skips the sync catalog
|
|
114
117
|
|
|
115
118
|
By default `--local` compares every catalog the built pnpmfile serves except
|
|
116
|
-
`sync.catalog` and `<sync.catalog>:peers
|
|
119
|
+
`sync.catalog` and its derived `<sync.catalog>:peers` and
|
|
120
|
+
`<sync.catalog>:exact` twins. The workflow's sync commits only
|
|
117
121
|
the config literal and the changesets; it never re-exports
|
|
118
122
|
`pnpm-workspace.yaml`, because `pnpm:export` is run by the user only. The
|
|
119
123
|
yaml's copy of the sync catalog therefore lags by design, and comparing it
|
|
@@ -143,7 +143,7 @@ Every field the CLI reads. Unknown keys are rejected, and a config with no
|
|
|
143
143
|
| `commit.messagePath` | `.changeset/catalog-sync.commit.txt` | Where the commit message is written |
|
|
144
144
|
| `floors` | `false` | Also raise and check breaking-floor changesets (`.changeset/breaking-floor-*.md`) |
|
|
145
145
|
| `local.pnpmfile` | `dist/prod/npm/pkg/pnpmfile.mjs` | The built pnpmfile `--local` imports, relative to the plugin package |
|
|
146
|
-
| `local.catalogs` | every served catalog except `<catalog
|
|
146
|
+
| `local.catalogs` | every served catalog except `<catalog>`, `<catalog>:peers` and `<catalog>:exact` | The catalogs `--local` compares with `pnpm-workspace.yaml` |
|
|
147
147
|
|
|
148
148
|
- A member is publishable when its `publishConfig.access` is `"public"`;
|
|
149
149
|
`private` is never read.
|