prisma-next 0.12.0-dev.5 → 0.12.0-dev.50

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 (127) hide show
  1. package/dist/cli.mjs +180 -163
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/{client-KgJorIvG.mjs → client-DC-UlBLy.mjs} +83 -58
  4. package/dist/client-DC-UlBLy.mjs.map +1 -0
  5. package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-esJGBD4W.mjs} +317 -23
  6. package/dist/command-helpers-esJGBD4W.mjs.map +1 -0
  7. package/dist/commands/contract-emit.mjs +1 -1
  8. package/dist/commands/contract-infer.mjs +1 -1
  9. package/dist/commands/db-init.mjs +4 -5
  10. package/dist/commands/db-init.mjs.map +1 -1
  11. package/dist/commands/db-schema.mjs +3 -3
  12. package/dist/commands/db-sign.mjs +4 -4
  13. package/dist/commands/db-update.d.mts.map +1 -1
  14. package/dist/commands/db-update.mjs +10 -7
  15. package/dist/commands/db-update.mjs.map +1 -1
  16. package/dist/commands/db-verify.mjs +1 -1
  17. package/dist/commands/migrate.d.mts +2 -2
  18. package/dist/commands/migrate.d.mts.map +1 -1
  19. package/dist/commands/migrate.mjs +6 -8
  20. package/dist/commands/migrate.mjs.map +1 -1
  21. package/dist/commands/migration-check.d.mts +55 -13
  22. package/dist/commands/migration-check.d.mts.map +1 -1
  23. package/dist/commands/migration-check.mjs +3 -2
  24. package/dist/commands/migration-graph.d.mts +17 -8
  25. package/dist/commands/migration-graph.d.mts.map +1 -1
  26. package/dist/commands/migration-graph.mjs +183 -2
  27. package/dist/commands/migration-graph.mjs.map +1 -0
  28. package/dist/commands/migration-list.d.mts +25 -27
  29. package/dist/commands/migration-list.d.mts.map +1 -1
  30. package/dist/commands/migration-list.mjs +2 -190
  31. package/dist/commands/migration-log.d.mts +9 -19
  32. package/dist/commands/migration-log.d.mts.map +1 -1
  33. package/dist/commands/migration-log.mjs +1 -137
  34. package/dist/commands/migration-new.mjs +3 -3
  35. package/dist/commands/migration-plan.d.mts +1 -1
  36. package/dist/commands/migration-plan.mjs +1 -1
  37. package/dist/commands/migration-show.d.mts +17 -21
  38. package/dist/commands/migration-show.d.mts.map +1 -1
  39. package/dist/commands/migration-show.mjs +23 -35
  40. package/dist/commands/migration-show.mjs.map +1 -1
  41. package/dist/commands/migration-status.d.mts +42 -144
  42. package/dist/commands/migration-status.d.mts.map +1 -1
  43. package/dist/commands/migration-status.mjs +3 -759
  44. package/dist/commands/ref.d.mts +1 -1
  45. package/dist/commands/ref.mjs +3 -3
  46. package/dist/commands/telemetry/index.d.mts +7 -0
  47. package/dist/commands/telemetry/index.d.mts.map +1 -0
  48. package/dist/commands/telemetry/index.mjs +2 -0
  49. package/dist/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-COZAemUl.mjs} +2 -2
  50. package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-COZAemUl.mjs.map} +1 -1
  51. package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-Bv46RAIO.mjs} +3 -3
  52. package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-Bv46RAIO.mjs.map} +1 -1
  53. package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-DIWImLqS.mjs} +5 -5
  54. package/dist/{contract-emit-D-4jrNve.mjs.map → contract-emit-DIWImLqS.mjs.map} +1 -1
  55. package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-DpGN9SAj.mjs} +3 -3
  56. package/dist/{contract-infer-D8uEbJuu.mjs.map → contract-infer-DpGN9SAj.mjs.map} +1 -1
  57. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-CpNVrBqW.mjs} +63 -5
  58. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-CpNVrBqW.mjs.map} +1 -1
  59. package/dist/{db-verify-v_vUKXTU.mjs → db-verify-Cq16Obsw.mjs} +4 -4
  60. package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-Cq16Obsw.mjs.map} +1 -1
  61. package/dist/exports/control-api.d.mts +2 -2
  62. package/dist/exports/control-api.d.mts.map +1 -1
  63. package/dist/exports/control-api.mjs +2 -2
  64. package/dist/exports/index.mjs +1 -1
  65. package/dist/exports/init-output.mjs +1 -1
  66. package/dist/{framework-components-fYXjz_in.mjs → framework-components-BO9VO43s.mjs} +2 -2
  67. package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-BO9VO43s.mjs.map} +1 -1
  68. package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-CV5LhrFg.d.mts} +1 -1
  69. package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-CV5LhrFg.d.mts.map} +1 -1
  70. package/dist/{init-Cv9UzWL5.mjs → init-C0rjiQ9I.mjs} +5 -58
  71. package/dist/init-C0rjiQ9I.mjs.map +1 -0
  72. package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-CRDKTNcf.mjs} +3 -3
  73. package/dist/{inspect-live-schema-C6ohV_oQ.mjs.map → inspect-live-schema-CRDKTNcf.mjs.map} +1 -1
  74. package/dist/migration-check-BxWlQBOs.mjs +573 -0
  75. package/dist/migration-check-BxWlQBOs.mjs.map +1 -0
  76. package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-BDd9abqW.mjs} +3 -3
  77. package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-BDd9abqW.mjs.map} +1 -1
  78. package/dist/migration-graph-space-render-CeNXh_Wy.mjs +1966 -0
  79. package/dist/migration-graph-space-render-CeNXh_Wy.mjs.map +1 -0
  80. package/dist/migration-list-vJWFuXca.mjs +228 -0
  81. package/dist/migration-list-vJWFuXca.mjs.map +1 -0
  82. package/dist/migration-log-6rcHQSI4.mjs +222 -0
  83. package/dist/migration-log-6rcHQSI4.mjs.map +1 -0
  84. package/dist/migration-path-target-UkxkgXnv.mjs +38 -0
  85. package/dist/migration-path-target-UkxkgXnv.mjs.map +1 -0
  86. package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-CHu_erQ5.mjs} +5 -6
  87. package/dist/{migration-plan-9DJ7q7_z.mjs.map → migration-plan-CHu_erQ5.mjs.map} +1 -1
  88. package/dist/migration-status-Bjv91dE7.mjs +444 -0
  89. package/dist/migration-status-Bjv91dE7.mjs.map +1 -0
  90. package/dist/{output-B60Gw5fu.mjs → output-BD61elic.mjs} +1 -1
  91. package/dist/{output-B60Gw5fu.mjs.map → output-BD61elic.mjs.map} +1 -1
  92. package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-CJY9zOv7.mjs} +1 -1
  93. package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-CJY9zOv7.mjs.map} +1 -1
  94. package/dist/schemas-BL33A3i-.d.mts +193 -0
  95. package/dist/schemas-BL33A3i-.d.mts.map +1 -0
  96. package/dist/schemas-DJY2O09F.mjs +112 -0
  97. package/dist/schemas-DJY2O09F.mjs.map +1 -0
  98. package/dist/telemetry-CZkgkR_O.mjs +122 -0
  99. package/dist/telemetry-CZkgkR_O.mjs.map +1 -0
  100. package/dist/{terminal-ui-5Y6mrg93.d.mts → terminal-ui-BgLiAOYi.d.mts} +1 -1
  101. package/dist/{terminal-ui-5Y6mrg93.d.mts.map → terminal-ui-BgLiAOYi.d.mts.map} +1 -1
  102. package/dist/{types-Dt_SfqFm.d.mts → types-qV41eEXH.d.mts} +44 -31
  103. package/dist/types-qV41eEXH.d.mts.map +1 -0
  104. package/dist/{verify-DCA9Sldu.mjs → verify-IilvIk_E.mjs} +2 -2
  105. package/dist/{verify-DCA9Sldu.mjs.map → verify-IilvIk_E.mjs.map} +1 -1
  106. package/package.json +11 -12
  107. package/dist/client-KgJorIvG.mjs.map +0 -1
  108. package/dist/command-helpers-Bbw1GbwL.mjs.map +0 -1
  109. package/dist/commands/migration-list.mjs.map +0 -1
  110. package/dist/commands/migration-log.mjs.map +0 -1
  111. package/dist/commands/migration-status.mjs.map +0 -1
  112. package/dist/extension-pack-inputs-IDvjRCi3.mjs +0 -62
  113. package/dist/extension-pack-inputs-IDvjRCi3.mjs.map +0 -1
  114. package/dist/graph-render-rFAqZujX.mjs +0 -1081
  115. package/dist/graph-render-rFAqZujX.mjs.map +0 -1
  116. package/dist/init-Cv9UzWL5.mjs.map +0 -1
  117. package/dist/migration-check-BiBJoYYW.mjs +0 -341
  118. package/dist/migration-check-BiBJoYYW.mjs.map +0 -1
  119. package/dist/migration-graph-D7DVUElV.mjs +0 -1232
  120. package/dist/migration-graph-D7DVUElV.mjs.map +0 -1
  121. package/dist/migration-list-styler-BRwF4-gy.mjs +0 -399
  122. package/dist/migration-list-styler-BRwF4-gy.mjs.map +0 -1
  123. package/dist/migration-types-D2FW63pr.d.mts +0 -15
  124. package/dist/migration-types-D2FW63pr.d.mts.map +0 -1
  125. package/dist/migrations-Cv2jxNNK.mjs +0 -228
  126. package/dist/migrations-Cv2jxNNK.mjs.map +0 -1
  127. package/dist/types-Dt_SfqFm.d.mts.map +0 -1
