@prisma/orm-toolchain 8.0.0-rc.1-dev.45 → 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-C-jirr19-DDQB0WGo.mjs +0 -295
- package/dist/code-templates-C-jirr19-DDQB0WGo.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-DC7zPKka-BSiUrPw3.mjs +0 -800
- package/dist/init-DC7zPKka-BSiUrPw3.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-DuKoiMax-Cfe2XVhc.mjs +0 -1476
- package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.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,621 +0,0 @@
|
|
|
1
|
-
import { F as errorUnexpected, I as mapRefResolutionError, N as errorTargetMigrationNotSupported, T as errorPlanForgotTheFlag, j as errorSnapshotMissing, l as errorContractValidationFailed, p as errorFileNotFound, t as CliStructuredError$1, x as errorMigrationPlanningFailed } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
|
|
2
|
-
import { t as assertFrameworkComponentsCompatible } from "./framework-components-Bau7o1-J-DTp6AUoq.mjs";
|
|
3
|
-
import { t as createProjectSpecifierResolver } from "./project-import-root-B4nM-VWX-D__g0hTb.mjs";
|
|
4
|
-
import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
|
|
5
|
-
import { t as MigrationToolsError } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
|
|
6
|
-
import { a as snapshotsImportPathFrom, o as writeContractSnapshot } from "./contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs";
|
|
7
|
-
import { t as computeMigrationHash } from "./hash-DH8hl5Rq-BpM2t3Nu.mjs";
|
|
8
|
-
import { t as deriveProvidedInvariants } from "./invariants-CTHy88OP-DJ-i5yTz.mjs";
|
|
9
|
-
import { i as materialiseExtensionMigrationPackageIfMissing, r as formatMigrationDirName, u as writeMigrationPackage } from "./io-635GlNx1-D94PxRc-.mjs";
|
|
10
|
-
import { r as findLatestMigration } from "./migration-graph-_SJImD5V-D5RCc651.mjs";
|
|
11
|
-
import { c as spaceMigrationDirectory, s as readContractSpaceHeadRef } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
|
|
12
|
-
import { i as emitContractSpaceArtifacts, o as planAllSpaces } from "./spaces-BG2w0P8d.mjs";
|
|
13
|
-
import { _ as resolveMigrationPaths, g as resolveContractPath, l as getTargetMigrations } from "./command-helpers-BCgwcqTe-lNCtppzM.mjs";
|
|
14
|
-
import { n as isGraphNode, t as assertHashIsGraphNode } from "./graph-membership-BViWUMpP-Cgu4Z2ox.mjs";
|
|
15
|
-
import { a as loadContractSpaceAggregateForCli, d as toExtensionInputs, n as buildContractSpaceAggregate } from "./contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs";
|
|
16
|
-
import { n as parseContractRef } from "./ref-resolution-sGcINe7o.mjs";
|
|
17
|
-
import { t as mapContractAtError } from "./contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs";
|
|
18
|
-
import { i as writeMigrationTs } from "./migration-ts-BoHxxGvi.mjs";
|
|
19
|
-
import { join, relative } from "pathe";
|
|
20
|
-
import { castAs } from "@prisma/orm-framework/utils/casts";
|
|
21
|
-
import { readFile } from "node:fs/promises";
|
|
22
|
-
import { createControlStack, hasOperationPreview } from "@prisma/orm-framework/components/control";
|
|
23
|
-
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
24
|
-
//#region ../../../1-framework/3-tooling/cli/dist/migration-plan-Cfz0efEL.mjs
|
|
25
|
-
/**
|
|
26
|
-
* Phase-1 of the two-phase `migration plan` pipeline (sub-spec § 4).
|
|
27
|
-
*
|
|
28
|
-
* For every extension that exposes a `contractSpace`:
|
|
29
|
-
*
|
|
30
|
-
* 1. Read the on-disk head ref (returns `null` on first emit).
|
|
31
|
-
* 2. Write the head contract into the migrations-root snapshot store
|
|
32
|
-
* (write-if-absent, keyed by hash) and unconditionally re-emit
|
|
33
|
-
* `refs/head.json`, via {@link emitContractSpaceArtifacts}. The
|
|
34
|
-
* framework owns `refs/head.json`; re-emit is the contract for that
|
|
35
|
-
* file. The snapshot itself is only written once per distinct hash.
|
|
36
|
-
* 3. Materialise any descriptor-shipped migration packages not yet on
|
|
37
|
-
* disk via {@link materialiseExtensionMigrationPackageIfMissing}.
|
|
38
|
-
* Existing packages are left untouched (by-existence skip).
|
|
39
|
-
*
|
|
40
|
-
* The return value lets the caller render a per-space status line and
|
|
41
|
-
* lets the phase-2 aggregate loader run on a now-consistent disk state
|
|
42
|
-
* (every loaded extension is guaranteed to have its head ref pinned
|
|
43
|
-
* to the descriptor's hash and to ship every package the descriptor
|
|
44
|
-
* declares).
|
|
45
|
-
*
|
|
46
|
-
* Output ordering is deterministic and alphabetical by spaceId (via
|
|
47
|
-
* {@link planAllSpaces}, which also detects duplicate spaceIds). This
|
|
48
|
-
* matches the canonical sort order used by every other aggregate
|
|
49
|
-
* surface (`migrate`, `migration status`, the runner).
|
|
50
|
-
*/
|
|
51
|
-
async function runContractSpaceSeedPhase(inputs) {
|
|
52
|
-
const planned = planAllSpaces(inputs.extensions.filter((pack) => pack.contractSpace !== void 0).map((pack) => ({
|
|
53
|
-
spaceId: pack.id,
|
|
54
|
-
priorContract: null,
|
|
55
|
-
newContract: pack.contractSpace.contractJson,
|
|
56
|
-
__pack: pack.contractSpace
|
|
57
|
-
})), (input) => input.__pack.migrations);
|
|
58
|
-
const descriptorBySpace = /* @__PURE__ */ new Map();
|
|
59
|
-
for (const pack of inputs.extensions) if (pack.contractSpace !== void 0) descriptorBySpace.set(pack.id, pack.contractSpace);
|
|
60
|
-
const seeded = [];
|
|
61
|
-
for (const space of planned) {
|
|
62
|
-
const descriptor = descriptorBySpace.get(space.spaceId);
|
|
63
|
-
if (descriptor === void 0) continue;
|
|
64
|
-
const priorHash = (await readContractSpaceHeadRef(inputs.migrationsDir, space.spaceId))?.hash ?? null;
|
|
65
|
-
await emitContractSpaceArtifacts(inputs.migrationsDir, space.spaceId, {
|
|
66
|
-
contract: descriptor.contractJson,
|
|
67
|
-
contractDts: buildPlaceholderContractDts(space.spaceId),
|
|
68
|
-
headRef: {
|
|
69
|
-
hash: descriptor.headRef.hash,
|
|
70
|
-
invariants: descriptor.headRef.invariants
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const spaceDir = spaceMigrationDirectory(inputs.migrationsDir, space.spaceId);
|
|
74
|
-
const newMigrationDirs = [];
|
|
75
|
-
for (const pkg of space.migrationPackages) {
|
|
76
|
-
const { written } = await materialiseExtensionMigrationPackageIfMissing(spaceDir, pkg);
|
|
77
|
-
if (written) newMigrationDirs.push(pkg.dirName);
|
|
78
|
-
}
|
|
79
|
-
const action = priorHash !== descriptor.headRef.hash || newMigrationDirs.length > 0 ? "updated" : "unchanged";
|
|
80
|
-
seeded.push({
|
|
81
|
-
spaceId: space.spaceId,
|
|
82
|
-
action,
|
|
83
|
-
priorHash,
|
|
84
|
-
newHash: descriptor.headRef.hash,
|
|
85
|
-
newMigrationDirs
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return { seeded };
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Placeholder `.d.ts` content for an extension space's on-disk mirror.
|
|
92
|
-
*
|
|
93
|
-
* Rendering a fully-typed `.d.ts` for an extension contract requires
|
|
94
|
-
* the SQL-family renderer with the codec / typemap registry threaded
|
|
95
|
-
* through; until that integration ships, the on-disk `.d.ts` is a
|
|
96
|
-
* stub `export {};` module that documents how consumers should
|
|
97
|
-
* validate the sibling `contract.json`. The stub typechecks on its
|
|
98
|
-
* own and does not need any TypeScript suppressions.
|
|
99
|
-
*/
|
|
100
|
-
function buildPlaceholderContractDts(spaceId) {
|
|
101
|
-
return [
|
|
102
|
-
"/**",
|
|
103
|
-
` * Placeholder \`.d.ts\` for extension space "${spaceId}".`,
|
|
104
|
-
" *",
|
|
105
|
-
" * The framework re-emits this file on every `migration plan` run",
|
|
106
|
-
" * alongside `contract.json` and `refs/head.json`. A typed `.d.ts`",
|
|
107
|
-
" * rendering pass for extension contracts is tracked separately;",
|
|
108
|
-
" * until that ships, consumers should import `contract.json`",
|
|
109
|
-
" * and pass it through the target descriptor’s `contractSerializer`.",
|
|
110
|
-
" */",
|
|
111
|
-
"export {};",
|
|
112
|
-
""
|
|
113
|
-
].join("\n");
|
|
114
|
-
}
|
|
115
|
-
const FULL_HASH_PATTERN = /^([0-9a-f]{64}|empty)$/;
|
|
116
|
-
function looksLikeFullHash(input) {
|
|
117
|
-
return FULL_HASH_PATTERN.test(input);
|
|
118
|
-
}
|
|
119
|
-
function graphIsEmpty(space) {
|
|
120
|
-
return space.packages.length === 0;
|
|
121
|
-
}
|
|
122
|
-
function getReachableRefs(refs, graph) {
|
|
123
|
-
return Object.entries(refs).flatMap(([name, entry]) => entry && isGraphNode(entry.hash, graph) ? [{
|
|
124
|
-
name,
|
|
125
|
-
hash: entry.hash
|
|
126
|
-
}] : []).sort((a, b) => a.name.localeCompare(b.name));
|
|
127
|
-
}
|
|
128
|
-
function assertFromIsGraphNode(fromHash, graph, refs, graphTipHash) {
|
|
129
|
-
try {
|
|
130
|
-
assertHashIsGraphNode(fromHash, graph);
|
|
131
|
-
} catch (error) {
|
|
132
|
-
if (MigrationToolsError.is(error) && error.code === "MIGRATION.HASH_NOT_IN_GRAPH") throw errorPlanForgotTheFlag(fromHash, getReachableRefs(refs, graph), graphTipHash, { cause: error });
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async function resolveContractRef(parsed, space, options) {
|
|
137
|
-
const { hash, provenance } = parsed;
|
|
138
|
-
const refName = provenance.kind === "ref" ? provenance.refName : void 0;
|
|
139
|
-
try {
|
|
140
|
-
const at = await space.contractAt(hash, refName !== void 0 ? { refName } : void 0);
|
|
141
|
-
if (at.provenance === "ref") return ok({
|
|
142
|
-
kind: "ref",
|
|
143
|
-
hash: at.hash,
|
|
144
|
-
contract: at.contract,
|
|
145
|
-
contractJson: at.contractJson,
|
|
146
|
-
contractDts: at.contractDts
|
|
147
|
-
});
|
|
148
|
-
return ok({
|
|
149
|
-
kind: "graph-node",
|
|
150
|
-
hash: at.hash,
|
|
151
|
-
contract: at.contract,
|
|
152
|
-
contractJson: at.contractJson,
|
|
153
|
-
contractDts: at.contractDts
|
|
154
|
-
});
|
|
155
|
-
} catch (error) {
|
|
156
|
-
return mapContractAtError(error, options?.artifactRole !== void 0 ? { artifactRole: options.artifactRole } : void 0);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async function resolveFromPolicy(parsed, input, refs, explicitFromLabel) {
|
|
160
|
-
const resolution = await resolveContractRef(parsed, input.space, {
|
|
161
|
-
...explicitFromLabel !== void 0 ? { explicitLabel: explicitFromLabel } : {},
|
|
162
|
-
artifactRole: "from"
|
|
163
|
-
});
|
|
164
|
-
if (!resolution.ok) return resolution;
|
|
165
|
-
if (resolution.value.kind === "graph-node") return ok({
|
|
166
|
-
kind: "graph-node",
|
|
167
|
-
fromHash: resolution.value.hash,
|
|
168
|
-
fromContract: resolution.value.contract
|
|
169
|
-
});
|
|
170
|
-
const { hash, contract, contractJson, contractDts } = resolution.value;
|
|
171
|
-
if (graphIsEmpty(input.space)) return ok({
|
|
172
|
-
kind: "auto-baseline",
|
|
173
|
-
fromHash: hash,
|
|
174
|
-
fromContract: contract,
|
|
175
|
-
contractDts,
|
|
176
|
-
contractJson
|
|
177
|
-
});
|
|
178
|
-
const graph = input.space.graph();
|
|
179
|
-
const graphTip = findLatestMigration(graph)?.to ?? null;
|
|
180
|
-
try {
|
|
181
|
-
assertFromIsGraphNode(hash, graph, refs, graphTip);
|
|
182
|
-
} catch (error) {
|
|
183
|
-
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
184
|
-
throw error;
|
|
185
|
-
}
|
|
186
|
-
return ok({
|
|
187
|
-
kind: "ref",
|
|
188
|
-
fromHash: hash,
|
|
189
|
-
fromContract: contract,
|
|
190
|
-
contractDts,
|
|
191
|
-
contractJson
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
async function resolveFromForPlan(input) {
|
|
195
|
-
const { optionsFrom, space } = input;
|
|
196
|
-
const graph = space.graph();
|
|
197
|
-
const refs = space.refs;
|
|
198
|
-
if (optionsFrom === void 0) {
|
|
199
|
-
const dbRef = refs["db"];
|
|
200
|
-
if (!dbRef) return ok({
|
|
201
|
-
kind: "greenfield",
|
|
202
|
-
fromHash: null,
|
|
203
|
-
fromContract: null
|
|
204
|
-
});
|
|
205
|
-
return resolveFromPolicy({
|
|
206
|
-
hash: dbRef.hash,
|
|
207
|
-
provenance: {
|
|
208
|
-
kind: "ref",
|
|
209
|
-
refName: "db"
|
|
210
|
-
}
|
|
211
|
-
}, input, refs);
|
|
212
|
-
}
|
|
213
|
-
const refResult = parseContractRef(optionsFrom, {
|
|
214
|
-
graph,
|
|
215
|
-
refs
|
|
216
|
-
});
|
|
217
|
-
if (!refResult.ok) {
|
|
218
|
-
if (looksLikeFullHash(optionsFrom)) {
|
|
219
|
-
const empty = graphIsEmpty(space);
|
|
220
|
-
const graphTip = findLatestMigration(graph)?.to ?? null;
|
|
221
|
-
if (empty) return notOk(errorSnapshotMissing(optionsFrom, { viaRef: false }));
|
|
222
|
-
return notOk(errorPlanForgotTheFlag(optionsFrom, getReachableRefs(refs, graph), graphTip));
|
|
223
|
-
}
|
|
224
|
-
return notOk(mapRefResolutionError(refResult.failure));
|
|
225
|
-
}
|
|
226
|
-
return resolveFromPolicy(refResult.value, input, refs, optionsFrom);
|
|
227
|
-
}
|
|
228
|
-
async function resolveToForPlan(optionsTo, input) {
|
|
229
|
-
const { space } = input;
|
|
230
|
-
const graph = space.graph();
|
|
231
|
-
const refs = space.refs;
|
|
232
|
-
const refResult = parseContractRef(optionsTo, {
|
|
233
|
-
graph,
|
|
234
|
-
refs
|
|
235
|
-
});
|
|
236
|
-
if (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));
|
|
237
|
-
const resolution = await resolveContractRef(refResult.value, space, {
|
|
238
|
-
explicitLabel: optionsTo,
|
|
239
|
-
artifactRole: "to"
|
|
240
|
-
});
|
|
241
|
-
if (!resolution.ok) return resolution;
|
|
242
|
-
const { hash, contract, contractJson, contractDts } = resolution.value;
|
|
243
|
-
return ok({
|
|
244
|
-
hash,
|
|
245
|
-
contract,
|
|
246
|
-
contractJson,
|
|
247
|
-
contractDts
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Policy core of `migration plan`: resolves from/to contracts, runs the planner legs, and writes the planned migration packages.
|
|
252
|
-
*/
|
|
253
|
-
function isEnoent(error) {
|
|
254
|
-
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
255
|
-
}
|
|
256
|
-
async function runPlannerLeg(planner, migrations, frameworkComponents, contract, fromContract, spaceId, ownership, snapshotsImportPath, resolveImportSpecifier) {
|
|
257
|
-
const fromSchema = migrations.contractToSchema(fromContract, frameworkComponents);
|
|
258
|
-
const plannerResult = planner.plan({
|
|
259
|
-
contract,
|
|
260
|
-
schema: fromSchema,
|
|
261
|
-
policy: { allowedOperationClasses: [
|
|
262
|
-
"additive",
|
|
263
|
-
"widening",
|
|
264
|
-
"destructive",
|
|
265
|
-
"data"
|
|
266
|
-
] },
|
|
267
|
-
fromContract,
|
|
268
|
-
frameworkComponents,
|
|
269
|
-
spaceId,
|
|
270
|
-
ownership,
|
|
271
|
-
snapshotsImportPath
|
|
272
|
-
});
|
|
273
|
-
if (plannerResult.kind === "failure") return notOk(errorMigrationPlanningFailed({ conflicts: castAs(plannerResult.conflicts) }));
|
|
274
|
-
let plannedOps = [];
|
|
275
|
-
let hasPlaceholders = false;
|
|
276
|
-
try {
|
|
277
|
-
plannedOps = await Promise.all(plannerResult.plan.operations);
|
|
278
|
-
if (plannedOps.length === 0) return notOk(errorMigrationPlanningFailed({ conflicts: [{
|
|
279
|
-
kind: "unsupportedChange",
|
|
280
|
-
summary: "Contract changed but planner produced no operations. This indicates unsupported or ignored changes."
|
|
281
|
-
}] }));
|
|
282
|
-
} catch (e) {
|
|
283
|
-
if (CliStructuredError$1.is(e) && e.code === "MIGRATION.UNFILLED_PLACEHOLDER") hasPlaceholders = true;
|
|
284
|
-
else throw e;
|
|
285
|
-
}
|
|
286
|
-
return ok({
|
|
287
|
-
plannedOps,
|
|
288
|
-
migrationTsContent: plannerResult.plan.renderTypeScript(resolveImportSpecifier),
|
|
289
|
-
hasPlaceholders
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
async function writePlannedMigrationPackage(packageDir, fromHash, toHash, createdAt, leg) {
|
|
293
|
-
const opsForWrite = leg.hasPlaceholders ? [] : leg.plannedOps;
|
|
294
|
-
const metadataWithInvariants = {
|
|
295
|
-
from: fromHash,
|
|
296
|
-
to: toHash,
|
|
297
|
-
providedInvariants: deriveProvidedInvariants(opsForWrite),
|
|
298
|
-
createdAt: createdAt.toISOString()
|
|
299
|
-
};
|
|
300
|
-
await writeMigrationPackage(packageDir, {
|
|
301
|
-
...metadataWithInvariants,
|
|
302
|
-
migrationHash: computeMigrationHash(metadataWithInvariants, opsForWrite)
|
|
303
|
-
}, opsForWrite);
|
|
304
|
-
await writeMigrationTs(packageDir, leg.migrationTsContent);
|
|
305
|
-
}
|
|
306
|
-
async function executeMigrationPlanCommand(options, startTime, callbacks) {
|
|
307
|
-
try {
|
|
308
|
-
return await executeMigrationPlanCommandInner(options, startTime, callbacks);
|
|
309
|
-
} catch (error) {
|
|
310
|
-
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
311
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
312
|
-
return notOk(errorUnexpected(message, { why: `Unexpected error during migration plan: ${message}` }));
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
async function executeMigrationPlanCommandInner(options, startTime, callbacks) {
|
|
316
|
-
const config = options.config;
|
|
317
|
-
const cwd = options.cwd;
|
|
318
|
-
const { configPath, migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.configPath, config, cwd);
|
|
319
|
-
const contractPathAbsolute = resolveContractPath(config);
|
|
320
|
-
const contractPath = relative(cwd, contractPathAbsolute);
|
|
321
|
-
callbacks?.onContextResolved?.({
|
|
322
|
-
configPath,
|
|
323
|
-
contractPath,
|
|
324
|
-
appMigrationsRelative
|
|
325
|
-
});
|
|
326
|
-
let contractJsonContent;
|
|
327
|
-
try {
|
|
328
|
-
contractJsonContent = await readFile(contractPathAbsolute, "utf-8");
|
|
329
|
-
} catch (error) {
|
|
330
|
-
if (isEnoent(error)) return notOk(errorFileNotFound(contractPathAbsolute, {
|
|
331
|
-
why: `Contract file not found at ${contractPathAbsolute}`,
|
|
332
|
-
fix: `Run \`prisma-next contract emit\` to generate ${contractPath}, or update \`config.contract.output\` in ${configPath}`
|
|
333
|
-
}));
|
|
334
|
-
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` }));
|
|
335
|
-
}
|
|
336
|
-
const stack = createControlStack(config);
|
|
337
|
-
const familyInstance = config.family.create(stack);
|
|
338
|
-
const controlAdapter = config.adapter.create(stack);
|
|
339
|
-
let toContract;
|
|
340
|
-
try {
|
|
341
|
-
toContract = familyInstance.deserializeContract(castAs(JSON.parse(contractJsonContent)));
|
|
342
|
-
} catch (error) {
|
|
343
|
-
return notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));
|
|
344
|
-
}
|
|
345
|
-
const rawStorageHash = toContract.storage?.storageHash;
|
|
346
|
-
if (typeof rawStorageHash !== "string") return notOk(errorContractValidationFailed("Contract is missing storageHash", { where: { path: contractPathAbsolute } }));
|
|
347
|
-
let toStorageHash = rawStorageHash;
|
|
348
|
-
let toArtifacts = null;
|
|
349
|
-
let fromContract = null;
|
|
350
|
-
let fromHash = null;
|
|
351
|
-
let snapshotStartContract = null;
|
|
352
|
-
let isAutoBaseline = false;
|
|
353
|
-
const tolerantAggregateResult = await loadContractSpaceAggregateForCli({
|
|
354
|
-
targetId: config.target.targetId,
|
|
355
|
-
migrationsDir,
|
|
356
|
-
appContract: toContract,
|
|
357
|
-
extensions: config.extensions ?? [],
|
|
358
|
-
deserializeContract: (json) => familyInstance.deserializeContract(json)
|
|
359
|
-
});
|
|
360
|
-
if (!tolerantAggregateResult.ok) return notOk(tolerantAggregateResult.failure);
|
|
361
|
-
const resolutionSpace = tolerantAggregateResult.value.app;
|
|
362
|
-
const resolutionResult = await resolveFromForPlan({
|
|
363
|
-
optionsFrom: options.from,
|
|
364
|
-
space: resolutionSpace
|
|
365
|
-
});
|
|
366
|
-
if (!resolutionResult.ok) return notOk(resolutionResult.failure);
|
|
367
|
-
switch (resolutionResult.value.kind) {
|
|
368
|
-
case "greenfield": break;
|
|
369
|
-
case "graph-node":
|
|
370
|
-
fromHash = resolutionResult.value.fromHash;
|
|
371
|
-
fromContract = resolutionResult.value.fromContract;
|
|
372
|
-
break;
|
|
373
|
-
case "ref":
|
|
374
|
-
fromHash = resolutionResult.value.fromHash;
|
|
375
|
-
fromContract = resolutionResult.value.fromContract;
|
|
376
|
-
snapshotStartContract = {
|
|
377
|
-
fromHash: resolutionResult.value.fromHash,
|
|
378
|
-
contractJson: resolutionResult.value.contractJson,
|
|
379
|
-
contractDts: resolutionResult.value.contractDts
|
|
380
|
-
};
|
|
381
|
-
break;
|
|
382
|
-
case "auto-baseline":
|
|
383
|
-
fromHash = resolutionResult.value.fromHash;
|
|
384
|
-
fromContract = resolutionResult.value.fromContract;
|
|
385
|
-
snapshotStartContract = {
|
|
386
|
-
fromHash: resolutionResult.value.fromHash,
|
|
387
|
-
contractJson: resolutionResult.value.contractJson,
|
|
388
|
-
contractDts: resolutionResult.value.contractDts
|
|
389
|
-
};
|
|
390
|
-
isAutoBaseline = true;
|
|
391
|
-
break;
|
|
392
|
-
}
|
|
393
|
-
if (options.to !== void 0) {
|
|
394
|
-
const toResolution = await resolveToForPlan(options.to, { space: resolutionSpace });
|
|
395
|
-
if (!toResolution.ok) return notOk(toResolution.failure);
|
|
396
|
-
toContract = toResolution.value.contract;
|
|
397
|
-
toStorageHash = toResolution.value.hash;
|
|
398
|
-
toArtifacts = {
|
|
399
|
-
contractJson: toResolution.value.contractJson,
|
|
400
|
-
contractDts: toResolution.value.contractDts
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
const resolveImportSpecifier = createProjectSpecifierResolver(options.configPath);
|
|
404
|
-
const seedResult = await runContractSpaceSeedPhase({
|
|
405
|
-
migrationsDir,
|
|
406
|
-
extensions: toExtensionInputs(config.extensions ?? [])
|
|
407
|
-
});
|
|
408
|
-
for (const record of seedResult.seeded) callbacks?.onSeeded?.(record);
|
|
409
|
-
const emittedExtensionDirs = seedResult.seeded.flatMap((r) => r.newMigrationDirs.map((dirName) => ({
|
|
410
|
-
spaceId: r.spaceId,
|
|
411
|
-
dirName
|
|
412
|
-
})));
|
|
413
|
-
if (fromHash === toStorageHash && !isAutoBaseline) return ok({
|
|
414
|
-
ok: true,
|
|
415
|
-
noOp: true,
|
|
416
|
-
from: fromHash,
|
|
417
|
-
to: toStorageHash,
|
|
418
|
-
operations: [],
|
|
419
|
-
emittedExtensionDirs,
|
|
420
|
-
summary: "No changes detected between contracts",
|
|
421
|
-
timings: { total: Date.now() - startTime }
|
|
422
|
-
});
|
|
423
|
-
const migrations = getTargetMigrations(config.target);
|
|
424
|
-
if (!migrations) return notOk(errorTargetMigrationNotSupported({ why: `Target "${config.target.id}" does not support migrations` }));
|
|
425
|
-
const aggregateResult = await buildContractSpaceAggregate({
|
|
426
|
-
targetId: config.target.targetId,
|
|
427
|
-
migrationsDir,
|
|
428
|
-
appContract: toContract,
|
|
429
|
-
extensions: config.extensions ?? [],
|
|
430
|
-
deserializeContract: (json) => familyInstance.deserializeContract(json)
|
|
431
|
-
});
|
|
432
|
-
if (!aggregateResult.ok) return notOk(aggregateResult.failure);
|
|
433
|
-
const aggregate = aggregateResult.value;
|
|
434
|
-
const frameworkComponents = assertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [
|
|
435
|
-
config.target,
|
|
436
|
-
config.adapter,
|
|
437
|
-
...config.extensions ?? []
|
|
438
|
-
]);
|
|
439
|
-
async function writeDestinationSnapshot(destHash) {
|
|
440
|
-
if (toArtifacts !== null) {
|
|
441
|
-
await writeContractSnapshot(migrationsDir, destHash, {
|
|
442
|
-
contractJson: toArtifacts.contractJson,
|
|
443
|
-
contractDts: toArtifacts.contractDts
|
|
444
|
-
});
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
const destinationArtifacts = getEmittedArtifactPaths(contractPathAbsolute);
|
|
448
|
-
const [contractJsonRaw, contractDts] = await Promise.all([readFile(destinationArtifacts.jsonPath, "utf-8"), readFile(destinationArtifacts.dtsPath, "utf-8")]);
|
|
449
|
-
await writeContractSnapshot(migrationsDir, destHash, {
|
|
450
|
-
contractJson: castAs(JSON.parse(contractJsonRaw)),
|
|
451
|
-
contractDts
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
try {
|
|
455
|
-
const planner = migrations.createPlanner(controlAdapter);
|
|
456
|
-
if (isAutoBaseline && fromHash !== null && fromContract !== null && snapshotStartContract !== null) {
|
|
457
|
-
const baselineTimestamp = /* @__PURE__ */ new Date();
|
|
458
|
-
const deltaTimestamp = new Date(baselineTimestamp.getTime() + 6e4);
|
|
459
|
-
const baselineDirName = formatMigrationDirName(baselineTimestamp, "baseline");
|
|
460
|
-
const deltaDirName = formatMigrationDirName(deltaTimestamp, options.name ?? "migration");
|
|
461
|
-
const baselinePackageDir = join(appMigrationsDir, baselineDirName);
|
|
462
|
-
const deltaPackageDir = join(appMigrationsDir, deltaDirName);
|
|
463
|
-
const baselineLeg = await runPlannerLeg(planner, migrations, frameworkComponents, fromContract, null, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(baselinePackageDir, migrationsDir), resolveImportSpecifier);
|
|
464
|
-
if (!baselineLeg.ok) return notOk(baselineLeg.failure);
|
|
465
|
-
await writePlannedMigrationPackage(baselinePackageDir, null, fromHash, baselineTimestamp, baselineLeg.value);
|
|
466
|
-
await writeContractSnapshot(migrationsDir, fromHash, {
|
|
467
|
-
contractJson: snapshotStartContract.contractJson,
|
|
468
|
-
contractDts: snapshotStartContract.contractDts
|
|
469
|
-
});
|
|
470
|
-
if (fromHash === toStorageHash) {
|
|
471
|
-
const baselineOps = baselineLeg.value.hasPlaceholders ? [] : baselineLeg.value.plannedOps;
|
|
472
|
-
if (baselineLeg.value.hasPlaceholders) {
|
|
473
|
-
const baselineDir = relative(cwd, baselinePackageDir);
|
|
474
|
-
return ok({
|
|
475
|
-
ok: true,
|
|
476
|
-
noOp: false,
|
|
477
|
-
from: fromHash,
|
|
478
|
-
to: toStorageHash,
|
|
479
|
-
dir: baselineDir,
|
|
480
|
-
baselineDir,
|
|
481
|
-
operations: [],
|
|
482
|
-
emittedExtensionDirs,
|
|
483
|
-
pendingPlaceholders: true,
|
|
484
|
-
summary: "Planned baseline with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
485
|
-
timings: { total: Date.now() - startTime }
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(baselineOps) : void 0;
|
|
489
|
-
return ok({
|
|
490
|
-
ok: true,
|
|
491
|
-
noOp: false,
|
|
492
|
-
from: fromHash,
|
|
493
|
-
to: toStorageHash,
|
|
494
|
-
baselineDir: relative(cwd, baselinePackageDir),
|
|
495
|
-
operations: baselineOps.map((op) => ({
|
|
496
|
-
id: op.id,
|
|
497
|
-
label: op.label,
|
|
498
|
-
operationClass: op.operationClass
|
|
499
|
-
})),
|
|
500
|
-
emittedExtensionDirs,
|
|
501
|
-
...preview !== void 0 ? { preview } : {},
|
|
502
|
-
summary: buildAutoBaselinePlanSummary(0, emittedExtensionDirs.length),
|
|
503
|
-
timings: { total: Date.now() - startTime }
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
const deltaLeg = await runPlannerLeg(planner, migrations, frameworkComponents, aggregate.app.contract(), fromContract, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(deltaPackageDir, migrationsDir), resolveImportSpecifier);
|
|
507
|
-
if (!deltaLeg.ok) return notOk(deltaLeg.failure);
|
|
508
|
-
await writePlannedMigrationPackage(deltaPackageDir, fromHash, toStorageHash, deltaTimestamp, deltaLeg.value);
|
|
509
|
-
await writeDestinationSnapshot(toStorageHash);
|
|
510
|
-
await writeContractSnapshot(migrationsDir, fromHash, {
|
|
511
|
-
contractJson: snapshotStartContract.contractJson,
|
|
512
|
-
contractDts: snapshotStartContract.contractDts
|
|
513
|
-
});
|
|
514
|
-
const deltaOps = deltaLeg.value.hasPlaceholders ? [] : deltaLeg.value.plannedOps;
|
|
515
|
-
if (deltaLeg.value.hasPlaceholders) return ok({
|
|
516
|
-
ok: true,
|
|
517
|
-
noOp: false,
|
|
518
|
-
from: fromHash,
|
|
519
|
-
to: toStorageHash,
|
|
520
|
-
dir: relative(cwd, deltaPackageDir),
|
|
521
|
-
baselineDir: relative(cwd, baselinePackageDir),
|
|
522
|
-
operations: [],
|
|
523
|
-
emittedExtensionDirs,
|
|
524
|
-
pendingPlaceholders: true,
|
|
525
|
-
summary: "Planned baseline + migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
526
|
-
timings: { total: Date.now() - startTime }
|
|
527
|
-
});
|
|
528
|
-
const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(deltaOps) : void 0;
|
|
529
|
-
return ok({
|
|
530
|
-
ok: true,
|
|
531
|
-
noOp: false,
|
|
532
|
-
from: fromHash,
|
|
533
|
-
to: toStorageHash,
|
|
534
|
-
dir: relative(cwd, deltaPackageDir),
|
|
535
|
-
baselineDir: relative(cwd, baselinePackageDir),
|
|
536
|
-
operations: deltaOps.map((op) => ({
|
|
537
|
-
id: op.id,
|
|
538
|
-
label: op.label,
|
|
539
|
-
operationClass: op.operationClass
|
|
540
|
-
})),
|
|
541
|
-
emittedExtensionDirs,
|
|
542
|
-
...preview !== void 0 ? { preview } : {},
|
|
543
|
-
summary: buildAutoBaselinePlanSummary(deltaOps.length, emittedExtensionDirs.length),
|
|
544
|
-
timings: { total: Date.now() - startTime }
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
const timestamp = /* @__PURE__ */ new Date();
|
|
548
|
-
const packageDir = join(appMigrationsDir, formatMigrationDirName(timestamp, options.name ?? "migration"));
|
|
549
|
-
const deltaLeg = await runPlannerLeg(planner, migrations, frameworkComponents, aggregate.app.contract(), fromContract, aggregate.app.spaceId, aggregate, snapshotsImportPathFrom(packageDir, migrationsDir), resolveImportSpecifier);
|
|
550
|
-
if (!deltaLeg.ok) return notOk(deltaLeg.failure);
|
|
551
|
-
await writePlannedMigrationPackage(packageDir, fromHash, toStorageHash, timestamp, deltaLeg.value);
|
|
552
|
-
await writeDestinationSnapshot(toStorageHash);
|
|
553
|
-
if (snapshotStartContract !== null) await writeContractSnapshot(migrationsDir, snapshotStartContract.fromHash, {
|
|
554
|
-
contractJson: snapshotStartContract.contractJson,
|
|
555
|
-
contractDts: snapshotStartContract.contractDts
|
|
556
|
-
});
|
|
557
|
-
if (deltaLeg.value.hasPlaceholders) return ok({
|
|
558
|
-
ok: true,
|
|
559
|
-
noOp: false,
|
|
560
|
-
from: fromHash,
|
|
561
|
-
to: toStorageHash,
|
|
562
|
-
dir: relative(cwd, packageDir),
|
|
563
|
-
operations: [],
|
|
564
|
-
emittedExtensionDirs,
|
|
565
|
-
pendingPlaceholders: true,
|
|
566
|
-
summary: "Planned migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit",
|
|
567
|
-
timings: { total: Date.now() - startTime }
|
|
568
|
-
});
|
|
569
|
-
const plannedOps = deltaLeg.value.plannedOps;
|
|
570
|
-
const preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(plannedOps) : void 0;
|
|
571
|
-
return ok({
|
|
572
|
-
ok: true,
|
|
573
|
-
noOp: false,
|
|
574
|
-
from: fromHash,
|
|
575
|
-
to: toStorageHash,
|
|
576
|
-
dir: relative(cwd, packageDir),
|
|
577
|
-
operations: plannedOps.map((op) => ({
|
|
578
|
-
id: op.id,
|
|
579
|
-
label: op.label,
|
|
580
|
-
operationClass: op.operationClass
|
|
581
|
-
})),
|
|
582
|
-
emittedExtensionDirs,
|
|
583
|
-
...preview !== void 0 ? { preview } : {},
|
|
584
|
-
summary: buildPlanSummary(plannedOps.length, emittedExtensionDirs.length),
|
|
585
|
-
timings: { total: Date.now() - startTime }
|
|
586
|
-
});
|
|
587
|
-
} catch (error) {
|
|
588
|
-
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
589
|
-
if (MigrationToolsError.is(error)) return notOk(error);
|
|
590
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
591
|
-
return notOk(errorUnexpected(message, { why: `Unexpected error during migration plan: ${message}` }));
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Compose the success-line summary so the cross-space side effect
|
|
596
|
-
* (extension-space migration packages materialised on disk during
|
|
597
|
-
* this `plan` run) is visible in the top line — not just in the
|
|
598
|
-
* step log above it.
|
|
599
|
-
*
|
|
600
|
-
* Example outputs:
|
|
601
|
-
* - `Planned 3 operation(s)` (app-space-only project)
|
|
602
|
-
* - `Planned 3 operation(s); materialised 1 extension-space migration` (one extension)
|
|
603
|
-
* - `Planned 3 operation(s); materialised 2 extension-space migrations` (two extensions)
|
|
604
|
-
*
|
|
605
|
-
* Locks AC3 at the summary-line level: a reader of the success line
|
|
606
|
-
* can tell that something happened beyond the app space.
|
|
607
|
-
*/
|
|
608
|
-
function buildPlanSummary(plannedOpsCount, emittedExtensionDirsCount) {
|
|
609
|
-
const base = `Planned ${plannedOpsCount} operation(s)`;
|
|
610
|
-
if (emittedExtensionDirsCount === 0) return base;
|
|
611
|
-
return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
|
|
612
|
-
}
|
|
613
|
-
function buildAutoBaselinePlanSummary(deltaOpsCount, emittedExtensionDirsCount) {
|
|
614
|
-
const base = `Planned baseline + ${deltaOpsCount} operation(s)`;
|
|
615
|
-
if (emittedExtensionDirsCount === 0) return base;
|
|
616
|
-
return `${base}; materialised ${emittedExtensionDirsCount} ${emittedExtensionDirsCount === 1 ? "extension-space migration" : "extension-space migrations"}`;
|
|
617
|
-
}
|
|
618
|
-
//#endregion
|
|
619
|
-
export { runContractSpaceSeedPhase as i, resolveFromForPlan as n, resolveToForPlan as r, executeMigrationPlanCommand as t };
|
|
620
|
-
|
|
621
|
-
//# sourceMappingURL=migration-plan-Cfz0efEL-DMNFq5b2.mjs.map
|