@prisma/orm-toolchain 8.0.0-rc.1-dev.36 → 8.0.0-rc.1-dev.38
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/bin__prisma-next.mjs +23 -23
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs → caught-errors-DLPzfzIW-CQ9BoXD-.mjs} +3 -3
- package/dist/{caught-errors-BZ-9WASe-DH4DaDha.mjs.map → caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map} +1 -1
- package/dist/{cli-errors-C6_pH59O-CzD4SYcJ.mjs → cli-errors-BG6bItjG-DwdKIeGz.mjs} +4 -4
- package/dist/cli-errors-BG6bItjG-DwdKIeGz.mjs.map +1 -0
- package/dist/{cli-errors-f5PRtVdm-C6xVKeQn.d.mts → cli-errors-BiKBrOXc-JPxQqO58.d.mts} +48 -6
- package/dist/cli-errors-BiKBrOXc-JPxQqO58.d.mts.map +1 -0
- package/dist/cli.mjs +572 -33
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__commands__contract-emit.mjs +1 -1
- package/dist/cli__commands__contract-infer.mjs +1 -1
- package/dist/cli__commands__db-init.mjs +1 -1
- package/dist/cli__commands__db-schema.mjs +1 -1
- package/dist/cli__commands__db-sign.mjs +1 -1
- package/dist/cli__commands__db-update.mjs +1 -1
- package/dist/cli__commands__db-verify.mjs +1 -1
- package/dist/cli__commands__migrate.d.mts +2 -2
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.mjs +1 -1
- package/dist/cli__commands__migration-graph.d.mts +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +1 -1
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.d.mts +1 -1
- package/dist/cli__commands__migration-log.mjs +1 -1
- package/dist/cli__commands__migration-new.mjs +1 -1
- package/dist/cli__commands__migration-plan.d.mts +1 -1
- package/dist/cli__commands__migration-plan.mjs +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.d.mts +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +11 -3
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +15 -15
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/{client-BqhVohc5-DFRVWFps.mjs → client-DU9qtBxW-BjVHiKzE.mjs} +57 -11
- package/dist/client-DU9qtBxW-BjVHiKzE.mjs.map +1 -0
- package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs → command-helpers-CwLvFwMB-BWwUQhlT.mjs} +3 -3
- package/dist/{command-helpers-kD9CO1hd-BPhnkBin.mjs.map → command-helpers-CwLvFwMB-BWwUQhlT.mjs.map} +1 -1
- package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs} +3 -3
- package/dist/{contract-at-errors-CLFX1-Gc-MNPXDx1t.mjs.map → contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map} +1 -1
- package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs → contract-emit-BQFpcb2A-BwT9iVdb.mjs} +5 -5
- package/dist/{contract-emit-BlvUNMHM-BEioUVR5.mjs.map → contract-emit-BQFpcb2A-BwT9iVdb.mjs.map} +1 -1
- package/dist/contract-emit-Bzt11N4v-BQ2Pr8KG.mjs +2 -0
- package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs} +6 -6
- package/dist/{contract-emit-CrYO0A8x-60BOqXFr.mjs.map → contract-emit-CZQZ1i4z-p9LSGmmQ.mjs.map} +1 -1
- package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs → contract-infer-C6cYOihE-CIUCgmw0.mjs} +4 -4
- package/dist/{contract-infer-C8kLphsm-C7-AIYMc.mjs.map → contract-infer-C6cYOihE-CIUCgmw0.mjs.map} +1 -1
- package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs} +4 -4
- package/dist/{contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs.map → contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs} +4 -4
- package/dist/{contract-space-aggregate-loader-BpdB-mHG-BiU0IUeb.mjs.map → contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs.map} +1 -1
- package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs → db-init-DypCy1e3-CBrYfhHF.mjs} +6 -6
- package/dist/{db-init-CyNsXRAB-D3xWQ-vy.mjs.map → db-init-DypCy1e3-CBrYfhHF.mjs.map} +1 -1
- package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs → db-init-failure-BmCcHUfc-BqDxyrJE.mjs} +3 -3
- package/dist/{db-init-failure-XYOVL4o7-BitY_JYn.mjs.map → db-init-failure-BmCcHUfc-BqDxyrJE.mjs.map} +1 -1
- package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs → db-schema-DHfPM-5V-JeCjrQ55.mjs} +4 -4
- package/dist/{db-schema-7zNGHgYN-BVaRHPxg.mjs.map → db-schema-DHfPM-5V-JeCjrQ55.mjs.map} +1 -1
- package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs → db-sign-DbAxRcZh-C-nT9kcG.mjs} +6 -6
- package/dist/{db-sign-DAs6J3XG-xxP2CCnO.mjs.map → db-sign-DbAxRcZh-C-nT9kcG.mjs.map} +1 -1
- package/dist/{db-update-BX1sOuQk-CpeLgPeN.mjs → db-update-J59yROwL-DCP-_z2W.mjs} +16 -7
- package/dist/db-update-J59yROwL-DCP-_z2W.mjs.map +1 -0
- package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs → db-verify-0TpDMziA-CJDKutMN.mjs} +5 -5
- package/dist/{db-verify-CN4nmxxF-DSRWae0u.mjs.map → db-verify-0TpDMziA-CJDKutMN.mjs.map} +1 -1
- package/dist/{format-DceifGAK-BJhTdkcO.mjs → format-cbJY7l6v-CjMUDTAs.mjs} +5 -5
- package/dist/{format-DceifGAK-BJhTdkcO.mjs.map → format-cbJY7l6v-CjMUDTAs.mjs.map} +1 -1
- package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs → framework-components-C3K7SBeC-Bj5gx85-.mjs} +3 -3
- package/dist/{framework-components-CPFWl2Ix-CrIZL3jG.mjs.map → framework-components-C3K7SBeC-Bj5gx85-.mjs.map} +1 -1
- package/dist/{init-SY01IBU--CQFYh2As.mjs → init-Bco4QkKJ-DqUZVrBU.mjs} +4 -4
- package/dist/{init-SY01IBU--CQFYh2As.mjs.map → init-Bco4QkKJ-DqUZVrBU.mjs.map} +1 -1
- package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs} +5 -5
- package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs.map → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map} +1 -1
- package/dist/{invariants-1L2zfc6--BpedlAbF.mjs → invariants-1zL5-9Mc-BCeOLxd_.mjs} +4 -4
- package/dist/{invariants-1L2zfc6--BpedlAbF.mjs.map → invariants-1zL5-9Mc-BCeOLxd_.mjs.map} +1 -1
- package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs → legend-BQcPKTLe-bn9e4_ZU.mjs} +3 -3
- package/dist/{legend-aXC5H1jH-Dg1yWonK.mjs.map → legend-BQcPKTLe-bn9e4_ZU.mjs.map} +1 -1
- package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs → migrate-CgSnzAUm-aGstaO5N.mjs} +12 -12
- package/dist/{migrate-DRiUHRCS-Cci6EEZv.mjs.map → migrate-CgSnzAUm-aGstaO5N.mjs.map} +1 -1
- package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs → migrate-failure-CnoUcDms-taa9pfd7.mjs} +4 -4
- package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs.map → migrate-failure-CnoUcDms-taa9pfd7.mjs.map} +1 -1
- package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts} +3 -3
- package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts.map → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map} +1 -1
- package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs → migrate-show-kVUG1xdo-bVTW8tu4.mjs} +6 -6
- package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs.map → migrate-show-kVUG1xdo-bVTW8tu4.mjs.map} +1 -1
- package/dist/{migration-check-BHiINj74-CVazN1LV.mjs → migration-check-BVK9vfan-Dfg8lbeB.mjs} +6 -6
- package/dist/{migration-check-BHiINj74-CVazN1LV.mjs.map → migration-check-BVK9vfan-Dfg8lbeB.mjs.map} +1 -1
- package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs → migration-check-CBMoMDX2-DhSEOGNg.mjs} +6 -6
- package/dist/{migration-check-of-RPYRk-HuXtDO8i.mjs.map → migration-check-CBMoMDX2-DhSEOGNg.mjs.map} +1 -1
- package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs} +5 -5
- package/dist/{migration-command-scaffold-zJFTGn5k-5AGczeSx.mjs.map → migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs.map} +1 -1
- package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs → migration-graph-B30X5398-BH3zB9Mn.mjs} +3 -3
- package/dist/{migration-graph-DmdVVJoZ-DDBKjUMz.mjs.map → migration-graph-B30X5398-BH3zB9Mn.mjs.map} +1 -1
- package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs → migration-graph-D2dbLCkl-CCHL0aDA.mjs} +8 -8
- package/dist/{migration-graph-D0KHjNJ--CWzX9Zzc.mjs.map → migration-graph-D2dbLCkl-CCHL0aDA.mjs.map} +1 -1
- package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs} +3 -3
- package/dist/{migration-graph-sections-BWcFCOL6-_G0Wb4QR.mjs.map → migration-graph-sections-0lKA5l1b-CTHQquu7.mjs.map} +1 -1
- package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs → migration-list-BQTfSGbT-DoNqbNsu.mjs} +3 -3
- package/dist/{migration-list-W0dqabIj-Dc2NH_LY.mjs.map → migration-list-BQTfSGbT-DoNqbNsu.mjs.map} +1 -1
- package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs → migration-list-DCx0KOFp-B3MiGnpa.mjs} +6 -6
- package/dist/{migration-list-B0SANIeM-DiXQ9LyS.mjs.map → migration-list-DCx0KOFp-B3MiGnpa.mjs.map} +1 -1
- package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs → migration-log-CJ6_9_uj-uWyc3vlC.mjs} +6 -6
- package/dist/{migration-log-B3iiP8ns-B4tdLSye.mjs.map → migration-log-CJ6_9_uj-uWyc3vlC.mjs.map} +1 -1
- package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs → migration-new-Bp5dPKnF-D-Fb6vEp.mjs} +7 -7
- package/dist/{migration-new-YSdtJTRp-Dc06LNJe.mjs.map → migration-new-Bp5dPKnF-D-Fb6vEp.mjs.map} +1 -1
- package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs → migration-new-CXLgOLXz-2C5s_q7n.mjs} +4 -4
- package/dist/{migration-new-Bf5K9fNK-Cd90rYmm.mjs.map → migration-new-CXLgOLXz-2C5s_q7n.mjs.map} +1 -1
- package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs} +3 -3
- package/dist/{migration-path-target-5r1leSW5-B0EMgvEv.mjs.map → migration-path-target-BNTSTPAc-D7dQ4K7x.mjs.map} +1 -1
- package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs → migration-plan-BxfF1Hdo-BKn0xMlY.mjs} +4 -4
- package/dist/{migration-plan-oterbw8h-_GrKbsRb.mjs.map → migration-plan-BxfF1Hdo-BKn0xMlY.mjs.map} +1 -1
- package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs → migration-plan-C6KrFHJT-CRkTsE7L.mjs} +8 -8
- package/dist/{migration-plan-CZY8HVCh-BbfQvxnb.mjs.map → migration-plan-C6KrFHJT-CRkTsE7L.mjs.map} +1 -1
- package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts → migration-plan-CharRhoN-BIB3WL65.d.mts} +3 -3
- package/dist/{migration-plan-4cnnP6yM-DXzRfi_A.d.mts.map → migration-plan-CharRhoN-BIB3WL65.d.mts.map} +1 -1
- package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs → migration-show-Dhnlx_GU-DhWLLt3Z.mjs} +8 -8
- package/dist/{migration-show-iX2cduR4-C3-FENR4.mjs.map → migration-show-Dhnlx_GU-DhWLLt3Z.mjs.map} +1 -1
- package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs → migration-status-S88DjM8c-DLHnCKfW.mjs} +10 -10
- package/dist/{migration-status-BZ6gOxyJ-sbhPgABr.mjs.map → migration-status-S88DjM8c-DLHnCKfW.mjs.map} +1 -1
- package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs → project-import-root-nwdoPWap--5vXe4zp.mjs} +3 -3
- package/dist/{project-import-root-BPuwl2j1-DTX9G73z.mjs.map → project-import-root-nwdoPWap--5vXe4zp.mjs.map} +1 -1
- package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs → ref-C8oaaeky-ColNkWpr.mjs} +5 -5
- package/dist/{ref-CVD6j3jA-BAgpZLNM.mjs.map → ref-C8oaaeky-ColNkWpr.mjs.map} +1 -1
- package/dist/{ref-CaqNqeRF-cjWFAueu.mjs → ref-gZQjdz8I-CW6n9Fc0.mjs} +4 -4
- package/dist/{ref-CaqNqeRF-cjWFAueu.mjs.map → ref-gZQjdz8I-CW6n9Fc0.mjs.map} +1 -1
- package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs} +3 -3
- package/dist/{ref-resolution-D4fAdXo8-Dfaky0yw.mjs.map → ref-resolution-DAK4OK3x-B-8ZZc0f.mjs.map} +1 -1
- package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs → telemetry-DPXFYAsz-CPW2USxs.mjs} +3 -3
- package/dist/{telemetry-fKuZOFpu-DNUWfIHo.mjs.map → telemetry-DPXFYAsz-CPW2USxs.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/cli-errors-C6_pH59O-CzD4SYcJ.mjs.map +0 -1
- package/dist/cli-errors-f5PRtVdm-C6xVKeQn.d.mts.map +0 -1
- package/dist/client-BqhVohc5-DFRVWFps.mjs.map +0 -1
- package/dist/contract-emit-Csa6R0gt-DvxFlS0O.mjs +0 -2
- package/dist/db-update-BX1sOuQk-CpeLgPeN.mjs.map +0 -1
package/dist/{inspect-live-schema-BaLAtOgO-Bs0gs_yP.mjs → inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { f as maskConnectionUrl, n as closeQuietly, s as formatStyledHeader, v as sanitizeErrorMessage } from "./command-helpers-
|
|
2
|
+
import { P as errorUnexpected, d as errorDriverRequired, l as errorDatabaseConnectionRequired, t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
3
|
+
import { f as maskConnectionUrl, n as closeQuietly, s as formatStyledHeader, v as sanitizeErrorMessage } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
4
4
|
import { t as createProgressAdapter } from "./progress-adapter-CjAeTxY_-BXYSd1eY.mjs";
|
|
5
|
-
import { t as createControlClient } from "./client-
|
|
5
|
+
import { t as createControlClient } from "./client-DU9qtBxW-BjVHiKzE.mjs";
|
|
6
6
|
import { relative, resolve } from "pathe";
|
|
7
7
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
8
|
-
//#region ../../../1-framework/3-tooling/cli/dist/inspect-live-schema-
|
|
8
|
+
//#region ../../../1-framework/3-tooling/cli/dist/inspect-live-schema-Cf77j9Vd.mjs
|
|
9
9
|
async function inspectLiveSchema(options, flags, ui, startTime, context) {
|
|
10
10
|
const configResult = await loadConfigForSections(options.config, [
|
|
11
11
|
"family",
|
|
@@ -92,4 +92,4 @@ async function inspectLiveSchema(options, flags, ui, startTime, context) {
|
|
|
92
92
|
//#endregion
|
|
93
93
|
export { inspectLiveSchema as t };
|
|
94
94
|
|
|
95
|
-
//# sourceMappingURL=inspect-live-schema-
|
|
95
|
+
//# sourceMappingURL=inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect-live-schema-
|
|
1
|
+
{"version":3,"file":"inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/inspect-live-schema-Cf77j9Vd.mjs"],"sourcesContent":["import { N as errorUnexpected, c as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorDriverRequired } from \"./cli-errors-BG6bItjG.mjs\";\nimport { S as formatStyledHeader, a as maskConnectionUrl, l as sanitizeErrorMessage, n as closeQuietly } from \"./command-helpers-CwLvFwMB.mjs\";\nimport { t as createProgressAdapter } from \"./progress-adapter-CjAeTxY_.mjs\";\nimport { t as createControlClient } from \"./client-DU9qtBxW.mjs\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { relative, resolve } from \"pathe\";\n//#region src/commands/inspect-live-schema.ts\nasync function inspectLiveSchema(options, flags, ui, startTime, context) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst configPath = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}];\n\t\tif (options.db) details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(options.db)\n\t\t});\n\t\telse if (config.db?.connection && typeof config.db.connection === \"string\") details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(config.db.connection)\n\t\t});\n\t\tui.stderr(formatStyledHeader({\n\t\t\tcommand: context.commandName,\n\t\t\tdescription: context.description,\n\t\t\turl: context.url,\n\t\t\tdetails,\n\t\t\tflags\n\t\t}));\n\t}\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${context.commandName} (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: context.commandName\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: `Config.driver is required for ${context.commandName}` }));\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\tdriver: config.driver,\n\t\textensions: config.extensions ?? []\n\t});\n\tconst onProgress = createProgressAdapter({\n\t\tui,\n\t\tflags\n\t});\n\ttry {\n\t\tconst schema = await client.introspect({\n\t\t\tconnection: dbConnection,\n\t\t\tonProgress\n\t\t});\n\t\tconst schemaView = client.toSchemaView(schema);\n\t\tconst pslContractAst = client.inferPslContract(schema);\n\t\tconst pslBlockDescriptors = client.getPslBlockDescriptors();\n\t\tconst dbUrl = typeof dbConnection === \"string\" ? maskConnectionUrl(dbConnection) : void 0;\n\t\treturn ok({\n\t\t\tconfig,\n\t\t\tschema,\n\t\t\tschemaView,\n\t\t\tpslContractAst,\n\t\t\tpslBlockDescriptors,\n\t\t\ttarget: {\n\t\t\t\tfamilyId: config.family.familyId,\n\t\t\t\tid: config.target.targetId\n\t\t\t},\n\t\t\tmeta: {\n\t\t\t\tconfigPath,\n\t\t\t\t...dbUrl ? { dbUrl } : {}\n\t\t\t},\n\t\t\ttimings: { total: Date.now() - startTime }\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tconst safeMessage = sanitizeErrorMessage(error instanceof Error ? error.message : String(error), typeof dbConnection === \"string\" ? dbConnection : void 0);\n\t\treturn notOk(errorUnexpected(safeMessage, { why: `Unexpected error during ${context.commandName}: ${safeMessage}` }));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\n//#endregion\nexport { inspectLiveSchema as t };\n\n//# sourceMappingURL=inspect-live-schema-Cf77j9Vd.mjs.map"],"mappings":";;;;;;;;AAQA,eAAe,kBAAkB,SAAS,OAAO,IAAI,WAAW,SAAS;CACxE,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI,OAAO;CAC7B,MAAM,SAAS,aAAa;CAC5B,MAAM,aAAa,QAAQ,SAAS,SAAS,QAAQ,IAAI,GAAG,QAAQ,QAAQ,MAAM,CAAC,IAAI;CACvF,IAAI,CAAC,MAAM,QAAQ,CAAC,MAAM,OAA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AM;IACL;IACA,GAAG,QAAQ,EAAE,MAAM,IAAI,CAAC;GACzB;GACA,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;EAC1C,CAAC;CACF,SAAS,OAAO;EACf,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM,cAAc,qBAAqB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,OAAO,iBAAiB,WAAW,eAAe,KAAK,CAAC;EACzJ,OAAO,MAAM,gBAAgB,aAAa,EAAE,KAAK,2BAA2B,QAAQ,YAAY,IAAI,cAAc,CAAC,CAAC;CACrH,UAAU;EACT,MAAM,aAAa,MAAM;CAC1B;AACD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as errorMarkerMismatch } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
2
2
|
import { O as errorNoInvariantPath, P as errorUnknownInvariant } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
|
|
3
3
|
import { a as findPath, o as findPathWithDecision, r as findLatestMigration } from "./migration-graph-_SJImD5V-D5RCc651.mjs";
|
|
4
|
-
import { C as toStructuralEdge, r as collectDeclaredInvariants } from "./command-helpers-
|
|
4
|
+
import { C as toStructuralEdge, r as collectDeclaredInvariants } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
5
5
|
import { n as isGraphNode } from "./graph-membership-BViWUMpP-Cgu4Z2ox.mjs";
|
|
6
6
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
|
-
//#region ../../../1-framework/3-tooling/cli/dist/invariants-
|
|
7
|
+
//#region ../../../1-framework/3-tooling/cli/dist/invariants-1zL5-9Mc.mjs
|
|
8
8
|
/** True when the on-disk graph contains a path fromHash → toHash. */
|
|
9
9
|
function hasMigrationPath(graph, fromHash, toHash) {
|
|
10
10
|
return findPath(graph, fromHash, toHash) !== null;
|
|
@@ -50,4 +50,4 @@ function refuseMissingInvariantPath(args) {
|
|
|
50
50
|
//#endregion
|
|
51
51
|
export { refuseUnknownInvariants as i, refuseMarkerOutsideGraph as n, refuseMissingInvariantPath as r, hasMigrationPath as t };
|
|
52
52
|
|
|
53
|
-
//# sourceMappingURL=invariants-
|
|
53
|
+
//# sourceMappingURL=invariants-1zL5-9Mc-BCeOLxd_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invariants-
|
|
1
|
+
{"version":3,"file":"invariants-1zL5-9Mc-BCeOLxd_.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/invariants-1zL5-9Mc.mjs"],"sourcesContent":["import { g as errorMarkerMismatch } from \"./cli-errors-BG6bItjG.mjs\";\nimport { m as toStructuralEdge, r as collectDeclaredInvariants } from \"./command-helpers-CwLvFwMB.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { errorNoInvariantPath, errorUnknownInvariant } from \"@internal/migration-tools/errors\";\nimport { findLatestMigration, findPath, findPathWithDecision, isGraphNode } from \"@internal/migration-tools/migration-graph\";\n//#region src/control-api/operations/graph-queries.ts\n/** True when the on-disk graph contains a path fromHash → toHash. */\nfunction hasMigrationPath(graph, fromHash, toHash) {\n\treturn findPath(graph, fromHash, toHash) !== null;\n}\n/**\n* Refusal for a live marker hash that is not a node of the on-disk app graph.\n* Same errorMarkerMismatch envelope migrate raises today, or null when the marker is a node.\n*/\nfunction refuseMarkerOutsideGraph(args) {\n\tif (isGraphNode(args.markerHash, args.graph)) return null;\n\treturn errorMarkerMismatch(args.markerHash, [...args.graph.nodes].sort(), findLatestMigration(args.graph)?.to ?? null);\n}\n//#endregion\n//#region src/control-api/operations/invariants.ts\n/**\n* Invariant refusals shared by migrate and migration status: unknown ref invariants and unsatisfiable invariant paths.\n*/\n/** Refuses ref invariants neither declared on any graph edge nor present on the live marker. */\nfunction refuseUnknownInvariants(args) {\n\tconst declared = collectDeclaredInvariants(args.graph);\n\tconst known = new Set(declared);\n\tfor (const id of args.markerInvariants) known.add(id);\n\tconst unknown = args.refInvariants.filter((id) => !known.has(id));\n\tif (unknown.length === 0) return null;\n\treturn errorUnknownInvariant({\n\t\t...ifDefined(\"refName\", args.refName),\n\t\tunknown,\n\t\tdeclared: [...declared].sort()\n\t});\n}\n/** Refuses a --to target whose missing invariants no path from originHash satisfies. */\nfunction refuseMissingInvariantPath(args) {\n\tconst outcome = findPathWithDecision(args.graph, args.originHash, args.targetHash, {\n\t\t...ifDefined(\"refName\", args.refName),\n\t\trequired: new Set(args.missing)\n\t});\n\tif (outcome.kind !== \"unsatisfiable\") return null;\n\treturn errorNoInvariantPath({\n\t\t...ifDefined(\"refName\", args.refName),\n\t\trequired: [...args.missing].sort(),\n\t\tmissing: outcome.missing,\n\t\tstructuralPath: outcome.structuralPath.map(toStructuralEdge)\n\t});\n}\n//#endregion\nexport { refuseMarkerOutsideGraph as i, refuseUnknownInvariants as n, hasMigrationPath as r, refuseMissingInvariantPath as t };\n\n//# sourceMappingURL=invariants-1zL5-9Mc.mjs.map"],"mappings":";;;;;;;;AAOA,SAAS,iBAAiB,OAAO,UAAU,QAAQ;CAClD,OAAO,SAAS,OAAO,UAAU,MAAM,MAAM;AAC9C;;;;;AAKA,SAAS,yBAAyB,MAAM;CACvC,IAAI,YAAY,KAAK,YAAY,KAAK,KAAK,GAAG,OAAO;CACrD,OAAO,oBAAoB,KAAK,YAAY,CAAC,GAAG,KAAK,MAAM,KAAK,CAAC,CAAC,KAAK,GAAG,oBAAoB,KAAK,KAAK,CAAC,EAAE,MAAM,IAAI;AACtH;;;;;AAOA,SAAS,wBAAwB,MAAM;CACtC,MAAM,WAAW,0BAA0B,KAAK,KAAK;CACrD,MAAM,QAAQ,IAAI,IAAI,QAAQ;CAC9B,KAAK,MAAM,MAAM,KAAK,kBAAkB,MAAM,IAAI,EAAE;CACpD,MAAM,UAAU,KAAK,cAAc,QAAQ,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;CAChE,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,OAAO,sBAAsB;EAC5B,GAAG,UAAU,WAAW,KAAK,OAAO;EACpC;EACA,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK;CAC9B,CAAC;AACF;;AAEA,SAAS,2BAA2B,MAAM;CACzC,MAAM,UAAU,qBAAqB,KAAK,OAAO,KAAK,YAAY,KAAK,YAAY;EAClF,GAAG,UAAU,WAAW,KAAK,OAAO;EACpC,UAAU,IAAI,IAAI,KAAK,OAAO;CAC/B,CAAC;CACD,IAAI,QAAQ,SAAS,iBAAiB,OAAO;CAC7C,OAAO,qBAAqB;EAC3B,GAAG,UAAU,WAAW,KAAK,OAAO;EACpC,UAAU,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,KAAK;EACjC,SAAS,QAAQ;EACjB,gBAAgB,QAAQ,eAAe,IAAI,gBAAgB;CAC5D,CAAC;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as errorLegendHumanOnly } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
2
2
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
3
|
-
//#region ../../../1-framework/3-tooling/cli/dist/legend-
|
|
3
|
+
//#region ../../../1-framework/3-tooling/cli/dist/legend-BQcPKTLe.mjs
|
|
4
4
|
/**
|
|
5
5
|
* The legend is decoration printed alongside the command header on stderr, so
|
|
6
6
|
* it is suppressed for the machine-readable / silent paths (`--json`, `--dot`,
|
|
@@ -19,4 +19,4 @@ function validateLegendOptions(options, flags) {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { validateLegendOptions as n, shouldShowLegend as t };
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=legend-
|
|
22
|
+
//# sourceMappingURL=legend-BQcPKTLe-bn9e4_ZU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legend-
|
|
1
|
+
{"version":3,"file":"legend-BQcPKTLe-bn9e4_ZU.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/legend-BQcPKTLe.mjs"],"sourcesContent":["import { h as errorLegendHumanOnly } from \"./cli-errors-BG6bItjG.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\n//#region src/utils/legend.ts\n/**\n* The legend is decoration printed alongside the command header on stderr, so\n* it is suppressed for the machine-readable / silent paths (`--json`, `--dot`,\n* `--quiet`) exactly as the header is.\n*/\nfunction shouldShowLegend(options, flags) {\n\treturn options.legend === true && options.dot !== true && flags.json !== true && flags.quiet !== true;\n}\nfunction validateLegendOptions(options, flags) {\n\tif (options.legend !== true) return ok(void 0);\n\tif (flags.json === true) return notOk(errorLegendHumanOnly(\"--json\"));\n\tif (flags.quiet === true) return notOk(errorLegendHumanOnly(\"--quiet\"));\n\tif (options.dot === true) return notOk(errorLegendHumanOnly(\"--dot\"));\n\treturn ok(void 0);\n}\n//#endregion\nexport { validateLegendOptions as n, shouldShowLegend as t };\n\n//# sourceMappingURL=legend-BQcPKTLe.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,iBAAiB,SAAS,OAAO;CACzC,OAAO,QAAQ,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,MAAM,SAAS,QAAQ,MAAM,UAAU;AAClG;AACA,SAAS,sBAAsB,SAAS,OAAO;CAC9C,IAAI,QAAQ,WAAW,MAAM,OAAO,GAAG,KAAK,CAAC;CAC7C,IAAI,MAAM,SAAS,MAAM,OAAO,MAAM,qBAAqB,QAAQ,CAAC;CACpE,IAAI,MAAM,UAAU,MAAM,OAAO,MAAM,qBAAqB,SAAS,CAAC;CACtE,IAAI,QAAQ,QAAQ,MAAM,OAAO,MAAM,qBAAqB,OAAO,CAAC;CACpE,OAAO,GAAG,KAAK,CAAC;AACjB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { M as errorTargetMigrationNotSupported, P as errorUnexpected, c as errorContractValidationFailed, d as errorDriverRequired, f as errorFileNotFound, l as errorDatabaseConnectionRequired } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
3
3
|
import { r as createTerminalUI, s as formatMigrationApplyCommandOutput } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
|
|
4
|
-
import { S as targetSupportsMigrations, _ as resolveMigrationPaths, b as setCommandExamples, f as maskConnectionUrl, g as resolveContractPath, m as parseGlobalFlagsOrExit, n as closeQuietly, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-
|
|
5
|
-
import { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-
|
|
6
|
-
import { t as createControlClient } from "./client-
|
|
4
|
+
import { S as targetSupportsMigrations, _ as resolveMigrationPaths, b as setCommandExamples, f as maskConnectionUrl, g as resolveContractPath, m as parseGlobalFlagsOrExit, n as closeQuietly, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
5
|
+
import { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs";
|
|
6
|
+
import { t as createControlClient } from "./client-DU9qtBxW-BjVHiKzE.mjs";
|
|
7
7
|
import { a as readContractIR, t as advanceRefSafely } from "./ref-advancement-DaZBzm7m-WoqnFAyr.mjs";
|
|
8
|
-
import { t as mapCaughtMigrationError } from "./caught-errors-
|
|
9
|
-
import { t as mapContractAtError } from "./contract-at-errors-
|
|
10
|
-
import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-
|
|
11
|
-
import { t as executeMigrateShowPlan } from "./migrate-show-
|
|
12
|
-
import { t as resolveContractRef } from "./ref-resolution-
|
|
13
|
-
import { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from "./migrate-failure-
|
|
8
|
+
import { t as mapCaughtMigrationError } from "./caught-errors-DLPzfzIW-CQ9BoXD-.mjs";
|
|
9
|
+
import { t as mapContractAtError } from "./contract-at-errors-Dptf8RE_-B5gr04Sc.mjs";
|
|
10
|
+
import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-1zL5-9Mc-BCeOLxd_.mjs";
|
|
11
|
+
import { t as executeMigrateShowPlan } from "./migrate-show-kVUG1xdo-bVTW8tu4.mjs";
|
|
12
|
+
import { t as resolveContractRef } from "./ref-resolution-DAK4OK3x-B-8ZZc0f.mjs";
|
|
13
|
+
import { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from "./migrate-failure-CnoUcDms-taa9pfd7.mjs";
|
|
14
14
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
15
15
|
import { readFile } from "node:fs/promises";
|
|
16
16
|
import { createControlStack } from "@prisma/orm-framework/components/control";
|
|
17
17
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
18
18
|
import { Command } from "commander";
|
|
19
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-
|
|
19
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migrate-CgSnzAUm.mjs
|
|
20
20
|
/**
|
|
21
21
|
* Read-only preview of the migration path `migrate` will take. Delegates the
|
|
22
22
|
* path computation to {@link executeMigrateShowPlan} (the control-api core)
|
|
@@ -340,4 +340,4 @@ function createMigrateCommand() {
|
|
|
340
340
|
//#endregion
|
|
341
341
|
export { createMigrateCommand as t };
|
|
342
342
|
|
|
343
|
-
//# sourceMappingURL=migrate-
|
|
343
|
+
//# sourceMappingURL=migrate-CgSnzAUm-aGstaO5N.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-DRiUHRCS-Cci6EEZv.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-DRiUHRCS.mjs"],"sourcesContent":["import { A as errorTargetMigrationNotSupported, M as errorUnexpected, l as errorDriverRequired, o as errorContractValidationFailed, s as errorDatabaseConnectionRequired, u as errorFileNotFound } from \"./cli-errors-C6_pH59O.mjs\";\nimport { a as formatMigrationApplyCommandOutput, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, a as maskConnectionUrl, c as resolveMigrationPaths, d as setCommandExamples, n as closeQuietly, p as targetSupportsMigrations, s as resolveContractPath, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-kD9CO1hd.mjs\";\nimport { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"./contract-space-aggregate-loader-BpdB-mHG.mjs\";\nimport { t as createControlClient } from \"./client-BqhVohc5.mjs\";\nimport { a as readContractIR, t as advanceRefSafely } from \"./ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-BZ-9WASe.mjs\";\nimport { t as mapContractAtError } from \"./contract-at-errors-CLFX1-Gc.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants } from \"./invariants-1L2zfc6-.mjs\";\nimport { t as executeMigrateShowPlan } from \"./migrate-show-bdXjSFgh.mjs\";\nimport { t as resolveContractRef } from \"./ref-resolution-D4fAdXo8.mjs\";\nimport { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from \"./migrate-failure-Bdr3AJee.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { createControlStack } from \"@internal/framework-components/control\";\n//#region src/commands/migrate.ts\n/**\n* Read-only preview of the migration path `migrate` will take. Delegates the\n* path computation to {@link executeMigrateShowPlan} (the control-api core)\n* and keeps only the styled header plus the Tier-3 graph rendering here.\n*/\nasync function executeMigrateShowCommand(options, flags, ui) {\n\tconst readsLiveMarker = options.from === void 0 || options.from === \"@db\";\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t...readsLiveMarker ? [\"driver\"] : [],\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst planResult = await executeMigrateShowPlan({\n\t\tconfig: configResult.value,\n\t\tcwd: process.cwd(),\n\t\t...ifDefined(\"configPath\", options.config),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"to\", options.to),\n\t\t...ifDefined(\"from\", options.from),\n\t\tonPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {\n\t\t\tif (!flags.json && !flags.quiet) {\n\t\t\t\tconst details = [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: migrationsRelative\n\t\t\t\t}];\n\t\t\t\tif (dbConnection && !hasExplicitFrom) details.push({\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: maskConnectionUrl(String(dbConnection))\n\t\t\t\t});\n\t\t\t\tif (options.from) details.push({\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: options.from\n\t\t\t\t});\n\t\t\t\tif (options.to) details.push({\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: options.to\n\t\t\t\t});\n\t\t\t\tconst header = formatStyledHeader({\n\t\t\t\t\tcommand: \"migrate --show\",\n\t\t\t\t\tdescription: \"Preview the migration path migrate will take (read-only)\",\n\t\t\t\t\tdetails,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tui.stderr(header);\n\t\t\t}\n\t\t}\n\t});\n\tif (!planResult.ok) return notOk(planResult.failure);\n\tconst plan = planResult.value;\n\tconst orderedMigrations = plan.migrations;\n\tlet graphOutput;\n\tlet runListDirNameWidth;\n\tlet runListLeftPad;\n\tif (!flags.json) {\n\t\tconst rendering = renderMigrateShowGraph(plan, {\n\t\t\tcolorize: flags.color !== false,\n\t\t\tglyphMode: \"unicode\"\n\t\t});\n\t\tgraphOutput = rendering.graphOutput;\n\t\trunListDirNameWidth = rendering.runListDirNameWidth;\n\t\trunListLeftPad = rendering.runListLeftPad;\n\t}\n\treturn ok({\n\t\tok: true,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: plan.summary,\n\t\t...graphOutput !== void 0 ? { graphOutput } : {},\n\t\t...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},\n\t\t...runListLeftPad !== void 0 ? { runListLeftPad } : {}\n\t});\n}\nfunction formatMigrateShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tif (result.graphOutput !== void 0 && result.graphOutput.length > 0) {\n\t\tlines.push(result.graphOutput);\n\t\tlines.push(\"\");\n\t}\n\tconst n = result.migrations.length;\n\tif (n === 0) {\n\t\tlines.push(result.summary);\n\t\treturn lines.join(\"\\n\");\n\t}\n\tlines.push(`The following ${n} migration${n === 1 ? \"\" : \"s\"} will run:`);\n\tlines.push(...migrateShowRunListRows(result.migrations, {\n\t\trunListDirNameWidth: result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length)),\n\t\trunListLeftPad: result.runListLeftPad\n\t}, {\n\t\tcolorize: flags.color !== false,\n\t\tglyphMode: \"unicode\"\n\t}));\n\treturn lines.join(\"\\n\");\n}\nasync function executeMigrateCommand(options, flags, ui, startTime) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for migrate (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: \"migrate\"\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: \"Config.driver is required for migrate\" }));\n\tif (!targetSupportsMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\n\tconst toArg = options.to;\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractRaw;\n\tlet contractContent;\n\ttry {\n\t\tcontractContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `prisma-next contract emit` to generate a valid contract.json, then retry.\"\n\t\t}));\n\t\treturn notOk(errorContractValidationFailed(`Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\ttry {\n\t\tcontractRaw = familyInstance.deserializeContract(JSON.parse(contractContent));\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst loadedAggregate = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: contractRaw,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loadedAggregate.ok) return notOk(loadedAggregate.failure);\n\tconst aggregate = loadedAggregate.value;\n\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(config.extensions ?? []),\n\t\tcheckContracts: true\n\t});\n\tif (integrityFailure) return notOk(integrityFailure);\n\tlet refEntry;\n\tlet refName;\n\tif (toArg) {\n\t\tconst refs = aggregate.app.refs;\n\t\tconst refResult = resolveContractRef(toArg, {\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(refResult.failure);\n\t\tif (refResult.value.provenance.kind === \"ref\") {\n\t\t\trefName = refResult.value.provenance.refName;\n\t\t\tconst resolved = refs[refName];\n\t\t\tif (resolved) refEntry = resolved;\n\t\t} else refEntry = {\n\t\t\thash: refResult.value.hash,\n\t\t\tinvariants: []\n\t\t};\n\t}\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: appMigrationsRelative\n\t\t}];\n\t\tif (typeof dbConnection === \"string\") details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(dbConnection)\n\t\t});\n\t\tif (toArg) details.push({\n\t\t\tlabel: \"to\",\n\t\t\tvalue: toArg\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migrate\",\n\t\t\tdescription: \"Apply planned migrations to advance the database\",\n\t\t\turl: \"https://pris.ly/migrate\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst appGraph = aggregate.app.graph();\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\tdriver: config.driver,\n\t\textensions: config.extensions ?? []\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\tif (appMarker !== null) {\n\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\tgraph: appGraph\n\t\t\t});\n\t\t\tif (markerRefusal) return notOk(markerRefusal);\n\t\t}\n\t\tif (refEntry && refEntry.invariants.length > 0) {\n\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", toArg)\n\t\t\t});\n\t\t\tif (invariantRefusal) return notOk(invariantRefusal);\n\t\t}\n\t\tif (!flags.quiet && !flags.json) ui.step(\"Loading contract spaces…\");\n\t\tlet applyContract = contractRaw;\n\t\tlet snapshotContractJson = JSON.parse(contractContent);\n\t\tlet snapshotContractDts;\n\t\tif (toArg && refEntry) {\n\t\t\tconst targetHash = refEntry.hash;\n\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === targetHash)) try {\n\t\t\t\tconst at = await aggregate.app.contractAt(targetHash, refName !== void 0 ? { refName } : void 0);\n\t\t\t\tapplyContract = at.contract;\n\t\t\t\tsnapshotContractJson = at.contractJson;\n\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t} catch (error) {\n\t\t\t\treturn mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t}\n\t\t}\n\t\tconst applyResult = await client.migrate({\n\t\t\tcontract: applyContract,\n\t\t\tmigrationsDir,\n\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t...refEntry?.invariants ? { refInvariants: refEntry.invariants } : {},\n\t\t\t...refEntry !== void 0 ? ifDefined(\"refName\", toArg) : {}\n\t\t});\n\t\tif (!applyResult.ok) return notOk(mapMigrateFailure(applyResult.failure));\n\t\tconst { value } = applyResult;\n\t\tlet advancedRef = null;\n\t\tif (options.advanceRef !== void 0) {\n\t\t\tconst contractIR = snapshotContractDts !== void 0 ? {\n\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t} : await readContractIR(snapshotContractJson, contractPathAbsolute);\n\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\trefsDir,\n\t\t\t\tmigrationsDir,\n\t\t\t\tname: options.advanceRef,\n\t\t\t\thash: value.markerHash,\n\t\t\t\tcontractIR\n\t\t\t});\n\t\t\tif (!advanced.ok) return notOk(advanced.failure);\n\t\t\tadvancedRef = {\n\t\t\t\tname: advanced.value.name,\n\t\t\t\thash: advanced.value.hash\n\t\t\t};\n\t\t}\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\tmigrationsTotal: value.perSpace.length,\n\t\t\tmarkerHash: value.markerHash,\n\t\t\tapplied: value.applied,\n\t\t\tsummary: value.summary,\n\t\t\tperSpace: value.perSpace,\n\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\ttimings: { total: Date.now() - startTime },\n\t\t\tadvancedRef\n\t\t});\n\t} catch (error) {\n\t\tconst mapped = mapCaughtMigrationError(error);\n\t\tif (mapped) return notOk(mapped);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\nfunction createMigrateCommand() {\n\tconst command = new Command(\"migrate\");\n\tsetCommandDescriptions(command, \"Apply planned migrations to advance the database\", \"Walks every contract space (app + extensions) and applies pending\\non-disk migrations in canonical order (extensions alphabetically,\\nthen app). Graph-walks the on-disk migration graph for every space.\\nUse --to to target a specific contract (hash, ref name, migration dir).\\nUse --show for a read-only preview of the path that would run.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migrate --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to production --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to abc123 --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --from @contract --to production\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--to <contract>\", \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\").option(\"--advance-ref <name>\", \"Advance the named ref to the post-apply marker after success\").option(\"--show\", \"Preview the migration path without applying (read-only)\").option(\"--from <contract>\", \"From-state for --show preview (@contract, @db, hash, ref name, or migration dir)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst startTime = Date.now();\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (options.show) {\n\t\t\tconst exitCode = handleResult(await executeMigrateShowCommand(options, flags, ui), flags, ui, (showResult) => {\n\t\t\t\tif (flags.json) ui.output(JSON.stringify(showResult, null, 2));\n\t\t\t\telse ui.output(formatMigrateShowOutput(showResult, flags));\n\t\t\t});\n\t\t\tprocess.exit(exitCode);\n\t\t\treturn;\n\t\t}\n\t\tconst exitCode = handleResult(await executeMigrateCommand(options, flags, ui, startTime), flags, ui, (migrateResult) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(migrateResult, null, 2));\n\t\t\telse if (!flags.quiet) ui.log(formatMigrationApplyCommandOutput(migrateResult, flags));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrateCommand as t };\n\n//# sourceMappingURL=migrate-DRiUHRCS.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,eAAe,0BAA0B,SAAS,OAAO,IAAI;CAC5D,MAAM,kBAAkB,QAAQ,SAAS,KAAK,KAAK,QAAQ,SAAS;CACpE,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;EACA,GAAG,kBAAkB,CAAC,QAAQ,IAAI,CAAC;EACnC;EACA;EACA;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI,OAAO;CAC7B,MAAM,aAAa,MAAM,uBAAuB;EAC/C,QAAQ,aAAa;EACrB,KAAK,QAAQ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BAAiB,KAAK;EACjC,IAAI,QAAQ,MAAM;GACjB,MAAM,WAAW,aAAa,MAAM,0BAA0B,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,eAAe;IAC7G,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;SACxD,GAAG,OAAO,wBAAwB,YAAY,KAAK,CAAC;GAC1D,CAAC;GACD,QAAQ,KAAK,QAAQ;GACrB;EACD;EACA,MAAM,WAAW,aAAa,MAAM,sBAAsB,SAAS,OAAO,IAAI,SAAS,GAAG,OAAO,KAAK,kBAAkB;GACvH,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,eAAe,MAAM,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,OAAO,GAAG,IAAI,kCAAkC,eAAe,KAAK,CAAC;EACtF,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"migrate-CgSnzAUm-aGstaO5N.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-CgSnzAUm.mjs"],"sourcesContent":["import { N as errorUnexpected, c as errorDatabaseConnectionRequired, d as errorFileNotFound, j as errorTargetMigrationNotSupported, s as errorContractValidationFailed, u as errorDriverRequired } from \"./cli-errors-BG6bItjG.mjs\";\nimport { a as formatMigrationApplyCommandOutput, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, a as maskConnectionUrl, c as resolveMigrationPaths, d as setCommandExamples, n as closeQuietly, p as targetSupportsMigrations, s as resolveContractPath, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-CwLvFwMB.mjs\";\nimport { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"./contract-space-aggregate-loader-CoLTf3Ce.mjs\";\nimport { t as createControlClient } from \"./client-DU9qtBxW.mjs\";\nimport { a as readContractIR, t as advanceRefSafely } from \"./ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-DLPzfzIW.mjs\";\nimport { t as mapContractAtError } from \"./contract-at-errors-Dptf8RE_.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants } from \"./invariants-1zL5-9Mc.mjs\";\nimport { t as executeMigrateShowPlan } from \"./migrate-show-kVUG1xdo.mjs\";\nimport { t as resolveContractRef } from \"./ref-resolution-DAK4OK3x.mjs\";\nimport { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from \"./migrate-failure-CnoUcDms.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { createControlStack } from \"@internal/framework-components/control\";\n//#region src/commands/migrate.ts\n/**\n* Read-only preview of the migration path `migrate` will take. Delegates the\n* path computation to {@link executeMigrateShowPlan} (the control-api core)\n* and keeps only the styled header plus the Tier-3 graph rendering here.\n*/\nasync function executeMigrateShowCommand(options, flags, ui) {\n\tconst readsLiveMarker = options.from === void 0 || options.from === \"@db\";\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t...readsLiveMarker ? [\"driver\"] : [],\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst planResult = await executeMigrateShowPlan({\n\t\tconfig: configResult.value,\n\t\tcwd: process.cwd(),\n\t\t...ifDefined(\"configPath\", options.config),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"to\", options.to),\n\t\t...ifDefined(\"from\", options.from),\n\t\tonPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {\n\t\t\tif (!flags.json && !flags.quiet) {\n\t\t\t\tconst details = [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: migrationsRelative\n\t\t\t\t}];\n\t\t\t\tif (dbConnection && !hasExplicitFrom) details.push({\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: maskConnectionUrl(String(dbConnection))\n\t\t\t\t});\n\t\t\t\tif (options.from) details.push({\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: options.from\n\t\t\t\t});\n\t\t\t\tif (options.to) details.push({\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: options.to\n\t\t\t\t});\n\t\t\t\tconst header = formatStyledHeader({\n\t\t\t\t\tcommand: \"migrate --show\",\n\t\t\t\t\tdescription: \"Preview the migration path migrate will take (read-only)\",\n\t\t\t\t\tdetails,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tui.stderr(header);\n\t\t\t}\n\t\t}\n\t});\n\tif (!planResult.ok) return notOk(planResult.failure);\n\tconst plan = planResult.value;\n\tconst orderedMigrations = plan.migrations;\n\tlet graphOutput;\n\tlet runListDirNameWidth;\n\tlet runListLeftPad;\n\tif (!flags.json) {\n\t\tconst rendering = renderMigrateShowGraph(plan, {\n\t\t\tcolorize: flags.color !== false,\n\t\t\tglyphMode: \"unicode\"\n\t\t});\n\t\tgraphOutput = rendering.graphOutput;\n\t\trunListDirNameWidth = rendering.runListDirNameWidth;\n\t\trunListLeftPad = rendering.runListLeftPad;\n\t}\n\treturn ok({\n\t\tok: true,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: plan.summary,\n\t\t...graphOutput !== void 0 ? { graphOutput } : {},\n\t\t...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},\n\t\t...runListLeftPad !== void 0 ? { runListLeftPad } : {}\n\t});\n}\nfunction formatMigrateShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tif (result.graphOutput !== void 0 && result.graphOutput.length > 0) {\n\t\tlines.push(result.graphOutput);\n\t\tlines.push(\"\");\n\t}\n\tconst n = result.migrations.length;\n\tif (n === 0) {\n\t\tlines.push(result.summary);\n\t\treturn lines.join(\"\\n\");\n\t}\n\tlines.push(`The following ${n} migration${n === 1 ? \"\" : \"s\"} will run:`);\n\tlines.push(...migrateShowRunListRows(result.migrations, {\n\t\trunListDirNameWidth: result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length)),\n\t\trunListLeftPad: result.runListLeftPad\n\t}, {\n\t\tcolorize: flags.color !== false,\n\t\tglyphMode: \"unicode\"\n\t}));\n\treturn lines.join(\"\\n\");\n}\nasync function executeMigrateCommand(options, flags, ui, startTime) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for migrate (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: \"migrate\"\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: \"Config.driver is required for migrate\" }));\n\tif (!targetSupportsMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\n\tconst toArg = options.to;\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractRaw;\n\tlet contractContent;\n\ttry {\n\t\tcontractContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `prisma-next contract emit` to generate a valid contract.json, then retry.\"\n\t\t}));\n\t\treturn notOk(errorContractValidationFailed(`Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\ttry {\n\t\tcontractRaw = familyInstance.deserializeContract(JSON.parse(contractContent));\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst loadedAggregate = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: contractRaw,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loadedAggregate.ok) return notOk(loadedAggregate.failure);\n\tconst aggregate = loadedAggregate.value;\n\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(config.extensions ?? []),\n\t\tcheckContracts: true\n\t});\n\tif (integrityFailure) return notOk(integrityFailure);\n\tlet refEntry;\n\tlet refName;\n\tif (toArg) {\n\t\tconst refs = aggregate.app.refs;\n\t\tconst refResult = resolveContractRef(toArg, {\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(refResult.failure);\n\t\tif (refResult.value.provenance.kind === \"ref\") {\n\t\t\trefName = refResult.value.provenance.refName;\n\t\t\tconst resolved = refs[refName];\n\t\t\tif (resolved) refEntry = resolved;\n\t\t} else refEntry = {\n\t\t\thash: refResult.value.hash,\n\t\t\tinvariants: []\n\t\t};\n\t}\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: appMigrationsRelative\n\t\t}];\n\t\tif (typeof dbConnection === \"string\") details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(dbConnection)\n\t\t});\n\t\tif (toArg) details.push({\n\t\t\tlabel: \"to\",\n\t\t\tvalue: toArg\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migrate\",\n\t\t\tdescription: \"Apply planned migrations to advance the database\",\n\t\t\turl: \"https://pris.ly/migrate\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst appGraph = aggregate.app.graph();\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\tdriver: config.driver,\n\t\textensions: config.extensions ?? []\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\tif (appMarker !== null) {\n\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\tgraph: appGraph\n\t\t\t});\n\t\t\tif (markerRefusal) return notOk(markerRefusal);\n\t\t}\n\t\tif (refEntry && refEntry.invariants.length > 0) {\n\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", toArg)\n\t\t\t});\n\t\t\tif (invariantRefusal) return notOk(invariantRefusal);\n\t\t}\n\t\tif (!flags.quiet && !flags.json) ui.step(\"Loading contract spaces…\");\n\t\tlet applyContract = contractRaw;\n\t\tlet snapshotContractJson = JSON.parse(contractContent);\n\t\tlet snapshotContractDts;\n\t\tif (toArg && refEntry) {\n\t\t\tconst targetHash = refEntry.hash;\n\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === targetHash)) try {\n\t\t\t\tconst at = await aggregate.app.contractAt(targetHash, refName !== void 0 ? { refName } : void 0);\n\t\t\t\tapplyContract = at.contract;\n\t\t\t\tsnapshotContractJson = at.contractJson;\n\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t} catch (error) {\n\t\t\t\treturn mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t}\n\t\t}\n\t\tconst applyResult = await client.migrate({\n\t\t\tcontract: applyContract,\n\t\t\tmigrationsDir,\n\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t...refEntry?.invariants ? { refInvariants: refEntry.invariants } : {},\n\t\t\t...refEntry !== void 0 ? ifDefined(\"refName\", toArg) : {}\n\t\t});\n\t\tif (!applyResult.ok) return notOk(mapMigrateFailure(applyResult.failure));\n\t\tconst { value } = applyResult;\n\t\tlet advancedRef = null;\n\t\tif (options.advanceRef !== void 0) {\n\t\t\tconst contractIR = snapshotContractDts !== void 0 ? {\n\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t} : await readContractIR(snapshotContractJson, contractPathAbsolute);\n\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\trefsDir,\n\t\t\t\tmigrationsDir,\n\t\t\t\tname: options.advanceRef,\n\t\t\t\thash: value.markerHash,\n\t\t\t\tcontractIR\n\t\t\t});\n\t\t\tif (!advanced.ok) return notOk(advanced.failure);\n\t\t\tadvancedRef = {\n\t\t\t\tname: advanced.value.name,\n\t\t\t\thash: advanced.value.hash\n\t\t\t};\n\t\t}\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\tmigrationsTotal: value.perSpace.length,\n\t\t\tmarkerHash: value.markerHash,\n\t\t\tapplied: value.applied,\n\t\t\tsummary: value.summary,\n\t\t\tperSpace: value.perSpace,\n\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\ttimings: { total: Date.now() - startTime },\n\t\t\tadvancedRef\n\t\t});\n\t} catch (error) {\n\t\tconst mapped = mapCaughtMigrationError(error);\n\t\tif (mapped) return notOk(mapped);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\nfunction createMigrateCommand() {\n\tconst command = new Command(\"migrate\");\n\tsetCommandDescriptions(command, \"Apply planned migrations to advance the database\", \"Walks every contract space (app + extensions) and applies pending\\non-disk migrations in canonical order (extensions alphabetically,\\nthen app). Graph-walks the on-disk migration graph for every space.\\nUse --to to target a specific contract (hash, ref name, migration dir).\\nUse --show for a read-only preview of the path that would run.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migrate --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to production --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to abc123 --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --from @contract --to production\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--to <contract>\", \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\").option(\"--advance-ref <name>\", \"Advance the named ref to the post-apply marker after success\").option(\"--show\", \"Preview the migration path without applying (read-only)\").option(\"--from <contract>\", \"From-state for --show preview (@contract, @db, hash, ref name, or migration dir)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst startTime = Date.now();\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (options.show) {\n\t\t\tconst exitCode = handleResult(await executeMigrateShowCommand(options, flags, ui), flags, ui, (showResult) => {\n\t\t\t\tif (flags.json) ui.output(JSON.stringify(showResult, null, 2));\n\t\t\t\telse ui.output(formatMigrateShowOutput(showResult, flags));\n\t\t\t});\n\t\t\tprocess.exit(exitCode);\n\t\t\treturn;\n\t\t}\n\t\tconst exitCode = handleResult(await executeMigrateCommand(options, flags, ui, startTime), flags, ui, (migrateResult) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(migrateResult, null, 2));\n\t\t\telse if (!flags.quiet) ui.log(formatMigrationApplyCommandOutput(migrateResult, flags));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrateCommand as t };\n\n//# sourceMappingURL=migrate-CgSnzAUm.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,eAAe,0BAA0B,SAAS,OAAO,IAAI;CAC5D,MAAM,kBAAkB,QAAQ,SAAS,KAAK,KAAK,QAAQ,SAAS;CACpE,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;EACA,GAAG,kBAAkB,CAAC,QAAQ,IAAI,CAAC;EACnC;EACA;EACA;EACA;CACD,CAAC;CACD,IAAI,CAAC,aAAa,IAAI,OAAO;CAC7B,MAAM,aAAa,MAAM,uBAAuB;EAC/C,QAAQ,aAAa;EACrB,KAAK,QAAQ,IAAI;EACjB,GAAG,UAAU,cAAc,QAAQ,MAAM;EACzC,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,QAAQ,QAAQ,IAAI;EACjC,sBAAsB,EAAE,YAAY,oBAAoB,cAAc,sBAAsB;GAC3F,IAAI,CAAC,MAAM,QAAQ,CAAC,MAAM,OAAO;IAChC,MAAM,UAAU,CAAC;KAChB,OAAO;KACP,OAAO;IACR,GAAG;KACF,OAAO;KACP,OAAO;IACR,CAAC;IACD,IAAI,gBAAgB,CAAC,iBAAiB,QAAQ,KAAK;KAClD,OAAO;KACP,OAAO,kBAAkB,OAAO,YAAY,CAAC;IAC9C,CAAC;IACD,IAAI,QAAQ,MAAM,QAAQ,KAAK;KAC9B,OAAO;KACP,OAAO,QA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AAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
|
package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs → migrate-failure-CnoUcDms-taa9pfd7.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as listRefsByContractHash } from "./migration-list-
|
|
1
|
+
import { C as errorPathUnreachable, O as errorRunnerFailed } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
2
|
+
import { t as listRefsByContractHash } from "./migration-list-BQTfSGbT-DoNqbNsu.mjs";
|
|
3
3
|
import { _ as renderMigrationGraphCommand, a as buildMigrationGraphRows, c as computeLabelColumn, f as formatOnPathMigrationRow, i as buildGrid, l as computeMaxDirNameWidth, m as indentMigrationGraphTreeBlock, p as highlightFromEdgeAnnotations } from "./migration-graph-command-render-BeuEyf2B-BNH9oUB_.mjs";
|
|
4
4
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-failure-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migrate-failure-CnoUcDms.mjs
|
|
6
6
|
const LABEL_GAP = 2;
|
|
7
7
|
const MIN_HASH_DATA_COLUMN = 25;
|
|
8
8
|
const LIST_INDENT = 2;
|
|
@@ -93,4 +93,4 @@ function mapMigrateFailure(failure) {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { migrateShowRunListRows as n, renderMigrateShowGraph as r, mapMigrateFailure as t };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=migrate-failure-
|
|
96
|
+
//# sourceMappingURL=migrate-failure-CnoUcDms-taa9pfd7.mjs.map
|
package/dist/{migrate-failure-Bdr3AJee-C9yNeQXy.mjs.map → migrate-failure-CnoUcDms-taa9pfd7.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-failure-
|
|
1
|
+
{"version":3,"file":"migrate-failure-CnoUcDms-taa9pfd7.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-failure-CnoUcDms.mjs"],"sourcesContent":["import { D as errorRunnerFailed, S as errorPathUnreachable } from \"./cli-errors-BG6bItjG.mjs\";\nimport { t as listRefsByContractHash } from \"./migration-list-BQTfSGbT.mjs\";\nimport { f as highlightFromEdgeAnnotations, g as buildGrid, h as buildMigrationGraphRows, i as formatOnPathMigrationRow, n as computeMaxDirNameWidth, p as indentMigrationGraphTreeBlock, r as renderMigrationGraphCommand, t as computeLabelColumn } from \"./migration-graph-command-render-BeuEyf2B.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/utils/formatters/migrate-show-render.ts\nconst LABEL_GAP = 2;\nconst MIN_HASH_DATA_COLUMN = 25;\nconst LIST_INDENT = 2;\nfunction paintOverrides(options) {\n\treturn {\n\t\t...options.styler === void 0 ? {} : { styler: options.styler },\n\t\t...options.palette === void 0 ? {} : { palette: options.palette }\n\t};\n}\n/**\n* Every space, with the migrations on the chosen path lifted to focus mode and\n* everything else dimmed. Widths are computed across all spaces first so the\n* sections and the run-list below them share their columns.\n*/\nfunction renderMigrateShowGraph(plan, options) {\n\tconst { aggregate, contractHash } = plan;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst onPathHashes = new Set(plan.migrations.map((migration) => migration.migrationHash));\n\tconst spaceLayouts = allSpaces.map((space) => {\n\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\tconst spaceGraph = space.graph();\n\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\treturn {\n\t\t\tspace,\n\t\t\tisApp,\n\t\t\trowModel,\n\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\tedgeAnnotations\n\t\t};\n\t});\n\tconst multiSpace = spaceLayouts.length > 1;\n\tconst globalLabelColumn = multiSpace ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, options.glyphMode))) : void 0;\n\tconst widestRunListName = plan.migrations.length > 0 ? Math.max(...plan.migrations.map((migration) => migration.dirName.length)) : 0;\n\tconst globalMaxDirNameWidth = multiSpace ? Math.max(Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))), widestRunListName) : void 0;\n\tconst sections = [];\n\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\tconst tree = renderMigrationGraphCommand({\n\t\t\tgrid,\n\t\t\trowModel,\n\t\t\tcontractHash,\n\t\t\tisAppSpace: isApp,\n\t\t\t...plan.usedLiveMarker && liveMarkerHash !== void 0 ? { dbHash: liveMarkerHash } : {},\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\tcolorize: options.colorize,\n\t\t\tglyphMode: options.glyphMode,\n\t\t\t...paintOverrides(options),\n\t\t\t...globalLabelColumn === void 0 ? {} : { globalLabelColumn },\n\t\t\t...globalMaxDirNameWidth === void 0 ? {} : { globalMaxDirNameWidth }\n\t\t});\n\t\tif (tree.length === 0) continue;\n\t\tsections.push(multiSpace ? `${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}` : tree);\n\t}\n\treturn {\n\t\tgraphOutput: sections.join(\"\\n\\n\"),\n\t\trunListDirNameWidth: globalMaxDirNameWidth ?? widestRunListName,\n\t\trunListLeftPad: globalLabelColumn\n\t};\n}\n/**\n* The ordered \"will run\" rows, aligned with the graph above them.\n*\n* The `→` arrow has to land in the same absolute column in a list row as in a\n* graph edge row. A graph edge row is `[gutter][name][hashes]`; a list row is\n* `[indent][name][indent][hashes]`, so the list's name column absorbs the\n* gutter width and the indent — twice over when a flat tree has no space\n* headings indenting it.\n*/\nfunction migrateShowRunListRows(migrations, rendering, options) {\n\tconst gutter = rendering.runListLeftPad ?? 0;\n\tconst multiSpace = rendering.runListLeftPad !== void 0;\n\tconst listDirNameWidth = gutter + Math.max(rendering.runListDirNameWidth + LABEL_GAP, MIN_HASH_DATA_COLUMN - gutter) - (multiSpace ? LIST_INDENT : LIST_INDENT * 2);\n\treturn migrations.map((migration) => ` ${formatOnPathMigrationRow(migration.dirName, migration.from, migration.to, listDirNameWidth, options.colorize, options.glyphMode, paintOverrides(options))}`);\n}\n//#endregion\n//#region src/utils/migrate-failure.ts\n/** A `migrate` apply failure as the CLI's structured error. */\nfunction mapMigrateFailure(failure) {\n\tif (failure.code === \"MIGRATION_PATH_NOT_FOUND\") return errorPathUnreachable(failure);\n\treturn errorRunnerFailed(failure.summary, {\n\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\tfix: \"Fix the issue and re-run `prisma-next migrate --to <contract>` — previously applied migrations are preserved.\",\n\t\tmeta: failure.meta ?? {},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\n//#endregion\nexport { migrateShowRunListRows as n, renderMigrateShowGraph as r, mapMigrateFailure as t };\n\n//# sourceMappingURL=migrate-failure-CnoUcDms.mjs.map"],"mappings":";;;;;AAKA,MAAM,YAAY;AAClB,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AACpB,SAAS,eAAe,SAAS;CAChC,OAAO;EACN,GAAG,QAAQ,WAAW,KAAK,IAAI,CAAC,IAAI,EAAE,QAAQ,QAAQ,OAAO;EAC7D,GAAG,QAAQ,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,QAAQ,QAAQ;CACjE;AACD;;;;;;AAMA,SAAS,uBAAuB,MAAM,SAAS;CAC9C,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,YAAY,CAAC,UAAU,KAAK,GAAG,UAAU,UAAU;CACzD,MAAM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B;GACvB,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACnB,GAAG,eAAe,OAAO;GACzB,GAAG,sBAAsB,KAAK,IAAI,CAAC,IAAI,EAAE,kBAAkB;GAC3D,GAAG,0BAA0B,KAAK,IAAI,CAAC,IAAI,EAAE,sBAAsB;EACpE,CAAC;EACD,IAAI,KAAK,WAAW,GAAG;EACvB,SAAS,KAAK,aAAa,GAAG,MAAM,QAAQ,KAAK,8BAA8B,MAAM,IAAI,MAAM,IAAI;CACpG;CACA,OAAO;EACN,aAAa,SAAS,KAAK,MAAM;EACjC,qBAAqB,yBAAyB;EAC9C,gBAAgB;CACjB;AACD;;;;;;;;;;AAUA,SAAS,uBAAuB,YAAY,WAAW,SAAS;CAC/D,MAAM,SAAS,UAAU,kBAAkB;CAC3C,MAAM,aAAa,UAAU,mBAAmB,KAAK;CACrD,MAAM,mBAAmB,SAAS,KAAK,IAAI,UAAU,sBAAsB,WAAW,uBAAuB,MAAM,KAAK,aAAa,cAAc,cAAc;CACjK,OAAO,WAAW,KAAK,cAAc,KAAK,yBAAyB,UAAU,SAAS,UAAU,MAAM,UAAU,IAAI,kBAAkB,QAAQ,UAAU,QAAQ,WAAW,eAAe,OAAO,CAAC,GAAG;AACtM;;AAIA,SAAS,kBAAkB,SAAS;CACnC,IAAI,QAAQ,SAAS,4BAA4B,OAAO,qBAAqB,OAAO;CACpF,OAAO,kBAAkB,QAAQ,SAAS;EACzC,KAAK,QAAQ,OAAO;EACpB,KAAK;EACL,MAAM,QAAQ,QAAQ,CAAC;EACvB,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as CreateControlClient, t as CliStructuredError$2 } from "./cli-errors-
|
|
1
|
+
import { c as CreateControlClient, t as CliStructuredError$2 } from "./cli-errors-BiKBrOXc-JPxQqO58.mjs";
|
|
2
2
|
import { c as ContractSpaceAggregate } from "./aggregate-CA6bJ8UO.mjs";
|
|
3
3
|
import { Result } from "@prisma/orm-framework/utils/result";
|
|
4
4
|
import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-Dlo-YzOk.d.mts
|
|
6
6
|
//#region src/control-api/operations/migrate-show.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* One migration that will run in a `migrate --show` preview, in execution order.
|
|
@@ -60,4 +60,4 @@ interface MigrateShowPlanSuccess {
|
|
|
60
60
|
declare function executeMigrateShowPlan(options: ExecuteMigrateShowPlanOptions): Promise<Result<MigrateShowPlanSuccess, CliStructuredError$2>>;
|
|
61
61
|
//#endregion
|
|
62
62
|
export { executeMigrateShowPlan as i, MigrateShowMigration as n, MigrateShowPlanSuccess as r, ExecuteMigrateShowPlanOptions as t };
|
|
63
|
-
//# sourceMappingURL=migrate-show-
|
|
63
|
+
//# sourceMappingURL=migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map
|
package/dist/{migrate-show-DutwCc2F-BhGfH7D-.d.mts.map → migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-show-
|
|
1
|
+
{"version":3,"file":"migrate-show-Dlo-YzOk-BXo-DmwI.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-Dlo-YzOk.d.mts"],"mappings":";;;;;;;;;UAQU;WACC;WACA;WACA;WACA;WACA;;UAED;WACC,QAAQ;;WAER;;WAEA;WACA;WACA;WACA;;WAEA,eAAe;;;;;WAKf,uBAAuB;aACrB;aACA;aACA;aACA;;;UAGH;WACC,WAAW;WACX;WACA,qBAAqB;WACrB;;WAEA,yBAAyB;;WAEzB;;;;;;;;;;;;;iBAaM,uBAAuB,SAAS,gCAAgC,QAAQ,OAAO,wBAAwB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as errorPathUnreachable, F as mapRefResolutionError, I as requireLiveDatabase, P as errorUnexpected, k as errorRuntime$1, l as errorDatabaseConnectionRequired, t as CliStructuredError$1 } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
2
2
|
import { t as MigrationToolsError } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
|
|
3
3
|
import "./constants-CM-w38DQ-Cz_EXbOc.mjs";
|
|
4
|
-
import { _ as resolveMigrationPaths, n as closeQuietly } from "./command-helpers-
|
|
4
|
+
import { _ as resolveMigrationPaths, n as closeQuietly } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
5
5
|
import { i as readRefs } from "./refs-WK86uYYp-B6EZkmmT.mjs";
|
|
6
6
|
import { u as requireHeadRef } from "./aggregate-BBsCbXgJ.mjs";
|
|
7
|
-
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-
|
|
8
|
-
import { a as planSpacePath, t as createControlClient } from "./client-
|
|
7
|
+
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs";
|
|
8
|
+
import { a as planSpacePath, t as createControlClient } from "./client-DU9qtBxW-BjVHiKzE.mjs";
|
|
9
9
|
import { n as parseContractRef } from "./ref-resolution-sGcINe7o.mjs";
|
|
10
10
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
11
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-
|
|
11
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-kVUG1xdo.mjs
|
|
12
12
|
/**
|
|
13
13
|
* Computes the path through the SAME seam as `executeMigrate`:
|
|
14
14
|
* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
|
|
@@ -196,4 +196,4 @@ async function executeMigrateShowPlan(options) {
|
|
|
196
196
|
//#endregion
|
|
197
197
|
export { executeMigrateShowPlan as t };
|
|
198
198
|
|
|
199
|
-
//# sourceMappingURL=migrate-show-
|
|
199
|
+
//# sourceMappingURL=migrate-show-kVUG1xdo-bVTW8tu4.mjs.map
|
package/dist/{migrate-show-bdXjSFgh-CQxl5yNp.mjs.map → migrate-show-kVUG1xdo-bVTW8tu4.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-show-bdXjSFgh-CQxl5yNp.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-bdXjSFgh.mjs"],"sourcesContent":["import { D as errorRuntime, M as errorUnexpected, N as mapRefResolutionError, P as requireLiveDatabase, s as errorDatabaseConnectionRequired, t as CliStructuredError, x as errorPathUnreachable } from \"./cli-errors-C6_pH59O.mjs\";\nimport { c as resolveMigrationPaths, n as closeQuietly } from \"./command-helpers-kD9CO1hd.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-BpdB-mHG.mjs\";\nimport { n as planSpacePath, t as createControlClient } from \"./client-BqhVohc5.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { requireHeadRef } from \"@internal/migration-tools/aggregate\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { MigrationToolsError } from \"@internal/migration-tools/errors\";\nimport { readRefs } from \"@internal/migration-tools/refs\";\nimport { parseContractRef } from \"@internal/migration-tools/ref-resolution\";\n//#region src/control-api/operations/migrate-show.ts\n/**\n* Computes the path through the SAME seam as `executeMigrate`:\n* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving\n* the full marker including `invariants` (not just `storageHash`).\n* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,\n* which feeds `resolveRecordedPath()` with the same target hash, target invariants,\n* and current marker as the real apply path uses.\n*\n* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No\n* DB state is mutated.\n*/\nasync function executeMigrateShowPlan(options) {\n\tconst config = options.config;\n\tconst { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(options.configPath, config, options.cwd);\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tconst hasDriver = !!config.driver;\n\tconst hasExplicitFrom = options.from !== void 0;\n\tif (!hasExplicitFrom) {\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver,\n\t\t\twhy: \"migrate --show needs a database connection to read the live marker (or pass --from <contract> for an offline preview)\",\n\t\t\tretryCommand: \"prisma-next migrate --show --from <contract>\"\n\t\t});\n\t\tif (missingDb) return notOk(missingDb);\n\t}\n\tlet allRefs = {};\n\ttry {\n\t\tallRefs = await readRefs(refsDir);\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst { aggregate, contractHash } = loaded.value;\n\tconst appGraph = aggregate.app.graph();\n\tlet targetHash = contractHash;\n\tlet refInvariants;\n\tif (options.to) {\n\t\tconst toResult = parseContractRef(options.to, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs,\n\t\t\tcontractHash\n\t\t});\n\t\tif (!toResult.ok) return notOk(mapRefResolutionError(toResult.failure));\n\t\tif (toResult.value.provenance.kind === \"reserved-db\") return notOk(errorDatabaseConnectionRequired({\n\t\t\twhy: \"@db is not valid as a --to target; it names the live database state, not a target contract.\",\n\t\t\tcommandName: \"migrate --show\"\n\t\t}));\n\t\ttargetHash = toResult.value.hash;\n\t\tif (toResult.value.provenance.kind === \"ref\") {\n\t\t\tconst refEntry = allRefs[toResult.value.provenance.refName];\n\t\t\tif (refEntry) refInvariants = refEntry.invariants;\n\t\t}\n\t}\n\toptions.onPreflightComplete?.({\n\t\tconfigPath,\n\t\tmigrationsRelative,\n\t\tdbConnection,\n\t\thasExplicitFrom\n\t});\n\tconst markerBySpace = /* @__PURE__ */ new Map();\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tif (hasExplicitFrom) if (options.from === \"@db\") {\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver,\n\t\t\twhy: \"@db resolves to the live database marker and requires a --db connection\",\n\t\t\tretryCommand: \"prisma-next migrate --show --from @db --db $DATABASE_URL\"\n\t\t});\n\t\tif (missingDb) return notOk(missingDb);\n\t} else {\n\t\tconst fromResult = parseContractRef(options.from, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs,\n\t\t\tcontractHash\n\t\t});\n\t\tif (!fromResult.ok) return notOk(mapRefResolutionError(fromResult.failure));\n\t\tif (fromResult.value.provenance.kind === \"reserved-db\") {\n\t\t\tconst missingDb = requireLiveDatabase({\n\t\t\t\tdbConnection,\n\t\t\t\thasDriver,\n\t\t\t\twhy: \"@db resolves to the live database marker and requires a --db connection\"\n\t\t\t});\n\t\t\tif (missingDb) return notOk(missingDb);\n\t\t} else {\n\t\t\tconst fromHash = fromResult.value.hash;\n\t\t\tconst offlineMarker = fromHash === EMPTY_CONTRACT_HASH ? null : {\n\t\t\t\tstorageHash: fromHash,\n\t\t\t\tinvariants: []\n\t\t\t};\n\t\t\tmarkerBySpace.set(aggregate.app.spaceId, offlineMarker);\n\t\t}\n\t}\n\tconst needsLiveMarker = !hasExplicitFrom || options.from === \"@db\";\n\tif (needsLiveMarker) {\n\t\tif (!dbConnection || !hasDriver) return notOk(errorDatabaseConnectionRequired({\n\t\t\twhy: \"A database connection is required to read the live marker for migrate --show\",\n\t\t\tcommandName: \"migrate --show\"\n\t\t}));\n\t\tconst client = (options.createClient ?? createControlClient)({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver: config.driver,\n\t\t\textensions: config.extensions ?? []\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tconst allMarkers = await client.readAllMarkers();\n\t\t\tfor (const space of allSpaces) {\n\t\t\t\tconst marker = allMarkers.get(space.spaceId);\n\t\t\t\tmarkerBySpace.set(space.spaceId, marker ?? null);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read live DB marker: ${error instanceof Error ? error.message : String(error)}` }));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t}\n\tconst canonicalOrderSpaces = [...aggregate.extensions, aggregate.app];\n\tconst orderedMigrations = [];\n\tfor (const space of canonicalOrderSpaces) {\n\t\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\t\tconst headRef = requireHeadRef(space);\n\t\tconst outcome = planSpacePath({\n\t\t\tspace,\n\t\t\taggregate,\n\t\t\ttargetHash: isAppSpace ? targetHash : headRef.hash,\n\t\t\trefInvariants: isAppSpace ? refInvariants : void 0,\n\t\t\tliveMarker: markerBySpace.get(space.spaceId) ?? null\n\t\t});\n\t\tif (outcome.kind === \"at-head\") continue;\n\t\tif (outcome.kind === \"never-planned\") return notOk(errorPathUnreachable({\n\t\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\t\tsummary: `No on-disk migrations for contract space \"${outcome.spaceId}\"`,\n\t\t\twhy: `migrate is replay-only: space \"${outcome.spaceId}\" has no on-disk migrations but its head ref targets \"${outcome.targetHash}\".`,\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\ttarget: outcome.targetHash,\n\t\t\t\tkind: \"neverPlanned\"\n\t\t\t}\n\t\t}));\n\t\tif (outcome.kind === \"unreachable\") {\n\t\t\tconst fromHash = outcome.liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\t\treturn notOk(errorPathUnreachable({\n\t\t\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\t\t\tsummary: `No migration path from ${fromHash.slice(0, 14)} to ${outcome.targetHash.slice(0, 14)} in space \"${outcome.spaceId}\".`,\n\t\t\t\twhy: `The migration graph has no path from the from-state to the target in space \"${outcome.spaceId}\".`,\n\t\t\t\tmeta: {\n\t\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\t\tfrom: fromHash,\n\t\t\t\t\tto: outcome.targetHash\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tif (outcome.kind === \"unsatisfiable\") return notOk(errorRuntime(\"MIGRATION.NO_INVARIANT_PATH\", `Missing required invariants for space \"${outcome.spaceId}\"`, {\n\t\t\twhy: `The path requires invariants not available on disk: ${outcome.missing.join(\", \")}`,\n\t\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\tmissing: [...outcome.missing]\n\t\t\t}\n\t\t}));\n\t\tfor (const edge of outcome.plan.migrationEdges) orderedMigrations.push({\n\t\t\tspaceId: space.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to\n\t\t});\n\t}\n\tconst count = orderedMigrations.length;\n\treturn ok({\n\t\taggregate,\n\t\tcontractHash,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: count === 0 ? \"Already up to date — nothing to run\" : `${count} migration${count === 1 ? \"\" : \"s\"} will run`,\n\t\trenderMarkerHashBySpace: new Map(allSpaces.map((s) => [s.spaceId, markerBySpace.get(s.spaceId)?.storageHash ?? EMPTY_CONTRACT_HASH])),\n\t\tusedLiveMarker: needsLiveMarker\n\t});\n}\n//#endregion\nexport { executeMigrateShowPlan as t };\n\n//# sourceMappingURL=migrate-show-bdXjSFgh.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,eAAe,uBAAuB,SAAS;CAC9C,MAAM,SAAS,QAAQ;CACvB,MAAM,EAAE,YAAY,eAAe,oBAAoB,YAAY,sBAAsB,QAAQ,YAAY,QAAQ,QAAQ,GAAG;CAChI,MAAM,eAAe,QAAQ,MAAM,OAAO,IAAI;CAC9C,MAAM,YAA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CAAC,GAAG,QAAQ,OAAO;GAC7B;EACD,CAAC,CAAC;EACF,KAAK,MAAM,QAAQ,QAAQ,KAAK,gBAAgB,kBAAkB,KAAK;GACtE,SAAS,MAAM;GACf,SAAS,KAAK;GACd,eAAe,KAAK;GACpB,MAAM,KAAK;GACX,IAAI,KAAK;EACV,CAAC;CACF;CACA,MAAM,QAAQ,kBAAkB;CAChC,OAAO,GAAG;EACT;EACA;EACA,YAAY;EACZ,SAAS,UAAU,IAAI,wCAAwC,GAAG,MAAM,YAAY,UAAU,IAAI,KAAK,IAAI;EAC3G,yBAAyB,IAAI,IAAI,UAAU,KAAK,MAAM,CAAC,EAAE,SAAS,cAAc,IAAI,EAAE,OAAO,CAAC,EAAE,eAAA,OAAkC,CAAC,CAAC;EACpI,gBAAgB;CACjB,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"migrate-show-kVUG1xdo-bVTW8tu4.mjs","names":["CliStructuredError","errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-kVUG1xdo.mjs"],"sourcesContent":["import { F as requireLiveDatabase, N as errorUnexpected, O as errorRuntime, P as mapRefResolutionError, S as errorPathUnreachable, c as errorDatabaseConnectionRequired, t as CliStructuredError } from \"./cli-errors-BG6bItjG.mjs\";\nimport { c as resolveMigrationPaths, n as closeQuietly } from \"./command-helpers-CwLvFwMB.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-CoLTf3Ce.mjs\";\nimport { n as planSpacePath, t as createControlClient } from \"./client-DU9qtBxW.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { requireHeadRef } from \"@internal/migration-tools/aggregate\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { MigrationToolsError } from \"@internal/migration-tools/errors\";\nimport { readRefs } from \"@internal/migration-tools/refs\";\nimport { parseContractRef } from \"@internal/migration-tools/ref-resolution\";\n//#region src/control-api/operations/migrate-show.ts\n/**\n* Computes the path through the SAME seam as `executeMigrate`:\n* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving\n* the full marker including `invariants` (not just `storageHash`).\n* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,\n* which feeds `resolveRecordedPath()` with the same target hash, target invariants,\n* and current marker as the real apply path uses.\n*\n* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No\n* DB state is mutated.\n*/\nasync function executeMigrateShowPlan(options) {\n\tconst config = options.config;\n\tconst { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(options.configPath, config, options.cwd);\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tconst hasDriver = !!config.driver;\n\tconst hasExplicitFrom = options.from !== void 0;\n\tif (!hasExplicitFrom) {\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver,\n\t\t\twhy: \"migrate --show needs a database connection to read the live marker (or pass --from <contract> for an offline preview)\",\n\t\t\tretryCommand: \"prisma-next migrate --show --from <contract>\"\n\t\t});\n\t\tif (missingDb) return notOk(missingDb);\n\t}\n\tlet allRefs = {};\n\ttry {\n\t\tallRefs = await readRefs(refsDir);\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst { aggregate, contractHash } = loaded.value;\n\tconst appGraph = aggregate.app.graph();\n\tlet targetHash = contractHash;\n\tlet refInvariants;\n\tif (options.to) {\n\t\tconst toResult = parseContractRef(options.to, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs,\n\t\t\tcontractHash\n\t\t});\n\t\tif (!toResult.ok) return notOk(mapRefResolutionError(toResult.failure));\n\t\tif (toResult.value.provenance.kind === \"reserved-db\") return notOk(errorDatabaseConnectionRequired({\n\t\t\twhy: \"@db is not valid as a --to target; it names the live database state, not a target contract.\",\n\t\t\tcommandName: \"migrate --show\"\n\t\t}));\n\t\ttargetHash = toResult.value.hash;\n\t\tif (toResult.value.provenance.kind === \"ref\") {\n\t\t\tconst refEntry = allRefs[toResult.value.provenance.refName];\n\t\t\tif (refEntry) refInvariants = refEntry.invariants;\n\t\t}\n\t}\n\toptions.onPreflightComplete?.({\n\t\tconfigPath,\n\t\tmigrationsRelative,\n\t\tdbConnection,\n\t\thasExplicitFrom\n\t});\n\tconst markerBySpace = /* @__PURE__ */ new Map();\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tif (hasExplicitFrom) if (options.from === \"@db\") {\n\t\tconst missingDb = requireLiveDatabase({\n\t\t\tdbConnection,\n\t\t\thasDriver,\n\t\t\twhy: \"@db resolves to the live database marker and requires a --db connection\",\n\t\t\tretryCommand: \"prisma-next migrate --show --from @db --db $DATABASE_URL\"\n\t\t});\n\t\tif (missingDb) return notOk(missingDb);\n\t} else {\n\t\tconst fromResult = parseContractRef(options.from, {\n\t\t\tgraph: appGraph,\n\t\t\trefs: allRefs,\n\t\t\tcontractHash\n\t\t});\n\t\tif (!fromResult.ok) return notOk(mapRefResolutionError(fromResult.failure));\n\t\tif (fromResult.value.provenance.kind === \"reserved-db\") {\n\t\t\tconst missingDb = requireLiveDatabase({\n\t\t\t\tdbConnection,\n\t\t\t\thasDriver,\n\t\t\t\twhy: \"@db resolves to the live database marker and requires a --db connection\"\n\t\t\t});\n\t\t\tif (missingDb) return notOk(missingDb);\n\t\t} else {\n\t\t\tconst fromHash = fromResult.value.hash;\n\t\t\tconst offlineMarker = fromHash === EMPTY_CONTRACT_HASH ? null : {\n\t\t\t\tstorageHash: fromHash,\n\t\t\t\tinvariants: []\n\t\t\t};\n\t\t\tmarkerBySpace.set(aggregate.app.spaceId, offlineMarker);\n\t\t}\n\t}\n\tconst needsLiveMarker = !hasExplicitFrom || options.from === \"@db\";\n\tif (needsLiveMarker) {\n\t\tif (!dbConnection || !hasDriver) return notOk(errorDatabaseConnectionRequired({\n\t\t\twhy: \"A database connection is required to read the live marker for migrate --show\",\n\t\t\tcommandName: \"migrate --show\"\n\t\t}));\n\t\tconst client = (options.createClient ?? createControlClient)({\n\t\t\tfamily: config.family,\n\t\t\ttarget: config.target,\n\t\t\tadapter: config.adapter,\n\t\t\tdriver: config.driver,\n\t\t\textensions: config.extensions ?? []\n\t\t});\n\t\ttry {\n\t\t\tawait client.connect(dbConnection);\n\t\t\tconst allMarkers = await client.readAllMarkers();\n\t\t\tfor (const space of allSpaces) {\n\t\t\t\tconst marker = allMarkers.get(space.spaceId);\n\t\t\t\tmarkerBySpace.set(space.spaceId, marker ?? null);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read live DB marker: ${error instanceof Error ? error.message : String(error)}` }));\n\t\t} finally {\n\t\t\tawait closeQuietly(client);\n\t\t}\n\t}\n\tconst canonicalOrderSpaces = [...aggregate.extensions, aggregate.app];\n\tconst orderedMigrations = [];\n\tfor (const space of canonicalOrderSpaces) {\n\t\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\t\tconst headRef = requireHeadRef(space);\n\t\tconst outcome = planSpacePath({\n\t\t\tspace,\n\t\t\taggregate,\n\t\t\ttargetHash: isAppSpace ? targetHash : headRef.hash,\n\t\t\trefInvariants: isAppSpace ? refInvariants : void 0,\n\t\t\tliveMarker: markerBySpace.get(space.spaceId) ?? null\n\t\t});\n\t\tif (outcome.kind === \"at-head\") continue;\n\t\tif (outcome.kind === \"never-planned\") return notOk(errorPathUnreachable({\n\t\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\t\tsummary: `No on-disk migrations for contract space \"${outcome.spaceId}\"`,\n\t\t\twhy: `migrate is replay-only: space \"${outcome.spaceId}\" has no on-disk migrations but its head ref targets \"${outcome.targetHash}\".`,\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\ttarget: outcome.targetHash,\n\t\t\t\tkind: \"neverPlanned\"\n\t\t\t}\n\t\t}));\n\t\tif (outcome.kind === \"unreachable\") {\n\t\t\tconst fromHash = outcome.liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\t\treturn notOk(errorPathUnreachable({\n\t\t\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\t\t\tsummary: `No migration path from ${fromHash.slice(0, 14)} to ${outcome.targetHash.slice(0, 14)} in space \"${outcome.spaceId}\".`,\n\t\t\t\twhy: `The migration graph has no path from the from-state to the target in space \"${outcome.spaceId}\".`,\n\t\t\t\tmeta: {\n\t\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\t\tfrom: fromHash,\n\t\t\t\t\tto: outcome.targetHash\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\tif (outcome.kind === \"unsatisfiable\") return notOk(errorRuntime(\"MIGRATION.NO_INVARIANT_PATH\", `Missing required invariants for space \"${outcome.spaceId}\"`, {\n\t\t\twhy: `The path requires invariants not available on disk: ${outcome.missing.join(\", \")}`,\n\t\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\t\tmeta: {\n\t\t\t\tspaceId: outcome.spaceId,\n\t\t\t\tmissing: [...outcome.missing]\n\t\t\t}\n\t\t}));\n\t\tfor (const edge of outcome.plan.migrationEdges) orderedMigrations.push({\n\t\t\tspaceId: space.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to\n\t\t});\n\t}\n\tconst count = orderedMigrations.length;\n\treturn ok({\n\t\taggregate,\n\t\tcontractHash,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: count === 0 ? \"Already up to date — nothing to run\" : `${count} migration${count === 1 ? \"\" : \"s\"} will run`,\n\t\trenderMarkerHashBySpace: new Map(allSpaces.map((s) => [s.spaceId, markerBySpace.get(s.spaceId)?.storageHash ?? EMPTY_CONT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MAAM,GAAG,EAAE,EAAE,aAAa,QAAQ,QAAQ;IAC5H,KAAK,+EAA+E,QAAQ,QAAQ;IACpG,MAAM;KACL,SAAS,QAAQ;KACjB,MAAM;KACN,IAAI,QAAQ;IACb;GACD,CAAC,CAAC;EACH;EACA,IAAI,QAAQ,SAAS,iBAAiB,OAAO,MAAMC,eAAa,+BAA+B,0CAA0C,QAAQ,QAAQ,IAAI;GAC5J,KAAK,uDAAuD,QAAQ,QAAQ,KAAK,IAAI;GACrF,KAAK;GACL,MAAM;IACL,SAAS,QAAQ;IACjB,SAAS,CAAC,GAAG,QAAQ,OAAO;GAC7B;EACD,CAAC,CAAC;EACF,KAAK,MAAM,QAAQ,QAAQ,KAAK,gBAAgB,kBAAkB,KAAK;GACtE,SAAS,MAAM;GACf,SAAS,KAAK;GACd,eAAe,KAAK;GACpB,MAAM,KAAK;GACX,IAAI,KAAK;EACV,CAAC;CACF;CACA,MAAM,QAAQ,kBAAkB;CAChC,OAAO,GAAG;EACT;EACA;EACA,YAAY;EACZ,SAAS,UAAU,IAAI,wCAAwC,GAAG,MAAM,YAAY,UAAU,IAAI,KAAK,IAAI;EAC3G,yBAAyB,IAAI,IAAI,UAAU,KAAK,MAAM,CAAC,EAAE,SAAS,cAAc,IAAI,EAAE,OAAO,CAAC,EAAE,eAAA,OAAkC,CAAC,CAAC;EACpI,gBAAgB;CACjB,CAAC;AACF"}
|
package/dist/{migration-check-BHiINj74-CVazN1LV.mjs → migration-check-BVK9vfan-Dfg8lbeB.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { L as runCommandAction, r as chooseAction } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
3
3
|
import { a as formatErrorJson, o as formatErrorOutput, r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
|
|
4
|
-
import { _ as resolveMigrationPaths, b as setCommandExamples, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, x as setCommandSeeAlso, y as setCommandDescriptions } from "./command-helpers-
|
|
5
|
-
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-
|
|
6
|
-
import { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from "./migration-check-
|
|
4
|
+
import { _ as resolveMigrationPaths, b as setCommandExamples, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, x as setCommandSeeAlso, y as setCommandDescriptions } from "./command-helpers-CwLvFwMB-BWwUQhlT.mjs";
|
|
5
|
+
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs";
|
|
6
|
+
import { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from "./migration-check-CBMoMDX2-DhSEOGNg.mjs";
|
|
7
7
|
import { join, relative } from "pathe";
|
|
8
8
|
import { Command } from "commander";
|
|
9
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-check-
|
|
9
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-check-BVK9vfan.mjs
|
|
10
10
|
function migrationPathRelative(dirPath) {
|
|
11
11
|
return relative(process.cwd(), dirPath);
|
|
12
12
|
}
|
|
@@ -269,4 +269,4 @@ function createMigrationCheckCommand() {
|
|
|
269
269
|
//#endregion
|
|
270
270
|
export { createMigrationCheckCommand as t };
|
|
271
271
|
|
|
272
|
-
//# sourceMappingURL=migration-check-
|
|
272
|
+
//# sourceMappingURL=migration-check-BVK9vfan-Dfg8lbeB.mjs.map
|