@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,15 +1,19 @@
1
- import { a as resolveGating, c as sanitizeCommanderResult, d as writeUserConfig, i as readUserConfig, l as senderModuleUrl, n as TELEMETRY_ENDPOINT_PATH, o as resolveTelemetryEndpoint, r as ensureInstallationId, s as runTelemetry, t as TELEMETRY_BACKEND_URL, u as userConfigPath } from "./exports-CqNUihkI.mjs";
2
- import "pathe";
3
- import "node:fs";
1
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
2
  import { blindCast } from "@prisma/orm-framework/utils/casts";
3
+ import { dirname, join } from "pathe";
4
+ import { randomUUID } from "node:crypto";
5
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
6
+ import { homedir } from "node:os";
7
+ import { fork } from "node:child_process";
8
+ import { fileURLToPath } from "node:url";
5
9
  import "@vercel/detect-agent";
6
- //#region ../../../1-framework/3-tooling/cli-telemetry/dist/enrich-BKPD0fEi.mjs
10
+ //#region ../../../1-framework/3-tooling/cli-telemetry/dist/enrich-IkV4Zai4.mjs
7
11
  const EMPTY_PROJECT_CONFIG = {
8
12
  databaseTarget: null,
9
13
  extensions: []
10
14
  };
11
15
  /**
12
- * Best-effort load of `prisma-next.config.*` from `projectRoot`,
16
+ * Best-effort load of `prisma.config.*` from `projectRoot`,
13
17
  * validated against the canonical `@internal/config` schema.
14
18
  * Returns `{ databaseTarget: null, extensions: [] }` on any failure
15
19
  * mode — missing config file (e.g. before `prisma-next init`), c12
@@ -25,14 +29,22 @@ const EMPTY_PROJECT_CONFIG = {
25
29
  async function loadProjectConfig(projectRoot) {
26
30
  try {
27
31
  const { loadConfig } = await import("c12");
28
- const config = (await loadConfig({
29
- name: "prisma-next",
32
+ const load = (name) => loadConfig({
33
+ name,
30
34
  cwd: projectRoot,
31
35
  dotenv: false,
32
36
  rcFile: false,
33
37
  globalRc: false
34
- })).config ?? null;
38
+ });
39
+ let result = await load("prisma");
40
+ if (!result.config || Object.keys(result.config).length === 0) result = await load("prisma-next");
41
+ let config = result.config ?? null;
35
42
  if (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;
43
+ if (config["$prismaConfig"] !== void 0) {
44
+ const orm = config["orm"];
45
+ if (orm === null || typeof orm !== "object" || Array.isArray(orm)) return EMPTY_PROJECT_CONFIG;
46
+ config = blindCast(orm);
47
+ }
36
48
  if ((await import("@prisma/orm-framework/config/config-validation")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;
37
49
  const validConfig = blindCast(config);
38
50
  return {
@@ -44,6 +56,273 @@ async function loadProjectConfig(projectRoot) {
44
56
  }
45
57
  }
46
58
  //#endregion
59
+ //#region ../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs
60
+ /**
61
+ * Production endpoint pinned to the deployed Prisma Compute backend.
62
+ * Compiled as a build-time constant; not user-configurable.
63
+ */
64
+ const TELEMETRY_BACKEND_URL = "https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build";
65
+ /**
66
+ * Path within the backend that accepts telemetry POSTs.
67
+ */
68
+ const TELEMETRY_ENDPOINT_PATH = "/events";
69
+ /**
70
+ * Resolve the full POST URL the sender targets. The
71
+ * `PRISMA_NEXT_TELEMETRY_ENDPOINT` env var is an integration-testing
72
+ * affordance only — it lets the test suite spin up a mock HTTP server
73
+ * on an ephemeral port and point the spawned sender at it. The override
74
+ * is intentionally undocumented in user-facing material.
75
+ *
76
+ * Fail-open: a malformed override (typo in a dev shell, bad CI config)
77
+ * silently falls back to the production backend rather than throwing,
78
+ * matching the telemetry layer's broader silent-on-failure contract.
79
+ */
80
+ function resolveTelemetryEndpoint(env = process.env) {
81
+ const override = env["PRISMA_NEXT_TELEMETRY_ENDPOINT"];
82
+ const base = override !== void 0 && override.length > 0 ? override : TELEMETRY_BACKEND_URL;
83
+ try {
84
+ return new URL(TELEMETRY_ENDPOINT_PATH, base).toString();
85
+ } catch {
86
+ return new URL(TELEMETRY_ENDPOINT_PATH, TELEMETRY_BACKEND_URL).toString();
87
+ }
88
+ }
89
+ /**
90
+ * A `PRISMA_NEXT_DISABLE_TELEMETRY` value counts as an opt-out only if
91
+ * it parses as a truthy string. The set-but-falsy spellings (`''`,
92
+ * `'0'`, `'false'`) are intentionally treated as not-set so a parent
93
+ * shell that exports the variable to a benign value doesn't accidentally
94
+ * disable telemetry for child processes.
95
+ */
96
+ function isTruthyOptOut(raw) {
97
+ if (raw === void 0) return false;
98
+ const normalised = raw.trim().toLowerCase();
99
+ if (normalised === "") return false;
100
+ if (normalised === "0") return false;
101
+ if (normalised === "false") return false;
102
+ return true;
103
+ }
104
+ /**
105
+ * Pure-function resolution of the gating decision. Same input → same
106
+ * output; no I/O. The caller is responsible for reading the env and the
107
+ * user config.
108
+ *
109
+ * Decision order:
110
+ * 1. Env-var override (`PRISMA_NEXT_DISABLE_TELEMETRY` truthy, or
111
+ * `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an
112
+ * opt-out env var wins over any stored or unset preference.
113
+ * 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).
114
+ * 3. Stored `enableTelemetry === true` → enabled.
115
+ * 4. Stored `enableTelemetry === undefined` (file missing, or field
116
+ * not set) → ENABLED. This is the opt-out default: absence of an
117
+ * explicit choice means telemetry is on. This is the load-bearing,
118
+ * counter-intuitive branch — do not "fix" it to default-off.
119
+ *
120
+ * Telemetry is disabled only when an env override is active or
121
+ * `enableTelemetry` is explicitly `false`.
122
+ */
123
+ function resolveGating(inputs) {
124
+ if (isTruthyOptOut(inputs.env["PRISMA_NEXT_DISABLE_TELEMETRY"]) || inputs.env["DO_NOT_TRACK"] === "1") return {
125
+ enabled: false,
126
+ reason: "env-override"
127
+ };
128
+ if (inputs.config.enableTelemetry === false) return {
129
+ enabled: false,
130
+ reason: "stored-opt-out"
131
+ };
132
+ return { enabled: true };
133
+ }
134
+ function flagNameFromLongName(longName) {
135
+ if (longName === null || !longName.startsWith("--")) return null;
136
+ const withoutPrefix = longName.slice(2);
137
+ return withoutPrefix.length > 0 ? withoutPrefix : null;
138
+ }
139
+ /**
140
+ * Project commander's parsed result into the wire-shape command and
141
+ * flag-name list. Pure; the only allowed inputs are the fields of
142
+ * `CommanderResultShape`.
143
+ *
144
+ * Sanitiser contract — no flag values, no positionals, no raw argv:
145
+ * - Drop the root program name (`commandPath[0]`); the wire ships
146
+ * `migration new`, not `prisma-next migration new`.
147
+ * - Emit only options whose Commander source is `cli`.
148
+ * - Emit the long user-facing flag spelling without the `--` prefix;
149
+ * never emit Commander's camelCase attribute names.
150
+ * - `positionalArgs` is accepted but never consumed; the field exists
151
+ * in the input type to make it obvious at the call site that
152
+ * positionals were deliberately excluded.
153
+ */
154
+ function sanitizeCommanderResult(input) {
155
+ return {
156
+ command: input.commandPath.slice(1).join(" "),
157
+ flags: input.options.flatMap((option) => {
158
+ if (option.source !== "cli") return [];
159
+ const flagName = flagNameFromLongName(option.longName);
160
+ return flagName === null ? [] : [flagName];
161
+ })
162
+ };
163
+ }
164
+ const APP_DIR = "prisma-next";
165
+ const FILE_NAME = "config.json";
166
+ /**
167
+ * Resolves the user-level config directory:
168
+ * - Windows: `%APPDATA%\prisma-next\` (fallback: `%USERPROFILE%\AppData\Roaming\prisma-next\`).
169
+ * - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-next/` if set, else
170
+ * `$HOME/.config/prisma-next/` per the XDG Base Directory Specification.
171
+ *
172
+ * The spec deliberately picks XDG over the macOS-native
173
+ * `~/Library/Preferences/` convention so the path resolution is
174
+ * test-overridable via `XDG_CONFIG_HOME` and matches the documented
175
+ * behaviour on all *nix platforms. We intentionally do not use
176
+ * `env-paths`: its macOS choice of `~/Library/Preferences` is for
177
+ * OS-managed plist preferences, not arbitrary JSON files. Apple documents
178
+ * that apps access that directory through system APIs such as
179
+ * `NSUserDefaults`, while cross-platform CLI and developer tools conventionally
180
+ * use `~/.config` on macOS too:
181
+ * https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html
182
+ */
183
+ function configDir() {
184
+ if (process.platform === "win32") {
185
+ const appData = process.env["APPDATA"];
186
+ if (appData !== void 0 && appData.length > 0) return join(appData, APP_DIR);
187
+ return join(homedir(), "AppData", "Roaming", APP_DIR);
188
+ }
189
+ const xdg = process.env["XDG_CONFIG_HOME"];
190
+ if (xdg !== void 0 && xdg.length > 0) return join(xdg, APP_DIR);
191
+ return join(homedir(), ".config", APP_DIR);
192
+ }
193
+ /**
194
+ * Path to the user-level config file. Resolved per call so test
195
+ * harnesses can mutate `$XDG_CONFIG_HOME` between cases.
196
+ */
197
+ function userConfigPath() {
198
+ return join(configDir(), FILE_NAME);
199
+ }
200
+ /**
201
+ * Reads the user-level config. File-missing, unreadable, or malformed →
202
+ * `{}` (the absence of consent is the same answer in every error mode).
203
+ * Unknown fields from a future client are passed through verbatim.
204
+ */
205
+ function readUserConfig() {
206
+ const path = userConfigPath();
207
+ if (!existsSync(path)) return {};
208
+ try {
209
+ const raw = readFileSync(path, "utf-8");
210
+ const parsed = JSON.parse(raw);
211
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
212
+ return {};
213
+ } catch {
214
+ return {};
215
+ }
216
+ }
217
+ /**
218
+ * Merges `partial` into the current config and writes the result
219
+ * atomically (temp file + rename) so a crash mid-write never leaves a
220
+ * half-baked file readable on disk. Unknown fields already on disk are
221
+ * preserved.
222
+ *
223
+ * When `partial.enableTelemetry === true` and no `installationId` is
224
+ * stored yet, generates a v4 random UUID and persists both fields in
225
+ * the same write. An existing `installationId` is never rotated. This is
226
+ * the *explicit-consent* mint path: a `false` answer
227
+ * (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare
228
+ * `writeUserConfig({ installationId })` mints nothing extra. The default-on
229
+ * first-send path mints its id separately via {@link ensureInstallationId},
230
+ * which records no consent answer.
231
+ */
232
+ function writeUserConfig(partial) {
233
+ const merged = {
234
+ ...readUserConfig(),
235
+ ...partial
236
+ };
237
+ if (partial.enableTelemetry === true && merged["installationId"] === void 0) merged["installationId"] = randomUUID();
238
+ const path = userConfigPath();
239
+ const dir = dirname(path);
240
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
241
+ const tmpPath = `${path}.${process.pid}.tmp`;
242
+ writeFileSync(tmpPath, `${JSON.stringify(merged, null, 2)}\n`, "utf-8");
243
+ renameSync(tmpPath, path);
244
+ }
245
+ /**
246
+ * Returns the stored `installationId`, minting and persisting a fresh v4
247
+ * UUID when none exists yet. Crucially, this persists *only* the id —
248
+ * `enableTelemetry` is left untouched (stays `undefined` on a default-on
249
+ * first run), so the interactive `init` consent prompt is not wrongly
250
+ * suppressed and no explicit consent the user never gave is recorded.
251
+ *
252
+ * Used by the default-on first-run fire path: the gate has already
253
+ * resolved enabled, so this only ever runs when telemetry is on.
254
+ */
255
+ function ensureInstallationId() {
256
+ const existing = readUserConfig().installationId;
257
+ if (typeof existing === "string" && existing.length > 0) return existing;
258
+ const installationId = randomUUID();
259
+ writeUserConfig({ installationId });
260
+ return installationId;
261
+ }
262
+ function runTelemetry(inputs) {
263
+ const env = inputs.env ?? process.env;
264
+ if (inputs.isCI) return {
265
+ spawned: false,
266
+ reason: "ci"
267
+ };
268
+ const config = inputs.userConfig ?? readUserConfig();
269
+ if (!resolveGating({
270
+ env,
271
+ config
272
+ }).enabled) return {
273
+ spawned: false,
274
+ reason: "gated-off"
275
+ };
276
+ const sanitised = sanitizeCommanderResult(inputs.command);
277
+ if (typeof config.installationId !== "string" || config.installationId.length === 0) return {
278
+ spawned: false,
279
+ reason: "gated-off"
280
+ };
281
+ const payload = {
282
+ installationId: config.installationId,
283
+ version: inputs.version,
284
+ command: sanitised.command,
285
+ flags: sanitised.flags,
286
+ projectRoot: inputs.projectRoot,
287
+ endpoint: resolveTelemetryEndpoint(env),
288
+ ...ifDefined("databaseTarget", inputs.databaseTarget),
289
+ ...ifDefined("exitCode", inputs.exitCode)
290
+ };
291
+ try {
292
+ const child = fork(inputs.senderPath, [], {
293
+ detached: true,
294
+ stdio: [
295
+ "pipe",
296
+ "ignore",
297
+ "ignore",
298
+ "ipc"
299
+ ]
300
+ });
301
+ child.send(payload, (err) => {
302
+ if (err !== null && process.env["PRISMA_NEXT_DEBUG"] === "1") process.stderr.write(`[cli-telemetry] parent send error: ${String(err)}\n`);
303
+ });
304
+ child.disconnect();
305
+ child.unref();
306
+ return { spawned: true };
307
+ } catch (err) {
308
+ if (process.env["PRISMA_NEXT_DEBUG"] === "1") process.stderr.write(`[cli-telemetry] parent fork failed: ${String(err)}\n`);
309
+ return {
310
+ spawned: false,
311
+ reason: "fork-failed"
312
+ };
313
+ }
314
+ }
315
+ /**
316
+ * Resolve the path to the compiled sender entry relative to a consumer
317
+ * that has captured its own `import.meta.url`. The CLI's
318
+ * `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the
319
+ * consumer asks `senderModuleUrl()` and forwards the result to
320
+ * `runTelemetry({ senderPath })`.
321
+ */
322
+ function senderModuleUrl(importMetaUrl) {
323
+ return fileURLToPath(new URL("./sender.mjs", importMetaUrl));
324
+ }
325
+ //#endregion
47
326
  export { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };
