prisma-next 0.11.0-dev.5 → 0.11.0-dev.51
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/dist/cli-errors-DFF1LlfU.mjs +215 -0
- package/dist/cli-errors-DFF1LlfU.mjs.map +1 -0
- package/dist/cli.mjs +9 -10
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-oXO2WCPD.mjs → client-5uvDppD8.mjs} +23 -21
- package/dist/client-5uvDppD8.mjs.map +1 -0
- package/dist/{command-helpers-DtavI0wJ.mjs → command-helpers-4UNsRRc4.mjs} +427 -9
- package/dist/command-helpers-4UNsRRc4.mjs.map +1 -0
- package/dist/commands/contract-emit.d.mts.map +1 -1
- package/dist/commands/contract-emit.mjs +1 -1
- package/dist/commands/contract-infer.d.mts.map +1 -1
- package/dist/commands/contract-infer.mjs +1 -1
- package/dist/commands/db-init.d.mts.map +1 -1
- package/dist/commands/db-init.mjs +33 -7
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.d.mts.map +1 -1
- package/dist/commands/db-schema.mjs +3 -4
- package/dist/commands/db-schema.mjs.map +1 -1
- package/dist/commands/db-sign.d.mts.map +1 -1
- package/dist/commands/db-sign.mjs +6 -7
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.d.mts.map +1 -1
- package/dist/commands/db-update.mjs +36 -8
- package/dist/commands/db-update.mjs.map +1 -1
- package/dist/commands/db-verify.d.mts.map +1 -1
- package/dist/commands/db-verify.mjs +1 -1
- package/dist/commands/migrate.d.mts +5 -1
- package/dist/commands/migrate.d.mts.map +1 -1
- package/dist/commands/migrate.mjs +79 -39
- package/dist/commands/migrate.mjs.map +1 -1
- package/dist/commands/migration-check.d.mts +4 -3
- package/dist/commands/migration-check.d.mts.map +1 -1
- package/dist/commands/migration-check.mjs +1 -280
- package/dist/commands/migration-graph.d.mts +1 -1
- package/dist/commands/migration-graph.d.mts.map +1 -1
- package/dist/commands/migration-graph.mjs +3 -4
- package/dist/commands/migration-graph.mjs.map +1 -1
- package/dist/commands/migration-list.d.mts +63 -12
- package/dist/commands/migration-list.d.mts.map +1 -1
- package/dist/commands/migration-list.mjs +2 -103
- package/dist/commands/migration-log.d.mts.map +1 -1
- package/dist/commands/migration-log.mjs +3 -4
- package/dist/commands/migration-log.mjs.map +1 -1
- package/dist/commands/migration-new.d.mts.map +1 -1
- package/dist/commands/migration-new.mjs +33 -38
- package/dist/commands/migration-new.mjs.map +1 -1
- package/dist/commands/migration-plan.d.mts +2 -1
- package/dist/commands/migration-plan.d.mts.map +1 -1
- package/dist/commands/migration-plan.mjs +1 -1
- package/dist/commands/migration-show.d.mts +4 -55
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +62 -153
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +5 -40
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +93 -67
- package/dist/commands/migration-status.mjs.map +1 -1
- package/dist/commands/ref.d.mts +1 -1
- package/dist/commands/ref.d.mts.map +1 -1
- package/dist/commands/ref.mjs +34 -9
- package/dist/commands/ref.mjs.map +1 -1
- package/dist/config-loader-B6sJjXTv.mjs.map +1 -1
- package/dist/config-loader.d.mts.map +1 -1
- package/dist/{contract-emit-o-8VmdQX.mjs → contract-emit-C-CFGZsI.mjs} +9 -6
- package/dist/{contract-emit-o-8VmdQX.mjs.map → contract-emit-C-CFGZsI.mjs.map} +1 -1
- package/dist/{contract-emit-CmsklifJ.mjs → contract-emit-CuUzzM46.mjs} +5 -6
- package/dist/{contract-emit-CmsklifJ.mjs.map → contract-emit-CuUzzM46.mjs.map} +1 -1
- package/dist/{contract-enrichment-Dani0mMW.mjs → contract-enrichment-XmUPhmsS.mjs} +4 -25
- package/dist/contract-enrichment-XmUPhmsS.mjs.map +1 -0
- package/dist/{contract-infer-pKkiCt7C.mjs → contract-infer-C98ZaRhp.mjs} +3 -4
- package/dist/{contract-infer-pKkiCt7C.mjs.map → contract-infer-C98ZaRhp.mjs.map} +1 -1
- package/dist/contract-space-aggregate-loader-CVHGuA35.mjs +170 -0
- package/dist/contract-space-aggregate-loader-CVHGuA35.mjs.map +1 -0
- package/dist/{db-verify-AoIUriL4.mjs → db-verify-BWl1Yxi-.mjs} +6 -7
- package/dist/{db-verify-AoIUriL4.mjs.map → db-verify-BWl1Yxi-.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +1 -1
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +3 -3
- package/dist/exports/index.d.mts.map +1 -1
- package/dist/exports/index.mjs +1 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/init-output.d.mts.map +1 -1
- package/dist/exports/init-output.mjs +1 -1
- package/dist/extension-pack-inputs-BiY86HbQ.mjs +62 -0
- package/dist/extension-pack-inputs-BiY86HbQ.mjs.map +1 -0
- package/dist/{framework-components-65gOHkHB.mjs → framework-components-DTcjouhS.mjs} +2 -2
- package/dist/{framework-components-65gOHkHB.mjs.map → framework-components-DTcjouhS.mjs.map} +1 -1
- package/dist/{global-flags-CdE7M0d9.d.mts → global-flags-DWsQ6SSI.d.mts} +1 -1
- package/dist/global-flags-DWsQ6SSI.d.mts.map +1 -0
- package/dist/glyph-mode-CBB4emzO.d.mts +5 -0
- package/dist/glyph-mode-CBB4emzO.d.mts.map +1 -0
- package/dist/{graph-render-DJVv0_uf.mjs → graph-render-D2FnLpuK.mjs} +1 -1
- package/dist/{graph-render-DJVv0_uf.mjs.map → graph-render-D2FnLpuK.mjs.map} +1 -1
- package/dist/{init-Db5Itt5r.mjs → init-C7PvN163.mjs} +5 -5
- package/dist/{init-Db5Itt5r.mjs.map → init-C7PvN163.mjs.map} +1 -1
- package/dist/{inspect-live-schema-LeWvkZVz.mjs → inspect-live-schema-BRCWQ-Sr.mjs} +5 -5
- package/dist/{inspect-live-schema-LeWvkZVz.mjs.map → inspect-live-schema-BRCWQ-Sr.mjs.map} +1 -1
- package/dist/migration-check-DoskM1nB.mjs +341 -0
- package/dist/migration-check-DoskM1nB.mjs.map +1 -0
- package/dist/migration-cli.d.mts.map +1 -1
- package/dist/migration-cli.mjs +4 -4
- package/dist/migration-cli.mjs.map +1 -1
- package/dist/{migration-command-scaffold-BtkunvFQ.mjs → migration-command-scaffold-CXLkoIJx.mjs} +5 -5
- package/dist/{migration-command-scaffold-BtkunvFQ.mjs.map → migration-command-scaffold-CXLkoIJx.mjs.map} +1 -1
- package/dist/migration-list-B2-iQ5Jd.mjs +646 -0
- package/dist/migration-list-B2-iQ5Jd.mjs.map +1 -0
- package/dist/{migration-plan-C2jeH1J5.mjs → migration-plan-BqmIKQpZ.mjs} +341 -88
- package/dist/migration-plan-BqmIKQpZ.mjs.map +1 -0
- package/dist/{migration-types-BXWvz12q.d.mts → migration-types-q64xAI_J.d.mts} +1 -1
- package/dist/{migration-types-BXWvz12q.d.mts.map → migration-types-q64xAI_J.d.mts.map} +1 -1
- package/dist/{migrations-CwZMa1Ck.mjs → migrations-BcVTutso.mjs} +12 -13
- package/dist/migrations-BcVTutso.mjs.map +1 -0
- package/dist/{output-BlsrGMEF.mjs → output-B60Gw5fu.mjs} +1 -1
- package/dist/{output-BlsrGMEF.mjs.map → output-B60Gw5fu.mjs.map} +1 -1
- package/dist/{progress-adapter-DFfvZcYL.mjs → progress-adapter-xASh41wr.mjs} +1 -1
- package/dist/{progress-adapter-DFfvZcYL.mjs.map → progress-adapter-xASh41wr.mjs.map} +1 -1
- package/dist/ref-advancement-DRh5Nquq.mjs +50 -0
- package/dist/ref-advancement-DRh5Nquq.mjs.map +1 -0
- package/dist/{types-C9FfXb1l.d.mts → types-CEtm6v6a.d.mts} +5 -11
- package/dist/types-CEtm6v6a.d.mts.map +1 -0
- package/dist/{verify-Bom75OYI.mjs → verify-DOHbbrub.mjs} +2 -2
- package/dist/{verify-Bom75OYI.mjs.map → verify-DOHbbrub.mjs.map} +1 -1
- package/package.json +12 -12
- package/dist/cli-errors-Czmx92Zy.d.mts +0 -3
- package/dist/cli-errors-Djtz98Vm.mjs +0 -71
- package/dist/cli-errors-Djtz98Vm.mjs.map +0 -1
- package/dist/client-oXO2WCPD.mjs.map +0 -1
- package/dist/command-helpers-DtavI0wJ.mjs.map +0 -1
- package/dist/commands/migration-check.mjs.map +0 -1
- package/dist/commands/migration-list.mjs.map +0 -1
- package/dist/contract-enrichment-Dani0mMW.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-BmNQwlws.mjs +0 -160
- package/dist/contract-space-aggregate-loader-BmNQwlws.mjs.map +0 -1
- package/dist/global-flags-CdE7M0d9.d.mts.map +0 -1
- package/dist/migration-plan-C2jeH1J5.mjs.map +0 -1
- package/dist/migrations-CwZMa1Ck.mjs.map +0 -1
- package/dist/terminal-ui-BiB_8KNo.mjs +0 -379
- package/dist/terminal-ui-BiB_8KNo.mjs.map +0 -1
- package/dist/types-C9FfXb1l.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-list-B2-iQ5Jd.mjs","names":[],"sources":["../src/utils/formatters/migration-list-data-column.ts","../src/utils/formatters/migration-list-graph-layout.ts","../src/utils/formatters/migration-list-graph-render.ts","../src/utils/formatters/migration-list-render.ts","../src/utils/formatters/migration-list-styler.ts","../src/commands/migration-list.ts"],"sourcesContent":["import type { MigrationEdgeKind } from '@prisma-next/migration-tools/migration-list-graph-topology';\nimport type { MigrationListEntry } from '@prisma-next/migration-tools/migration-list-types';\nimport type { GlyphMode } from '../glyph-mode';\nimport type { MigrationListStyler } from './migration-list-render';\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 { EMPTY_CONTRACT_HASH } from '@prisma-next/migration-tools/constants';\nimport {\n classifyMigrationListGraphTopology,\n type MigrationEdgeKind,\n type MigrationListGraphTopology,\n} from '@prisma-next/migration-tools/migration-list-graph-topology';\nimport type { MigrationListEntry } from '@prisma-next/migration-tools/migration-list-types';\n\nexport type ConnectorKind = 'fanBelow' | 'joinAbove';\n\nexport interface MigrationLayoutRow {\n readonly kind: 'migration';\n readonly entry: MigrationListEntry;\n readonly edgeKind: MigrationEdgeKind;\n readonly laneIndex: number;\n readonly passThroughLanes: readonly number[];\n readonly woven: boolean;\n}\n\nexport interface NodeLineLayoutRow {\n readonly kind: 'nodeLine';\n readonly contractHash: string;\n readonly laneIndex: number;\n}\n\nexport interface ConnectorLayoutRow {\n readonly kind: 'connector';\n readonly connectorKind: ConnectorKind;\n readonly contractHash: string;\n readonly startLane: number;\n readonly endLane: number;\n readonly branchCount: number;\n}\n\nexport type LayoutRow = MigrationLayoutRow | NodeLineLayoutRow | ConnectorLayoutRow;\n\nexport interface MigrationListGraphLayout {\n readonly rows: readonly LayoutRow[];\n}\n\ninterface LaneState {\n want: string;\n active: boolean;\n}\n\nfunction canonicalFrom(from: string | null): string {\n return from ?? EMPTY_CONTRACT_HASH;\n}\n\nfunction forwardInDegree(topology: MigrationListGraphTopology, hash: string): number {\n return topology.forwardInDegree.get(hash) ?? 0;\n}\n\nfunction forwardOutDegree(topology: MigrationListGraphTopology, hash: string): number {\n return topology.forwardOutDegree.get(hash) ?? 0;\n}\n\nfunction buildForwardProducersByTo(\n entries: readonly MigrationListEntry[],\n kindByMigrationHash: ReadonlyMap<string, MigrationEdgeKind>,\n): Map<string, MigrationListEntry[]> {\n const byTo = new Map<string, MigrationListEntry[]>();\n for (const entry of entries) {\n if (kindByMigrationHash.get(entry.migrationHash) !== 'forward') continue;\n const bucket = byTo.get(entry.to);\n if (bucket) bucket.push(entry);\n else byTo.set(entry.to, [entry]);\n }\n return byTo;\n}\n\nfunction countForwardProducersTo(\n forwardProducersByTo: Map<string, MigrationListEntry[]>,\n contract: string,\n): number {\n return forwardProducersByTo.get(contract)?.length ?? 0;\n}\n\nfunction hasLaterForwardDepartingFrom(\n entries: readonly MigrationListEntry[],\n startIndex: number,\n contract: string,\n kindByMigrationHash: ReadonlyMap<string, MigrationEdgeKind>,\n): boolean {\n for (let index = startIndex + 1; index < entries.length; index++) {\n const later = entries[index];\n if (later === undefined) continue;\n if (kindByMigrationHash.get(later.migrationHash) !== 'forward') continue;\n if (canonicalFrom(later.from) === contract) return true;\n }\n return false;\n}\n\nexport function computeMigrationListGraphLayout(\n entries: readonly MigrationListEntry[],\n topology: MigrationListGraphTopology = classifyMigrationListGraphTopology(entries),\n): MigrationListGraphLayout {\n const { kindByMigrationHash } = topology;\n const forwardProducersByTo = buildForwardProducersByTo(entries, kindByMigrationHash);\n const convergencesEmitted = new Set<string>();\n const producerLaneByHash = new Map<string, number>();\n const lanes: LaneState[] = [];\n const rows: LayoutRow[] = [];\n\n function emitNodeLine(contractHash: string): void {\n rows.push({ kind: 'nodeLine', contractHash, laneIndex: 0 });\n }\n\n function emitConnector(\n connectorKind: ConnectorKind,\n contractHash: string,\n startLane: number,\n endLane: number,\n branchCount: number,\n ): void {\n rows.push({\n kind: 'connector',\n connectorKind,\n contractHash,\n startLane,\n endLane,\n branchCount,\n });\n }\n\n function activeLaneIndices(): number[] {\n const indices: number[] = [];\n for (let index = 0; index < lanes.length; index++) {\n if (lanes[index]?.active) indices.push(index);\n }\n return indices;\n }\n\n function lanesWanting(contract: string): number[] {\n const indices: number[] = [];\n for (let index = 0; index < lanes.length; index++) {\n const lane = lanes[index];\n if (lane?.active && lane.want === contract) indices.push(index);\n }\n return indices;\n }\n\n function ensureLane(index: number): void {\n while (lanes.length <= index) {\n lanes.push({ want: '', active: false });\n }\n }\n\n function openLaneAtRight(want: string): number {\n const index = lanes.length;\n lanes.push({ want, active: true });\n return index;\n }\n\n function closeLane(index: number): void {\n ensureLane(index);\n const lane = lanes[index];\n if (lane) lane.active = false;\n }\n\n function emitJoinAbove(contractHash: string, laneIndices: readonly number[]): void {\n if (laneIndices.length < 2) return;\n const startLane = Math.min(...laneIndices);\n const endLane = Math.max(...laneIndices);\n emitConnector('joinAbove', contractHash, startLane, endLane, laneIndices.length);\n for (const index of laneIndices) {\n if (index !== startLane) closeLane(index);\n }\n }\n\n function emitConvergencePreamble(contract: string): void {\n if (convergencesEmitted.has(contract)) return;\n if (forwardInDegree(topology, contract) < 2) return;\n\n const consumersWanting = lanesWanting(contract);\n if (forwardOutDegree(topology, contract) >= 2 && consumersWanting.length >= 2) {\n emitJoinAbove(contract, consumersWanting);\n }\n\n emitNodeLine(contract);\n const producers = forwardProducersByTo.get(contract) ?? [];\n if (producers.length >= 2) {\n emitConnector('fanBelow', contract, 0, producers.length - 1, producers.length);\n }\n\n for (const [producerIndex, producer] of producers.entries()) {\n ensureLane(producerIndex);\n lanes[producerIndex] = { want: canonicalFrom(producer.from), active: true };\n producerLaneByHash.set(producer.migrationHash, producerIndex);\n }\n\n convergencesEmitted.add(contract);\n }\n\n function placeWoven(\n entry: MigrationListEntry,\n edgeKind: MigrationEdgeKind,\n laneIndex: number,\n ): void {\n const passThroughLanes = activeLaneIndices().filter((index) => index !== laneIndex);\n rows.push({\n kind: 'migration',\n entry,\n edgeKind,\n laneIndex,\n passThroughLanes,\n woven: true,\n });\n ensureLane(laneIndex);\n lanes[laneIndex] = { want: canonicalFrom(entry.from), active: true };\n }\n\n function placeUnwoven(entry: MigrationListEntry, edgeKind: MigrationEdgeKind): void {\n const passThroughLanes = activeLaneIndices();\n const laneIndex = passThroughLanes.length === 0 ? 0 : Math.max(...passThroughLanes) + 1;\n rows.push({\n kind: 'migration',\n entry,\n edgeKind,\n laneIndex,\n passThroughLanes,\n woven: false,\n });\n }\n\n for (let entryIndex = 0; entryIndex < entries.length; entryIndex++) {\n const entry = entries[entryIndex]!;\n const edgeKind = kindByMigrationHash.get(entry.migrationHash) ?? 'forward';\n const to = entry.to;\n\n if (edgeKind !== 'forward') {\n placeUnwoven(entry, edgeKind);\n continue;\n }\n\n if (forwardInDegree(topology, to) >= 2 && !convergencesEmitted.has(to)) {\n emitConvergencePreamble(to);\n }\n\n const presetLane = producerLaneByHash.get(entry.migrationHash);\n const wantingTo = lanesWanting(to);\n\n if (wantingTo.length >= 2 && countForwardProducersTo(forwardProducersByTo, to) === 1) {\n emitJoinAbove(to, wantingTo);\n }\n\n if (presetLane !== undefined) {\n placeWoven(entry, edgeKind, presetLane);\n continue;\n }\n\n const firstWanting = wantingTo[0];\n if (firstWanting !== undefined) {\n placeWoven(entry, edgeKind, firstWanting);\n continue;\n }\n\n if (hasLaterForwardDepartingFrom(entries, entryIndex, to, kindByMigrationHash)) {\n placeUnwoven(entry, edgeKind);\n continue;\n }\n\n const tipLaneIndex = openLaneAtRight(canonicalFrom(entry.from));\n placeWoven(entry, edgeKind, tipLaneIndex);\n }\n\n return { rows };\n}\n","import type { MigrationListGraphTopology } from '@prisma-next/migration-tools/migration-list-graph-topology';\nimport type {\n MigrationListEntry,\n MigrationListResult,\n} from '@prisma-next/migration-tools/migration-list-types';\nimport type { GlyphMode } from '../glyph-mode';\nimport {\n abbreviateContractHash,\n computeMigrationDirNameWidth,\n formatMigrationDataColumn,\n formatNodeLineDataColumn,\n MIGRATION_LIST_ASCII_KIND_GLYPH,\n MIGRATION_LIST_UNICODE_KIND_GLYPH,\n migrationListEmptySource,\n migrationListForwardArrow,\n} from './migration-list-data-column';\nimport type {\n ConnectorLayoutRow,\n LayoutRow,\n MigrationLayoutRow,\n MigrationListGraphLayout,\n NodeLineLayoutRow,\n} from './migration-list-graph-layout';\nimport { computeMigrationListGraphLayout } from './migration-list-graph-layout';\nimport type { MigrationListStyler } from './migration-list-render';\n\nexport type { GlyphMode } from '../glyph-mode';\n\ninterface GlyphPalette {\n readonly lane: string;\n readonly node: string;\n readonly forwardArrow: string;\n readonly emptySource: string;\n readonly kind: typeof MIGRATION_LIST_UNICODE_KIND_GLYPH;\n readonly fanBelow: (branchCount: number) => string;\n readonly joinAbove: (branchCount: number) => string;\n}\n\nconst UNICODE_PALETTE: GlyphPalette = {\n lane: '│',\n node: 'o',\n forwardArrow: migrationListForwardArrow('unicode'),\n emptySource: migrationListEmptySource('unicode'),\n kind: MIGRATION_LIST_UNICODE_KIND_GLYPH,\n fanBelow: (branchCount) => (branchCount === 2 ? '├─┐' : '├─┬─┐'),\n joinAbove: (branchCount) => (branchCount === 2 ? '├─┘' : '└─┴─┘'),\n};\n\nconst ASCII_PALETTE: GlyphPalette = {\n lane: '|',\n node: 'o',\n forwardArrow: migrationListForwardArrow('ascii'),\n emptySource: migrationListEmptySource('ascii'),\n kind: MIGRATION_LIST_ASCII_KIND_GLYPH,\n fanBelow: (branchCount) => (branchCount === 2 ? '+-\\\\' : '+-|-\\\\'),\n joinAbove: (branchCount) => (branchCount === 2 ? '+-/' : '/-+-/'),\n};\n\nfunction paletteFor(mode: GlyphMode): GlyphPalette {\n return mode === 'ascii' ? ASCII_PALETTE : UNICODE_PALETTE;\n}\n\nfunction migrationEntries(layout: MigrationListGraphLayout): MigrationListEntry[] {\n const entries: MigrationListEntry[] = [];\n for (const row of layout.rows) {\n if (row.kind === 'migration') entries.push(row.entry);\n }\n return entries;\n}\n\nfunction layoutMaxLaneIndex(layout: MigrationListGraphLayout): number {\n let max = 0;\n for (const row of layout.rows) {\n if (row.kind === 'migration') {\n max = Math.max(max, row.laneIndex, ...row.passThroughLanes);\n } else if (row.kind === 'connector') {\n max = Math.max(max, row.endLane);\n } else {\n max = Math.max(max, row.laneIndex);\n }\n }\n return max;\n}\n\nfunction laneCell(glyph: string): string {\n return `${glyph} `;\n}\n\nfunction emptyLaneCell(): string {\n return ' ';\n}\n\nfunction renderMigrationGutter(\n row: MigrationLayoutRow,\n maxLane: number,\n palette: GlyphPalette,\n style: MigrationListStyler,\n): string {\n const cells: string[] = [];\n for (let lane = 0; lane <= maxLane; lane++) {\n if (lane === row.laneIndex) {\n cells.push(laneCell(style.kind(palette.kind[row.edgeKind])));\n } else if (row.passThroughLanes.includes(lane)) {\n cells.push(laneCell(style.lane(palette.lane)));\n } else {\n cells.push(emptyLaneCell());\n }\n }\n return cells.join('');\n}\n\nfunction renderNodeLineGutter(\n row: NodeLineLayoutRow,\n openLanes: ReadonlySet<number>,\n maxLane: number,\n palette: GlyphPalette,\n style: MigrationListStyler,\n): string {\n const cells: string[] = [];\n for (let lane = 0; lane <= maxLane; lane++) {\n if (lane === row.laneIndex) {\n cells.push(laneCell(palette.node));\n } else if (openLanes.has(lane)) {\n cells.push(laneCell(style.lane(palette.lane)));\n } else {\n cells.push(emptyLaneCell());\n }\n }\n return cells.join('');\n}\n\nfunction renderConnectorGutter(\n row: ConnectorLayoutRow,\n openLanes: ReadonlySet<number>,\n maxLane: number,\n palette: GlyphPalette,\n style: MigrationListStyler,\n): string {\n const spanLaneCount = row.endLane - row.startLane + 1;\n const spanWidth = spanLaneCount * 2;\n let spanGlyph = (\n row.connectorKind === 'fanBelow'\n ? palette.fanBelow(row.branchCount)\n : palette.joinAbove(row.branchCount)\n )\n .padEnd(spanWidth, ' ')\n .slice(0, spanWidth);\n\n const hasOutsideOpen = [...openLanes].some((lane) => lane < row.startLane || lane > row.endLane);\n if (!hasOutsideOpen && spanGlyph.endsWith(' ')) {\n spanGlyph = spanGlyph.slice(0, -1);\n }\n\n let gutter = '';\n for (let lane = 0; lane < row.startLane; lane++) {\n gutter += openLanes.has(lane) ? laneCell(style.lane(palette.lane)) : emptyLaneCell();\n }\n gutter += style.lane(spanGlyph);\n for (let lane = row.endLane + 1; lane <= maxLane; lane++) {\n gutter += openLanes.has(lane) ? laneCell(style.lane(palette.lane)) : emptyLaneCell();\n }\n return gutter;\n}\n\nfunction advanceOpenLanes(row: LayoutRow, openLanes: ReadonlySet<number>): ReadonlySet<number> {\n if (row.kind === 'migration') {\n return new Set([row.laneIndex, ...row.passThroughLanes]);\n }\n if (row.kind === 'connector') {\n if (row.connectorKind === 'fanBelow') {\n const next = new Set(openLanes);\n for (let lane = row.startLane; lane <= row.endLane; lane++) {\n next.add(lane);\n }\n return next;\n }\n const next = new Set(openLanes);\n for (let lane = row.startLane + 1; lane <= row.endLane; lane++) {\n next.delete(lane);\n }\n return next;\n }\n return openLanes;\n}\n\nexport function renderMigrationListGraphWithStyle(\n layout: MigrationListGraphLayout,\n style: MigrationListStyler,\n glyphMode: GlyphMode,\n): string {\n const palette = paletteFor(glyphMode);\n const migrations = migrationEntries(layout);\n const layoutMaxLane = layoutMaxLaneIndex(layout);\n const dirNameWidth = computeMigrationDirNameWidth(migrations);\n const gutterMaxLane = layoutMaxLane;\n const blockDataStart = (layoutMaxLane + 1) * 2;\n // Migration and node-line gutters always occupy a fixed, ANSI-free visible\n // width of two columns per lane. Padding is computed from this width rather\n // than the rendered string length so dimmed lanes (which carry zero-width\n // SGR bytes) stay column-aligned with the data that follows.\n const gutterVisibleWidth = (gutterMaxLane + 1) * 2;\n const lines: string[] = [];\n let openLanes: ReadonlySet<number> = new Set();\n\n function padToDataColumn(gutter: string, dataStart: number): string {\n return gutter + ' '.repeat(Math.max(0, dataStart - gutterVisibleWidth));\n }\n\n for (const row of layout.rows) {\n if (row.kind === 'migration') {\n const gutter = renderMigrationGutter(row, gutterMaxLane, palette, style);\n const data = formatMigrationDataColumn(row.entry, {\n dirNameWidth,\n edgeKind: row.edgeKind,\n style,\n forwardArrow: palette.forwardArrow,\n emptySource: palette.emptySource,\n });\n lines.push(`${padToDataColumn(gutter, blockDataStart)}${data}`);\n } else if (row.kind === 'nodeLine') {\n const gutter = renderNodeLineGutter(row, openLanes, gutterMaxLane, palette, style);\n const data = formatNodeLineDataColumn(row.contractHash, style);\n lines.push(`${padToDataColumn(gutter, blockDataStart)}${data}`);\n } else {\n lines.push(renderConnectorGutter(row, openLanes, gutterMaxLane, palette, style));\n }\n openLanes = advanceOpenLanes(row, openLanes);\n }\n\n return lines.map((line) => line.trimEnd()).join('\\n');\n}\n\nexport function renderMigrationListGraph(\n layout: MigrationListGraphLayout,\n style: MigrationListStyler,\n glyphMode: GlyphMode,\n): string {\n return renderMigrationListGraphWithStyle(layout, style, glyphMode);\n}\n\nexport function formatGraphNodeLineHash(contractHash: string, style: MigrationListStyler): string {\n return style.sourceHash(abbreviateContractHash(contractHash));\n}\n\nfunction formatGraphEmptyStateLine(spaceId: string, style: MigrationListStyler): string {\n return style.emptyState(`There are no migrations in migrations/${spaceId}/ yet`);\n}\n\nfunction renderGraphSpaceBlock(\n spaceId: string,\n migrations: readonly MigrationListEntry[],\n multiSpace: boolean,\n style: MigrationListStyler,\n glyphMode: GlyphMode,\n topology: MigrationListGraphTopology,\n): readonly string[] {\n if (migrations.length === 0) {\n const emptyLine = formatGraphEmptyStateLine(spaceId, style);\n if (!multiSpace) {\n return [emptyLine];\n }\n return [style.spaceHeading(`${spaceId}:`), ` ${emptyLine}`];\n }\n\n const layout = computeMigrationListGraphLayout(migrations, topology);\n const graphBody = renderMigrationListGraphWithStyle(layout, style, glyphMode);\n const rows = graphBody.split('\\n');\n if (!multiSpace) {\n return rows;\n }\n return [style.spaceHeading(`${spaceId}:`), ...rows.map((row) => ` ${row}`)];\n}\n\nexport function renderMigrationListGraphResult(\n result: MigrationListResult,\n style: MigrationListStyler,\n glyphMode: GlyphMode,\n topologyBySpaceId: ReadonlyMap<string, MigrationListGraphTopology>,\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 if (topology === undefined) {\n throw new Error(`missing topology for space ${space.spaceId}`);\n }\n lines.push(\n ...renderGraphSpaceBlock(\n space.spaceId,\n space.migrations,\n multiSpace,\n style,\n glyphMode,\n topology,\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","import {\n classifyMigrationListGraphTopology,\n type MigrationEdgeKind,\n type MigrationListGraphTopology,\n} from '@prisma-next/migration-tools/migration-list-graph-topology';\nimport type {\n MigrationListEntry,\n MigrationListResult,\n} from '@prisma-next/migration-tools/migration-list-types';\nimport type { GlyphMode } from '../glyph-mode';\nimport {\n computeMigrationDirNameWidth,\n formatMigrationDataColumn,\n migrationListEmptySource,\n migrationListForwardArrow,\n migrationListKindGlyph,\n} from './migration-list-data-column';\n\nexport type { MigrationEdgeKind } from '@prisma-next/migration-tools/migration-list-graph-topology';\nexport type {\n MigrationListEntry,\n MigrationListResult,\n MigrationSpaceListEntry,\n} from '@prisma-next/migration-tools/migration-list-types';\nexport type { GlyphMode } from '../glyph-mode';\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, greenBright, yellow } from 'colorette';\nimport { IDENTITY_MIGRATION_LIST_STYLER, type MigrationListStyler } from './migration-list-render';\n\n/**\n * The reserved ref name for the live-database marker. Treated as a\n * structurally distinct token from user-named refs so the styler can\n * make it visually pop in `(refs)` decorations.\n */\nconst DB_REF_NAME = 'db';\n\nfunction styleRefName(name: string): string {\n return name === DB_REF_NAME ? bold(greenBright(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 live-DB `db` marker inside is green-bold\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","import { enumerateMigrationSpaces } from '@prisma-next/migration-tools/enumerate-migration-spaces';\nimport { MigrationToolsError } from '@prisma-next/migration-tools/errors';\nimport type {\n MigrationListResult,\n MigrationSpaceListEntry,\n} from '@prisma-next/migration-tools/migration-list-types';\nimport { APP_SPACE_ID, isValidSpaceId } from '@prisma-next/migration-tools/spaces';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { notOk, ok, type Result } from '@prisma-next/utils/result';\nimport { Command } from 'commander';\nimport { loadConfig } from '../config-loader';\nimport {\n type CliStructuredError,\n errorInvalidSpaceId,\n errorSpaceNotFound,\n errorUnexpected,\n mapMigrationToolsError,\n} from '../utils/cli-errors';\nimport {\n addGlobalOptions,\n resolveMigrationPaths,\n setCommandDescriptions,\n setCommandExamples,\n setCommandSeeAlso,\n} from '../utils/command-helpers';\nimport {\n type GlyphMode,\n renderMigrationListGraphResult,\n} from '../utils/formatters/migration-list-graph-render';\nimport {\n buildMigrationListTopologyBySpace,\n renderMigrationListWithStyle,\n} from '../utils/formatters/migration-list-render';\nimport { createAnsiMigrationListStyler } from '../utils/formatters/migration-list-styler';\nimport { formatStyledHeader } from '../utils/formatters/styled';\nimport type { CommonCommandOptions } from '../utils/global-flags';\nimport { type GlobalFlags, parseGlobalFlagsOrExit } from '../utils/global-flags';\nimport { handleResult } from '../utils/result-handler';\nimport { createTerminalUI, type TerminalUI } from '../utils/terminal-ui';\n\ninterface MigrationListOptions extends CommonCommandOptions {\n readonly config?: string;\n readonly space?: string;\n readonly graph?: boolean;\n readonly ascii?: boolean;\n}\n\nexport interface MigrationListHumanRenderOptions {\n readonly graph: boolean;\n readonly glyphMode: GlyphMode;\n readonly useColor: boolean;\n}\n\nexport function renderMigrationListHumanOutput(\n result: MigrationListResult,\n options: MigrationListHumanRenderOptions,\n): string {\n const styler = createAnsiMigrationListStyler({ useColor: options.useColor });\n const topologyBySpaceId = buildMigrationListTopologyBySpace(result);\n if (options.graph) {\n return renderMigrationListGraphResult(result, styler, options.glyphMode, topologyBySpaceId);\n }\n return renderMigrationListWithStyle(result, styler, options.glyphMode, topologyBySpaceId);\n}\n\n/**\n * Inputs for {@link runMigrationList} — the pure-ish data-and-policy core\n * of `migration list` that tests exercise directly.\n *\n * The core depends only on the filesystem rooted at `migrationsDir`. It\n * does NOT call `loadConfig`, parse CLI flags, render a styled header,\n * or write to any stream. Output rendering is the caller's concern (the\n * CLI shell renders via {@link renderMigrationList}; JSON callers\n * serialize the {@link MigrationListResult} directly).\n */\nexport interface RunMigrationListInputs {\n /** Absolute path to the project's `migrations/` directory. */\n readonly migrationsDir: string;\n /**\n * Optional contract-space id to narrow the result to a single space.\n * Same validation rules as {@link isValidSpaceId}. When absent, every\n * on-disk space contributes.\n */\n readonly spaceFilter?: string;\n}\n\nfunction computeSummary(spaces: readonly MigrationSpaceListEntry[]): string {\n const totalMigrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n if (spaces.length <= 1) {\n return `${totalMigrations} migration(s) on disk`;\n }\n return `${totalMigrations} migration(s) across ${spaces.length} contract space(s)`;\n}\n\n/**\n * The unit-testable core of `migration list`. Given an absolute\n * `migrationsDir` and an optional `spaceFilter`, enumerates every\n * on-disk migration (via {@link enumerateMigrationSpaces}), narrows to\n * the requested space if any, and assembles a {@link MigrationListResult}\n * ready for the renderer or JSON serializer.\n *\n * The enumerator is the single source of truth for \"what is a contract\n * space\": existence, the `--space` candidate-suggestion list, and\n * scoping are all derived from one {@link enumerateMigrationSpaces}\n * traversal. This means the reserved-name exclusion the enumerator\n * applies (e.g. the per-space `refs/` subdirectory) is honoured here for\n * free — a `--space refs` request resolves to `SPACE_NOT_FOUND`, not a\n * synthesized empty-state.\n *\n * Distinct empty-state paths:\n *\n * - `migrations/` missing or contains no valid space directories →\n * synthesizes `[{ spaceId: APP_SPACE_ID, migrations: [] }]` so the\n * renderer's empty-state path can name a directory (spec § Empty-state +\n * the `migrations/` missing edge case).\n * - `--space <id>` on an existing-but-empty space dir → the enumerator\n * surfaces `{ spaceId, migrations: [] }`; `<id>` is in the set, so it\n * scopes to that entry and renders the empty-state the same way.\n * - `--space <id>` on a non-existent (or reserved) space → structured\n * `MIGRATION.SPACE_NOT_FOUND` error (NOT empty-state).\n *\n * Errors caught here:\n *\n * - {@link MigrationToolsError} from the enumerator → mapped through\n * {@link mapMigrationToolsError} so callers see the catalogue code.\n * - Anything else (filesystem etc.) → wrapped via {@link errorUnexpected}.\n */\nexport async function runMigrationList(\n inputs: RunMigrationListInputs,\n): Promise<Result<MigrationListResult, CliStructuredError>> {\n const { migrationsDir, spaceFilter } = inputs;\n\n if (spaceFilter !== undefined && !isValidSpaceId(spaceFilter)) {\n return notOk(errorInvalidSpaceId(spaceFilter));\n }\n\n let spaces: readonly MigrationSpaceListEntry[];\n try {\n spaces = await enumerateMigrationSpaces({ projectMigrationsDir: migrationsDir });\n } catch (error) {\n if (MigrationToolsError.is(error)) return notOk(mapMigrationToolsError(error));\n return notOk(\n errorUnexpected(error instanceof Error ? error.message : String(error), {\n why: `Failed to enumerate migrations: ${error instanceof Error ? error.message : String(error)}`,\n }),\n );\n }\n\n if (spaceFilter !== undefined && !spaces.some((s) => s.spaceId === spaceFilter)) {\n return notOk(errorSpaceNotFound(spaceFilter, spaces.map((s) => s.spaceId).sort()));\n }\n\n const scopedSpaces =\n spaceFilter !== undefined ? spaces.filter((s) => s.spaceId === spaceFilter) : spaces;\n\n const resultSpaces: readonly MigrationSpaceListEntry[] =\n scopedSpaces.length === 0 ? [{ spaceId: APP_SPACE_ID, migrations: [] }] : scopedSpaces;\n\n return ok({\n ok: true,\n spaces: resultSpaces,\n summary: computeSummary(resultSpaces),\n });\n}\n\n/**\n * CLI shell: loads config, resolves paths, prints the styled header on\n * stderr (interactive mode only), and delegates to {@link runMigrationList}.\n * Kept intentionally thin so the unit-testable surface lives in the core.\n */\nasync function executeMigrationListCommand(\n options: MigrationListOptions,\n flags: GlobalFlags,\n ui: TerminalUI,\n): Promise<Result<MigrationListResult, CliStructuredError>> {\n const config = await loadConfig(options.config);\n const { configPath, migrationsDir, migrationsRelative } = resolveMigrationPaths(\n options.config,\n config,\n );\n\n if (!flags.json && !flags.quiet) {\n const header = formatStyledHeader({\n command: 'migration list',\n description: 'List on-disk migrations, latest first, per contract space',\n details: [\n { label: 'config', value: configPath },\n { label: 'migrations', value: migrationsRelative },\n ...(options.space !== undefined ? [{ label: 'space', value: options.space }] : []),\n ],\n flags,\n });\n ui.stderr(header);\n }\n\n return runMigrationList({\n migrationsDir,\n ...ifDefined('spaceFilter', options.space),\n });\n}\n\nexport function createMigrationListCommand(): Command {\n const command = new Command('list');\n setCommandDescriptions(\n command,\n 'List on-disk migrations, latest first, per contract space',\n 'Enumerates every on-disk migration under migrations/<space>/ for every\\n' +\n 'contract space found on disk, latest first. Offline — does not consult\\n' +\n 'the database. Each row leads with a kind glyph (* forward, ↩ rollback,\\n' +\n '⟲ self), then dirName, then source → destination contract hashes\\n' +\n '(7-char git-style). Self-edges show a single hash. Invariants render as\\n' +\n '{...}; refs on the destination as (production, db). Pass --space <id>\\n' +\n 'to narrow to one contract space. --graph draws the forward spine with\\n' +\n 'lane gutters; --ascii forces ASCII glyphs (orthogonal to --no-color).',\n );\n setCommandExamples(command, [\n 'prisma-next migration list',\n 'prisma-next migration list --graph',\n 'prisma-next migration list --space app',\n 'prisma-next migration list --graph --ascii',\n 'prisma-next migration list --json',\n ]);\n setCommandSeeAlso(command, [\n { verb: 'migration status', oneLiner: 'Show migration path and pending status' },\n { verb: 'migration log', oneLiner: 'Show executed migration history' },\n { verb: 'migration graph', oneLiner: 'Show the migration graph topology' },\n { verb: 'migration show', oneLiner: 'Display migration package contents' },\n ]);\n addGlobalOptions(command)\n .option('--config <path>', 'Path to prisma-next.config.ts')\n .option('--space <id>', 'Narrow output to a single contract space')\n .option('--graph', 'Draw migration relationships as an annotated tree')\n .option('--ascii', 'Use ASCII glyphs for --graph (pipe-friendly)')\n .action(async (options: MigrationListOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n const ui = createTerminalUI(flags);\n const result = await executeMigrationListCommand(options, flags, ui);\n const exitCode = handleResult(result, flags, ui, (listResult) => {\n if (flags.json) {\n ui.output(JSON.stringify(listResult, null, 2));\n } else if (!flags.quiet) {\n ui.output(\n renderMigrationListHumanOutput(listResult, {\n graph: options.graph === true,\n glyphMode: ui.resolveGlyphMode(options.ascii === true),\n useColor: ui.useColor,\n }),\n );\n }\n });\n process.exit(exitCode);\n });\n return command;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,oCAAuE;CAClF,SAAS;CACT,UAAU;CACV,MAAM;AACR;AAEA,MAAa,kCAAqE;CAChF,SAAS;CACT,UAAU;CACV,MAAM;AACR;AAEA,SAAgB,uBAAuB,WAAsB,UAAqC;CAChG,OAAO,cAAc,UACjB,gCAAgC,YAChC,kCAAkC;AACxC;AAEA,SAAgB,0BAA0B,WAA8B;CACtE,OAAO,cAAc,UAAA,OAAA;AAGvB;AAEA,SAAgB,yBAAyB,WAA8B;CACrE,OAAO,cAAc,UAAA,MAAA;AACvB;AAEA,SAAgB,uBAAuB,MAAsB;CAE3D,QADiB,KAAK,WAAW,SAAS,IAAI,KAAK,MAAM,CAAC,IAAI,MAC9C,MAAM,GAAA,CAA4B;AACpD;AAEA,SAAgB,6BAA6B,YAAmD;CAC9F,IAAI,WAAW,WAA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