@prisma/orm-toolchain 8.0.0-rc.1-dev.44 → 8.0.0-rc.1-dev.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +3 -3
  2. package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-CPZB020V.mjs} +9 -9
  3. package/dist/{aggregate-BBsCbXgJ.mjs.map → aggregate-CPZB020V.mjs.map} +1 -1
  4. package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-DLUJLq5Y.d.mts} +3 -3
  5. package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-DLUJLq5Y.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +19 -5
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +287 -8
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +11 -13
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +5382 -1095
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +298 -27
  15. package/dist/cli__control-api.d.mts.map +1 -1
  16. package/dist/cli__control-api.mjs +2 -19
  17. package/dist/cli__control-api__testing.d.mts +1 -1
  18. package/dist/cli__control-api__testing.mjs.map +1 -1
  19. package/dist/cli__init-output.d.mts +0 -1
  20. package/dist/cli__init-output.d.mts.map +1 -1
  21. package/dist/cli__init-output.mjs +1 -1
  22. package/dist/cli__migration-cli.mjs +9 -9
  23. package/dist/cli__migration-cli.mjs.map +1 -1
  24. package/dist/config-loader.d.mts +1 -1
  25. package/dist/config-loader.mjs +1 -1
  26. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs} +4 -4
  27. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map} +1 -1
  28. package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-BwgNK50T-DGvKgFCK.d.mts} +81 -81
  29. package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +1 -0
  30. package/dist/emitter.d.mts +1 -1
  31. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-CXbGUWGu-CstQHPh6.mjs} +2 -2
  32. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs.map → errors-CXbGUWGu-CstQHPh6.mjs.map} +1 -1
  33. package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
  34. package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
  35. package/dist/{exports-B3xY_FHp.mjs → exports-8ZUN43ve.mjs} +6 -6
  36. package/dist/exports-8ZUN43ve.mjs.map +1 -0
  37. package/dist/{exports-BZLNbtkY.mjs → exports-BZaG8_w_.mjs} +64 -36
  38. package/dist/exports-BZaG8_w_.mjs.map +1 -0
  39. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-BViWUMpP-C4lYYJdU.mjs} +2 -2
  40. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-BViWUMpP-C4lYYJdU.mjs.map} +1 -1
  41. package/dist/{import-roots-NDOIEDVj.mjs → import-roots-CNFBPAT1.mjs} +10 -3
  42. package/dist/{import-roots-NDOIEDVj.mjs.map → import-roots-CNFBPAT1.mjs.map} +1 -1
  43. package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-CfoYgejL.d.mts} +2 -2
  44. package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-CfoYgejL.d.mts.map} +1 -1
  45. package/dist/{index-mCsi_ND5.d.mts → index-DRs7L6N0.d.mts} +11 -3
  46. package/dist/index-DRs7L6N0.d.mts.map +1 -0
  47. package/dist/{index-CnOyYxmv.d.mts → index-Dgwl8Tzs.d.mts} +2 -2
  48. package/dist/{index-CnOyYxmv.d.mts.map → index-Dgwl8Tzs.d.mts.map} +1 -1
  49. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-CTHy88OP-CYI2a8IO.mjs} +2 -2
  50. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-CTHy88OP-CYI2a8IO.mjs.map} +1 -1
  51. package/dist/{io-635GlNx1-D94PxRc-.mjs → io-635GlNx1-D3zrw2qu.mjs} +4 -4
  52. package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-635GlNx1-D3zrw2qu.mjs.map} +1 -1
  53. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-_SJImD5V-BURyY1KM.mjs} +2 -2
  54. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-_SJImD5V-BURyY1KM.mjs.map} +1 -1
  55. package/dist/{migration-gubSSeMk.mjs → migration-hspPIEeV.mjs} +4 -4
  56. package/dist/{migration-gubSSeMk.mjs.map → migration-hspPIEeV.mjs.map} +1 -1
  57. package/dist/migration-tools.d.mts +4 -4
  58. package/dist/migration-tools.mjs +13 -13
  59. package/dist/migration-tools__aggregate.d.mts +1 -1
  60. package/dist/migration-tools__aggregate.mjs +1 -1
  61. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  62. package/dist/migration-tools__errors.d.mts +1 -1
  63. package/dist/migration-tools__errors.mjs +1 -1
  64. package/dist/migration-tools__invariants.mjs +1 -1
  65. package/dist/migration-tools__io.mjs +1 -1
  66. package/dist/migration-tools__migration-graph.mjs +2 -2
  67. package/dist/migration-tools__migration-ts.mjs +1 -1
  68. package/dist/migration-tools__migration.mjs +1 -1
  69. package/dist/migration-tools__ref-resolution.mjs +1 -1
  70. package/dist/migration-tools__refs.mjs +1 -1
  71. package/dist/migration-tools__spaces.d.mts +2 -2
  72. package/dist/migration-tools__spaces.mjs +2 -2
  73. package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
  74. package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
  75. package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-CovTDY14-CUoAqLML.mjs} +3 -45
  76. package/dist/output-CovTDY14-CUoAqLML.mjs.map +1 -0
  77. package/dist/publish-surface.d.mts +2 -2
  78. package/dist/publish-surface.mjs +2 -2
  79. package/dist/publish-surface__import-roots.d.mts +1 -1
  80. package/dist/publish-surface__import-roots.mjs +1 -1
  81. package/dist/publish-surface__shells.d.mts +1 -1
  82. package/dist/publish-surface__shells.mjs +1 -1
  83. package/dist/quick-reference-mongo.md +12 -9
  84. package/dist/quick-reference-postgres.md +12 -9
  85. package/dist/readme-mongo.md +2 -2
  86. package/dist/readme-postgres.md +2 -2
  87. package/dist/ref-h6InR6dO-rGfl18Jv.mjs +4686 -0
  88. package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +1 -0
  89. package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-HeNBXW53.mjs} +2 -2
  90. package/dist/{ref-resolution-sGcINe7o.mjs.map → ref-resolution-HeNBXW53.mjs.map} +1 -1
  91. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-WK86uYYp-gM8tvWQP.mjs} +2 -2
  92. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs.map → refs-WK86uYYp-gM8tvWQP.mjs.map} +1 -1
  93. package/dist/{shells-BenrJHp2.mjs → shells-C4HbRAr5.mjs} +13 -14
  94. package/dist/shells-C4HbRAr5.mjs.map +1 -0
  95. package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
  96. package/dist/shells-CIUmT4u4.d.mts.map +1 -0
  97. package/dist/{spaces-BG2w0P8d.mjs → spaces-4qMOAYE9.mjs} +7 -7
  98. package/dist/{spaces-BG2w0P8d.mjs.map → spaces-4qMOAYE9.mjs.map} +1 -1
  99. package/dist/{spaces-tWQi7CUv.d.mts → spaces-Dj65JrwZ.d.mts} +2 -2
  100. package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-Dj65JrwZ.d.mts.map} +1 -1
  101. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
  102. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
  103. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs} +4 -4
  104. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map} +1 -1
  105. package/dist/vite-plugin-contract-emit.d.mts +2 -2
  106. package/dist/vite-plugin-contract-emit.mjs +5 -5
  107. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  108. package/package.json +14 -38
  109. package/dist/bin__prisma-next.mjs +0 -512
  110. package/dist/bin__prisma-next.mjs.map +0 -1
  111. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
  112. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
  113. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
  114. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
  115. package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
  116. package/dist/cli__commands__contract-emit.d.mts +0 -2
  117. package/dist/cli__commands__contract-emit.mjs +0 -2
  118. package/dist/cli__commands__contract-infer.d.mts +0 -7
  119. package/dist/cli__commands__contract-infer.d.mts.map +0 -1
  120. package/dist/cli__commands__contract-infer.mjs +0 -2
  121. package/dist/cli__commands__db-init.d.mts +0 -7
  122. package/dist/cli__commands__db-init.d.mts.map +0 -1
  123. package/dist/cli__commands__db-init.mjs +0 -2
  124. package/dist/cli__commands__db-schema.d.mts +0 -7
  125. package/dist/cli__commands__db-schema.d.mts.map +0 -1
  126. package/dist/cli__commands__db-schema.mjs +0 -2
  127. package/dist/cli__commands__db-sign.d.mts +0 -7
  128. package/dist/cli__commands__db-sign.d.mts.map +0 -1
  129. package/dist/cli__commands__db-sign.mjs +0 -2
  130. package/dist/cli__commands__db-update.d.mts +0 -7
  131. package/dist/cli__commands__db-update.d.mts.map +0 -1
  132. package/dist/cli__commands__db-update.mjs +0 -2
  133. package/dist/cli__commands__db-verify.d.mts +0 -7
  134. package/dist/cli__commands__db-verify.d.mts.map +0 -1
  135. package/dist/cli__commands__db-verify.mjs +0 -2
  136. package/dist/cli__commands__migrate.d.mts +0 -57
  137. package/dist/cli__commands__migrate.d.mts.map +0 -1
  138. package/dist/cli__commands__migrate.mjs +0 -2
  139. package/dist/cli__commands__migration-check.d.mts +0 -8
  140. package/dist/cli__commands__migration-check.d.mts.map +0 -1
  141. package/dist/cli__commands__migration-check.mjs +0 -3
  142. package/dist/cli__commands__migration-graph.d.mts +0 -38
  143. package/dist/cli__commands__migration-graph.d.mts.map +0 -1
  144. package/dist/cli__commands__migration-graph.mjs +0 -2
  145. package/dist/cli__commands__migration-list.d.mts +0 -39
  146. package/dist/cli__commands__migration-list.d.mts.map +0 -1
  147. package/dist/cli__commands__migration-list.mjs +0 -2
  148. package/dist/cli__commands__migration-log.d.mts +0 -20
  149. package/dist/cli__commands__migration-log.d.mts.map +0 -1
  150. package/dist/cli__commands__migration-log.mjs +0 -2
  151. package/dist/cli__commands__migration-new.d.mts +0 -7
  152. package/dist/cli__commands__migration-new.d.mts.map +0 -1
  153. package/dist/cli__commands__migration-new.mjs +0 -2
  154. package/dist/cli__commands__migration-plan.d.mts +0 -34
  155. package/dist/cli__commands__migration-plan.d.mts.map +0 -1
  156. package/dist/cli__commands__migration-plan.mjs +0 -2
  157. package/dist/cli__commands__migration-show.d.mts +0 -27
  158. package/dist/cli__commands__migration-show.d.mts.map +0 -1
  159. package/dist/cli__commands__migration-show.mjs +0 -2
  160. package/dist/cli__commands__migration-status.d.mts +0 -55
  161. package/dist/cli__commands__migration-status.d.mts.map +0 -1
  162. package/dist/cli__commands__migration-status.mjs +0 -3
  163. package/dist/cli__commands__ref.d.mts +0 -7
  164. package/dist/cli__commands__ref.d.mts.map +0 -1
  165. package/dist/cli__commands__ref.mjs +0 -2
  166. package/dist/cli__commands__telemetry.d.mts +0 -7
  167. package/dist/cli__commands__telemetry.d.mts.map +0 -1
  168. package/dist/cli__commands__telemetry.mjs +0 -2
  169. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
  170. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
  171. package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs +0 -295
  172. package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs.map +0 -1
  173. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
  174. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
  175. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
  176. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
  177. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
  178. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
  179. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
  180. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
  181. package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
  182. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
  183. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
  184. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
  185. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
  186. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
  187. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
  188. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
  189. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
  190. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
  191. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
  192. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
  193. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
  194. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
  195. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
  196. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
  197. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
  198. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
  199. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
  200. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
  201. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
  202. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
  203. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
  204. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
  205. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
  206. package/dist/exports-B3xY_FHp.mjs.map +0 -1
  207. package/dist/exports-BZLNbtkY.mjs.map +0 -1
  208. package/dist/exports-CqNUihkI.mjs +0 -276
  209. package/dist/exports-CqNUihkI.mjs.map +0 -1
  210. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
  211. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
  212. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
  213. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
  214. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
  215. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
  216. package/dist/index-mCsi_ND5.d.mts.map +0 -1
  217. package/dist/init-B86mXFNC-C2HAUCRn.mjs +0 -800
  218. package/dist/init-B86mXFNC-C2HAUCRn.mjs.map +0 -1
  219. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
  220. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
  221. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
  222. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
  223. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
  224. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
  225. package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
  226. package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
  227. package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
  228. package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
  229. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
  230. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
  231. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
  232. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
  233. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
  234. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
  235. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
  236. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
  237. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
  238. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
  239. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
  240. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
  241. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
  242. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
  243. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
  244. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
  245. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
  246. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
  247. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
  248. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
  249. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
  250. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
  251. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
  252. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
  253. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
  254. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
  255. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
  256. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
  257. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
  258. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
  259. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
  260. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
  261. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
  262. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
  263. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
  264. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
  265. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
  266. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
  267. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
  268. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
  269. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
  270. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
  271. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
  272. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
  273. package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
  274. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
  275. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
  276. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
  277. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
  278. package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs +0 -1476
  279. package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map +0 -1
  280. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
  281. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
  282. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
  283. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
  284. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
  285. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
  286. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
  287. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
  288. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
  289. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
  290. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
  291. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
  292. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
  293. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
  294. package/dist/shells-BenrJHp2.mjs.map +0 -1
  295. package/dist/shells-COHV_Ozf.d.mts.map +0 -1
  296. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
  297. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
  298. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
  299. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
  300. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
  301. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
  302. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
  303. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
