@prisma/orm-toolchain 8.0.0-rc.1-dev.6 → 8.0.0-rc.1-dev.8

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.
Files changed (200) hide show
  1. package/dist/{aggregate-i-rfetSO.mjs → aggregate-D53gnb7v.mjs} +8 -8
  2. package/dist/{aggregate-i-rfetSO.mjs.map → aggregate-D53gnb7v.mjs.map} +1 -1
  3. package/dist/bin__prisma-next.mjs +22 -22
  4. package/dist/bin__prisma-next.mjs.map +1 -1
  5. package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs +14 -0
  6. package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs.map +1 -0
  7. package/dist/{types-2n_H3DQ9-Bks8UPEO.d.mts → cli-errors-CDr3WcJP-NFry5GHb.d.mts} +2 -2
  8. package/dist/cli-errors-CDr3WcJP-NFry5GHb.d.mts.map +1 -0
  9. package/dist/cli.mjs +2 -2
  10. package/dist/cli__commands__contract-emit.mjs +1 -1
  11. package/dist/cli__commands__contract-infer.mjs +1 -1
  12. package/dist/cli__commands__db-init.mjs +1 -1
  13. package/dist/cli__commands__db-schema.mjs +1 -1
  14. package/dist/cli__commands__db-sign.mjs +1 -1
  15. package/dist/cli__commands__db-update.mjs +1 -1
  16. package/dist/cli__commands__db-verify.mjs +1 -1
  17. package/dist/cli__commands__migrate.d.mts +3 -12
  18. package/dist/cli__commands__migrate.d.mts.map +1 -1
  19. package/dist/cli__commands__migrate.mjs +1 -1
  20. package/dist/cli__commands__migration-check.d.mts +1 -57
  21. package/dist/cli__commands__migration-check.d.mts.map +1 -1
  22. package/dist/cli__commands__migration-check.mjs +2 -2
  23. package/dist/cli__commands__migration-graph.d.mts +1 -1
  24. package/dist/cli__commands__migration-graph.mjs +1 -1
  25. package/dist/cli__commands__migration-list.d.mts +4 -44
  26. package/dist/cli__commands__migration-list.d.mts.map +1 -1
  27. package/dist/cli__commands__migration-list.mjs +2 -2
  28. package/dist/cli__commands__migration-log.d.mts +1 -1
  29. package/dist/cli__commands__migration-log.mjs +1 -1
  30. package/dist/cli__commands__migration-new.mjs +1 -1
  31. package/dist/cli__commands__migration-plan.d.mts +2 -47
  32. package/dist/cli__commands__migration-plan.d.mts.map +1 -1
  33. package/dist/cli__commands__migration-plan.mjs +1 -1
  34. package/dist/cli__commands__migration-show.mjs +1 -1
  35. package/dist/cli__commands__migration-status.d.mts +1 -1
  36. package/dist/cli__commands__migration-status.mjs +1 -1
  37. package/dist/cli__commands__ref.d.mts +1 -28
  38. package/dist/cli__commands__ref.d.mts.map +1 -1
  39. package/dist/cli__commands__ref.mjs +2 -2
  40. package/dist/cli__commands__telemetry.mjs +1 -1
  41. package/dist/cli__control-api.d.mts +502 -2
  42. package/dist/cli__control-api.d.mts.map +1 -1
  43. package/dist/cli__control-api.mjs +18 -3
  44. package/dist/cli__migration-cli.mjs +2 -2
  45. package/dist/{client-7aUYC7ci-Bh9mLxkl.mjs → client-Y6qbDk7X-BzKLmBZo.mjs} +8 -8
  46. package/dist/{client-7aUYC7ci-Bh9mLxkl.mjs.map → client-Y6qbDk7X-BzKLmBZo.mjs.map} +1 -1
  47. package/dist/{command-helpers-C4WpR-QE-CK2gkj6l.mjs → command-helpers-C4WpR-QE-DE494TSG.mjs} +2 -2
  48. package/dist/{command-helpers-C4WpR-QE-CK2gkj6l.mjs.map → command-helpers-C4WpR-QE-DE494TSG.mjs.map} +1 -1
  49. package/dist/config-loader.d.mts +2 -18
  50. package/dist/{contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs → contract-at-errors-Dv1mxKYO-C29YB4RC.mjs} +4 -4
  51. package/dist/contract-at-errors-Dv1mxKYO-C29YB4RC.mjs.map +1 -0
  52. package/dist/{contract-emit-CTm2zfuG-8mtkxW8M.mjs → contract-emit-CTm2zfuG-7PV9SBY6.mjs} +4 -4
  53. package/dist/{contract-emit-CTm2zfuG-8mtkxW8M.mjs.map → contract-emit-CTm2zfuG-7PV9SBY6.mjs.map} +1 -1
  54. package/dist/{contract-emit-D8IXP9Qp-CecAQio1.mjs → contract-emit-D8IXP9Qp-Df6NwXn8.mjs} +3 -3
  55. package/dist/{contract-emit-D8IXP9Qp-CecAQio1.mjs.map → contract-emit-D8IXP9Qp-Df6NwXn8.mjs.map} +1 -1
  56. package/dist/{contract-infer-C8-RqHeK-D_dm3onP.mjs → contract-infer-BwT7ngoo-Dx6aAwIN.mjs} +4 -4
  57. package/dist/{contract-infer-C8-RqHeK-D_dm3onP.mjs.map → contract-infer-BwT7ngoo-Dx6aAwIN.mjs.map} +1 -1
  58. package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs +82 -0
  59. package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs.map +1 -0
  60. package/dist/{contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs → contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs} +3 -3
  61. package/dist/{contract-snapshot-store-DNTOE6fB-BDpjbdCJ.mjs.map → contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs.map} +1 -1
  62. package/dist/{contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs → contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs} +6 -6
  63. package/dist/contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs.map +1 -0
  64. package/dist/{db-init-CXMcvoIA.mjs → db-init-CBj_EWg3.mjs} +15 -26
  65. package/dist/db-init-CBj_EWg3.mjs.map +1 -0
  66. package/dist/{db-schema-j8DERh4t.mjs → db-schema-BWpeh0Q_.mjs} +4 -4
  67. package/dist/{db-schema-j8DERh4t.mjs.map → db-schema-BWpeh0Q_.mjs.map} +1 -1
  68. package/dist/{db-sign-xV_rpoIc.mjs → db-sign-DCb_DKtv.mjs} +13 -29
  69. package/dist/db-sign-DCb_DKtv.mjs.map +1 -0
  70. package/dist/{db-update-DXa2DIvu.mjs → db-update-WX0KitcX.mjs} +27 -50
  71. package/dist/db-update-WX0KitcX.mjs.map +1 -0
  72. package/dist/{db-verify-YWHjuKC7-DidK1gx1.mjs → db-verify-B8ax2Y_x-Bp4s5Ra6.mjs} +5 -5
  73. package/dist/{db-verify-YWHjuKC7-DidK1gx1.mjs.map → db-verify-B8ax2Y_x-Bp4s5Ra6.mjs.map} +1 -1
  74. package/dist/{errors-BwusfLIN-BXM7K-ww.mjs → errors-Co-8oaiB-CB-6Uqki.mjs} +5 -4
  75. package/dist/{errors-BwusfLIN-BXM7K-ww.mjs.map → errors-Co-8oaiB-CB-6Uqki.mjs.map} +1 -1
  76. package/dist/{errors-AkMBj-YP.d.mts → errors-NRmFpwR1.d.mts} +6 -2
  77. package/dist/errors-NRmFpwR1.d.mts.map +1 -0
  78. package/dist/{format-Bw3LVJ1v-D10inUT9.mjs → format-Bw3LVJ1v-BJ6lVFMA.mjs} +2 -2
  79. package/dist/{format-Bw3LVJ1v-D10inUT9.mjs.map → format-Bw3LVJ1v-BJ6lVFMA.mjs.map} +1 -1
  80. package/dist/{framework-components-3DdB31mk-BPGSuOyZ.mjs → framework-components-3DdB31mk-BHyX-OlJ.mjs} +2 -2
  81. package/dist/{framework-components-3DdB31mk-BPGSuOyZ.mjs.map → framework-components-3DdB31mk-BHyX-OlJ.mjs.map} +1 -1
  82. package/dist/{graph-membership-h9ejuZla-ewjYM5wz.mjs → graph-membership-BEmNEMtP-rz61CLM5.mjs} +3 -3
  83. package/dist/{graph-membership-h9ejuZla-ewjYM5wz.mjs.map → graph-membership-BEmNEMtP-rz61CLM5.mjs.map} +1 -1
  84. package/dist/index-Df9igRvP.d.mts +18 -0
  85. package/dist/index-Df9igRvP.d.mts.map +1 -0
  86. package/dist/{init-CPB89WK2-Di4kgP6B.mjs → init-CPB89WK2-DPZRZ9Ee.mjs} +3 -3
  87. package/dist/{init-CPB89WK2-Di4kgP6B.mjs.map → init-CPB89WK2-DPZRZ9Ee.mjs.map} +1 -1
  88. package/dist/{inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs → inspect-live-schema-Da76TWOs-CAFqkhGb.mjs} +4 -4
  89. package/dist/{inspect-live-schema-DEYE4EHW-DmSfKdpv.mjs.map → inspect-live-schema-Da76TWOs-CAFqkhGb.mjs.map} +1 -1
  90. package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs +52 -0
  91. package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs.map +1 -0
  92. package/dist/{invariants-CMcQxRas-CXX9uhQW.mjs → invariants-C1WVUAH7-DlOBTTkM.mjs} +3 -3
  93. package/dist/{invariants-CMcQxRas-CXX9uhQW.mjs.map → invariants-C1WVUAH7-DlOBTTkM.mjs.map} +1 -1
  94. package/dist/{io-CL3hSv42-DGZtTs89.mjs → io-CHUUeHh0-CoCBe9eN.mjs} +5 -5
  95. package/dist/{io-CL3hSv42-DGZtTs89.mjs.map → io-CHUUeHh0-CoCBe9eN.mjs.map} +1 -1
  96. package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs +22 -0
  97. package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs.map +1 -0
  98. package/dist/{migrate-COusRrm7.mjs → migrate-B-NAuO90.mjs} +87 -230
  99. package/dist/migrate-B-NAuO90.mjs.map +1 -0
  100. package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts +56 -0
  101. package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts.map +1 -0
  102. package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs +202 -0
  103. package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs.map +1 -0
  104. package/dist/{migration-diUAhNaa.mjs → migration-DAJY-NmR.mjs} +3 -3
  105. package/dist/{migration-diUAhNaa.mjs.map → migration-DAJY-NmR.mjs.map} +1 -1
  106. package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs +254 -0
  107. package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs.map +1 -0
  108. package/dist/{migration-check-CueEJelQ-J81XR_ns.mjs → migration-check-DONPyXff-CGTUpLv-.mjs} +12 -254
  109. package/dist/migration-check-DONPyXff-CGTUpLv-.mjs.map +1 -0
  110. package/dist/{migration-command-scaffold-DNRo4exb-9JCezdoT.mjs → migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs} +4 -4
  111. package/dist/{migration-command-scaffold-DNRo4exb-9JCezdoT.mjs.map → migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs.map} +1 -1
  112. package/dist/{migration-graph-D6bN-mX0-DwMWY8DA.mjs → migration-graph-DDaOHo10-yJFAbKCu.mjs} +3 -3
  113. package/dist/{migration-graph-D6bN-mX0-DwMWY8DA.mjs.map → migration-graph-DDaOHo10-yJFAbKCu.mjs.map} +1 -1
  114. package/dist/{migration-graph-BL6vfLcE.mjs → migration-graph-Dn469b0l.mjs} +10 -19
  115. package/dist/migration-graph-Dn469b0l.mjs.map +1 -0
  116. package/dist/migration-graph-HKch1Xk4-DyWhXtjZ.mjs +35 -0
  117. package/dist/migration-graph-HKch1Xk4-DyWhXtjZ.mjs.map +1 -0
  118. package/dist/migration-list-C9OPCMt--C28yBgVr.mjs +102 -0
  119. package/dist/migration-list-C9OPCMt--C28yBgVr.mjs.map +1 -0
  120. package/dist/migration-list-jk4iCtmO.mjs +120 -0
  121. package/dist/migration-list-jk4iCtmO.mjs.map +1 -0
  122. package/dist/{migration-log-BXbz6-Lj-CKHbat5f.mjs → migration-log-DQzUBrm8-D3m9wcuf.mjs} +7 -5
  123. package/dist/migration-log-DQzUBrm8-D3m9wcuf.mjs.map +1 -0
  124. package/dist/migration-new-BkSY6m0t.mjs +50 -0
  125. package/dist/migration-new-BkSY6m0t.mjs.map +1 -0
  126. package/dist/{migration-new-szZFsA3C.mjs → migration-new-g98oB3nC-BcrkxAAt.mjs} +12 -52
  127. package/dist/migration-new-g98oB3nC-BcrkxAAt.mjs.map +1 -0
  128. package/dist/{migration-path-target-BPYp3LNc-qRQlG_Yn.mjs → migration-path-target-BPYp3LNc-DsDdLU0J.mjs} +2 -2
  129. package/dist/{migration-path-target-BPYp3LNc-qRQlG_Yn.mjs.map → migration-path-target-BPYp3LNc-DsDdLU0J.mjs.map} +1 -1
  130. package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts +159 -0
  131. package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts.map +1 -0
  132. package/dist/migration-plan-CjIYMJZy.mjs +172 -0
  133. package/dist/migration-plan-CjIYMJZy.mjs.map +1 -0
  134. package/dist/{migration-plan-CxXAXYc8-Dnp-v8Nl.mjs → migration-plan-CwuZLXVE-DAJ-JUQT.mjs} +45 -183
  135. package/dist/migration-plan-CwuZLXVE-DAJ-JUQT.mjs.map +1 -0
  136. package/dist/{migration-show-BKsIh7Uz.mjs → migration-show-CW6EKtfw.mjs} +13 -9
  137. package/dist/migration-show-CW6EKtfw.mjs.map +1 -0
  138. package/dist/{migration-status-CNnRInne--cvmx56T.mjs → migration-status-DSQcBhiN.mjs} +37 -68
  139. package/dist/migration-status-DSQcBhiN.mjs.map +1 -0
  140. package/dist/migration-tools.d.mts +4 -4
  141. package/dist/migration-tools.mjs +13 -13
  142. package/dist/migration-tools__aggregate.mjs +1 -1
  143. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  144. package/dist/migration-tools__errors.d.mts +2 -2
  145. package/dist/migration-tools__errors.mjs +2 -2
  146. package/dist/migration-tools__invariants.mjs +1 -1
  147. package/dist/migration-tools__io.mjs +1 -1
  148. package/dist/migration-tools__migration-graph.mjs +2 -2
  149. package/dist/migration-tools__migration.mjs +1 -1
  150. package/dist/migration-tools__ref-resolution.mjs +1 -1
  151. package/dist/migration-tools__refs.mjs +1 -1
  152. package/dist/migration-tools__spaces.mjs +2 -2
  153. package/dist/{project-import-root-C_bd0ooL-CLXW-gp6.mjs → project-import-root-C_bd0ooL-WkbJLnAA.mjs} +2 -2
  154. package/dist/{project-import-root-C_bd0ooL-CLXW-gp6.mjs.map → project-import-root-C_bd0ooL-WkbJLnAA.mjs.map} +1 -1
  155. package/dist/ref-DSAZime8.mjs +72 -0
  156. package/dist/ref-DSAZime8.mjs.map +1 -0
  157. package/dist/ref-advancement-DaZBzm7m-BZQtedYC.mjs +96 -0
  158. package/dist/ref-advancement-DaZBzm7m-BZQtedYC.mjs.map +1 -0
  159. package/dist/ref-eJjxzYTh-CNiyDL4p.mjs +109 -0
  160. package/dist/ref-eJjxzYTh-CNiyDL4p.mjs.map +1 -0
  161. package/dist/{ref-resolution-BsdziDFA.mjs → ref-resolution-Ct2GMcNB.mjs} +2 -2
  162. package/dist/{ref-resolution-BsdziDFA.mjs.map → ref-resolution-Ct2GMcNB.mjs.map} +1 -1
  163. package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs +16 -0
  164. package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs.map +1 -0
  165. package/dist/{refs-DtoeUivZ-qay0UMSP.mjs → refs-B2BL8z3i-DGGFB7Mj.mjs} +3 -3
  166. package/dist/{refs-DtoeUivZ-qay0UMSP.mjs.map → refs-B2BL8z3i-DGGFB7Mj.mjs.map} +1 -1
  167. package/dist/refs-fQLFcMoq-UTlvnijY.mjs +47 -0
  168. package/dist/refs-fQLFcMoq-UTlvnijY.mjs.map +1 -0
  169. package/dist/{spaces-BNd2Tlk0.mjs → spaces-DxuvClN9.mjs} +6 -6
  170. package/dist/{spaces-BNd2Tlk0.mjs.map → spaces-DxuvClN9.mjs.map} +1 -1
  171. package/dist/{telemetry-DVBHDQd6-BEdoMii0.mjs → telemetry-DVBHDQd6-Ckn5oClN.mjs} +2 -2
  172. package/dist/{telemetry-DVBHDQd6-BEdoMii0.mjs.map → telemetry-DVBHDQd6-Ckn5oClN.mjs.map} +1 -1
  173. package/dist/{verify-C6L_hiJU-CN3eEe3Y.mjs → verify-C6L_hiJU-B4V3bqvG.mjs} +2 -2
  174. package/dist/{verify-C6L_hiJU-CN3eEe3Y.mjs.map → verify-C6L_hiJU-B4V3bqvG.mjs.map} +1 -1
  175. package/dist/{verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs → verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs} +4 -4
  176. package/dist/{verify-contract-spaces-Ak73-zQK-y4qVyu-y.mjs.map → verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs.map} +1 -1
  177. package/dist/vite-plugin-contract-emit.mjs +1 -1
  178. package/package.json +12 -12
  179. package/dist/config-loader.d.mts.map +0 -1
  180. package/dist/contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs.map +0 -1
  181. package/dist/contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs.map +0 -1
  182. package/dist/db-init-CXMcvoIA.mjs.map +0 -1
  183. package/dist/db-sign-xV_rpoIc.mjs.map +0 -1
  184. package/dist/db-update-DXa2DIvu.mjs.map +0 -1
  185. package/dist/errors-AkMBj-YP.d.mts.map +0 -1
  186. package/dist/migrate-COusRrm7.mjs.map +0 -1
  187. package/dist/migration-check-CueEJelQ-J81XR_ns.mjs.map +0 -1
  188. package/dist/migration-graph-BL6vfLcE.mjs.map +0 -1
  189. package/dist/migration-list-D2_JdzWC-MRHYYVQE.mjs +0 -228
  190. package/dist/migration-list-D2_JdzWC-MRHYYVQE.mjs.map +0 -1
  191. package/dist/migration-log-BXbz6-Lj-CKHbat5f.mjs.map +0 -1
  192. package/dist/migration-new-szZFsA3C.mjs.map +0 -1
  193. package/dist/migration-plan-CxXAXYc8-Dnp-v8Nl.mjs.map +0 -1
  194. package/dist/migration-show-BKsIh7Uz.mjs.map +0 -1
  195. package/dist/migration-status-CNnRInne--cvmx56T.mjs.map +0 -1
  196. package/dist/ref-DjZ5Y8ju.mjs +0 -171
  197. package/dist/ref-DjZ5Y8ju.mjs.map +0 -1
  198. package/dist/ref-advancement-CSPMoQs3-CPkL3IFF.mjs +0 -57
  199. package/dist/ref-advancement-CSPMoQs3-CPkL3IFF.mjs.map +0 -1
  200. package/dist/types-2n_H3DQ9-Bks8UPEO.d.mts.map +0 -1
