rolldown-pnpm-config 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,7 +76,8 @@ function readRunningList(file) {
76
76
  function writeListAndMessage(rootDir, sync, pluginName, moves) {
77
77
  return Effect.gen(function* () {
78
78
  const path = yield* Path.Path;
79
- yield* writeFile(path.join(rootDir, sync.changesetPath), renderChangeset(pluginName, sync.bump, moves, sync.catalog));
79
+ const file = path.join(rootDir, sync.changesetPath);
80
+ yield* writeFile(file, yield* Effect.fromResult(renderChangeset(pluginName, sync.bump, moves, sync.catalog)).pipe(Effect.mapError((error) => new UpgradeError({ message: `Cannot render ${file}: ${error.message}` }))));
80
81
  yield* writeFile(path.join(rootDir, sync.messagePath), renderCommitMessage(sync.commitScope, moves));
81
82
  });
82
83
  }
@@ -452,14 +453,7 @@ function moveLine(move, note = "") {
452
453
  function syncWriteDoc(result) {
453
454
  if (!result.wrote) return [Doc.line("The sync catalog is current; nothing written.")];
454
455
  const rippled = new Set(result.ripples.map((r) => `${r.catalog}\0${r.pkg}`));
455
- const blocks = [];
456
- if (result.moves.length > 0) {
457
- blocks.push(Doc.line(`Synced ${Fmt.plural(result.moves.length, "catalog entry", "catalog entries")}:`));
458
- blocks.push(Doc.lines(result.moves.map((m) => moveLine(m, rippled.has(`${m.catalog}\0${m.pkg}`) ? " (ripple)" : "")), { wrap: false }));
459
- } else if (result.listWritten) blocks.push(Doc.line("The catalog was current; rewrote the stale running list."));
460
- else blocks.push(Doc.line("The catalog was current; the running list was left as it was."));
461
- if (result.floors > 0) blocks.push(Doc.line(`Updated ${Fmt.plural(result.floors, "breaking-floor changeset")}.`));
462
- return blocks;
456
+ return Doc.concat(result.moves.length > 0 ? [Doc.line(`Synced ${Fmt.plural(result.moves.length, "catalog entry", "catalog entries")}:`), Doc.lines(result.moves.map((m) => moveLine(m, rippled.has(`${m.catalog}\0${m.pkg}`) ? " (ripple)" : "")), { wrap: false })] : Doc.line(result.listWritten ? "The catalog was current; rewrote the stale running list." : "The catalog was current; the running list was left as it was."), result.floors > 0 && Doc.line(`Updated ${Fmt.plural(result.floors, "breaking-floor changeset")}.`));
463
457
  }
464
458
  /**
465
459
  * The `--format json` document of a write-mode run.
@@ -596,7 +590,7 @@ const syncCommand = Command.make("sync", {
596
590
  return yield* Effect.fail(result.failure);
597
591
  }
598
592
  const doc = result.success;
599
- yield* CliFormat.print(format === "json" ? "json" : "auto", {
593
+ yield* CliFormat.print(format, {
600
594
  doc: () => syncCheckView(doc),
601
595
  json: () => doc
602
596
  }, ONE_LINE);
@@ -25,11 +25,8 @@ const coloured = Effect.gen(function* () {
25
25
  */
26
26
  function printView(view, options = {}) {
27
27
  return Effect.gen(function* () {
28
- const doc = [];
29
- if (options.heading !== void 0) doc.push(Doc.line(options.heading), Doc.line(""));
30
- if (options.legend !== void 0 && (yield* coloured)) doc.push(options.legend, Doc.line(""));
31
- doc.push(Doc.lines(view.lines, { wrap: false }));
32
- yield* Doc.print(doc);
28
+ const legend = options.legend !== void 0 && (yield* coloured) ? options.legend : void 0;
29
+ yield* Doc.print(Doc.concat(options.heading !== void 0 && [Doc.line(options.heading), Doc.line("")], legend !== void 0 && [legend, Doc.line("")], Doc.lines(view.lines, { wrap: false })));
33
30
  });
34
31
  }
35
32
 
@@ -3,13 +3,11 @@ import { Doc, Status } from "@effected/cli-kit";
3
3
  // src/cli/render/report.ts
4
4
  function statusDoc(status, message) {
5
5
  const [first = "", ...rest] = message.split("\n");
6
- const blocks = [Doc.line([
6
+ return Doc.concat(Doc.line([
7
7
  Doc.status(Status.core, status),
8
8
  " ",
9
9
  first
10
- ])];
11
- if (rest.length > 0) blocks.push(Doc.verbatim(rest.join("\n")));
12
- return blocks;
10
+ ]), rest.length > 0 && Doc.verbatim(rest.join("\n")));
13
11
  }
14
12
  /**
15
13
  * The failure report for one of the CLI's own errors: a status line carrying
package/cli/summary.js CHANGED
@@ -46,9 +46,7 @@ function summaryDoc(decisions, interop, rejected) {
46
46
  }
47
47
  lines.push(row(" ", 0, [tone(`${toUpdate} to update · ${major} major · ${resync} resync · ${materialize} new peer · ${upToDate} up to date`, "unchanged")]));
48
48
  if (interop) for (const c of interop.conflicts) lines.push(row("⚠", 0, [tone(`${c.pkg} (kept ${c.ceiling}) blocked by ${c.blockedBy}`, "warn")]));
49
- const blocks = [Doc.lines(lines, { wrap: false })];
50
- if (rejected && rejected.length > 0) blocks.push(Doc.line(""), Doc.lines([row("⚠", 0, [tone("Rejected (no published version satisfies these):", "warn")]), ...rejected.map((r) => row("⚠", 1, [tone(`${r.pkg} ${r.kind} ${r.value} — ${r.reason}`, "warn")]))], { wrap: false }));
51
- return blocks;
49
+ return Doc.concat(Doc.lines(lines, { wrap: false }), rejected !== void 0 && rejected.length > 0 && [Doc.line(""), Doc.lines([row("⚠", 0, [tone("Rejected (no published version satisfies these):", "warn")]), ...rejected.map((r) => row("⚠", 1, [tone(`${r.pkg} ${r.kind} ${r.value} — ${r.reason}`, "warn")]))], { wrap: false })]);
52
50
  }
53
51
 
54
52
  export { summaryDoc };
@@ -1,4 +1,4 @@
1
- import { ChangesetConfig, PendingChangeset, PendingChangesets, PreState, ReleasePlan } from "@effected/changesets";
1
+ import { ChangesetConfig, ChangesetFile, PendingChangeset, PendingChangesets, PreState, ReleasePlan } from "@effected/changesets";
2
2
  import { WorkspaceDiscovery } from "@effected/workspaces";
3
3
  import { Effect, FileSystem, Option, Path } from "effect";
4
4
  import { ReleasePlanError, discoveryLayer } from "./release-plan.js";
@@ -16,7 +16,10 @@ const isFloorFile = (file) => file.startsWith("breaking-floor-") && file.endsWit
16
16
  const renderFloorChangeset = (raised) => {
17
17
  const lines = raised.causes.map((cause) => `- Requires \`${cause.dependency}\` ${cause.newVersion} (\`${cause.kind}\`: \`${cause.range}\`), a breaking release from ${cause.oldVersion}. A consumer still on ${cause.oldVersion} cannot install this version beside it, so this release leaves its own version line too.`);
18
18
  const upgrade = raised.causes.map((cause) => `\`${cause.dependency}\` to ${cause.newVersion}`).join(", ");
19
- return `---\n"${raised.name}": ${raised.required}\n---\n\n## Breaking Changes\n\n${lines.join("\n")}\n\nTo upgrade, move ${upgrade} in the same install as this release.\n`;
19
+ return ChangesetFile.render({
20
+ releases: { [raised.name]: raised.required },
21
+ summary: `## Breaking Changes\n\n${lines.join("\n")}\n\nTo upgrade, move ${upgrade} in the same install as this release.`
22
+ });
20
23
  };
21
24
  /**
22
25
  * Raise every release whose published floor crosses a dependency's breaking
@@ -92,7 +95,7 @@ const planFloorEdits = Effect.fn("Sync.planFloorEdits")(function* (rootDir) {
92
95
  for (const r of raised) {
93
96
  const file = floorFile(r.name);
94
97
  wanted.add(file);
95
- const content = renderFloorChangeset(r);
98
+ const content = yield* renderFloorChangeset(r).pipe(Effect.mapError((error) => new ReleasePlanError({ message: `Floor changeset for ${r.name} could not be rendered: ${error.message}` })));
96
99
  const target = path.join(dir, file);
97
100
  const current = yield* fs.readFileString(target).pipe(Effect.option);
98
101
  if (Option.isNone(current) || current.value !== content) edits.push({
@@ -1,3 +1,5 @@
1
+ import { ChangesetFile } from "@effected/changesets";
2
+
1
3
  // src/cli/sync/running-list.ts
2
4
  /**
3
5
  * The config's catalog entries by catalog name, then package: the
@@ -46,10 +48,14 @@ function moveText(move) {
46
48
  * @internal
47
49
  */
48
50
  function renderChangeset(pluginName, bump, moves, catalog) {
49
- return `---\n"${pluginName}": ${bump}\n---\n\n## Maintenance\n\n${moves.length === 0 ? `- Synced the \`${catalog}\` catalog to the current release versions` : byCatalog(moves).map(([name, group]) => {
51
+ const body = moves.length === 0 ? `- Synced the \`${catalog}\` catalog to the current release versions` : byCatalog(moves).map(([name, group]) => {
50
52
  const lines = group.map((move) => `- \`${move.pkg}\` ${moveText(move)}`);
51
53
  return `### Updates ${moveSummary(name, group.length)}\n\n${lines.join("\n")}`;
52
- }).join("\n\n")}\n`;
54
+ }).join("\n\n");
55
+ return ChangesetFile.renderResult({
56
+ releases: { [pluginName]: bump },
57
+ summary: `## Maintenance\n\n${body}`
58
+ });
53
59
  }
54
60
  /** One `### Updates … catalog:<catalog> …` heading, capturing the catalog. */
55
61
  const SECTION = /^### Updates \d+ catalog:(\S+) versions?$/;
package/cli/version.js CHANGED
@@ -6,6 +6,6 @@
6
6
  *
7
7
  * @internal
8
8
  */
9
- const CLI_VERSION = "3.2.0";
9
+ const CLI_VERSION = "3.2.1";
10
10
 
11
11
  export { CLI_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-pnpm-config",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
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.10.0",
40
- "@effected/cli-kit": "0.33.1",
39
+ "@effected/changesets": "0.11.0",
40
+ "@effected/cli-kit": "0.34.0",
41
41
  "@effected/env": "0.12.0",
42
- "@effected/files": "0.5.0",
42
+ "@effected/files": "0.6.0",
43
43
  "@effected/glob": "0.23.1",
44
44
  "@effected/npm": "0.35.1",
45
- "@effected/pnpm": "0.1.3",
45
+ "@effected/pnpm": "0.1.4",
46
46
  "@effected/semver": "0.24.0",
47
- "@effected/walker": "0.32.0",
48
- "@effected/workspaces": "0.49.4",
47
+ "@effected/walker": "0.33.0",
48
+ "@effected/workspaces": "0.49.5",
49
49
  "@effected/yaml": "0.31.0",
50
50
  "effect": "4.1.7",
51
51
  "ink": "^8.0.0",