@prisma-next/cli 0.12.0 → 0.13.0-dev.2
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/README.md +2 -2
- package/dist/cli.mjs +180 -163
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-KgJorIvG.mjs → client-CJzuo5wX.mjs} +222 -107
- package/dist/client-CJzuo5wX.mjs.map +1 -0
- package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-DGMvGBeX.mjs} +318 -25
- package/dist/command-helpers-DGMvGBeX.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 +4 -5
- 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 -3
- 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 -6
- 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 +10 -7
- 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 +37 -3
- package/dist/commands/migrate.d.mts.map +1 -1
- package/dist/commands/migrate.mjs +298 -12
- package/dist/commands/migrate.mjs.map +1 -1
- package/dist/commands/migration-check.d.mts +55 -13
- package/dist/commands/migration-check.d.mts.map +1 -1
- package/dist/commands/migration-check.mjs +3 -2
- package/dist/commands/migration-graph.d.mts +17 -8
- package/dist/commands/migration-graph.d.mts.map +1 -1
- package/dist/commands/migration-graph.mjs +185 -2
- package/dist/commands/migration-graph.mjs.map +1 -0
- package/dist/commands/migration-list.d.mts +26 -27
- package/dist/commands/migration-list.d.mts.map +1 -1
- package/dist/commands/migration-list.mjs +2 -190
- package/dist/commands/migration-log.d.mts +9 -19
- package/dist/commands/migration-log.d.mts.map +1 -1
- package/dist/commands/migration-log.mjs +1 -137
- package/dist/commands/migration-new.d.mts.map +1 -1
- package/dist/commands/migration-new.mjs +6 -5
- package/dist/commands/migration-new.mjs.map +1 -1
- package/dist/commands/migration-plan.d.mts +1 -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 +17 -21
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +24 -36
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +42 -144
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +3 -759
- package/dist/commands/ref.d.mts +1 -1
- package/dist/commands/ref.d.mts.map +1 -1
- package/dist/commands/ref.mjs +4 -4
- package/dist/commands/ref.mjs.map +1 -1
- package/dist/commands/telemetry/index.d.mts +7 -0
- package/dist/commands/telemetry/index.d.mts.map +1 -0
- package/dist/commands/telemetry/index.mjs +2 -0
- package/dist/{config-loader-B6sJjXTv.mjs → config-loader-p9JMrekQ.mjs} +1 -1
- package/dist/{config-loader-B6sJjXTv.mjs.map → config-loader-p9JMrekQ.mjs.map} +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-CFXsstzm.mjs} +2 -2
- package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-CFXsstzm.mjs.map} +1 -1
- package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-B_qriF8B.mjs} +5 -5
- package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-B_qriF8B.mjs.map} +1 -1
- package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-C8HmtboH.mjs} +12 -7
- package/dist/contract-emit-C8HmtboH.mjs.map +1 -0
- package/dist/{contract-enrichment-a0V5Y_mL.mjs → contract-enrichment-gn9sWbPw.mjs} +1 -1
- package/dist/{contract-enrichment-a0V5Y_mL.mjs.map → contract-enrichment-gn9sWbPw.mjs.map} +1 -1
- package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-BYT_ra_U.mjs} +5 -5
- package/dist/contract-infer-BYT_ra_U.mjs.map +1 -0
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-ClI1KN6d.mjs} +5 -5
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-ClI1KN6d.mjs.map} +1 -1
- package/dist/{db-verify-v_vUKXTU.mjs → db-verify-C24FKhb7.mjs} +6 -6
- package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-C24FKhb7.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +5 -3
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +3 -3
- package/dist/exports/index.mjs +1 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/init-output.d.mts +1 -3
- package/dist/exports/init-output.d.mts.map +1 -1
- package/dist/exports/init-output.mjs +1 -1
- package/dist/{extension-pack-inputs-IDvjRCi3.mjs → extension-pack-inputs-1ySHqxKG.mjs} +1 -1
- package/dist/{extension-pack-inputs-IDvjRCi3.mjs.map → extension-pack-inputs-1ySHqxKG.mjs.map} +1 -1
- package/dist/{framework-components-fYXjz_in.mjs → framework-components-YVQHhPH7.mjs} +2 -2
- package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-YVQHhPH7.mjs.map} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-BpoOYtNZ.d.mts} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-BpoOYtNZ.d.mts.map} +1 -1
- package/dist/{init-Cv9UzWL5.mjs → init-0HwB-Vh8.mjs} +5 -58
- package/dist/init-0HwB-Vh8.mjs.map +1 -0
- package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-DF6IwcDl.mjs} +7 -5
- package/dist/inspect-live-schema-DF6IwcDl.mjs.map +1 -0
- package/dist/migration-check-VwM8xCZV.mjs +574 -0
- package/dist/migration-check-VwM8xCZV.mjs.map +1 -0
- package/dist/migration-cli.mjs +1 -1
- package/dist/migration-cli.mjs.map +1 -1
- package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-DA-Lhx6o.mjs} +5 -5
- package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-DA-Lhx6o.mjs.map} +1 -1
- package/dist/migration-graph-command-render-CEez7YUK.mjs +1960 -0
- package/dist/migration-graph-command-render-CEez7YUK.mjs.map +1 -0
- package/dist/migration-list-DlJJ_38Z.mjs +230 -0
- package/dist/migration-list-DlJJ_38Z.mjs.map +1 -0
- package/dist/migration-log-CG0qQAFm.mjs +222 -0
- package/dist/migration-log-CG0qQAFm.mjs.map +1 -0
- package/dist/migration-path-target-Ce6OZImp.mjs +38 -0
- package/dist/migration-path-target-Ce6OZImp.mjs.map +1 -0
- package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-z5Ing-TD.mjs} +9 -8
- package/dist/migration-plan-z5Ing-TD.mjs.map +1 -0
- package/dist/migration-status-CD-LC2Ip.mjs +447 -0
- package/dist/migration-status-CD-LC2Ip.mjs.map +1 -0
- package/dist/{output-B60Gw5fu.mjs → output-mEQ74_nd.mjs} +1 -1
- package/dist/{output-B60Gw5fu.mjs.map → output-mEQ74_nd.mjs.map} +1 -1
- package/dist/{progress-adapter-C644QK8l.mjs → progress-adapter-CjAeTxY_.mjs} +1 -1
- package/dist/{progress-adapter-C644QK8l.mjs.map → progress-adapter-CjAeTxY_.mjs.map} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-BkXlikCA.mjs} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-BkXlikCA.mjs.map} +1 -1
- package/dist/schemas-CeGMYFYX.d.mts +191 -0
- package/dist/schemas-CeGMYFYX.d.mts.map +1 -0
- package/dist/schemas-KhXMzNA_.mjs +112 -0
- package/dist/schemas-KhXMzNA_.mjs.map +1 -0
- package/dist/telemetry-BIM4beEO.mjs +122 -0
- package/dist/telemetry-BIM4beEO.mjs.map +1 -0
- package/dist/{terminal-ui-5Y6mrg93.d.mts → terminal-ui-DGRNFWna.d.mts} +1 -1
- package/dist/terminal-ui-DGRNFWna.d.mts.map +1 -0
- package/dist/{types-Dt_SfqFm.d.mts → types-C_tYiJYx.d.mts} +53 -31
- package/dist/types-C_tYiJYx.d.mts.map +1 -0
- package/dist/{verify-DCA9Sldu.mjs → verify-DcOYZ1tH.mjs} +2 -2
- package/dist/{verify-DCA9Sldu.mjs.map → verify-DcOYZ1tH.mjs.map} +1 -1
- package/package.json +26 -22
- package/src/cli.ts +5 -0
- package/src/commands/contract-infer.ts +2 -2
- package/src/commands/db-update.ts +7 -1
- package/src/commands/init/index.ts +6 -35
- package/src/commands/init/init.ts +1 -14
- package/src/commands/init/inputs.ts +0 -75
- package/src/commands/inspect-live-schema.ts +10 -0
- package/src/commands/json/schemas.ts +195 -0
- package/src/commands/migrate.ts +527 -8
- package/src/commands/migration-check.ts +469 -134
- package/src/commands/migration-graph.ts +164 -91
- package/src/commands/migration-list.ts +72 -39
- package/src/commands/migration-log.ts +52 -102
- package/src/commands/migration-new.ts +2 -1
- package/src/commands/migration-plan.ts +2 -1
- package/src/commands/migration-show.ts +31 -66
- package/src/commands/migration-status-overlay.ts +61 -0
- package/src/commands/migration-status.ts +458 -1066
- package/src/commands/telemetry/index.ts +107 -0
- package/src/commands/telemetry/status.ts +67 -0
- package/src/control-api/client.ts +70 -9
- package/src/control-api/operations/contract-emit.ts +22 -2
- package/src/control-api/operations/db-init.ts +6 -3
- package/src/control-api/operations/{db-apply.ts → db-run.ts} +55 -14
- package/src/control-api/operations/db-update.ts +7 -4
- package/src/control-api/operations/db-verify.ts +15 -5
- package/src/control-api/operations/{migration-apply.ts → migrate.ts} +181 -80
- package/src/control-api/operations/{apply.ts → run-migration.ts} +33 -27
- package/src/control-api/types.ts +56 -29
- package/src/utils/cli-errors.ts +70 -2
- package/src/utils/formatters/errors.ts +11 -0
- package/src/utils/formatters/migration-graph-command-render.ts +239 -0
- package/src/utils/formatters/migration-graph-grid-layout.ts +1134 -0
- package/src/utils/formatters/migration-graph-labels.ts +408 -0
- package/src/utils/formatters/migration-graph-model.ts +103 -0
- package/src/utils/formatters/migration-graph-occlusion-render.ts +258 -0
- package/src/utils/formatters/migration-graph-rows.ts +128 -15
- package/src/utils/formatters/migration-graph-space-render.ts +188 -0
- package/src/utils/formatters/migration-list-data-column.ts +4 -91
- package/src/utils/formatters/migration-list-graph-topology.ts +72 -94
- package/src/utils/formatters/migration-list-render.ts +135 -71
- package/src/utils/formatters/migration-list-styler.ts +46 -5
- package/src/utils/formatters/migration-list-types.ts +5 -21
- package/src/utils/formatters/migration-log-table.ts +205 -0
- package/src/utils/formatters/migrations.ts +33 -11
- package/src/utils/global-flags.ts +35 -0
- package/src/utils/integrity-violation-to-check-failure.ts +28 -19
- package/src/utils/legend.ts +38 -0
- package/src/utils/migration-path-target.ts +60 -0
- package/src/utils/telemetry.ts +68 -32
- package/dist/client-KgJorIvG.mjs.map +0 -1
- package/dist/command-helpers-Bbw1GbwL.mjs.map +0 -1
- package/dist/commands/migration-list.mjs.map +0 -1
- package/dist/commands/migration-log.mjs.map +0 -1
- package/dist/commands/migration-status.mjs.map +0 -1
- package/dist/contract-emit-D-4jrNve.mjs.map +0 -1
- package/dist/contract-infer-D8uEbJuu.mjs.map +0 -1
- package/dist/graph-render-rFAqZujX.mjs +0 -1081
- package/dist/graph-render-rFAqZujX.mjs.map +0 -1
- package/dist/init-Cv9UzWL5.mjs.map +0 -1
- package/dist/inspect-live-schema-C6ohV_oQ.mjs.map +0 -1
- package/dist/migration-check-BiBJoYYW.mjs +0 -341
- package/dist/migration-check-BiBJoYYW.mjs.map +0 -1
- package/dist/migration-graph-D7DVUElV.mjs +0 -1232
- package/dist/migration-graph-D7DVUElV.mjs.map +0 -1
- package/dist/migration-list-styler-BRwF4-gy.mjs +0 -399
- package/dist/migration-list-styler-BRwF4-gy.mjs.map +0 -1
- package/dist/migration-plan-9DJ7q7_z.mjs.map +0 -1
- package/dist/migration-types-D2FW63pr.d.mts +0 -15
- package/dist/migration-types-D2FW63pr.d.mts.map +0 -1
- package/dist/migrations-Cv2jxNNK.mjs +0 -228
- package/dist/migrations-Cv2jxNNK.mjs.map +0 -1
- package/dist/terminal-ui-5Y6mrg93.d.mts.map +0 -1
- package/dist/types-Dt_SfqFm.d.mts.map +0 -1
- package/src/utils/formatters/graph-migration-mapper.ts +0 -235
- package/src/utils/formatters/graph-render.ts +0 -1323
- package/src/utils/formatters/graph-types.ts +0 -120
- package/src/utils/formatters/migration-graph-layout.ts +0 -1119
- package/src/utils/formatters/migration-graph-tree-render.ts +0 -459
|
@@ -1,53 +1,35 @@
|
|
|
1
|
-
import { t as loadConfig } from "../config-loader-
|
|
2
|
-
import {
|
|
3
|
-
import { t as createControlClient } from "../client-
|
|
4
|
-
import {
|
|
1
|
+
import { t as loadConfig } from "../config-loader-p9JMrekQ.mjs";
|
|
2
|
+
import { A as formatStyledHeader, B as errorContractValidationFailed, E as formatMigrationShowOutput, W as errorFileNotFound, _ as createTerminalUI, ct as errorUnexpected, d as setCommandSeeAlso, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, o as resolveContractPath, rt as errorRuntime, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, ut as mapRefResolutionError, y as handleResult } from "../command-helpers-DGMvGBeX.mjs";
|
|
3
|
+
import { t as createControlClient } from "../client-CJzuo5wX.mjs";
|
|
4
|
+
import { n as looksLikePath, r as resolveAppTargetPath, t as findPackageByDirPath } from "../migration-path-target-Ce6OZImp.mjs";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
7
7
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
8
|
-
import {
|
|
8
|
+
import { relative } from "pathe";
|
|
9
9
|
import { readFile } from "node:fs/promises";
|
|
10
10
|
import { APP_SPACE_ID, createControlStack } from "@prisma-next/framework-components/control";
|
|
11
|
-
import { loadContractSpaceAggregate } from "@prisma-next/migration-tools/aggregate";
|
|
12
11
|
import { castAs } from "@prisma-next/utils/casts";
|
|
12
|
+
import { loadContractSpaceAggregate } from "@prisma-next/migration-tools/aggregate";
|
|
13
13
|
import { parseMigrationRef } from "@prisma-next/migration-tools/ref-resolution";
|
|
14
14
|
//#region src/commands/migration-show.ts
|
|
15
|
-
function looksLikePath(target) {
|
|
16
|
-
return target.includes("/") || target.includes("\\");
|
|
17
|
-
}
|
|
18
|
-
function resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative) {
|
|
19
|
-
const targetPath = resolve(target);
|
|
20
|
-
const relativeToApp = relative(appMigrationsDir, targetPath);
|
|
21
|
-
if (relativeToApp === "" || relativeToApp === "." || relativeToApp.startsWith("..") || isAbsolute(relativeToApp)) return notOk(errorRuntime("Target must point to an app-space migration", {
|
|
22
|
-
why: `Expected a path under ${appMigrationsRelative}, got ${target}`,
|
|
23
|
-
fix: "Pass an app-space migration directory or use a hash prefix."
|
|
24
|
-
}));
|
|
25
|
-
return ok(targetPath);
|
|
26
|
-
}
|
|
27
15
|
function pkgToPresent(spaceId, pkg, client) {
|
|
28
16
|
const ops = castAs(pkg.ops);
|
|
29
|
-
const
|
|
17
|
+
const rawPreview = client.toOperationPreview(ops) ?? { statements: [] };
|
|
30
18
|
return {
|
|
31
|
-
spaceId,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
migrationHash: pkg.metadata.migrationHash,
|
|
19
|
+
space: spaceId,
|
|
20
|
+
name: pkg.dirName,
|
|
21
|
+
fromContract: pkg.metadata.from,
|
|
22
|
+
toContract: pkg.metadata.to,
|
|
23
|
+
hash: pkg.metadata.migrationHash,
|
|
37
24
|
createdAt: pkg.metadata.createdAt,
|
|
38
25
|
operations: ops.map((op) => ({
|
|
39
26
|
id: op.id,
|
|
40
27
|
label: op.label,
|
|
41
28
|
operationClass: op.operationClass
|
|
42
29
|
})),
|
|
43
|
-
preview
|
|
44
|
-
summary: `${ops.length} operation(s)`
|
|
30
|
+
preview: { statements: [...rawPreview.statements] }
|
|
45
31
|
};
|
|
46
32
|
}
|
|
47
|
-
function findPackageByDirPath(packages, resolvedDirPath) {
|
|
48
|
-
const normalized = resolve(resolvedDirPath);
|
|
49
|
-
return packages.find((p) => resolve(p.dirPath) === normalized);
|
|
50
|
-
}
|
|
51
33
|
async function executeMigrationShowCommand(target, options, flags, ui) {
|
|
52
34
|
const config = await loadConfig(options.config);
|
|
53
35
|
const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config);
|
|
@@ -139,15 +121,21 @@ async function executeMigrationShowCommand(target, options, flags, ui) {
|
|
|
139
121
|
}));
|
|
140
122
|
appPkg = matchedPkg;
|
|
141
123
|
}
|
|
124
|
+
const migration = pkgToPresent(APP_SPACE_ID, appPkg, client);
|
|
142
125
|
return ok({
|
|
143
126
|
ok: true,
|
|
144
|
-
migration:
|
|
127
|
+
summary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,
|
|
128
|
+
migration
|
|
145
129
|
});
|
|
146
130
|
}
|
|
147
131
|
function createMigrationShowCommand() {
|
|
148
132
|
const command = new Command("show");
|
|
149
|
-
setCommandDescriptions(command, "Display migration package contents", "Shows the operations, statement preview, and metadata for one app-space migration.\nAccepts a directory path, directory name, or hash prefix.");
|
|
150
|
-
setCommandExamples(command, [
|
|
133
|
+
setCommandDescriptions(command, "Display migration package contents", "Shows the operations, statement preview, and metadata for one app-space migration.\nAccepts a directory path, directory name, or hash prefix.\nOffline — does not consult the database.");
|
|
134
|
+
setCommandExamples(command, [
|
|
135
|
+
"prisma-next migration show 20260101_100000_add_user",
|
|
136
|
+
"prisma-next migration show sha256:a1b2c3",
|
|
137
|
+
"prisma-next migration show 20260101_100000_add_user --json"
|
|
138
|
+
]);
|
|
151
139
|
setCommandSeeAlso(command, [
|
|
152
140
|
{
|
|
153
141
|
verb: "migration status",
|
|
@@ -166,7 +154,7 @@ function createMigrationShowCommand() {
|
|
|
166
154
|
oneLiner: "Show the migration graph topology"
|
|
167
155
|
}
|
|
168
156
|
]);
|
|
169
|
-
addGlobalOptions(command).argument("<target>", "Migration reference: directory name, hash/prefix, or path").option("--config <path>", "Path to prisma-next.config.ts").action(async (target, options) => {
|
|
157
|
+
addGlobalOptions(command).argument("<target>", "Migration reference: directory name, hash/prefix, ref, or path").option("--config <path>", "Path to prisma-next.config.ts").action(async (target, options) => {
|
|
170
158
|
const flags = parseGlobalFlagsOrExit(options);
|
|
171
159
|
const ui = createTerminalUI(flags);
|
|
172
160
|
const exitCode = handleResult(await executeMigrationShowCommand(target, options, flags, ui), flags, ui, (showResult) => {
|
|
@@ -178,6 +166,6 @@ function createMigrationShowCommand() {
|
|
|
178
166
|
return command;
|
|
179
167
|
}
|
|
180
168
|
//#endregion
|
|
181
|
-
export { createMigrationShowCommand
|
|
169
|
+
export { createMigrationShowCommand };
|
|
182
170
|
|
|
183
171
|
//# sourceMappingURL=migration-show.mjs.map
|
|
@@ -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,I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iB,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} 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 { relative } 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 {\n findPackageByDirPath,\n looksLikePath,\n resolveAppTargetPath,\n} from '../utils/migration-path-target';\nimport { handleResult } from '../utils/result-handler';\nimport { createTerminalUI, type TerminalUI } from '../utils/terminal-ui';\nimport type { MigrationShowResult } from './json/schemas';\n\ninterface MigrationShowOptions extends CommonCommandOptions {\n readonly config?: string;\n}\n\nexport interface MigrationShowPresent {\n readonly space: string;\n readonly name: string;\n readonly fromContract: string | null;\n readonly toContract: string;\n readonly hash: string;\n readonly createdAt: string;\n readonly operations: { id: string; label: string; operationClass: string }[];\n readonly preview: {\n statements: { text: string; language: string }[];\n };\n}\n\nexport type { MigrationShowResult };\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 rawPreview = client.toOperationPreview(ops) ?? { statements: [] };\n return {\n space: spaceId,\n name: pkg.dirName,\n fromContract: pkg.metadata.from,\n toContract: pkg.metadata.to,\n hash: 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: { statements: [...rawPreview.statements] },\n };\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 const migration = pkgToPresent(APP_SPACE_ID, appPkg, client);\n return ok({\n ok: true,\n summary: `Migration ${migration.name} in ${migration.space}: ${migration.operations.length} operation(s)`,\n migration,\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 'Offline — does not consult the database.',\n );\n setCommandExamples(command, [\n 'prisma-next migration show 20260101_100000_add_user',\n 'prisma-next migration show sha256:a1b2c3',\n 'prisma-next migration show 20260101_100000_add_user --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 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, ref, 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":";;;;;;;;;;;;;;AAiEA,SAAS,aACP,SACA,KACA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Q;CACvB,CAAC;CAEH,OAAO;AACT"}
|
|
@@ -1,157 +1,55 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as CliStructuredError } from "../types-C_tYiJYx.mjs";
|
|
2
|
+
import { c as MigrationStatusEntry, d as StatusDiagnosticJson, l as MigrationStatusResult, p as migrationStatusJsonResultSchema, u as MigrationStatusSpace } from "../schemas-CeGMYFYX.mjs";
|
|
3
|
+
import { n as GlobalFlags, t as CommonCommandOptions } from "../global-flags-BpoOYtNZ.mjs";
|
|
4
|
+
import { t as TerminalUI } from "../terminal-ui-DGRNFWna.mjs";
|
|
2
5
|
import { Command } from "commander";
|
|
3
|
-
import {
|
|
4
|
-
import { MigrationGraph } from "@prisma-next/migration-tools/graph";
|
|
5
|
-
import { OnDiskMigrationPackage } from "@prisma-next/migration-tools/package";
|
|
6
|
+
import { Result } from "@prisma-next/utils/result";
|
|
6
7
|
|
|
7
|
-
//#region src/utils/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
readonly status: EdgeStatusKind;
|
|
8
|
+
//#region src/utils/migration-types.d.ts
|
|
9
|
+
interface StatusRef {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly hash: string;
|
|
12
|
+
readonly active: boolean;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/commands/migration-status.d.ts
|
|
16
|
-
interface
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly to
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
24
|
-
readonly status: EdgeStatusKind | 'unknown';
|
|
16
|
+
interface MigrationStatusOptions extends CommonCommandOptions {
|
|
17
|
+
readonly db?: string;
|
|
18
|
+
readonly config?: string;
|
|
19
|
+
readonly to?: string;
|
|
20
|
+
readonly from?: string;
|
|
21
|
+
readonly space?: string;
|
|
22
|
+
readonly legend?: boolean;
|
|
23
|
+
readonly ascii?: boolean;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
* - `headHash`: the on-disk head ref's hash (where the space is going).
|
|
32
|
-
* - `markerHash`: the live marker hash for the space, or null if no
|
|
33
|
-
* marker has been written yet (greenfield, or pre-`migrate`).
|
|
34
|
-
* - `pendingCount`: number of migration edges between marker and head.
|
|
35
|
-
* Computed via {@link graphWalkStrategy}; 0 means the space is
|
|
36
|
-
* already at head.
|
|
37
|
-
* - `status`: convenience tag the formatter uses to pick a glyph.
|
|
38
|
-
* `'never-planned'` is reserved for spaces with non-empty head but
|
|
39
|
-
* no on-disk migrations — which shouldn't happen if the loader's
|
|
40
|
-
* integrity check passes.
|
|
41
|
-
*
|
|
42
|
-
* Online-only fields (`markerHash`, `status`) are absent when the
|
|
43
|
-
* command runs without a database connection.
|
|
44
|
-
*/
|
|
45
|
-
interface MigrationStatusSpaceEntry {
|
|
46
|
-
readonly spaceId: string;
|
|
47
|
-
readonly kind: 'app' | 'extension';
|
|
48
|
-
readonly headHash: string;
|
|
49
|
-
readonly markerHash?: string | null;
|
|
50
|
-
readonly pendingCount?: number;
|
|
51
|
-
readonly status?: 'up-to-date' | 'pending' | 'no-marker' | 'never-planned' | 'unreachable';
|
|
25
|
+
interface MigrationStatusTreeSection {
|
|
26
|
+
readonly space: string;
|
|
27
|
+
readonly tree: string;
|
|
28
|
+
readonly showHeading: boolean;
|
|
52
29
|
}
|
|
53
|
-
|
|
54
|
-
* Sum per-space `pendingCount` into a cross-space total, but only when
|
|
55
|
-
* every loaded space reports a defined `pendingCount`. Returns
|
|
56
|
-
* `undefined` if any space is on the marker-unknown / offline path
|
|
57
|
-
* (where `pendingCount` is intentionally absent), so JSON consumers can
|
|
58
|
-
* distinguish "no pending" from "unknown".
|
|
59
|
-
*/
|
|
60
|
-
declare function computeTotalPendingAcrossSpaces(spaces: readonly MigrationStatusSpaceEntry[]): number | undefined;
|
|
61
|
-
interface MigrationStatusResult {
|
|
30
|
+
interface MigrationStatusCommandResult {
|
|
62
31
|
readonly ok: true;
|
|
63
|
-
readonly
|
|
64
|
-
readonly migrations: readonly MigrationStatusEntry[];
|
|
65
|
-
readonly markerHash?: string;
|
|
66
|
-
readonly targetHash: string;
|
|
67
|
-
readonly contractHash: string;
|
|
68
|
-
readonly refs?: readonly StatusRef[];
|
|
69
|
-
/** Required invariants from the active ref, sorted ascending. Always present (`[]` when no `--ref` or the ref declares none) — knowable offline. */
|
|
70
|
-
readonly requiredInvariants: readonly string[];
|
|
71
|
-
/**
|
|
72
|
-
* Invariants the marker has applied at least once, intersected with
|
|
73
|
-
* `requiredInvariants` for display relevance. JSON consumers see only the
|
|
74
|
-
* subset overlapping the active ref's required set — the full unfiltered
|
|
75
|
-
* marker invariant list lives on `marker.invariants` (control plane) and
|
|
76
|
-
* is not surfaced here. Present only in `mode === 'online'`; absent when
|
|
77
|
-
* offline (the marker is unknown, not empty).
|
|
78
|
-
*/
|
|
79
|
-
readonly appliedInvariants?: readonly string[];
|
|
80
|
-
/** required − applied. Present only in `mode === 'online'`; absent when offline. */
|
|
81
|
-
readonly missingInvariants?: readonly string[];
|
|
82
|
-
readonly pathDecision?: {
|
|
83
|
-
readonly fromHash: string;
|
|
84
|
-
readonly toHash: string;
|
|
85
|
-
readonly alternativeCount: number;
|
|
86
|
-
readonly tieBreakReasons: readonly string[];
|
|
87
|
-
readonly refName?: string;
|
|
88
|
-
readonly requiredInvariants: readonly string[];
|
|
89
|
-
readonly satisfiedInvariants: readonly string[];
|
|
90
|
-
readonly selectedPath: readonly {
|
|
91
|
-
readonly dirName: string;
|
|
92
|
-
readonly migrationHash: string;
|
|
93
|
-
readonly from: string;
|
|
94
|
-
readonly to: string;
|
|
95
|
-
readonly invariants: readonly string[];
|
|
96
|
-
}[];
|
|
97
|
-
};
|
|
32
|
+
readonly spaces: readonly MigrationStatusSpace[];
|
|
98
33
|
readonly summary: string;
|
|
99
|
-
readonly diagnostics: readonly
|
|
100
|
-
|
|
101
|
-
* Aggregate enumeration of every on-disk contract space (app +
|
|
102
|
-
* extensions), in canonical schedule order (extensions
|
|
103
|
-
* alphabetically, then app). Present whenever the aggregate loader
|
|
104
|
-
* succeeded; absent in early-error returns (e.g. unreadable
|
|
105
|
-
* migrations directory) where the existing diagnostics already
|
|
106
|
-
* surface the failure.
|
|
107
|
-
*
|
|
108
|
-
* The top-level fields (`migrations`, `markerHash`, `targetHash`,
|
|
109
|
-
* `pathDecision`, …) describe the **app member** specifically.
|
|
110
|
-
* Per-space detail for extension members lives only on this list.
|
|
111
|
-
*/
|
|
112
|
-
readonly spaces?: readonly MigrationStatusSpaceEntry[];
|
|
113
|
-
/** Cross-space pending-migration total (sum of `spaces[].pendingCount`). Present when `spaces` is. */
|
|
114
|
-
readonly totalPendingAcrossSpaces?: number;
|
|
115
|
-
readonly graph?: MigrationGraph;
|
|
116
|
-
readonly bundles?: readonly OnDiskMigrationPackage[];
|
|
117
|
-
readonly edgeStatuses?: readonly EdgeStatus[];
|
|
118
|
-
readonly activeRefHash?: string;
|
|
119
|
-
readonly activeRefName?: string;
|
|
120
|
-
readonly diverged?: boolean;
|
|
34
|
+
readonly diagnostics: readonly StatusDiagnosticJson[];
|
|
35
|
+
readonly treeSections: readonly MigrationStatusTreeSection[];
|
|
121
36
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
declare function deriveEdgeStatuses(graph: MigrationGraph, targetHash: string, contractHash: string, markerHash: string | undefined, mode: 'online' | 'offline'): EdgeStatus[];
|
|
138
|
-
/**
|
|
139
|
-
* Build the aggregate enumeration of contract spaces for the status
|
|
140
|
-
* output. Loads the aggregate from disk (lossy on failure — extension
|
|
141
|
-
* spaces are simply omitted, the app member's output keeps working),
|
|
142
|
-
* reads per-space marker rows when online, and uses
|
|
143
|
-
* {@link graphWalkStrategy} to compute each space's pending count.
|
|
144
|
-
*
|
|
145
|
-
* The aggregate-walking status reports per-space marker + pending
|
|
146
|
-
* state alongside the cross-space totals.
|
|
147
|
-
*/
|
|
148
|
-
declare function loadAggregateStatusSpaces(args: {
|
|
149
|
-
readonly aggregate: ContractSpaceAggregate;
|
|
150
|
-
readonly extensionPacks: ReadonlyArray<unknown>;
|
|
151
|
-
readonly markersBySpace: ReadonlyMap<string, ContractMarkerRecordLike> | null;
|
|
152
|
-
}): Promise<readonly MigrationStatusSpaceEntry[]>;
|
|
37
|
+
declare function buildNoPathSummary(args: {
|
|
38
|
+
readonly markerHash: string | undefined;
|
|
39
|
+
readonly targetHash: string;
|
|
40
|
+
readonly explicitTarget: boolean;
|
|
41
|
+
readonly refName: string | undefined;
|
|
42
|
+
}): string;
|
|
43
|
+
declare function buildStatusHeadline(args: {
|
|
44
|
+
readonly pendingCount: number;
|
|
45
|
+
readonly targetHash: string;
|
|
46
|
+
readonly markerDiverged: boolean;
|
|
47
|
+
readonly markerHash: string | undefined;
|
|
48
|
+
}): string;
|
|
49
|
+
declare function formatStatusSummary(result: MigrationStatusCommandResult, colorize: boolean): string;
|
|
50
|
+
declare function formatStatusHumanOutput(result: MigrationStatusCommandResult, colorize: boolean): string;
|
|
51
|
+
declare function executeMigrationStatusCommand(options: MigrationStatusOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<MigrationStatusCommandResult, CliStructuredError>>;
|
|
153
52
|
declare function createMigrationStatusCommand(): Command;
|
|
154
|
-
declare function formatStatusSummary(result: MigrationStatusResult, colorize: boolean): string;
|
|
155
53
|
//#endregion
|
|
156
|
-
export { MigrationStatusEntry, MigrationStatusResult,
|
|
54
|
+
export { type MigrationStatusEntry, MigrationStatusOptions, type MigrationStatusResult, type MigrationStatusSpace, MigrationStatusTreeSection, type StatusDiagnosticJson, type StatusRef, buildNoPathSummary, buildStatusHeadline, createMigrationStatusCommand, executeMigrationStatusCommand, formatStatusHumanOutput, formatStatusSummary, migrationStatusJsonResultSchema };
|
|
157
55
|
//# sourceMappingURL=migration-status.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-status.d.mts","names":[],"sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"migration-status.d.mts","names":[],"sources":["../../src/utils/migration-types.ts","../../src/commands/migration-status.ts"],"mappings":";;;;;;;;UAAiB,SAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA;EAAA,SACA,MAAA;AAAA;;;UCqFM,sBAAA,SAA+B,oBAAoB;EAAA,SACzD,EAAA;EAAA,SACA,MAAA;EAAA,SACA,EAAA;EAAA,SACA,IAAA;EAAA,SACA,KAAA;EAAA,SACA,MAAA;EAAA,SACA,KAAA;AAAA;AAAA,UAGM,0BAAA;EAAA,SACN,KAAA;EAAA,SACA,IAAA;EAAA,SACA,WAAA;AAAA;AAAA,UAGD,4BAAA;EAAA,SACC,EAAA;EAAA,SACA,MAAA,WAAiB,oBAAA;EAAA,SACjB,OAAA;EAAA,SACA,WAAA,WAAsB,oBAAA;EAAA,SACtB,YAAA,WAAuB,0BAAA;AAAA;AAAA,iBA8DlB,kBAAA,CAAmB,IAAA;EAAA,SACxB,UAAA;EAAA,SACA,UAAA;EAAA,SACA,cAAA;EAAA,SACA,OAAA;AAAA;AAAA,iBAiBK,mBAAA,CAAoB,IAAA;EAAA,SACzB,YAAA;EAAA,SACA,UAAA;EAAA,SACA,cAAA;EAAA,SACA,UAAA;AAAA;AAAA,iBAWK,mBAAA,CACd,MAAA,EAAQ,4BAA4B,EACpC,QAAA;AAAA,iBAyBc,uBAAA,CACd,MAAA,EAAQ,4BAA4B,EACpC,QAAA;AAAA,iBAqCoB,6BAAA,CACpB,OAAA,EAAS,sBAAA,EACT,KAAA,EAAO,WAAA,EACP,EAAA,EAAI,UAAA,GACH,OAAA,CAAQ,MAAA,CAAO,4BAAA,EAA8B,kBAAA;AAAA,iBAmXhC,4BAAA,IAAgC,OAAO"}
|