prisma-next 0.12.0-dev.3 → 0.12.0-dev.31

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 (113) hide show
  1. package/dist/cli.mjs +180 -163
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/{client-KgJorIvG.mjs → client-xeWpMlq1.mjs} +39 -15
  4. package/dist/client-xeWpMlq1.mjs.map +1 -0
  5. package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-DK_5ItoJ.mjs} +284 -24
  6. package/dist/command-helpers-DK_5ItoJ.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 +1 -1
  18. package/dist/commands/migrate.mjs +5 -6
  19. package/dist/commands/migrate.mjs.map +1 -1
  20. package/dist/commands/migration-check.mjs +1 -1
  21. package/dist/commands/migration-graph.d.mts +13 -7
  22. package/dist/commands/migration-graph.d.mts.map +1 -1
  23. package/dist/commands/migration-graph.mjs +171 -2
  24. package/dist/commands/migration-graph.mjs.map +1 -0
  25. package/dist/commands/migration-list.d.mts +24 -26
  26. package/dist/commands/migration-list.d.mts.map +1 -1
  27. package/dist/commands/migration-list.mjs +2 -190
  28. package/dist/commands/migration-log.d.mts +6 -18
  29. package/dist/commands/migration-log.d.mts.map +1 -1
  30. package/dist/commands/migration-log.mjs +1 -137
  31. package/dist/commands/migration-new.mjs +3 -3
  32. package/dist/commands/migration-plan.d.mts +1 -1
  33. package/dist/commands/migration-plan.mjs +1 -1
  34. package/dist/commands/migration-show.d.mts +1 -1
  35. package/dist/commands/migration-show.mjs +3 -4
  36. package/dist/commands/migration-show.mjs.map +1 -1
  37. package/dist/commands/migration-status.d.mts +41 -141
  38. package/dist/commands/migration-status.d.mts.map +1 -1
  39. package/dist/commands/migration-status.mjs +2 -759
  40. package/dist/commands/ref.d.mts +1 -1
  41. package/dist/commands/ref.mjs +3 -3
  42. package/dist/commands/telemetry/index.d.mts +7 -0
  43. package/dist/commands/telemetry/index.d.mts.map +1 -0
  44. package/dist/commands/telemetry/index.mjs +2 -0
  45. package/dist/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-DG3kjgoz.mjs} +2 -2
  46. package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-DG3kjgoz.mjs.map} +1 -1
  47. package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-BO0l6fnT.mjs} +3 -3
  48. package/dist/{contract-emit-D-4jrNve.mjs.map → contract-emit-BO0l6fnT.mjs.map} +1 -1
  49. package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-C0Bs0VRj.mjs} +3 -3
  50. package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-C0Bs0VRj.mjs.map} +1 -1
  51. package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-2wtPflGH.mjs} +3 -3
  52. package/dist/{contract-infer-D8uEbJuu.mjs.map → contract-infer-2wtPflGH.mjs.map} +1 -1
  53. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-Dbr3-jHF.mjs} +4 -4
  54. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-Dbr3-jHF.mjs.map} +1 -1
  55. package/dist/{db-verify-v_vUKXTU.mjs → db-verify-CxHiSiTG.mjs} +4 -4
  56. package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-CxHiSiTG.mjs.map} +1 -1
  57. package/dist/exports/control-api.d.mts +1 -1
  58. package/dist/exports/control-api.d.mts.map +1 -1
  59. package/dist/exports/control-api.mjs +2 -2
  60. package/dist/exports/index.mjs +1 -1
  61. package/dist/exports/init-output.mjs +1 -1
  62. package/dist/{framework-components-fYXjz_in.mjs → framework-components-CxOVKAAh.mjs} +2 -2
  63. package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-CxOVKAAh.mjs.map} +1 -1
  64. package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-DG4uY5tV.d.mts} +1 -1
  65. package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-DG4uY5tV.d.mts.map} +1 -1
  66. package/dist/{init-Cv9UzWL5.mjs → init-R272pxux.mjs} +5 -58
  67. package/dist/init-R272pxux.mjs.map +1 -0
  68. package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-RekOwfi5.mjs} +3 -3
  69. package/dist/{inspect-live-schema-C6ohV_oQ.mjs.map → inspect-live-schema-RekOwfi5.mjs.map} +1 -1
  70. package/dist/{migration-check-BiBJoYYW.mjs → migration-check-Dc0cOhKH.mjs} +2 -2
  71. package/dist/{migration-check-BiBJoYYW.mjs.map → migration-check-Dc0cOhKH.mjs.map} +1 -1
  72. package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-ApB3NxWY.mjs} +3 -3
  73. package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-ApB3NxWY.mjs.map} +1 -1
  74. package/dist/migration-graph-space-render-dmLLWift.mjs +1966 -0
  75. package/dist/migration-graph-space-render-dmLLWift.mjs.map +1 -0
  76. package/dist/migration-list-C5sXrl0U.mjs +228 -0
  77. package/dist/migration-list-C5sXrl0U.mjs.map +1 -0
  78. package/dist/migration-list-types-DS63IdFd.d.mts +23 -0
  79. package/dist/migration-list-types-DS63IdFd.d.mts.map +1 -0
  80. package/dist/migration-log-DD_vCbYW.mjs +203 -0
  81. package/dist/migration-log-DD_vCbYW.mjs.map +1 -0
  82. package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-CeTjQOIG.mjs} +5 -5
  83. package/dist/{migration-plan-9DJ7q7_z.mjs.map → migration-plan-CeTjQOIG.mjs.map} +1 -1
  84. package/dist/migration-status-qV8ctwPy.mjs +432 -0
  85. package/dist/migration-status-qV8ctwPy.mjs.map +1 -0
  86. package/dist/{output-B60Gw5fu.mjs → output-CF_hqzI-.mjs} +1 -1
  87. package/dist/{output-B60Gw5fu.mjs.map → output-CF_hqzI-.mjs.map} +1 -1
  88. package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-V1o-9LVK.mjs} +1 -1
  89. package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-V1o-9LVK.mjs.map} +1 -1
  90. package/dist/telemetry-S-NGi9U6.mjs +122 -0
  91. package/dist/telemetry-S-NGi9U6.mjs.map +1 -0
  92. package/dist/{types-Dt_SfqFm.d.mts → types-Mh7mdPHM.d.mts} +13 -2
  93. package/dist/types-Mh7mdPHM.d.mts.map +1 -0
  94. package/dist/{verify-DCA9Sldu.mjs → verify-BdI-BgYi.mjs} +2 -2
  95. package/dist/{verify-DCA9Sldu.mjs.map → verify-BdI-BgYi.mjs.map} +1 -1
  96. package/package.json +11 -12
  97. package/dist/client-KgJorIvG.mjs.map +0 -1
  98. package/dist/command-helpers-Bbw1GbwL.mjs.map +0 -1
  99. package/dist/commands/migration-list.mjs.map +0 -1
  100. package/dist/commands/migration-log.mjs.map +0 -1
  101. package/dist/commands/migration-status.mjs.map +0 -1
  102. package/dist/graph-render-rFAqZujX.mjs +0 -1081
  103. package/dist/graph-render-rFAqZujX.mjs.map +0 -1
  104. package/dist/init-Cv9UzWL5.mjs.map +0 -1
  105. package/dist/migration-graph-D7DVUElV.mjs +0 -1232
  106. package/dist/migration-graph-D7DVUElV.mjs.map +0 -1
  107. package/dist/migration-list-styler-BRwF4-gy.mjs +0 -399
  108. package/dist/migration-list-styler-BRwF4-gy.mjs.map +0 -1
  109. package/dist/migration-types-D2FW63pr.d.mts +0 -15
  110. package/dist/migration-types-D2FW63pr.d.mts.map +0 -1
  111. package/dist/migrations-Cv2jxNNK.mjs +0 -228
  112. package/dist/migrations-Cv2jxNNK.mjs.map +0 -1
  113. package/dist/types-Dt_SfqFm.d.mts.map +0 -1