48
327
 
49
328
  //# sourceMappingURL=cli-telemetry.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-telemetry.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/enrich-BKPD0fEi.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { determineAgent } from \"@vercel/detect-agent\";\nimport { join } from \"pathe\";\n//#region src/enrich.ts\nconst EMPTY_PROJECT_CONFIG = {\n\tdatabaseTarget: null,\n\textensions: []\n};\n/**\n* Best-effort load of `prisma-next.config.*` from `projectRoot`,\n* validated against the canonical `@internal/config` schema.\n* Returns `{ databaseTarget: null, extensions: [] }` on any failure\n* mode — missing config file (e.g. before `prisma-next init`), c12\n* throws while evaluating user TS, validator rejects a malformed\n* shape, etc. Telemetry is non-blocking and best-effort; an empty\n* result is the only downside of an unloadable or invalid config.\n*\n* Both `c12` and `@internal/config/config-validation` are imported\n* lazily so the detached sender's cold-start cost is paid only when\n* telemetry actually fires, not on every fork even when gates\n* short-circuit before reaching this code path.\n*/\nasync function loadProjectConfig(projectRoot) {\n\ttry {\n\t\tconst { loadConfig } = await import(\"c12\");\n\t\tconst config = (await loadConfig({\n\t\t\tname: \"prisma-next\",\n\t\t\tcwd: projectRoot,\n\t\t\tdotenv: false,\n\t\t\trcFile: false,\n\t\t\tglobalRc: false\n\t\t})).config ?? null;\n\t\tif (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;\n\t\tif ((await import(\"@internal/config/config-validation\")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst validConfig = blindCast(config);\n\t\treturn {\n\t\t\tdatabaseTarget: validConfig.target.targetId,\n\t\t\textensions: (validConfig.extensions ?? []).map((pack) => pack.id)\n\t\t};\n\t} catch {\n\t\treturn EMPTY_PROJECT_CONFIG;\n\t}\n}\n/**\n* Identify the runtime the sender is running in. Same-runtime as the\n* parent is a correctness requirement: the parent forked us via\n* `child_process.fork`, which inherits the parent's runtime. Detection\n* keys on the runtime-specific version field rather than env vars so a\n* spoofed env can't lie about the actual interpreter.\n*/\nfunction resolveRuntime(versions) {\n\tif (versions.bun !== void 0) return {\n\t\tname: \"bun\",\n\t\tversion: versions.bun\n\t};\n\tif (versions.deno !== void 0) return {\n\t\tname: \"deno\",\n\t\tversion: versions.deno\n\t};\n\treturn {\n\t\tname: \"node\",\n\t\tversion: versions.node\n\t};\n}\n/**\n* Parse `npm_config_user_agent` into a `<pm>/<version>` token. The\n* value, when present, looks like\n* `\"pnpm/10.27.0 npm/? node/v24.13.0 darwin arm64\"` — we take the first\n* whitespace-separated token. Any failure → `null`.\n*/\nfunction parsePackageManager(userAgent) {\n\tif (userAgent === void 0) return null;\n\tconst first = userAgent.split(/\\s+/)[0];\n\tif (first === void 0 || first.length === 0) return null;\n\tif (!first.includes(\"/\")) return null;\n\treturn first;\n}\n/**\n* Read the user's project `package.json` and resolve a TypeScript\n* version from `devDependencies.typescript` (preferred) or\n* `dependencies.typescript`. Strips a leading `^` or `~` semver\n* prefix. Returns `null` on any failure mode — file missing,\n* unreadable, malformed JSON, key absent, not a string.\n*/\nfunction readTsVersionFromPackageJson(raw) {\n\tif (raw === null) return null;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst candidate = pickStringDep(parsed[\"devDependencies\"]) ?? pickStringDep(parsed[\"dependencies\"]);\n\tif (candidate === null) return null;\n\treturn candidate.replace(/^[\\^~]/, \"\");\n}\nfunction pickStringDep(deps) {\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tconst value = deps[\"typescript\"];\n\treturn typeof value === \"string\" ? value : null;\n}\n/**\n* Build the full backend event from the parent's payload, the\n* c12-loaded project-config slice, and the child's per-process\n* snapshot. Pure given a `projectConfig` + `EnrichEnvironment`.\n*/\nfunction buildTelemetryEvent(payload, projectConfig, env) {\n\tconst runtime = resolveRuntime(env.versions);\n\treturn {\n\t\tinstallationId: payload.installationId,\n\t\tversion: payload.version,\n\t\tcommand: payload.command,\n\t\tflags: payload.flags,\n\t\truntimeName: runtime.name,\n\t\truntimeVersion: runtime.version,\n\t\tos: env.platform,\n\t\tarch: env.arch,\n\t\tpackageManager: parsePackageManager(env.env[\"npm_config_user_agent\"]),\n\t\tdatabaseTarget: projectConfig.databaseTarget,\n\t\ttsVersion: readTsVersionFromPackageJson(env.readProjectPackageJson()),\n\t\tagent: env.agent,\n\t\textensions: projectConfig.extensions\n\t};\n}\n/**\n* Resolve the agent label for the telemetry event via\n* `@vercel/detect-agent`, collapsing its discriminated result to the\n* event's `string | null` shape. Any detection failure counts as\n* \"no agent\" — telemetry is best-effort and non-blocking.\n*/\nasync function resolveAgentLabel() {\n\ttry {\n\t\tconst result = await determineAgent();\n\t\treturn result.isAgent ? result.agent.name : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Convenience for the sender entry: build the event from the live\n* `process` plus a c12 load of `prisma-next.config.*` from\n* `payload.projectRoot` plus a real project-package.json reader,\n* swallowing any I/O errors in the file read.\n*\n* The parent's `payload.databaseTarget` (when present) wins over the\n* c12-derived value. The parent sets this for the first-`init` run,\n* where the config file does not exist on disk yet but the user has\n* just declared a target via the consent prompt; every other\n* invocation leaves it unset and the c12 load supplies the value.\n*/\nasync function buildTelemetryEventFromProcess(payload) {\n\tconst loadedConfig = await loadProjectConfig(payload.projectRoot);\n\treturn buildTelemetryEvent(payload, {\n\t\tdatabaseTarget: payload.databaseTarget ?? loadedConfig.databaseTarget,\n\t\textensions: loadedConfig.extensions\n\t}, {\n\t\tplatform: process.platform,\n\t\tarch: process.arch,\n\t\tversions: process.versions,\n\t\tenv: process.env,\n\t\tagent: await resolveAgentLabel(),\n\t\treadProjectPackageJson: () => {\n\t\t\ttry {\n\t\t\t\treturn readFileSync(join(payload.projectRoot, \"package.json\"), \"utf-8\");\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { loadProjectConfig as n, buildTelemetryEventFromProcess as t };\n\n//# sourceMappingURL=enrich-BKPD0fEi.mjs.map"],"mappings":";;;;;;AAKA,MAAM,uBAAuB;CAC5B,gBAAgB;CAChB,YAAY,CAAC;AACd;;;;;;;;;;;;;;;AAeA,eAAe,kBAAkB,aAAa;CAC7C,IAAI;EACH,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,MAAM,UAAU,MAAM,WAAW;GAChC,MAAM;GACN,KAAK;GACL,QAAQ;GACR,QAAQ;GACR,UAAU;EACX,CAAC,EAAA,CAAG,UAAU;EACd,IAAI,WAAW,QAAQ,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG,OAAO;EAChE,KAAK,MAAM,OAAO,kDAAA,CAAuC,oBAAoB,MAAM,CAAC,CAAC,SAAS,GAAG,OAAO;EACxG,MAAM,cAAc,UAAU,MAAM;EACpC,OAAO;GACN,gBAAgB,YAAY,OAAO;GACnC,aAAa,YAAY,cAAc,CAAC,EAAA,CAAG,KAAK,SAAS,KAAK,EAAE;EACjE;CACD,QAAQ;EACP,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"cli-telemetry.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/enrich-IkV4Zai4.mjs","../../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { determineAgent } from \"@vercel/detect-agent\";\nimport { join } from \"pathe\";\n//#region src/enrich.ts\nconst EMPTY_PROJECT_CONFIG = {\n\tdatabaseTarget: null,\n\textensions: []\n};\n/**\n* Best-effort load of `prisma.config.*` from `projectRoot`,\n* validated against the canonical `@internal/config` schema.\n* Returns `{ databaseTarget: null, extensions: [] }` on any failure\n* mode — missing config file (e.g. before `prisma-next init`), c12\n* throws while evaluating user TS, validator rejects a malformed\n* shape, etc. Telemetry is non-blocking and best-effort; an empty\n* result is the only downside of an unloadable or invalid config.\n*\n* Both `c12` and `@internal/config/config-validation` are imported\n* lazily so the detached sender's cold-start cost is paid only when\n* telemetry actually fires, not on every fork even when gates\n* short-circuit before reaching this code path.\n*/\nasync function loadProjectConfig(projectRoot) {\n\ttry {\n\t\tconst { loadConfig } = await import(\"c12\");\n\t\tconst load = (name) => loadConfig({\n\t\t\tname,\n\t\t\tcwd: projectRoot,\n\t\t\tdotenv: false,\n\t\t\trcFile: false,\n\t\t\tglobalRc: false\n\t\t});\n\t\tlet result = await load(\"prisma\");\n\t\tif (!result.config || Object.keys(result.config).length === 0) result = await load(\"prisma-next\");\n\t\tlet config = result.config ?? null;\n\t\tif (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;\n\t\tif (config[\"$prismaConfig\"] !== void 0) {\n\t\t\tconst orm = config[\"orm\"];\n\t\t\tif (orm === null || typeof orm !== \"object\" || Array.isArray(orm)) return EMPTY_PROJECT_CONFIG;\n\t\t\tconfig = blindCast(orm);\n\t\t}\n\t\tif ((await import(\"@internal/config/config-validation\")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst validConfig = blindCast(config);\n\t\treturn {\n\t\t\tdatabaseTarget: validConfig.target.targetId,\n\t\t\textensions: (validConfig.extensions ?? []).map((pack) => pack.id)\n\t\t};\n\t} catch {\n\t\treturn EMPTY_PROJECT_CONFIG;\n\t}\n}\n/**\n* Identify the runtime the sender is running in. Same-runtime as the\n* parent is a correctness requirement: the parent forked us via\n* `child_process.fork`, which inherits the parent's runtime. Detection\n* keys on the runtime-specific version field rather than env vars so a\n* spoofed env can't lie about the actual interpreter.\n*/\nfunction resolveRuntime(versions) {\n\tif (versions.bun !== void 0) return {\n\t\tname: \"bun\",\n\t\tversion: versions.bun\n\t};\n\tif (versions.deno !== void 0) return {\n\t\tname: \"deno\",\n\t\tversion: versions.deno\n\t};\n\treturn {\n\t\tname: \"node\",\n\t\tversion: versions.node\n\t};\n}\n/**\n* Parse `npm_config_user_agent` into a `<pm>/<version>` token. The\n* value, when present, looks like\n* `\"pnpm/10.27.0 npm/? node/v24.13.0 darwin arm64\"` — we take the first\n* whitespace-separated token. Any failure → `null`.\n*/\nfunction parsePackageManager(userAgent) {\n\tif (userAgent === void 0) return null;\n\tconst first = userAgent.split(/\\s+/)[0];\n\tif (first === void 0 || first.length === 0) return null;\n\tif (!first.includes(\"/\")) return null;\n\treturn first;\n}\n/**\n* Read the user's project `package.json` and resolve a TypeScript\n* version from `devDependencies.typescript` (preferred) or\n* `dependencies.typescript`. Strips a leading `^` or `~` semver\n* prefix. Returns `null` on any failure mode — file missing,\n* unreadable, malformed JSON, key absent, not a string.\n*/\nfunction readTsVersionFromPackageJson(raw) {\n\tif (raw === null) return null;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst candidate = pickStringDep(parsed[\"devDependencies\"]) ?? pickStringDep(parsed[\"dependencies\"]);\n\tif (candidate === null) return null;\n\treturn candidate.replace(/^[\\^~]/, \"\");\n}\nfunction pickStringDep(deps) {\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tconst value = deps[\"typescript\"];\n\treturn typeof value === \"string\" ? value : null;\n}\n/**\n* Build the full backend event from the parent's payload, the\n* c12-loaded project-config slice, and the child's per-process\n* snapshot. Pure given a `projectConfig` + `EnrichEnvironment`.\n*/\nfunction buildTelemetryEvent(payload, projectConfig, env) {\n\tconst runtime = resolveRuntime(env.versions);\n\treturn {\n\t\tinstallationId: payload.installationId,\n\t\tversion: payload.version,\n\t\tcommand: payload.command,\n\t\tflags: payload.flags,\n\t\truntimeName: runtime.name,\n\t\truntimeVersion: runtime.version,\n\t\tos: env.platform,\n\t\tarch: env.arch,\n\t\tpackageManager: parsePackageManager(env.env[\"npm_config_user_agent\"]),\n\t\tdatabaseTarget: projectConfig.databaseTarget,\n\t\ttsVersion: readTsVersionFromPackageJson(env.readProjectPackageJson()),\n\t\tagent: env.agent,\n\t\textensions: projectConfig.extensions,\n\t\texitCode: payload.exitCode ?? null\n\t};\n}\n/**\n* Resolve the agent label for the telemetry event via\n* `@vercel/detect-agent`, collapsing its discriminated result to the\n* event's `string | null` shape. Any detection failure counts as\n* \"no agent\" — telemetry is best-effort and non-blocking.\n*/\nasync function resolveAgentLabel() {\n\ttry {\n\t\tconst result = await determineAgent();\n\t\treturn result.isAgent ? result.agent.name : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Convenience for the sender entry: build the event from the live\n* `process` plus a c12 load of `prisma.config.*` from\n* `payload.projectRoot` plus a real project-package.json reader,\n* swallowing any I/O errors in the file read.\n*\n* The parent's `payload.databaseTarget` (when present) wins over the\n* c12-derived value. The parent sets this for the first-`init` run,\n* where the config file does not exist on disk yet but the user has\n* just declared a target via the consent prompt; every other\n* invocation leaves it unset and the c12 load supplies the value.\n*/\nasync function buildTelemetryEventFromProcess(payload) {\n\tconst loadedConfig = await loadProjectConfig(payload.projectRoot);\n\treturn buildTelemetryEvent(payload, {\n\t\tdatabaseTarget: payload.databaseTarget ?? loadedConfig.databaseTarget,\n\t\textensions: loadedConfig.extensions\n\t}, {\n\t\tplatform: process.platform,\n\t\tarch: process.arch,\n\t\tversions: process.versions,\n\t\tenv: process.env,\n\t\tagent: await resolveAgentLabel(),\n\t\treadProjectPackageJson: () => {\n\t\t\ttry {\n\t\t\t\treturn readFileSync(join(payload.projectRoot, \"package.json\"), \"utf-8\");\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { loadProjectConfig as n, buildTelemetryEventFromProcess as t };\n\n//# sourceMappingURL=enrich-IkV4Zai4.mjs.map","import { n as loadProjectConfig } from \"../enrich-IkV4Zai4.mjs\";\nimport { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"pathe\";\nimport { fork } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { randomUUID } from \"node:crypto\";\nimport { homedir } from \"node:os\";\n//#region src/endpoint.ts\n/**\n* Production endpoint pinned to the deployed Prisma Compute backend.\n* Compiled as a build-time constant; not user-configurable.\n*/\nconst TELEMETRY_BACKEND_URL = \"https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build\";\n/**\n* Path within the backend that accepts telemetry POSTs.\n*/\nconst TELEMETRY_ENDPOINT_PATH = \"/events\";\n/**\n* Resolve the full POST URL the sender targets. The\n* `PRISMA_NEXT_TELEMETRY_ENDPOINT` env var is an integration-testing\n* affordance only — it lets the test suite spin up a mock HTTP server\n* on an ephemeral port and point the spawned sender at it. The override\n* is intentionally undocumented in user-facing material.\n*\n* Fail-open: a malformed override (typo in a dev shell, bad CI config)\n* silently falls back to the production backend rather than throwing,\n* matching the telemetry layer's broader silent-on-failure contract.\n*/\nfunction resolveTelemetryEndpoint(env = process.env) {\n\tconst override = env[\"PRISMA_NEXT_TELEMETRY_ENDPOINT\"];\n\tconst base = override !== void 0 && override.length > 0 ? override : TELEMETRY_BACKEND_URL;\n\ttry {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, base).toString();\n\t} catch {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, TELEMETRY_BACKEND_URL).toString();\n\t}\n}\n//#endregion\n//#region src/gating.ts\n/**\n* A `PRISMA_NEXT_DISABLE_TELEMETRY` value counts as an opt-out only if\n* it parses as a truthy string. The set-but-falsy spellings (`''`,\n* `'0'`, `'false'`) are intentionally treated as not-set so a parent\n* shell that exports the variable to a benign value doesn't accidentally\n* disable telemetry for child processes.\n*/\nfunction isTruthyOptOut(raw) {\n\tif (raw === void 0) return false;\n\tconst normalised = raw.trim().toLowerCase();\n\tif (normalised === \"\") return false;\n\tif (normalised === \"0\") return false;\n\tif (normalised === \"false\") return false;\n\treturn true;\n}\n/**\n* Pure-function resolution of the gating decision. Same input → same\n* output; no I/O. The caller is responsible for reading the env and the\n* user config.\n*\n* Decision order:\n* 1. Env-var override (`PRISMA_NEXT_DISABLE_TELEMETRY` truthy, or\n* `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an\n* opt-out env var wins over any stored or unset preference.\n* 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).\n* 3. Stored `enableTelemetry === true` → enabled.\n* 4. Stored `enableTelemetry === undefined` (file missing, or field\n* not set) → ENABLED. This is the opt-out default: absence of an\n* explicit choice means telemetry is on. This is the load-bearing,\n* counter-intuitive branch — do not \"fix\" it to default-off.\n*\n* Telemetry is disabled only when an env override is active or\n* `enableTelemetry` is explicitly `false`.\n*/\nfunction resolveGating(inputs) {\n\tif (isTruthyOptOut(inputs.env[\"PRISMA_NEXT_DISABLE_TELEMETRY\"]) || inputs.env[\"DO_NOT_TRACK\"] === \"1\") return {\n\t\tenabled: false,\n\t\treason: \"env-override\"\n\t};\n\tif (inputs.config.enableTelemetry === false) return {\n\t\tenabled: false,\n\t\treason: \"stored-opt-out\"\n\t};\n\treturn { enabled: true };\n}\n//#endregion\n//#region src/sanitize.ts\nfunction flagNameFromLongName(longName) {\n\tif (longName === null || !longName.startsWith(\"--\")) return null;\n\tconst withoutPrefix = longName.slice(2);\n\treturn withoutPrefix.length > 0 ? withoutPrefix : null;\n}\n/**\n* Project commander's parsed result into the wire-shape command and\n* flag-name list. Pure; the only allowed inputs are the fields of\n* `CommanderResultShape`.\n*\n* Sanitiser contract — no flag values, no positionals, no raw argv:\n* - Drop the root program name (`commandPath[0]`); the wire ships\n* `migration new`, not `prisma-next migration new`.\n* - Emit only options whose Commander source is `cli`.\n* - Emit the long user-facing flag spelling without the `--` prefix;\n* never emit Commander's camelCase attribute names.\n* - `positionalArgs` is accepted but never consumed; the field exists\n* in the input type to make it obvious at the call site that\n* positionals were deliberately excluded.\n*/\nfunction sanitizeCommanderResult(input) {\n\treturn {\n\t\tcommand: input.commandPath.slice(1).join(\" \"),\n\t\tflags: input.options.flatMap((option) => {\n\t\t\tif (option.source !== \"cli\") return [];\n\t\t\tconst flagName = flagNameFromLongName(option.longName);\n\t\t\treturn flagName === null ? [] : [flagName];\n\t\t})\n\t};\n}\n//#endregion\n//#region src/user-config.ts\nconst APP_DIR = \"prisma-next\";\nconst FILE_NAME = \"config.json\";\n/**\n* Resolves the user-level config directory:\n* - Windows: `%APPDATA%\\prisma-next\\` (fallback: `%USERPROFILE%\\AppData\\Roaming\\prisma-next\\`).\n* - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-next/` if set, else\n* `$HOME/.config/prisma-next/` per the XDG Base Directory Specification.\n*\n* The spec deliberately picks XDG over the macOS-native\n* `~/Library/Preferences/` convention so the path resolution is\n* test-overridable via `XDG_CONFIG_HOME` and matches the documented\n* behaviour on all *nix platforms. We intentionally do not use\n* `env-paths`: its macOS choice of `~/Library/Preferences` is for\n* OS-managed plist preferences, not arbitrary JSON files. Apple documents\n* that apps access that directory through system APIs such as\n* `NSUserDefaults`, while cross-platform CLI and developer tools conventionally\n* use `~/.config` on macOS too:\n* https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html\n*/\nfunction configDir() {\n\tif (process.platform === \"win32\") {\n\t\tconst appData = process.env[\"APPDATA\"];\n\t\tif (appData !== void 0 && appData.length > 0) return join(appData, APP_DIR);\n\t\treturn join(homedir(), \"AppData\", \"Roaming\", APP_DIR);\n\t}\n\tconst xdg = process.env[\"XDG_CONFIG_HOME\"];\n\tif (xdg !== void 0 && xdg.length > 0) return join(xdg, APP_DIR);\n\treturn join(homedir(), \".config\", APP_DIR);\n}\n/**\n* Path to the user-level config file. Resolved per call so test\n* harnesses can mutate `$XDG_CONFIG_HOME` between cases.\n*/\nfunction userConfigPath() {\n\treturn join(configDir(), FILE_NAME);\n}\n/**\n* Reads the user-level config. File-missing, unreadable, or malformed →\n* `{}` (the absence of consent is the same answer in every error mode).\n* Unknown fields from a future client are passed through verbatim.\n*/\nfunction readUserConfig() {\n\tconst path = userConfigPath();\n\tif (!existsSync(path)) return {};\n\ttry {\n\t\tconst raw = readFileSync(path, \"utf-8\");\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)) return parsed;\n\t\treturn {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n/**\n* Merges `partial` into the current config and writes the result\n* atomically (temp file + rename) so a crash mid-write never leaves a\n* half-baked file readable on disk. Unknown fields already on disk are\n* preserved.\n*\n* When `partial.enableTelemetry === true` and no `installationId` is\n* stored yet, generates a v4 random UUID and persists both fields in\n* the same write. An existing `installationId` is never rotated. This is\n* the *explicit-consent* mint path: a `false` answer\n* (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare\n* `writeUserConfig({ installationId })` mints nothing extra. The default-on\n* first-send path mints its id separately via {@link ensureInstallationId},\n* which records no consent answer.\n*/\nfunction writeUserConfig(partial) {\n\tconst merged = {\n\t\t...readUserConfig(),\n\t\t...partial\n\t};\n\tif (partial.enableTelemetry === true && merged[\"installationId\"] === void 0) merged[\"installationId\"] = randomUUID();\n\tconst path = userConfigPath();\n\tconst dir = dirname(path);\n\tif (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\tconst tmpPath = `${path}.${process.pid}.tmp`;\n\twriteFileSync(tmpPath, `${JSON.stringify(merged, null, 2)}\\n`, \"utf-8\");\n\trenameSync(tmpPath, path);\n}\n/**\n* Returns the stored `installationId`, minting and persisting a fresh v4\n* UUID when none exists yet. Crucially, this persists *only* the id —\n* `enableTelemetry` is left untouched (stays `undefined` on a default-on\n* first run), so the interactive `init` consent prompt is not wrongly\n* suppressed and no explicit consent the user never gave is recorded.\n*\n* Used by the default-on first-run fire path: the gate has already\n* resolved enabled, so this only ever runs when telemetry is on.\n*/\nfunction ensureInstallationId() {\n\tconst existing = readUserConfig().installationId;\n\tif (typeof existing === \"string\" && existing.length > 0) return existing;\n\tconst installationId = randomUUID();\n\twriteUserConfig({ installationId });\n\treturn installationId;\n}\n//#endregion\n//#region src/spawn.ts\nfunction runTelemetry(inputs) {\n\tconst env = inputs.env ?? process.env;\n\tif (inputs.isCI) return {\n\t\tspawned: false,\n\t\treason: \"ci\"\n\t};\n\tconst config = inputs.userConfig ?? readUserConfig();\n\tif (!resolveGating({\n\t\tenv,\n\t\tconfig\n\t}).enabled) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst sanitised = sanitizeCommanderResult(inputs.command);\n\tif (typeof config.installationId !== \"string\" || config.installationId.length === 0) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst payload = {\n\t\tinstallationId: config.installationId,\n\t\tversion: inputs.version,\n\t\tcommand: sanitised.command,\n\t\tflags: sanitised.flags,\n\t\tprojectRoot: inputs.projectRoot,\n\t\tendpoint: resolveTelemetryEndpoint(env),\n\t\t...ifDefined(\"databaseTarget\", inputs.databaseTarget),\n\t\t...ifDefined(\"exitCode\", inputs.exitCode)\n\t};\n\ttry {\n\t\tconst child = fork(inputs.senderPath, [], {\n\t\t\tdetached: true,\n\t\t\tstdio: [\n\t\t\t\t\"pipe\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ipc\"\n\t\t\t]\n\t\t});\n\t\tchild.send(payload, (err) => {\n\t\t\tif (err !== null && process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent send error: ${String(err)}\\n`);\n\t\t});\n\t\tchild.disconnect();\n\t\tchild.unref();\n\t\treturn { spawned: true };\n\t} catch (err) {\n\t\tif (process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent fork failed: ${String(err)}\\n`);\n\t\treturn {\n\t\t\tspawned: false,\n\t\t\treason: \"fork-failed\"\n\t\t};\n\t}\n}\n/**\n* Resolve the path to the compiled sender entry relative to a consumer\n* that has captured its own `import.meta.url`. The CLI's\n* `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the\n* consumer asks `senderModuleUrl()` and forwards the result to\n* `runTelemetry({ senderPath })`.\n*/\nfunction senderModuleUrl(importMetaUrl) {\n\treturn fileURLToPath(new URL(\"./sender.mjs\", importMetaUrl));\n}\n//#endregion\nexport { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":"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"}