@@ -1,18 +1,15 @@
1
- import { P as errorUnknownInvariant, t as MigrationToolsError } from "./errors-BwusfLIN-BXM7K-ww.mjs";
2
- import "./constants-CM-w38DQ-Cz_EXbOc.mjs";
3
- import { r as findLatestMigration } from "./migration-graph-D6bN-mX0-DwMWY8DA.mjs";
4
- import { D as errorRunnerFailed, N as errorUnexpected, O as errorRuntime$1, Q as maskConnectionUrl, R as formatMigrationApplyCommandOutput, S as errorPathUnreachable, W as formatStyledHeader, Z as mapRefResolutionError, d as errorContractValidationFailed, et as parseGlobalFlagsOrExit, f as errorDatabaseConnectionRequired, h as errorFileNotFound, i as collectDeclaredInvariants, it as resolveMigrationPaths, j as errorTargetMigrationNotSupported, lt as targetSupportsMigrations, m as errorDriverRequired, nt as requireLiveDatabase, o as createTerminalUI, ot as setCommandDescriptions, q as handleResult, r as addGlobalOptions, rt as resolveContractPath, st as setCommandExamples, t as CliStructuredError$1, y as errorMarkerMismatch } from "./command-helpers-C4WpR-QE-CK2gkj6l.mjs";
1
+ import { D as errorRunnerFailed, N as errorUnexpected, Q as maskConnectionUrl, R as formatMigrationApplyCommandOutput, S as errorPathUnreachable, W as formatStyledHeader, d as errorContractValidationFailed, et as parseGlobalFlagsOrExit, f as errorDatabaseConnectionRequired, h as errorFileNotFound, it as resolveMigrationPaths, j as errorTargetMigrationNotSupported, lt as targetSupportsMigrations, m as errorDriverRequired, o as createTerminalUI, ot as setCommandDescriptions, q as handleResult, r as addGlobalOptions, rt as resolveContractPath, st as setCommandExamples } from "./command-helpers-C4WpR-QE-DE494TSG.mjs";
5
2
  import { r as loadConfig } from "./exports-CDX9kZuw.mjs";
