@prisma/orm-toolchain 8.0.0-rc.1-dev.44 → 8.0.0-rc.1-dev.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-CPZB020V.mjs} +9 -9
- package/dist/{aggregate-BBsCbXgJ.mjs.map → aggregate-CPZB020V.mjs.map} +1 -1
- package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-DLUJLq5Y.d.mts} +3 -3
- package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-DLUJLq5Y.d.mts.map} +1 -1
- package/dist/cli-telemetry.d.mts +19 -5
- package/dist/cli-telemetry.d.mts.map +1 -1
- package/dist/cli-telemetry.mjs +287 -8
- package/dist/cli-telemetry.mjs.map +1 -1
- package/dist/cli.d.mts +11 -13
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +5382 -1095
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +298 -27
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +2 -19
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/cli__control-api__testing.mjs.map +1 -1
- package/dist/cli__init-output.d.mts +0 -1
- package/dist/cli__init-output.d.mts.map +1 -1
- package/dist/cli__init-output.mjs +1 -1
- package/dist/cli__migration-cli.mjs +9 -9
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/config-loader.d.mts +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs} +4 -4
- package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map} +1 -1
- package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-BwgNK50T-DGvKgFCK.d.mts} +81 -81
- package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +1 -0
- package/dist/emitter.d.mts +1 -1
- package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-CXbGUWGu-CstQHPh6.mjs} +2 -2
- package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs.map → errors-CXbGUWGu-CstQHPh6.mjs.map} +1 -1
- package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
- package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
- package/dist/{exports-B3xY_FHp.mjs → exports-8ZUN43ve.mjs} +6 -6
- package/dist/exports-8ZUN43ve.mjs.map +1 -0
- package/dist/{exports-BZLNbtkY.mjs → exports-BZaG8_w_.mjs} +64 -36
- package/dist/exports-BZaG8_w_.mjs.map +1 -0
- package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-BViWUMpP-C4lYYJdU.mjs} +2 -2
- package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-BViWUMpP-C4lYYJdU.mjs.map} +1 -1
- package/dist/{import-roots-NDOIEDVj.mjs → import-roots-CNFBPAT1.mjs} +10 -3
- package/dist/{import-roots-NDOIEDVj.mjs.map → import-roots-CNFBPAT1.mjs.map} +1 -1
- package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-CfoYgejL.d.mts} +2 -2
- package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-CfoYgejL.d.mts.map} +1 -1
- package/dist/{index-mCsi_ND5.d.mts → index-DRs7L6N0.d.mts} +11 -3
- package/dist/index-DRs7L6N0.d.mts.map +1 -0
- package/dist/{index-CnOyYxmv.d.mts → index-Dgwl8Tzs.d.mts} +2 -2
- package/dist/{index-CnOyYxmv.d.mts.map → index-Dgwl8Tzs.d.mts.map} +1 -1
- package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-CTHy88OP-CYI2a8IO.mjs} +2 -2
- package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-CTHy88OP-CYI2a8IO.mjs.map} +1 -1
- package/dist/{io-635GlNx1-D94PxRc-.mjs → io-635GlNx1-D3zrw2qu.mjs} +4 -4
- package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-635GlNx1-D3zrw2qu.mjs.map} +1 -1
- package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-_SJImD5V-BURyY1KM.mjs} +2 -2
- package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-_SJImD5V-BURyY1KM.mjs.map} +1 -1
- package/dist/{migration-gubSSeMk.mjs → migration-hspPIEeV.mjs} +4 -4
- package/dist/{migration-gubSSeMk.mjs.map → migration-hspPIEeV.mjs.map} +1 -1
- package/dist/migration-tools.d.mts +4 -4
- package/dist/migration-tools.mjs +13 -13
- package/dist/migration-tools__aggregate.d.mts +1 -1
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
- package/dist/migration-tools__errors.d.mts +1 -1
- package/dist/migration-tools__errors.mjs +1 -1
- package/dist/migration-tools__invariants.mjs +1 -1
- package/dist/migration-tools__io.mjs +1 -1
- package/dist/migration-tools__migration-graph.mjs +2 -2
- package/dist/migration-tools__migration-ts.mjs +1 -1
- package/dist/migration-tools__migration.mjs +1 -1
- package/dist/migration-tools__ref-resolution.mjs +1 -1
- package/dist/migration-tools__refs.mjs +1 -1
- package/dist/migration-tools__spaces.d.mts +2 -2
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
- package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
- package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-CovTDY14-CUoAqLML.mjs} +3 -45
- package/dist/output-CovTDY14-CUoAqLML.mjs.map +1 -0
- package/dist/publish-surface.d.mts +2 -2
- package/dist/publish-surface.mjs +2 -2
- package/dist/publish-surface__import-roots.d.mts +1 -1
- package/dist/publish-surface__import-roots.mjs +1 -1
- package/dist/publish-surface__shells.d.mts +1 -1
- package/dist/publish-surface__shells.mjs +1 -1
- package/dist/quick-reference-mongo.md +12 -9
- package/dist/quick-reference-postgres.md +12 -9
- package/dist/readme-mongo.md +2 -2
- package/dist/readme-postgres.md +2 -2
- package/dist/ref-h6InR6dO-rGfl18Jv.mjs +4686 -0
- package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +1 -0
- package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-HeNBXW53.mjs} +2 -2
- package/dist/{ref-resolution-sGcINe7o.mjs.map → ref-resolution-HeNBXW53.mjs.map} +1 -1
- package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-WK86uYYp-gM8tvWQP.mjs} +2 -2
- package/dist/{refs-WK86uYYp-B6EZkmmT.mjs.map → refs-WK86uYYp-gM8tvWQP.mjs.map} +1 -1
- package/dist/{shells-BenrJHp2.mjs → shells-C4HbRAr5.mjs} +13 -14
- package/dist/shells-C4HbRAr5.mjs.map +1 -0
- package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
- package/dist/shells-CIUmT4u4.d.mts.map +1 -0
- package/dist/{spaces-BG2w0P8d.mjs → spaces-4qMOAYE9.mjs} +7 -7
- package/dist/{spaces-BG2w0P8d.mjs.map → spaces-4qMOAYE9.mjs.map} +1 -1
- package/dist/{spaces-tWQi7CUv.d.mts → spaces-Dj65JrwZ.d.mts} +2 -2
- package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-Dj65JrwZ.d.mts.map} +1 -1
- package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
- package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
- package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs} +4 -4
- package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.d.mts +2 -2
- package/dist/vite-plugin-contract-emit.mjs +5 -5
- package/dist/vite-plugin-contract-emit.mjs.map +1 -1
- package/package.json +14 -38
- package/dist/bin__prisma-next.mjs +0 -512
- package/dist/bin__prisma-next.mjs.map +0 -1
- package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
- package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
- package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
- package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
- package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
- package/dist/cli__commands__contract-emit.d.mts +0 -2
- package/dist/cli__commands__contract-emit.mjs +0 -2
- package/dist/cli__commands__contract-infer.d.mts +0 -7
- package/dist/cli__commands__contract-infer.d.mts.map +0 -1
- package/dist/cli__commands__contract-infer.mjs +0 -2
- package/dist/cli__commands__db-init.d.mts +0 -7
- package/dist/cli__commands__db-init.d.mts.map +0 -1
- package/dist/cli__commands__db-init.mjs +0 -2
- package/dist/cli__commands__db-schema.d.mts +0 -7
- package/dist/cli__commands__db-schema.d.mts.map +0 -1
- package/dist/cli__commands__db-schema.mjs +0 -2
- package/dist/cli__commands__db-sign.d.mts +0 -7
- package/dist/cli__commands__db-sign.d.mts.map +0 -1
- package/dist/cli__commands__db-sign.mjs +0 -2
- package/dist/cli__commands__db-update.d.mts +0 -7
- package/dist/cli__commands__db-update.d.mts.map +0 -1
- package/dist/cli__commands__db-update.mjs +0 -2
- package/dist/cli__commands__db-verify.d.mts +0 -7
- package/dist/cli__commands__db-verify.d.mts.map +0 -1
- package/dist/cli__commands__db-verify.mjs +0 -2
- package/dist/cli__commands__migrate.d.mts +0 -57
- package/dist/cli__commands__migrate.d.mts.map +0 -1
- package/dist/cli__commands__migrate.mjs +0 -2
- package/dist/cli__commands__migration-check.d.mts +0 -8
- package/dist/cli__commands__migration-check.d.mts.map +0 -1
- package/dist/cli__commands__migration-check.mjs +0 -3
- package/dist/cli__commands__migration-graph.d.mts +0 -38
- package/dist/cli__commands__migration-graph.d.mts.map +0 -1
- package/dist/cli__commands__migration-graph.mjs +0 -2
- package/dist/cli__commands__migration-list.d.mts +0 -39
- package/dist/cli__commands__migration-list.d.mts.map +0 -1
- package/dist/cli__commands__migration-list.mjs +0 -2
- package/dist/cli__commands__migration-log.d.mts +0 -20
- package/dist/cli__commands__migration-log.d.mts.map +0 -1
- package/dist/cli__commands__migration-log.mjs +0 -2
- package/dist/cli__commands__migration-new.d.mts +0 -7
- package/dist/cli__commands__migration-new.d.mts.map +0 -1
- package/dist/cli__commands__migration-new.mjs +0 -2
- package/dist/cli__commands__migration-plan.d.mts +0 -34
- package/dist/cli__commands__migration-plan.d.mts.map +0 -1
- package/dist/cli__commands__migration-plan.mjs +0 -2
- package/dist/cli__commands__migration-show.d.mts +0 -27
- package/dist/cli__commands__migration-show.d.mts.map +0 -1
- package/dist/cli__commands__migration-show.mjs +0 -2
- package/dist/cli__commands__migration-status.d.mts +0 -55
- package/dist/cli__commands__migration-status.d.mts.map +0 -1
- package/dist/cli__commands__migration-status.mjs +0 -3
- package/dist/cli__commands__ref.d.mts +0 -7
- package/dist/cli__commands__ref.d.mts.map +0 -1
- package/dist/cli__commands__ref.mjs +0 -2
- package/dist/cli__commands__telemetry.d.mts +0 -7
- package/dist/cli__commands__telemetry.d.mts.map +0 -1
- package/dist/cli__commands__telemetry.mjs +0 -2
- package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
- package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
- package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs +0 -295
- package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs.map +0 -1
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
- package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
- package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
- package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
- package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
- package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
- package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
- package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
- package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
- package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
- package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
- package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
- package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
- package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
- package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
- package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
- package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
- package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
- package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
- package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
- package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
- package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
- package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
- package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
- package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
- package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
- package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
- package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
- package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
- package/dist/exports-B3xY_FHp.mjs.map +0 -1
- package/dist/exports-BZLNbtkY.mjs.map +0 -1
- package/dist/exports-CqNUihkI.mjs +0 -276
- package/dist/exports-CqNUihkI.mjs.map +0 -1
- package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
- package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
- package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
- package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
- package/dist/index-mCsi_ND5.d.mts.map +0 -1
- package/dist/init-B86mXFNC-C2HAUCRn.mjs +0 -800
- package/dist/init-B86mXFNC-C2HAUCRn.mjs.map +0 -1
- package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
- package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
- package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
- package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
- package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
- package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
- package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
- package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
- package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
- package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
- package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
- package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
- package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
- package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
- package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
- package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
- package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
- package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
- package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
- package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
- package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
- package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
- package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
- package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
- package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
- package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
- package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
- package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
- package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
- package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
- package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
- package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
- package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
- package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
- package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
- package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
- package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
- package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
- package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
- package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
- package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
- package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
- package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
- package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
- package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
- package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
- package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
- package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
- package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
- package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
- package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
- package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
- package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
- package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs +0 -1476
- package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map +0 -1
- package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
- package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
- package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
- package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
- package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
- package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
- package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
- package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
- package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
- package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
- package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
- package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
- package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
- package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
- package/dist/shells-BenrJHp2.mjs.map +0 -1
- package/dist/shells-COHV_Ozf.d.mts.map +0 -1
- package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
- package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
- package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
- package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
- package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
- package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
-
import { F as errorUnexpected, N as errorTargetMigrationNotSupported, f as errorDriverRequired, l as errorContractValidationFailed, p as errorFileNotFound, u as errorDatabaseConnectionRequired } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
|
|
3
|
-
import { r as createTerminalUI, s as formatMigrationApplyCommandOutput } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
|
|
4
|
-
import { S as targetSupportsMigrations, _ as resolveMigrationPaths, b as setCommandExamples, f as maskConnectionUrl, g as resolveContractPath, m as parseGlobalFlagsOrExit, n as closeQuietly, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-BCgwcqTe-lNCtppzM.mjs";
|
|
5
|
-
import { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs";
|
|
6
|
-
import { t as createControlClient } from "./client-C6Qp5ujC-Dxb7r79B.mjs";
|
|
7
|
-
import { a as readContractIR, t as advanceRefSafely } from "./ref-advancement-DaZBzm7m-WoqnFAyr.mjs";
|
|
8
|
-
import { t as mapCaughtMigrationError } from "./caught-errors-BZo7zcRc-C-pIEasG.mjs";
|
|
9
|
-
import { t as mapContractAtError } from "./contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs";
|
|
10
|
-
import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-Bltd8DyA-Cg_1Lu0q.mjs";
|
|
11
|
-
import { t as executeMigrateShowPlan } from "./migrate-show-C_9xR4Qt-B-Y0PGKw.mjs";
|
|
12
|
-
import { t as resolveContractRef } from "./ref-resolution-BSN1amKm-C6-TTM2N.mjs";
|
|
13
|
-
import { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from "./migrate-failure-D4NvkoCk-0bttmQs2.mjs";
|
|
14
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
15
|
-
import { readFile } from "node:fs/promises";
|
|
16
|
-
import { createControlStack } from "@prisma/orm-framework/components/control";
|
|
17
|
-
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
18
|
-
import { Command } from "commander";
|
|
19
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-BXATUjYE.mjs
|
|
20
|
-
/**
|
|
21
|
-
* Read-only preview of the migration path `migrate` will take. Delegates the
|
|
22
|
-
* path computation to {@link executeMigrateShowPlan} (the control-api core)
|
|
23
|
-
* and keeps only the styled header plus the Tier-3 graph rendering here.
|
|
24
|
-
*/
|
|
25
|
-
async function executeMigrateShowCommand(options, flags, ui) {
|
|
26
|
-
const readsLiveMarker = options.from === void 0 || options.from === "@db";
|
|
27
|
-
const configResult = await loadConfigForSections(options.config, [
|
|
28
|
-
"family",
|
|
29
|
-
"target",
|
|
30
|
-
"adapter",
|
|
31
|
-
...readsLiveMarker ? ["driver"] : [],
|
|
32
|
-
"extensions",
|
|
33
|
-
"db",
|
|
34
|
-
"migrations",
|
|
35
|
-
"contract"
|
|
36
|
-
]);
|
|
37
|
-
if (!configResult.ok) return configResult;
|
|
38
|
-
const planResult = await executeMigrateShowPlan({
|
|
39
|
-
config: configResult.value,
|
|
40
|
-
cwd: process.cwd(),
|
|
41
|
-
...ifDefined("configPath", options.config),
|
|
42
|
-
...ifDefined("db", options.db),
|
|
43
|
-
...ifDefined("to", options.to),
|
|
44
|
-
...ifDefined("from", options.from),
|
|
45
|
-
onPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {
|
|
46
|
-
if (!flags.json && !flags.quiet) {
|
|
47
|
-
const details = [{
|
|
48
|
-
label: "config",
|
|
49
|
-
value: configPath
|
|
50
|
-
}, {
|
|
51
|
-
label: "migrations",
|
|
52
|
-
value: migrationsRelative
|
|
53
|
-
}];
|
|
54
|
-
if (dbConnection && !hasExplicitFrom) details.push({
|
|
55
|
-
label: "database",
|
|
56
|
-
value: maskConnectionUrl(String(dbConnection))
|
|
57
|
-
});
|
|
58
|
-
if (options.from) details.push({
|
|
59
|
-
label: "from",
|
|
60
|
-
value: options.from
|
|
61
|
-
});
|
|
62
|
-
if (options.to) details.push({
|
|
63
|
-
label: "to",
|
|
64
|
-
value: options.to
|
|
65
|
-
});
|
|
66
|
-
const header = formatStyledHeader({
|
|
67
|
-
command: "migrate --show",
|
|
68
|
-
description: "Preview the migration path migrate will take (read-only)",
|
|
69
|
-
details,
|
|
70
|
-
flags
|
|
71
|
-
});
|
|
72
|
-
ui.stderr(header);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (!planResult.ok) return notOk(planResult.failure);
|
|
77
|
-
const plan = planResult.value;
|
|
78
|
-
const orderedMigrations = plan.migrations;
|
|
79
|
-
let graphOutput;
|
|
80
|
-
let runListDirNameWidth;
|
|
81
|
-
let runListLeftPad;
|
|
82
|
-
if (!flags.json) {
|
|
83
|
-
const rendering = renderMigrateShowGraph(plan, {
|
|
84
|
-
colorize: flags.color !== false,
|
|
85
|
-
glyphMode: "unicode"
|
|
86
|
-
});
|
|
87
|
-
graphOutput = rendering.graphOutput;
|
|
88
|
-
runListDirNameWidth = rendering.runListDirNameWidth;
|
|
89
|
-
runListLeftPad = rendering.runListLeftPad;
|
|
90
|
-
}
|
|
91
|
-
return ok({
|
|
92
|
-
ok: true,
|
|
93
|
-
migrations: orderedMigrations,
|
|
94
|
-
summary: plan.summary,
|
|
95
|
-
...graphOutput !== void 0 ? { graphOutput } : {},
|
|
96
|
-
...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},
|
|
97
|
-
...runListLeftPad !== void 0 ? { runListLeftPad } : {}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function formatMigrateShowOutput(result, flags) {
|
|
101
|
-
if (flags.quiet) return "";
|
|
102
|
-
const lines = [];
|
|
103
|
-
if (result.graphOutput !== void 0 && result.graphOutput.length > 0) {
|
|
104
|
-
lines.push(result.graphOutput);
|
|
105
|
-
lines.push("");
|
|
106
|
-
}
|
|
107
|
-
const n = result.migrations.length;
|
|
108
|
-
if (n === 0) {
|
|
109
|
-
lines.push(result.summary);
|
|
110
|
-
return lines.join("\n");
|
|
111
|
-
}
|
|
112
|
-
lines.push(`The following ${n} migration${n === 1 ? "" : "s"} will run:`);
|
|
113
|
-
lines.push(...migrateShowRunListRows(result.migrations, {
|
|
114
|
-
runListDirNameWidth: result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length)),
|
|
115
|
-
runListLeftPad: result.runListLeftPad
|
|
116
|
-
}, {
|
|
117
|
-
colorize: flags.color !== false,
|
|
118
|
-
glyphMode: "unicode"
|
|
119
|
-
}));
|
|
120
|
-
return lines.join("\n");
|
|
121
|
-
}
|
|
122
|
-
async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
123
|
-
const configResult = await loadConfigForSections(options.config, [
|
|
124
|
-
"family",
|
|
125
|
-
"target",
|
|
126
|
-
"adapter",
|
|
127
|
-
"driver",
|
|
128
|
-
"extensions",
|
|
129
|
-
"db",
|
|
130
|
-
"migrations",
|
|
131
|
-
"contract"
|
|
132
|
-
]);
|
|
133
|
-
if (!configResult.ok) return configResult;
|
|
134
|
-
const config = configResult.value;
|
|
135
|
-
const { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config, process.cwd());
|
|
136
|
-
const dbConnection = options.db ?? config.db?.connection;
|
|
137
|
-
if (!dbConnection) return notOk(errorDatabaseConnectionRequired({
|
|
138
|
-
why: `Database connection is required for migrate (set db.connection in ${configPath}, or pass --db <url>)`,
|
|
139
|
-
commandName: "migrate"
|
|
140
|
-
}));
|
|
141
|
-
if (!config.driver) return notOk(errorDriverRequired({ why: "Config.driver is required for migrate" }));
|
|
142
|
-
if (!targetSupportsMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target "${config.target.id}" does not support migrations` }));
|
|
143
|
-
const toArg = options.to;
|
|
144
|
-
const stack = createControlStack(config);
|
|
145
|
-
const familyInstance = config.family.create(stack);
|
|
146
|
-
const contractPathAbsolute = resolveContractPath(config);
|
|
147
|
-
let contractRaw;
|
|
148
|
-
let contractContent;
|
|
149
|
-
try {
|
|
150
|
-
contractContent = await readFile(contractPathAbsolute, "utf-8");
|
|
151
|
-
} catch (error) {
|
|
152
|
-
if (error instanceof Error && error.code === "ENOENT") return notOk(errorFileNotFound(contractPathAbsolute, {
|
|
153
|
-
why: `Contract file not found at ${contractPathAbsolute}`,
|
|
154
|
-
fix: "Run `prisma-next contract emit` to generate a valid contract.json, then retry."
|
|
155
|
-
}));
|
|
156
|
-
return notOk(errorContractValidationFailed(`Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));
|
|
157
|
-
}
|
|
158
|
-
try {
|
|
159
|
-
contractRaw = familyInstance.deserializeContract(JSON.parse(contractContent));
|
|
160
|
-
} catch (error) {
|
|
161
|
-
return notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));
|
|
162
|
-
}
|
|
163
|
-
const loadedAggregate = await loadContractSpaceAggregateForCli({
|
|
164
|
-
targetId: config.target.targetId,
|
|
165
|
-
migrationsDir,
|
|
166
|
-
appContract: contractRaw,
|
|
167
|
-
extensions: config.extensions ?? [],
|
|
168
|
-
deserializeContract: (json) => familyInstance.deserializeContract(json)
|
|
169
|
-
});
|
|
170
|
-
if (!loadedAggregate.ok) return notOk(loadedAggregate.failure);
|
|
171
|
-
const aggregate = loadedAggregate.value;
|
|
172
|
-
const integrityFailure = refuseContractSpaceIntegrity(aggregate, {
|
|
173
|
-
declaredExtensions: toDeclaredExtensionsFromRaw(config.extensions ?? []),
|
|
174
|
-
checkContracts: true
|
|
175
|
-
});
|
|
176
|
-
if (integrityFailure) return notOk(integrityFailure);
|
|
177
|
-
let refEntry;
|
|
178
|
-
let refName;
|
|
179
|
-
if (toArg) {
|
|
180
|
-
const refs = aggregate.app.refs;
|
|
181
|
-
const refResult = resolveContractRef(toArg, {
|
|
182
|
-
graph: aggregate.app.graph(),
|
|
183
|
-
refs
|
|
184
|
-
});
|
|
185
|
-
if (!refResult.ok) return notOk(refResult.failure);
|
|
186
|
-
if (refResult.value.provenance.kind === "ref") {
|
|
187
|
-
refName = refResult.value.provenance.refName;
|
|
188
|
-
const resolved = refs[refName];
|
|
189
|
-
if (resolved) refEntry = resolved;
|
|
190
|
-
} else refEntry = {
|
|
191
|
-
hash: refResult.value.hash,
|
|
192
|
-
invariants: []
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
if (!flags.json && !flags.quiet) {
|
|
196
|
-
const details = [{
|
|
197
|
-
label: "config",
|
|
198
|
-
value: configPath
|
|
199
|
-
}, {
|
|
200
|
-
label: "migrations",
|
|
201
|
-
value: appMigrationsRelative
|
|
202
|
-
}];
|
|
203
|
-
if (typeof dbConnection === "string") details.push({
|
|
204
|
-
label: "database",
|
|
205
|
-
value: maskConnectionUrl(dbConnection)
|
|
206
|
-
});
|
|
207
|
-
if (toArg) details.push({
|
|
208
|
-
label: "to",
|
|
209
|
-
value: toArg
|
|
210
|
-
});
|
|
211
|
-
const header = formatStyledHeader({
|
|
212
|
-
command: "migrate",
|
|
213
|
-
description: "Apply planned migrations to advance the database",
|
|
214
|
-
url: "https://pris.ly/migrate",
|
|
215
|
-
details,
|
|
216
|
-
flags
|
|
217
|
-
});
|
|
218
|
-
ui.stderr(header);
|
|
219
|
-
}
|
|
220
|
-
const appGraph = aggregate.app.graph();
|
|
221
|
-
const client = createControlClient({
|
|
222
|
-
family: config.family,
|
|
223
|
-
target: config.target,
|
|
224
|
-
adapter: config.adapter,
|
|
225
|
-
driver: config.driver,
|
|
226
|
-
extensions: config.extensions ?? []
|
|
227
|
-
});
|
|
228
|
-
try {
|
|
229
|
-
await client.connect(dbConnection);
|
|
230
|
-
const appMarker = (await client.readAllMarkers()).get("app") ?? null;
|
|
231
|
-
if (appMarker !== null) {
|
|
232
|
-
const markerRefusal = refuseMarkerOutsideGraph({
|
|
233
|
-
markerHash: appMarker.storageHash,
|
|
234
|
-
graph: appGraph
|
|
235
|
-
});
|
|
236
|
-
if (markerRefusal) return notOk(markerRefusal);
|
|
237
|
-
}
|
|
238
|
-
if (refEntry && refEntry.invariants.length > 0) {
|
|
239
|
-
const invariantRefusal = refuseUnknownInvariants({
|
|
240
|
-
graph: appGraph,
|
|
241
|
-
markerInvariants: appMarker?.invariants ?? [],
|
|
242
|
-
refInvariants: refEntry.invariants,
|
|
243
|
-
...ifDefined("refName", toArg)
|
|
244
|
-
});
|
|
245
|
-
if (invariantRefusal) return notOk(invariantRefusal);
|
|
246
|
-
}
|
|
247
|
-
if (!flags.quiet && !flags.json) ui.step("Loading contract spaces…");
|
|
248
|
-
let applyContract = contractRaw;
|
|
249
|
-
let snapshotContractJson = JSON.parse(contractContent);
|
|
250
|
-
let snapshotContractDts;
|
|
251
|
-
if (toArg && refEntry) {
|
|
252
|
-
const targetHash = refEntry.hash;
|
|
253
|
-
if (aggregate.app.packages.find((p) => p.metadata.to === targetHash)) try {
|
|
254
|
-
const at = await aggregate.app.contractAt(targetHash, refName !== void 0 ? { refName } : void 0);
|
|
255
|
-
applyContract = at.contract;
|
|
256
|
-
snapshotContractJson = at.contractJson;
|
|
257
|
-
snapshotContractDts = at.contractDts;
|
|
258
|
-
} catch (error) {
|
|
259
|
-
return mapContractAtError(error, { artifactRole: "to" });
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
const applyResult = await client.migrate({
|
|
263
|
-
contract: applyContract,
|
|
264
|
-
migrationsDir,
|
|
265
|
-
...ifDefined("refHash", refEntry?.hash),
|
|
266
|
-
...refEntry?.invariants ? { refInvariants: refEntry.invariants } : {},
|
|
267
|
-
...refEntry !== void 0 ? ifDefined("refName", toArg) : {}
|
|
268
|
-
});
|
|
269
|
-
if (!applyResult.ok) return notOk(mapMigrateFailure(applyResult.failure));
|
|
270
|
-
const { value } = applyResult;
|
|
271
|
-
let advancedRef = null;
|
|
272
|
-
if (options.advanceRef !== void 0) {
|
|
273
|
-
const contractIR = snapshotContractDts !== void 0 ? {
|
|
274
|
-
contract: snapshotContractJson,
|
|
275
|
-
contractDts: snapshotContractDts
|
|
276
|
-
} : await readContractIR(snapshotContractJson, contractPathAbsolute);
|
|
277
|
-
const advanced = await advanceRefSafely({
|
|
278
|
-
refsDir,
|
|
279
|
-
migrationsDir,
|
|
280
|
-
name: options.advanceRef,
|
|
281
|
-
hash: value.markerHash,
|
|
282
|
-
contractIR
|
|
283
|
-
});
|
|
284
|
-
if (!advanced.ok) return notOk(advanced.failure);
|
|
285
|
-
advancedRef = {
|
|
286
|
-
name: advanced.value.name,
|
|
287
|
-
hash: advanced.value.hash
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
return ok({
|
|
291
|
-
ok: true,
|
|
292
|
-
migrationsApplied: value.migrationsApplied,
|
|
293
|
-
migrationsTotal: value.perSpace.length,
|
|
294
|
-
markerHash: value.markerHash,
|
|
295
|
-
applied: value.applied,
|
|
296
|
-
summary: value.summary,
|
|
297
|
-
perSpace: value.perSpace,
|
|
298
|
-
...ifDefined("pathDecision", value.pathDecision),
|
|
299
|
-
timings: { total: Date.now() - startTime },
|
|
300
|
-
advancedRef
|
|
301
|
-
});
|
|
302
|
-
} catch (error) {
|
|
303
|
-
const mapped = mapCaughtMigrationError(error);
|
|
304
|
-
if (mapped) return notOk(mapped);
|
|
305
|
-
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));
|
|
306
|
-
} finally {
|
|
307
|
-
await closeQuietly(client);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
function createMigrateCommand() {
|
|
311
|
-
const command = new Command("migrate");
|
|
312
|
-
setCommandDescriptions(command, "Apply planned migrations to advance the database", "Walks every contract space (app + extensions) and applies pending\non-disk migrations in canonical order (extensions alphabetically,\nthen app). Graph-walks the on-disk migration graph for every space.\nUse --to to target a specific contract (hash, ref name, migration dir).\nUse --show for a read-only preview of the path that would run.");
|
|
313
|
-
setCommandExamples(command, [
|
|
314
|
-
"prisma-next migrate --db $DATABASE_URL",
|
|
315
|
-
"prisma-next migrate --to production --db $DATABASE_URL",
|
|
316
|
-
"prisma-next migrate --to abc123 --db $DATABASE_URL",
|
|
317
|
-
"prisma-next migrate --show --db $DATABASE_URL",
|
|
318
|
-
"prisma-next migrate --show --from @contract --to production"
|
|
319
|
-
]);
|
|
320
|
-
addGlobalOptions(command).option("--db <url>", "Database connection string").option("--config <path>", "Path to prisma-next.config.ts").option("--to <contract>", "Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)").option("--advance-ref <name>", "Advance the named ref to the post-apply marker after success").option("--show", "Preview the migration path without applying (read-only)").option("--from <contract>", "From-state for --show preview (@contract, @db, hash, ref name, or migration dir)").action(async (options) => {
|
|
321
|
-
const flags = parseGlobalFlagsOrExit(options);
|
|
322
|
-
const startTime = Date.now();
|
|
323
|
-
const ui = createTerminalUI(flags);
|
|
324
|
-
if (options.show) {
|
|
325
|
-
const exitCode = handleResult(await executeMigrateShowCommand(options, flags, ui), flags, ui, (showResult) => {
|
|
326
|
-
if (flags.json) ui.output(JSON.stringify(showResult, null, 2));
|
|
327
|
-
else ui.output(formatMigrateShowOutput(showResult, flags));
|
|
328
|
-
});
|
|
329
|
-
process.exit(exitCode);
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
const exitCode = handleResult(await executeMigrateCommand(options, flags, ui, startTime), flags, ui, (migrateResult) => {
|
|
333
|
-
if (flags.json) ui.output(JSON.stringify(migrateResult, null, 2));
|
|
334
|
-
else if (!flags.quiet) ui.log(formatMigrationApplyCommandOutput(migrateResult, flags));
|
|
335
|
-
});
|
|
336
|
-
process.exit(exitCode);
|
|
337
|
-
});
|
|
338
|
-
return command;
|
|
339
|
-
}
|
|
340
|
-
//#endregion
|
|
341
|
-
export { createMigrateCommand as t };
|
|
342
|
-
|
|
343
|
-
//# sourceMappingURL=migrate-BXATUjYE-Do79Imf-.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-BXATUjYE-Do79Imf-.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-BXATUjYE.mjs"],"sourcesContent":["import { M as errorTargetMigrationNotSupported, P as errorUnexpected, c as errorContractValidationFailed, d as errorDriverRequired, f as errorFileNotFound, l as errorDatabaseConnectionRequired } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { a as formatMigrationApplyCommandOutput, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, a as maskConnectionUrl, c as resolveMigrationPaths, d as setCommandExamples, n as closeQuietly, p as targetSupportsMigrations, s as resolveContractPath, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-BCgwcqTe.mjs\";\nimport { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"./contract-space-aggregate-loader-fa04OIaL.mjs\";\nimport { t as createControlClient } from \"./client-C6Qp5ujC.mjs\";\nimport { a as readContractIR, t as advanceRefSafely } from \"./ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapCaughtMigrationError } from \"./caught-errors-BZo7zcRc.mjs\";\nimport { t as mapContractAtError } from \"./contract-at-errors-BSoDI0Hw.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants } from \"./invariants-Bltd8DyA.mjs\";\nimport { t as executeMigrateShowPlan } from \"./migrate-show-C_9xR4Qt.mjs\";\nimport { t as resolveContractRef } from \"./ref-resolution-BSN1amKm.mjs\";\nimport { n as migrateShowRunListRows, r as renderMigrateShowGraph, t as mapMigrateFailure } from \"./migrate-failure-D4NvkoCk.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { createControlStack } from \"@internal/framework-components/control\";\n//#region src/commands/migrate.ts\n/**\n* Read-only preview of the migration path `migrate` will take. Delegates the\n* path computation to {@link executeMigrateShowPlan} (the control-api core)\n* and keeps only the styled header plus the Tier-3 graph rendering here.\n*/\nasync function executeMigrateShowCommand(options, flags, ui) {\n\tconst readsLiveMarker = options.from === void 0 || options.from === \"@db\";\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t...readsLiveMarker ? [\"driver\"] : [],\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst planResult = await executeMigrateShowPlan({\n\t\tconfig: configResult.value,\n\t\tcwd: process.cwd(),\n\t\t...ifDefined(\"configPath\", options.config),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"to\", options.to),\n\t\t...ifDefined(\"from\", options.from),\n\t\tonPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {\n\t\t\tif (!flags.json && !flags.quiet) {\n\t\t\t\tconst details = [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: migrationsRelative\n\t\t\t\t}];\n\t\t\t\tif (dbConnection && !hasExplicitFrom) details.push({\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: maskConnectionUrl(String(dbConnection))\n\t\t\t\t});\n\t\t\t\tif (options.from) details.push({\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: options.from\n\t\t\t\t});\n\t\t\t\tif (options.to) details.push({\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: options.to\n\t\t\t\t});\n\t\t\t\tconst header = formatStyledHeader({\n\t\t\t\t\tcommand: \"migrate --show\",\n\t\t\t\t\tdescription: \"Preview the migration path migrate will take (read-only)\",\n\t\t\t\t\tdetails,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tui.stderr(header);\n\t\t\t}\n\t\t}\n\t});\n\tif (!planResult.ok) return notOk(planResult.failure);\n\tconst plan = planResult.value;\n\tconst orderedMigrations = plan.migrations;\n\tlet graphOutput;\n\tlet runListDirNameWidth;\n\tlet runListLeftPad;\n\tif (!flags.json) {\n\t\tconst rendering = renderMigrateShowGraph(plan, {\n\t\t\tcolorize: flags.color !== false,\n\t\t\tglyphMode: \"unicode\"\n\t\t});\n\t\tgraphOutput = rendering.graphOutput;\n\t\trunListDirNameWidth = rendering.runListDirNameWidth;\n\t\trunListLeftPad = rendering.runListLeftPad;\n\t}\n\treturn ok({\n\t\tok: true,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: plan.summary,\n\t\t...graphOutput !== void 0 ? { graphOutput } : {},\n\t\t...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},\n\t\t...runListLeftPad !== void 0 ? { runListLeftPad } : {}\n\t});\n}\nfunction formatMigrateShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tif (result.graphOutput !== void 0 && result.graphOutput.length > 0) {\n\t\tlines.push(result.graphOutput);\n\t\tlines.push(\"\");\n\t}\n\tconst n = result.migrations.length;\n\tif (n === 0) {\n\t\tlines.push(result.summary);\n\t\treturn lines.join(\"\\n\");\n\t}\n\tlines.push(`The following ${n} migration${n === 1 ? \"\" : \"s\"} will run:`);\n\tlines.push(...migrateShowRunListRows(result.migrations, {\n\t\trunListDirNameWidth: result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length)),\n\t\trunListLeftPad: result.runListLeftPad\n\t}, {\n\t\tcolorize: flags.color !== false,\n\t\tglyphMode: \"unicode\"\n\t}));\n\treturn lines.join(\"\\n\");\n}\nasync function executeMigrateCommand(options, flags, ui, startTime) {\n\tconst configResult = await loadConfigForSections(options.config, [\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"driver\",\n\t\t\"extensions\",\n\t\t\"db\",\n\t\t\"migrations\",\n\t\t\"contract\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config, process.cwd());\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for migrate (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: \"migrate\"\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: \"Config.driver is required for migrate\" }));\n\tif (!targetSupportsMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\n\tconst toArg = options.to;\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractRaw;\n\tlet contractContent;\n\ttry {\n\t\tcontractContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `prisma-next contract emit` to generate a valid contract.json, then retry.\"\n\t\t}));\n\t\treturn notOk(errorContractValidationFailed(`Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\ttry {\n\t\tcontractRaw = familyInstance.deserializeContract(JSON.parse(contractContent));\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst loadedAggregate = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: contractRaw,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loadedAggregate.ok) return notOk(loadedAggregate.failure);\n\tconst aggregate = loadedAggregate.value;\n\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(config.extensions ?? []),\n\t\tcheckContracts: true\n\t});\n\tif (integrityFailure) return notOk(integrityFailure);\n\tlet refEntry;\n\tlet refName;\n\tif (toArg) {\n\t\tconst refs = aggregate.app.refs;\n\t\tconst refResult = resolveContractRef(toArg, {\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(refResult.failure);\n\t\tif (refResult.value.provenance.kind === \"ref\") {\n\t\t\trefName = refResult.value.provenance.refName;\n\t\t\tconst resolved = refs[refName];\n\t\t\tif (resolved) refEntry = resolved;\n\t\t} else refEntry = {\n\t\t\thash: refResult.value.hash,\n\t\t\tinvariants: []\n\t\t};\n\t}\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: appMigrationsRelative\n\t\t}];\n\t\tif (typeof dbConnection === \"string\") details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(dbConnection)\n\t\t});\n\t\tif (toArg) details.push({\n\t\t\tlabel: \"to\",\n\t\t\tvalue: toArg\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migrate\",\n\t\t\tdescription: \"Apply planned migrations to advance the database\",\n\t\t\turl: \"https://pris.ly/migrate\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst appGraph = aggregate.app.graph();\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\tdriver: config.driver,\n\t\textensions: config.extensions ?? []\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\tif (appMarker !== null) {\n\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\tgraph: appGraph\n\t\t\t});\n\t\t\tif (markerRefusal) return notOk(markerRefusal);\n\t\t}\n\t\tif (refEntry && refEntry.invariants.length > 0) {\n\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", toArg)\n\t\t\t});\n\t\t\tif (invariantRefusal) return notOk(invariantRefusal);\n\t\t}\n\t\tif (!flags.quiet && !flags.json) ui.step(\"Loading contract spaces…\");\n\t\tlet applyContract = contractRaw;\n\t\tlet snapshotContractJson = JSON.parse(contractContent);\n\t\tlet snapshotContractDts;\n\t\tif (toArg && refEntry) {\n\t\t\tconst targetHash = refEntry.hash;\n\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === targetHash)) try {\n\t\t\t\tconst at = await aggregate.app.contractAt(targetHash, refName !== void 0 ? { refName } : void 0);\n\t\t\t\tapplyContract = at.contract;\n\t\t\t\tsnapshotContractJson = at.contractJson;\n\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t} catch (error) {\n\t\t\t\treturn mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t}\n\t\t}\n\t\tconst applyResult = await client.migrate({\n\t\t\tcontract: applyContract,\n\t\t\tmigrationsDir,\n\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t...refEntry?.invariants ? { refInvariants: refEntry.invariants } : {},\n\t\t\t...refEntry !== void 0 ? ifDefined(\"refName\", toArg) : {}\n\t\t});\n\t\tif (!applyResult.ok) return notOk(mapMigrateFailure(applyResult.failure));\n\t\tconst { value } = applyResult;\n\t\tlet advancedRef = null;\n\t\tif (options.advanceRef !== void 0) {\n\t\t\tconst contractIR = snapshotContractDts !== void 0 ? {\n\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t} : await readContractIR(snapshotContractJson, contractPathAbsolute);\n\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\trefsDir,\n\t\t\t\tmigrationsDir,\n\t\t\t\tname: options.advanceRef,\n\t\t\t\thash: value.markerHash,\n\t\t\t\tcontractIR\n\t\t\t});\n\t\t\tif (!advanced.ok) return notOk(advanced.failure);\n\t\t\tadvancedRef = {\n\t\t\t\tname: advanced.value.name,\n\t\t\t\thash: advanced.value.hash\n\t\t\t};\n\t\t}\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\tmigrationsTotal: value.perSpace.length,\n\t\t\tmarkerHash: value.markerHash,\n\t\t\tapplied: value.applied,\n\t\t\tsummary: value.summary,\n\t\t\tperSpace: value.perSpace,\n\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\ttimings: { total: Date.now() - startTime },\n\t\t\tadvancedRef\n\t\t});\n\t} catch (error) {\n\t\tconst mapped = mapCaughtMigrationError(error);\n\t\tif (mapped) return notOk(mapped);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));\n\t} finally {\n\t\tawait closeQuietly(client);\n\t}\n}\nfunction createMigrateCommand() {\n\tconst command = new Command(\"migrate\");\n\tsetCommandDescriptions(command, \"Apply planned migrations to advance the database\", \"Walks every contract space (app + extensions) and applies pending\\non-disk migrations in canonical order (extensions alphabetically,\\nthen app). Graph-walks the on-disk migration graph for every space.\\nUse --to to target a specific contract (hash, ref name, migration dir).\\nUse --show for a read-only preview of the path that would run.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migrate --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to production --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to abc123 --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --from @contract --to production\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--to <contract>\", \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\").option(\"--advance-ref <name>\", \"Advance the named ref to the post-apply marker after success\").option(\"--show\", \"Preview the migration path without applying (read-only)\").option(\"--from <contract>\", \"From-state for --show preview (@contract, @db, hash, ref name, or migration dir)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst startTime = Date.now();\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (options.show) {\n\t\t\tconst exitCode = handleResult(await executeMigrateShowCommand(options, flags, ui), flags, ui, (showResult) => {\n\t\t\t\tif (flags.json) ui.output(JSON.stringify(showResult, null, 2));\n\t\t\t\telse ui.output(formatMigrateShowOutput(showResult, flags));\n\t\t\t});\n\t\t\tprocess.exit(exitCode);\n\t\t\treturn;\n\t\t}\n\t\tconst exitCode = handleResult(await executeMigrateCommand(options, flags, ui, startTime), flags, ui, (migrateResult) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(migrateResult, null, 2));\n\t\t\telse if (!flags.quiet) ui.log(formatMigrationApplyCommandOutput(migrateResult, flags));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrateCommand as t };\n\n//# sourceMappingURL=migrate-BXATUjYE.mjs.map"],"mappings":";;;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EACA;EACA;EACA;EACA;CACD,CAAC;CACD,iBAAiB,OAAO,CAAC,CAAC,OAAO,cAAc,4BAA4B,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,mBAAmB,2FAA2F,CAAC,CAAC,OAAO,wBAAwB,8DAA8D,CAAC,CAAC,OAAO,UAAU,yDAAyD,CAAC,CAAC,OAAO,qBAAqB,kFAAkF,CAAC,CAAC,OAAO,OAAO,YAAY;EACnjB,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,YAAY,KAAK,IAAI;EAC3B,MAAM,KAAK,iBAAiB,KAAK;EACjC,IAAI,QAAQ,MAAM;GACjB,MAAM,WAAW,aAAa,MAAM,0BAA0B,SAAS,OAAO,EAAE,GAAG,OAAO,KAAK,eAAe;IAC7G,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,YAAY,MAAM,CAAC,CAAC;SACxD,GAAG,OAAO,wBAAwB,YAAY,KAAK,CAAC;GAC1D,CAAC;GACD,QAAQ,KAAK,QAAQ;GACrB;EACD;EACA,MAAM,WAAW,aAAa,MAAM,sBAAsB,SAAS,OAAO,IAAI,SAAS,GAAG,OAAO,KAAK,kBAAkB;GACvH,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,eAAe,MAAM,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,OAAO,GAAG,IAAI,kCAAkC,eAAe,KAAK,CAAC;EACtF,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { k as errorRunnerFailed, w as errorPathUnreachable } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
|
|
2
|
-
import { t as listRefsByContractHash } from "./migration-list-CY08bD8I-PoXuv94c.mjs";
|
|
3
|
-
import { _ as renderMigrationGraphCommand, a as buildMigrationGraphRows, c as computeLabelColumn, f as formatOnPathMigrationRow, i as buildGrid, l as computeMaxDirNameWidth, m as indentMigrationGraphTreeBlock, p as highlightFromEdgeAnnotations } from "./migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs";
|
|
4
|
-
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-failure-D4NvkoCk.mjs
|
|
6
|
-
const LABEL_GAP = 2;
|
|
7
|
-
const MIN_HASH_DATA_COLUMN = 25;
|
|
8
|
-
const LIST_INDENT = 2;
|
|
9
|
-
function paintOverrides(options) {
|
|
10
|
-
return {
|
|
11
|
-
...options.styler === void 0 ? {} : { styler: options.styler },
|
|
12
|
-
...options.palette === void 0 ? {} : { palette: options.palette }
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Every space, with the migrations on the chosen path lifted to focus mode and
|
|
17
|
-
* everything else dimmed. Widths are computed across all spaces first so the
|
|
18
|
-
* sections and the run-list below them share their columns.
|
|
19
|
-
*/
|
|
20
|
-
function renderMigrateShowGraph(plan, options) {
|
|
21
|
-
const { aggregate, contractHash } = plan;
|
|
22
|
-
const allSpaces = [aggregate.app, ...aggregate.extensions];
|
|
23
|
-
const onPathHashes = new Set(plan.migrations.map((migration) => migration.migrationHash));
|
|
24
|
-
const spaceLayouts = allSpaces.map((space) => {
|
|
25
|
-
const isApp = space.spaceId === aggregate.app.spaceId;
|
|
26
|
-
const spaceGraph = space.graph();
|
|
27
|
-
const rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});
|
|
28
|
-
const edgeAnnotations = /* @__PURE__ */ new Map();
|
|
29
|
-
for (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? "on-path" : "off-path" });
|
|
30
|
-
return {
|
|
31
|
-
space,
|
|
32
|
-
isApp,
|
|
33
|
-
rowModel,
|
|
34
|
-
grid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),
|
|
35
|
-
edgeAnnotations
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
const multiSpace = spaceLayouts.length > 1;
|
|
39
|
-
const globalLabelColumn = multiSpace ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, options.glyphMode))) : void 0;
|
|
40
|
-
const widestRunListName = plan.migrations.length > 0 ? Math.max(...plan.migrations.map((migration) => migration.dirName.length)) : 0;
|
|
41
|
-
const globalMaxDirNameWidth = multiSpace ? Math.max(Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))), widestRunListName) : void 0;
|
|
42
|
-
const sections = [];
|
|
43
|
-
for (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {
|
|
44
|
-
const liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);
|
|
45
|
-
const tree = renderMigrationGraphCommand({
|
|
46
|
-
grid,
|
|
47
|
-
rowModel,
|
|
48
|
-
contractHash,
|
|
49
|
-
isAppSpace: isApp,
|
|
50
|
-
...plan.usedLiveMarker && liveMarkerHash !== void 0 ? { dbHash: liveMarkerHash } : {},
|
|
51
|
-
refsByHash: listRefsByContractHash(space),
|
|
52
|
-
edgeAnnotationsByHash: edgeAnnotations,
|
|
53
|
-
colorize: options.colorize,
|
|
54
|
-
glyphMode: options.glyphMode,
|
|
55
|
-
...paintOverrides(options),
|
|
56
|
-
...globalLabelColumn === void 0 ? {} : { globalLabelColumn },
|
|
57
|
-
...globalMaxDirNameWidth === void 0 ? {} : { globalMaxDirNameWidth }
|
|
58
|
-
});
|
|
59
|
-
if (tree.length === 0) continue;
|
|
60
|
-
sections.push(multiSpace ? `${space.spaceId}:\n${indentMigrationGraphTreeBlock(tree, " ")}` : tree);
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
graphOutput: sections.join("\n\n"),
|
|
64
|
-
runListDirNameWidth: globalMaxDirNameWidth ?? widestRunListName,
|
|
65
|
-
runListLeftPad: globalLabelColumn
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* The ordered "will run" rows, aligned with the graph above them.
|
|
70
|
-
*
|
|
71
|
-
* The `→` arrow has to land in the same absolute column in a list row as in a
|
|
72
|
-
* graph edge row. A graph edge row is `[gutter][name][hashes]`; a list row is
|
|
73
|
-
* `[indent][name][indent][hashes]`, so the list's name column absorbs the
|
|
74
|
-
* gutter width and the indent — twice over when a flat tree has no space
|
|
75
|
-
* headings indenting it.
|
|
76
|
-
*/
|
|
77
|
-
function migrateShowRunListRows(migrations, rendering, options) {
|
|
78
|
-
const gutter = rendering.runListLeftPad ?? 0;
|
|
79
|
-
const multiSpace = rendering.runListLeftPad !== void 0;
|
|
80
|
-
const listDirNameWidth = gutter + Math.max(rendering.runListDirNameWidth + LABEL_GAP, MIN_HASH_DATA_COLUMN - gutter) - (multiSpace ? LIST_INDENT : LIST_INDENT * 2);
|
|
81
|
-
return migrations.map((migration) => ` ${formatOnPathMigrationRow(migration.dirName, migration.from, migration.to, listDirNameWidth, options.colorize, options.glyphMode, paintOverrides(options))}`);
|
|
82
|
-
}
|
|
83
|
-
/** A `migrate` apply failure as the CLI's structured error. */
|
|
84
|
-
function mapMigrateFailure(failure) {
|
|
85
|
-
if (failure.code === "MIGRATION_PATH_NOT_FOUND") return errorPathUnreachable(failure);
|
|
86
|
-
return errorRunnerFailed(failure.summary, {
|
|
87
|
-
why: failure.why ?? "Migration runner failed",
|
|
88
|
-
fix: "Fix the issue and re-run `prisma-next migrate --to <contract>` — previously applied migrations are preserved.",
|
|
89
|
-
meta: failure.meta ?? {},
|
|
90
|
-
...ifDefined("cause", failure.cause)
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { migrateShowRunListRows as n, renderMigrateShowGraph as r, mapMigrateFailure as t };
|
|
95
|
-
|
|
96
|
-
//# sourceMappingURL=migrate-failure-D4NvkoCk-0bttmQs2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-failure-D4NvkoCk-0bttmQs2.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-failure-D4NvkoCk.mjs"],"sourcesContent":["import { C as errorPathUnreachable, O as errorRunnerFailed } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { t as listRefsByContractHash } from \"./migration-list-CY08bD8I.mjs\";\nimport { _ as buildGrid, f as highlightFromEdgeAnnotations, g as buildMigrationGraphRows, i as formatOnPathMigrationRow, n as computeMaxDirNameWidth, p as indentMigrationGraphTreeBlock, r as renderMigrationGraphCommand, t as computeLabelColumn } from \"./migration-graph-command-render-h0VdTkSM.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/utils/formatters/migrate-show-render.ts\nconst LABEL_GAP = 2;\nconst MIN_HASH_DATA_COLUMN = 25;\nconst LIST_INDENT = 2;\nfunction paintOverrides(options) {\n\treturn {\n\t\t...options.styler === void 0 ? {} : { styler: options.styler },\n\t\t...options.palette === void 0 ? {} : { palette: options.palette }\n\t};\n}\n/**\n* Every space, with the migrations on the chosen path lifted to focus mode and\n* everything else dimmed. Widths are computed across all spaces first so the\n* sections and the run-list below them share their columns.\n*/\nfunction renderMigrateShowGraph(plan, options) {\n\tconst { aggregate, contractHash } = plan;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst onPathHashes = new Set(plan.migrations.map((migration) => migration.migrationHash));\n\tconst spaceLayouts = allSpaces.map((space) => {\n\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\tconst spaceGraph = space.graph();\n\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\treturn {\n\t\t\tspace,\n\t\t\tisApp,\n\t\t\trowModel,\n\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\tedgeAnnotations\n\t\t};\n\t});\n\tconst multiSpace = spaceLayouts.length > 1;\n\tconst globalLabelColumn = multiSpace ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, options.glyphMode))) : void 0;\n\tconst widestRunListName = plan.migrations.length > 0 ? Math.max(...plan.migrations.map((migration) => migration.dirName.length)) : 0;\n\tconst globalMaxDirNameWidth = multiSpace ? Math.max(Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))), widestRunListName) : void 0;\n\tconst sections = [];\n\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\tconst tree = renderMigrationGraphCommand({\n\t\t\tgrid,\n\t\t\trowModel,\n\t\t\tcontractHash,\n\t\t\tisAppSpace: isApp,\n\t\t\t...plan.usedLiveMarker && liveMarkerHash !== void 0 ? { dbHash: liveMarkerHash } : {},\n\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\tcolorize: options.colorize,\n\t\t\tglyphMode: options.glyphMode,\n\t\t\t...paintOverrides(options),\n\t\t\t...globalLabelColumn === void 0 ? {} : { globalLabelColumn },\n\t\t\t...globalMaxDirNameWidth === void 0 ? {} : { globalMaxDirNameWidth }\n\t\t});\n\t\tif (tree.length === 0) continue;\n\t\tsections.push(multiSpace ? `${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}` : tree);\n\t}\n\treturn {\n\t\tgraphOutput: sections.join(\"\\n\\n\"),\n\t\trunListDirNameWidth: globalMaxDirNameWidth ?? widestRunListName,\n\t\trunListLeftPad: globalLabelColumn\n\t};\n}\n/**\n* The ordered \"will run\" rows, aligned with the graph above them.\n*\n* The `→` arrow has to land in the same absolute column in a list row as in a\n* graph edge row. A graph edge row is `[gutter][name][hashes]`; a list row is\n* `[indent][name][indent][hashes]`, so the list's name column absorbs the\n* gutter width and the indent — twice over when a flat tree has no space\n* headings indenting it.\n*/\nfunction migrateShowRunListRows(migrations, rendering, options) {\n\tconst gutter = rendering.runListLeftPad ?? 0;\n\tconst multiSpace = rendering.runListLeftPad !== void 0;\n\tconst listDirNameWidth = gutter + Math.max(rendering.runListDirNameWidth + LABEL_GAP, MIN_HASH_DATA_COLUMN - gutter) - (multiSpace ? LIST_INDENT : LIST_INDENT * 2);\n\treturn migrations.map((migration) => ` ${formatOnPathMigrationRow(migration.dirName, migration.from, migration.to, listDirNameWidth, options.colorize, options.glyphMode, paintOverrides(options))}`);\n}\n//#endregion\n//#region src/utils/migrate-failure.ts\n/** A `migrate` apply failure as the CLI's structured error. */\nfunction mapMigrateFailure(failure) {\n\tif (failure.code === \"MIGRATION_PATH_NOT_FOUND\") return errorPathUnreachable(failure);\n\treturn errorRunnerFailed(failure.summary, {\n\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\tfix: \"Fix the issue and re-run `prisma-next migrate --to <contract>` — previously applied migrations are preserved.\",\n\t\tmeta: failure.meta ?? {},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\n//#endregion\nexport { migrateShowRunListRows as n, renderMigrateShowGraph as r, mapMigrateFailure as t };\n\n//# sourceMappingURL=migrate-failure-D4NvkoCk.mjs.map"],"mappings":";;;;;AAKA,MAAM,YAAY;AAClB,MAAM,uBAAuB;AAC7B,MAAM,cAAc;AACpB,SAAS,eAAe,SAAS;CAChC,OAAO;EACN,GAAG,QAAQ,WAAW,KAAK,IAAI,CAAC,IAAI,EAAE,QAAQ,QAAQ,OAAO;EAC7D,GAAG,QAAQ,YAAY,KAAK,IAAI,CAAC,IAAI,EAAE,SAAS,QAAQ,QAAQ;CACjE;AACD;;;;;;AAMA,SAAS,uBAAuB,MAAM,SAAS;CAC9C,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,YAAY,CAAC,UAAU,KAAK,GAAG,UA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B,KAAK;GACxC,uBAAuB;GACvB,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACnB,GAAG,eAAe,OAAO;GACzB,GAAG,sBAAsB,KAAK,IAAI,CAAC,IAAI,EAAE,kBAAkB;GAC3D,GAAG,0BAA0B,KAAK,IAAI,CAAC,IAAI,EAAE,sBAAsB;EACpE,CAAC;EACD,IAAI,KAAK,WAAW,GAAG;EACvB,SAAS,KAAK,aAAa,GAAG,MAAM,QAAQ,KAAK,8BAA8B,MAAM,IAAI,MAAM,IAAI;CACpG;CACA,OAAO;EACN,aAAa,SAAS,KAAK,MAAM;EACjC,qBAAqB,yBAAyB;EAC9C,gBAAgB;CACjB;AACD;;;;;;;;;;AAUA,SAAS,uBAAuB,YAAY,WAAW,SAAS;CAC/D,MAAM,SAAS,UAAU,kBAAkB;CAC3C,MAAM,aAAa,UAAU,mBAAmB,KAAK;CACrD,MAAM,mBAAmB,SAAS,KAAK,IAAI,UAAU,sBAAsB,WAAW,uBAAuB,MAAM,KAAK,aAAa,cAAc,cAAc;CACjK,OAAO,WAAW,KAAK,cAAc,KAAK,yBAAyB,UAAU,SAAS,UAAU,MAAM,UAAU,IAAI,kBAAkB,QAAQ,UAAU,QAAQ,WAAW,eAAe,OAAO,CAAC,GAAG;AACtM;;AAIA,SAAS,kBAAkB,SAAS;CACnC,IAAI,QAAQ,SAAS,4BAA4B,OAAO,qBAAqB,OAAO;CACpF,OAAO,kBAAkB,QAAQ,SAAS;EACzC,KAAK,QAAQ,OAAO;EACpB,KAAK;EACL,MAAM,QAAQ,QAAQ,CAAC;EACvB,GAAG,UAAU,SAAS,QAAQ,KAAK;CACpC,CAAC;AACF"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { c as CreateControlClient, t as CliStructuredError$2 } from "./cli-errors-iquUoY6O-BFboxglv.mjs";
|
|
2
|
-
import { c as ContractSpaceAggregate } from "./aggregate-CA6bJ8UO.mjs";
|
|
3
|
-
import { Result } from "@prisma/orm-framework/utils/result";
|
|
4
|
-
import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-B8UJ9dmb.d.mts
|
|
6
|
-
//#region src/control-api/operations/migrate-show.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* One migration that will run in a `migrate --show` preview, in execution order.
|
|
9
|
-
*/
|
|
10
|
-
interface MigrateShowMigration {
|
|
11
|
-
readonly spaceId: string;
|
|
12
|
-
readonly dirName: string;
|
|
13
|
-
readonly migrationHash: string;
|
|
14
|
-
readonly from: string;
|
|
15
|
-
readonly to: string;
|
|
16
|
-
}
|
|
17
|
-
interface ExecuteMigrateShowPlanOptions {
|
|
18
|
-
readonly config: PrismaNextConfig;
|
|
19
|
-
/** Directory the command was invoked from. */
|
|
20
|
-
readonly cwd: string;
|
|
21
|
-
/** `--config` as the user wrote it, used only to locate the migrations directory and for display. */
|
|
22
|
-
readonly configPath?: string;
|
|
23
|
-
readonly db?: string;
|
|
24
|
-
readonly to?: string;
|
|
25
|
-
readonly from?: string;
|
|
26
|
-
/** Client factory used when the plan needs the live DB marker; defaults to the real client. */
|
|
27
|
-
readonly createClient?: CreateControlClient;
|
|
28
|
-
/**
|
|
29
|
-
* Invoked once, after refs/aggregate/--to resolution succeeds and before any DB connection —
|
|
30
|
-
* exactly where the CLI renders its styled header today.
|
|
31
|
-
*/
|
|
32
|
-
readonly onPreflightComplete?: (ctx: {
|
|
33
|
-
readonly configPath: string;
|
|
34
|
-
readonly migrationsRelative: string;
|
|
35
|
-
readonly dbConnection: unknown | undefined;
|
|
36
|
-
readonly hasExplicitFrom: boolean;
|
|
37
|
-
}) => void;
|
|
38
|
-
}
|
|
39
|
-
interface MigrateShowPlanSuccess {
|
|
40
|
-
readonly aggregate: ContractSpaceAggregate;
|
|
41
|
-
readonly contractHash: string;
|
|
42
|
-
readonly migrations: readonly MigrateShowMigration[];
|
|
43
|
-
readonly summary: string;
|
|
44
|
-
/** Per-space render hash: live/override marker storageHash, pre-defaulted to the empty sentinel. */
|
|
45
|
-
readonly renderMarkerHashBySpace: ReadonlyMap<string, string>;
|
|
46
|
-
/** True when the live DB marker was read — gates the ★ db marker in the tree. */
|
|
47
|
-
readonly usedLiveMarker: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Computes the path through the SAME seam as `executeMigrate`:
|
|
51
|
-
* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
|
|
52
|
-
* the full marker including `invariants` (not just `storageHash`).
|
|
53
|
-
* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,
|
|
54
|
-
* which feeds `resolveRecordedPath()` with the same target hash, target invariants,
|
|
55
|
-
* and current marker as the real apply path uses.
|
|
56
|
-
*
|
|
57
|
-
* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No
|
|
58
|
-
* DB state is mutated.
|
|
59
|
-
*/
|
|
60
|
-
declare function executeMigrateShowPlan(options: ExecuteMigrateShowPlanOptions): Promise<Result<MigrateShowPlanSuccess, CliStructuredError$2>>;
|
|
61
|
-
//#endregion
|
|
62
|
-
export { executeMigrateShowPlan as i, MigrateShowMigration as n, MigrateShowPlanSuccess as r, ExecuteMigrateShowPlanOptions as t };
|
|
63
|
-
//# sourceMappingURL=migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-show-B8UJ9dmb-C4RTPbDk.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-B8UJ9dmb.d.mts"],"mappings":";;;;;;;;;UAQU;WACC;WACA;WACA;WACA;WACA;;UAED;WACC,QAAQ;;WAER;;WAEA;WACA;WACA;WACA;;WAEA,eAAe;;;;;WAKf,uBAAuB;aACrB;aACA;aACA;aACA;;;UAGH;WACC,WAAW;WACX;WACA,qBAAqB;WACrB;;WAEA,yBAAyB;;WAEzB;;;;;;;;;;;;;iBAaM,uBAAuB,SAAS,gCAAgC,QAAQ,OAAO,wBAAwB"}
|