package/dist/cli.d.mts CHANGED
@@ -1,12 +1,7 @@
1
- import { t as createContractEmitCommand } from "./contract-emit-CvwNE4R1-DEn1V1Zo.mjs";
2
- import { Command } from "commander";
3
- import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
4
1
  import { Contract } from "@prisma/orm-framework/contract/types";
5
2
  import { LoadedConfig } from "@prisma/cli-engine";
3
+ import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
6
4
  //#region ../../../1-framework/3-tooling/cli/dist/exports/index.d.mts
7
- //#region src/commands/format.d.ts
8
- declare function createFormatCommand(): Command;
9
- //#endregion
10
5
  //#region src/load-ts-contract.d.ts
11
6
  interface LoadTsContractOptions {
12
7
  readonly allowlist?: ReadonlyArray<string>;
@@ -46,16 +41,19 @@ interface LoadOrmConfigOptions {
46
41
  readonly cwd: string;
47
42
  /** A non-default config file, resolved against `cwd` when relative. */
48
43
  readonly configPath?: string;
44
+ /** Receives one message per deprecated spelling the loader accepted. */
45
+ readonly warn?: (message: string) => void;
49
46
  }
50
47
  /**
51
- * Builds the engine's `Runtime.config` from `prisma-next.config.ts`.
48
+ * Builds the engine's `Runtime.config` from `prisma.config.ts`.
52
49
  *
53
- * The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`
54
- * marker, which is not the file this bin reads, so the bin owns the load: the
50
+ * The engine ships its own synchronous loader, but the bin owns the load: the
55
51
  * ORM's c12 loader evaluates the module asynchronously and finalizes paths
56
- * against the config file's own directory. The whole result nests as the
57
- * single `orm` section the engine models one section per family, and
58
- * `contract`, `db`, `migrations` and the rest are subsections of it.
52
+ * against the config file's own directory. It reads the same shape the engine
53
+ * does defineConfig from `@prisma/cli-engine` with the whole Prisma Next
54
+ * configuration nested as the single `orm` section and keeps reading the
55
+ * deprecated `prisma-next.config.ts` filename and flat shape, surfacing each
56
+ * through `warn`.
59
57
  *
60
58
  * Only failures that prevent evaluation entirely are diagnostics here, and
61
59
  * they carry `section: null` so they fail exactly the commands that read
@@ -63,5 +61,5 @@ interface LoadOrmConfigOptions {
63
61
  */
64
62
  declare function loadOrmConfig(options: LoadOrmConfigOptions): Promise<LoadedConfig>;
65
63
  //#endregion
66
- export { type LoadOrmConfigOptions, type LoadTsContractOptions, createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };
64
+ export { type LoadOrmConfigOptions, type LoadTsContractOptions, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };
67
65
  //# sourceMappingURL=cli.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.d.mts"],"mappings":";;;;;;;iBAMiB,uBAAuB;;;UAG9B;WACC,YAAY;;;;;;;;;;;;;;;;;;iBAkBN,mBAAmB,mBAAmB,UAAU,wBAAwB,QAAQ;;;cAGnF,+CAA+C,cAAc;;;;;;;;cAQ7D,+CAA+C;;;UAGnD;;WAEC;;WAEA;;;;;;;;;;;;;;;;iBAgBM,cAAc,SAAS,uBAAuB,QAAQ"}
1
+ {"version":3,"file":"cli.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.d.mts"],"mappings":";;;;;UAIU;WACC,YAAY;;;;;;;;;;;;;;;;;;iBAkBN,mBAAmB,mBAAmB,UAAU,wBAAwB,QAAQ;;;cAGnF,+CAA+C,cAAc;;;;;;;;cAQ7D,+CAA+C;;;UAGnD;;WAEC;;WAEA;;WAEA,QAAQ;;;;;;;;;;;;;;;;;iBAiBF,cAAc,SAAS,uBAAuB,QAAQ"}