@@ -1,776 +0,0 @@
1
- import { A as errorRuntime$1, C as errorOutputFormatMutex, h as errorInvalidOutputFormat, t as CliStructuredError$1 } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
2
- import { a as formatErrorJson, i as formatDim, n as createColorFormatter, o as formatErrorOutput, r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
3
- import { c as spaceMigrationDirectory, t as APP_SPACE_ID$1 } from "./verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs";
4
- import "@prisma/orm-framework/utils/defined";
5
- import { relative, resolve } from "pathe";
6
- import { readFile } from "node:fs/promises";
7
- import { hasMigrations } from "@prisma/orm-framework/components/control";
8
- import { blue, bold, cyan, dim, green, magenta } from "colorette";
9
- import { notOk } from "@prisma/orm-framework/utils/result";
10
- import wrapAnsi from "wrap-ansi";
11
- import stringWidth from "string-width";
12
- import stripAnsi from "strip-ansi";
13
- import { isCI } from "ci-info";
14
- //#region ../../../1-framework/3-tooling/cli/dist/command-helpers-BCgwcqTe.mjs
15
- /**
16
- * Fixed width for left column in help output.
17
- */
18
- const LEFT_COLUMN_WIDTH$1 = 20;
19
- /**
20
- * Creates an arrow segment badge with green background and white text.
21
- * Body: green background with white "prisma-next" text
22
- * Tip: dark grey arrow pointing right (Powerline separator)
23
- */
24
- function createPrismaNextBadge$1(useColor) {
25
- if (!useColor) return "prisma-next";
26
- return bold("prisma-next");
27
- }
28
- /**
29
- * Creates a padding function.
30
- */
31
- function createPadFunction() {
32
- return (s, w) => s + " ".repeat(Math.max(0, w - s.length));
33
- }
34
- /**
35
- * Formats a header line: brand + operation + intent
36
- */
37
- function formatHeaderLine$1(options) {
38
- if (options.operation) return `${options.brand} ${options.operation} → ${options.intent}`;
39
- return `${options.brand} ${options.intent}`;
40
- }
41
- /**
42
- * Formats a "Read more" URL line.
43
- * The "Read more" label is in default color (not cyan), and the URL is blue.
44
- */
45
- function formatReadMoreLine$1(options) {
46
- const labelPadded = createPadFunction()("Read more", options.maxLabelWidth);
47
- const valueColored = options.useColor ? blue(options.url) : options.url;
48
- return `${options.formatDimText("│")} ${labelPadded} ${valueColored}`;
49
- }
50
- /**
51
- * Pads text to a fixed width, accounting for ANSI escape codes.
52
- * Uses string-width to measure the actual display width.
53
- */
54
- function padToFixedWidth(text, width) {
55
- const actualWidth = stringWidth(text);
56
- const padding = Math.max(0, width - actualWidth);
57
- return text + " ".repeat(padding);
58
- }
59
- /**
60
- * Renders a command tree structure.
61
- * Handles both single-level (subcommands of a command) and multi-level (top-level commands with subcommands) trees.
62
- */
63
- function renderCommandTree(options) {
64
- const { commands, useColor, formatDimText, hasItemsAfter, continuationPrefix } = options;
65
- const lines = [];
66
- if (commands.length === 0) return lines;
67
- for (let i = 0; i < commands.length; i++) {
68
- const cmd = commands[i];
69
- if (!cmd) continue;
70
- const subcommands = cmd.commands.filter((subcmd) => !subcmd.name().startsWith("_"));
71
- const isLastCommand = i === commands.length - 1;
72
- if (subcommands.length > 0) {
73
- const treePrefix = `${isLastCommand && !hasItemsAfter ? formatDimText("└") : formatDimText("├")}─ `;
74
- const treePrefixWidth = stringWidth(stripAnsi(treePrefix));
75
- const remainingWidth = LEFT_COLUMN_WIDTH$1 - treePrefixWidth;
76
- const commandNamePadded = padToFixedWidth(cmd.name(), remainingWidth);
77
- const commandNameColored = useColor ? cyan(commandNamePadded) : commandNamePadded;
78
- lines.push(`${formatDimText("│")} ${treePrefix}${commandNameColored}`);
79
- for (let j = 0; j < subcommands.length; j++) {
80
- const subcmd = subcommands[j];
81
- if (!subcmd) continue;
82
- const isLastSubcommand = j === subcommands.length - 1;
83
- const shortDescription = subcmd.description() || "";
84
- const treeChar = isLastSubcommand ? "└" : "├";
85
- const continuation = continuationPrefix ?? (isLastCommand && isLastSubcommand && !hasItemsAfter ? " " : formatDimText("│"));
86
- const subTreePrefix = `${continuation === " " ? " " : continuation} ${formatDimText(treeChar)}─ `;
87
- const subTreePrefixWidth = stringWidth(stripAnsi(subTreePrefix));
88
- const subRemainingWidth = LEFT_COLUMN_WIDTH$1 - subTreePrefixWidth;
89
- const subcommandNamePadded = padToFixedWidth(subcmd.name(), subRemainingWidth);
90
- const subcommandNameColored = useColor ? cyan(subcommandNamePadded) : subcommandNamePadded;
91
- lines.push(`${formatDimText("│")} ${subTreePrefix}${subcommandNameColored} ${shortDescription}`);
92
- }
93
- } else {
94
- const treePrefix = `${isLastCommand && !hasItemsAfter ? formatDimText("└") : formatDimText("├")}─ `;
95
- const treePrefixWidth = stringWidth(stripAnsi(treePrefix));
96
- const remainingWidth = LEFT_COLUMN_WIDTH$1 - treePrefixWidth;
97
- const commandNamePadded = padToFixedWidth(cmd.name(), remainingWidth);
98
- const commandNameColored = useColor ? cyan(commandNamePadded) : commandNamePadded;
99
- const shortDescription = cmd.description() || "";
100
- lines.push(`${formatDimText("│")} ${treePrefix}${commandNameColored} ${shortDescription}`);
101
- }
102
- }
103
- return lines;
104
- }
105
- /**
106
- * Formats the header in the new experimental visual style.
107
- * This header appears at the start of command output, showing the operation,
108
- * intent, documentation link, and parameters.
109
- */
110
- function formatStyledHeader(options) {
111
- const lines = [];
112
- const useColor = options.flags.color !== false;
113
- const formatDimText = (text) => formatDim(useColor, text);
114
- const brand = createPrismaNextBadge$1(useColor);
115
- const operation = useColor ? bold(options.command) : options.command;
116
- const intent = formatDimText(options.description);
117
- lines.push(formatHeaderLine$1({
118
- brand,
119
- operation,
120
- intent
121
- }));
122
- lines.push(formatDimText("│"));
123
- for (const detail of options.details) {
124
- const labelPadded = padToFixedWidth(`${detail.label}:`, LEFT_COLUMN_WIDTH$1);
125
- const labelColored = useColor ? cyan(labelPadded) : labelPadded;
126
- lines.push(`${formatDimText("│")} ${labelColored} ${detail.value}`);
127
- }
128
- if (options.url) {
129
- lines.push(formatDimText("│"));
130
- lines.push(formatReadMoreLine$1({
131
- url: options.url,
132
- maxLabelWidth: LEFT_COLUMN_WIDTH$1,
133
- useColor,
134
- formatDimText
135
- }));
136
- }
137
- lines.push(formatDimText("└"));
138
- return `${lines.join("\n")}\n`;
139
- }
140
- /**
141
- * Formats a success message in the styled output format.
142
- */
143
- function formatSuccessMessage(flags) {
144
- return `${createColorFormatter(flags.color !== false, green)("✔")} Success`;
145
- }
146
- /**
147
- * Fixed width for left column in help output.
148
- * Must match the value in styled.ts.
149
- */
150
- const LEFT_COLUMN_WIDTH = 20;
151
- /**
152
- * Minimum width for right column wrapping in help output.
153
- */
154
- const RIGHT_COLUMN_MIN_WIDTH = 40;
155
- /**
156
- * Maximum width for right column wrapping in help output (when terminal is wide enough).
157
- */
158
- const RIGHT_COLUMN_MAX_WIDTH = 90;
159
- /**
160
- * Gets the terminal width, or returns a default if not available.
161
- */
162
- function getTerminalWidth() {
163
- const terminalWidth = process.stderr.columns || process.stdout.columns;
164
- const envWidth = Number.parseInt(process.env["CLI_WIDTH"] || "", 10);
165
- return terminalWidth || (Number.isFinite(envWidth) ? envWidth : 80);
166
- }
167
- /**
168
- * Calculates the available width for the right column based on terminal width.
169
- */
170
- function calculateRightColumnWidth() {
171
- const availableWidth = getTerminalWidth() - 2 - LEFT_COLUMN_WIDTH - 2;
172
- return Math.max(RIGHT_COLUMN_MIN_WIDTH, Math.min(availableWidth, RIGHT_COLUMN_MAX_WIDTH));
173
- }
174
- /**
175
- * Creates the CLI brand badge.
176
- */
177
- function createPrismaNextBadge(useColor) {
178
- return useColor ? bold("prisma-next") : "prisma-next";
179
- }
180
- /**
181
- * Formats a header line: brand + operation + intent
182
- */
183
- function formatHeaderLine(options) {
184
- if (options.operation) return `${options.brand} ${options.operation} → ${options.intent}`;
185
- return `${options.brand} ${options.intent}`;
186
- }
187
- /**
188
- * Wraps text to fit within a specified width using wrap-ansi.
189
- */
190
- function wrapTextAnsi(text, width) {
191
- return wrapAnsi(text, width, {
192
- hard: false,
193
- trim: true
194
- }).split("\n");
195
- }
196
- /**
197
- * Formats a default value as "default: <value>" with dimming.
198
- */
199
- function formatDefaultValue(value, useColor) {
200
- const defaultText = `default: ${String(value)}`;
201
- return useColor ? dim(defaultText) : defaultText;
202
- }
203
- /**
204
- * Formats a "Read more" URL line.
205
- */
206
- function formatReadMoreLine(options) {
207
- const labelPadded = `Read more${" ".repeat(Math.max(0, options.maxLabelWidth - 9))}`;
208
- const valueColored = options.useColor ? blue(options.url) : options.url;
209
- return `${options.formatDimText("│")} ${labelPadded} ${valueColored}`;
210
- }
211
- /**
212
- * Formats multiline description with "Prisma Next" in green.
213
- */
214
- function formatMultilineDescription(options) {
215
- const lines = [];
216
- const formatGreen = (text) => options.useColor ? green(text) : text;
217
- const wrapWidth = 24 + calculateRightColumnWidth() - 2;
218
- for (const descLine of options.descriptionLines) {
219
- const wrappedLines = wrapTextAnsi(descLine.replace(/Prisma Next/g, (match) => formatGreen(match)), wrapWidth);
220
- for (const wrappedLine of wrappedLines) lines.push(`${options.formatDimText("│")} ${wrappedLine}`);
221
- }
222
- return lines;
223
- }
224
- /**
225
- * Maps command paths to their documentation URLs.
226
- */
227
- function getCommandDocsUrl(commandPath) {
228
- return {
229
- "contract emit": "https://pris.ly/contract-emit",
230
- "contract infer": "https://pris.ly/contract-infer",
231
- "db schema": "https://pris.ly/db-schema",
232
- "db verify": "https://pris.ly/db-verify",
233
- "db update": "https://pris.ly/db-update",
234
- "migration plan": "https://pris.ly/migration-plan",
235
- migrate: "https://pris.ly/migrate",
236
- "migration show": "https://pris.ly/migration-show",
237
- "migration status": "https://pris.ly/migration-status"
238
- }[commandPath];
239
- }
240
- /**
241
- * Builds the full command path from a command and its parents.
242
- */
243
- function buildCommandPath(command) {
244
- const parts = [];
245
- let current = command;
246
- while (current && current.name() !== "prisma-next") {
247
- parts.unshift(current.name());
248
- current = current.parent ?? void 0;
249
- }
250
- return parts.join(" ");
251
- }
252
- /**
253
- * Formats help output for a command using the styled format.
254
- */
255
- function formatCommandHelp(options) {
256
- const { command, flags } = options;
257
- const lines = [];
258
- const useColor = flags.color !== false;
259
- const formatDimText = (text) => formatDim(useColor, text);
260
- const commandPath = buildCommandPath(command);
261
- const shortDescription = command.description() || "";
262
- const longDescription = getLongDescription(command);
263
- const argsSuffix = command.registeredArguments.map((arg) => arg.required ? `<${arg.name()}>` : `[${arg.name()}]`).join(" ");
264
- const brand = createPrismaNextBadge(useColor);
265
- const commandWithArgs = argsSuffix ? `${commandPath} ${argsSuffix}` : commandPath;
266
- const operation = useColor ? bold(commandWithArgs) : commandWithArgs;
267
- const intent = formatDimText(shortDescription);
268
- lines.push(formatHeaderLine({
269
- brand,
270
- operation,
271
- intent
272
- }));
273
- lines.push(formatDimText("│"));
274
- const optionsList = command.options.map((opt) => {
275
- const description = opt.description || "";
276
- const defaultValue = opt.defaultValue;
277
- return {
278
- flags: opt.flags,
279
- description,
280
- defaultValue
281
- };
282
- });
283
- const subcommands = command.commands.filter((cmd) => !cmd.name().startsWith("_"));
284
- if (subcommands.length > 0) {
285
- const treeLines = renderCommandTree({
286
- commands: subcommands,
287
- useColor,
288
- formatDimText,
289
- hasItemsAfter: optionsList.length > 0
290
- });
291
- lines.push(...treeLines);
292
- }
293
- if (subcommands.length > 0 && optionsList.length > 0) lines.push(formatDimText("│"));
294
- if (optionsList.length > 0) for (const opt of optionsList) {
295
- const flagsPadded = padToFixedWidth(opt.flags, LEFT_COLUMN_WIDTH);
296
- let flagsColored = flagsPadded;
297
- if (useColor) {
298
- flagsColored = flagsPadded.replace(/(<[^>]+>)/g, (match) => magenta(match));
299
- flagsColored = cyan(flagsColored);
300
- }
301
- const rightColumnWidth = calculateRightColumnWidth();
302
- const wrappedDescription = wrapTextAnsi(opt.description, rightColumnWidth);
303
- lines.push(`${formatDimText("│")} ${flagsColored} ${wrappedDescription[0] || ""}`);
304
- for (let i = 1; i < wrappedDescription.length; i++) {
305
- const emptyLabel = " ".repeat(LEFT_COLUMN_WIDTH);
306
- lines.push(`${formatDimText("│")} ${emptyLabel} ${wrappedDescription[i] || ""}`);
307
- }
308
- if (opt.defaultValue !== void 0) {
309
- const emptyLabel = " ".repeat(LEFT_COLUMN_WIDTH);
310
- const defaultText = formatDefaultValue(opt.defaultValue, useColor);
311
- lines.push(`${formatDimText("│")} ${emptyLabel} ${defaultText}`);
312
- }
313
- }
314
- const docsUrl = getCommandDocsUrl(commandPath);
315
- if (docsUrl) {
316
- lines.push(formatDimText("│"));
317
- lines.push(formatReadMoreLine({
318
- url: docsUrl,
319
- maxLabelWidth: LEFT_COLUMN_WIDTH,
320
- useColor,
321
- formatDimText
322
- }));
323
- }
324
- const examples = getCommandExamples(command);
325
- if (examples && examples.length > 0) {
326
- lines.push(formatDimText("│"));
327
- lines.push(`${formatDimText("│")} ${formatDimText("Examples:")}`);
328
- for (const example of examples) lines.push(`${formatDimText("│")} ${useColor ? dim("$") : "$"} ${example}`);
329
- }
330
- const seeAlso = getCommandSeeAlso(command);
331
- if (seeAlso && seeAlso.length > 0) {
332
- lines.push(formatDimText("│"));
333
- lines.push(`${formatDimText("│")} ${formatDimText("See also:")}`);
334
- for (const ref of seeAlso) lines.push(`${formatDimText("│")} ${ref.verb} ${formatDimText(ref.oneLiner)}`);
335
- }
336
- if (longDescription) {
337
- lines.push(formatDimText("│"));
338
- const descriptionLines = longDescription.split("\n").filter((line) => line.trim().length > 0);
339
- lines.push(...formatMultilineDescription({
340
- descriptionLines,
341
- useColor,
342
- formatDimText
343
- }));
344
- }
345
- lines.push(formatDimText("└"));
346
- return `${lines.join("\n")}\n`;
347
- }
348
- /**
349
- * Formats help output for the root program using the styled format.
350
- */
351
- function formatRootHelp(options) {
352
- const { program, flags } = options;
353
- const lines = [];
354
- const useColor = flags.color !== false;
355
- const formatDimText = (text) => formatDim(useColor, text);
356
- const brand = createPrismaNextBadge(useColor);
357
- const intent = formatDimText("Manage your data layer");
358
- lines.push(formatHeaderLine({
359
- brand,
360
- operation: "",
361
- intent
362
- }));
363
- lines.push(formatDimText("│"));
364
- const topLevelCommands = program.commands.filter((cmd) => !cmd.name().startsWith("_") && cmd.name() !== "help");
365
- const globalOptions = program.options.map((opt) => {
366
- const description = opt.description || "";
367
- const defaultValue = opt.defaultValue;
368
- return {
369
- flags: opt.flags,
370
- description,
371
- defaultValue
372
- };
373
- });
374
- if (topLevelCommands.length > 0) {
375
- const treeLines = renderCommandTree({
376
- commands: topLevelCommands,
377
- useColor,
378
- formatDimText,
379
- hasItemsAfter: globalOptions.length > 0
380
- });
381
- lines.push(...treeLines);
382
- }
383
- if (topLevelCommands.length > 0 && globalOptions.length > 0) lines.push(formatDimText("│"));
384
- if (globalOptions.length > 0) for (const opt of globalOptions) {
385
- const flagsPadded = padToFixedWidth(opt.flags, LEFT_COLUMN_WIDTH);
386
- let flagsColored = flagsPadded;
387
- if (useColor) {
388
- flagsColored = flagsPadded.replace(/(<[^>]+>)/g, (match) => magenta(match));
389
- flagsColored = cyan(flagsColored);
390
- }
391
- const rightColumnWidth = calculateRightColumnWidth();
392
- const wrappedDescription = wrapTextAnsi(opt.description, rightColumnWidth);
393
- lines.push(`${formatDimText("│")} ${flagsColored} ${wrappedDescription[0] || ""}`);
394
- for (let i = 1; i < wrappedDescription.length; i++) {
395
- const emptyLabel = " ".repeat(LEFT_COLUMN_WIDTH);
396
- lines.push(`${formatDimText("│")} ${emptyLabel} ${wrappedDescription[i] || ""}`);
397
- }
398
- if (opt.defaultValue !== void 0) {
399
- const emptyLabel = " ".repeat(LEFT_COLUMN_WIDTH);
400
- const defaultText = formatDefaultValue(opt.defaultValue, useColor);
401
- lines.push(`${formatDimText("│")} ${emptyLabel} ${defaultText}`);
402
- }
403
- }
404
- const formatGreen = (text) => useColor ? green(text) : text;
405
- const descriptionLines = [`Use ${formatGreen("Prisma Next")} to define your data layer as a contract. Sign your database and application with the same contract to guarantee compatibility. Plan and apply migrations to safely evolve your schema.`];
406
- if (descriptionLines.length > 0) {
407
- lines.push(formatDimText("│"));
408
- lines.push(...formatMultilineDescription({
409
- descriptionLines,
410
- useColor,
411
- formatDimText
412
- }));
413
- }
414
- lines.push(formatDimText("└"));
415
- return `${lines.join("\n")}\n`;
416
- }
417
- /**
418
- * Returns true when the process is running in any CI environment recognised
419
- * by the `ci-info` package. The single source of truth for CI detection
420
- * across this CLI — colour-output suppression and telemetry-skip both call
421
- * this helper, so neither path drifts from the other when a new CI provider
422
- * is added upstream.
423
- *
424
- * `ci-info` checks the standard `CI=true` marker plus dozens of
425
- * provider-specific environment variables (Buildkite, Jenkins, Drone,
426
- * Bitbucket Pipelines, Azure Pipelines, AWS CodeBuild, …) that the raw
427
- * `process.env.CI` read misses.
428
- *
429
- */
430
- function isCI$1() {
431
- return isCI;
432
- }
433
- /**
434
- * Processes a CLI command result, handling both success and error cases.
435
- * Formats output appropriately and returns the exit code.
436
- * Never throws - returns exit code for commands to use with process.exit().
437
- *
438
- * Error output:
439
- * - JSON mode: JSON error to stdout (piped) via ui.output(), human sees nothing on stderr.
440
- * - Interactive: human-readable error to stderr.
441
- */
442
- function handleResult(result, flags, ui, onSuccess) {
443
- if (result.ok) {
444
- if (onSuccess) onSuccess(result.value);
445
- return 0;
446
- }
447
- const envelope = result.failure.toEnvelope();
448
- if (flags.json) ui.output(formatErrorJson(envelope));
449
- else ui.error(formatErrorOutput(envelope, flags));
450
- return result.failure.code === "CLI.INIT_USER_ABORTED" ? 3 : 2;
451
- }
452
- function isJsonFlagSet(json) {
453
- return json === true;
454
- }
455
- function resolveOutputFormat(options) {
456
- const formatOption = options.format;
457
- const jsonFlag = isJsonFlagSet(options.json);
458
- if (formatOption !== void 0) {
459
- if (formatOption !== "pretty" && formatOption !== "json") throw errorInvalidOutputFormat(formatOption);
460
- if (jsonFlag && formatOption === "pretty") throw errorOutputFormatMutex();
461
- return {
462
- format: formatOption,
463
- explicitFormat: true
464
- };
465
- }
466
- if (jsonFlag) return {
467
- format: "json",
468
- explicitFormat: false
469
- };
470
- if (!process.stdout.isTTY) return {
471
- format: "json",
472
- explicitFormat: false
473
- };
474
- return {
475
- format: "pretty",
476
- explicitFormat: false
477
- };
478
- }
479
- function inferJsonModeForParseError(options) {
480
- if (options.format === "json") return true;
481
- if (isJsonFlagSet(options.json) && options.format !== "pretty") return true;
482
- if (options.format !== void 0) return false;
483
- return !process.stdout.isTTY;
484
- }
485
- function emitGlobalFlagParseError(error, options) {
486
- const jsonMode = inferJsonModeForParseError(options);
487
- const flags = {
488
- format: jsonMode ? "json" : "pretty",
489
- explicitFormat: false,
490
- ...jsonMode ? { json: true } : {},
491
- color: false,
492
- verbose: 0,
493
- interactive: false
494
- };
495
- const ui = createTerminalUI(flags);
496
- const exitCode = handleResult(notOk(error), flags, ui);
497
- process.exit(exitCode);
498
- }
499
- /**
500
- * Parses global flags from CLI options.
501
- * Handles verbosity flags (-v, --trace), output format (--format, --json),
502
- * quiet mode, color, interactivity (--interactive/--no-interactive), and
503
- * auto-accept (-y/--yes).
504
- *
505
- * On invalid or conflicting format flags, prints a structured CLI error
506
- * envelope and exits with code 2.
507
- */
508
- function parseGlobalFlagsOrExit(options) {
509
- try {
510
- return parseGlobalFlags(options);
511
- } catch (error) {
512
- if (CliStructuredError$1.is(error)) emitGlobalFlagParseError(error, options);
513
- throw error;
514
- }
515
- }
516
- /**
517
- * Parses global flags from CLI options.
518
- * Handles verbosity flags (-v, --trace), output format (--format, --json),
519
- * quiet mode, color, interactivity (--interactive/--no-interactive), and
520
- * auto-accept (-y/--yes).
521
- *
522
- * Throws {@link CliStructuredError} for invalid or conflicting format flags.
523
- */
524
- function parseGlobalFlags(options) {
525
- const { format, explicitFormat } = resolveOutputFormat(options);
526
- const flags = {
527
- format,
528
- explicitFormat
529
- };
530
- if (format === "json") flags.json = true;
531
- if (options.quiet || options.q) flags.quiet = true;
532
- if (options.trace || process.env["PRISMA_NEXT_TRACE"] === "1") flags.verbose = 2;
533
- else if (options.verbose || options.v || process.env["PRISMA_NEXT_DEBUG"] === "1") flags.verbose = 1;
534
- else flags.verbose = 0;
535
- if (process.env["NO_COLOR"] || flags.json) flags.color = false;
536
- else if (options["no-color"]) flags.color = false;
537
- else if (options.color !== void 0) flags.color = options.color;
538
- else flags.color = process.stdout.isTTY && !isCI$1();
539
- if (options["no-interactive"]) flags.interactive = false;
540
- else if (options.interactive !== void 0) flags.interactive = options.interactive;
541
- else flags.interactive = !!process.stdout.isTTY;
542
- if (options.yes || options.y) flags.yes = true;
543
- return flags;
544
- }
545
- /**
546
- * Bridges the two TTY checks (stdout via `flags`, stdin via
547
- * `process.stdin.isTTY`) into the `canPrompt` boolean the interactive
548
- * `init` flow consumes.
549
- *
550
- * Per the [Style Guide § Interactivity](../../../../../../../docs/CLI%20Style%20Guide.md#interactivity):
551
- *
552
- * - `flags.interactive` governs *decoration* (TerminalUI, intro/outro,
553
- * spinners) and is derived from stdout-TTY by `parseGlobalFlags`,
554
- * honouring `--interactive` / `--no-interactive`.
555
- * - Prompting additionally requires a stdin TTY — closing stdin is a
556
- * common signal in CI / agent environments even when stdout stays
557
- * attached.
558
- * - `--interactive` is the explicit override: when the user passes it,
559
- * we honour it (e.g. testing flows where stdin is stubbed).
560
- *
561
- * Single source of truth for the interactive-prompt decision: both the
562
- * `init` action handler and the preAction telemetry bridge derive
563
- * prompt-eligibility from this helper so they cannot drift. Lives in
564
- * `global-flags` (alongside `parseGlobalFlags`) to keep
565
- * `utils/telemetry` and `commands/init/index` free of an import cycle.
566
- *
567
- * Exported so callers and tests can derive the same value without
568
- * touching `process` globals.
569
- */
570
- function deriveCanPrompt(opts) {
571
- if (opts.optionInteractive === true) return true;
572
- if (opts.flagsInteractive === false) return false;
573
- return opts.stdinIsTTY;
574
- }
575
- const longDescriptions = /* @__PURE__ */ new WeakMap();
576
- const commandExamples = /* @__PURE__ */ new WeakMap();
577
- const commandSeeAlso = /* @__PURE__ */ new WeakMap();
578
- /**
579
- * Sets both short and long descriptions for a command.
580
- * The short description is used in command trees and headers.
581
- * The long description is shown at the bottom of help output.
582
- */
583
- function setCommandDescriptions(command, shortDescription, longDescription) {
584
- command.description(shortDescription);
585
- if (longDescription) longDescriptions.set(command, longDescription);
586
- return command;
587
- }
588
- /**
589
- * Sets copy-pastable examples for a command, shown in help text.
590
- */
591
- function setCommandExamples(command, examples) {
592
- commandExamples.set(command, examples);
593
- return command;
594
- }
595
- /**
596
- * Gets the long description from a command if it was set via setCommandDescriptions.
597
- */
598
- function getLongDescription(command) {
599
- return longDescriptions.get(command);
600
- }
601
- /**
602
- * Gets examples from a command if set via setCommandExamples.
603
- */
604
- function getCommandExamples(command) {
605
- return commandExamples.get(command);
606
- }
607
- /**
608
- * Sets cross-references to related commands, rendered in a "See also"
609
- * section below the Examples block in help output.
610
- */
611
- function setCommandSeeAlso(command, refs) {
612
- commandSeeAlso.set(command, refs);
613
- return command;
614
- }
615
- /**
616
- * Gets the see-also cross-references from a command.
617
- */
618
- function getCommandSeeAlso(command) {
619
- return commandSeeAlso.get(command);
620
- }
621
- /**
622
- * Resolves the absolute path to contract.json from the config.
623
- */
624
- function resolveContractPath(config) {
625
- if (config.contract?.output === void 0) throw errorRuntime$1("CONFIG.VALIDATION_FAILED", "config.contract.output is required to resolve the contract path", {
626
- why: "CLI commands read the emitted contract from config.contract.output; the config has no value to read.",
627
- fix: "Ensure your prisma-next.config.ts goes through `defineConfig()`, which normalises a default output when the provider supplies an input path, or set `contract.output` explicitly."
628
- });
629
- return resolve(config.contract.output);
630
- }
631
- /**
632
- * Resolves the migrations directory and config path from CLI options.
633
- * Shared by migrate, migration-plan, and migration-status.
634
- *
635
- * - `migrationsDir` is the project's top-level `migrations/` directory
636
- * (the root that the aggregate loader walks for every contract space).
637
- * - `appMigrationsDir` is the app subspace directory under it
638
- * (`<migrationsDir>/<APP_SPACE_ID>/`). Every per-app reader / writer
639
- * (`migration new`, `migration plan`, `migrate`,
640
- * `migration status`, `migration show`, `migration ref`) operates on
641
- * this directory. Extensions own their own `migrations/<spaceId>/`.
642
- * - `refsDir` is the app's refs directory (`<appMigrationsDir>/refs/`).
643
- * The framework does not maintain refs at the migrations root.
644
- *
645
- * `cwd` is the directory the command was invoked from; every relative path in
646
- * the result is computed against it.
647
- */
648
- function resolveMigrationPaths(configOption, config, cwd) {
649
- const resolvedConfigPath = configOption ? resolve(cwd, configOption) : void 0;
650
- const configPath = resolvedConfigPath ? relative(cwd, resolvedConfigPath) : "prisma-next.config.ts";
651
- const migrationsDir = resolve(resolvedConfigPath ? resolve(resolvedConfigPath, "..") : cwd, config.migrations?.dir ?? "migrations");
652
- const migrationsRelative = relative(cwd, migrationsDir);
653
- const appMigrationsDir = spaceMigrationDirectory(migrationsDir, APP_SPACE_ID$1);
654
- return {
655
- configPath,
656
- migrationsDir,
657
- migrationsRelative,
658
- appMigrationsDir,
659
- appMigrationsRelative: relative(cwd, appMigrationsDir),
660
- refsDir: resolve(appMigrationsDir, "refs")
661
- };
662
- }
663
- function collectDeclaredInvariants(graph) {
664
- const declared = /* @__PURE__ */ new Set();
665
- for (const edges of graph.forwardChain.values()) for (const edge of edges) for (const inv of edge.invariants) declared.add(inv);
666
- return declared;
667
- }
668
- /**
669
- * Maps a `MigrationEdge` to the structural-edge shape used in the
670
- * `MIGRATION.NO_INVARIANT_PATH` error envelope. Shared between
671
- * `migrate` and `migration status` so both commands surface
672
- * the same JSON wire shape when an invariant-aware route is unsatisfiable.
673
- */
674
- function toStructuralEdge(edge) {
675
- return {
676
- dirName: edge.dirName,
677
- migrationHash: edge.migrationHash,
678
- from: edge.from,
679
- to: edge.to,
680
- invariants: edge.invariants
681
- };
682
- }
683
- function targetSupportsMigrations(target) {
684
- return hasMigrations(target);
685
- }
686
- /**
687
- * Hangs up without letting the hang-up decide the command's result. A rejection out of a
688
- * `finally` replaces the value the `try`/`catch` already returned, so an unguarded close turns a
689
- * mapped connection error into an unmapped one — and that is the case it hits most, because a
690
- * `connect()` that failed leaves nothing to close.
691
- */
692
- async function closeQuietly(client) {
693
- try {
694
- await client.close();
695
- } catch {}
696
- }
697
- function getTargetMigrations(target) {
698
- return hasMigrations(target) ? target.migrations : void 0;
699
- }
700
- /**
701
- * Reads and parses contract.json, validating the framework-level envelope
702
- * fields (storageHash, schemaVersion, target, targetFamily).
703
- *
704
- * Family-specific validation (storage structure, codec mappings, etc.)
705
- * happens downstream in the control client via the family instance.
706
- */
707
- async function readContractEnvelope(config) {
708
- const contractPath = resolveContractPath(config);
709
- const content = await readFile(contractPath, "utf-8");
710
- const json = JSON.parse(content);
711
- const { schemaVersion, target, targetFamily, profileHash } = json;
712
- const storageHash = json["storage"]?.["storageHash"];
713
- if (typeof storageHash !== "string") throw new CliStructuredError$1("CONTRACT.VALIDATION_FAILED", `Contract at ${relative(process.cwd(), contractPath)} is missing a valid storage.storageHash. Run \`prisma-next contract emit\` to regenerate.`, { where: { path: contractPath } });
714
- if (typeof schemaVersion !== "string") throw new CliStructuredError$1("CONTRACT.VALIDATION_FAILED", `Contract at ${relative(process.cwd(), contractPath)} is missing schemaVersion.`, { where: { path: contractPath } });
715
- if (typeof target !== "string") throw new CliStructuredError$1("CONTRACT.VALIDATION_FAILED", `Contract at ${relative(process.cwd(), contractPath)} is missing target.`, { where: { path: contractPath } });
716
- if (typeof targetFamily !== "string") throw new CliStructuredError$1("CONTRACT.VALIDATION_FAILED", `Contract at ${relative(process.cwd(), contractPath)} is missing targetFamily.`, { where: { path: contractPath } });
717
- return {
718
- ...json,
719
- storageHash,
720
- schemaVersion,
721
- target,
722
- targetFamily,
723
- ...typeof profileHash === "string" ? { profileHash } : {}
724
- };
725
- }
726
- /**
727
- * Masks credentials in a database connection URL.
728
- * Handles standard URLs (username + password + query params) and libpq-style key=value strings.
729
- */
730
- function maskConnectionUrl(url) {
731
- try {
732
- const parsed = new URL(url);
733
- if (parsed.username) parsed.username = "****";
734
- if (parsed.password) parsed.password = "****";
735
- for (const key of [...parsed.searchParams.keys()]) if (/password/i.test(key)) parsed.searchParams.set(key, "****");
736
- return parsed.toString();
737
- } catch {
738
- return url.replace(/password\s*=\s*\S+/gi, "password=****").replace(/user\s*=\s*\S+/gi, "user=****");
739
- }
740
- }
741
- /**
742
- * Strips raw connection URL fragments from an error message to prevent credential leakage.
743
- * Call this before surfacing driver errors to the user.
744
- */
745
- function sanitizeErrorMessage(message, connectionUrl) {
746
- if (!connectionUrl) return message;
747
- try {
748
- const parsed = new URL(connectionUrl);
749
- let sanitized = message;
750
- sanitized = sanitized.replaceAll(connectionUrl, maskConnectionUrl(connectionUrl));
751
- if (parsed.password) sanitized = sanitized.replaceAll(parsed.password, "****");
752
- if (parsed.username) sanitized = sanitized.replaceAll(parsed.username, "****");
753
- return sanitized;
754
- } catch {
755
- return message.replace(/password\s*=\s*\S+/gi, "password=****").replace(/user\s*=\s*\S+/gi, "user=****");
756
- }
757
- }
758
- /**
759
- * Registers the global CLI options shared by every command:
760
- * --format, --json, -q/--quiet, -v/--verbose, --trace, --color, --no-color,
761
- * --interactive, --no-interactive, -y/--yes.
762
- *
763
- * Also sets up the styled help formatter.
764
- */
765
- function addGlobalOptions(command) {
766
- return command.configureHelp({ formatHelp: (cmd) => {
767
- return formatCommandHelp({
768
- command: cmd,
769
- flags: parseGlobalFlags({})
770
- });
771
- } }).option("--format <pretty|json>", "Output format (default: pretty, or json when stdout is not a TTY)").option("--json", "Output as JSON (alias for --format json)").option("-q, --quiet", "Quiet mode: errors only").option("-v, --verbose", "Verbose output: debug info, timings").option("--trace", "Trace output: deep internals, stack traces").option("--color", "Force color output").option("--no-color", "Disable color output").option("--interactive", "Force interactive mode").option("--no-interactive", "Disable interactive prompts").option("-y, --yes", "Auto-accept prompts");
772
- }
773
- //#endregion
774
- export { toStructuralEdge as C, targetSupportsMigrations as S, resolveMigrationPaths as _, formatCommandHelp as a, setCommandExamples as b, formatSuccessMessage as c, isCI$1 as d, maskConnectionUrl as f, resolveContractPath as g, readContractEnvelope as h, deriveCanPrompt as i, getTargetMigrations as l, parseGlobalFlagsOrExit as m, closeQuietly as n, formatRootHelp as o, parseGlobalFlags as p, collectDeclaredInvariants as r, formatStyledHeader as s, addGlobalOptions as t, handleResult as u, sanitizeErrorMessage as v, setCommandSeeAlso as x, setCommandDescriptions as y };
775
-
776
- //# sourceMappingURL=command-helpers-BCgwcqTe-lNCtppzM.mjs.map