prisma-next 0.12.0-dev.4 → 0.12.0-dev.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +180 -163
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-KgJorIvG.mjs → client-Dk-zRFuT.mjs} +83 -58
- package/dist/client-Dk-zRFuT.mjs.map +1 -0
- package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-xvg9oq4T.mjs} +301 -23
- package/dist/command-helpers-xvg9oq4T.mjs.map +1 -0
- package/dist/commands/contract-emit.mjs +1 -1
- package/dist/commands/contract-infer.mjs +1 -1
- package/dist/commands/db-init.mjs +4 -5
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.mjs +3 -3
- package/dist/commands/db-sign.mjs +4 -4
- 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.mjs +1 -1
- package/dist/commands/migrate.d.mts +2 -2
- package/dist/commands/migrate.d.mts.map +1 -1
- package/dist/commands/migrate.mjs +6 -8
- package/dist/commands/migrate.mjs.map +1 -1
- package/dist/commands/migration-check.d.mts +55 -1
- package/dist/commands/migration-check.d.mts.map +1 -1
- package/dist/commands/migration-check.mjs +2 -2
- package/dist/commands/migration-graph.d.mts +25 -7
- package/dist/commands/migration-graph.d.mts.map +1 -1
- package/dist/commands/migration-graph.mjs +170 -2
- package/dist/commands/migration-graph.mjs.map +1 -0
- package/dist/commands/migration-list.d.mts +24 -26
- 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 +20 -15
- package/dist/commands/migration-log.d.mts.map +1 -1
- package/dist/commands/migration-log.mjs +1 -137
- package/dist/commands/migration-new.mjs +3 -3
- package/dist/commands/migration-plan.d.mts +1 -1
- package/dist/commands/migration-plan.mjs +1 -1
- package/dist/commands/migration-show.d.mts +1 -4
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +13 -25
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +41 -141
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +2 -759
- package/dist/commands/ref.d.mts +1 -1
- package/dist/commands/ref.mjs +3 -3
- 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/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-Wj3u4Xco.mjs} +2 -2
- package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-Wj3u4Xco.mjs.map} +1 -1
- package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-CZU0UO6M.mjs} +3 -3
- package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-CZU0UO6M.mjs.map} +1 -1
- package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-FetLZ3jn.mjs} +5 -5
- package/dist/{contract-emit-D-4jrNve.mjs.map → contract-emit-FetLZ3jn.mjs.map} +1 -1
- package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-3wtOsS_H.mjs} +3 -3
- package/dist/{contract-infer-D8uEbJuu.mjs.map → contract-infer-3wtOsS_H.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-BdRPfM3Q.mjs} +63 -5
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-BdRPfM3Q.mjs.map} +1 -1
- package/dist/{db-verify-v_vUKXTU.mjs → db-verify-BisylXFZ.mjs} +4 -4
- package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-BisylXFZ.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +2 -2
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +2 -2
- package/dist/exports/index.mjs +1 -1
- package/dist/exports/init-output.mjs +1 -1
- package/dist/{framework-components-fYXjz_in.mjs → framework-components-Be4inY3I.mjs} +2 -2
- package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-Be4inY3I.mjs.map} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-DG4uY5tV.d.mts} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-DG4uY5tV.d.mts.map} +1 -1
- package/dist/{init-Cv9UzWL5.mjs → init-BTE2U7lG.mjs} +5 -58
- package/dist/init-BTE2U7lG.mjs.map +1 -0
- package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-Cy9Y4wsL.mjs} +3 -3
- package/dist/{inspect-live-schema-C6ohV_oQ.mjs.map → inspect-live-schema-Cy9Y4wsL.mjs.map} +1 -1
- package/dist/{migration-check-BiBJoYYW.mjs → migration-check-CUavU7U9.mjs} +236 -88
- package/dist/migration-check-CUavU7U9.mjs.map +1 -0
- package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-BxOxtyJ6.mjs} +3 -3
- package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-BxOxtyJ6.mjs.map} +1 -1
- package/dist/migration-graph-space-render-ByJ83gxp.mjs +1966 -0
- package/dist/migration-graph-space-render-ByJ83gxp.mjs.map +1 -0
- package/dist/migration-list-jK6QeczE.mjs +228 -0
- package/dist/migration-list-jK6QeczE.mjs.map +1 -0
- package/dist/migration-list-types-DS63IdFd.d.mts +23 -0
- package/dist/migration-list-types-DS63IdFd.d.mts.map +1 -0
- package/dist/migration-log-DWI6dZyi.mjs +215 -0
- package/dist/migration-log-DWI6dZyi.mjs.map +1 -0
- package/dist/migration-path-target-DqcrbOis.mjs +24 -0
- package/dist/migration-path-target-DqcrbOis.mjs.map +1 -0
- package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-NHdlUwPG.mjs} +5 -6
- package/dist/{migration-plan-9DJ7q7_z.mjs.map → migration-plan-NHdlUwPG.mjs.map} +1 -1
- package/dist/migration-status-DI6Ldjbo.mjs +439 -0
- package/dist/migration-status-DI6Ldjbo.mjs.map +1 -0
- package/dist/{output-B60Gw5fu.mjs → output-CF_hqzI-.mjs} +1 -1
- package/dist/{output-B60Gw5fu.mjs.map → output-CF_hqzI-.mjs.map} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-CJY9zOv7.mjs} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-CJY9zOv7.mjs.map} +1 -1
- package/dist/telemetry-DQP0BvKv.mjs +122 -0
- package/dist/telemetry-DQP0BvKv.mjs.map +1 -0
- package/dist/{types-Dt_SfqFm.d.mts → types-Cculk5KV.d.mts} +44 -31
- package/dist/types-Cculk5KV.d.mts.map +1 -0
- package/dist/{verify-DCA9Sldu.mjs → verify-tvHRBBVP.mjs} +2 -2
- package/dist/{verify-DCA9Sldu.mjs.map → verify-tvHRBBVP.mjs.map} +1 -1
- package/package.json +11 -12
- 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/extension-pack-inputs-IDvjRCi3.mjs +0 -62
- package/dist/extension-pack-inputs-IDvjRCi3.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/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-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/types-Dt_SfqFm.d.mts.map +0 -1
|
@@ -1,157 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as MigrationListEntry } from "../migration-list-types-DS63IdFd.mjs";
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import { ContractMarkerRecordLike, ContractSpaceAggregate } from "@prisma-next/migration-tools/aggregate";
|
|
4
|
-
import { MigrationGraph } from "@prisma-next/migration-tools/graph";
|
|
5
|
-
import { OnDiskMigrationPackage } from "@prisma-next/migration-tools/package";
|
|
6
3
|
|
|
7
|
-
//#region src/utils/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
|
|
4
|
+
//#region src/utils/migration-types.d.ts
|
|
5
|
+
interface StatusRef {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly hash: string;
|
|
8
|
+
readonly active: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface StatusDiagnostic {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
readonly severity: 'warn' | 'info';
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly hints: readonly string[];
|
|
13
15
|
}
|
|
14
16
|
//#endregion
|
|
15
17
|
//#region src/commands/migration-status.d.ts
|
|
16
|
-
interface
|
|
17
|
-
readonly
|
|
18
|
-
readonly from: string;
|
|
19
|
-
readonly to: string;
|
|
20
|
-
readonly migrationHash: string;
|
|
21
|
-
readonly operationCount: number;
|
|
22
|
-
readonly operationSummary: string;
|
|
23
|
-
readonly hasDestructive: boolean;
|
|
24
|
-
readonly status: EdgeStatusKind | 'unknown';
|
|
18
|
+
interface MigrationStatusMigrationEntry extends MigrationListEntry {
|
|
19
|
+
readonly status: 'applied' | 'pending' | null;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
* Per-space status row in the aggregate-shaped status output.
|
|
28
|
-
*
|
|
29
|
-
* Surfaces, for each contract space:
|
|
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 {
|
|
21
|
+
interface MigrationStatusSpaceResult {
|
|
46
22
|
readonly spaceId: string;
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly pendingCount?: number;
|
|
51
|
-
readonly status?: 'up-to-date' | 'pending' | 'no-marker' | 'never-planned' | 'unreachable';
|
|
23
|
+
readonly markerHash: string | null;
|
|
24
|
+
readonly targetHash: string;
|
|
25
|
+
readonly migrations: readonly MigrationStatusMigrationEntry[];
|
|
52
26
|
}
|
|
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
27
|
interface MigrationStatusResult {
|
|
62
28
|
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
|
-
};
|
|
29
|
+
readonly spaces: readonly MigrationStatusSpaceResult[];
|
|
98
30
|
readonly summary: string;
|
|
31
|
+
readonly missingInvariantsLine?: string;
|
|
99
32
|
readonly diagnostics: readonly StatusDiagnostic[];
|
|
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;
|
|
33
|
+
readonly treeSections: readonly MigrationStatusTreeSection[];
|
|
121
34
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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[]>;
|
|
153
|
-
declare function createMigrationStatusCommand(): Command;
|
|
35
|
+
interface MigrationStatusTreeSection {
|
|
36
|
+
readonly spaceId: string;
|
|
37
|
+
readonly tree: string;
|
|
38
|
+
readonly showHeading: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare function buildNoPathSummary(args: {
|
|
41
|
+
readonly markerHash: string | undefined;
|
|
42
|
+
readonly targetHash: string;
|
|
43
|
+
readonly explicitTarget: boolean;
|
|
44
|
+
readonly refName: string | undefined;
|
|
45
|
+
}): string;
|
|
46
|
+
declare function buildStatusHeadline(args: {
|
|
47
|
+
readonly pendingCount: number;
|
|
48
|
+
readonly targetHash: string;
|
|
49
|
+
readonly markerDiverged: boolean;
|
|
50
|
+
readonly markerHash: string | undefined;
|
|
51
|
+
}): string;
|
|
154
52
|
declare function formatStatusSummary(result: MigrationStatusResult, colorize: boolean): string;
|
|
53
|
+
declare function formatStatusHumanOutput(result: MigrationStatusResult, colorize: boolean): string;
|
|
54
|
+
declare function createMigrationStatusCommand(): Command;
|
|
155
55
|
//#endregion
|
|
156
|
-
export {
|
|
56
|
+
export { MigrationStatusMigrationEntry, MigrationStatusResult, MigrationStatusSpaceResult, MigrationStatusTreeSection, type StatusDiagnostic, type StatusRef, buildNoPathSummary, buildStatusHeadline, createMigrationStatusCommand, formatStatusHumanOutput, formatStatusSummary };
|
|
157
57
|
//# 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;AAAA,UAGM,gBAAA;EAAA,SACN,IAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,KAAA;AAAA;;;UCuEM,6BAAA,SAAsC,kBAAkB;EAAA,SAC9D,MAAM;AAAA;AAAA,UAGA,0BAAA;EAAA,SACN,OAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,WAAqB,6BAA6B;AAAA;AAAA,UAG5C,qBAAA;EAAA,SACN,EAAA;EAAA,SACA,MAAA,WAAiB,0BAAA;EAAA,SACjB,OAAA;EAAA,SACA,qBAAA;EAAA,SACA,WAAA,WAAsB,gBAAA;EAAA,SACtB,YAAA,WAAuB,0BAAA;AAAA;AAAA,UAGjB,0BAAA;EAAA,SACN,OAAA;EAAA,SACA,IAAA;EAAA,SACA,WAAA;AAAA;AAAA,iBA8DK,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,CAAoB,MAAA,EAAQ,qBAAqB,EAAE,QAAA;AAAA,iBAqBnD,uBAAA,CAAwB,MAAA,EAAQ,qBAAqB,EAAE,QAAA;AAAA,iBAuZvD,4BAAA,CAAA,GAAgC,OAAO"}
|