@@ -1,190 +1,2 @@
1
- import { t as loadConfig } from "../config-loader-B6sJjXTv.mjs";
2
- import { B as errorInvalidSpaceId, Q as errorSpaceNotFound, T as formatStyledHeader, _ as createTerminalUI, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from "../command-helpers-Bbw1GbwL.mjs";
3
- import { r as buildReadAggregate } from "../contract-space-aggregate-loader-DvZwdkrr.mjs";
4
- import { i as renderMigrationListWithStyle, n as createAnsiMigrationListStyler, r as buildMigrationListTopologyBySpace } from "../migration-list-styler-BRwF4-gy.mjs";
5
- import { Command } from "commander";
6
- import { ifDefined } from "@prisma-next/utils/defined";
7
- import { notOk, ok } from "@prisma-next/utils/result";
8
- import { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, isValidSpaceId, listContractSpaceDirectories } from "@prisma-next/migration-tools/spaces";
9
- import { HEAD_REF_NAME, refsByContractHash } from "@prisma-next/migration-tools/refs";
10
- //#region src/commands/migration-list.ts
11
- function compareSpaceIds(a, b) {
12
- if (a === APP_SPACE_ID) return b === APP_SPACE_ID ? 0 : -1;
13
- if (b === APP_SPACE_ID) return 1;
14
- if (a < b) return -1;
15
- if (a > b) return 1;
16
- return 0;
17
- }
18
- function compareDirNamesDescending(a, b) {
19
- if (a.dirName < b.dirName) return 1;
20
- if (a.dirName > b.dirName) return -1;
21
- return 0;
22
- }
23
- /**
24
- * Ref names decorating a space's destination contract hashes. The
25
- * tolerant `member.refs` deliberately omits the structural `head.json`;
26
- * for extension spaces the old enumerator surfaced it as a `head`
27
- * decoration on the tip migration, so fold `member.headRef` back in to
28
- * keep that output. The app space synthesises its head, so it carries
29
- * no on-disk `head` ref to restore.
30
- */
31
- function listRefsByContractHash(member) {
32
- const byHash = new Map(refsByContractHash(member.refs));
33
- if (member.spaceId !== APP_SPACE_ID && member.headRef !== null) {
34
- const hash = member.headRef.hash;
35
- const bucket = byHash.get(hash) ?? [];
36
- if (!bucket.includes(HEAD_REF_NAME)) byHash.set(hash, [...bucket, HEAD_REF_NAME].sort());
37
- }
38
- return byHash;
39
- }
40
- async function orderedOnDiskSpaceIds(projectMigrationsDir) {
41
- return (await listContractSpaceDirectories(projectMigrationsDir)).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).filter(isValidSpaceId).sort(compareSpaceIds);
42
- }
43
- /**
44
- * Project the loaded {@link ContractSpaceAggregate} into the render-ready
45
- * {@link MigrationSpaceListEntry} rows `migration list` displays.
46
- *
47
- * Space membership matches the on-disk contract-space directories (not the
48
- * aggregate's always-present synthesized app member when `migrations/app/`
49
- * is absent); package and ref data come from `aggregate.space(id)`.
50
- */
51
- async function migrationSpaceListEntriesFromAggregate(aggregate, projectMigrationsDir) {
52
- const spaceIds = await orderedOnDiskSpaceIds(projectMigrationsDir);
53
- const spaces = [];
54
- for (const spaceId of spaceIds) {
55
- const member = aggregate.space(spaceId);
56
- if (member === void 0) continue;
57
- const refsByHash = listRefsByContractHash(member);
58
- const migrations = member.packages.map((pkg) => ({
59
- dirName: pkg.dirName,
60
- from: pkg.metadata.from,
61
- to: pkg.metadata.to,
62
- migrationHash: pkg.metadata.migrationHash,
63
- operationCount: pkg.ops.length,
64
- createdAt: pkg.metadata.createdAt,
65
- refs: refsByHash.get(pkg.metadata.to) ?? [],
66
- providedInvariants: pkg.metadata.providedInvariants
67
- })).sort(compareDirNamesDescending);
68
- spaces.push({
69
- spaceId,
70
- migrations
71
- });
72
- }
73
- return spaces;
74
- }
75
- function renderMigrationListHumanOutput(result, options) {
76
- const styler = createAnsiMigrationListStyler({ useColor: options.useColor });
77
- const topologyBySpaceId = buildMigrationListTopologyBySpace(result);
78
- return renderMigrationListWithStyle(result, styler, options.glyphMode, topologyBySpaceId);
79
- }
80
- function computeSummary(spaces) {
81
- const totalMigrations = spaces.reduce((count, space) => count + space.migrations.length, 0);
82
- if (spaces.length <= 1) return `${totalMigrations} migration(s) on disk`;
83
- return `${totalMigrations} migration(s) across ${spaces.length} contract space(s)`;
84
- }
85
- /**
86
- * Policy core of `migration list`: validates `--space`, narrows the
87
- * pre-enumerated spaces, and assembles a {@link MigrationListResult}.
88
- *
89
- * - `migrations/` missing or contains no valid space directories →
90
- * caller passes `spaces: []`; this synthesizes `[{ spaceId: APP_SPACE_ID, migrations: [] }]`.
91
- * - `--space <id>` on an existing-but-empty space → `{ spaceId, migrations: [] }` in the input.
92
- * - `--space <id>` on a non-existent (or reserved) space → `SPACE_NOT_FOUND`.
93
- */
94
- function runMigrationList(inputs) {
95
- const { spaces, spaceFilter } = inputs;
96
- if (spaceFilter !== void 0 && !isValidSpaceId(spaceFilter)) return notOk(errorInvalidSpaceId(spaceFilter));
97
- if (spaceFilter !== void 0 && !spaces.some((s) => s.spaceId === spaceFilter)) return notOk(errorSpaceNotFound(spaceFilter, spaces.map((s) => s.spaceId).sort()));
98
- const scopedSpaces = spaceFilter !== void 0 ? spaces.filter((s) => s.spaceId === spaceFilter) : spaces;
99
- const resultSpaces = scopedSpaces.length === 0 ? [{
100
- spaceId: APP_SPACE_ID,
101
- migrations: []
102
- }] : scopedSpaces;
103
- return ok({
104
- ok: true,
105
- spaces: resultSpaces,
106
- summary: computeSummary(resultSpaces)
107
- });
108
- }
109
- /**
110
- * CLI shell: loads config, resolves paths, prints the styled header on
111
- * stderr (interactive mode only), and delegates to {@link runMigrationList}.
112
- * Kept intentionally thin so the unit-testable surface lives in the core.
113
- */
114
- async function executeMigrationListCommand(options, flags, ui) {
115
- const config = await loadConfig(options.config);
116
- const { configPath, migrationsDir, migrationsRelative } = resolveMigrationPaths(options.config, config);
117
- if (!flags.json && !flags.quiet) {
118
- const header = formatStyledHeader({
119
- command: "migration list",
120
- description: "List on-disk migrations, latest first, per contract space",
121
- details: [
122
- {
123
- label: "config",
124
- value: configPath
125
- },
126
- {
127
- label: "migrations",
128
- value: migrationsRelative
129
- },
130
- ...options.space !== void 0 ? [{
131
- label: "space",
132
- value: options.space
133
- }] : []
134
- ],
135
- flags
136
- });
137
- ui.stderr(header);
138
- }
139
- const loaded = await buildReadAggregate(config, { migrationsDir });
140
- if (!loaded.ok) return notOk(loaded.failure);
141
- return runMigrationList({
142
- spaces: await migrationSpaceListEntriesFromAggregate(loaded.value.aggregate, migrationsDir),
143
- ...ifDefined("spaceFilter", options.space)
144
- });
145
- }
146
- function createMigrationListCommand() {
147
- const command = new Command("list");
148
- setCommandDescriptions(command, "List on-disk migrations, latest first, per contract space", "Enumerates every on-disk migration under migrations/<space>/ for every\ncontract space found on disk, latest first. Offline — does not consult\nthe database. Each row leads with a kind glyph (* forward, ↩ rollback,\n⟲ self), then dirName, then source → destination contract hashes\n(7-char git-style). Self-edges show a single hash. Invariants render as\n{...}; refs on the destination as (production, db). Pass --space <id>\nto narrow to one contract space. --ascii forces ASCII kind glyphs\n(orthogonal to --no-color).");
149
- setCommandExamples(command, [
150
- "prisma-next migration list",
151
- "prisma-next migration list --space app",
152
- "prisma-next migration list --ascii",
153
- "prisma-next migration list --json"
154
- ]);
155
- setCommandSeeAlso(command, [
156
- {
157
- verb: "migration status",
158
- oneLiner: "Show migration path and pending status"
159
- },
160
- {
161
- verb: "migration log",
162
- oneLiner: "Show executed migration history"
163
- },
164
- {
165
- verb: "migration graph",
166
- oneLiner: "Show the migration graph topology"
167
- },
168
- {
169
- verb: "migration show",
170
- oneLiner: "Display migration package contents"
171
- }
172
- ]);
173
- addGlobalOptions(command).option("--config <path>", "Path to prisma-next.config.ts").option("--space <id>", "Narrow output to a single contract space").option("--ascii", "Use ASCII kind glyphs (pipe-friendly)").action(async (options) => {
174
- const flags = parseGlobalFlagsOrExit(options);
175
- const ui = createTerminalUI(flags);
176
- const exitCode = handleResult(await executeMigrationListCommand(options, flags, ui), flags, ui, (listResult) => {
177
- if (flags.json) ui.output(JSON.stringify(listResult, null, 2));
178
- else if (!flags.quiet) ui.output(renderMigrationListHumanOutput(listResult, {
179
- glyphMode: ui.resolveGlyphMode(options.ascii === true),
180
- useColor: ui.useColor
181
- }));
182
- });
183
- process.exit(exitCode);
184
- });
185
- return command;
186
- }
187
- //#endregion
188
- export { createMigrationListCommand, executeMigrationListCommand, migrationSpaceListEntriesFromAggregate, renderMigrationListHumanOutput, runMigrationList };
189
-
190
- //# sourceMappingURL=migration-list.mjs.map
1
+ import { a as renderMigrationListHumanOutput, i as migrationSpaceListEntriesFromAggregate, n as executeMigrationListCommand, o as runMigrationList, r as listRefsByContractHash, t as createMigrationListCommand } from "../migration-list-C5sXrl0U.mjs";
2
+ export { createMigrationListCommand, executeMigrationListCommand, listRefsByContractHash, migrationSpaceListEntriesFromAggregate, renderMigrationListHumanOutput, runMigrationList };
@@ -1,30 +1,18 @@
1
- import { N as CliStructuredError } from "../types-Dt_SfqFm.mjs";
2
- import { n as GlobalFlags, t as CommonCommandOptions } from "../global-flags-DEHjV8_s.mjs";
1
+ import { N as CliStructuredError } from "../types-Mh7mdPHM.mjs";
2
+ import { n as GlobalFlags, t as CommonCommandOptions } from "../global-flags-DG4uY5tV.mjs";
3
3
  import { t as TerminalUI } from "../terminal-ui-5Y6mrg93.mjs";