6
- import { n as isGraphNode } from "./graph-membership-h9ejuZla-ewjYM5wz.mjs";
7
- import { i as readRefs } from "./refs-DtoeUivZ-qay0UMSP.mjs";
8
- import { u as requireHeadRef } from "./aggregate-i-rfetSO.mjs";
9
- import { a as refuseContractSpaceIntegrity, i as loadContractSpaceAggregateForCli, n as buildReadAggregate, s as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-CziO_ZRW-DIoQOL0P.mjs";
10
- import { a as planSpacePath, t as createControlClient } from "./client-7aUYC7ci-Bh9mLxkl.mjs";
11
- import { i as readContractIR, r as executeRefAdvancement } from "./ref-advancement-CSPMoQs3-CPkL3IFF.mjs";
12
- import { n as parseContractRef } from "./ref-resolution-BsdziDFA.mjs";
13
- import { t as mapContractAtError } from "./contract-at-errors-YdCQ5OOk-okxG7Eaj.mjs";
3
+ import { a as readContractIR, t as advanceRefSafely } from "./ref-advancement-DaZBzm7m-BZQtedYC.mjs";
4
+ import { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs";
5
+ import { t as createControlClient } from "./client-Y6qbDk7X-BzKLmBZo.mjs";
6
+ import { t as mapContractAtError } from "./contract-at-errors-Dv1mxKYO-C29YB4RC.mjs";
7
+ import { t as resolveContractRef } from "./ref-resolution-_S4xTT2L-BE5zgO2W.mjs";
8
+ import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-BzYfO9IL-BXTvx0z9.mjs";
9
+ import { t as listRefsByContractHash } from "./migration-list-C9OPCMt--C28yBgVr.mjs";
14
10
  import { c as computeMaxDirNameWidth, d as highlightFromEdgeAnnotations, f as indentMigrationGraphTreeBlock, h as renderMigrationGraphCommand, i as buildMigrationGraphRows, r as buildGrid, s as computeLabelColumn, u as formatOnPathMigrationRow } from "./migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs";
15
- import { r as listRefsByContractHash } from "./migration-list-D2_JdzWC-MRHYYVQE.mjs";
11
+ import { t as mapCaughtMigrationError } from "./caught-errors-D7Qznyrm-BzYooF6H.mjs";
12
+ import { t as executeMigrateShowPlan } from "./migrate-show-B2LkXkoB-D1ZNl84C.mjs";
16
13
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
17
14
  import { notOk, ok } from "@prisma/orm-framework/utils/result";
18
15
  import { readFile } from "node:fs/promises";
@@ -20,205 +17,52 @@ import { createControlStack } from "@prisma/orm-framework/components/control";
20
17
  import { Command } from "commander";
21
18
  //#region ../../../1-framework/3-tooling/cli/dist/commands/migrate.mjs
22
19
  /**
23
- * Read-only preview of the migration path `migrate` will take.
24
- *
25
- * Computes the path through the SAME seam as `executeMigrate`:
26
- * - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
27
- * the full marker including `invariants` (not just `storageHash`).
28
- * - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,
29
- * which feeds `resolveRecordedPath()` with the same target hash, target invariants,
30
- * and current marker as the real apply path uses.
31
- *
32
- * Returns BEFORE any write boundary (`runMigration` / marker / DDL). No
33
- * DB state is mutated.
20
+ * Read-only preview of the migration path `migrate` will take. Delegates the
21
+ * path computation to {@link executeMigrateShowPlan} (the control-api core)
22
+ * and keeps only the styled header plus the Tier-3 graph rendering here.
34
23
  */
35
24
  async function executeMigrateShowCommand(options, flags, ui) {
36
- const config = await loadConfig(options.config);
37
- const { configPath, migrationsDir, migrationsRelative, refsDir } = resolveMigrationPaths(options.config, config);
38
- const dbConnection = options.db ?? config.db?.connection;
39
- const hasDriver = !!config.driver;
40
- const hasExplicitFrom = options.from !== void 0;
41
- if (!hasExplicitFrom) {
42
- const missingDb = requireLiveDatabase({
43
- dbConnection,
44
- hasDriver,
45
- why: "migrate --show needs a database connection to read the live marker (or pass --from <contract> for an offline preview)",
46
- retryCommand: "prisma-next migrate --show --from <contract>"
47
- });
48
- if (missingDb) return notOk(missingDb);
49
- }
50
- let allRefs = {};
51
- try {
52
- allRefs = await readRefs(refsDir);
53
- } catch (error) {
54
- if (MigrationToolsError.is(error)) return notOk(error);
55
- throw error;
56
- }
57
- const loaded = await buildReadAggregate(config, { migrationsDir });
58
- if (!loaded.ok) return notOk(loaded.failure);
59
- const { aggregate, contractHash } = loaded.value;
60
- const appGraph = aggregate.app.graph();
61
- let targetHash = contractHash;
62
- let refInvariants;
63
- if (options.to) {
64
- const toResult = parseContractRef(options.to, {
65
- graph: appGraph,
66
- refs: allRefs,
67
- contractHash
68
- });
69
- if (!toResult.ok) return notOk(mapRefResolutionError(toResult.failure));
70
- if (toResult.value.provenance.kind === "reserved-db") return notOk(errorDatabaseConnectionRequired({
71
- why: "@db is not valid as a --to target; it names the live database state, not a target contract.",
72
- commandName: "migrate --show"
73
- }));
74
- targetHash = toResult.value.hash;
75
- if (toResult.value.provenance.kind === "ref") {
76
- const refEntry = allRefs[toResult.value.provenance.refName];
77
- if (refEntry) refInvariants = refEntry.invariants;
78
- }
79
- }
80
- if (!flags.json && !flags.quiet) {
81
- const details = [{
82
- label: "config",
83
- value: configPath
84
- }, {
85
- label: "migrations",
86
- value: migrationsRelative
87
- }];
88
- if (dbConnection && !hasExplicitFrom) details.push({
89
- label: "database",
90
- value: maskConnectionUrl(String(dbConnection))
91
- });
92
- if (options.from) details.push({
93
- label: "from",
94
- value: options.from
95
- });
96
- if (options.to) details.push({
97
- label: "to",
98
- value: options.to
99
- });
100
- const header = formatStyledHeader({
101
- command: "migrate --show",
102
- description: "Preview the migration path migrate will take (read-only)",
103
- details,
104
- flags
105
- });
106
- ui.stderr(header);
107
- }
108
- const markerBySpace = /* @__PURE__ */ new Map();
109
- const allSpaces = [aggregate.app, ...aggregate.extensions];
110
- if (hasExplicitFrom) if (options.from === "@db") {
111
- const missingDb = requireLiveDatabase({
112
- dbConnection,
113
- hasDriver,
114
- why: "@db resolves to the live database marker and requires a --db connection",
115
- retryCommand: "prisma-next migrate --show --from @db --db $DATABASE_URL"
116
- });
117
- if (missingDb) return notOk(missingDb);
118
- } else {
119
- const fromResult = parseContractRef(options.from, {
120
- graph: appGraph,
121
- refs: allRefs,
122
- contractHash
123
- });
124
- if (!fromResult.ok) return notOk(mapRefResolutionError(fromResult.failure));
125
- if (fromResult.value.provenance.kind === "reserved-db") {
126
- const missingDb = requireLiveDatabase({
127
- dbConnection,
128
- hasDriver,
129
- why: "@db resolves to the live database marker and requires a --db connection"
130
- });
131
- if (missingDb) return notOk(missingDb);
132
- } else {
133
- const fromHash = fromResult.value.hash;
134
- const offlineMarker = fromHash === "empty" ? null : {
135
- storageHash: fromHash,
136
- invariants: []
137
- };
138
- markerBySpace.set(aggregate.app.spaceId, offlineMarker);
139
- }
140
- }
141
- const needsLiveMarker = !hasExplicitFrom || options.from === "@db";
142
- if (needsLiveMarker) {
143
- if (!dbConnection || !hasDriver) return notOk(errorDatabaseConnectionRequired({
144
- why: "A database connection is required to read the live marker for migrate --show",
145
- commandName: "migrate --show"
146
- }));
147
- const client = createControlClient({
148
- family: config.family,
149
- target: config.target,
150
- adapter: config.adapter,
151
- driver: config.driver,
152
- extensions: config.extensions ?? []
153
- });
154
- try {
155
- await client.connect(dbConnection);
156
- const allMarkers = await client.readAllMarkers();
157
- for (const space of allSpaces) {
158
- const marker = allMarkers.get(space.spaceId);
159
- markerBySpace.set(space.spaceId, marker ?? null);
25
+ const planResult = await executeMigrateShowPlan({
26
+ ...ifDefined("config", options.config),
27
+ ...ifDefined("db", options.db),
28
+ ...ifDefined("to", options.to),
29
+ ...ifDefined("from", options.from),
30
+ onPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {
31
+ if (!flags.json && !flags.quiet) {
32
+ const details = [{
33
+ label: "config",
34
+ value: configPath
35
+ }, {
36
+ label: "migrations",
37
+ value: migrationsRelative
38
+ }];
39
+ if (dbConnection && !hasExplicitFrom) details.push({
40
+ label: "database",
41
+ value: maskConnectionUrl(String(dbConnection))
42
+ });
43
+ if (options.from) details.push({
44
+ label: "from",
45
+ value: options.from
46
+ });
47
+ if (options.to) details.push({
48
+ label: "to",
49
+ value: options.to
50
+ });
51
+ const header = formatStyledHeader({
52
+ command: "migrate --show",
53
+ description: "Preview the migration path migrate will take (read-only)",
54
+ details,
55
+ flags
56
+ });
57
+ ui.stderr(header);
160
58
  }
161
- } catch (error) {
162
- if (CliStructuredError$1.is(error)) return notOk(error);
163
- return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read live DB marker: ${error instanceof Error ? error.message : String(error)}` }));
164
- } finally {
165
- await client.close();
166
59
  }
167
- }
168
- const canonicalOrderSpaces = [...aggregate.extensions, aggregate.app];
169
- const orderedMigrations = [];
170
- for (const space of canonicalOrderSpaces) {
171
- const isAppSpace = space.spaceId === aggregate.app.spaceId;
172
- const headRef = requireHeadRef(space);
173
- const outcome = planSpacePath({
174
- space,
175
- aggregate,
176
- targetHash: isAppSpace ? targetHash : headRef.hash,
177
- refInvariants: isAppSpace ? refInvariants : void 0,
178
- liveMarker: markerBySpace.get(space.spaceId) ?? null
179
- });
180
- if (outcome.kind === "at-head") continue;
181
- if (outcome.kind === "never-planned") return notOk(errorPathUnreachable({
182
- code: "MIGRATION_PATH_NOT_FOUND",
183
- summary: `No on-disk migrations for contract space "${outcome.spaceId}"`,
184
- why: `migrate is replay-only: space "${outcome.spaceId}" has no on-disk migrations but its head ref targets "${outcome.targetHash}".`,
185
- meta: {
186
- spaceId: outcome.spaceId,
187
- target: outcome.targetHash,
188
- kind: "neverPlanned"
189
- }
190
- }));
191
- if (outcome.kind === "unreachable") {
192
- const fromHash = outcome.liveMarker?.storageHash ?? "empty";
193
- return notOk(errorPathUnreachable({
194
- code: "MIGRATION_PATH_NOT_FOUND",
195
- summary: `No migration path from ${fromHash.slice(0, 14)} to ${outcome.targetHash.slice(0, 14)} in space "${outcome.spaceId}".`,
196
- why: `The migration graph has no path from the from-state to the target in space "${outcome.spaceId}".`,
197
- meta: {
198
- spaceId: outcome.spaceId,
199
- from: fromHash,
200
- to: outcome.targetHash
201
- }
202
- }));
203
- }
204
- if (outcome.kind === "unsatisfiable") return notOk(errorRuntime$1("MIGRATION.NO_INVARIANT_PATH", `Missing required invariants for space "${outcome.spaceId}"`, {
205
- why: `The path requires invariants not available on disk: ${outcome.missing.join(", ")}`,
206
- fix: "Add a migration on the path that runs `dataTransform({ invariantId: \"<id>\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.",
207
- meta: {
208
- spaceId: outcome.spaceId,
209
- missing: [...outcome.missing]
210
- }
211
- }));
212
- for (const edge of outcome.plan.migrationEdges) orderedMigrations.push({
213
- spaceId: space.spaceId,
214
- dirName: edge.dirName,
215
- migrationHash: edge.migrationHash,
216
- from: edge.from,
217
- to: edge.to
218
- });
219
- }
220
- const count = orderedMigrations.length;
221
- const summary = count === 0 ? "Already up to date — nothing to run" : `${count} migration${count === 1 ? "" : "s"} will run`;
60
+ });
61
+ if (!planResult.ok) return notOk(planResult.failure);
62
+ const plan = planResult.value;
63
+ const { aggregate, contractHash } = plan;
64
+ const orderedMigrations = plan.migrations;
65
+ const allSpaces = [aggregate.app, ...aggregate.extensions];
222
66
  let graphOutput;
223
67
  let runListDirNameWidth;
224
68
  let runListLeftPad;
@@ -249,13 +93,13 @@ async function executeMigrateShowCommand(options, flags, ui) {
249
93
  const showSpaceHeadings = allSpaces.length > 1;
250
94
  const sections = [];
251
95
  for (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {
252
- const liveMarkerHash = (markerBySpace.get(space.spaceId) ?? null)?.storageHash ?? "empty";
96
+ const liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);
253
97
  const tree = renderMigrationGraphCommand({
254
98
  grid,
255
99
  rowModel,
256
100
  contractHash,
257
101
  isAppSpace: isApp,
258
- ...needsLiveMarker ? { dbHash: liveMarkerHash } : {},
102
+ ...plan.usedLiveMarker ? { dbHash: liveMarkerHash } : {},
259
103
  refsByHash: listRefsByContractHash(space),
260
104
  edgeAnnotationsByHash: edgeAnnotations,
261
105
  colorize,
@@ -272,7 +116,7 @@ async function executeMigrateShowCommand(options, flags, ui) {
272
116
  return ok({
273
117
  ok: true,
274
118
  migrations: orderedMigrations,
275
- summary,
119
+ summary: plan.summary,
276
120
  ...graphOutput !== void 0 ? { graphOutput } : {},
277
121
  ...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},
278
122
  ...runListLeftPad !== void 0 ? { runListLeftPad } : {}
@@ -354,11 +198,11 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
354
198
  let refName;
355
199
  if (toArg) {
356
200
  const refs = aggregate.app.refs;
357
- const refResult = parseContractRef(toArg, {
201
+ const refResult = resolveContractRef(toArg, {
358
202
  graph: aggregate.app.graph(),
359
203
  refs
360
204
  });
361
- if (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));
205
+ if (!refResult.ok) return notOk(refResult.failure);
362
206
  if (refResult.value.provenance.kind === "ref") {
363
207
  refName = refResult.value.provenance.refName;
364
208
  const resolved = refs[refName];
@@ -404,17 +248,21 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
404
248
  try {
405
249
  await client.connect(dbConnection);
406
250
  const appMarker = (await client.readAllMarkers()).get("app") ?? null;
407
- if (appMarker !== null && !isGraphNode(appMarker.storageHash, appGraph)) return notOk(errorMarkerMismatch(appMarker.storageHash, [...appGraph.nodes].sort(), findLatestMigration(appGraph)?.to ?? null));
251
+ if (appMarker !== null) {
252
+ const markerRefusal = refuseMarkerOutsideGraph({
253
+ markerHash: appMarker.storageHash,
254
+ graph: appGraph
255
+ });
256
+ if (markerRefusal) return notOk(markerRefusal);
257
+ }
408
258
  if (refEntry && refEntry.invariants.length > 0) {
409
- const declared = collectDeclaredInvariants(appGraph);
410
- const known = new Set(declared);
411
- for (const id of appMarker?.invariants ?? []) known.add(id);
412
- const unknown = refEntry.invariants.filter((id) => !known.has(id));
413
- if (unknown.length > 0) return notOk(errorUnknownInvariant({
414
- ...ifDefined("refName", toArg),
415
- unknown,
416
- declared: [...declared].sort()
417
- }));
259
+ const invariantRefusal = refuseUnknownInvariants({
260
+ graph: appGraph,
261
+ markerInvariants: appMarker?.invariants ?? [],
262
+ refInvariants: refEntry.invariants,
263
+ ...ifDefined("refName", toArg)
264
+ });
265
+ if (invariantRefusal) return notOk(invariantRefusal);
418
266
  }
419
267
  if (!flags.quiet && !flags.json) ui.step("Loading contract spaces…");
420
268
  let applyContract = contractRaw;
@@ -441,15 +289,23 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
441
289
  if (!applyResult.ok) return notOk(mapApplyFailure(applyResult.failure));
442
290
  const { value } = applyResult;
443
291
  let advancedRef = null;
444
- if (options.advanceRef !== void 0) try {
292
+ if (options.advanceRef !== void 0) {
445
293
  const contractIR = snapshotContractDts !== void 0 ? {
446
294
  contract: snapshotContractJson,
447
295
  contractDts: snapshotContractDts
448
296
  } : await readContractIR(snapshotContractJson, contractPathAbsolute);
449
- advancedRef = await executeRefAdvancement(refsDir, migrationsDir, options.advanceRef, value.markerHash, contractIR);
450
- } catch (error) {
451
- if (MigrationToolsError.is(error)) return notOk(error);
452
- throw error;
297
+ const advanced = await advanceRefSafely({
298
+ refsDir,
299
+ migrationsDir,
300
+ name: options.advanceRef,
301
+ hash: value.markerHash,
302
+ contractIR
303
+ });
304
+ if (!advanced.ok) return notOk(advanced.failure);
305
+ advancedRef = {
306
+ name: advanced.value.name,
307
+ hash: advanced.value.hash
308
+ };
453
309
  }
454
310
  return ok({
455
311
  ok: true,
@@ -464,7 +320,8 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
464
320
  advancedRef
465
321
  });
466
322
  } catch (error) {
467
- if (CliStructuredError$1.is(error)) return notOk(error);
323
+ const mapped = mapCaughtMigrationError(error);
324
+ if (mapped) return notOk(mapped);
468
325
  return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));
469
326
  } finally {
470
327
  await client.close();
@@ -503,4 +360,4 @@ function createMigrateCommand() {
503
360
  //#endregion
504
361
  export { createMigrateCommand as t };
505
362
 
506
- //# sourceMappingURL=migrate-COusRrm7.mjs.map
363
+ //# sourceMappingURL=migrate-B-NAuO90.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-B-NAuO90.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migrate.mjs"],"sourcesContent":["import { A as formatStyledHeader, B as errorContractValidationFailed, S as formatMigrationApplyCommandOutput, U as errorDriverRequired, V as errorDatabaseConnectionRequired, W as errorFileNotFound, Z as errorPathUnreachable, _ as createTerminalUI, ct as errorUnexpected, f as targetSupportsMigrations, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, nt as errorRunnerFailed, o as resolveContractPath, ot as errorTargetMigrationNotSupported, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"../command-helpers-C4WpR-QE.mjs\";\nimport { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"../contract-space-aggregate-loader-C5r12INu.mjs\";\nimport { t as createControlClient } from \"../client-Y6qbDk7X.mjs\";\nimport { a as readContractIR, t as advanceRefSafely } from \"../ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapCaughtMigrationError } from \"../caught-errors-D7Qznyrm.mjs\";\nimport { t as mapContractAtError } from \"../contract-at-errors-Dv1mxKYO.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants } from \"../invariants-BzYfO9IL.mjs\";\nimport { t as executeMigrateShowPlan } from \"../migrate-show-B2LkXkoB.mjs\";\nimport { t as listRefsByContractHash } from \"../migration-list-C9OPCMt-.mjs\";\nimport { t as resolveContractRef } from \"../ref-resolution-_S4xTT2L.mjs\";\nimport { d as highlightFromEdgeAnnotations, f as indentMigrationGraphTreeBlock, h as buildGrid, i as formatOnPathMigrationRow, m as buildMigrationGraphRows, n as computeMaxDirNameWidth, r as renderMigrationGraphCommand, t as computeLabelColumn } from \"../migration-graph-command-render-BKrg6BPv.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfig } 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 planResult = await executeMigrateShowPlan({\n\t\t...ifDefined(\"config\", 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 { aggregate, contractHash } = plan;\n\tconst orderedMigrations = plan.migrations;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tlet graphOutput;\n\tlet runListDirNameWidth;\n\tlet runListLeftPad;\n\tif (!flags.json) {\n\t\tconst onPathHashes = new Set(orderedMigrations.map((m) => m.migrationHash));\n\t\tconst colorize = flags.color !== false;\n\t\tconst spaceLayouts = allSpaces.map((space) => {\n\t\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\t\tconst spaceGraph = space.graph();\n\t\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\t\treturn {\n\t\t\t\tspace,\n\t\t\t\tisApp,\n\t\t\t\tspaceGraph,\n\t\t\t\trowModel,\n\t\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\t\tedgeAnnotations\n\t\t\t};\n\t\t});\n\t\tconst globalLabelColumn = spaceLayouts.length > 1 ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, \"unicode\"))) : void 0;\n\t\tconst globalMaxDirNameWidthFromLayouts = spaceLayouts.length > 1 ? Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))) : void 0;\n\t\tconst runListMaxFromMigrations = orderedMigrations.length > 0 ? Math.max(...orderedMigrations.map((m) => m.dirName.length)) : 0;\n\t\tconst globalMaxDirNameWidth = globalMaxDirNameWidthFromLayouts !== void 0 ? Math.max(globalMaxDirNameWidthFromLayouts, runListMaxFromMigrations) : void 0;\n\t\trunListDirNameWidth = globalMaxDirNameWidth ?? runListMaxFromMigrations;\n\t\trunListLeftPad = globalLabelColumn;\n\t\tconst showSpaceHeadings = allSpaces.length > 1;\n\t\tconst sections = [];\n\t\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\t\tconst tree = renderMigrationGraphCommand({\n\t\t\t\tgrid,\n\t\t\t\trowModel,\n\t\t\t\tcontractHash,\n\t\t\t\tisAppSpace: isApp,\n\t\t\t\t...plan.usedLiveMarker ? { dbHash: liveMarkerHash } : {},\n\t\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\t\tcolorize,\n\t\t\t\tglyphMode: \"unicode\",\n\t\t\t\t...globalLabelColumn !== void 0 ? { globalLabelColumn } : {},\n\t\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t\t});\n\t\t\tif (tree.length === 0) continue;\n\t\t\tif (showSpaceHeadings) sections.push(`${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}`);\n\t\t\telse sections.push(tree);\n\t\t}\n\t\tgraphOutput = sections.join(\"\\n\\n\");\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 colorize = flags.color !== false;\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(`The following ${n} migration${n === 1 ? \"\" : \"s\"} will run:`);\n\t\tconst isMultiSpace = result.runListLeftPad !== void 0;\n\t\tconst gutter = result.runListLeftPad ?? 0;\n\t\tconst rawDirNameWidth = result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length));\n\t\tconst listDirNameWidth = gutter + Math.max(rawDirNameWidth + 2, 25 - gutter) - (isMultiSpace ? 2 : 4);\n\t\tfor (const m of result.migrations) lines.push(` ${formatOnPathMigrationRow(m.dirName, m.from, m.to, listDirNameWidth, colorize, \"unicode\")}`);\n\t} else lines.push(result.summary);\n\treturn lines.join(\"\\n\");\n}\nfunction mapApplyFailure(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}\nasync function executeMigrateCommand(options, flags, ui, startTime) {\n\tconst config = await loadConfig(options.config);\n\tconst { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config);\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(mapApplyFailure(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 client.close();\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 };\n\n//# sourceMappingURL=migrate.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,eAAe,0BAA0B,SAAS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AQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -0,0 +1,56 @@
1
+ import { t as CliStructuredError$1 } from "./cli-errors-CDr3WcJP-NFry5GHb.mjs";
2
+ import { c as ContractSpaceAggregate } from "./aggregate-BflrjWPO.mjs";
3
+ import { Result } from "@prisma/orm-framework/utils/result";
4
+ //#region ../../../1-framework/3-tooling/cli/dist/migrate-show-60NNqVia.d.mts
5
+ //#region src/control-api/operations/migrate-show.d.ts
6
+ /**
7
+ * One migration that will run in a `migrate --show` preview, in execution order.
8
+ */
9
+ interface MigrateShowMigration {
10
+ readonly spaceId: string;
11
+ readonly dirName: string;
12
+ readonly migrationHash: string;
13
+ readonly from: string;
14
+ readonly to: string;
15
+ }
16
+ interface ExecuteMigrateShowPlanOptions {
17
+ readonly config?: string;
18
+ readonly db?: string;
19
+ readonly to?: string;
20
+ readonly from?: string;
21
+ /**
22
+ * Invoked once, after refs/aggregate/--to resolution succeeds and before any DB connection —
23
+ * exactly where the CLI renders its styled header today.
24
+ */
25
+ readonly onPreflightComplete?: (ctx: {
26
+ readonly configPath: string;
27
+ readonly migrationsRelative: string;
28
+ readonly dbConnection: unknown | undefined;
29
+ readonly hasExplicitFrom: boolean;
30
+ }) => void;
31
+ }
32
+ interface MigrateShowPlanSuccess {
33
+ readonly aggregate: ContractSpaceAggregate;
34
+ readonly contractHash: string;
35
+ readonly migrations: readonly MigrateShowMigration[];
36
+ readonly summary: string;
37
+ /** Per-space render hash: live/override marker storageHash, pre-defaulted to the empty sentinel. */
38
+ readonly renderMarkerHashBySpace: ReadonlyMap<string, string>;
39
+ /** True when the live DB marker was read — gates the ★ db marker in the tree. */
40
+ readonly usedLiveMarker: boolean;
41
+ }
42
+ /**
43
+ * Computes the path through the SAME seam as `executeMigrate`:
44
+ * - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
45
+ * the full marker including `invariants` (not just `storageHash`).
46
+ * - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,
47
+ * which feeds `resolveRecordedPath()` with the same target hash, target invariants,
48
+ * and current marker as the real apply path uses.
49
+ *
50
+ * Returns BEFORE any write boundary (`runMigration` / marker / DDL). No
51
+ * DB state is mutated.
52
+ */
53
+ declare function executeMigrateShowPlan(options: ExecuteMigrateShowPlanOptions): Promise<Result<MigrateShowPlanSuccess, CliStructuredError$1>>;
54
+ //#endregion
55
+ export { executeMigrateShowPlan as i, MigrateShowMigration as n, MigrateShowPlanSuccess as r, ExecuteMigrateShowPlanOptions as t };
56
+ //# sourceMappingURL=migrate-show-60NNqVia-oGqMaVA9.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-show-60NNqVia-oGqMaVA9.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-60NNqVia.d.mts"],"mappings":";;;;;;;;UAOU;WACC;WACA;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;WACA;;;;;WAKA,uBAAuB;aACrB;aACA;aACA;aACA;;;UAGH;WACC,WAAW;WACX;WACA,qBAAqB;WACrB;;WAEA,yBAAyB;;WAEzB;;;;;;;;;;;;;iBAaM,uBAAuB,SAAS,gCAAgC,QAAQ,OAAO,wBAAwB"}