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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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-C-jirr19-DDQB0WGo.mjs +0 -295
  172. package/dist/code-templates-C-jirr19-DDQB0WGo.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-DC7zPKka-BSiUrPw3.mjs +0 -800
  218. package/dist/init-DC7zPKka-BSiUrPw3.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-DuKoiMax-Cfe2XVhc.mjs +0 -1476
  279. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.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,676 +0,0 @@
1
- import { ifDefined } from "@prisma/orm-framework/utils/defined";
2
- import { blindCast } from "@prisma/orm-framework/utils/casts";
3
- import { bold, cyan, dim, green, red, yellow } from "colorette";
4
- import * as clack from "@clack/prompts";
5
- //#region ../../../1-framework/3-tooling/cli/dist/terminal-ui-Cqz4LVL7.mjs
6
- /**
7
- * Checks if verbose output is enabled at the specified level.
8
- */
9
- function isVerbose(flags, level) {
10
- return (flags.verbose ?? 0) >= level;
11
- }
12
- /**
13
- * Creates a color-aware formatter function.
14
- * Returns a function that applies the color only if colors are enabled.
15
- */
16
- function createColorFormatter(useColor, colorFn) {
17
- return useColor ? colorFn : (text) => text;
18
- }
19
- /**
20
- * Formats text with dim styling if colors are enabled.
21
- */
22
- function formatDim(useColor, text) {
23
- return useColor ? dim(text) : text;
24
- }
25
- /**
26
- * The binary this package installs. Next-action commands are authored with a
27
- * `{bin}` placeholder and rendered against this name, so no library-layer
28
- * error hardcodes it.
29
- *
30
- * `test/output.next-actions.test.ts` asserts this stays equal to the sole key
31
- * of the package manifest's `bin` map.
32
- */
33
- const BIN_NAME = "prisma-next";
34
- /**
35
- * Render a single statement of an `OperationPreview` for the human-readable
36
- * preview block. SQL statements get a trailing `;` if missing so the rendered
37
- * preview is byte-identical to the legacy `string[]`-based renderer for SQL
38
- * targets. Other languages (`'mongodb-shell'`) render verbatim.
39
- */
40
- function renderPreviewStatement(text, language) {
41
- const trimmed = text.trim();
42
- if (!trimmed) return void 0;
43
- if (language === "sql") return trimmed.endsWith(";") ? trimmed : `${trimmed};`;
44
- return trimmed;
45
- }
46
- /**
47
- * Choose the header label for a preview block. SQL-only previews keep the
48
- * legacy `DDL preview` label so the rendered output is byte-identical to the
49
- * pre-aggregate SQL CLI; previews from any other family — or a mix that
50
- * includes any non-SQL language — use the family-agnostic `Operation preview`
51
- * label.
52
- *
53
- * An empty `statements` array deliberately renders as `Operation preview`
54
- * rather than `DDL preview`: `Array.prototype.every` is vacuously true for
55
- * empty arrays, but we have no evidence the preview is SQL-only when no
56
- * statements are present, so the family-agnostic label is the safer default.
57
- */
58
- function previewBlockHeader(preview) {
59
- return preview.statements.length > 0 && preview.statements.every((s) => s.language === "sql") ? "DDL preview" : "Operation preview";
60
- }
61
- function formatPlannerWarningsBlock(warnings, useColor) {
62
- const formatDimText = (text) => formatDim(useColor, text);
63
- const lines = ["", "Warnings:"];
64
- for (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);
65
- return lines;
66
- }
67
- /**
68
- * Render the shared per-space execution block consumed by the `db init`
69
- * / `db update` / `migrate` summaries. Always shows: space
70
- * label (`Extension space: <id>` or `App space`) → per-op lines under
71
- * each space → per-space marker hash (when known).
72
- *
73
- * `mode` controls the marker label phrasing — `'apply'` shows
74
- * `marker → <hash>` (post-apply), `'plan'` omits the marker line
75
- * entirely (no marker has been written yet).
76
- */
77
- function formatPerSpaceBlock(perSpace, mode, useColor) {
78
- const formatYellow = createColorFormatter(useColor, yellow);
79
- const formatCyan = createColorFormatter(useColor, cyan);
80
- const formatDimText = (text) => formatDim(useColor, text);
81
- const lines = [];
82
- for (let s = 0; s < perSpace.length; s++) {
83
- const space = perSpace[s];
84
- if (s > 0) lines.push("");
85
- const header = space.kind === "app" ? formatCyan("App space") : formatCyan(`Extension space: ${space.spaceId}`);
86
- lines.push(header);
87
- if (space.operations.length === 0) lines.push(` ${formatDimText("(no operations)")}`);
88
- else for (let i = 0; i < space.operations.length; i++) {
89
- const op = space.operations[i];
90
- const treeChar = i === space.operations.length - 1 ? "└" : "├";
91
- const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
92
- lines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
93
- }
94
- if (mode === "apply" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);
95
- }
96
- return lines;
97
- }
98
- /**
99
- * Formats human-readable output for migration commands (db init, db update) in plan mode.
100
- */
101
- function formatMigrationPlanOutput(result, flags) {
102
- if (flags.quiet) return "";
103
- const lines = [];
104
- const useColor = flags.color !== false;
105
- const formatGreen = createColorFormatter(useColor, green);
106
- const formatDimText = (text) => formatDim(useColor, text);
107
- const operationCount = result.plan?.operations.length ?? 0;
108
- const spaceCount = result.perSpace?.length ?? 0;
109
- if (spaceCount > 0) lines.push(`${formatGreen("✔")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}`);
110
- else lines.push(`${formatGreen("✔")} Planned ${operationCount} operation(s)`);
111
- if (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));
112
- const formatYellow = createColorFormatter(useColor, yellow);
113
- if (result.perSpace && result.perSpace.length > 0) {
114
- lines.push("");
115
- lines.push(...formatPerSpaceBlock(result.perSpace, "plan", useColor));
116
- if (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === "destructive"))) {
117
- lines.push("");
118
- lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
119
- }
120
- } else if (result.plan?.operations && result.plan.operations.length > 0) {
121
- lines.push(`${formatDimText("│")}`);
122
- for (let i = 0; i < result.plan.operations.length; i++) {
123
- const op = result.plan.operations[i];
124
- if (!op) continue;
125
- const treeChar = i === result.plan.operations.length - 1 ? "└" : "├";
126
- const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
127
- lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
128
- }
129
- if (result.plan.operations.some((op) => op.operationClass === "destructive")) {
130
- lines.push("");
131
- lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
132
- }
133
- }
134
- if (result.plan?.destination) {
135
- lines.push("");
136
- lines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);
137
- }
138
- if (result.plannedAdvanceRef) {
139
- lines.push("");
140
- lines.push(formatDimText(`Would advance ref "${result.plannedAdvanceRef.name}" → ${result.plannedAdvanceRef.hash}`));
141
- }
142
- const preview = result.plan?.preview;
143
- if (preview) {
144
- lines.push("");
145
- lines.push(`${formatDimText(previewBlockHeader(preview))}`);
146
- if (preview.statements.length === 0) lines.push(`${formatDimText("No operations.")}`);
147
- else {
148
- lines.push("");
149
- for (const statement of preview.statements) {
150
- const rendered = renderPreviewStatement(statement.text, statement.language);
151
- if (rendered) lines.push(rendered);
152
- }
153
- }
154
- }
155
- if (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);
156
- lines.push("");
157
- lines.push(`${formatDimText("This is a dry run. No changes were applied.")}`);
158
- lines.push(`${formatDimText("Run without --dry-run to apply changes.")}`);
159
- return lines.join("\n");
160
- }
161
- function formatMigrationApplyCommandOutput(result, flags) {
162
- if (flags.quiet) return "";
163
- const lines = [];
164
- const useColor = flags.color !== false;
165
- const formatGreen = createColorFormatter(useColor, green);
166
- const formatDimText = (text) => formatDim(useColor, text);
167
- lines.push(`${formatGreen("✔")} ${result.summary}`);
168
- if (result.perSpace.length > 0) {
169
- lines.push("");
170
- for (const line of formatPerSpaceBlock(result.perSpace, "apply", useColor)) lines.push(line);
171
- }
172
- if (result.advancedRef) {
173
- lines.push("");
174
- lines.push(formatDimText(`Advanced ref "${result.advancedRef.name}" → ${result.advancedRef.hash}`));
175
- }
176
- lines.push("");
177
- lines.push(formatDimText("Next: prisma-next migration status"));
178
- if (isVerbose(flags, 1) && result.timings) {
179
- lines.push("");
180
- lines.push(formatDimText(`Total time: ${result.timings.total}ms`));
181
- }
182
- return lines.join("\n");
183
- }
184
- function formatSpaceShowBlock(space, useColor) {
185
- const formatGreen = createColorFormatter(useColor, green);
186
- const formatYellow = createColorFormatter(useColor, yellow);
187
- const formatDimText = (text) => formatDim(useColor, text);
188
- const lines = [];
189
- lines.push(`${formatGreen("✔")} ${space.name}`);
190
- lines.push(`${formatDimText(` from: ${space.fromContract ?? "(baseline)"}`)}`);
191
- lines.push(`${formatDimText(` to: ${space.toContract}`)}`);
192
- lines.push(`${formatDimText(` hash: ${space.hash}`)}`);
193
- lines.push(`${formatDimText(` created: ${space.createdAt}`)}`);
194
- lines.push("");
195
- lines.push(`${space.operations.length} operation(s)`);
196
- if (space.operations.length > 0) {
197
- lines.push(`${formatDimText("│")}`);
198
- for (let i = 0; i < space.operations.length; i++) {
199
- const op = space.operations[i];
200
- const treeChar = i === space.operations.length - 1 ? "└" : "├";
201
- const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
202
- lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
203
- }
204
- if (space.operations.some((op) => op.operationClass === "destructive")) {
205
- lines.push("");
206
- lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
207
- }
208
- }
209
- if (space.preview.statements.length > 0) {
210
- lines.push("");
211
- lines.push(`${formatDimText(previewBlockHeader(space.preview))}`);
212
- lines.push("");
213
- for (const statement of space.preview.statements) {
214
- const rendered = renderPreviewStatement(statement.text, statement.language);
215
- if (rendered) lines.push(rendered);
216
- }
217
- }
218
- return lines;
219
- }
220
- function formatMigrationShowOutput(result, flags) {
221
- if (flags.quiet) return "";
222
- const useColor = flags.color !== false;
223
- return formatSpaceShowBlock(result.migration, useColor).join("\n");
224
- }
225
- /**
226
- * Formats human-readable output for migration commands (db init, db update) in apply mode.
227
- */
228
- function formatMigrationApplyOutput(result, flags) {
229
- if (flags.quiet) return "";
230
- const lines = [];
231
- const useColor = flags.color !== false;
232
- const formatGreen = createColorFormatter(useColor, green);
233
- const formatDimText = (text) => formatDim(useColor, text);
234
- if (result.ok) {
235
- const executed = result.execution?.operationsExecuted ?? 0;
236
- const spaceCount = result.perSpace?.length ?? 0;
237
- if (executed === 0) {
238
- const acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}` : "";
239
- lines.push(`${formatGreen("✔")} Database already matches contract${acrossClause}`);
240
- } else if (spaceCount > 0) lines.push(`${formatGreen("✔")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? "" : "s"}`);
241
- else lines.push(`${formatGreen("✔")} Applied ${executed} operation(s)`);
242
- if (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));
243
- if (result.perSpace && result.perSpace.length > 0) {
244
- lines.push("");
245
- lines.push(...formatPerSpaceBlock(result.perSpace, "apply", useColor));
246
- lines.push("");
247
- lines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? "the space is" : "all spaces are"} up to date.`));
248
- } else if (result.marker) {
249
- lines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);
250
- if (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);
251
- }
252
- if (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);
253
- if (result.advancedRef) lines.push(formatDimText(`Advanced ref "${result.advancedRef.name}" → ${result.advancedRef.hash}`));
254
- }
255
- return lines.join("\n");
256
- }
257
- /**
258
- * Formats JSON output for migration commands (db init, db update).
259
- */
260
- function formatMigrationJson(result) {
261
- return JSON.stringify(result, null, 2);
262
- }
263
- const BIN_PLACEHOLDER = "{bin}";
264
- /**
265
- * Rewrite the `{bin}` placeholder in every next-action command to `binName`.
266
- *
267
- * Library-layer error factories cannot know which binary the user invoked, so
268
- * they write `{bin} ref set <name> <hash>`. Every surface that renders or
269
- * serializes an envelope resolves the placeholder first, so a consumer only
270
- * ever sees a command that is runnable as written.
271
- */
272
- function resolveBinPlaceholder(envelope, binName) {
273
- const substitute = (command) => command.replaceAll(BIN_PLACEHOLDER, binName);
274
- const resolved = envelope.nextActions.map((action) => ({
275
- ...action,
276
- ...ifDefined("command", action.command?.replaceAll(BIN_PLACEHOLDER, binName)),
277
- ...ifDefined("commands", action.commands?.map(substitute))
278
- }));
279
- return {
280
- ...envelope,
281
- nextActions: resolved
282
- };
283
- }
284
- /**
285
- * The display label for a schema-diff issue in the shared error envelope,
286
- * derived from which sides are present: expected-only is a missing object,
287
- * actual-only an extra one, both a mismatch. `undefined` when the entry is not
288
- * a schema-diff issue (it carries neither side) so the caller can fall through
289
- * to its generic label.
290
- */
291
- function schemaDiffIssueLabel(issue) {
292
- const hasExpected = issue.expected !== void 0;
293
- const hasActual = issue.actual !== void 0;
294
- if (hasExpected && hasActual) return "mismatch";
295
- if (hasExpected) return "missing";
296
- if (hasActual) return "extra";
297
- }
298
- /**
299
- * Formats error output for human-readable display.
300
- */
301
- function formatErrorOutput(error, flags) {
302
- const lines = [];
303
- const useColor = flags.color !== false;
304
- const formatRed = createColorFormatter(useColor, red);
305
- const formatDimText = (text) => formatDim(useColor, text);
306
- lines.push(`${formatRed("✖")} ${error.summary} (${error.code})`);
307
- if (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);
308
- if (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);
309
- if (error.where?.path) {
310
- const whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;
311
- lines.push(`${formatDimText(` Where: ${whereLine}`)}`);
312
- }
313
- if (error.meta?.["conflicts"]) {
314
- const conflicts = error.meta["conflicts"];
315
- if (conflicts.length > 0) {
316
- const maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);
317
- const header = isVerbose(flags, 1) ? " Conflicts:" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;
318
- lines.push(`${formatDimText(header)}`);
319
- for (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);
320
- if (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(" Re-run with -v/--verbose to see all conflicts")}`);
321
- }
322
- }
323
- if (error.meta?.["issues"]) {
324
- const issues = error.meta["issues"];
325
- if (issues.length > 0) {
326
- const maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);
327
- const header = isVerbose(flags, 1) ? " Issues:" : ` Issues (showing ${maxToShow} of ${issues.length}):`;
328
- lines.push(`${formatDimText(header)}`);
329
- for (const issue of issues.slice(0, maxToShow)) {
330
- const label = issue.kind ?? schemaDiffIssueLabel(issue) ?? "issue";
331
- const message = issue.message ?? issue.path?.join("/") ?? "";
332
- lines.push(`${formatDimText(` - [${label}] ${message}`)}`);
333
- }
334
- if (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(" Re-run with -v/--verbose to see all issues")}`);
335
- }
336
- }
337
- if (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));
338
- const plannerWarnings = error.meta?.["plannerWarnings"];
339
- if (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {
340
- const typedWarnings = blindCast(plannerWarnings);
341
- lines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));
342
- }
343
- if (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);
344
- return lines.join("\n");
345
- }
346
- /**
347
- * Formats error output as JSON.
348
- */
349
- function formatErrorJson(error) {
350
- return JSON.stringify(resolveBinPlaceholder(error, BIN_NAME), null, 2);
351
- }
352
- function localeString(env) {
353
- return env["LC_ALL"] ?? env["LC_CTYPE"] ?? env["LANG"] ?? "";
354
- }
355
- function isUtf8Locale(env) {
356
- const locale = localeString(env);
357
- if (locale.length === 0) return false;
358
- return /UTF-8|utf8/i.test(locale);
359
- }
360
- function detectGlyphMode(input) {
361
- if (!input.isTTY) return "ascii";
362
- if (!isUtf8Locale(input.env)) return "ascii";
363
- return "unicode";
364
- }
365
- function createShutdownHandler(options) {
366
- const exit = options?.exit ?? ((code) => process.exit(code));
367
- const gracePeriodMs = options?.gracePeriodMs ?? 3e3;
368
- const controller = new AbortController();
369
- let shuttingDown = false;
370
- let graceTimer;
371
- const onSignal = () => {
372
- if (shuttingDown) {
373
- exit(130);
374
- return;
375
- }
376
- shuttingDown = true;
377
- controller.abort();
378
- graceTimer = setTimeout(() => exit(130), gracePeriodMs);
379
- graceTimer.unref();
380
- };
381
- return {
382
- signal: controller.signal,
383
- isShuttingDown: () => shuttingDown,
384
- onSignal,
385
- clearGraceTimer: () => {
386
- if (graceTimer !== void 0) {
387
- clearTimeout(graceTimer);
388
- graceTimer = void 0;
389
- }
390
- }
391
- };
392
- }
393
- const globalHandler = createShutdownHandler();
394
- /**
395
- * The global AbortSignal. Pass this to any async operation that should
396
- * be cancellable on Ctrl+C (e.g., DB queries, long-running emit).
397
- */
398
- const shutdownSignal = globalHandler.signal;
399
- /**
400
- * Installs SIGINT and SIGTERM handlers. Call once at CLI startup.
401
- *
402
- * - First signal: aborts the controller, starts a 3s grace timer.
403
- * - Second signal: force-exits immediately.
404
- */
405
- let installed = false;
406
- function installShutdownHandlers() {
407
- if (installed) return;
408
- installed = true;
409
- process.on("SIGINT", globalHandler.onSignal);
410
- process.on("SIGTERM", globalHandler.onSignal);
411
- }
412
- /**
413
- * Composable CLI output abstraction.
414
- *
415
- * Follows the Unix convention of separating data from decoration:
416
- * - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.
417
- * - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.
418
- *
419
- * Rules:
420
- * 1. All methods except `output()` and `error()` write to stderr only in interactive mode.
421
- * 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.
422
- * 3. `error()` always writes to stderr — errors matter even when piped.
423
- * 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).
424
- * 5. Never write data to stderr — decoration methods are for human context only.
425
- * 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.
426
- */
427
- var TerminalUI = class TerminalUI {
428
- /**
429
- * True when stdout is a TTY (interactive terminal).
430
- * False when piped (e.g., `prisma-next db verify | jq`).
431
- */
432
- isInteractive;
433
- /**
434
- * Whether color output is enabled.
435
- */
436
- useColor;
437
- /**
438
- * When true, decoration methods write even on non-TTY stdout
439
- * (explicit `--format pretty`).
440
- */
441
- forcePretty;
442
- /**
443
- * Whether stdout is a TTY — used for migration-list graph glyph detection.
444
- */
445
- stdoutIsTTY;
446
- /**
447
- * Process environment snapshot for locale-aware glyph detection.
448
- */
449
- env;
450
- static stderrOpts = { output: process.stderr };
451
- constructor(options) {
452
- this.isInteractive = options?.interactive ?? !!process.stdout.isTTY;
453
- this.forcePretty = options?.forcePretty ?? false;
454
- this.useColor = options?.color ?? (this.isInteractive || this.forcePretty);
455
- this.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;
456
- this.env = options?.env ?? process.env;
457
- }
458
- get isTTY() {
459
- return this.stdoutIsTTY;
460
- }
461
- /**
462
- * Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;
463
- * otherwise delegates to the pure {@link detectGlyphMode} helper.
464
- */
465
- resolveGlyphMode(forceAscii) {
466
- if (forceAscii) return "ascii";
467
- return detectGlyphMode(this.glyphModeInput());
468
- }
469
- glyphModeInput() {
470
- return {
471
- isTTY: this.stdoutIsTTY,
472
- env: this.env
473
- };
474
- }
475
- get shouldDecorate() {
476
- return this.isInteractive || this.forcePretty;
477
- }
478
- /**
479
- * Log a message line to stderr. No-op when piped unless forcePretty.
480
- */
481
- log(message) {
482
- if (!this.shouldDecorate) return;
483
- clack.log.message(message, TerminalUI.stderrOpts);
484
- }
485
- /**
486
- * Log a success message to stderr. No-op when piped unless forcePretty.
487
- */
488
- success(message) {
489
- if (!this.shouldDecorate) return;
490
- clack.log.success(message, TerminalUI.stderrOpts);
491
- }
492
- /**
493
- * Log a warning message to stderr. No-op when piped unless forcePretty.
494
- */
495
- warn(message) {
496
- if (!this.shouldDecorate) return;
497
- clack.log.warn(message, TerminalUI.stderrOpts);
498
- }
499
- /**
500
- * Log an error message to stderr. Always writes (errors matter even in pipes).
501
- */
502
- error(message) {
503
- clack.log.error(message, TerminalUI.stderrOpts);
504
- }
505
- /**
506
- * Log an info message to stderr. No-op when piped unless forcePretty.
507
- */
508
- info(message) {
509
- if (!this.shouldDecorate) return;
510
- clack.log.info(message, TerminalUI.stderrOpts);
511
- }
512
- /**
513
- * Log a step message to stderr. No-op when piped unless forcePretty.
514
- */
515
- step(message) {
516
- if (!this.shouldDecorate) return;
517
- clack.log.step(message, TerminalUI.stderrOpts);
518
- }
519
- /**
520
- * Display a note box on stderr. No-op when piped unless forcePretty.
521
- */
522
- note(message, title) {
523
- if (!this.shouldDecorate) return;
524
- clack.note(message, title, TerminalUI.stderrOpts);
525
- }
526
- /**
527
- * Display intro banner on stderr. No-op when piped unless forcePretty.
528
- */
529
- intro(title) {
530
- if (!this.shouldDecorate) return;
531
- clack.intro(title, TerminalUI.stderrOpts);
532
- }
533
- /**
534
- * Display outro banner on stderr. No-op when piped unless forcePretty.
535
- */
536
- outro(message) {
537
- if (!this.shouldDecorate) return;
538
- clack.outro(message, TerminalUI.stderrOpts);
539
- }
540
- /**
541
- * Create a Clack spinner on stderr with a 100ms delay threshold.
542
- * The spinner only appears if the operation takes longer than the threshold,
543
- * avoiding flicker for fast operations. Returns a no-op spinner when not decorating.
544
- */
545
- spinner(delayMs = 100) {
546
- const noop = {
547
- start: () => {},
548
- stop: () => {},
549
- cancel: () => {},
550
- error: () => {},
551
- message: () => {},
552
- clear: () => {},
553
- get isCancelled() {
554
- return false;
555
- }
556
- };
557
- if (!this.shouldDecorate) return noop;
558
- let inner;
559
- let timer;
560
- let pendingMsg;
561
- let settled = false;
562
- const ensureCleared = () => {
563
- if (timer !== void 0) {
564
- clearTimeout(timer);
565
- timer = void 0;
566
- }
567
- };
568
- const onAbort = () => {
569
- if (!settled) {
570
- settled = true;
571
- ensureCleared();
572
- if (inner) inner.cancel("Interrupted");
573
- }
574
- };
575
- if (!shutdownSignal.aborted) shutdownSignal.addEventListener("abort", onAbort, { once: true });
576
- return {
577
- start(msg) {
578
- pendingMsg = msg;
579
- timer = setTimeout(() => {
580
- if (!settled) {
581
- inner = clack.spinner(TerminalUI.stderrOpts);
582
- inner.start(pendingMsg);
583
- }
584
- }, delayMs);
585
- },
586
- stop(msg) {
587
- settled = true;
588
- ensureCleared();
589
- if (inner) inner.stop(msg);
590
- },
591
- cancel(msg) {
592
- settled = true;
593
- ensureCleared();
594
- if (inner) inner.cancel(msg);
595
- },
596
- error(msg) {
597
- settled = true;
598
- ensureCleared();
599
- if (inner) inner.error(msg);
600
- },
601
- message(msg) {
602
- pendingMsg = msg;
603
- if (inner) inner.message(msg);
604
- },
605
- clear() {
606
- settled = true;
607
- ensureCleared();
608
- if (inner) inner.clear();
609
- },
610
- get isCancelled() {
611
- return inner?.isCancelled ?? false;
612
- }
613
- };
614
- }
615
- /**
616
- * Prompt for yes/no confirmation on stderr. Returns true if confirmed.
617
- * In non-interactive mode or when cancelled (Ctrl-C), returns false.
618
- */
619
- async confirm(message) {
620
- if (!this.isInteractive) return false;
621
- const result = await clack.confirm({
622
- message,
623
- ...TerminalUI.stderrOpts
624
- });
625
- if (clack.isCancel(result)) return false;
626
- return result;
627
- }
628
- /**
629
- * Write a raw line to stderr. No-op when piped unless forcePretty.
630
- * Use for decoration that doesn't fit Clack's log format (e.g. styled headers).
631
- */
632
- stderr(message) {
633
- if (!this.shouldDecorate) return;
634
- process.stderr.write(`${message}\n`);
635
- }
636
- /**
637
- * Write machine-readable data to stdout.
638
- * Always writes — if a command calls output(), there is data to emit.
639
- *
640
- * This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`
641
- */
642
- output(data) {
643
- process.stdout.write(`${data}\n`);
644
- }
645
- green(text) {
646
- return this.useColor ? green(text) : text;
647
- }
648
- red(text) {
649
- return this.useColor ? red(text) : text;
650
- }
651
- cyan(text) {
652
- return this.useColor ? cyan(text) : text;
653
- }
654
- dim(text) {
655
- return this.useColor ? dim(text) : text;
656
- }
657
- bold(text) {
658
- return this.useColor ? bold(text) : text;
659
- }
660
- yellow(text) {
661
- return this.useColor ? yellow(text) : text;
662
- }
663
- };
664
- function createTerminalUI(flags, runtime) {
665
- return new TerminalUI({
666
- color: flags.color,
667
- interactive: flags.interactive,
668
- forcePretty: flags.format === "pretty" && flags.explicitFormat,
669
- stdoutIsTTY: runtime?.isTTY,
670
- env: runtime?.env
671
- });
672
- }
673
- //#endregion
674
- export { formatErrorJson as a, formatMigrationApplyOutput as c, formatMigrationShowOutput as d, installShutdownHandlers as f, renderPreviewStatement as h, formatDim as i, formatMigrationJson as l, previewBlockHeader as m, createColorFormatter as n, formatErrorOutput as o, isVerbose as p, createTerminalUI as r, formatMigrationApplyCommandOutput as s, BIN_NAME as t, formatMigrationPlanOutput as u };
675
-
676
- //# sourceMappingURL=terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map