@@ -1,399 +0,0 @@
1
- import { bold, cyan, cyanBright, dim, green, yellow } from "colorette";
2
- import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
3
- //#region src/utils/formatters/migration-list-graph-topology.ts
4
- function compareDirNameDesc(a, b) {
5
- return b.dirName.localeCompare(a.dirName);
6
- }
7
- function bumpDegree(map, key) {
8
- map.set(key, (map.get(key) ?? 0) + 1);
9
- }
10
- function forwardRootsForDepth(nodes, candidates) {
11
- const inDegree = /* @__PURE__ */ new Map();
12
- for (const node of nodes) inDegree.set(node, 0);
13
- for (const edge of candidates) bumpDegree(inDegree, edge.to);
14
- const roots = [];
15
- for (const node of nodes) if ((inDegree.get(node) ?? 0) === 0) roots.push(node);
16
- roots.sort((a, b) => {
17
- if (a === EMPTY_CONTRACT_HASH) return -1;
18
- if (b === EMPTY_CONTRACT_HASH) return 1;
19
- return a.localeCompare(b);
20
- });
21
- if (roots.length > 0) return roots;
22
- return [...nodes].sort((a, b) => {
23
- if (a === EMPTY_CONTRACT_HASH) return -1;
24
- if (b === EMPTY_CONTRACT_HASH) return 1;
25
- return a.localeCompare(b);
26
- });
27
- }
28
- function longestPathDepths(nodes, candidates) {
29
- const depth = /* @__PURE__ */ new Map();
30
- for (const root of forwardRootsForDepth(nodes, candidates)) depth.set(root, 0);
31
- const maxPasses = nodes.size;
32
- for (let pass = 0; pass < maxPasses; pass++) {
33
- let changed = false;
34
- for (const edge of candidates) {
35
- const base = depth.get(edge.from);
36
- if (base === void 0) continue;
37
- const next = base + 1;
38
- if (next > (depth.get(edge.to) ?? -1)) {
39
- depth.set(edge.to, next);
40
- changed = true;
41
- }
42
- }
43
- if (!changed) break;
44
- }
45
- for (const node of nodes) if (!depth.has(node)) depth.set(node, 0);
46
- return depth;
47
- }
48
- function canReachForward(start, goal, candidates) {
49
- if (start === goal) return true;
50
- const outgoing = /* @__PURE__ */ new Map();
51
- for (const edge of candidates) {
52
- const bucket = outgoing.get(edge.from);
53
- if (bucket) bucket.push(edge.to);
54
- else outgoing.set(edge.from, [edge.to]);
55
- }
56
- const visited = new Set([start]);
57
- const queue = [start];
58
- while (queue.length > 0) {
59
- const node = queue.shift();
60
- if (node === void 0) continue;
61
- for (const next of outgoing.get(node) ?? []) {
62
- if (next === goal) return true;
63
- if (!visited.has(next)) {
64
- visited.add(next);
65
- queue.push(next);
66
- }
67
- }
68
- }
69
- return false;
70
- }
71
- function isMarginalForwardEdge(nodes, candidates, edge) {
72
- const depthWithout = longestPathDepths(nodes, candidates.filter((candidate) => candidate !== edge));
73
- const depthWith = longestPathDepths(nodes, candidates);
74
- const fromDepth = depthWithout.get(edge.from) ?? 0;
75
- return (depthWith.get(edge.to) ?? 0) > fromDepth;
76
- }
77
- function shouldPeelForwardEdge(nodes, candidates, edge) {
78
- const without = candidates.filter((candidate) => candidate !== edge);
79
- const depthWithout = longestPathDepths(nodes, without);
80
- const fromDepth = depthWithout.get(edge.from) ?? 0;
81
- const toWithout = depthWithout.get(edge.to) ?? 0;
82
- if (canReachForward(edge.to, edge.from, without) && fromDepth > toWithout + 1) return true;
83
- return !isMarginalForwardEdge(nodes, candidates, edge);
84
- }
85
- function peelNonMarginalForwardEdges(nodes, kindByMigrationHash, nonSelf) {
86
- let candidates = nonSelf.filter((edge) => kindByMigrationHash.get(edge.hash) === "forward");
87
- while (candidates.length > 0) {
88
- const rollbackCandidates = candidates.filter((edge) => shouldPeelForwardEdge(nodes, candidates, edge));
89
- if (rollbackCandidates.length === 0) break;
90
- rollbackCandidates.sort(compareDirNameDesc);
91
- const rollback = rollbackCandidates[0];
92
- if (rollback === void 0) break;
93
- kindByMigrationHash.set(rollback.hash, "rollback");
94
- candidates = candidates.filter((edge) => edge !== rollback);
95
- }
96
- }
97
- /**
98
- * DFS with dirName-descending traversal. A GRAY target is a rollback only when it
99
- * is the immediate DFS parent of the source — cross-links to other GRAY nodes
100
- * stay forward. A follow-up peel pass drops node-skipping rollbacks (target can
101
- * reach the source on the forward subgraph and sits more than one rank below).
102
- */
103
- function classifyNormalizedEdges(edges) {
104
- const nodes = /* @__PURE__ */ new Set();
105
- const kindByMigrationHash = /* @__PURE__ */ new Map();
106
- const outgoingByFrom = /* @__PURE__ */ new Map();
107
- const nonSelf = [];
108
- for (const edge of edges) {
109
- nodes.add(edge.from);
110
- nodes.add(edge.to);
111
- if (edge.from === edge.to) {
112
- kindByMigrationHash.set(edge.hash, "self");
113
- continue;
114
- }
115
- nonSelf.push(edge);
116
- const bucket = outgoingByFrom.get(edge.from);
117
- if (bucket) bucket.push(edge);
118
- else outgoingByFrom.set(edge.from, [edge]);
119
- }
120
- for (const bucket of outgoingByFrom.values()) bucket.sort(compareDirNameDesc);
121
- const nonSelfInDegree = /* @__PURE__ */ new Map();
122
- for (const node of nodes) nonSelfInDegree.set(node, 0);
123
- for (const bucket of outgoingByFrom.values()) for (const edge of bucket) bumpDegree(nonSelfInDegree, edge.to);
124
- const dfsRoots = [];
125
- for (const node of nodes) if ((nonSelfInDegree.get(node) ?? 0) === 0) dfsRoots.push(node);
126
- dfsRoots.sort((a, b) => {
127
- if (a === EMPTY_CONTRACT_HASH) return -1;
128
- if (b === EMPTY_CONTRACT_HASH) return 1;
129
- return a.localeCompare(b);
130
- });
131
- if (dfsRoots.length === 0) dfsRoots.push(...[...nodes].sort((a, b) => a.localeCompare(b)));
132
- const WHITE = 0;
133
- const GRAY = 1;
134
- const BLACK = 2;
135
- const color = /* @__PURE__ */ new Map();
136
- const dfsParent = /* @__PURE__ */ new Map();
137
- for (const node of nodes) color.set(node, WHITE);
138
- const stack = [];
139
- function isImmediateDfsParent(ancestor, node) {
140
- return dfsParent.get(node) === ancestor;
141
- }
142
- function pushFrame(node, parent) {
143
- color.set(node, GRAY);
144
- dfsParent.set(node, parent);
145
- stack.push({
146
- node,
147
- outgoing: outgoingByFrom.get(node) ?? [],
148
- index: 0
149
- });
150
- }
151
- function runDfsFrom(root) {
152
- if (color.get(root) !== WHITE) return;
153
- pushFrame(root, void 0);
154
- while (stack.length > 0) {
155
- const frame = stack[stack.length - 1];
156
- if (frame === void 0) break;
157
- if (frame.index >= frame.outgoing.length) {
158
- color.set(frame.node, BLACK);
159
- stack.pop();
160
- continue;
161
- }
162
- const edge = frame.outgoing[frame.index];
163
- frame.index += 1;
164
- if (edge === void 0) continue;
165
- const v = edge.to;
166
- const vColor = color.get(v);
167
- if (vColor === GRAY && isImmediateDfsParent(v, frame.node)) kindByMigrationHash.set(edge.hash, "rollback");
168
- else {
169
- kindByMigrationHash.set(edge.hash, "forward");
170
- if (vColor === WHITE) pushFrame(v, frame.node);
171
- }
172
- }
173
- }
174
- for (const root of dfsRoots) runDfsFrom(root);
175
- const remainingWhite = [...nodes].filter((node) => color.get(node) === WHITE);
176
- remainingWhite.sort((a, b) => a.localeCompare(b));
177
- for (const root of remainingWhite) runDfsFrom(root);
178
- peelNonMarginalForwardEdges(nodes, kindByMigrationHash, nonSelf);
179
- const forwardInDegree = /* @__PURE__ */ new Map();
180
- const forwardOutDegree = /* @__PURE__ */ new Map();
181
- for (const edge of edges) {
182
- if (kindByMigrationHash.get(edge.hash) !== "forward") continue;
183
- bumpDegree(forwardOutDegree, edge.from);
184
- bumpDegree(forwardInDegree, edge.to);
185
- }
186
- return {
187
- kindByMigrationHash,
188
- forwardInDegree,
189
- forwardOutDegree
190
- };
191
- }
192
- function canonicalFrom(from) {
193
- return from ?? EMPTY_CONTRACT_HASH;
194
- }
195
- /**
196
- * Classify forward/rollback/self for a Tier-2 `MigrationListEntry[]` edge set.
197
- * Returns the kind of each migration plus the forward in/out degree of each
198
- * contract node. This is the established Tier-2 surface; its behaviour is
199
- * unchanged — only its implementation now delegates to the shared classifier.
200
- */
201
- function classifyMigrationListGraphTopology(entries) {
202
- return classifyNormalizedEdges(entries.map((entry) => ({
203
- hash: entry.migrationHash,
204
- from: canonicalFrom(entry.from),
205
- to: entry.to,
206
- dirName: entry.dirName
207
- })));
208
- }
209
- /**
210
- * Classify forward/rollback/self for a `MigrationGraph` edge set (Tier-3).
211
- * Delegates to the same shared classifier as `classifyMigrationListGraphTopology`
212
- * so both tiers agree on forward/rollback/self without duplicating logic.
213
- */
214
- function classifyMigrationGraphTopology(graph) {
215
- const normalized = [];
216
- for (const edges of graph.forwardChain.values()) for (const edge of edges) normalized.push({
217
- hash: edge.migrationHash,
218
- from: edge.from,
219
- to: edge.to,
220
- dirName: edge.dirName
221
- });
222
- return classifyNormalizedEdges(normalized);
223
- }
224
- const MIGRATION_LIST_UNICODE_KIND_GLYPH = {
225
- forward: "*",
226
- rollback: "↩",
227
- self: "⟲"
228
- };
229
- const MIGRATION_LIST_ASCII_KIND_GLYPH = {
230
- forward: "*",
231
- rollback: "<",
232
- self: "~"
233
- };
234
- function migrationListKindGlyph(glyphMode, edgeKind) {
235
- return glyphMode === "ascii" ? MIGRATION_LIST_ASCII_KIND_GLYPH[edgeKind] : MIGRATION_LIST_UNICODE_KIND_GLYPH[edgeKind];
236
- }
237
- function migrationListForwardArrow(glyphMode) {
238
- return glyphMode === "ascii" ? "->" : "→";
239
- }
240
- function migrationListEmptySource(glyphMode) {
241
- return glyphMode === "ascii" ? "-" : "∅";
242
- }
243
- function abbreviateContractHash(hash) {
244
- return (hash.startsWith("sha256:") ? hash.slice(7) : hash).slice(0, 7);
245
- }
246
- function computeMigrationDirNameWidth(migrations) {
247
- if (migrations.length === 0) return 0;
248
- return Math.max(...migrations.map((entry) => entry.dirName.length)) + 2;
249
- }
250
- function formatSourceColumn(from, style, emptySource) {
251
- if (from === null) return style.glyph(emptySource) + " ".repeat(7 - emptySource.length);
252
- return style.sourceHash(abbreviateContractHash(from));
253
- }
254
- function formatDecorations(providedInvariants, refs, style) {
255
- const blocks = [];
256
- if (providedInvariants.length > 0) blocks.push(style.invariants(providedInvariants));
257
- if (refs.length > 0) blocks.push(style.refs(refs));
258
- if (blocks.length === 0) return "";
259
- return ` ${blocks.join(" ")}`;
260
- }
261
- function formatMigrationDataColumn(migration, options) {
262
- const { dirNameWidth, edgeKind, style, forwardArrow = "→", emptySource = "∅" } = options;
263
- const dirNamePadding = " ".repeat(Math.max(0, dirNameWidth - migration.dirName.length));
264
- const dirName = `${style.dirName(migration.dirName)}${dirNamePadding}`;
265
- const decorations = formatDecorations(migration.providedInvariants, migration.refs, style);
266
- if (edgeKind === "self") {
267
- const contractHash = migration.from ?? migration.to;
268
- return `${dirName}${style.sourceHash(abbreviateContractHash(contractHash))}${decorations}`;
269
- }
270
- return `${dirName}${formatSourceColumn(migration.from, style, emptySource)} ${style.glyph(forwardArrow)} ${style.destHash(abbreviateContractHash(migration.to))}${decorations}`;
271
- }
272
- //#endregion
273
- //#region src/utils/formatters/migration-list-render.ts
274
- const IDENTITY_MIGRATION_LIST_STYLER = {
275
- kind: (text) => text,
276
- dirName: (text) => text,
277
- sourceHash: (text) => text,
278
- destHash: (text) => text,
279
- glyph: (text) => text,
280
- lane: (text) => text,
281
- invariants: (ids) => `{${ids.join(", ")}}`,
282
- refs: (names) => `(${names.join(", ")})`,
283
- spaceHeading: (text) => text,
284
- summary: (text) => text,
285
- emptyState: (text) => text
286
- };
287
- function resolveEdgeKind(migrationHash, kindByMigrationHash) {
288
- return kindByMigrationHash.get(migrationHash) ?? "forward";
289
- }
290
- function formatMigrationRow(migration, dirNameWidth, edgeKind, glyphMode, style) {
291
- return `${`${style.kind(migrationListKindGlyph(glyphMode, edgeKind))} `}${formatMigrationDataColumn(migration, {
292
- dirNameWidth,
293
- edgeKind,
294
- style,
295
- forwardArrow: migrationListForwardArrow(glyphMode),
296
- emptySource: migrationListEmptySource(glyphMode)
297
- })}`;
298
- }
299
- function formatEmptyStateLine(spaceId, style) {
300
- return style.emptyState(`There are no migrations in migrations/${spaceId}/ yet`);
301
- }
302
- function renderSpaceBlock(spaceId, migrations, multiSpace, glyphMode, kindByMigrationHash, style) {
303
- if (migrations.length === 0) {
304
- const emptyLine = formatEmptyStateLine(spaceId, style);
305
- if (!multiSpace) return [emptyLine];
306
- return [style.spaceHeading(`${spaceId}:`), ` ${emptyLine}`];
307
- }
308
- const dirNameWidth = computeMigrationDirNameWidth(migrations);
309
- const rows = migrations.map((entry) => formatMigrationRow(entry, dirNameWidth, resolveEdgeKind(entry.migrationHash, kindByMigrationHash), glyphMode, style));
310
- if (!multiSpace) return rows;
311
- return [style.spaceHeading(`${spaceId}:`), ...rows.map((row) => ` ${row}`)];
312
- }
313
- function buildMigrationListTopologyBySpace(result) {
314
- const topologyBySpaceId = /* @__PURE__ */ new Map();
315
- for (const space of result.spaces) topologyBySpaceId.set(space.spaceId, classifyMigrationListGraphTopology(space.migrations));
316
- return topologyBySpaceId;
317
- }
318
- /**
319
- * Compose the styled `migration list` output. The renderer is
320
- * presentation-neutral — every token passes through `style` before
321
- * landing in the output, so the same composition serves the pure-text
322
- * path ({@link renderMigrationList} via
323
- * {@link IDENTITY_MIGRATION_LIST_STYLER}) and the ANSI-styled CLI path
324
- * (via the ANSI styler the CLI shell wires up).
325
- */
326
- function renderMigrationListWithStyle(result, style, glyphMode = "unicode", topologyBySpaceId = buildMigrationListTopologyBySpace(result)) {
327
- const multiSpace = result.spaces.length > 1;
328
- const lines = [];
329
- for (let index = 0; index < result.spaces.length; index++) {
330
- const space = result.spaces[index];
331
- if (index > 0) lines.push("");
332
- const kindByMigrationHash = topologyBySpaceId.get(space.spaceId)?.kindByMigrationHash ?? classifyMigrationListGraphTopology(space.migrations).kindByMigrationHash;
333
- lines.push(...renderSpaceBlock(space.spaceId, space.migrations, multiSpace, glyphMode, kindByMigrationHash, style));
334
- }
335
- if (result.spaces.reduce((count, space) => count + space.migrations.length, 0) > 0) {
336
- lines.push("");
337
- lines.push(style.summary(result.summary));
338
- }
339
- return lines.join("\n");
340
- }
341
- //#endregion
342
- //#region src/utils/formatters/migration-list-styler.ts
343
- /**
344
- * The current contract overlay marker. Unlike user refs, this names the user's
345
- * declared desired state — the implicit base/target for `plan` / `migrate` —
346
- * not a stored label. It is emphasized (bold) so it stands out from plain refs
347
- * (including the live-database `db` marker, which is just another ref).
348
- */
349
- const CONTRACT_MARKER_NAME = "contract";
350
- function styleRefName(name) {
351
- return name === "contract" ? bold(green(name)) : green(name);
352
- }
353
- /**
354
- * Build a {@link MigrationListStyler} that decorates `migration list`
355
- * tokens with ANSI SGR codes. When `useColor` is `false` (non-TTY,
356
- * `--no-color`, `NO_COLOR=1`, piped output) the function returns the
357
- * shared identity styler so callers get plain text with zero ANSI
358
- * bytes — pipe-friendly by construction.
359
- *
360
- * Palette:
361
- *
362
- * - `dirName`: bold
363
- * - `sourceHash`: dim cyan
364
- * - `destHash`: bright cyan
365
- * - `kind` (`*` / `↩` / `⟲`): bright — the signal; lanes and arrows dim
366
- * - `glyph` (`→` / `⟲` / `∅`): dim
367
- * - `lane` (graph gutter lines `│` and fan/join connectors `├─┐` / `├─┘`): dim
368
- * - `invariants` (`{...}`): yellow
369
- * - `refs` (`(...)`): green; the `contract` desired-state marker inside is
370
- * green-bold (the active ref is bolded separately by the tree styler)
371
- * - `spaceHeading` (`<spaceId>:`): bold
372
- * - `summary`: dim
373
- * - `emptyState`: dim
374
- */
375
- function createAnsiMigrationListStyler(opts) {
376
- if (!opts.useColor) return IDENTITY_MIGRATION_LIST_STYLER;
377
- return {
378
- kind: (text) => text,
379
- dirName: (text) => bold(text),
380
- sourceHash: (text) => dim(cyan(text)),
381
- destHash: (text) => cyanBright(text),
382
- glyph: (text) => dim(text),
383
- lane: (text) => dim(text),
384
- invariants: (ids) => yellow(`{${ids.join(", ")}}`),
385
- refs: (names) => {
386
- const open = green("(");
387
- const close = green(")");
388
- const separator = green(", ");
389
- return open + names.map(styleRefName).join(separator) + close;
390
- },
391
- spaceHeading: (text) => bold(text),
392
- summary: (text) => dim(text),
393
- emptyState: (text) => dim(text)
394
- };
395
- }
396
- //#endregion
397
- export { migrationListEmptySource as a, renderMigrationListWithStyle as i, createAnsiMigrationListStyler as n, migrationListForwardArrow as o, buildMigrationListTopologyBySpace as r, classifyMigrationGraphTopology as s, CONTRACT_MARKER_NAME as t };
398
-
399
- //# sourceMappingURL=migration-list-styler-BRwF4-gy.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-list-styler-BRwF4-gy.mjs","names":[],"sources":["../src/utils/formatters/migration-list-graph-topology.ts","../src/utils/formatters/migration-list-data-column.ts","../src/utils/formatters/migration-list-render.ts","../src/utils/formatters/migration-list-styler.ts"],"sourcesContent":["import { EMPTY_CONTRACT_HASH } from '@prisma-next/migration-tools/constants';\nimport type { MigrationGraph } from '@prisma-next/migration-tools/graph';\nimport type { MigrationListEntry } from './migration-list-types';\n\nexport type MigrationEdgeKind = 'forward' | 'rollback' | 'self';\n\nexport interface MigrationListGraphTopology {\n readonly kindByMigrationHash: ReadonlyMap<string, MigrationEdgeKind>;\n readonly forwardInDegree: ReadonlyMap<string, number>;\n readonly forwardOutDegree: ReadonlyMap<string, number>;\n}\n\n// ---------------------------------------------------------------------------\n// Shared classifier — operates on a normalized edge shape common to both\n// MigrationListEntry (Tier-2) and MigrationEdge / MigrationGraph (Tier-3).\n// ---------------------------------------------------------------------------\n\ninterface NormalizedEdge {\n readonly hash: string;\n readonly from: string;\n readonly to: string;\n readonly dirName: string;\n}\n\nfunction compareDirNameDesc(a: NormalizedEdge, b: NormalizedEdge): number {\n return b.dirName.localeCompare(a.dirName);\n}\n\nfunction bumpDegree(map: Map<string, number>, key: string): void {\n map.set(key, (map.get(key) ?? 0) + 1);\n}\n\nfunction forwardRootsForDepth(\n nodes: ReadonlySet<string>,\n candidates: readonly NormalizedEdge[],\n): readonly string[] {\n const inDegree = new Map<string, number>();\n for (const node of nodes) {\n inDegree.set(node, 0);\n }\n for (const edge of candidates) {\n bumpDegree(inDegree, edge.to);\n }\n\n const roots: string[] = [];\n for (const node of nodes) {\n if ((inDegree.get(node) ?? 0) === 0) {\n roots.push(node);\n }\n }\n roots.sort((a, b) => {\n if (a === EMPTY_CONTRACT_HASH) return -1;\n if (b === EMPTY_CONTRACT_HASH) return 1;\n return a.localeCompare(b);\n });\n if (roots.length > 0) return roots;\n\n return [...nodes].sort((a, b) => {\n if (a === EMPTY_CONTRACT_HASH) return -1;\n if (b === EMPTY_CONTRACT_HASH) return 1;\n return a.localeCompare(b);\n });\n}\n\nfunction longestPathDepths(\n nodes: ReadonlySet<string>,\n candidates: readonly NormalizedEdge[],\n): Map<string, number> {\n const depth = new Map<string, number>();\n for (const root of forwardRootsForDepth(nodes, candidates)) {\n depth.set(root, 0);\n }\n\n const maxPasses = nodes.size;\n for (let pass = 0; pass < maxPasses; pass++) {\n let changed = false;\n for (const edge of candidates) {\n const base = depth.get(edge.from);\n if (base === undefined) continue;\n const next = base + 1;\n if (next > (depth.get(edge.to) ?? -1)) {\n depth.set(edge.to, next);\n changed = true;\n }\n }\n if (!changed) break;\n }\n\n for (const node of nodes) {\n if (!depth.has(node)) {\n depth.set(node, 0);\n }\n }\n\n return depth;\n}\n\nfunction canReachForward(\n start: string,\n goal: string,\n candidates: readonly NormalizedEdge[],\n): boolean {\n if (start === goal) return true;\n\n const outgoing = new Map<string, string[]>();\n for (const edge of candidates) {\n const bucket = outgoing.get(edge.from);\n if (bucket) bucket.push(edge.to);\n else outgoing.set(edge.from, [edge.to]);\n }\n\n const visited = new Set<string>([start]);\n const queue = [start];\n while (queue.length > 0) {\n const node = queue.shift();\n if (node === undefined) continue;\n for (const next of outgoing.get(node) ?? []) {\n if (next === goal) return true;\n if (!visited.has(next)) {\n visited.add(next);\n queue.push(next);\n }\n }\n }\n\n return false;\n}\n\nfunction isMarginalForwardEdge(\n nodes: ReadonlySet<string>,\n candidates: readonly NormalizedEdge[],\n edge: NormalizedEdge,\n): boolean {\n const without = candidates.filter((candidate) => candidate !== edge);\n const depthWithout = longestPathDepths(nodes, without);\n const depthWith = longestPathDepths(nodes, candidates);\n const fromDepth = depthWithout.get(edge.from) ?? 0;\n const toWith = depthWith.get(edge.to) ?? 0;\n return toWith > fromDepth;\n}\n\n// The first branch is the load-bearing one: a forward edge `from → to` is a\n// disguised node-skipping rollback when, after removing it, `to` can still\n// reach `from` and `from` sits strictly deeper than `to + 1` (a longer path\n// already connects them). This branch fires on every cycle-closing edge, and\n// the caller peels exactly one edge (dirName-max) per iteration before\n// recomputing — so cycles are broken deterministically regardless of edge\n// order. `isMarginalForwardEdge` is only a fallback for the residual case and\n// is reached only while the candidate set is still cyclic.\nfunction shouldPeelForwardEdge(\n nodes: ReadonlySet<string>,\n candidates: readonly NormalizedEdge[],\n edge: NormalizedEdge,\n): boolean {\n const without = candidates.filter((candidate) => candidate !== edge);\n const depthWithout = longestPathDepths(nodes, without);\n const fromDepth = depthWithout.get(edge.from) ?? 0;\n const toWithout = depthWithout.get(edge.to) ?? 0;\n\n if (canReachForward(edge.to, edge.from, without) && fromDepth > toWithout + 1) {\n return true;\n }\n\n return !isMarginalForwardEdge(nodes, candidates, edge);\n}\n\nfunction peelNonMarginalForwardEdges(\n nodes: ReadonlySet<string>,\n kindByMigrationHash: Map<string, MigrationEdgeKind>,\n nonSelf: readonly NormalizedEdge[],\n): void {\n let candidates = nonSelf.filter((edge) => kindByMigrationHash.get(edge.hash) === 'forward');\n\n while (candidates.length > 0) {\n const rollbackCandidates = candidates.filter((edge) =>\n shouldPeelForwardEdge(nodes, candidates, edge),\n );\n if (rollbackCandidates.length === 0) break;\n\n rollbackCandidates.sort(compareDirNameDesc);\n const rollback = rollbackCandidates[0];\n if (rollback === undefined) break;\n\n kindByMigrationHash.set(rollback.hash, 'rollback');\n candidates = candidates.filter((edge) => edge !== rollback);\n }\n}\n\n/**\n * DFS with dirName-descending traversal. A GRAY target is a rollback only when it\n * is the immediate DFS parent of the source — cross-links to other GRAY nodes\n * stay forward. A follow-up peel pass drops node-skipping rollbacks (target can\n * reach the source on the forward subgraph and sits more than one rank below).\n */\nfunction classifyNormalizedEdges(edges: readonly NormalizedEdge[]): MigrationListGraphTopology {\n const nodes = new Set<string>();\n const kindByMigrationHash = new Map<string, MigrationEdgeKind>();\n const outgoingByFrom = new Map<string, NormalizedEdge[]>();\n const nonSelf: NormalizedEdge[] = [];\n\n for (const edge of edges) {\n nodes.add(edge.from);\n nodes.add(edge.to);\n\n if (edge.from === edge.to) {\n kindByMigrationHash.set(edge.hash, 'self');\n continue;\n }\n\n nonSelf.push(edge);\n const bucket = outgoingByFrom.get(edge.from);\n if (bucket) bucket.push(edge);\n else outgoingByFrom.set(edge.from, [edge]);\n }\n\n for (const bucket of outgoingByFrom.values()) {\n bucket.sort(compareDirNameDesc);\n }\n\n const nonSelfInDegree = new Map<string, number>();\n for (const node of nodes) {\n nonSelfInDegree.set(node, 0);\n }\n for (const bucket of outgoingByFrom.values()) {\n for (const edge of bucket) {\n bumpDegree(nonSelfInDegree, edge.to);\n }\n }\n\n const dfsRoots: string[] = [];\n for (const node of nodes) {\n if ((nonSelfInDegree.get(node) ?? 0) === 0) {\n dfsRoots.push(node);\n }\n }\n dfsRoots.sort((a, b) => {\n if (a === EMPTY_CONTRACT_HASH) return -1;\n if (b === EMPTY_CONTRACT_HASH) return 1;\n return a.localeCompare(b);\n });\n if (dfsRoots.length === 0) {\n dfsRoots.push(...[...nodes].sort((a, b) => a.localeCompare(b)));\n }\n\n const WHITE = 0;\n const GRAY = 1;\n const BLACK = 2;\n const color = new Map<string, number>();\n const dfsParent = new Map<string, string | undefined>();\n for (const node of nodes) {\n color.set(node, WHITE);\n }\n\n interface Frame {\n node: string;\n outgoing: readonly NormalizedEdge[];\n index: number;\n }\n const stack: Frame[] = [];\n\n function isImmediateDfsParent(ancestor: string, node: string): boolean {\n return dfsParent.get(node) === ancestor;\n }\n\n function pushFrame(node: string, parent: string | undefined): void {\n color.set(node, GRAY);\n dfsParent.set(node, parent);\n stack.push({ node, outgoing: outgoingByFrom.get(node) ?? [], index: 0 });\n }\n\n function runDfsFrom(root: string): void {\n if (color.get(root) !== WHITE) return;\n pushFrame(root, undefined);\n\n while (stack.length > 0) {\n const frame = stack[stack.length - 1];\n if (frame === undefined) break;\n if (frame.index >= frame.outgoing.length) {\n color.set(frame.node, BLACK);\n stack.pop();\n continue;\n }\n\n const edge = frame.outgoing[frame.index];\n frame.index += 1;\n if (edge === undefined) continue;\n\n const v = edge.to;\n const vColor = color.get(v);\n if (vColor === GRAY && isImmediateDfsParent(v, frame.node)) {\n kindByMigrationHash.set(edge.hash, 'rollback');\n } else {\n kindByMigrationHash.set(edge.hash, 'forward');\n if (vColor === WHITE) {\n pushFrame(v, frame.node);\n }\n }\n }\n }\n\n for (const root of dfsRoots) {\n runDfsFrom(root);\n }\n const remainingWhite = [...nodes].filter((node) => color.get(node) === WHITE);\n remainingWhite.sort((a, b) => a.localeCompare(b));\n for (const root of remainingWhite) {\n runDfsFrom(root);\n }\n\n peelNonMarginalForwardEdges(nodes, kindByMigrationHash, nonSelf);\n\n const forwardInDegree = new Map<string, number>();\n const forwardOutDegree = new Map<string, number>();\n\n for (const edge of edges) {\n if (kindByMigrationHash.get(edge.hash) !== 'forward') continue;\n bumpDegree(forwardOutDegree, edge.from);\n bumpDegree(forwardInDegree, edge.to);\n }\n\n return {\n kindByMigrationHash,\n forwardInDegree,\n forwardOutDegree,\n };\n}\n\nfunction canonicalFrom(from: string | null): string {\n return from ?? EMPTY_CONTRACT_HASH;\n}\n\n/**\n * Classify forward/rollback/self for a Tier-2 `MigrationListEntry[]` edge set.\n * Returns the kind of each migration plus the forward in/out degree of each\n * contract node. This is the established Tier-2 surface; its behaviour is\n * unchanged — only its implementation now delegates to the shared classifier.\n */\nexport function classifyMigrationListGraphTopology(\n entries: readonly MigrationListEntry[],\n): MigrationListGraphTopology {\n const normalized: NormalizedEdge[] = entries.map((entry) => ({\n hash: entry.migrationHash,\n from: canonicalFrom(entry.from),\n to: entry.to,\n dirName: entry.dirName,\n }));\n return classifyNormalizedEdges(normalized);\n}\n\n/**\n * Classify forward/rollback/self for a `MigrationGraph` edge set (Tier-3).\n * Delegates to the same shared classifier as `classifyMigrationListGraphTopology`\n * so both tiers agree on forward/rollback/self without duplicating logic.\n */\nexport function classifyMigrationGraphTopology(graph: MigrationGraph): MigrationListGraphTopology {\n const normalized: NormalizedEdge[] = [];\n for (const edges of graph.forwardChain.values()) {\n for (const edge of edges) {\n normalized.push({\n hash: edge.migrationHash,\n from: edge.from,\n to: edge.to,\n dirName: edge.dirName,\n });\n }\n }\n return classifyNormalizedEdges(normalized);\n}\n","import type { GlyphMode } from '../glyph-mode';\nimport type { MigrationEdgeKind } from './migration-list-graph-topology';\nimport type { MigrationListStyler } from './migration-list-render';\nimport type { MigrationListEntry } from './migration-list-types';\n\nexport const MIGRATION_LIST_HASH_WIDTH = 7;\nexport const MIGRATION_LIST_EMPTY_SOURCE = '∅';\nexport const MIGRATION_LIST_ASCII_EMPTY_SOURCE = '-';\nexport const MIGRATION_LIST_FORWARD_EDGE_GLYPH = '→';\nexport const MIGRATION_LIST_ASCII_FORWARD_EDGE_GLYPH = '->';\nexport const MIGRATION_LIST_DECORATION_PREFIX = ' ';\n\nexport const MIGRATION_LIST_UNICODE_KIND_GLYPH: Record<MigrationEdgeKind, string> = {\n forward: '*',\n rollback: '↩',\n self: '⟲',\n};\n\nexport const MIGRATION_LIST_ASCII_KIND_GLYPH: Record<MigrationEdgeKind, string> = {\n forward: '*',\n rollback: '<',\n self: '~',\n};\n\nexport function migrationListKindGlyph(glyphMode: GlyphMode, edgeKind: MigrationEdgeKind): string {\n return glyphMode === 'ascii'\n ? MIGRATION_LIST_ASCII_KIND_GLYPH[edgeKind]\n : MIGRATION_LIST_UNICODE_KIND_GLYPH[edgeKind];\n}\n\nexport function migrationListForwardArrow(glyphMode: GlyphMode): string {\n return glyphMode === 'ascii'\n ? MIGRATION_LIST_ASCII_FORWARD_EDGE_GLYPH\n : MIGRATION_LIST_FORWARD_EDGE_GLYPH;\n}\n\nexport function migrationListEmptySource(glyphMode: GlyphMode): string {\n return glyphMode === 'ascii' ? MIGRATION_LIST_ASCII_EMPTY_SOURCE : MIGRATION_LIST_EMPTY_SOURCE;\n}\n\nexport function abbreviateContractHash(hash: string): string {\n const stripped = hash.startsWith('sha256:') ? hash.slice(7) : hash;\n return stripped.slice(0, MIGRATION_LIST_HASH_WIDTH);\n}\n\nexport function computeMigrationDirNameWidth(migrations: readonly MigrationListEntry[]): number {\n if (migrations.length === 0) return 0;\n return Math.max(...migrations.map((entry) => entry.dirName.length)) + 2;\n}\n\nfunction formatSourceColumn(\n from: string | null,\n style: MigrationListStyler,\n emptySource: string,\n): string {\n if (from === null) {\n return style.glyph(emptySource) + ' '.repeat(MIGRATION_LIST_HASH_WIDTH - emptySource.length);\n }\n return style.sourceHash(abbreviateContractHash(from));\n}\n\nexport function formatDecorations(\n providedInvariants: readonly string[],\n refs: readonly string[],\n style: MigrationListStyler,\n): string {\n const blocks: string[] = [];\n if (providedInvariants.length > 0) {\n blocks.push(style.invariants(providedInvariants));\n }\n if (refs.length > 0) {\n blocks.push(style.refs(refs));\n }\n if (blocks.length === 0) return '';\n return `${MIGRATION_LIST_DECORATION_PREFIX}${blocks.join(' ')}`;\n}\n\nexport interface MigrationDataColumnOptions {\n readonly dirNameWidth: number;\n readonly edgeKind: MigrationEdgeKind;\n readonly style: MigrationListStyler;\n readonly forwardArrow?: string;\n readonly emptySource?: string;\n}\n\nexport function formatMigrationDataColumn(\n migration: MigrationListEntry,\n options: MigrationDataColumnOptions,\n): string {\n const {\n dirNameWidth,\n edgeKind,\n style,\n forwardArrow = MIGRATION_LIST_FORWARD_EDGE_GLYPH,\n emptySource = MIGRATION_LIST_EMPTY_SOURCE,\n } = options;\n const dirNamePadding = ' '.repeat(Math.max(0, dirNameWidth - migration.dirName.length));\n const dirName = `${style.dirName(migration.dirName)}${dirNamePadding}`;\n const decorations = formatDecorations(migration.providedInvariants, migration.refs, style);\n\n if (edgeKind === 'self') {\n const contractHash = migration.from ?? migration.to;\n const hash = style.sourceHash(abbreviateContractHash(contractHash));\n return `${dirName}${hash}${decorations}`;\n }\n\n const source = formatSourceColumn(migration.from, style, emptySource);\n const arrow = style.glyph(forwardArrow);\n const dest = style.destHash(abbreviateContractHash(migration.to));\n return `${dirName}${source} ${arrow} ${dest}${decorations}`;\n}\n\nexport function formatNodeLineDataColumn(contractHash: string, style: MigrationListStyler): string {\n return style.sourceHash(abbreviateContractHash(contractHash));\n}\n","import type { GlyphMode } from '../glyph-mode';\nimport {\n computeMigrationDirNameWidth,\n formatMigrationDataColumn,\n migrationListEmptySource,\n migrationListForwardArrow,\n migrationListKindGlyph,\n} from './migration-list-data-column';\nimport {\n classifyMigrationListGraphTopology,\n type MigrationEdgeKind,\n type MigrationListGraphTopology,\n} from './migration-list-graph-topology';\nimport type { MigrationListEntry, MigrationListResult } from './migration-list-types';\n\nexport type { GlyphMode } from '../glyph-mode';\nexport type { MigrationEdgeKind } from './migration-list-graph-topology';\nexport type {\n MigrationListEntry,\n MigrationListResult,\n MigrationSpaceListEntry,\n} from './migration-list-types';\n\n/**\n * Semantic styler for `migration list` output tokens. Token-typed so\n * the renderer composes presentation-neutral fragments and the styler\n * decides how each token kind is decorated (ANSI codes, plain text,\n * etc.). The renderer pads with raw spaces *outside* styled tokens so\n * visible column widths stay stable regardless of what the styler\n * emits — adding ANSI escape sequences never disturbs alignment.\n *\n * `invariants` and `refs` receive the underlying string arrays rather\n * than a pre-joined string so per-element styling (e.g. distinguishing\n * the live-DB `db` marker from user-named refs) is possible without\n * having to re-parse a joined block.\n */\nexport interface MigrationListStyler {\n kind(text: string): string;\n dirName(text: string): string;\n sourceHash(text: string): string;\n destHash(text: string): string;\n glyph(text: string): string;\n lane(text: string): string;\n invariants(ids: readonly string[]): string;\n refs(names: readonly string[]): string;\n spaceHeading(text: string): string;\n summary(text: string): string;\n emptyState(text: string): string;\n}\n\nexport const IDENTITY_MIGRATION_LIST_STYLER: MigrationListStyler = {\n kind: (text) => text,\n dirName: (text) => text,\n sourceHash: (text) => text,\n destHash: (text) => text,\n glyph: (text) => text,\n lane: (text) => text,\n invariants: (ids) => `{${ids.join(', ')}}`,\n refs: (names) => `(${names.join(', ')})`,\n spaceHeading: (text) => text,\n summary: (text) => text,\n emptyState: (text) => text,\n};\n\nfunction resolveEdgeKind(\n migrationHash: string,\n kindByMigrationHash: ReadonlyMap<string, MigrationEdgeKind>,\n): MigrationEdgeKind {\n return kindByMigrationHash.get(migrationHash) ?? 'forward';\n}\n\nfunction formatMigrationRow(\n migration: MigrationListEntry,\n dirNameWidth: number,\n edgeKind: MigrationEdgeKind,\n glyphMode: GlyphMode,\n style: MigrationListStyler,\n): string {\n const kindColumn = `${style.kind(migrationListKindGlyph(glyphMode, edgeKind))} `;\n const data = formatMigrationDataColumn(migration, {\n dirNameWidth,\n edgeKind,\n style,\n forwardArrow: migrationListForwardArrow(glyphMode),\n emptySource: migrationListEmptySource(glyphMode),\n });\n return `${kindColumn}${data}`;\n}\n\nfunction formatEmptyStateLine(spaceId: string, style: MigrationListStyler): string {\n return style.emptyState(`There are no migrations in migrations/${spaceId}/ yet`);\n}\n\nfunction renderSpaceBlock(\n spaceId: string,\n migrations: readonly MigrationListEntry[],\n multiSpace: boolean,\n glyphMode: GlyphMode,\n kindByMigrationHash: ReadonlyMap<string, MigrationEdgeKind>,\n style: MigrationListStyler,\n): readonly string[] {\n if (migrations.length === 0) {\n const emptyLine = formatEmptyStateLine(spaceId, style);\n if (!multiSpace) {\n return [emptyLine];\n }\n return [style.spaceHeading(`${spaceId}:`), ` ${emptyLine}`];\n }\n\n const dirNameWidth = computeMigrationDirNameWidth(migrations);\n const rows = migrations.map((entry) =>\n formatMigrationRow(\n entry,\n dirNameWidth,\n resolveEdgeKind(entry.migrationHash, kindByMigrationHash),\n glyphMode,\n style,\n ),\n );\n if (!multiSpace) {\n return rows;\n }\n return [style.spaceHeading(`${spaceId}:`), ...rows.map((row) => ` ${row}`)];\n}\n\nexport function buildMigrationListTopologyBySpace(\n result: MigrationListResult,\n): ReadonlyMap<string, MigrationListGraphTopology> {\n const topologyBySpaceId = new Map<string, MigrationListGraphTopology>();\n for (const space of result.spaces) {\n topologyBySpaceId.set(space.spaceId, classifyMigrationListGraphTopology(space.migrations));\n }\n return topologyBySpaceId;\n}\n\n/**\n * Compose the styled `migration list` output. The renderer is\n * presentation-neutral — every token passes through `style` before\n * landing in the output, so the same composition serves the pure-text\n * path ({@link renderMigrationList} via\n * {@link IDENTITY_MIGRATION_LIST_STYLER}) and the ANSI-styled CLI path\n * (via the ANSI styler the CLI shell wires up).\n */\nexport function renderMigrationListWithStyle(\n result: MigrationListResult,\n style: MigrationListStyler,\n glyphMode: GlyphMode = 'unicode',\n topologyBySpaceId: ReadonlyMap<\n string,\n MigrationListGraphTopology\n > = buildMigrationListTopologyBySpace(result),\n): string {\n const multiSpace = result.spaces.length > 1;\n const lines: string[] = [];\n\n for (let index = 0; index < result.spaces.length; index++) {\n const space = result.spaces[index]!;\n if (index > 0) {\n lines.push('');\n }\n const topology = topologyBySpaceId.get(space.spaceId);\n const kindByMigrationHash =\n topology?.kindByMigrationHash ??\n classifyMigrationListGraphTopology(space.migrations).kindByMigrationHash;\n lines.push(\n ...renderSpaceBlock(\n space.spaceId,\n space.migrations,\n multiSpace,\n glyphMode,\n kindByMigrationHash,\n style,\n ),\n );\n }\n\n const totalMigrations = result.spaces.reduce(\n (count, space) => count + space.migrations.length,\n 0,\n );\n if (totalMigrations > 0) {\n lines.push('');\n lines.push(style.summary(result.summary));\n }\n\n return lines.join('\\n');\n}\n\nexport function renderMigrationList(result: MigrationListResult): string {\n return renderMigrationListWithStyle(result, IDENTITY_MIGRATION_LIST_STYLER);\n}\n","import { bold, cyan, cyanBright, dim, green, yellow } from 'colorette';\nimport { IDENTITY_MIGRATION_LIST_STYLER, type MigrationListStyler } from './migration-list-render';\n\n/**\n * The current contract overlay marker. Unlike user refs, this names the user's\n * declared desired state — the implicit base/target for `plan` / `migrate` —\n * not a stored label. It is emphasized (bold) so it stands out from plain refs\n * (including the live-database `db` marker, which is just another ref).\n */\nexport const CONTRACT_MARKER_NAME = 'contract';\n\nfunction styleRefName(name: string): string {\n return name === CONTRACT_MARKER_NAME ? bold(green(name)) : green(name);\n}\n\n/**\n * Build a {@link MigrationListStyler} that decorates `migration list`\n * tokens with ANSI SGR codes. When `useColor` is `false` (non-TTY,\n * `--no-color`, `NO_COLOR=1`, piped output) the function returns the\n * shared identity styler so callers get plain text with zero ANSI\n * bytes — pipe-friendly by construction.\n *\n * Palette:\n *\n * - `dirName`: bold\n * - `sourceHash`: dim cyan\n * - `destHash`: bright cyan\n * - `kind` (`*` / `↩` / `⟲`): bright — the signal; lanes and arrows dim\n * - `glyph` (`→` / `⟲` / `∅`): dim\n * - `lane` (graph gutter lines `│` and fan/join connectors `├─┐` / `├─┘`): dim\n * - `invariants` (`{...}`): yellow\n * - `refs` (`(...)`): green; the `contract` desired-state marker inside is\n * green-bold (the active ref is bolded separately by the tree styler)\n * - `spaceHeading` (`<spaceId>:`): bold\n * - `summary`: dim\n * - `emptyState`: dim\n */\nexport function createAnsiMigrationListStyler(opts: {\n readonly useColor: boolean;\n}): MigrationListStyler {\n if (!opts.useColor) {\n return IDENTITY_MIGRATION_LIST_STYLER;\n }\n return {\n // Kind glyphs stay bright in both flat and graph views; lanes carry the dim gutter.\n kind: (text) => text,\n dirName: (text) => bold(text),\n sourceHash: (text) => dim(cyan(text)),\n destHash: (text) => cyanBright(text),\n glyph: (text) => dim(text),\n lane: (text) => dim(text),\n invariants: (ids) => yellow(`{${ids.join(', ')}}`),\n refs: (names) => {\n const open = green('(');\n const close = green(')');\n const separator = green(', ');\n return open + names.map(styleRefName).join(separator) + close;\n },\n spaceHeading: (text) => bold(text),\n summary: (text) => dim(text),\n emptyState: (text) => dim(text),\n };\n}\n"],"mappings":";;;AAwBA,SAAS,mBAAmB,GAAmB,GAA2B;CACxE,OAAO,EAAE,QAAQ,cAAc,EAAE,OAAO;AAC1C;AAEA,SAAS,WAAW,KAA0B,KAAmB;CAC/D,IAAI,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC;AACtC;AAEA,SAAS,qBACP,OACA,YACmB;CACnB,MAAM,2BAAW,IAAI,IAAoB;CACzC,KAAK,MAAM,QAAQ,OACjB,SAAS,IAAI,MAAM,CAAC;CAEtB,KAAK,MAAM,QAAQ,YACjB,WAAW,UAAU,KAAK,EAAE;CAG9B,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,QAAQ,OACjB,KAAK,SAAS,IAAI,IAAI,KAAK,OAAO,GAChC,MAAM,KAAK,IAAI;CAGnB,MAAM,MAAM,GAAG,MAAM;EACnB,IAAI,MAAM,qBAAqB,OAAO;EACtC,IAAI,MAAM,qBAAqB,OAAO;EACtC,OAAO,EAAE,cAAc,CAAC;CAC1B,CAAC;CACD,IAAI,MAAM,SAAS,GAAG,OAAO;CAE7B,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,MAAM;EAC/B,IAAI,MAAM,qBAAqB,OAAO;EACtC,IAAI,MAAM,qBAAqB,OAAO;EACtC,OAAO,EAAE,cAAc,CAAC;CAC1B,CAAC;AACH;AAEA,SAAS,kBACP,OACA,YACqB;CACrB,MAAM,wBAAQ,IAAI,IAAoB;C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AAS,IAAI,IAAI;CAChC;AACF"}
@@ -1,15 +0,0 @@
1
- //#region src/utils/migration-types.d.ts
2
- interface StatusRef {
3
- readonly name: string;
4
- readonly hash: string;
5
- readonly active: boolean;
6
- }
7
- interface StatusDiagnostic {
8
- readonly code: string;
9
- readonly severity: 'warn' | 'info';
10
- readonly message: string;
11
- readonly hints: readonly string[];
12
- }
13
- //#endregion
14
- export { StatusRef as n, StatusDiagnostic as t };
15
- //# sourceMappingURL=migration-types-D2FW63pr.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-types-D2FW63pr.d.mts","names":[],"sources":["../src/utils/migration-types.ts"],"mappings":";UAAiB,SAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAGM,gBAAA;EAAA,SACN,IAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,KAAA;AAAA"}