@prisma/orm-toolchain 8.0.0-rc.1-dev.38 → 8.0.0-rc.1-dev.40
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 +25 -318
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/{caught-errors-DLPzfzIW-CQ9BoXD-.mjs → caught-errors-BZo7zcRc-C-pIEasG.mjs} +3 -3
- package/dist/{caught-errors-DLPzfzIW-CQ9BoXD-.mjs.map → caught-errors-BZo7zcRc-C-pIEasG.mjs.map} +1 -1
- package/dist/{cli-errors-BG6bItjG-DwdKIeGz.mjs → cli-errors-B4zTLaqQ-CXgjO9t4.mjs} +20 -3
- package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +1 -0
- package/dist/{cli-errors-BiKBrOXc-JPxQqO58.d.mts → cli-errors-iquUoY6O-BFboxglv.d.mts} +17 -9
- package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +1 -0
- package/dist/cli.mjs +2895 -182
- 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 +2 -2
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +2 -2
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.d.mts +2 -2
- 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 +2 -2
- 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 +4 -4
- package/dist/cli__control-api.mjs +15 -15
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/cli__control-api__testing.mjs +2 -1
- package/dist/cli__control-api__testing.mjs.map +1 -1
- package/dist/cli__init-output.d.mts +1 -1
- package/dist/cli__init-output.mjs +1 -1
- package/dist/{client-DU9qtBxW-BjVHiKzE.mjs → client-C6Qp5ujC-Dxb7r79B.mjs} +12 -15
- package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +1 -0
- package/dist/code-templates-D73q329L-CSx0Jg-6.mjs +295 -0
- package/dist/code-templates-D73q329L-CSx0Jg-6.mjs.map +1 -0
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +65 -0
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +1 -0
- package/dist/{command-helpers-CwLvFwMB-BWwUQhlT.mjs → command-helpers-BCgwcqTe-lNCtppzM.mjs} +3 -3
- package/dist/{command-helpers-CwLvFwMB-BWwUQhlT.mjs.map → command-helpers-BCgwcqTe-lNCtppzM.mjs.map} +1 -1
- package/dist/{contract-at-errors-Dptf8RE_-B5gr04Sc.mjs → contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs} +3 -3
- package/dist/{contract-at-errors-Dptf8RE_-B5gr04Sc.mjs.map → contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map} +1 -1
- package/dist/contract-emit-DDWBBvF1-BeGZCRrb.mjs +2 -0
- package/dist/{contract-emit-CZQZ1i4z-p9LSGmmQ.mjs → contract-emit-DFScp9D6-6H-UJMFv.mjs} +5 -5
- package/dist/{contract-emit-CZQZ1i4z-p9LSGmmQ.mjs.map → contract-emit-DFScp9D6-6H-UJMFv.mjs.map} +1 -1
- package/dist/{contract-emit-BQFpcb2A-BwT9iVdb.mjs → contract-emit-DsvAx-dY-DQzoDO34.mjs} +5 -5
- package/dist/{contract-emit-BQFpcb2A-BwT9iVdb.mjs.map → contract-emit-DsvAx-dY-DQzoDO34.mjs.map} +1 -1
- package/dist/{contract-infer-C6cYOihE-CIUCgmw0.mjs → contract-infer-BwIDGl7v-CZrdWXAr.mjs} +4 -4
- package/dist/{contract-infer-C6cYOihE-CIUCgmw0.mjs.map → contract-infer-BwIDGl7v-CZrdWXAr.mjs.map} +1 -1
- package/dist/{contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs → contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs} +4 -4
- package/dist/{contract-snapshot-resolution-DvZvbNcZ-DHFCWe_k.mjs.map → contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs → contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs} +4 -4
- package/dist/{contract-space-aggregate-loader-CoLTf3Ce-pQDru2w0.mjs.map → contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map} +1 -1
- package/dist/{db-init-DypCy1e3-CBrYfhHF.mjs → db-init-BolXrKAI-CwG-zEDW.mjs} +6 -6
- package/dist/{db-init-DypCy1e3-CBrYfhHF.mjs.map → db-init-BolXrKAI-CwG-zEDW.mjs.map} +1 -1
- package/dist/{db-init-failure-BmCcHUfc-BqDxyrJE.mjs → db-init-failure-B5cQML4A-5zr-99Ek.mjs} +3 -3
- package/dist/{db-init-failure-BmCcHUfc-BqDxyrJE.mjs.map → db-init-failure-B5cQML4A-5zr-99Ek.mjs.map} +1 -1
- package/dist/{db-schema-DHfPM-5V-JeCjrQ55.mjs → db-schema-DvdLBdEY-Dl6e1d_Y.mjs} +4 -4
- package/dist/{db-schema-DHfPM-5V-JeCjrQ55.mjs.map → db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map} +1 -1
- package/dist/{db-sign-DbAxRcZh-C-nT9kcG.mjs → db-sign-DCp4c8CA-B3tun-kh.mjs} +6 -6
- package/dist/{db-sign-DbAxRcZh-C-nT9kcG.mjs.map → db-sign-DCp4c8CA-B3tun-kh.mjs.map} +1 -1
- package/dist/{db-update-J59yROwL-DCP-_z2W.mjs → db-update-CfayE8WE-CPhQyDaZ.mjs} +6 -6
- package/dist/{db-update-J59yROwL-DCP-_z2W.mjs.map → db-update-CfayE8WE-CPhQyDaZ.mjs.map} +1 -1
- package/dist/{db-verify-0TpDMziA-CJDKutMN.mjs → db-verify-BN7IrOAL-kEzRNJUl.mjs} +7 -65
- package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +1 -0
- package/dist/{exports-DaxzMVtq.mjs → exports-B3xY_FHp.mjs} +304 -18
- package/dist/exports-B3xY_FHp.mjs.map +1 -0
- package/dist/{format-cbJY7l6v-CjMUDTAs.mjs → format-Ca7dUE6B-BMFqrc6D.mjs} +5 -5
- package/dist/{format-cbJY7l6v-CjMUDTAs.mjs.map → format-Ca7dUE6B-BMFqrc6D.mjs.map} +1 -1
- package/dist/{framework-components-C3K7SBeC-Bj5gx85-.mjs → framework-components-Bau7o1-J-DTp6AUoq.mjs} +3 -3
- package/dist/{framework-components-C3K7SBeC-Bj5gx85-.mjs.map → framework-components-Bau7o1-J-DTp6AUoq.mjs.map} +1 -1
- package/dist/init-DJrxDasP-DoQftaPY.mjs +800 -0
- package/dist/init-DJrxDasP-DoQftaPY.mjs.map +1 -0
- package/dist/{inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs → inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs} +5 -5
- package/dist/{inspect-live-schema-Cf77j9Vd-i5fzNW4T.mjs.map → inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map} +1 -1
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +115 -0
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +1 -0
- package/dist/{invariants-1zL5-9Mc-BCeOLxd_.mjs → invariants-Bltd8DyA-Cg_1Lu0q.mjs} +4 -4
- package/dist/{invariants-1zL5-9Mc-BCeOLxd_.mjs.map → invariants-Bltd8DyA-Cg_1Lu0q.mjs.map} +1 -1
- package/dist/{legend-BQcPKTLe-bn9e4_ZU.mjs → legend-DGv9e2_0-BtetgRz4.mjs} +3 -3
- package/dist/{legend-BQcPKTLe-bn9e4_ZU.mjs.map → legend-DGv9e2_0-BtetgRz4.mjs.map} +1 -1
- package/dist/{migrate-CgSnzAUm-aGstaO5N.mjs → migrate-BXATUjYE-Do79Imf-.mjs} +12 -12
- package/dist/{migrate-CgSnzAUm-aGstaO5N.mjs.map → migrate-BXATUjYE-Do79Imf-.mjs.map} +1 -1
- package/dist/{migrate-failure-CnoUcDms-taa9pfd7.mjs → migrate-failure-D4NvkoCk-0bttmQs2.mjs} +5 -5
- package/dist/{migrate-failure-CnoUcDms-taa9pfd7.mjs.map → migrate-failure-D4NvkoCk-0bttmQs2.mjs.map} +1 -1
- package/dist/{migrate-show-Dlo-YzOk-BXo-DmwI.d.mts → migrate-show-B8UJ9dmb-C4RTPbDk.d.mts} +3 -3
- package/dist/{migrate-show-Dlo-YzOk-BXo-DmwI.d.mts.map → migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map} +1 -1
- package/dist/{migrate-show-kVUG1xdo-bVTW8tu4.mjs → migrate-show-C_9xR4Qt-B-Y0PGKw.mjs} +6 -6
- package/dist/{migrate-show-kVUG1xdo-bVTW8tu4.mjs.map → migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map} +1 -1
- package/dist/{migration-check-CBMoMDX2-DhSEOGNg.mjs → migration-check-Bbdw7t-r-C2VTMK61.mjs} +6 -6
- package/dist/{migration-check-CBMoMDX2-DhSEOGNg.mjs.map → migration-check-Bbdw7t-r-C2VTMK61.mjs.map} +1 -1
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +163 -0
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +1 -0
- package/dist/{migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs → migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs} +5 -5
- package/dist/{migration-command-scaffold-B1BiWKLI-Bskk5UKX.mjs.map → migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map} +1 -1
- package/dist/{migration-graph-B30X5398-BH3zB9Mn.mjs → migration-graph-B8WxW_tm-qGNf7jQh.mjs} +3 -3
- package/dist/{migration-graph-B30X5398-BH3zB9Mn.mjs.map → migration-graph-B8WxW_tm-qGNf7jQh.mjs.map} +1 -1
- package/dist/{migration-graph-D2dbLCkl-CCHL0aDA.mjs → migration-graph-BOwu76mF-kOTWFvfV.mjs} +9 -9
- package/dist/{migration-graph-D2dbLCkl-CCHL0aDA.mjs.map → migration-graph-BOwu76mF-kOTWFvfV.mjs.map} +1 -1
- package/dist/{migration-graph-command-render-BeuEyf2B-BNH9oUB_.mjs → migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs} +17 -3
- package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +1 -0
- package/dist/{migration-graph-sections-0lKA5l1b-CTHQquu7.mjs → migration-graph-sections-BBHPOFN--COKyUKQ4.mjs} +4 -4
- package/dist/{migration-graph-sections-0lKA5l1b-CTHQquu7.mjs.map → migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map} +1 -1
- package/dist/{migration-list-DCx0KOFp-B3MiGnpa.mjs → migration-list-CKuYcMQq-CubZzE9i.mjs} +7 -7
- package/dist/{migration-list-DCx0KOFp-B3MiGnpa.mjs.map → migration-list-CKuYcMQq-CubZzE9i.mjs.map} +1 -1
- package/dist/{migration-list-BQTfSGbT-DoNqbNsu.mjs → migration-list-CY08bD8I-PoXuv94c.mjs} +3 -3
- package/dist/{migration-list-BQTfSGbT-DoNqbNsu.mjs.map → migration-list-CY08bD8I-PoXuv94c.mjs.map} +1 -1
- package/dist/{migration-log-CJ6_9_uj-uWyc3vlC.mjs → migration-log-CUbGla-9-BLIrWjwN.mjs} +8 -8
- package/dist/{migration-log-CJ6_9_uj-uWyc3vlC.mjs.map → migration-log-CUbGla-9-BLIrWjwN.mjs.map} +1 -1
- package/dist/{migration-log-table-DRiOnvzf-zTQBThqe.mjs → migration-log-table-eES9lPjv-BCFm8qJr.mjs} +3 -3
- package/dist/{migration-log-table-DRiOnvzf-zTQBThqe.mjs.map → migration-log-table-eES9lPjv-BCFm8qJr.mjs.map} +1 -1
- package/dist/{migration-new-CXLgOLXz-2C5s_q7n.mjs → migration-new-ChvZjf5X-BFhEM0BF.mjs} +4 -4
- package/dist/{migration-new-CXLgOLXz-2C5s_q7n.mjs.map → migration-new-ChvZjf5X-BFhEM0BF.mjs.map} +1 -1
- package/dist/{migration-new-Bp5dPKnF-D-Fb6vEp.mjs → migration-new-DXMvJdbB-BkrpDfcr.mjs} +7 -7
- package/dist/{migration-new-Bp5dPKnF-D-Fb6vEp.mjs.map → migration-new-DXMvJdbB-BkrpDfcr.mjs.map} +1 -1
- package/dist/{migration-path-target-BNTSTPAc-D7dQ4K7x.mjs → migration-path-target-JDWqF9kj-B7zoMq6X.mjs} +3 -3
- package/dist/{migration-path-target-BNTSTPAc-D7dQ4K7x.mjs.map → migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map} +1 -1
- package/dist/{migration-plan-CharRhoN-BIB3WL65.d.mts → migration-plan-BV9f5Xjq-DiyscOMc.d.mts} +3 -3
- package/dist/{migration-plan-CharRhoN-BIB3WL65.d.mts.map → migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map} +1 -1
- package/dist/{migration-plan-BxfF1Hdo-BKn0xMlY.mjs → migration-plan-Bz1hOTHF-CFCtPuOv.mjs} +4 -4
- package/dist/{migration-plan-BxfF1Hdo-BKn0xMlY.mjs.map → migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map} +1 -1
- package/dist/{migration-plan-C6KrFHJT-CRkTsE7L.mjs → migration-plan-Cfz0efEL-DMNFq5b2.mjs} +8 -8
- package/dist/{migration-plan-C6KrFHJT-CRkTsE7L.mjs.map → migration-plan-Cfz0efEL-DMNFq5b2.mjs.map} +1 -1
- package/dist/{migration-show-Dhnlx_GU-DhWLLt3Z.mjs → migration-show-BGdR1xnT-Cg3M0FPh.mjs} +8 -8
- package/dist/{migration-show-Dhnlx_GU-DhWLLt3Z.mjs.map → migration-show-BGdR1xnT-Cg3M0FPh.mjs.map} +1 -1
- package/dist/{migration-status-S88DjM8c-DLHnCKfW.mjs → migration-status-BIrAJ5af-D-_mMBUA.mjs} +12 -11
- package/dist/{migration-status-S88DjM8c-DLHnCKfW.mjs.map → migration-status-BIrAJ5af-D-_mMBUA.mjs.map} +1 -1
- package/dist/{output-DWNYqZGc-D2sRgLAm.mjs → output-DP3woAjV-BxCr9nHA.mjs} +21 -11
- package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +1 -0
- package/dist/{project-import-root-nwdoPWap--5vXe4zp.mjs → project-import-root-B4nM-VWX-D__g0hTb.mjs} +3 -3
- package/dist/{project-import-root-nwdoPWap--5vXe4zp.mjs.map → project-import-root-B4nM-VWX-D__g0hTb.mjs.map} +1 -1
- package/dist/{init-Bco4QkKJ-DqUZVrBU.mjs → redact-secrets-Cvia6eTB-BE_Pg3k9.mjs} +741 -1517
- package/dist/redact-secrets-Cvia6eTB-BE_Pg3k9.mjs.map +1 -0
- package/dist/{ref-gZQjdz8I-CW6n9Fc0.mjs → ref-4x6BGSsd-ClaoZIQh.mjs} +4 -4
- package/dist/{ref-gZQjdz8I-CW6n9Fc0.mjs.map → ref-4x6BGSsd-ClaoZIQh.mjs.map} +1 -1
- package/dist/{ref-C8oaaeky-ColNkWpr.mjs → ref-WXLIR9Xm-12IUtoBU.mjs} +5 -5
- package/dist/{ref-C8oaaeky-ColNkWpr.mjs.map → ref-WXLIR9Xm-12IUtoBU.mjs.map} +1 -1
- package/dist/{ref-resolution-DAK4OK3x-B-8ZZc0f.mjs → ref-resolution-BSN1amKm-C6-TTM2N.mjs} +3 -3
- package/dist/{ref-resolution-DAK4OK3x-B-8ZZc0f.mjs.map → ref-resolution-BSN1amKm-C6-TTM2N.mjs.map} +1 -1
- package/dist/{schemas-Bm2e3Hk1-qLKF0B36.d.mts → schemas-BGgjiKV0-Rh8RlMCl.d.mts} +4 -2
- package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +1 -0
- package/dist/{schemas-BMkqaqvM-CLaqlat4.mjs → schemas-CYSD83Cu-Bff4PPoi.mjs} +3 -2
- package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +1 -0
- package/dist/{telemetry-DPXFYAsz-CPW2USxs.mjs → telemetry-BD52LETE-Cqeb7ebh.mjs} +3 -3
- package/dist/{telemetry-DPXFYAsz-CPW2USxs.mjs.map → telemetry-BD52LETE-Cqeb7ebh.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +13 -13
- package/dist/cli-errors-BG6bItjG-DwdKIeGz.mjs.map +0 -1
- package/dist/cli-errors-BiKBrOXc-JPxQqO58.d.mts.map +0 -1
- package/dist/client-DU9qtBxW-BjVHiKzE.mjs.map +0 -1
- package/dist/contract-emit-Bzt11N4v-BQ2Pr8KG.mjs +0 -2
- package/dist/db-verify-0TpDMziA-CJDKutMN.mjs.map +0 -1
- package/dist/exports-DaxzMVtq.mjs.map +0 -1
- package/dist/init-Bco4QkKJ-DqUZVrBU.mjs.map +0 -1
- package/dist/migration-check-BVK9vfan-Dfg8lbeB.mjs +0 -272
- package/dist/migration-check-BVK9vfan-Dfg8lbeB.mjs.map +0 -1
- package/dist/migration-graph-command-render-BeuEyf2B-BNH9oUB_.mjs.map +0 -1
- package/dist/output-DWNYqZGc-D2sRgLAm.mjs.map +0 -1
- package/dist/schemas-BMkqaqvM-CLaqlat4.mjs.map +0 -1
- package/dist/schemas-Bm2e3Hk1-qLKF0B36.d.mts.map +0 -1
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import { L as runCommandAction, r as chooseAction } from "./cli-errors-BG6bItjG-DwdKIeGz.mjs";
|
|
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-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
|
-
import { join, relative } from "pathe";
|
|
8
|
-
import { Command } from "commander";
|
|
9
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-check-BVK9vfan.mjs
|
|
10
|
-
function migrationPathRelative(dirPath) {
|
|
11
|
-
return relative(process.cwd(), dirPath);
|
|
12
|
-
}
|
|
13
|
-
function migrationFileRelative(dirPath, fileName) {
|
|
14
|
-
return join(migrationPathRelative(dirPath), fileName);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Map one {@link IntegrityViolation} onto a `migration check` failure row.
|
|
18
|
-
* Sole catalogue mapping from integrity violations to `MIGRATION.CHECK_*` codes.
|
|
19
|
-
*/
|
|
20
|
-
function integrityViolationToCheckFailure(violation, migrationsDir) {
|
|
21
|
-
const spaceRelative = (spaceId) => migrationPathRelative(join(migrationsDir, spaceId));
|
|
22
|
-
const packageRelative = (spaceId, dirName) => migrationPathRelative(join(migrationsDir, spaceId, dirName));
|
|
23
|
-
const refRelative = (spaceId, refName) => migrationPathRelative(join(migrationsDir, spaceId, "refs", `${refName}.json`));
|
|
24
|
-
switch (violation.kind) {
|
|
25
|
-
case "hashMismatch": return {
|
|
26
|
-
space: violation.spaceId,
|
|
27
|
-
code: "MIGRATION.CHECK_HASH_MISMATCH",
|
|
28
|
-
where: migrationFileRelative(join(migrationsDir, violation.spaceId, violation.dirName), "migration.json"),
|
|
29
|
-
why: `Stored hash ${violation.stored} does not match recomputed hash ${violation.computed}`,
|
|
30
|
-
nextActions: [chooseAction("Re-emit the migration package, or restore it from version control")]
|
|
31
|
-
};
|
|
32
|
-
case "providedInvariantsMismatch": return {
|
|
33
|
-
space: violation.spaceId,
|
|
34
|
-
code: "MIGRATION.CHECK_PROVIDED_INVARIANTS_MISMATCH",
|
|
35
|
-
where: packageRelative(violation.spaceId, violation.dirName),
|
|
36
|
-
why: `Migration "${violation.dirName}" providedInvariants in migration.json disagrees with ops.json.`,
|
|
37
|
-
nextActions: [chooseAction("Re-emit the migration package so migration.json and ops.json agree")]
|
|
38
|
-
};
|
|
39
|
-
case "packageUnloadable": return {
|
|
40
|
-
space: violation.spaceId,
|
|
41
|
-
code: "MIGRATION.CHECK_PACKAGE_UNLOADABLE",
|
|
42
|
-
where: packageRelative(violation.spaceId, violation.dirName),
|
|
43
|
-
why: `Migration "${violation.dirName}" could not be loaded: ${violation.detail}`,
|
|
44
|
-
nextActions: [chooseAction("Re-emit the migration package, or restore it from version control")]
|
|
45
|
-
};
|
|
46
|
-
case "sameSourceAndTarget": return {
|
|
47
|
-
space: violation.spaceId,
|
|
48
|
-
code: "MIGRATION.CHECK_NOOP_SELF_EDGE",
|
|
49
|
-
where: packageRelative(violation.spaceId, violation.dirName),
|
|
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.`,
|
|
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")]
|
|
52
|
-
};
|
|
53
|
-
case "orphanSpaceDir": return {
|
|
54
|
-
space: violation.spaceId,
|
|
55
|
-
code: "MIGRATION.CHECK_ORPHAN_SPACE_DIR",
|
|
56
|
-
where: spaceRelative(violation.spaceId),
|
|
57
|
-
why: `Contract-space directory "${violation.spaceId}" exists on disk but no extension declares it.`,
|
|
58
|
-
nextActions: [chooseAction("Remove the orphan directory"), chooseAction("Or declare the extension in `extensions`")]
|
|
59
|
-
};
|
|
60
|
-
case "declaredButUnmigrated": return {
|
|
61
|
-
space: violation.spaceId,
|
|
62
|
-
code: "MIGRATION.CHECK_DECLARED_BUT_UNMIGRATED",
|
|
63
|
-
where: spaceRelative(violation.spaceId),
|
|
64
|
-
why: `Extension "${violation.spaceId}" is declared in \`extensions\` but has no on-disk migrations directory.`,
|
|
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")]
|
|
66
|
-
};
|
|
67
|
-
case "headRefMissing": return {
|
|
68
|
-
space: violation.spaceId,
|
|
69
|
-
code: "MIGRATION.CHECK_HEAD_REF_MISSING",
|
|
70
|
-
where: refRelative(violation.spaceId, "head"),
|
|
71
|
-
why: `Head ref \`refs/head.json\` is missing for contract space "${violation.spaceId}".`,
|
|
72
|
-
nextActions: [chooseAction("Re-emit the contract-space migrations and head ref artefacts"), chooseAction("Or restore `refs/head.json` from version control")]
|
|
73
|
-
};
|
|
74
|
-
case "headRefNotInGraph": return {
|
|
75
|
-
space: violation.spaceId,
|
|
76
|
-
code: "MIGRATION.CHECK_HEAD_REF_NOT_IN_GRAPH",
|
|
77
|
-
where: refRelative(violation.spaceId, "head"),
|
|
78
|
-
why: `Head ref ${violation.hash} for contract space "${violation.spaceId}" is not present in its migration graph.`,
|
|
79
|
-
nextActions: [chooseAction("Re-emit the contract-space migrations"), chooseAction("Or restore the missing migration package")]
|
|
80
|
-
};
|
|
81
|
-
case "refUnreadable": return {
|
|
82
|
-
space: violation.spaceId,
|
|
83
|
-
code: "MIGRATION.CHECK_REF_UNREADABLE",
|
|
84
|
-
where: refRelative(violation.spaceId, violation.refName),
|
|
85
|
-
why: `Ref "${violation.refName}" for contract space "${violation.spaceId}" is unreadable: ${violation.detail}`,
|
|
86
|
-
nextActions: [chooseAction("Repair or remove the corrupt ref file")]
|
|
87
|
-
};
|
|
88
|
-
case "targetMismatch": return {
|
|
89
|
-
space: violation.spaceId,
|
|
90
|
-
code: "MIGRATION.CHECK_TARGET_MISMATCH",
|
|
91
|
-
where: spaceRelative(violation.spaceId),
|
|
92
|
-
why: `Contract space "${violation.spaceId}" targets "${violation.actual}" but the project targets "${violation.expected}".`,
|
|
93
|
-
nextActions: [chooseAction("Update the extension to target the configured database"), chooseAction("Or change the project target")]
|
|
94
|
-
};
|
|
95
|
-
case "disjointness": return {
|
|
96
|
-
space: "app",
|
|
97
|
-
code: "MIGRATION.CHECK_SPACE_DISJOINTNESS_VIOLATION",
|
|
98
|
-
where: migrationPathRelative(migrationsDir),
|
|
99
|
-
why: `Storage element "${violation.element}" is claimed by multiple contract spaces: ${violation.claimedBy.join(", ")}.`,
|
|
100
|
-
nextActions: [chooseAction("Update the contracts so each storage element is owned by exactly one contract space")]
|
|
101
|
-
};
|
|
102
|
-
case "contractUnreadable": return {
|
|
103
|
-
space: violation.spaceId,
|
|
104
|
-
code: "MIGRATION.CHECK_CONTRACT_UNREADABLE",
|
|
105
|
-
where: migrationFileRelative(join(migrationsDir, violation.spaceId), "contract.json"),
|
|
106
|
-
why: `Contract for space "${violation.spaceId}" is unreadable: ${violation.detail}`,
|
|
107
|
-
nextActions: [runCommandAction("Re-emit the extension contract artefacts", "prisma-next contract emit"), chooseAction("Or fix the descriptor producing the invalid contract")]
|
|
108
|
-
};
|
|
109
|
-
case "duplicateMigrationHash": return {
|
|
110
|
-
space: violation.spaceId,
|
|
111
|
-
code: "MIGRATION.CHECK_DUPLICATE_MIGRATION_HASH",
|
|
112
|
-
where: spaceRelative(violation.spaceId),
|
|
113
|
-
why: `Multiple migrations in space "${violation.spaceId}" share migrationHash "${violation.migrationHash}" (${violation.dirNames.join(", ")}).`,
|
|
114
|
-
nextActions: [chooseAction("Re-emit one of the conflicting packages so each migrationHash is unique")]
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
async function executeMigrationCheckCommand(target, options, flags, ui) {
|
|
119
|
-
const configResult = await loadConfigForSections(options.config, [
|
|
120
|
-
"family",
|
|
121
|
-
"target",
|
|
122
|
-
"adapter",
|
|
123
|
-
"extensions",
|
|
124
|
-
"migrations",
|
|
125
|
-
"contract"
|
|
126
|
-
]);
|
|
127
|
-
if (!configResult.ok) return {
|
|
128
|
-
error: configResult.failure,
|
|
129
|
-
exitCode: 2
|
|
130
|
-
};
|
|
131
|
-
const config = configResult.value;
|
|
132
|
-
const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config, process.cwd());
|
|
133
|
-
if (!flags.json && !flags.quiet) {
|
|
134
|
-
const details = [{
|
|
135
|
-
label: "config",
|
|
136
|
-
value: configPath
|
|
137
|
-
}, {
|
|
138
|
-
label: "migrations",
|
|
139
|
-
value: appMigrationsRelative
|
|
140
|
-
}];
|
|
141
|
-
if (target) details.push({
|
|
142
|
-
label: "target",
|
|
143
|
-
value: target
|
|
144
|
-
});
|
|
145
|
-
const header = formatStyledHeader({
|
|
146
|
-
command: "migration check",
|
|
147
|
-
description: "Verify artifact and graph integrity",
|
|
148
|
-
details,
|
|
149
|
-
flags
|
|
150
|
-
});
|
|
151
|
-
ui.stderr(header);
|
|
152
|
-
}
|
|
153
|
-
const loadedAggregate = await buildReadAggregate(config, { migrationsDir });
|
|
154
|
-
if (!loadedAggregate.ok) return {
|
|
155
|
-
error: loadedAggregate.failure,
|
|
156
|
-
exitCode: 2
|
|
157
|
-
};
|
|
158
|
-
const spaces = await enumerateCheckSpaces(loadedAggregate.value.aggregate, migrationsDir, process.cwd());
|
|
159
|
-
if (target) return await checkSingleTarget(target, {
|
|
160
|
-
spaces,
|
|
161
|
-
...options.space !== void 0 ? { spaceFilter: options.space } : {},
|
|
162
|
-
appMigrationsDir,
|
|
163
|
-
appMigrationsRelative,
|
|
164
|
-
cwd: process.cwd()
|
|
165
|
-
});
|
|
166
|
-
const checkResult = await runMigrationCheck({
|
|
167
|
-
spaces,
|
|
168
|
-
...options.space !== void 0 ? { spaceFilter: options.space } : {}
|
|
169
|
-
});
|
|
170
|
-
if (!checkResult.ok) return {
|
|
171
|
-
error: checkResult.failure,
|
|
172
|
-
exitCode: 2
|
|
173
|
-
};
|
|
174
|
-
const failures = [...checkResult.value.failures];
|
|
175
|
-
const allViolations = await loadAggregateIntegrityViolations(config, migrationsDir);
|
|
176
|
-
const scopedViolations = options.space === void 0 ? allViolations : allViolations.filter((v) => v.kind !== "disjointness" && v.spaceId === options.space);
|
|
177
|
-
for (const violation of scopedViolations) failures.push(integrityViolationToCheckFailure(violation, migrationsDir));
|
|
178
|
-
if (failures.length === 0) return {
|
|
179
|
-
result: {
|
|
180
|
-
ok: true,
|
|
181
|
-
failures: [],
|
|
182
|
-
summary: "All checks passed"
|
|
183
|
-
},
|
|
184
|
-
exitCode: 0
|
|
185
|
-
};
|
|
186
|
-
return {
|
|
187
|
-
result: {
|
|
188
|
-
ok: false,
|
|
189
|
-
failures,
|
|
190
|
-
summary: `${failures.length} integrity failure(s)`
|
|
191
|
-
},
|
|
192
|
-
exitCode: 4
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
function createMigrationCheckCommand() {
|
|
196
|
-
const command = new Command("check");
|
|
197
|
-
setCommandDescriptions(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.");
|
|
198
|
-
setCommandExamples(command, [
|
|
199
|
-
"prisma-next migration check",
|
|
200
|
-
"prisma-next migration check --space app",
|
|
201
|
-
"prisma-next migration check 20260101-add-users",
|
|
202
|
-
"prisma-next migration check 20260101-add-users --space app",
|
|
203
|
-
"prisma-next migration check --json"
|
|
204
|
-
]);
|
|
205
|
-
setCommandSeeAlso(command, [
|
|
206
|
-
{
|
|
207
|
-
verb: "migration status",
|
|
208
|
-
oneLiner: "Show migration path and pending status"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
verb: "migration list",
|
|
212
|
-
oneLiner: "List on-disk migrations"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
verb: "migration graph",
|
|
216
|
-
oneLiner: "Show the migration graph topology"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
verb: "migration show",
|
|
220
|
-
oneLiner: "Display migration package contents"
|
|
221
|
-
}
|
|
222
|
-
]);
|
|
223
|
-
command.exitOverride();
|
|
224
|
-
addGlobalOptions(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) => {
|
|
225
|
-
const flags = parseGlobalFlagsOrExit(options);
|
|
226
|
-
const ui = createTerminalUI(flags);
|
|
227
|
-
let outcome;
|
|
228
|
-
try {
|
|
229
|
-
outcome = await executeMigrationCheckCommand(target, options, flags, ui);
|
|
230
|
-
} catch (error) {
|
|
231
|
-
outcome = {
|
|
232
|
-
result: {
|
|
233
|
-
ok: false,
|
|
234
|
-
failures: [],
|
|
235
|
-
summary: error instanceof Error ? error.message : String(error)
|
|
236
|
-
},
|
|
237
|
-
exitCode: 2
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
if (outcome.error) {
|
|
241
|
-
const envelope = outcome.error.toEnvelope();
|
|
242
|
-
if (flags.json) ui.output(formatErrorJson(envelope));
|
|
243
|
-
else if (!flags.quiet) ui.error(formatErrorOutput(envelope, flags));
|
|
244
|
-
process.exit(outcome.exitCode);
|
|
245
|
-
}
|
|
246
|
-
const result = outcome.result ?? {
|
|
247
|
-
ok: false,
|
|
248
|
-
failures: [],
|
|
249
|
-
summary: "No check result produced"
|
|
250
|
-
};
|
|
251
|
-
if (flags.json) ui.output(JSON.stringify(result, null, 2));
|
|
252
|
-
else if (!flags.quiet) if (result.ok) {
|
|
253
|
-
const spaceSuffix = outcome.resolvedSpaceId !== void 0 ? ` (space: ${outcome.resolvedSpaceId})` : "";
|
|
254
|
-
ui.log(`✔ ${result.summary}${spaceSuffix}`);
|
|
255
|
-
} else {
|
|
256
|
-
for (const f of result.failures) {
|
|
257
|
-
ui.log(`✗ [${f.code}] ${f.where}: ${f.why}`);
|
|
258
|
-
for (const action of f.nextActions) {
|
|
259
|
-
const command = action.command === void 0 ? "" : `: ${action.command}`;
|
|
260
|
-
ui.log(` next: ${action.label}${command}`);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
ui.log(`\n${result.summary}`);
|
|
264
|
-
}
|
|
265
|
-
process.exit(outcome.exitCode);
|
|
266
|
-
});
|
|
267
|
-
return command;
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
export { createMigrationCheckCommand as t };
|
|
271
|
-
|
|
272
|
-
//# sourceMappingURL=migration-check-BVK9vfan-Dfg8lbeB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-check-BVK9vfan-Dfg8lbeB.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-check-BVK9vfan.mjs"],"sourcesContent":["import { I as chooseAction, L as runCommandAction } from \"./cli-errors-BG6bItjG.mjs\";\nimport { i as formatErrorOutput, r as formatErrorJson, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.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-CwLvFwMB.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-CoLTf3Ce.mjs\";\nimport { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from \"./migration-check-CBMoMDX2.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-BVK9vfan.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,iBAAiB,YAAY,sBAAsB,KAAK,eAAe,OAAO,CAAC;CACrF,MAAM,mBAAmB,SAAS,YAAY,sBAAsB,KAAK,eAAe,SAAS,OAAO,CAAC;CACzG,MAAM,eAAe,SAAS,YAAY,sBAAsB,KAAK,eAAe,SAAS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