4
4
  import { Command } from "commander";
5
5
  import { Result } from "@prisma-next/utils/result";
6
+ import { LedgerEntryRecord } from "@prisma-next/contract/types";
6
7
 
7
8
  //#region src/commands/migration-log.d.ts
8
9
  interface MigrationLogOptions extends CommonCommandOptions {
9
10
  readonly db?: string;
10
11
  readonly config?: string;
12
+ readonly utc?: boolean;
11
13
  }
12
- interface MigrationLogEntry {
13
- readonly dirName: string;
14
- readonly from: string;
15
- readonly to: string;
16
- readonly migrationHash: string;
17
- readonly operationCount: number;
18
- readonly createdAt: string;
19
- }
20
- interface MigrationLogResult {
21
- readonly ok: true;
22
- readonly markerHash: string | null;
23
- readonly applied: readonly MigrationLogEntry[];
24
- readonly summary: string;
25
- }
26
- declare function executeMigrationLogCommand(options: MigrationLogOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<MigrationLogResult, CliStructuredError>>;
14
+ declare function executeMigrationLogCommand(options: MigrationLogOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<readonly LedgerEntryRecord[], CliStructuredError>>;
27
15
  declare function createMigrationLogCommand(): Command;
28
16
  //#endregion
29
- export { MigrationLogEntry, MigrationLogResult, createMigrationLogCommand, executeMigrationLogCommand };
17
+ export { createMigrationLogCommand, executeMigrationLogCommand };
30
18
  //# sourceMappingURL=migration-log.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-log.d.mts","names":[],"sources":["../../src/commands/migration-log.ts"],"mappings":";;;;;;;UAgCU,mBAAA,SAA4B,oBAAoB;EAAA,SAC/C,EAAA;EAAA,SACA,MAAA;AAAA;AAAA,UAGM,iBAAA;EAAA,SACN,OAAA;EAAA,SACA,IAAA;EAAA,SACA,EAAA;EAAA,SACA,aAAA;EAAA,SACA,cAAA;EAAA,SACA,SAAA;AAAA;AAAA,UAGM,kBAAA;EAAA,SACN,EAAA;EAAA,SACA,UAAA;EAAA,SACA,OAAA,WAAkB,iBAAiB;EAAA,SACnC,OAAA;AAAA;AAAA,iBAGW,0BAAA,CACpB,OAAA,EAAS,mBAAA,EACT,KAAA,EAAO,WAAA,EACP,EAAA,EAAI,UAAA,GACH,OAAA,CAAQ,MAAA,CAAO,kBAAA,EAAoB,kBAAA;AAAA,iBA8GtB,yBAAA,CAAA,GAA6B,OAAO"}
1
+ {"version":3,"file":"migration-log.d.mts","names":[],"sources":["../../src/commands/migration-log.ts"],"mappings":";;;;;;;;UAkCU,mBAAA,SAA4B,oBAAoB;EAAA,SAC/C,EAAA;EAAA,SACA,MAAA;EAAA,SACA,GAAA;AAAA;AAAA,iBAGW,0BAAA,CACpB,OAAA,EAAS,mBAAA,EACT,KAAA,EAAO,WAAA,EACP,EAAA,EAAI,UAAA,GACH,OAAA,CAAQ,MAAA,UAAgB,iBAAA,IAAqB,kBAAA;AAAA,iBA4DhC,yBAAA,CAAA,GAA6B,OAAO"}
@@ -1,138 +1,2 @@
1
- import { t as loadConfig } from "../config-loader-B6sJjXTv.mjs";
2
- import { A as CliStructuredError, F as errorDatabaseConnectionRequired, L as errorDriverRequired, T as formatStyledHeader, _ as createTerminalUI, d as setCommandSeeAlso, f as targetSupportsMigrations, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, nt as mapMigrationToolsError, s as resolveMigrationPaths, t as addGlobalOptions, tt as errorUnexpected, u as setCommandExamples, y as handleResult } from "../command-helpers-Bbw1GbwL.mjs";
3
- import { t as createControlClient } from "../client-KgJorIvG.mjs";
4
- import { r as buildReadAggregate } from "../contract-space-aggregate-loader-DvZwdkrr.mjs";
5
- import { Command } from "commander";
6
- import { notOk, ok } from "@prisma-next/utils/result";
7
- import { cyan, dim } from "colorette";
8
- import { EMPTY_CONTRACT_HASH } from "@prisma-next/migration-tools/constants";
9
- import { MigrationToolsError } from "@prisma-next/migration-tools/errors";
10
- import { findPath } from "@prisma-next/migration-tools/migration-graph";
11
- //#region src/commands/migration-log.ts
12
- async function executeMigrationLogCommand(options, flags, ui) {
13
- const config = await loadConfig(options.config);
14
- const { configPath, appMigrationsRelative, migrationsDir } = resolveMigrationPaths(options.config, config);
15
- const dbConnection = options.db ?? config.db?.connection;
16
- if (!dbConnection) return notOk(errorDatabaseConnectionRequired({
17
- why: `Database connection is required for migration log (set db.connection in ${configPath}, or pass --db <url>)`,
18
- commandName: "migration log"
19
- }));
20
- if (!config.driver) return notOk(errorDriverRequired({ why: "Config.driver is required for migration log" }));
21
- if (!targetSupportsMigrations(config.target)) return notOk(errorUnexpected("Target does not support migrations"));
22
- if (!flags.json && !flags.quiet) {
23
- const header = formatStyledHeader({
24
- command: "migration log",
25
- description: "Show executed migration history",
26
- details: [
27
- {
28
- label: "config",
29
- value: configPath
30
- },
31
- {
32
- label: "migrations",
33
- value: appMigrationsRelative
34
- },
35
- ...typeof dbConnection === "string" ? [{
36
- label: "database",
37
- value: maskConnectionUrl(dbConnection)
38
- }] : []
39
- ],
40
- flags
41
- });
42
- ui.stderr(header);
43
- }
44
- const loaded = await buildReadAggregate(config, { migrationsDir });
45
- if (!loaded.ok) return loaded;
46
- const graph = loaded.value.aggregate.app.graph();
47
- const bundles = loaded.value.aggregate.app.packages;
48
- const client = createControlClient({
49
- family: config.family,
50
- target: config.target,
51
- adapter: config.adapter,
52
- driver: config.driver,
53
- extensionPacks: config.extensionPacks ?? []
54
- });
55
- try {
56
- await client.connect(dbConnection);
57
- const markerHash = (await client.readMarker())?.storageHash ?? null;
58
- if (!markerHash) return ok({
59
- ok: true,
60
- markerHash: null,
61
- applied: [],
62
- summary: "No migrations applied (database has no marker)"
63
- });
64
- const appliedPath = findPath(graph, EMPTY_CONTRACT_HASH, markerHash);
65
- if (appliedPath === null) return notOk(errorUnexpected("Database marker is not reachable from migration history", {
66
- why: `Marker hash ${markerHash} is not reachable from the root of the on-disk migration graph.`,
67
- fix: "The database may have been migrated outside this project. Use `migration status` to inspect the current state."
68
- }));
69
- const pkgByDirName = new Map(bundles.map((p) => [p.dirName, p]));
70
- const entries = appliedPath.map((edge) => {
71
- const ops = pkgByDirName.get(edge.dirName)?.ops ?? [];
72
- return {
73
- dirName: edge.dirName,
74
- from: edge.from,
75
- to: edge.to,
76
- migrationHash: edge.migrationHash,
77
- operationCount: ops.length,
78
- createdAt: edge.createdAt
79
- };
80
- });
81
- return ok({
82
- ok: true,
83
- markerHash,
84
- applied: entries,
85
- summary: `${entries.length} migration(s) applied`
86
- });
87
- } catch (error) {
88
- if (CliStructuredError.is(error)) return notOk(error);
89
- if (MigrationToolsError.is(error)) return notOk(mapMigrationToolsError(error));
90
- return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read migration log: ${error instanceof Error ? error.message : String(error)}` }));
91
- } finally {
92
- await client.close();
93
- }
94
- }
95
- function createMigrationLogCommand() {
96
- const command = new Command("log");
97
- setCommandDescriptions(command, "Show executed migration history", "Reads the database marker and displays the applied migration chain\nfrom the initial state to the current marker position.");
98
- setCommandExamples(command, ["prisma-next migration log --db $DATABASE_URL", "prisma-next migration log --json --db $DATABASE_URL"]);
99
- setCommandSeeAlso(command, [
100
- {
101
- verb: "migration status",
102
- oneLiner: "Show migration path and pending status"
103
- },
104
- {
105
- verb: "migration list",
106
- oneLiner: "List on-disk migrations"
107
- },
108
- {
109
- verb: "migration graph",
110
- oneLiner: "Show the migration graph topology"
111
- },
112
- {
113
- verb: "migration show",
114
- oneLiner: "Display migration package contents"
115
- }
116
- ]);
117
- addGlobalOptions(command).option("--db <url>", "Database connection string").option("--config <path>", "Path to prisma-next.config.ts").action(async (options) => {
118
- const flags = parseGlobalFlagsOrExit(options);
119
- const ui = createTerminalUI(flags);
120
- const exitCode = handleResult(await executeMigrationLogCommand(options, flags, ui), flags, ui, (logResult) => {
121
- if (flags.json) ui.output(JSON.stringify(logResult, null, 2));
122
- else if (!flags.quiet) {
123
- const c = (fn, s) => flags.color !== false ? fn(s) : s;
124
- if (logResult.applied.length === 0) ui.log(logResult.summary);
125
- else {
126
- for (const entry of logResult.applied) ui.log(`${c(cyan, "✓")} ${entry.dirName} ${c(dim, entry.migrationHash.slice(0, 16) + "…")} ${entry.operationCount} op(s)`);
127
- ui.log(`\n${logResult.summary}`);
128
- }
129
- }
130
- });
131
- process.exit(exitCode);
132
- });
133
- return command;
134
- }
135
- //#endregion
1
+ import { n as executeMigrationLogCommand, t as createMigrationLogCommand } from "../migration-log-DD_vCbYW.mjs";
136
2
  export { createMigrationLogCommand, executeMigrationLogCommand };
137
-
138
- //# sourceMappingURL=migration-log.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { t as loadConfig } from "../config-loader-B6sJjXTv.mjs";
2
- import { $ as errorTargetMigrationNotSupported, A as CliStructuredError, R as errorFileNotFound, T as formatStyledHeader, X as errorRuntime, _ as createTerminalUI, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, o as resolveContractPath, r as getTargetMigrations, s as resolveMigrationPaths, t as addGlobalOptions, tt as errorUnexpected, u as setCommandExamples, y as handleResult } from "../command-helpers-Bbw1GbwL.mjs";
3
- import { t as assertFrameworkComponentsCompatible } from "../framework-components-fYXjz_in.mjs";
4
- import { s as refusePackageCorruptionOnAggregate } from "../contract-space-aggregate-loader-DvZwdkrr.mjs";
2
+ import { A as formatStyledHeader, F as CliStructuredError, U as errorFileNotFound, _ as createTerminalUI, at as errorTargetMigrationNotSupported, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, nt as errorRuntime, o as resolveContractPath, r as getTargetMigrations, s as resolveMigrationPaths, st as errorUnexpected, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from "../command-helpers-DK_5ItoJ.mjs";
3
+ import { t as assertFrameworkComponentsCompatible } from "../framework-components-CxOVKAAh.mjs";
4
+ import { o as refusePackageCorruptionOnAggregate } from "../contract-space-aggregate-loader-Dbr3-jHF.mjs";
5
5
  import { Command } from "commander";
6
6
  import { getEmittedArtifactPaths } from "@prisma-next/emitter";
7
7
  import { notOk, ok } from "@prisma-next/utils/result";
@@ -1,4 +1,4 @@
1
- import { n as GlobalFlags } from "../global-flags-DEHjV8_s.mjs";
1
+ import { n as GlobalFlags } from "../global-flags-DG4uY5tV.mjs";
2
2
  import { Command } from "commander";
3
3
  import { Result } from "@prisma-next/utils/result";
4
4
  import { OperationPreview } from "@prisma-next/framework-components/control";
@@ -1,2 +1,2 @@
1
- import { n as formatMigrationPlanOutput, r as resolveBundleByPrefix, t as createMigrationPlanCommand } from "../migration-plan-9DJ7q7_z.mjs";
1
+ import { n as formatMigrationPlanOutput, r as resolveBundleByPrefix, t as createMigrationPlanCommand } from "../migration-plan-CeTjQOIG.mjs";
2
2
  export { createMigrationPlanCommand, formatMigrationPlanOutput, resolveBundleByPrefix };
@@ -1,4 +1,4 @@
1
- import { N as CliStructuredError } from "../types-Dt_SfqFm.mjs";
1
+ import { N as CliStructuredError } from "../types-Mh7mdPHM.mjs";
2
2
  import { Command } from "commander";
3
3
  import { Result } from "@prisma-next/utils/result";
4
4
  import { OperationPreview } from "@prisma-next/framework-components/control";
@@ -1,15 +1,14 @@
1
1
  import { t as loadConfig } from "../config-loader-B6sJjXTv.mjs";
2
- import { P as errorContractValidationFailed, R as errorFileNotFound, T as formatStyledHeader, X as errorRuntime, _ as createTerminalUI, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, o as resolveContractPath, rt as mapRefResolutionError, s as resolveMigrationPaths, t as addGlobalOptions, tt as errorUnexpected, u as setCommandExamples, y as handleResult } from "../command-helpers-Bbw1GbwL.mjs";
3
- import { t as createControlClient } from "../client-KgJorIvG.mjs";
4
- import { a as formatMigrationShowOutput } from "../migrations-Cv2jxNNK.mjs";
2
+ import { A as formatStyledHeader, E as formatMigrationShowOutput, U as errorFileNotFound, _ as createTerminalUI, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, lt as mapRefResolutionError, nt as errorRuntime, o as resolveContractPath, s as resolveMigrationPaths, st as errorUnexpected, t as addGlobalOptions, u as setCommandExamples, y as handleResult, z as errorContractValidationFailed } from "../command-helpers-DK_5ItoJ.mjs";
3
+ import { t as createControlClient } from "../client-xeWpMlq1.mjs";
5
4
  import { Command } from "commander";
6
5
  import { ifDefined } from "@prisma-next/utils/defined";
7
6
  import { notOk, ok } from "@prisma-next/utils/result";
8
7
  import { isAbsolute, relative, resolve } from "pathe";
9
8
  import { readFile } from "node:fs/promises";
10
9
  import { APP_SPACE_ID, createControlStack } from "@prisma-next/framework-components/control";
11
- import { loadContractSpaceAggregate } from "@prisma-next/migration-tools/aggregate";
12
10
  import { castAs } from "@prisma-next/utils/casts";
11
+ import { loadContractSpaceAggregate } from "@prisma-next/migration-tools/aggregate";
13
12
  import { parseMigrationRef } from "@prisma-next/migration-tools/ref-resolution";
14
13
  //#region src/commands/migration-show.ts
15
14
  function looksLikePath(target) {
@@ -1 +1 @@
1
- {"version":3,"file":"migration-show.mjs","names":[],"sources":["../../src/commands/migration-show.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport type { Contract } from '@prisma-next/contract/types';\nimport {\n APP_SPACE_ID,\n createControlStack,\n type MigrationPlanOperation,\n type OperationPreview,\n} from '@prisma-next/framework-components/control';\nimport { loadContractSpaceAggregate } from '@prisma-next/migration-tools/aggregate';\nimport type { OnDiskMigrationPackage } from '@prisma-next/migration-tools/package';\nimport { parseMigrationRef } from '@prisma-next/migration-tools/ref-resolution';\nimport { castAs } from '@prisma-next/utils/casts';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { notOk, ok, type Result } from '@prisma-next/utils/result';\nimport { Command } from 'commander';\nimport { isAbsolute, relative, resolve } from 'pathe';\nimport { loadConfig } from '../config-loader';\nimport { createControlClient } from '../control-api/client';\nimport {\n type CliStructuredError,\n errorContractValidationFailed,\n errorFileNotFound,\n errorRuntime,\n errorUnexpected,\n mapRefResolutionError,\n} from '../utils/cli-errors';\nimport {\n addGlobalOptions,\n resolveContractPath,\n resolveMigrationPaths,\n setCommandDescriptions,\n setCommandExamples,\n setCommandSeeAlso,\n} from '../utils/command-helpers';\nimport { formatMigrationShowOutput } from '../utils/formatters/migrations';\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 MigrationShowOptions extends CommonCommandOptions {\n readonly config?: string;\n}\n\nexport interface MigrationShowPresent {\n readonly spaceId: string;\n readonly dirName: string;\n readonly dirPath: string;\n readonly from: string | null;\n readonly to: string;\n readonly migrationHash: string;\n readonly createdAt: string;\n readonly operations: readonly {\n readonly id: string;\n readonly label: string;\n readonly operationClass: string;\n }[];\n readonly preview: OperationPreview;\n readonly summary: string;\n}\n\nexport interface MigrationShowResult {\n readonly ok: true;\n readonly migration: MigrationShowPresent;\n}\n\nfunction looksLikePath(target: string): boolean {\n return target.includes('/') || target.includes('\\\\');\n}\n\nexport function resolveAppTargetPath(\n target: string,\n appMigrationsDir: string,\n appMigrationsRelative: string,\n): Result<string, CliStructuredError> {\n const targetPath = resolve(target);\n const relativeToApp = relative(appMigrationsDir, targetPath);\n const isOutsideAppDir =\n relativeToApp === '' ||\n relativeToApp === '.' ||\n relativeToApp.startsWith('..') ||\n isAbsolute(relativeToApp);\n if (isOutsideAppDir) {\n return notOk(\n errorRuntime('Target must point to an app-space migration', {\n why: `Expected a path under ${appMigrationsRelative}, got ${target}`,\n fix: 'Pass an app-space migration directory or use a hash prefix.',\n }),\n );\n }\n return ok(targetPath);\n}\n\nfunction pkgToPresent(\n spaceId: string,\n pkg: OnDiskMigrationPackage,\n client: ReturnType<typeof createControlClient>,\n): MigrationShowPresent {\n const ops = castAs<readonly MigrationPlanOperation[]>(pkg.ops);\n const preview: OperationPreview = client.toOperationPreview(ops) ?? { statements: [] };\n return {\n spaceId,\n dirName: pkg.dirName,\n dirPath: relative(process.cwd(), pkg.dirPath),\n from: pkg.metadata.from,\n to: pkg.metadata.to,\n migrationHash: pkg.metadata.migrationHash,\n createdAt: pkg.metadata.createdAt,\n operations: ops.map((op) => ({\n id: op.id,\n label: op.label,\n operationClass: op.operationClass,\n })),\n preview,\n summary: `${ops.length} operation(s)`,\n };\n}\n\nfunction findPackageByDirPath(\n packages: readonly OnDiskMigrationPackage[],\n resolvedDirPath: string,\n): OnDiskMigrationPackage | undefined {\n const normalized = resolve(resolvedDirPath);\n return packages.find((p) => resolve(p.dirPath) === normalized);\n}\n\nasync function executeMigrationShowCommand(\n target: string,\n options: MigrationShowOptions,\n flags: GlobalFlags,\n ui: TerminalUI,\n): Promise<Result<MigrationShowResult, CliStructuredError>> {\n const config = await loadConfig(options.config);\n const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } =\n resolveMigrationPaths(options.config, config);\n\n const contractPathAbsolute = resolveContractPath(config);\n const contractPath = relative(process.cwd(), contractPathAbsolute);\n\n if (!flags.json && !flags.quiet) {\n const header = formatStyledHeader({\n command: 'migration show',\n description: 'Display migration package contents',\n details: [\n { label: 'config', value: configPath },\n { label: 'contract', value: contractPath },\n { label: 'migrations', value: appMigrationsRelative },\n { label: 'target', value: target },\n ],\n flags,\n });\n ui.stderr(header);\n }\n\n const client = createControlClient({\n family: config.family,\n target: config.target,\n adapter: config.adapter,\n ...ifDefined('driver', config.driver),\n extensionPacks: config.extensionPacks ?? [],\n });\n\n let contractJsonContent: string;\n try {\n contractJsonContent = await readFile(contractPathAbsolute, 'utf-8');\n } catch (error) {\n if (error instanceof Error && (error as NodeJS.ErrnoException).code === 'ENOENT') {\n return notOk(\n errorFileNotFound(contractPathAbsolute, {\n why: `Contract file not found at ${contractPathAbsolute}`,\n fix: `Run \\`prisma-next contract emit\\` to generate ${contractPath}`,\n }),\n );\n }\n return notOk(\n errorUnexpected(error instanceof Error ? error.message : String(error), {\n why: 'Failed to read contract file',\n }),\n );\n }\n\n const stack = createControlStack(config);\n const familyInstance = config.family.create(stack);\n\n let appContract: Contract;\n try {\n appContract = familyInstance.deserializeContract(\n castAs<unknown>(JSON.parse(contractJsonContent)),\n );\n } catch (error) {\n return notOk(\n errorContractValidationFailed(\n `Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`,\n { where: { path: contractPathAbsolute } },\n ),\n );\n }\n\n const aggregate = await loadContractSpaceAggregate({\n migrationsDir,\n appContract,\n deserializeContract: (json: unknown) => familyInstance.deserializeContract(json),\n });\n\n const packages = aggregate.app.packages;\n const graph = aggregate.app.graph();\n const refs = aggregate.app.refs;\n\n let appPkg: OnDiskMigrationPackage;\n if (looksLikePath(target)) {\n const resolved = resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative);\n if (!resolved.ok) return resolved;\n const matched = findPackageByDirPath(packages, resolved.value);\n if (!matched) {\n return notOk(\n errorRuntime('Migration package not found', {\n why: `No loaded migration package at ${relative(process.cwd(), resolved.value)}`,\n fix: 'Pass a directory name, hash prefix, or path to an on-disk app-space migration package.',\n }),\n );\n }\n appPkg = matched;\n } else {\n if (packages.length === 0) {\n return notOk(\n errorRuntime('No migrations found', {\n why: `No migration packages found in ${appMigrationsRelative}`,\n fix: 'Run `prisma-next migration plan` to create a migration first.',\n }),\n );\n }\n const migResult = parseMigrationRef(target, { graph, refs });\n if (!migResult.ok) {\n return notOk(mapRefResolutionError(migResult.failure));\n }\n const matchedPkg = packages.find(\n (p) => p.metadata.migrationHash === migResult.value.migrationHash,\n );\n if (!matchedPkg) {\n return notOk(\n errorRuntime('Migration package not found', {\n why: `Resolved migration \"${migResult.value.dirName}\" but the package was not loaded`,\n fix: 'The migrations directory may be corrupted. Inspect the migration.json files.',\n }),\n );\n }\n appPkg = matchedPkg;\n }\n\n return ok({\n ok: true,\n migration: pkgToPresent(APP_SPACE_ID, appPkg, client),\n });\n}\n\nexport function createMigrationShowCommand(): Command {\n const command = new Command('show');\n setCommandDescriptions(\n command,\n 'Display migration package contents',\n 'Shows the operations, statement preview, and metadata for one app-space migration.\\n' +\n 'Accepts a directory path, directory name, or hash prefix.',\n );\n setCommandExamples(command, [\n 'prisma-next migration show 20260101_100000_add_user',\n 'prisma-next migration show sha256:a1b2c3',\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 list', oneLiner: 'List on-disk migrations' },\n { verb: 'migration graph', oneLiner: 'Show the migration graph topology' },\n ]);\n addGlobalOptions(command)\n .argument('<target>', 'Migration reference: directory name, hash/prefix, or path')\n .option('--config <path>', 'Path to prisma-next.config.ts')\n .action(async (target: string, options: MigrationShowOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n\n const ui = createTerminalUI(flags);\n\n const result = await executeMigrationShowCommand(target, options, flags, ui);\n\n const exitCode = handleResult(result, flags, ui, (showResult) => {\n if (flags.json) {\n ui.output(JSON.stringify(showResult, null, 2));\n } else if (!flags.quiet) {\n ui.log(formatMigrationShowOutput(showResult, flags));\n }\n });\n\n process.exit(exitCode);\n });\n\n return command;\n}\n"],"mappings":";;;;;;;;;;;;;;AAmEA,SAAS,cAAc,QAAyB;CAC9C,OAAO,OAAO,SAAS,GAAG,KAAK,OAAO,SAAS,IAAI;AACrD;AAEA,SAAgB,qBACd,QACA,kBACA,uBACoC;CACpC,MAAM,aAAa,QAAQ,MAAM;CACjC,MAAM,gBAAgB,SAAS,kBAAkB,UAAU;CAM3D,IAJE,kBAAkB,MAClB,kBAAkB,OAClB,cAAc,WAAW,IAAI,KAC7B,WAAW,aAAa,GAExB,OAAO,MACL,aAAa,+CAA+C;EAC1D,KAAK,yBAAyB,sBAAsB,QAAQ;EAC5D,KAAK;CACP,CAAC,CACH;CAEF,OAAO,GAAG,UAAU;AACtB;AAEA,SAAS,aACP,SACA,KACA,QACsB;CACtB,MAAM,MAAM,OAA0C,IAAI,GAAG;CAC7D,MAAM,UAA4B,OAAO,mBAAmB,GAAG,KAAK,EAAE,YAAY,CAAC,EAAE;CACrF,OAAO;EACL;EACA,SAAS,IAAI;EACb,SAAS,SAAS,QAAQ,IAAI,GAAG,IAAI,OAAO;EAC5C,MAAM,IAAI,SAAS;EACnB,IAAI,IAAI,SAAS;EACjB,eAAe,IAAI,SAAS;EAC5B,WAAW,IAAI,SAAS;EACxB,YAAY,IAAI,KAAK,QAAQ;GAC3B,IAAI,GAAG;GACP,OAAO,GAAG;GACV,gBAAgB,GAAG;EACrB,EAAE;EACF;EACA,SAAS,GAAG,IAAI,OAAO;CACzB;AACF;AAEA,SAAS,qBACP,UACA,iBACoC;CACpC,MAAM,aAAa,QAAQ,eAAe;CAC1C,OAAO,SAAS,MAAM,MAAM,QAAQ,EAAE,OAAO,MAAM,UAAU;AAC/D;AAEA,eAAe,4BACb,QACA,SACA,OACA,IAC0D;CAC1D,MAAM,SAAS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CAC1B,uDACA,0CACF,CAAC;CACD,kBAAkB,SAAS;EACzB;GAAE,MAAM;GAAoB,UAAU;EAAyC;EAC/E;GAAE,MAAM;GAAiB,UAAU;EAAkC;EACrE;GAAE,MAAM;GAAkB,UAAU;EAA0B;EAC9D;GAAE,MAAM;GAAmB,UAAU;EAAoC;CAC3E,CAAC;CACD,iBAAiB,OAAO,EACrB,SAAS,YAAY,2DAA2D,EAChF,OAAO,mBAAmB,+BAA+B,EACzD,OAAO,OAAO,QAAgB,YAAkC;EAC/D,MAAM,QAAQ,uBAAuB,OAAO;EAE5C,MAAM,KAAK,iBAAiB,KAAK;EAIjC,MAAM,WAAW,aAAa,MAFT,4BAA4B,QAAQ,SAAS,OAAO,EAAE,GAErC,OAAO,KAAK,eAAe;GAC/D,IAAI,MAAM,MACR,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,OAChB,GAAG,IAAI,0BAA0B,YAAY,KAAK,CAAC;EAEvD,CAAC;EAED,QAAQ,KAAK,QAAQ;CACvB,CAAC;CAEH,OAAO;AACT"}
1
+ {"version":3,"file":"migration-show.mjs","names":[],"sources":["../../src/commands/migration-show.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport type { Contract } from '@prisma-next/contract/types';\nimport {\n APP_SPACE_ID,\n createControlStack,\n type MigrationPlanOperation,\n type OperationPreview,\n} from '@prisma-next/framework-components/control';\nimport { loadContractSpaceAggregate } from '@prisma-next/migration-tools/aggregate';\nimport type { OnDiskMigrationPackage } from '@prisma-next/migration-tools/package';\nimport { parseMigrationRef } from '@prisma-next/migration-tools/ref-resolution';\nimport { castAs } from '@prisma-next/utils/casts';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { notOk, ok, type Result } from '@prisma-next/utils/result';\nimport { Command } from 'commander';\nimport { isAbsolute, relative, resolve } from 'pathe';\nimport { loadConfig } from '../config-loader';\nimport { createControlClient } from '../control-api/client';\nimport {\n type CliStructuredError,\n errorContractValidationFailed,\n errorFileNotFound,\n errorRuntime,\n errorUnexpected,\n mapRefResolutionError,\n} from '../utils/cli-errors';\nimport {\n addGlobalOptions,\n resolveContractPath,\n resolveMigrationPaths,\n setCommandDescriptions,\n setCommandExamples,\n setCommandSeeAlso,\n} from '../utils/command-helpers';\nimport { formatMigrationShowOutput } from '../utils/formatters/migrations';\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 MigrationShowOptions extends CommonCommandOptions {\n readonly config?: string;\n}\n\nexport interface MigrationShowPresent {\n readonly spaceId: string;\n readonly dirName: string;\n readonly dirPath: string;\n readonly from: string | null;\n readonly to: string;\n readonly migrationHash: string;\n readonly createdAt: string;\n readonly operations: readonly {\n readonly id: string;\n readonly label: string;\n readonly operationClass: string;\n }[];\n readonly preview: OperationPreview;\n readonly summary: string;\n}\n\nexport interface MigrationShowResult {\n readonly ok: true;\n readonly migration: MigrationShowPresent;\n}\n\nfunction looksLikePath(target: string): boolean {\n return target.includes('/') || target.includes('\\\\');\n}\n\nexport function resolveAppTargetPath(\n target: string,\n appMigrationsDir: string,\n appMigrationsRelative: string,\n): Result<string, CliStructuredError> {\n const targetPath = resolve(target);\n const relativeToApp = relative(appMigrationsDir, targetPath);\n const isOutsideAppDir =\n relativeToApp === '' ||\n relativeToApp === '.' ||\n relativeToApp.startsWith('..') ||\n isAbsolute(relativeToApp);\n if (isOutsideAppDir) {\n return notOk(\n errorRuntime('Target must point to an app-space migration', {\n why: `Expected a path under ${appMigrationsRelative}, got ${target}`,\n fix: 'Pass an app-space migration directory or use a hash prefix.',\n }),\n );\n }\n return ok(targetPath);\n}\n\nfunction pkgToPresent(\n spaceId: string,\n pkg: OnDiskMigrationPackage,\n client: ReturnType<typeof createControlClient>,\n): MigrationShowPresent {\n const ops = castAs<readonly MigrationPlanOperation[]>(pkg.ops);\n const preview: OperationPreview = client.toOperationPreview(ops) ?? { statements: [] };\n return {\n spaceId,\n dirName: pkg.dirName,\n dirPath: relative(process.cwd(), pkg.dirPath),\n from: pkg.metadata.from,\n to: pkg.metadata.to,\n migrationHash: pkg.metadata.migrationHash,\n createdAt: pkg.metadata.createdAt,\n operations: ops.map((op) => ({\n id: op.id,\n label: op.label,\n operationClass: op.operationClass,\n })),\n preview,\n summary: `${ops.length} operation(s)`,\n };\n}\n\nfunction findPackageByDirPath(\n packages: readonly OnDiskMigrationPackage[],\n resolvedDirPath: string,\n): OnDiskMigrationPackage | undefined {\n const normalized = resolve(resolvedDirPath);\n return packages.find((p) => resolve(p.dirPath) === normalized);\n}\n\nasync function executeMigrationShowCommand(\n target: string,\n options: MigrationShowOptions,\n flags: GlobalFlags,\n ui: TerminalUI,\n): Promise<Result<MigrationShowResult, CliStructuredError>> {\n const config = await loadConfig(options.config);\n const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } =\n resolveMigrationPaths(options.config, config);\n\n const contractPathAbsolute = resolveContractPath(config);\n const contractPath = relative(process.cwd(), contractPathAbsolute);\n\n if (!flags.json && !flags.quiet) {\n const header = formatStyledHeader({\n command: 'migration show',\n description: 'Display migration package contents',\n details: [\n { label: 'config', value: configPath },\n { label: 'contract', value: contractPath },\n { label: 'migrations', value: appMigrationsRelative },\n { label: 'target', value: target },\n ],\n flags,\n });\n ui.stderr(header);\n }\n\n const client = createControlClient({\n family: config.family,\n target: config.target,\n adapter: config.adapter,\n ...ifDefined('driver', config.driver),\n extensionPacks: config.extensionPacks ?? [],\n });\n\n let contractJsonContent: string;\n try {\n contractJsonContent = await readFile(contractPathAbsolute, 'utf-8');\n } catch (error) {\n if (error instanceof Error && (error as NodeJS.ErrnoException).code === 'ENOENT') {\n return notOk(\n errorFileNotFound(contractPathAbsolute, {\n why: `Contract file not found at ${contractPathAbsolute}`,\n fix: `Run \\`prisma-next contract emit\\` to generate ${contractPath}`,\n }),\n );\n }\n return notOk(\n errorUnexpected(error instanceof Error ? error.message : String(error), {\n why: 'Failed to read contract file',\n }),\n );\n }\n\n const stack = createControlStack(config);\n const familyInstance = config.family.create(stack);\n\n let appContract: Contract;\n try {\n appContract = familyInstance.deserializeContract(\n castAs<unknown>(JSON.parse(contractJsonContent)),\n );\n } catch (error) {\n return notOk(\n errorContractValidationFailed(\n `Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`,\n { where: { path: contractPathAbsolute } },\n ),\n );\n }\n\n const aggregate = await loadContractSpaceAggregate({\n migrationsDir,\n appContract,\n deserializeContract: (json: unknown) => familyInstance.deserializeContract(json),\n });\n\n const packages = aggregate.app.packages;\n const graph = aggregate.app.graph();\n const refs = aggregate.app.refs;\n\n let appPkg: OnDiskMigrationPackage;\n if (looksLikePath(target)) {\n const resolved = resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative);\n if (!resolved.ok) return resolved;\n const matched = findPackageByDirPath(packages, resolved.value);\n if (!matched) {\n return notOk(\n errorRuntime('Migration package not found', {\n why: `No loaded migration package at ${relative(process.cwd(), resolved.value)}`,\n fix: 'Pass a directory name, hash prefix, or path to an on-disk app-space migration package.',\n }),\n );\n }\n appPkg = matched;\n } else {\n if (packages.length === 0) {\n return notOk(\n errorRuntime('No migrations found', {\n why: `No migration packages found in ${appMigrationsRelative}`,\n fix: 'Run `prisma-next migration plan` to create a migration first.',\n }),\n );\n }\n const migResult = parseMigrationRef(target, { graph, refs });\n if (!migResult.ok) {\n return notOk(mapRefResolutionError(migResult.failure));\n }\n const matchedPkg = packages.find(\n (p) => p.metadata.migrationHash === migResult.value.migrationHash,\n );\n if (!matchedPkg) {\n return notOk(\n errorRuntime('Migration package not found', {\n why: `Resolved migration \"${migResult.value.dirName}\" but the package was not loaded`,\n fix: 'The migrations directory may be corrupted. Inspect the migration.json files.',\n }),\n );\n }\n appPkg = matchedPkg;\n }\n\n return ok({\n ok: true,\n migration: pkgToPresent(APP_SPACE_ID, appPkg, client),\n });\n}\n\nexport function createMigrationShowCommand(): Command {\n const command = new Command('show');\n setCommandDescriptions(\n command,\n 'Display migration package contents',\n 'Shows the operations, statement preview, and metadata for one app-space migration.\\n' +\n 'Accepts a directory path, directory name, or hash prefix.',\n );\n setCommandExamples(command, [\n 'prisma-next migration show 20260101_100000_add_user',\n 'prisma-next migration show sha256:a1b2c3',\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 list', oneLiner: 'List on-disk migrations' },\n { verb: 'migration graph', oneLiner: 'Show the migration graph topology' },\n ]);\n addGlobalOptions(command)\n .argument('<target>', 'Migration reference: directory name, hash/prefix, or path')\n .option('--config <path>', 'Path to prisma-next.config.ts')\n .action(async (target: string, options: MigrationShowOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n\n const ui = createTerminalUI(flags);\n\n const result = await executeMigrationShowCommand(target, options, flags, ui);\n\n const exitCode = handleResult(result, flags, ui, (showResult) => {\n if (flags.json) {\n ui.output(JSON.stringify(showResult, null, 2));\n } else if (!flags.quiet) {\n ui.log(formatMigrationShowOutput(showResult, flags));\n }\n });\n\n process.exit(exitCode);\n });\n\n return command;\n}\n"],"mappings":";;;;;;;;;;;;;AAmEA,SAAS,cAAc,QAAyB;CAC9C,OAAO,OAAO,SAAS,GAAG,KAAK,OAAO,SAAS,IAAI;AACrD;AAEA,SAAgB,qBACd,QACA,kBACA,uBACoC;CACpC,MAAM,aAAa,QAAQ,MAAM;CACjC,MAAM,gBAAgB,SAAS,kBAAkB,UAAU;CAM3D,IAJE,kBAAkB,MAClB,kBAAkB,OAClB,cAAc,WAAW,IAAI,KAC7B,WAAW,aAAa,GAExB,OAAO,MACL,aAAa,+CAA+C;EAC1D,KAAK,yBAAyB,sBAAsB,QAAQ;EAC5D,KAAK;CACP,CAAC,CACH;CAEF,OA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