@prisma/orm-toolchain 8.0.0-rc.1-dev.25 → 8.0.0-rc.1-dev.26
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 +24 -24
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/{caught-errors-nYuTn3NK-DkD-ZrDr.mjs → caught-errors-B_oGFiYw-BqX49eW0.mjs} +3 -3
- package/dist/{caught-errors-nYuTn3NK-DkD-ZrDr.mjs.map → caught-errors-B_oGFiYw-BqX49eW0.mjs.map} +1 -1
- package/dist/{cli-errors-C7vbvQuK-DLpSxz4U.d.mts → cli-errors-C8DGzS94-CPP3UmRT.d.mts} +6 -5
- package/dist/cli-errors-C8DGzS94-CPP3UmRT.d.mts.map +1 -0
- package/dist/{cli-errors-kU09RUaz-CUkQ9XuM.mjs → cli-errors-CihMAEVj-C1uUYBop.mjs} +122 -28
- package/dist/cli-errors-CihMAEVj-C1uUYBop.mjs.map +1 -0
- package/dist/cli.mjs +383 -14
- 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.d.mts +1 -1
- package/dist/cli__commands__migration-check.mjs +2 -2
- package/dist/cli__commands__migration-graph.d.mts +12 -10
- package/dist/cli__commands__migration-graph.d.mts.map +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +4 -4
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.d.mts +4 -4
- 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.d.mts +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.d.mts +4 -4
- package/dist/cli__commands__migration-status.mjs +2 -2
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +33 -31
- 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-milNsAnF-B92uF3yv.mjs → client-CaIWFVnh-PVaTEvdx.mjs} +5 -5
- package/dist/{client-milNsAnF-B92uF3yv.mjs.map → client-CaIWFVnh-PVaTEvdx.mjs.map} +1 -1
- package/dist/{command-helpers-bGYd7Aab-BNSzfbHK.mjs → command-helpers-DutQjYgy-CDfFwtAa.mjs} +16 -5
- package/dist/{command-helpers-bGYd7Aab-BNSzfbHK.mjs.map → command-helpers-DutQjYgy-CDfFwtAa.mjs.map} +1 -1
- package/dist/{contract-at-errors-BTeDEXm4-BAIDia2-.mjs → contract-at-errors-BsQiGdZC-BY8u2is4.mjs} +3 -3
- package/dist/{contract-at-errors-BTeDEXm4-BAIDia2-.mjs.map → contract-at-errors-BsQiGdZC-BY8u2is4.mjs.map} +1 -1
- package/dist/contract-emit-BAfPwP3y-DfV1Stry.mjs +2 -0
- package/dist/{contract-emit-Ci-8sP-b-QzQXK2xQ.mjs → contract-emit-BJDLPMxp-qaGmQUQr.mjs} +6 -6
- package/dist/{contract-emit-Ci-8sP-b-QzQXK2xQ.mjs.map → contract-emit-BJDLPMxp-qaGmQUQr.mjs.map} +1 -1
- package/dist/{contract-emit-Bdf4DAR4-lKqkbfZT.mjs → contract-emit-WIAaN0lC-DKOdtrUQ.mjs} +5 -5
- package/dist/{contract-emit-Bdf4DAR4-lKqkbfZT.mjs.map → contract-emit-WIAaN0lC-DKOdtrUQ.mjs.map} +1 -1
- package/dist/{contract-infer-hhyMJiwS-BJ5cYC9P.mjs → contract-infer-B929dnCJ-KkT9frLY.mjs} +5 -5
- package/dist/{contract-infer-hhyMJiwS-BJ5cYC9P.mjs.map → contract-infer-B929dnCJ-KkT9frLY.mjs.map} +1 -1
- package/dist/{contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs → contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs} +4 -4
- package/dist/{contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs.map → contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs → contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs} +4 -4
- package/dist/{contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs.map → contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs.map} +1 -1
- package/dist/{db-init-3CbSYxRI-BlTkWh8n.mjs → db-init-CU_x-p2M-_6oEFLiG.mjs} +7 -7
- package/dist/db-init-CU_x-p2M-_6oEFLiG.mjs.map +1 -0
- package/dist/{db-schema-BVLbe3EL-WLnbuo77.mjs → db-schema-BKAn8UrM-DP4k7BAB.mjs} +6 -6
- package/dist/{db-schema-BVLbe3EL-WLnbuo77.mjs.map → db-schema-BKAn8UrM-DP4k7BAB.mjs.map} +1 -1
- package/dist/{db-sign-Cdw2RmoG-C-X5UheR.mjs → db-sign-BQF-jVXg-D467Bhpj.mjs} +9 -9
- package/dist/db-sign-BQF-jVXg-D467Bhpj.mjs.map +1 -0
- package/dist/{db-update-BHOdo8PV-BVBNKrJc.mjs → db-update-B0_Q4ykE-CT9vcaMu.mjs} +8 -8
- package/dist/db-update-B0_Q4ykE-CT9vcaMu.mjs.map +1 -0
- package/dist/{db-verify-C9P9oNCs-gieY7hV2.mjs → db-verify-C0DJc8z6-f3gZeEMD.mjs} +9 -9
- package/dist/db-verify-C0DJc8z6-f3gZeEMD.mjs.map +1 -0
- package/dist/{format-Ddhz7xFW-Bo1nhay8.mjs → format-SYdHyutg-IqXk-tDV.mjs} +5 -5
- package/dist/{format-Ddhz7xFW-Bo1nhay8.mjs.map → format-SYdHyutg-IqXk-tDV.mjs.map} +1 -1
- package/dist/{framework-components-Cruf6BPK-CaQvMI3T.mjs → framework-components-CXxMNF8E-C-g2cchI.mjs} +3 -3
- package/dist/{framework-components-Cruf6BPK-CaQvMI3T.mjs.map → framework-components-CXxMNF8E-C-g2cchI.mjs.map} +1 -1
- package/dist/{init-DjdnLDyf-2nVOeVG9.mjs → init-BvE3r7P6-CjJraEPP.mjs} +5 -5
- package/dist/{init-DjdnLDyf-2nVOeVG9.mjs.map → init-BvE3r7P6-CjJraEPP.mjs.map} +1 -1
- package/dist/{inspect-live-schema-BEQun_1x-CZpCgg8A.mjs → inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs} +6 -6
- package/dist/inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs.map +1 -0
- package/dist/{invariants-D5TNnX5E-rjPoJGFq.mjs → invariants-TW5CizTS-BsIpi4h4.mjs} +4 -4
- package/dist/{invariants-D5TNnX5E-rjPoJGFq.mjs.map → invariants-TW5CizTS-BsIpi4h4.mjs.map} +1 -1
- package/dist/{legend-BBtAETiW-BHqTbUjx.mjs → legend-QYDKKevn-DCIlAPn4.mjs} +3 -3
- package/dist/{legend-BBtAETiW-BHqTbUjx.mjs.map → legend-QYDKKevn-DCIlAPn4.mjs.map} +1 -1
- package/dist/{migrate-show-CUymfnbM-BbpcO2FY.mjs → migrate-show-C-fdCznr-BH88FGVn.mjs} +7 -7
- package/dist/migrate-show-C-fdCznr-BH88FGVn.mjs.map +1 -0
- package/dist/{migrate-show-g71Z4vJw-ocdTvf70.d.mts → migrate-show-DWIvU6Y_-BQyWhZD1.d.mts} +4 -4
- package/dist/{migrate-show-g71Z4vJw-ocdTvf70.d.mts.map → migrate-show-DWIvU6Y_-BQyWhZD1.d.mts.map} +1 -1
- package/dist/{migrate-B-hpVTxi-DJzFYT2w.mjs → migrate-vNMZJk7M-DKogRyOh.mjs} +14 -14
- package/dist/migrate-vNMZJk7M-DKogRyOh.mjs.map +1 -0
- package/dist/{migration-check-DHYPMUFe-Cni_ZUzB.mjs → migration-check-C-2GTAGq-Duc0P6Uo.mjs} +16 -16
- package/dist/migration-check-C-2GTAGq-Duc0P6Uo.mjs.map +1 -0
- package/dist/{migration-check-zgqYe3SB-B6LI6wY7.mjs → migration-check-DATj3HSn-Del6ZSln.mjs} +26 -21
- package/dist/migration-check-DATj3HSn-Del6ZSln.mjs.map +1 -0
- package/dist/{migration-command-scaffold-DsT7ke7B-D3u913Po.mjs → migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs} +5 -5
- package/dist/{migration-command-scaffold-DsT7ke7B-D3u913Po.mjs.map → migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs.map} +1 -1
- package/dist/{migration-graph-Dm9gU0oE-DxPD_SNA.mjs → migration-graph-B1mg_jel-HVG6FLD0.mjs} +20 -62
- package/dist/migration-graph-B1mg_jel-HVG6FLD0.mjs.map +1 -0
- package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs → migration-graph-BtP1Va3T-CMOZgqVW.mjs} +3 -3
- package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs.map → migration-graph-BtP1Va3T-CMOZgqVW.mjs.map} +1 -1
- package/dist/migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs +67 -0
- package/dist/migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs.map +1 -0
- package/dist/{migration-list-Bkase_ZM-D-bErpSr.mjs → migration-list-AKRIIovW-Cr39jOaI.mjs} +3 -3
- package/dist/{migration-list-Bkase_ZM-D-bErpSr.mjs.map → migration-list-AKRIIovW-Cr39jOaI.mjs.map} +1 -1
- package/dist/{migration-list-DDGUTC8Y-B_X7rkez.mjs → migration-list-RSlyGyvD-KKmZtdY1.mjs} +7 -7
- package/dist/{migration-list-DDGUTC8Y-B_X7rkez.mjs.map → migration-list-RSlyGyvD-KKmZtdY1.mjs.map} +1 -1
- package/dist/migration-log-CBfOcyPC-DTqCL1cs.mjs +123 -0
- package/dist/migration-log-CBfOcyPC-DTqCL1cs.mjs.map +1 -0
- package/dist/{migration-log-Cft50PRu-DcnHdxT4.mjs → migration-log-table-C0dSMG9T-BhBYrdka.mjs} +4 -120
- package/dist/migration-log-table-C0dSMG9T-BhBYrdka.mjs.map +1 -0
- package/dist/{migration-new-D9GHbYwF-C8D22HXG.mjs → migration-new-1LYliIXy-BK_Xz0Z6.mjs} +5 -5
- package/dist/{migration-new-D9GHbYwF-C8D22HXG.mjs.map → migration-new-1LYliIXy-BK_Xz0Z6.mjs.map} +1 -1
- package/dist/{migration-new-RorO1I8r-Ch8NQ4GQ.mjs → migration-new-DcPO4tiw-Bew7S-bj.mjs} +7 -7
- package/dist/{migration-new-RorO1I8r-Ch8NQ4GQ.mjs.map → migration-new-DcPO4tiw-Bew7S-bj.mjs.map} +1 -1
- package/dist/{migration-path-target-DhGt62Mi-dm4TU1hJ.mjs → migration-path-target-yA4h5Zc6-DlzBblBG.mjs} +7 -7
- package/dist/migration-path-target-yA4h5Zc6-DlzBblBG.mjs.map +1 -0
- package/dist/{migration-plan-BOhasCLr-GJWYoOA8.mjs → migration-plan-B0z2Qpa5-6b1SJSsb.mjs} +5 -5
- package/dist/{migration-plan-BOhasCLr-GJWYoOA8.mjs.map → migration-plan-B0z2Qpa5-6b1SJSsb.mjs.map} +1 -1
- package/dist/{migration-plan-DrCTzrXH-CDJbdiC6.mjs → migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs} +8 -8
- package/dist/{migration-plan-DrCTzrXH-CDJbdiC6.mjs.map → migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs.map} +1 -1
- package/dist/{migration-plan-t2e_8yD2-w5Ffa0V_.d.mts → migration-plan-s94qwFHi-86F_Aklp.d.mts} +4 -4
- package/dist/{migration-plan-t2e_8yD2-w5Ffa0V_.d.mts.map → migration-plan-s94qwFHi-86F_Aklp.d.mts.map} +1 -1
- package/dist/{migration-show-DRARjIbv-1p6EE_Uw.mjs → migration-show-BRy1GVBE-NuwoczhZ.mjs} +13 -22
- package/dist/migration-show-BRy1GVBE-NuwoczhZ.mjs.map +1 -0
- package/dist/{migration-status-Yh0eOQJN-YpcPDpNh.mjs → migration-status-Dob4onB1-0YkQF25g.mjs} +12 -12
- package/dist/migration-status-Dob4onB1-0YkQF25g.mjs.map +1 -0
- package/dist/{project-import-root--e8xli8Z-Bfrvrv67.mjs → project-import-root-Bkz1gPB2-jhrMFebo.mjs} +3 -3
- package/dist/{project-import-root--e8xli8Z-Bfrvrv67.mjs.map → project-import-root-Bkz1gPB2-jhrMFebo.mjs.map} +1 -1
- package/dist/{ref-Cu7Zc1Hv-_R4MnDfr.mjs → ref-B643Z0CS-CoJgdv7h.mjs} +5 -5
- package/dist/{ref-Cu7Zc1Hv-_R4MnDfr.mjs.map → ref-B643Z0CS-CoJgdv7h.mjs.map} +1 -1
- package/dist/{ref-BQcl8Ksv-BYZY0Ktb.mjs → ref-D9J4TNYz-Dk7HCAoq.mjs} +5 -5
- package/dist/{ref-BQcl8Ksv-BYZY0Ktb.mjs.map → ref-D9J4TNYz-Dk7HCAoq.mjs.map} +1 -1
- package/dist/{ref-resolution-BYCRg72z-DFhwf-XR.mjs → ref-resolution-Bi4lpxM8-BX-7sl0f.mjs} +3 -3
- package/dist/{ref-resolution-BYCRg72z-DFhwf-XR.mjs.map → ref-resolution-Bi4lpxM8-BX-7sl0f.mjs.map} +1 -1
- package/dist/{schemas-KhXMzNA_-CzZ7GFX_.mjs → schemas-BMkqaqvM-CLaqlat4.mjs} +9 -3
- package/dist/{schemas-KhXMzNA_-CzZ7GFX_.mjs.map → schemas-BMkqaqvM-CLaqlat4.mjs.map} +1 -1
- package/dist/{schemas-CeGMYFYX-h3OcU__O.d.mts → schemas-Bm2e3Hk1-qLKF0B36.d.mts} +16 -4
- package/dist/{schemas-CeGMYFYX-h3OcU__O.d.mts.map → schemas-Bm2e3Hk1-qLKF0B36.d.mts.map} +1 -1
- package/dist/{telemetry-Dh6e0ams-BsjGN3tQ.mjs → telemetry-DFEbk6sD-BYEW2bCJ.mjs} +4 -4
- package/dist/{telemetry-Dh6e0ams-BsjGN3tQ.mjs.map → telemetry-DFEbk6sD-BYEW2bCJ.mjs.map} +1 -1
- package/dist/{terminal-ui-ypPE9cN6-ilMBkmwT.mjs → terminal-ui-DQNCDg2u-B3PFqjB8.mjs} +10 -3
- package/dist/terminal-ui-DQNCDg2u-B3PFqjB8.mjs.map +1 -0
- package/dist/{verify-DBsKxZrK-eDPxNiSS.mjs → verify-TphNCyMu-h8vrnbud.mjs} +3 -3
- package/dist/{verify-DBsKxZrK-eDPxNiSS.mjs.map → verify-TphNCyMu-h8vrnbud.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/cli-errors-C7vbvQuK-DLpSxz4U.d.mts.map +0 -1
- package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs.map +0 -1
- package/dist/contract-emit-E6m8HE42-Bfiodzf_.mjs +0 -2
- package/dist/db-init-3CbSYxRI-BlTkWh8n.mjs.map +0 -1
- package/dist/db-sign-Cdw2RmoG-C-X5UheR.mjs.map +0 -1
- package/dist/db-update-BHOdo8PV-BVBNKrJc.mjs.map +0 -1
- package/dist/db-verify-C9P9oNCs-gieY7hV2.mjs.map +0 -1
- package/dist/inspect-live-schema-BEQun_1x-CZpCgg8A.mjs.map +0 -1
- package/dist/migrate-B-hpVTxi-DJzFYT2w.mjs.map +0 -1
- package/dist/migrate-show-CUymfnbM-BbpcO2FY.mjs.map +0 -1
- package/dist/migration-check-DHYPMUFe-Cni_ZUzB.mjs.map +0 -1
- package/dist/migration-check-zgqYe3SB-B6LI6wY7.mjs.map +0 -1
- package/dist/migration-graph-Dm9gU0oE-DxPD_SNA.mjs.map +0 -1
- package/dist/migration-log-Cft50PRu-DcnHdxT4.mjs.map +0 -1
- package/dist/migration-path-target-DhGt62Mi-dm4TU1hJ.mjs.map +0 -1
- package/dist/migration-show-DRARjIbv-1p6EE_Uw.mjs.map +0 -1
- package/dist/migration-status-Yh0eOQJN-YpcPDpNh.mjs.map +0 -1
- package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map +0 -1
package/dist/{migration-check-zgqYe3SB-B6LI6wY7.mjs → migration-check-DATj3HSn-Del6ZSln.mjs}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { I as runCommandAction, r as chooseAction } from "./cli-errors-CihMAEVj-C1uUYBop.mjs";
|
|
3
|
+
import { a as formatErrorOutput, i as formatErrorJson, n as createTerminalUI } from "./terminal-ui-DQNCDg2u-B3PFqjB8.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-DutQjYgy-CDfFwtAa.mjs";
|
|
5
|
+
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs";
|
|
6
|
+
import { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from "./migration-check-C-2GTAGq-Duc0P6Uo.mjs";
|
|
6
7
|
import { join, relative } from "pathe";
|
|
7
8
|
import { Command } from "commander";
|
|
8
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-check-
|
|
9
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-check-DATj3HSn.mjs
|
|
9
10
|
function migrationPathRelative(dirPath) {
|
|
10
11
|
return relative(process.cwd(), dirPath);
|
|
11
12
|
}
|
|
@@ -26,91 +27,91 @@ function integrityViolationToCheckFailure(violation, migrationsDir) {
|
|
|
26
27
|
code: "MIGRATION.CHECK_HASH_MISMATCH",
|
|
27
28
|
where: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), "migration.json"),
|
|
28
29
|
why: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,
|
|
29
|
-
|
|
30
|
+
nextActions: [chooseAction("Re-emit the migration package, or restore it from version control")]
|
|
30
31
|
};
|
|
31
32
|
case "providedInvariantsMismatch": return {
|
|
32
33
|
space: violation.spaceId,
|
|
33
34
|
code: "MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH",
|
|
34
35
|
where: packageRelative(violation.spaceId, violation.dirName),
|
|
35
36
|
why: `Migration "${violation.dirName}" providedInvariants in migration.json disagrees with ops.json.`,
|
|
36
|
-
|
|
37
|
+
nextActions: [chooseAction("Re-emit the migration package so migration.json and ops.json agree")]
|
|
37
38
|
};
|
|
38
39
|
case "packageUnloadable": return {
|
|
39
40
|
space: violation.spaceId,
|
|
40
41
|
code: "MIGRATION.CHECK_PACKAGE_UNLOADABLE",
|
|
41
42
|
where: packageRelative(violation.spaceId, violation.dirName),
|
|
42
43
|
why: `Migration "${violation.dirName}" could not be loaded: ${violation.detail}`,
|
|
43
|
-
|
|
44
|
+
nextActions: [chooseAction("Re-emit the migration package, or restore it from version control")]
|
|
44
45
|
};
|
|
45
46
|
case "sameSourceAndTarget": return {
|
|
46
47
|
space: violation.spaceId,
|
|
47
48
|
code: "MIGRATION.CHECK_NOOP_SELF_EDGE",
|
|
48
49
|
where: packageRelative(violation.spaceId, violation.dirName),
|
|
49
50
|
why: `Migration "${violation.dirName}" in space "${violation.spaceId}" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`,
|
|
50
|
-
|
|
51
|
+
nextActions: [chooseAction("Add a data operation if this self-edge was meant to carry a data invariant"), chooseAction("Or delete the migration if it is a true no-op")]
|
|
51
52
|
};
|
|
52
53
|
case "orphanSpaceDir": return {
|
|
53
54
|
space: violation.spaceId,
|
|
54
55
|
code: "MIGRATION.CHECK_ORPHAN_SPACE_DIR",
|
|
55
56
|
where: spaceRelative(violation.spaceId),
|
|
56
57
|
why: `Contract-space directory "${violation.spaceId}" exists on disk but no extension declares it.`,
|
|
57
|
-
|
|
58
|
+
nextActions: [chooseAction("Remove the orphan directory"), chooseAction("Or declare the extension in `extensions`")]
|
|
58
59
|
};
|
|
59
60
|
case "declaredButUnmigrated": return {
|
|
60
61
|
space: violation.spaceId,
|
|
61
62
|
code: "MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED",
|
|
62
63
|
where: spaceRelative(violation.spaceId),
|
|
63
64
|
why: `Extension "${violation.spaceId}" is declared in \`extensions\` but has no on-disk migrations directory.`,
|
|
64
|
-
|
|
65
|
+
nextActions: [runCommandAction("Re-emit the extension contract-space artefacts, then plan its migrations", "prisma-next contract emit"), chooseAction("Or remove the extension from `extensions` if it is unused")]
|
|
65
66
|
};
|
|
66
67
|
case "headRefMissing": return {
|
|
67
68
|
space: violation.spaceId,
|
|
68
69
|
code: "MIGRATION.CHECK_HEAD_REF_MISSING",
|
|
69
70
|
where: refRelative(violation.spaceId, "head"),
|
|
70
71
|
why: `Head ref \`refs/head.json\` is missing for contract space "${violation.spaceId}".`,
|
|
71
|
-
|
|
72
|
+
nextActions: [chooseAction("Re-emit the contract-space migrations and head ref artefacts"), chooseAction("Or restore `refs/head.json` from version control")]
|
|
72
73
|
};
|
|
73
74
|
case "headRefNotInGraph": return {
|
|
74
75
|
space: violation.spaceId,
|
|
75
76
|
code: "MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH",
|
|
76
77
|
where: refRelative(violation.spaceId, "head"),
|
|
77
78
|
why: `Head ref ${violation.hash} for contract space "${violation.spaceId}" is not present in its migration graph.`,
|
|
78
|
-
|
|
79
|
+
nextActions: [chooseAction("Re-emit the contract-space migrations"), chooseAction("Or restore the missing migration package")]
|
|
79
80
|
};
|
|
80
81
|
case "refUnreadable": return {
|
|
81
82
|
space: violation.spaceId,
|
|
82
83
|
code: "MIGRATION.CHECK_REF_UNREADABLE",
|
|
83
84
|
where: refRelative(violation.spaceId, violation.refName),
|
|
84
85
|
why: `Ref "${violation.refName}" for contract space "${violation.spaceId}" is unreadable: ${violation.detail}`,
|
|
85
|
-
|
|
86
|
+
nextActions: [chooseAction("Repair or remove the corrupt ref file")]
|
|
86
87
|
};
|
|
87
88
|
case "targetMismatch": return {
|
|
88
89
|
space: violation.spaceId,
|
|
89
90
|
code: "MIGRATION.CHECK_TARGET_MISMATCH",
|
|
90
91
|
where: spaceRelative(violation.spaceId),
|
|
91
92
|
why: `Contract space "${violation.spaceId}" targets "${violation.actual}" but the project targets "${violation.expected}".`,
|
|
92
|
-
|
|
93
|
+
nextActions: [chooseAction("Update the extension to target the configured database"), chooseAction("Or change the project target")]
|
|
93
94
|
};
|
|
94
95
|
case "disjointness": return {
|
|
95
96
|
space: "app",
|
|
96
97
|
code: "MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION",
|
|
97
98
|
where: migrationPathRelative(migrationsDir),
|
|
98
99
|
why: `Storage element "${violation.element}" is claimed by multiple contract spaces: ${violation.claimedBy.join(", ")}.`,
|
|
99
|
-
|
|
100
|
+
nextActions: [chooseAction("Update the contracts so each storage element is owned by exactly one contract space")]
|
|
100
101
|
};
|
|
101
102
|
case "contractUnreadable": return {
|
|
102
103
|
space: violation.spaceId,
|
|
103
104
|
code: "MIGRATION.CHECK_CONTRACT_UNREADABLE",
|
|
104
105
|
where: migrationFileRelative(join(migrationsDir, violation.spaceId), "contract.json"),
|
|
105
106
|
why: `Contract for space "${violation.spaceId}" is unreadable: ${violation.detail}`,
|
|
106
|
-
|
|
107
|
+
nextActions: [runCommandAction("Re-emit the extension contract artefacts", "prisma-next contract emit"), chooseAction("Or fix the descriptor producing the invalid contract")]
|
|
107
108
|
};
|
|
108
109
|
case "duplicateMigrationHash": return {
|
|
109
110
|
space: violation.spaceId,
|
|
110
111
|
code: "MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH",
|
|
111
112
|
where: spaceRelative(violation.spaceId),
|
|
112
113
|
why: `Multiple migrations in space "${violation.spaceId}" share migrationHash "${violation.migrationHash}" (${violation.dirNames.join(", ")}).`,
|
|
113
|
-
|
|
114
|
+
nextActions: [chooseAction("Re-emit one of the conflicting packages so each migrationHash is unique")]
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
}
|
|
@@ -159,7 +160,8 @@ async function executeMigrationCheckCommand(target, options, flags, ui) {
|
|
|
159
160
|
spaces,
|
|
160
161
|
...options.space !== void 0 ? { spaceFilter: options.space } : {},
|
|
161
162
|
appMigrationsDir,
|
|
162
|
-
appMigrationsRelative
|
|
163
|
+
appMigrationsRelative,
|
|
164
|
+
cwd: process.cwd()
|
|
163
165
|
});
|
|
164
166
|
const checkResult = await runMigrationCheck({
|
|
165
167
|
spaces,
|
|
@@ -253,7 +255,10 @@ function createMigrationCheckCommand() {
|
|
|
253
255
|
} else {
|
|
254
256
|
for (const f of result.failures) {
|
|
255
257
|
ui.log(`✗ [${f.code}] ${f.where}: ${f.why}`);
|
|
256
|
-
|
|
258
|
+
for (const action of f.nextActions) {
|
|
259
|
+
const command = action.command === void 0 ? "" : `: ${action.command}`;
|
|
260
|
+
ui.log(` next: ${action.label}${command}`);
|
|
261
|
+
}
|
|
257
262
|
}
|
|
258
263
|
ui.log(`\n${result.summary}`);
|
|
259
264
|
}
|
|
@@ -264,4 +269,4 @@ function createMigrationCheckCommand() {
|
|
|
264
269
|
//#endregion
|
|
265
270
|
export { createMigrationCheckCommand as t };
|
|
266
271
|
|
|
267
|
-
//# sourceMappingURL=migration-check-
|
|
272
|
+
//# sourceMappingURL=migration-check-DATj3HSn-Del6ZSln.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-check-DATj3HSn-Del6ZSln.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-check-DATj3HSn.mjs"],"sourcesContent":["import { F as chooseAction, I as runCommandAction } from \"./cli-errors-CihMAEVj.mjs\";\nimport { i as formatErrorOutput, r as formatErrorJson, t as createTerminalUI } from \"./terminal-ui-DQNCDg2u.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, c as resolveMigrationPaths, d as setCommandExamples, f as setCommandSeeAlso, t as addGlobalOptions, u as setCommandDescriptions } from \"./command-helpers-DutQjYgy.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-sF0OJ6oz.mjs\";\nimport { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from \"./migration-check-C-2GTAGq.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { join, relative } from \"pathe\";\n//#region src/utils/integrity-violation-to-check-failure.ts\nfunction migrationPathRelative(dirPath) {\n\treturn relative(process.cwd(), dirPath);\n}\nfunction migrationFileRelative(dirPath, fileName) {\n\treturn join(migrationPathRelative(dirPath), fileName);\n}\n/**\n* Map one {@link IntegrityViolation} onto a `migration check` failure row.\n* Sole catalogue mapping from integrity violations to `MIGRATION.CHECK_*` codes.\n*/\nfunction integrityViolationToCheckFailure(violation, migrationsDir) {\n\tconst spaceRelative = (spaceId) => migrationPathRelative(join(migrationsDir, spaceId));\n\tconst packageRelative = (spaceId, dirName) => migrationPathRelative(join(migrationsDir, spaceId, dirName));\n\tconst refRelative = (spaceId, refName) => migrationPathRelative(join(migrationsDir, spaceId, \"refs\", `${refName}.json`));\n\tswitch (violation.kind) {\n\t\tcase \"hashMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HASH_MISMATCH\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), \"migration.json\"),\n\t\t\twhy: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"providedInvariantsMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" providedInvariants in migration.json disagrees with ops.json.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package so migration.json and ops.json agree\")]\n\t\t};\n\t\tcase \"packageUnloadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_PACKAGE_UNLOADABLE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" could not be loaded: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the migration package, or restore it from version control\")]\n\t\t};\n\t\tcase \"sameSourceAndTarget\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_NOOP_SELF_EDGE\",\n\t\t\twhere: packageRelative(violation.spaceId, violation.dirName),\n\t\t\twhy: `Migration \"${violation.dirName}\" in space \"${violation.spaceId}\" has source equal to target (${violation.hash}) with no data invariant — a true no-op self-edge.`,\n\t\t\tnextActions: [chooseAction(\"Add a data operation if this self-edge was meant to carry a data invariant\"), chooseAction(\"Or delete the migration if it is a true no-op\")]\n\t\t};\n\t\tcase \"orphanSpaceDir\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_ORPHAN_SPACE_DIR\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract-space directory \"${violation.spaceId}\" exists on disk but no extension declares it.`,\n\t\t\tnextActions: [chooseAction(\"Remove the orphan directory\"), chooseAction(\"Or declare the extension in `extensions`\")]\n\t\t};\n\t\tcase \"declaredButUnmigrated\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Extension \"${violation.spaceId}\" is declared in \\`extensions\\` but has no on-disk migrations directory.`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract-space artefacts, then plan its migrations\", \"prisma-next contract emit\"), chooseAction(\"Or remove the extension from `extensions` if it is unused\")]\n\t\t};\n\t\tcase \"headRefMissing\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_MISSING\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref \\`refs/head.json\\` is missing for contract space \"${violation.spaceId}\".`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations and head ref artefacts\"), chooseAction(\"Or restore `refs/head.json` from version control\")]\n\t\t};\n\t\tcase \"headRefNotInGraph\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH\",\n\t\t\twhere: refRelative(violation.spaceId, \"head\"),\n\t\t\twhy: `Head ref ${violation.hash} for contract space \"${violation.spaceId}\" is not present in its migration graph.`,\n\t\t\tnextActions: [chooseAction(\"Re-emit the contract-space migrations\"), chooseAction(\"Or restore the missing migration package\")]\n\t\t};\n\t\tcase \"refUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_REF_UNREADABLE\",\n\t\t\twhere: refRelative(violation.spaceId, violation.refName),\n\t\t\twhy: `Ref \"${violation.refName}\" for contract space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [chooseAction(\"Repair or remove the corrupt ref file\")]\n\t\t};\n\t\tcase \"targetMismatch\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_TARGET_MISMATCH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Contract space \"${violation.spaceId}\" targets \"${violation.actual}\" but the project targets \"${violation.expected}\".`,\n\t\t\tnextActions: [chooseAction(\"Update the extension to target the configured database\"), chooseAction(\"Or change the project target\")]\n\t\t};\n\t\tcase \"disjointness\": return {\n\t\t\tspace: \"app\",\n\t\t\tcode: \"MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION\",\n\t\t\twhere: migrationPathRelative(migrationsDir),\n\t\t\twhy: `Storage element \"${violation.element}\" is claimed by multiple contract spaces: ${violation.claimedBy.join(\", \")}.`,\n\t\t\tnextActions: [chooseAction(\"Update the contracts so each storage element is owned by exactly one contract space\")]\n\t\t};\n\t\tcase \"contractUnreadable\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_CONTRACT_UNREADABLE\",\n\t\t\twhere: migrationFileRelative(join(migrationsDir, violation.spaceId), \"contract.json\"),\n\t\t\twhy: `Contract for space \"${violation.spaceId}\" is unreadable: ${violation.detail}`,\n\t\t\tnextActions: [runCommandAction(\"Re-emit the extension contract artefacts\", \"prisma-next contract emit\"), chooseAction(\"Or fix the descriptor producing the invalid contract\")]\n\t\t};\n\t\tcase \"duplicateMigrationHash\": return {\n\t\t\tspace: violation.spaceId,\n\t\t\tcode: \"MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH\",\n\t\t\twhere: spaceRelative(violation.spaceId),\n\t\t\twhy: `Multiple migrations in space \"${violation.spaceId}\" share migrationHash \"${violation.migrationHash}\" (${violation.dirNames.join(\", \")}).`,\n\t\t\tnextActions: [chooseAction(\"Re-emit one of the conflicting packages so each migrationHash is unique\")]\n\t\t};\n\t}\n}\n//#endregion\n//#region src/commands/migration-check.ts\nasync function executeMigrationCheckCommand(target, options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return {\n\t\terror: configResult.failure,\n\t\texitCode: 2\n\t};\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config, process.cwd());\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 (target) details.push({\n\t\t\tlabel: \"target\",\n\t\t\tvalue: target\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration check\",\n\t\t\tdescription: \"Verify artifact and graph integrity\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst loadedAggregate = await buildReadAggregate(config, { migrationsDir });\n\tif (!loadedAggregate.ok) return {\n\t\terror: loadedAggregate.failure,\n\t\texitCode: 2\n\t};\n\tconst spaces = await enumerateCheckSpaces(loadedAggregate.value.aggregate, migrationsDir, process.cwd());\n\tif (target) return await checkSingleTarget(target, {\n\t\tspaces,\n\t\t...options.space !== void 0 ? { spaceFilter: options.space } : {},\n\t\tappMigrationsDir,\n\t\tappMigrationsRelative,\n\t\tcwd: process.cwd()\n\t});\n\tconst checkResult = await runMigrationCheck({\n\t\tspaces,\n\t\t...options.space !== void 0 ? { spaceFilter: options.space } : {}\n\t});\n\tif (!checkResult.ok) return {\n\t\terror: checkResult.failure,\n\t\texitCode: 2\n\t};\n\tconst failures = [...checkResult.value.failures];\n\tconst allViolations = await loadAggregateIntegrityViolations(config, migrationsDir);\n\tconst scopedViolations = options.space === void 0 ? allViolations : allViolations.filter((v) => v.kind !== \"disjointness\" && v.spaceId === options.space);\n\tfor (const violation of scopedViolations) failures.push(integrityViolationToCheckFailure(violation, migrationsDir));\n\tif (failures.length === 0) return {\n\t\tresult: {\n\t\t\tok: true,\n\t\t\tfailures: [],\n\t\t\tsummary: \"All checks passed\"\n\t\t},\n\t\texitCode: 0\n\t};\n\treturn {\n\t\tresult: {\n\t\t\tok: false,\n\t\t\tfailures,\n\t\t\tsummary: `${failures.length} integrity failure(s)`\n\t\t},\n\t\texitCode: 4\n\t};\n}\nfunction createMigrationCheckCommand() {\n\tconst command = new Command(\"check\");\n\tsetCommandDescriptions(command, \"Verify artifact and graph integrity\", \"Validates that on-disk migration packages are internally consistent\\n(hashes match, manifests are complete) and that the graph is well-formed\\n(edges connect, refs point at valid nodes). The whole-graph check spans\\nevery contract space by default; pass --space <id> to narrow to one. A\\nmigration reference checks a single package, resolved across all contract\\nspaces (narrow with --space; an ambiguous reference is a precondition failure).\\nOffline — does not consult the database.\\nExit codes: 0 = all checks passed, 2 = precondition failed\\n(unresolved target or unknown --space), 4 = integrity failure(s) found.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration check\",\n\t\t\"prisma-next migration check --space app\",\n\t\t\"prisma-next migration check 20260101-add-users\",\n\t\t\"prisma-next migration check 20260101-add-users --space app\",\n\t\t\"prisma-next migration check --json\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration graph\",\n\t\t\toneLiner: \"Show the migration graph topology\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\tcommand.exitOverride();\n\taddGlobalOptions(command).argument(\"[target]\", \"Migration reference: directory name, hash/prefix, ref, or path\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--space <id>\", \"Narrow output to a single contract space\").action(async (target, options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tlet outcome;\n\t\ttry {\n\t\t\toutcome = await executeMigrationCheckCommand(target, options, flags, ui);\n\t\t} catch (error) {\n\t\t\toutcome = {\n\t\t\t\tresult: {\n\t\t\t\t\tok: false,\n\t\t\t\t\tfailures: [],\n\t\t\t\t\tsummary: error instanceof Error ? error.message : String(error)\n\t\t\t\t},\n\t\t\t\texitCode: 2\n\t\t\t};\n\t\t}\n\t\tif (outcome.error) {\n\t\t\tconst envelope = outcome.error.toEnvelope();\n\t\t\tif (flags.json) ui.output(formatErrorJson(envelope));\n\t\t\telse if (!flags.quiet) ui.error(formatErrorOutput(envelope, flags));\n\t\t\tprocess.exit(outcome.exitCode);\n\t\t}\n\t\tconst result = outcome.result ?? {\n\t\t\tok: false,\n\t\t\tfailures: [],\n\t\t\tsummary: \"No check result produced\"\n\t\t};\n\t\tif (flags.json) ui.output(JSON.stringify(result, null, 2));\n\t\telse if (!flags.quiet) if (result.ok) {\n\t\t\tconst spaceSuffix = outcome.resolvedSpaceId !== void 0 ? ` (space: ${outcome.resolvedSpaceId})` : \"\";\n\t\t\tui.log(`✔ ${result.summary}${spaceSuffix}`);\n\t\t} else {\n\t\t\tfor (const f of result.failures) {\n\t\t\t\tui.log(`✗ [${f.code}] ${f.where}: ${f.why}`);\n\t\t\t\tfor (const action of f.nextActions) {\n\t\t\t\t\tconst command = action.command === void 0 ? \"\" : `: ${action.command}`;\n\t\t\t\t\tui.log(` next: ${action.label}${command}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tui.log(`\\n${result.summary}`);\n\t\t}\n\t\tprocess.exit(outcome.exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrationCheckCommand as t };\n\n//# sourceMappingURL=migration-check-DATj3HSn.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,sBAAsB,SAAS;CACvC,OAAO,SAAS,QAAQ,IAAI,GAAG,OAAO;AACvC;AACA,SAAS,sBAAsB,SAAS,UAAU;CACjD,OAAO,KAAK,sBAAsB,OAAO,GAAG,QAAQ;AACrD;;;;;AAKA,SAAS,iCAAiC,WAAW,eAAe;CACnE,MAAM,iBAAi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KAC7D,GAAG,IAAI,WAAW,OAAO,QAAQ,SAAS;IAC3C;GACD;GACA,GAAG,IAAI,KAAK,OAAO,SAAS;EAC7B;EACA,QAAQ,KAAK,QAAQ,QAAQ;CAC9B,CAAC;CACD,OAAO;AACR"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { N as errorUnexpected, c as errorDatabaseConnectionRequired, d as errorFileNotFound, j as errorTargetMigrationNotSupported, s as errorContractValidationFailed, t as CliStructuredError$1, u as errorDriverRequired } from "./cli-errors-CihMAEVj-C1uUYBop.mjs";
|
|
3
|
+
import { f as maskConnectionUrl, g as resolveContractPath, s as formatStyledHeader, t as addGlobalOptions } from "./command-helpers-DutQjYgy-CDfFwtAa.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-CaIWFVnh-PVaTEvdx.mjs";
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
7
7
|
import { hasMigrations } from "@prisma/orm-framework/components/control";
|
|
8
8
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
9
9
|
import { relative, resolve } from "node:path";
|
|
10
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-command-scaffold-
|
|
10
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-command-scaffold-BezR8GWB.mjs
|
|
11
11
|
/**
|
|
12
12
|
* Prepares the shared context for migration commands (db init, db update).
|
|
13
13
|
*
|
|
@@ -118,4 +118,4 @@ function addMigrationCommandOptions(command) {
|
|
|
118
118
|
//#endregion
|
|
119
119
|
export { prepareMigrationContext as n, addMigrationCommandOptions as t };
|
|
120
120
|
|
|
121
|
-
//# sourceMappingURL=migration-command-scaffold-
|
|
121
|
+
//# sourceMappingURL=migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-command-scaffold-
|
|
1
|
+
{"version":3,"file":"migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-command-scaffold-BezR8GWB.mjs"],"sourcesContent":["import { A as errorTargetMigrationNotSupported, M as errorUnexpected, l as errorDriverRequired, o as errorContractValidationFailed, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFileNotFound } from \"./cli-errors-CihMAEVj.mjs\";\nimport { S as formatStyledHeader, a as maskConnectionUrl, s as resolveContractPath, t as addGlobalOptions } from \"./command-helpers-DutQjYgy.mjs\";\nimport { t as createProgressAdapter } from \"./progress-adapter-CjAeTxY_.mjs\";\nimport { t as createControlClient } from \"./client-CaIWFVnh.mjs\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { hasMigrations } from \"@internal/framework-components/control\";\nimport { relative, resolve } from \"node:path\";\n//#region src/utils/migration-command-scaffold.ts\n/**\n* Prepares the shared context for migration commands (db init, db update).\n*\n* Handles: config loading, contract file reading, JSON parsing, connection resolution,\n* driver/migration-support validation, client creation, and header output.\n*\n* Returns a Result with either the resolved context or a structured error.\n*/\nasync function prepareMigrationContext(options, flags, ui, descriptor) {\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 = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\tlet contractPathAbsolute;\n\ttry {\n\t\tcontractPathAbsolute = resolveContractPath(config);\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tconst contractPath = relative(process.cwd(), contractPathAbsolute);\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: \"contract\",\n\t\t\tvalue: contractPath\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\tif (options.dryRun) details.push({\n\t\t\tlabel: \"mode\",\n\t\t\tvalue: \"dry run\"\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: descriptor.commandName,\n\t\t\tdescription: descriptor.description,\n\t\t\turl: descriptor.url,\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = 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 ${contractPath}, or update \\`config.contract.output\\` in ${configPath}`\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` }));\n\t}\n\tlet contractJson;\n\ttry {\n\t\tcontractJson = JSON.parse(contractJsonContent);\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${descriptor.commandName} (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: descriptor.commandName\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: `Config.driver is required for ${descriptor.commandName}` }));\n\tif (!hasMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\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\treturn ok({\n\t\tclient,\n\t\tcontractJson,\n\t\tdbConnection,\n\t\tonProgress,\n\t\tconfigPath,\n\t\tcontractPath,\n\t\tcontractPathAbsolute,\n\t\tconfig\n\t});\n}\n/**\n* Registers the shared CLI options for migration commands (db init, db update).\n*/\nfunction addMigrationCommandOptions(command) {\n\taddGlobalOptions(command);\n\treturn command.option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--dry-run\", \"Preview planned operations without applying\", false);\n}\n//#endregion\nexport { prepareMigrationContext as n, addMigrationCommandOptions as t };\n\n//# sourceMappingURL=migration-command-scaffold-BezR8GWB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,eAAe,wBAAwB,SAAS,OAAO,IAAI,YAAY;CACtE,MAAM,eAAe,MAAM,sBAAsB,QAAQ,QAAQ;EAChE;EACA;EACA;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;CACJ,IAAI;EACH,uBAAuB,oBAAoB,MAAM;CAClD,SAAS,OAAO;EACf,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;CACA,MAAM,eAAe,SAAS,QAAQ,IAAI,GAAG,oBAAoB;CACjE,IAAI,CAAC,M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,EAAE,KAAK,iCAAiC,WAAW,cAAc,CAAC,CAAC;CACxH,IAAI,CAAC,cAAc,OAAO,MAAM,GAAG,OAAO,MAAM,iCAAiC,EAAE,KAAK,WAAW,OAAO,OAAO,GAAG,+BAA+B,CAAC,CAAC;CACrJ,MAAM,SAAS,oBAAoB;EAClC,QAAQ,OAAO;EACf,QAAQ,OAAO;EACf,SAAS,OAAO;EAChB,QAAQ,OAAO;EACf,YAAY,OAAO,cAAc,CAAC;CACnC,CAAC;CACD,MAAM,aAAa,sBAAsB;EACxC;EACA;CACD,CAAC;CACD,OAAO,GAAG;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;AACF;;;;AAIA,SAAS,2BAA2B,SAAS;CAC5C,iBAAiB,OAAO;CACxB,OAAO,QAAQ,OAAO,cAAc,4BAA4B,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,aAAa,+CAA+C,KAAK;AACtM"}
|
package/dist/{migration-graph-Dm9gU0oE-DxPD_SNA.mjs → migration-graph-B1mg_jel-HVG6FLD0.mjs}
RENAMED
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import { n as createTerminalUI } from "./terminal-ui-
|
|
3
|
-
import {
|
|
4
|
-
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-
|
|
5
|
-
import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
2
|
+
import { n as createTerminalUI } from "./terminal-ui-DQNCDg2u-B3PFqjB8.mjs";
|
|
3
|
+
import { _ as resolveMigrationPaths, b as setCommandExamples, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, x as setCommandSeeAlso, y as setCommandDescriptions } from "./command-helpers-DutQjYgy-CDfFwtAa.mjs";
|
|
4
|
+
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs";
|
|
5
|
+
import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-AKRIIovW-Cr39jOaI.mjs";
|
|
6
|
+
import { g as renderMigrationGraphLegend } from "./migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs";
|
|
7
|
+
import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-BtP1Va3T-CMOZgqVW.mjs";
|
|
8
|
+
import { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from "./migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs";
|
|
9
|
+
import { n as validateLegendOptions, t as shouldShowLegend } from "./legend-QYDKKevn-DCIlAPn4.mjs";
|
|
9
10
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
10
11
|
import { ok } from "@prisma/orm-framework/utils/result";
|
|
11
12
|
import { Command } from "commander";
|
|
12
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-graph-
|
|
13
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-graph-B1mg_jel.mjs
|
|
13
14
|
function computeGraphSummary(spaces) {
|
|
14
15
|
const contractCount = spaces.reduce((count, space) => count + space.contracts.length, 0);
|
|
15
16
|
const migrationCount = spaces.reduce((count, space) => count + space.migrations.length, 0);
|
|
16
17
|
return `${spaces.length} space(s), ${contractCount} contract(s), ${migrationCount} migration(s)`;
|
|
17
18
|
}
|
|
18
19
|
function formatMigrationGraphHumanOutput(result) {
|
|
19
|
-
|
|
20
|
-
for (const section of result.treeSections) {
|
|
21
|
-
if (section.showHeading) sections.push(`${section.space}:`);
|
|
22
|
-
if (section.tree.length > 0) sections.push(section.tree);
|
|
23
|
-
else sections.push("(no migrations)");
|
|
24
|
-
sections.push("");
|
|
25
|
-
}
|
|
26
|
-
sections.push(result.summary);
|
|
27
|
-
return sections.join("\n").trimEnd();
|
|
20
|
+
return renderMigrationGraphSections(result.treeSections, result.summary);
|
|
28
21
|
}
|
|
29
22
|
async function executeMigrationGraphCommand(options, flags, ui) {
|
|
30
23
|
const configResult = await loadConfigForSections(options.config, [
|
|
@@ -77,40 +70,13 @@ async function executeMigrationGraphCommand(options, flags, ui) {
|
|
|
77
70
|
});
|
|
78
71
|
if (!listResult.ok) return listResult;
|
|
79
72
|
const scopedSpaces = listResult.value.spaces;
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})
|
|
87
|
-
const globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;
|
|
88
|
-
const globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;
|
|
89
|
-
const treeSections = [];
|
|
90
|
-
for (const spaceEntry of scopedSpaces) {
|
|
91
|
-
const space = aggregate.space(spaceEntry.space);
|
|
92
|
-
if (space === void 0) continue;
|
|
93
|
-
const graph = space.graph();
|
|
94
|
-
const isAppSpace = spaceEntry.space === aggregate.app.spaceId;
|
|
95
|
-
const refsByHash = listRefsByContractHash(space);
|
|
96
|
-
const tree = spaceEntry.migrations.length === 0 ? "" : renderMigrationGraphSpaceTree({
|
|
97
|
-
graph,
|
|
98
|
-
migrations: spaceEntry.migrations,
|
|
99
|
-
liveContractHash,
|
|
100
|
-
glyphMode,
|
|
101
|
-
colorize,
|
|
102
|
-
isAppSpace,
|
|
103
|
-
refsByHash,
|
|
104
|
-
...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},
|
|
105
|
-
...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}
|
|
106
|
-
});
|
|
107
|
-
const displayTree = showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, " ") : tree;
|
|
108
|
-
treeSections.push({
|
|
109
|
-
space: spaceEntry.space,
|
|
110
|
-
tree: displayTree,
|
|
111
|
-
showHeading: showSpaceHeadings
|
|
112
|
-
});
|
|
113
|
-
}
|
|
73
|
+
const treeSections = buildMigrationGraphTreeSections({
|
|
74
|
+
aggregate,
|
|
75
|
+
scopedSpaces,
|
|
76
|
+
liveContractHash,
|
|
77
|
+
glyphMode: ui.resolveGlyphMode(options.ascii === true),
|
|
78
|
+
colorize: flags.color !== false
|
|
79
|
+
});
|
|
114
80
|
const spaces = [...buildMigrationSpaceGraphEntries({
|
|
115
81
|
aggregate,
|
|
116
82
|
scopedSpaces
|
|
@@ -158,16 +124,8 @@ function createMigrationGraphCommand() {
|
|
|
158
124
|
const legendValidation = validateLegendOptions(options, flags);
|
|
159
125
|
if (!legendValidation.ok) process.exit(handleResult(legendValidation, flags, ui));
|
|
160
126
|
const exitCode = handleResult(await executeMigrationGraphCommand(options, flags, ui), flags, ui, (graphResult) => {
|
|
161
|
-
if (options.dot)
|
|
162
|
-
|
|
163
|
-
for (const edge of graphResult.graph.migrationByHash.values()) {
|
|
164
|
-
const from = edge.from.slice(0, 12);
|
|
165
|
-
const to = edge.to.slice(0, 12);
|
|
166
|
-
lines.push(` "${from}" -> "${to}" [label="${edge.dirName}"];`);
|
|
167
|
-
}
|
|
168
|
-
lines.push("}");
|
|
169
|
-
ui.output(lines.join("\n"));
|
|
170
|
-
} else if (flags.json) {
|
|
127
|
+
if (options.dot) ui.output(renderMigrationGraphDot(graphResult.graph));
|
|
128
|
+
else if (flags.json) {
|
|
171
129
|
const jsonResult = {
|
|
172
130
|
ok: true,
|
|
173
131
|
spaces: [...graphResult.spaces],
|
|
@@ -183,4 +141,4 @@ function createMigrationGraphCommand() {
|
|
|
183
141
|
//#endregion
|
|
184
142
|
export { executeMigrationGraphCommand as n, formatMigrationGraphHumanOutput as r, createMigrationGraphCommand as t };
|
|
185
143
|
|
|
186
|
-
//# sourceMappingURL=migration-graph-
|
|
144
|
+
//# sourceMappingURL=migration-graph-B1mg_jel-HVG6FLD0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-graph-B1mg_jel-HVG6FLD0.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-graph-B1mg_jel.mjs"],"sourcesContent":["import { t as createTerminalUI } from \"./terminal-ui-DQNCDg2u.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, c as resolveMigrationPaths, d as setCommandExamples, f as setCommandSeeAlso, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-DutQjYgy.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-sF0OJ6oz.mjs\";\nimport { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from \"./migration-list-AKRIIovW.mjs\";\nimport { a as renderMigrationGraphLegend } from \"./migration-graph-command-render-BKrg6BPv.mjs\";\nimport { t as buildMigrationSpaceGraphEntries } from \"./migration-graph-BtP1Va3T.mjs\";\nimport { n as renderMigrationGraphDot, r as renderMigrationGraphSections, t as buildMigrationGraphTreeSections } from \"./migration-graph-sections-BVqyqBHg.mjs\";\nimport { n as validateLegendOptions, t as shouldShowLegend } from \"./legend-QYDKKevn.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { ok } from \"@internal/utils/result\";\n//#region src/commands/migration-graph.ts\nfunction computeGraphSummary(spaces) {\n\tconst contractCount = spaces.reduce((count, space) => count + space.contracts.length, 0);\n\tconst migrationCount = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\treturn `${spaces.length} space(s), ${contractCount} contract(s), ${migrationCount} migration(s)`;\n}\nfunction formatMigrationGraphHumanOutput(result) {\n\treturn renderMigrationGraphSections(result.treeSections, result.summary);\n}\nasync function executeMigrationGraphCommand(options, flags, ui) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsRelative, migrationsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tif (!flags.json && !flags.quiet) {\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migration graph\",\n\t\t\tdescription: \"Show the migration graph topology\",\n\t\t\tdetails: [\n\t\t\t\t{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t},\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\t...options.space !== void 0 ? [{\n\t\t\t\t\tlabel: \"space\",\n\t\t\t\t\tvalue: options.space\n\t\t\t\t}] : []\n\t\t\t],\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t\tif (shouldShowLegend(options, flags)) {\n\t\t\tui.stderr(renderMigrationGraphLegend({\n\t\t\t\tcolorize: flags.color !== false,\n\t\t\t\tglyphMode: ui.resolveGlyphMode(options.ascii === true)\n\t\t\t}));\n\t\t\tui.stderr(\"\");\n\t\t}\n\t}\n\tconst loaded = await buildReadAggregate(config, { migrationsDir });\n\tif (!loaded.ok) return loaded;\n\tconst { aggregate, contractHash: liveContractHash } = loaded.value;\n\tconst appGraph = aggregate.app.graph();\n\tconst listResult = runMigrationList({\n\t\tspaces: await migrationSpaceListEntriesFromAggregate(aggregate, migrationsDir),\n\t\t...ifDefined(\"spaceFilter\", options.space)\n\t});\n\tif (!listResult.ok) return listResult;\n\tconst scopedSpaces = listResult.value.spaces;\n\tconst treeSections = buildMigrationGraphTreeSections({\n\t\taggregate,\n\t\tscopedSpaces,\n\t\tliveContractHash,\n\t\tglyphMode: ui.resolveGlyphMode(options.ascii === true),\n\t\tcolorize: flags.color !== false\n\t});\n\tconst spaces = [...buildMigrationSpaceGraphEntries({\n\t\taggregate,\n\t\tscopedSpaces\n\t})];\n\treturn ok({\n\t\tok: true,\n\t\tgraph: appGraph,\n\t\tspaces,\n\t\ttreeSections,\n\t\tsummary: computeGraphSummary(spaces)\n\t});\n}\nfunction createMigrationGraphCommand() {\n\tconst command = new Command(\"graph\");\n\tsetCommandDescriptions(command, \"Show the migration graph topology\", \"Renders the migration graph topology.\\nOffline — does not consult the database.\\n--ascii swaps box-drawing for pipe-friendly ASCII glyphs.\\nUse --json for machine-readable output, or --dot for Graphviz DOT\\nformat.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migration graph\",\n\t\t\"prisma-next migration graph --json\",\n\t\t\"prisma-next migration graph --dot\",\n\t\t\"prisma-next migration graph --ascii\",\n\t\t\"prisma-next migration graph --legend\",\n\t\t\"prisma-next migration graph --space app\"\n\t]);\n\tsetCommandSeeAlso(command, [\n\t\t{\n\t\t\tverb: \"migration status\",\n\t\t\toneLiner: \"Show migration path and pending status\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration log\",\n\t\t\toneLiner: \"Show executed migration history\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration list\",\n\t\t\toneLiner: \"List on-disk migrations\"\n\t\t},\n\t\t{\n\t\t\tverb: \"migration show\",\n\t\t\toneLiner: \"Display migration package contents\"\n\t\t}\n\t]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--space <id>\", \"Narrow output to a single contract space\").option(\"--dot\", \"Output in Graphviz DOT format\").option(\"--ascii\", \"Use ASCII glyphs (pipe-friendly)\").option(\"--legend\", \"Print a key for the tree glyphs and lane colors\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst legendValidation = validateLegendOptions(options, flags);\n\t\tif (!legendValidation.ok) process.exit(handleResult(legendValidation, flags, ui));\n\t\tconst exitCode = handleResult(await executeMigrationGraphCommand(options, flags, ui), flags, ui, (graphResult) => {\n\t\t\tif (options.dot) ui.output(renderMigrationGraphDot(graphResult.graph));\n\t\t\telse if (flags.json) {\n\t\t\t\tconst jsonResult = {\n\t\t\t\t\tok: true,\n\t\t\t\t\tspaces: [...graphResult.spaces],\n\t\t\t\t\tsummary: graphResult.summary\n\t\t\t\t};\n\t\t\t\tui.output(JSON.stringify(jsonResult, null, 2));\n\t\t\t} else if (!flags.quiet) ui.output(formatMigrationGraphHumanOutput(graphResult));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { executeMigrationGraphCommand as n, formatMigrationGraphHumanOutput as r, createMigrationGraphCommand as t };\n\n//# sourceMappingURL=migration-graph-B1mg_jel.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,oBAAoB,QAAQ;CACpC,MAAM,gBAAgB,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,UAAU,QAAQ,CAAC;CACvF,MAAM,iBAAiB,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,WAAW,QAAQ,CAAC;CACzF,OAAO,GAAG,OAAO,OAAO,aAAa,cAAc,gBAAgB,eAAe;AACnF;AACA,SAAS,gCAAgC,QAAQ;CAChD,OAAO,6BAA6B,OAAO,cAAc,OAAO,OAAO;AACxE;AACA,eAAe,6BAA6B,SAAS,OAAO,IAAI;CAC/D,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,EAAE,YAAY,oBAAoB,kBAAkB,sBAAsB,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CACrH,IAAI,CAAC,MAAM,QAAQ,CAAC,MAAM,OAAO;EAChC,MAAM,SAAS,mBAAmB;GACjC,SAAS;GACT,aAAa;GACb,SAAS;IACR;KACC,OAAO;KACP,OAAO;IACR;IACA;KACC,OAAO;KACP,OAAO;IACR;IACA,GAAG,QAAQ,UAAU,KAAK,IAAI,CAAC;KAC9B,OAAO;KAC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AiB,OAAO,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,gBAAgB,0CAA0C,CAAC,CAAC,OAAO,SAAS,+BAA+B,CAAC,CAAC,OAAO,WAAW,kCAAkC,CAAC,CAAC,OAAO,YAAY,iDAAiD,CAAC,CAAC,OAAO,OAAO,YAAY;EAC9V,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,mBAAmB,sBAAsB,SAAS,KAAK;EAC7D,IAAI,CAAC,iBAAiB,IAAI,QAAQ,KAAK,aAAa,kBAAkB,OAAO,EAAE,CAAC;EAChF,MAAM,WAAW,aAAa,MAAM,6BAA6B,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,gBAAgB;GACjH,IAAI,QAAQ,KAAK,GAAG,OAAO,wBAAwB,YAAY,KAAK,CAAC;QAChE,IAAI,MAAM,MAAM;IACpB,MAAM,aAAa;KAClB,IAAI;KACJ,QAAQ,CAAC,GAAG,YAAY,MAAM;KAC9B,SAAS,YAAY;IACtB;IACA,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;GAC9C,OAAO,IAAI,CAAC,MAAM,OAAO,GAAG,OAAO,gCAAgC,WAAW,CAAC;EAChF,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
|
package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs → migration-graph-BtP1Va3T-CMOZgqVW.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./constants-CM-w38DQ-Cz_EXbOc.mjs";
|
|
2
|
-
import { t as listRefsByContractHash } from "./migration-list-
|
|
3
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-graph-
|
|
2
|
+
import { t as listRefsByContractHash } from "./migration-list-AKRIIovW-Cr39jOaI.mjs";
|
|
3
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-graph-BtP1Va3T.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Project scoped list entries into the per-space contracts+migrations rows the migration
|
|
6
6
|
* graph --json output serializes (EMPTY_CONTRACT_HASH from-hash → null). Skips space ids
|
|
@@ -32,4 +32,4 @@ function buildMigrationSpaceGraphEntries(args) {
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { buildMigrationSpaceGraphEntries as t };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=migration-graph-
|
|
35
|
+
//# sourceMappingURL=migration-graph-BtP1Va3T-CMOZgqVW.mjs.map
|
package/dist/{migration-graph-CChCjts3-ERrIm5aT.mjs.map → migration-graph-BtP1Va3T-CMOZgqVW.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-graph-
|
|
1
|
+
{"version":3,"file":"migration-graph-BtP1Va3T-CMOZgqVW.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-graph-BtP1Va3T.mjs"],"sourcesContent":["import { t as listRefsByContractHash } from \"./migration-list-AKRIIovW.mjs\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\n//#region src/control-api/operations/migration-graph.ts\n/**\n* Project scoped list entries into the per-space contracts+migrations rows the migration\n* graph --json output serializes (EMPTY_CONTRACT_HASH from-hash → null). Skips space ids\n* the aggregate no longer resolves, mirroring the command loop.\n*/\nfunction buildMigrationSpaceGraphEntries(args) {\n\tconst spaces = [];\n\tfor (const spaceEntry of args.scopedSpaces) {\n\t\tconst space = args.aggregate.space(spaceEntry.space);\n\t\tif (space === void 0) continue;\n\t\tconst graph = space.graph();\n\t\tconst refsByHash = listRefsByContractHash(space);\n\t\tspaces.push({\n\t\t\tspace: spaceEntry.space,\n\t\t\tcontracts: [...graph.nodes].map((hash) => ({\n\t\t\t\thash,\n\t\t\t\trefs: [...refsByHash.get(hash) ?? []]\n\t\t\t})),\n\t\t\tmigrations: [...graph.migrationByHash.values()].map((edge) => ({\n\t\t\t\tname: edge.dirName,\n\t\t\t\thash: edge.migrationHash,\n\t\t\t\tfromContract: edge.from === EMPTY_CONTRACT_HASH ? null : edge.from,\n\t\t\t\ttoContract: edge.to\n\t\t\t}))\n\t\t});\n\t}\n\treturn spaces;\n}\n//#endregion\nexport { buildMigrationSpaceGraphEntries as t };\n\n//# sourceMappingURL=migration-graph-BtP1Va3T.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,gCAAgC,MAAM;CAC9C,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,cAAc,KAAK,cAAc;EAC3C,MAAM,QAAQ,KAAK,UAAU,MAAM,WAAW,KAAK;EACnD,IAAI,UAAU,KAAK,GAAG;EACtB,MAAM,QAAQ,MAAM,MAAM;EAC1B,MAAM,aAAa,uBAAuB,KAAK;EAC/C,OAAO,KAAK;GACX,OAAO,WAAW;GAClB,WAAW,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,KAAK,UAAU;IAC1C;IACA,MAAM,CAAC,GAAG,WAAW,IAAI,IAAI,KAAK,CAAC,CAAC;GACrC,EAAE;GACF,YAAY,CAAC,GAAG,MAAM,gBAAgB,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU;IAC9D,MAAM,KAAK;IACX,MAAM,KAAK;IACX,cAAc,KAAK,SAAA,UAA+B,OAAO,KAAK;IAC9D,YAAY,KAAK;GAClB,EAAE;EACH,CAAC;CACF;CACA,OAAO;AACR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { t as listRefsByContractHash } from "./migration-list-AKRIIovW-Cr39jOaI.mjs";
|
|
2
|
+
import { _ as renderMigrationGraphSpaceTree, a as computeGlobalMaxDirNameWidth, f as indentMigrationGraphTreeBlock, o as computeGlobalMaxEdgeTreePrefixWidth } from "./migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs";
|
|
3
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-graph-sections-BVqyqBHg.mjs
|
|
4
|
+
/**
|
|
5
|
+
* One tree per in-scope contract space. Widths are computed across every space
|
|
6
|
+
* first so multi-space sections align with each other.
|
|
7
|
+
*/
|
|
8
|
+
function buildMigrationGraphTreeSections(inputs) {
|
|
9
|
+
const { aggregate, scopedSpaces, liveContractHash, glyphMode, colorize } = inputs;
|
|
10
|
+
const showSpaceHeadings = scopedSpaces.length > 1;
|
|
11
|
+
const globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((entry) => entry.migrations.length > 0).flatMap((entry) => {
|
|
12
|
+
const graph = aggregate.space(entry.space)?.graph();
|
|
13
|
+
return graph === void 0 ? [] : [{
|
|
14
|
+
graph,
|
|
15
|
+
liveContractHash
|
|
16
|
+
}];
|
|
17
|
+
}) : [];
|
|
18
|
+
const globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;
|
|
19
|
+
const globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;
|
|
20
|
+
const sections = [];
|
|
21
|
+
for (const entry of scopedSpaces) {
|
|
22
|
+
const space = aggregate.space(entry.space);
|
|
23
|
+
if (space === void 0) continue;
|
|
24
|
+
const tree = entry.migrations.length === 0 ? "" : renderMigrationGraphSpaceTree({
|
|
25
|
+
graph: space.graph(),
|
|
26
|
+
migrations: entry.migrations,
|
|
27
|
+
liveContractHash,
|
|
28
|
+
glyphMode,
|
|
29
|
+
colorize,
|
|
30
|
+
isAppSpace: entry.space === aggregate.app.spaceId,
|
|
31
|
+
refsByHash: listRefsByContractHash(space),
|
|
32
|
+
...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},
|
|
33
|
+
...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}
|
|
34
|
+
});
|
|
35
|
+
sections.push({
|
|
36
|
+
space: entry.space,
|
|
37
|
+
tree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, " ") : tree,
|
|
38
|
+
showHeading: showSpaceHeadings
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return sections;
|
|
42
|
+
}
|
|
43
|
+
/** The rendered tree, headings and summary as one block of lines. */
|
|
44
|
+
function renderMigrationGraphSections(sections, summary) {
|
|
45
|
+
const lines = [];
|
|
46
|
+
for (const section of sections) {
|
|
47
|
+
if (section.showHeading) lines.push(`${section.space}:`);
|
|
48
|
+
lines.push(section.tree.length > 0 ? section.tree : "(no migrations)");
|
|
49
|
+
lines.push("");
|
|
50
|
+
}
|
|
51
|
+
lines.push(summary);
|
|
52
|
+
return lines.join("\n").trimEnd();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Graphviz DOT for the app graph. Node ids are truncated to 12 characters,
|
|
56
|
+
* which is a collision hazard recorded and preserved by the port.
|
|
57
|
+
*/
|
|
58
|
+
function renderMigrationGraphDot(graph) {
|
|
59
|
+
const lines = ["digraph migrations {"];
|
|
60
|
+
for (const edge of graph.migrationByHash.values()) lines.push(` "${edge.from.slice(0, 12)}" -> "${edge.to.slice(0, 12)}" [label="${edge.dirName}"];`);
|
|
61
|
+
lines.push("}");
|
|
62
|
+
return lines.join("\n");
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { renderMigrationGraphDot as n, renderMigrationGraphSections as r, buildMigrationGraphTreeSections as t };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-graph-sections-BVqyqBHg.mjs"],"sourcesContent":["import { t as listRefsByContractHash } from \"./migration-list-AKRIIovW.mjs\";\nimport { f as indentMigrationGraphTreeBlock, l as computeGlobalMaxDirNameWidth, p as renderMigrationGraphSpaceTree, u as computeGlobalMaxEdgeTreePrefixWidth } from \"./migration-graph-command-render-BKrg6BPv.mjs\";\n//#region src/utils/formatters/migration-graph-sections.ts\n/**\n* One tree per in-scope contract space. Widths are computed across every space\n* first so multi-space sections align with each other.\n*/\nfunction buildMigrationGraphTreeSections(inputs) {\n\tconst { aggregate, scopedSpaces, liveContractHash, glyphMode, colorize } = inputs;\n\tconst showSpaceHeadings = scopedSpaces.length > 1;\n\tconst globalLayoutInputs = showSpaceHeadings ? scopedSpaces.filter((entry) => entry.migrations.length > 0).flatMap((entry) => {\n\t\tconst graph = aggregate.space(entry.space)?.graph();\n\t\treturn graph === void 0 ? [] : [{\n\t\t\tgraph,\n\t\t\tliveContractHash\n\t\t}];\n\t}) : [];\n\tconst globalMaxEdgeTreePrefixWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxEdgeTreePrefixWidth(globalLayoutInputs) : void 0;\n\tconst globalMaxDirNameWidth = globalLayoutInputs.length > 0 ? computeGlobalMaxDirNameWidth(globalLayoutInputs) : void 0;\n\tconst sections = [];\n\tfor (const entry of scopedSpaces) {\n\t\tconst space = aggregate.space(entry.space);\n\t\tif (space === void 0) continue;\n\t\tconst tree = entry.migrations.length === 0 ? \"\" : renderMigrationGraphSpaceTree({\n\t\t\tgraph: space.graph(),\n\t\t\tmigrations: entry.migrations,\n\t\t\tliveContractHash,\n\t\t\tglyphMode,\n\t\t\tcolorize,\n\t\t\tisAppSpace: entry.space === aggregate.app.spaceId,\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t...globalMaxEdgeTreePrefixWidth !== void 0 ? { globalMaxEdgeTreePrefixWidth } : {},\n\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t});\n\t\tsections.push({\n\t\t\tspace: entry.space,\n\t\t\ttree: showSpaceHeadings && tree.length > 0 ? indentMigrationGraphTreeBlock(tree, \" \") : tree,\n\t\t\tshowHeading: showSpaceHeadings\n\t\t});\n\t}\n\treturn sections;\n}\n/** The rendered tree, headings and summary as one block of lines. */\nfunction renderMigrationGraphSections(sections, summary) {\n\tconst lines = [];\n\tfor (const section of sections) {\n\t\tif (section.showHeading) lines.push(`${section.space}:`);\n\t\tlines.push(section.tree.length > 0 ? section.tree : \"(no migrations)\");\n\t\tlines.push(\"\");\n\t}\n\tlines.push(summary);\n\treturn lines.join(\"\\n\").trimEnd();\n}\n/**\n* Graphviz DOT for the app graph. Node ids are truncated to 12 characters,\n* which is a collision hazard recorded and preserved by the port.\n*/\nfunction renderMigrationGraphDot(graph) {\n\tconst lines = [\"digraph migrations {\"];\n\tfor (const edge of graph.migrationByHash.values()) lines.push(` \"${edge.from.slice(0, 12)}\" -> \"${edge.to.slice(0, 12)}\" [label=\"${edge.dirName}\"];`);\n\tlines.push(\"}\");\n\treturn lines.join(\"\\n\");\n}\n//#endregion\nexport { renderMigrationGraphDot as n, renderMigrationGraphSections as r, buildMigrationGraphTreeSections as t };\n\n//# sourceMappingURL=migration-graph-sections-BVqyqBHg.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,gCAAgC,QAAQ;CAChD,MAAM,EAAE,WAAW,cAAc,kBAAkB,WAAW,aAAa;CAC3E,MAAM,oBAAoB,aAAa,SAAS;CAChD,MAAM,qBAAqB,oBAAoB,aAAa,QAAQ,UAAU,MAAM,WAAW,SAAS,CAAC,CAAC,CAAC,SAAS,UAAU;EAC7H,MAAM,QAAQ,UAAU,MAAM,MAAM,KAAK,CAAC,EAAE,MAAM;EAClD,OAAO,UAAU,KAAK,IAAI,CAAC,IAAI,CAAC;GAC/B;GACA;EACD,CAAC;CACF,CAAC,IAAI,CAAC;CACN,MAAM,+BAA+B,mBAAmB,SAAS,IAAI,oCAAoC,kBAAkB,IAAI,KAAK;CACpI,MAAM,wBAAwB,mBAAmB,SAAS,IAAI,6BAA6B,kBAAkB,IAAI,KAAK;CACtH,MAAM,WAAW,CAAC;CAClB,KAAK,MAAM,SAAS,cAAc;EACjC,MAAM,QAAQ,UAAU,MAAM,MAAM,KAAK;EACzC,IAAI,UAAU,KAAK,GAAG;EACtB,MAAM,OAAO,MAAM,WAAW,WAAW,IAAI,KAAK,8BAA8B;GAC/E,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM;GAClB;GACA;GACA;GACA,YAAY,MAAM,UAAU,UAAU,IAAI;GAC1C,YAAY,uBAAuB,KAAK;GACxC,GAAG,iCAAiC,KAAK,IAAI,EAAE,6BAA6B,IAAI,CAAC;GACjF,GAAG,0BAA0B,KAAK,IAAI,EAAE,sBAAsB,IAAI,CAAC;EACpE,CAAC;EACD,SAAS,KAAK;GACb,OAAO,MAAM;GACb,MAAM,qBAAqB,KAAK,SAAS,IAAI,8BAA8B,MAAM,IAAI,IAAI;GACzF,aAAa;EACd,CAAC;CACF;CACA,OAAO;AACR;;AAEA,SAAS,6BAA6B,UAAU,SAAS;CACxD,MAAM,QAAQ,CAAC;CACf,KAAK,MAAM,WAAW,UAAU;EAC/B,IAAI,QAAQ,aAAa,MAAM,KAAK,GAAG,QAAQ,MAAM,EAAE;EACvD,MAAM,KAAK,QAAQ,KAAK,SAAS,IAAI,QAAQ,OAAO,iBAAiB;EACrE,MAAM,KAAK,EAAE;CACd;CACA,MAAM,KAAK,OAAO;CAClB,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,QAAQ;AACjC;;;;;AAKA,SAAS,wBAAwB,OAAO;CACvC,MAAM,QAAQ,CAAC,sBAAsB;CACrC,KAAK,MAAM,QAAQ,MAAM,gBAAgB,OAAO,GAAG,MAAM,KAAK,MAAM,KAAK,KAAK,MAAM,GAAG,EAAE,EAAE,QAAQ,KAAK,GAAG,MAAM,GAAG,EAAE,EAAE,YAAY,KAAK,QAAQ,IAAI;CACrJ,MAAM,KAAK,GAAG;CACd,OAAO,MAAM,KAAK,IAAI;AACvB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as errorSpaceNotFound, m as errorInvalidSpaceId } from "./cli-errors-CihMAEVj-C1uUYBop.mjs";
|
|
2
2
|
import { a as isValidSpaceId, o as listContractSpaceDirectories, t as APP_SPACE_ID } from "./verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs";
|
|
3
3
|
import { o as refsByContractHash, t as HEAD_REF_NAME } from "./refs-B2BL8z3i-DGGFB7Mj.mjs";
|
|
4
4
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-list-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-list-AKRIIovW.mjs
|
|
6
6
|
function compareSpaceIds(a, b) {
|
|
7
7
|
if (a === APP_SPACE_ID) return b === APP_SPACE_ID ? 0 : -1;
|
|
8
8
|
if (b === APP_SPACE_ID) return 1;
|
|
@@ -99,4 +99,4 @@ function runMigrationList(inputs) {
|
|
|
99
99
|
//#endregion
|
|
100
100
|
export { migrationSpaceListEntriesFromAggregate as n, runMigrationList as r, listRefsByContractHash as t };
|
|
101
101
|
|
|
102
|
-
//# sourceMappingURL=migration-list-
|
|
102
|
+
//# sourceMappingURL=migration-list-AKRIIovW-Cr39jOaI.mjs.map
|
package/dist/{migration-list-Bkase_ZM-D-bErpSr.mjs.map → migration-list-AKRIIovW-Cr39jOaI.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-list-
|
|
1
|
+
{"version":3,"file":"migration-list-AKRIIovW-Cr39jOaI.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-list-AKRIIovW.mjs"],"sourcesContent":["import { k as errorSpaceNotFound, p as errorInvalidSpaceId } from \"./cli-errors-CihMAEVj.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { APP_SPACE_ID, isValidSpaceId, listContractSpaceDirectories } from \"@internal/migration-tools/spaces\";\nimport { HEAD_REF_NAME, refsByContractHash } from \"@internal/migration-tools/refs\";\n//#region src/control-api/operations/migration-list.ts\nfunction compareSpaceIds(a, b) {\n\tif (a === APP_SPACE_ID) return b === APP_SPACE_ID ? 0 : -1;\n\tif (b === APP_SPACE_ID) return 1;\n\tif (a < b) return -1;\n\tif (a > b) return 1;\n\treturn 0;\n}\nfunction compareDirNamesDescending(a, b) {\n\tif (a.name < b.name) return 1;\n\tif (a.name > b.name) return -1;\n\treturn 0;\n}\n/**\n* Ref names decorating a space's destination contract hashes. The\n* tolerant `space.refs` deliberately omits the structural `head.json`;\n* for extension spaces the old enumerator surfaced it as a `head`\n* decoration on the tip migration, so fold `space.headRef` back in to\n* keep that output. The app space synthesises its head, so it carries\n* no on-disk `head` ref to restore.\n*/\nfunction listRefsByContractHash(space) {\n\tconst byHash = new Map(refsByContractHash(space.refs));\n\tif (space.spaceId !== APP_SPACE_ID && space.headRef !== null) {\n\t\tconst hash = space.headRef.hash;\n\t\tconst bucket = byHash.get(hash) ?? [];\n\t\tif (!bucket.includes(HEAD_REF_NAME)) byHash.set(hash, [...bucket, HEAD_REF_NAME].sort());\n\t}\n\treturn byHash;\n}\nasync function orderedOnDiskSpaceIds(projectMigrationsDir) {\n\treturn (await listContractSpaceDirectories(projectMigrationsDir)).filter(isValidSpaceId).sort(compareSpaceIds);\n}\n/**\n* Project the loaded {@link ContractSpaceAggregate} into the render-ready\n* {@link MigrationSpaceListEntry} rows `migration list` displays.\n*\n* Space membership matches the on-disk contract-space directories (not the\n* aggregate's always-present synthesized app space when `migrations/app/`\n* is absent); package and ref data come from `aggregate.space(id)`.\n*/\nasync function migrationSpaceListEntriesFromAggregate(aggregate, projectMigrationsDir) {\n\tconst spaceIds = await orderedOnDiskSpaceIds(projectMigrationsDir);\n\tconst spaces = [];\n\tfor (const spaceId of spaceIds) {\n\t\tconst space = aggregate.space(spaceId);\n\t\tif (space === void 0) continue;\n\t\tconst refsByHash = listRefsByContractHash(space);\n\t\tconst migrations = space.packages.map((pkg) => ({\n\t\t\tname: pkg.dirName,\n\t\t\thash: pkg.metadata.migrationHash,\n\t\t\tfromContract: pkg.metadata.from,\n\t\t\ttoContract: pkg.metadata.to,\n\t\t\toperationCount: pkg.ops.length,\n\t\t\tcreatedAt: pkg.metadata.createdAt,\n\t\t\trefs: [...refsByHash.get(pkg.metadata.to) ?? []],\n\t\t\tprovidedInvariants: [...pkg.metadata.providedInvariants]\n\t\t})).sort(compareDirNamesDescending);\n\t\tspaces.push({\n\t\t\tspace: spaceId,\n\t\t\tmigrations\n\t\t});\n\t}\n\treturn spaces;\n}\nfunction computeSummary(spaces) {\n\tconst totalMigrations = spaces.reduce((count, space) => count + space.migrations.length, 0);\n\tif (spaces.length <= 1) return `${totalMigrations} migration(s) on disk`;\n\treturn `${totalMigrations} migration(s) across ${spaces.length} contract space(s)`;\n}\n/**\n* Policy core of `migration list`: validates `--space`, narrows the\n* pre-enumerated spaces, and assembles a {@link MigrationListResult}.\n*\n* - `migrations/` missing or contains no valid space directories →\n* caller passes `spaces: []`; this synthesizes `[{ spaceId: APP_SPACE_ID, migrations: [] }]`.\n* - `--space <id>` on an existing-but-empty space → `{ spaceId, migrations: [] }` in the input.\n* - `--space <id>` on a non-existent (or reserved) space → `SPACE_NOT_FOUND`.\n*/\nfunction runMigrationList(inputs) {\n\tconst { spaces, spaceFilter } = inputs;\n\tif (spaceFilter !== void 0 && !isValidSpaceId(spaceFilter)) return notOk(errorInvalidSpaceId(spaceFilter));\n\tif (spaceFilter !== void 0 && !spaces.some((s) => s.space === spaceFilter)) return notOk(errorSpaceNotFound(spaceFilter, spaces.map((s) => s.space).sort()));\n\tconst scopedSpaces = spaceFilter !== void 0 ? spaces.filter((s) => s.space === spaceFilter) : spaces;\n\tconst resultSpaces = scopedSpaces.length === 0 ? [{\n\t\tspace: APP_SPACE_ID,\n\t\tmigrations: []\n\t}] : scopedSpaces;\n\treturn ok({\n\t\tok: true,\n\t\tspaces: [...resultSpaces],\n\t\tsummary: computeSummary(resultSpaces)\n\t});\n}\n//#endregion\nexport { migrationSpaceListEntriesFromAggregate as n, runMigrationList as r, listRefsByContractHash as t };\n\n//# sourceMappingURL=migration-list-AKRIIovW.mjs.map"],"mappings":";;;;;AAKA,SAAS,gBA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G,WAAW,IAAI,IAAI,SAAS,EAAE,KAAK,CAAC,CAAC;GAC/C,oBAAoB,CAAC,GAAG,IAAI,SAAS,kBAAkB;EACxD,EAAE,CAAC,CAAC,KAAK,yBAAyB;EAClC,OAAO,KAAK;GACX,OAAO;GACP;EACD,CAAC;CACF;CACA,OAAO;AACR;AACA,SAAS,eAAe,QAAQ;CAC/B,MAAM,kBAAkB,OAAO,QAAQ,OAAO,UAAU,QAAQ,MAAM,WAAW,QAAQ,CAAC;CAC1F,IAAI,OAAO,UAAU,GAAG,OAAO,GAAG,gBAAgB;CAClD,OAAO,GAAG,gBAAgB,uBAAuB,OAAO,OAAO;AAChE;;;;;;;;;;AAUA,SAAS,iBAAiB,QAAQ;CACjC,MAAM,EAAE,QAAQ,gBAAgB;CAChC,IAAI,gBAAgB,KAAK,KAAK,CAAC,eAAe,WAAW,GAAG,OAAO,MAAM,oBAAoB,WAAW,CAAC;CACzG,IAAI,gBAAgB,KAAK,KAAK,CAAC,OAAO,MAAM,MAAM,EAAE,UAAU,WAAW,GAAG,OAAO,MAAM,mBAAmB,aAAa,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;CAC3J,MAAM,eAAe,gBAAgB,KAAK,IAAI,OAAO,QAAQ,MAAM,EAAE,UAAU,WAAW,IAAI;CAC9F,MAAM,eAAe,aAAa,WAAW,IAAI,CAAC;EACjD,OAAO;EACP,YAAY,CAAC;CACd,CAAC,IAAI;CACL,OAAO,GAAG;EACT,IAAI;EACJ,QAAQ,CAAC,GAAG,YAAY;EACxB,SAAS,eAAe,YAAY;CACrC,CAAC;AACF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import { n as createTerminalUI } from "./terminal-ui-
|
|
3
|
-
import {
|
|
4
|
-
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-
|
|
5
|
-
import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-
|
|
2
|
+
import { n as createTerminalUI } from "./terminal-ui-DQNCDg2u-B3PFqjB8.mjs";
|
|
3
|
+
import { _ as resolveMigrationPaths, b as setCommandExamples, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, x as setCommandSeeAlso, y as setCommandDescriptions } from "./command-helpers-DutQjYgy-CDfFwtAa.mjs";
|
|
4
|
+
import { r as buildReadAggregate } from "./contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs";
|
|
5
|
+
import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList } from "./migration-list-AKRIIovW-Cr39jOaI.mjs";
|
|
6
6
|
import { g as renderMigrationGraphLegend, l as createAnsiMigrationListStyler, v as renderMigrationListWithStyle } from "./migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs";
|
|
7
|
-
import { n as validateLegendOptions, t as shouldShowLegend } from "./legend-
|
|
7
|
+
import { n as validateLegendOptions, t as shouldShowLegend } from "./legend-QYDKKevn-DCIlAPn4.mjs";
|
|
8
8
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
9
9
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
10
10
|
import { Command } from "commander";
|
|
11
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-list-
|
|
11
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migration-list-RSlyGyvD.mjs
|
|
12
12
|
function renderMigrationListHumanOutput(result, options) {
|
|
13
13
|
return renderMigrationListWithStyle(result, createAnsiMigrationListStyler({ useColor: options.useColor }), options.glyphMode, {
|
|
14
14
|
colorize: options.useColor,
|
|
@@ -127,4 +127,4 @@ function createMigrationListCommand() {
|
|
|
127
127
|
//#endregion
|
|
128
128
|
export { executeMigrationListCommand as n, renderMigrationListHumanOutput as r, createMigrationListCommand as t };
|
|
129
129
|
|
|
130
|
-
//# sourceMappingURL=migration-list-
|
|
130
|
+
//# sourceMappingURL=migration-list-RSlyGyvD-KKmZtdY1.mjs.map
|