@prisma/orm-toolchain 0.16.0-dev.36

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 (321) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/dist/aggregate-B4mhR4Sk.mjs +1012 -0
  4. package/dist/aggregate-B4mhR4Sk.mjs.map +1 -0
  5. package/dist/aggregate-BflrjWPO.d.mts +803 -0
  6. package/dist/aggregate-BflrjWPO.d.mts.map +1 -0
  7. package/dist/bin__prisma-next.mjs +800 -0
  8. package/dist/bin__prisma-next.mjs.map +1 -0
  9. package/dist/cli-telemetry.d.mts +367 -0
  10. package/dist/cli-telemetry.d.mts.map +1 -0
  11. package/dist/cli-telemetry.mjs +48 -0
  12. package/dist/cli-telemetry.mjs.map +1 -0
  13. package/dist/cli-telemetry__sender.d.mts +1 -0
  14. package/dist/cli-telemetry__sender.mjs +1 -0
  15. package/dist/cli.d.mts +31 -0
  16. package/dist/cli.d.mts.map +1 -0
  17. package/dist/cli.mjs +180 -0
  18. package/dist/cli.mjs.map +1 -0
  19. package/dist/cli__commands__contract-emit.d.mts +2 -0
  20. package/dist/cli__commands__contract-emit.mjs +2 -0
  21. package/dist/cli__commands__contract-infer.d.mts +7 -0
  22. package/dist/cli__commands__contract-infer.d.mts.map +1 -0
  23. package/dist/cli__commands__contract-infer.mjs +2 -0
  24. package/dist/cli__commands__db-init.d.mts +7 -0
  25. package/dist/cli__commands__db-init.d.mts.map +1 -0
  26. package/dist/cli__commands__db-init.mjs +2 -0
  27. package/dist/cli__commands__db-schema.d.mts +7 -0
  28. package/dist/cli__commands__db-schema.d.mts.map +1 -0
  29. package/dist/cli__commands__db-schema.mjs +2 -0
  30. package/dist/cli__commands__db-sign.d.mts +7 -0
  31. package/dist/cli__commands__db-sign.d.mts.map +1 -0
  32. package/dist/cli__commands__db-sign.mjs +2 -0
  33. package/dist/cli__commands__db-update.d.mts +7 -0
  34. package/dist/cli__commands__db-update.d.mts.map +1 -0
  35. package/dist/cli__commands__db-update.mjs +2 -0
  36. package/dist/cli__commands__db-verify.d.mts +7 -0
  37. package/dist/cli__commands__db-verify.d.mts.map +1 -0
  38. package/dist/cli__commands__db-verify.mjs +2 -0
  39. package/dist/cli__commands__migrate.d.mts +66 -0
  40. package/dist/cli__commands__migrate.d.mts.map +1 -0
  41. package/dist/cli__commands__migrate.mjs +2 -0
  42. package/dist/cli__commands__migration-check.d.mts +64 -0
  43. package/dist/cli__commands__migration-check.d.mts.map +1 -0
  44. package/dist/cli__commands__migration-check.mjs +3 -0
  45. package/dist/cli__commands__migration-graph.d.mts +36 -0
  46. package/dist/cli__commands__migration-graph.d.mts.map +1 -0
  47. package/dist/cli__commands__migration-graph.mjs +2 -0
  48. package/dist/cli__commands__migration-list.d.mts +79 -0
  49. package/dist/cli__commands__migration-list.d.mts.map +1 -0
  50. package/dist/cli__commands__migration-list.mjs +2 -0
  51. package/dist/cli__commands__migration-log.d.mts +20 -0
  52. package/dist/cli__commands__migration-log.d.mts.map +1 -0
  53. package/dist/cli__commands__migration-log.mjs +2 -0
  54. package/dist/cli__commands__migration-new.d.mts +7 -0
  55. package/dist/cli__commands__migration-new.d.mts.map +1 -0
  56. package/dist/cli__commands__migration-new.mjs +2 -0
  57. package/dist/cli__commands__migration-plan.d.mts +79 -0
  58. package/dist/cli__commands__migration-plan.d.mts.map +1 -0
  59. package/dist/cli__commands__migration-plan.mjs +2 -0
  60. package/dist/cli__commands__migration-show.d.mts +27 -0
  61. package/dist/cli__commands__migration-show.d.mts.map +1 -0
  62. package/dist/cli__commands__migration-show.mjs +2 -0
  63. package/dist/cli__commands__migration-status.d.mts +55 -0
  64. package/dist/cli__commands__migration-status.d.mts.map +1 -0
  65. package/dist/cli__commands__migration-status.mjs +3 -0
  66. package/dist/cli__commands__ref.d.mts +34 -0
  67. package/dist/cli__commands__ref.d.mts.map +1 -0
  68. package/dist/cli__commands__ref.mjs +2 -0
  69. package/dist/cli__commands__telemetry.d.mts +7 -0
  70. package/dist/cli__commands__telemetry.d.mts.map +1 -0
  71. package/dist/cli__commands__telemetry.mjs +2 -0
  72. package/dist/cli__config-types.d.mts +2 -0
  73. package/dist/cli__config-types.mjs +2 -0
  74. package/dist/cli__control-api.d.mts +141 -0
  75. package/dist/cli__control-api.d.mts.map +1 -0
  76. package/dist/cli__control-api.mjs +4 -0
  77. package/dist/cli__init-output.d.mts +37 -0
  78. package/dist/cli__init-output.d.mts.map +1 -0
  79. package/dist/cli__init-output.mjs +2 -0
  80. package/dist/cli__migration-cli.d.mts +79 -0
  81. package/dist/cli__migration-cli.d.mts.map +1 -0
  82. package/dist/cli__migration-cli.mjs +407 -0
  83. package/dist/cli__migration-cli.mjs.map +1 -0
  84. package/dist/client-75qrAPqf-DZAVUxFa.mjs +1606 -0
  85. package/dist/client-75qrAPqf-DZAVUxFa.mjs.map +1 -0
  86. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs +1671 -0
  87. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +1 -0
  88. package/dist/config-loader.d.mts +18 -0
  89. package/dist/config-loader.d.mts.map +1 -0
  90. package/dist/config-loader.mjs +2 -0
  91. package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs +10 -0
  92. package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs.map +1 -0
  93. package/dist/constants-Dkcn8Qu4.d.mts +10 -0
  94. package/dist/constants-Dkcn8Qu4.d.mts.map +1 -0
  95. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +36 -0
  96. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +1 -0
  97. package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs +148 -0
  98. package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs.map +1 -0
  99. package/dist/contract-emit-B65_UiFn.d.mts +7 -0
  100. package/dist/contract-emit-B65_UiFn.d.mts.map +1 -0
  101. package/dist/contract-emit-B6odMoem-CK3diBPk.mjs +359 -0
  102. package/dist/contract-emit-B6odMoem-CK3diBPk.mjs.map +1 -0
  103. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +56 -0
  104. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +1 -0
  105. package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs +73 -0
  106. package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs.map +1 -0
  107. package/dist/contract-snapshot-store-CbqynbtE.d.mts +28 -0
  108. package/dist/contract-snapshot-store-CbqynbtE.d.mts.map +1 -0
  109. package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs +118 -0
  110. package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map +1 -0
  111. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs +302 -0
  112. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +1 -0
  113. package/dist/db-init-Vbkb_TKZ.mjs +153 -0
  114. package/dist/db-init-Vbkb_TKZ.mjs.map +1 -0
  115. package/dist/db-schema-ClQCu3xY.mjs +47 -0
  116. package/dist/db-schema-ClQCu3xY.mjs.map +1 -0
  117. package/dist/db-sign-jjXDgQ1u.mjs +175 -0
  118. package/dist/db-sign-jjXDgQ1u.mjs.map +1 -0
  119. package/dist/db-update-BQlrqtDD.mjs +183 -0
  120. package/dist/db-update-BQlrqtDD.mjs.map +1 -0
  121. package/dist/db-verify-CKPsRFrj-3udprZQD.mjs +396 -0
  122. package/dist/db-verify-CKPsRFrj-3udprZQD.mjs.map +1 -0
  123. package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs +334 -0
  124. package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs.map +1 -0
  125. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts +63 -0
  126. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +1 -0
  127. package/dist/emitter.d.mts +75 -0
  128. package/dist/emitter.d.mts.map +1 -0
  129. package/dist/emitter.mjs +3 -0
  130. package/dist/emitter__domain-type-generation.d.mts +2 -0
  131. package/dist/emitter__domain-type-generation.mjs +2 -0
  132. package/dist/emitter__type-expression-safety.d.mts +6 -0
  133. package/dist/emitter__type-expression-safety.d.mts.map +1 -0
  134. package/dist/emitter__type-expression-safety.mjs +2 -0
  135. package/dist/errors--qsXZUtL.d.mts +72 -0
  136. package/dist/errors--qsXZUtL.d.mts.map +1 -0
  137. package/dist/errors-IpZm1Skp-BH495dRd.mjs +378 -0
  138. package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +1 -0
  139. package/dist/exports-BN0vFTxG.mjs +276 -0
  140. package/dist/exports-BN0vFTxG.mjs.map +1 -0
  141. package/dist/exports-B_xhKZmC.mjs +1436 -0
  142. package/dist/exports-B_xhKZmC.mjs.map +1 -0
  143. package/dist/exports-D3-NwrMA-CadaBGQ3.mjs +154 -0
  144. package/dist/exports-D3-NwrMA-CadaBGQ3.mjs.map +1 -0
  145. package/dist/exports-Dl2aGAk7.mjs +119 -0
  146. package/dist/exports-Dl2aGAk7.mjs.map +1 -0
  147. package/dist/format-ByDm2goZ-DKLyhNHo.mjs +101 -0
  148. package/dist/format-ByDm2goZ-DKLyhNHo.mjs.map +1 -0
  149. package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs +58 -0
  150. package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs.map +1 -0
  151. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +35 -0
  152. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +1 -0
  153. package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts +28 -0
  154. package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts.map +1 -0
  155. package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs +14 -0
  156. package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map +1 -0
  157. package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs +64 -0
  158. package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs.map +1 -0
  159. package/dist/hash-XZYYKJ-i.d.mts +53 -0
  160. package/dist/hash-XZYYKJ-i.d.mts.map +1 -0
  161. package/dist/import-roots-B6CtsWXb.d.mts +119 -0
  162. package/dist/import-roots-B6CtsWXb.d.mts.map +1 -0
  163. package/dist/import-roots-NDOIEDVj.mjs +217 -0
  164. package/dist/import-roots-NDOIEDVj.mjs.map +1 -0
  165. package/dist/init-DHctXAI9-DSlaaYXN.mjs +2186 -0
  166. package/dist/init-DHctXAI9-DSlaaYXN.mjs.map +1 -0
  167. package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs +91 -0
  168. package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs.map +1 -0
  169. package/dist/invariants-B5wLrgQS.d.mts +39 -0
  170. package/dist/invariants-B5wLrgQS.d.mts.map +1 -0
  171. package/dist/invariants-lXzy6txi-DAoP4nTE.mjs +57 -0
  172. package/dist/invariants-lXzy6txi-DAoP4nTE.mjs.map +1 -0
  173. package/dist/io-C8TdyBKt-DloEBi70.mjs +313 -0
  174. package/dist/io-C8TdyBKt-DloEBi70.mjs.map +1 -0
  175. package/dist/io-DYfeLJxR.d.mts +1 -0
  176. package/dist/io-sr4CO9_t-C3eV_kn-.d.mts +125 -0
  177. package/dist/io-sr4CO9_t-C3eV_kn-.d.mts.map +1 -0
  178. package/dist/ledger-origin-BGRN77Oy.d.mts +6 -0
  179. package/dist/ledger-origin-BGRN77Oy.d.mts.map +1 -0
  180. package/dist/ledger-origin-D7PN4Fon.mjs +9 -0
  181. package/dist/ledger-origin-D7PN4Fon.mjs.map +1 -0
  182. package/dist/metadata-2nbOAGsV-uYNeq2Cp.d.mts +2 -0
  183. package/dist/metadata-BtscDay2.d.mts +1 -0
  184. package/dist/migrate-Cb_iv264.mjs +500 -0
  185. package/dist/migrate-Cb_iv264.mjs.map +1 -0
  186. package/dist/migration-B2ljMJim.d.mts +155 -0
  187. package/dist/migration-B2ljMJim.d.mts.map +1 -0
  188. package/dist/migration-BuUmO7It.mjs +209 -0
  189. package/dist/migration-BuUmO7It.mjs.map +1 -0
  190. package/dist/migration-check-CcG-fB8r-CDs5C9vt.mjs +597 -0
  191. package/dist/migration-check-CcG-fB8r-CDs5C9vt.mjs.map +1 -0
  192. package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs +103 -0
  193. package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs.map +1 -0
  194. package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs +500 -0
  195. package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs.map +1 -0
  196. package/dist/migration-graph-DkoCC0Qy.mjs +185 -0
  197. package/dist/migration-graph-DkoCC0Qy.mjs.map +1 -0
  198. package/dist/migration-graph-Dqndu0i5.d.mts +9 -0
  199. package/dist/migration-graph-Dqndu0i5.d.mts.map +1 -0
  200. package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs +1945 -0
  201. package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs.map +1 -0
  202. package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts +124 -0
  203. package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts.map +1 -0
  204. package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs +228 -0
  205. package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs.map +1 -0
  206. package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs +220 -0
  207. package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs.map +1 -0
  208. package/dist/migration-new-BurCjyaQ.mjs +168 -0
  209. package/dist/migration-new-BurCjyaQ.mjs.map +1 -0
  210. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs +38 -0
  211. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +1 -0
  212. package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs +759 -0
  213. package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs.map +1 -0
  214. package/dist/migration-show-Bx5I5aW9.mjs +171 -0
  215. package/dist/migration-show-Bx5I5aW9.mjs.map +1 -0
  216. package/dist/migration-status-CFlzlRmu-DewBN8Ys.mjs +444 -0
  217. package/dist/migration-status-CFlzlRmu-DewBN8Ys.mjs.map +1 -0
  218. package/dist/migration-tools.d.mts +23 -0
  219. package/dist/migration-tools.mjs +17 -0
  220. package/dist/migration-tools__aggregate.d.mts +2 -0
  221. package/dist/migration-tools__aggregate.mjs +2 -0
  222. package/dist/migration-tools__constants.d.mts +2 -0
  223. package/dist/migration-tools__constants.mjs +2 -0
  224. package/dist/migration-tools__contract-snapshot-store.d.mts +2 -0
  225. package/dist/migration-tools__contract-snapshot-store.mjs +2 -0
  226. package/dist/migration-tools__errors.d.mts +2 -0
  227. package/dist/migration-tools__errors.mjs +2 -0
  228. package/dist/migration-tools__graph.d.mts +2 -0
  229. package/dist/migration-tools__graph.mjs +1 -0
  230. package/dist/migration-tools__hash.d.mts +2 -0
  231. package/dist/migration-tools__hash.mjs +2 -0
  232. package/dist/migration-tools__invariants.d.mts +2 -0
  233. package/dist/migration-tools__invariants.mjs +2 -0
  234. package/dist/migration-tools__io.d.mts +3 -0
  235. package/dist/migration-tools__io.mjs +2 -0
  236. package/dist/migration-tools__ledger-origin.d.mts +2 -0
  237. package/dist/migration-tools__ledger-origin.mjs +2 -0
  238. package/dist/migration-tools__metadata.d.mts +3 -0
  239. package/dist/migration-tools__metadata.mjs +1 -0
  240. package/dist/migration-tools__migration-graph.d.mts +3 -0
  241. package/dist/migration-tools__migration-graph.mjs +3 -0
  242. package/dist/migration-tools__migration-ts.d.mts +2 -0
  243. package/dist/migration-tools__migration-ts.mjs +2 -0
  244. package/dist/migration-tools__migration.d.mts +2 -0
  245. package/dist/migration-tools__migration.mjs +2 -0
  246. package/dist/migration-tools__package.d.mts +3 -0
  247. package/dist/migration-tools__package.mjs +1 -0
  248. package/dist/migration-tools__ref-resolution.d.mts +2 -0
  249. package/dist/migration-tools__ref-resolution.mjs +2 -0
  250. package/dist/migration-tools__refs.d.mts +2 -0
  251. package/dist/migration-tools__refs.mjs +2 -0
  252. package/dist/migration-tools__spaces.d.mts +3 -0
  253. package/dist/migration-tools__spaces.mjs +3 -0
  254. package/dist/migration-ts-CNaAtK8C.d.mts +38 -0
  255. package/dist/migration-ts-CNaAtK8C.d.mts.map +1 -0
  256. package/dist/migration-ts-FyF55c4M.mjs +67 -0
  257. package/dist/migration-ts-FyF55c4M.mjs.map +1 -0
  258. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs +13 -0
  259. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs.map +1 -0
  260. package/dist/output-DWNYqZGc-D2sRgLAm.mjs +109 -0
  261. package/dist/output-DWNYqZGc-D2sRgLAm.mjs.map +1 -0
  262. package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts +21 -0
  263. package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts.map +1 -0
  264. package/dist/package-N9PPdFV_.d.mts +3 -0
  265. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +43 -0
  266. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +1 -0
  267. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs +99 -0
  268. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +1 -0
  269. package/dist/publish-surface.d.mts +3 -0
  270. package/dist/publish-surface.mjs +3 -0
  271. package/dist/publish-surface__import-roots.d.mts +2 -0
  272. package/dist/publish-surface__import-roots.mjs +2 -0
  273. package/dist/publish-surface__shells.d.mts +2 -0
  274. package/dist/publish-surface__shells.mjs +2 -0
  275. package/dist/quick-reference-mongo.md +114 -0
  276. package/dist/quick-reference-postgres.md +93 -0
  277. package/dist/readme-mongo.md +35 -0
  278. package/dist/readme-postgres.md +34 -0
  279. package/dist/ref-B6cTthTi.mjs +171 -0
  280. package/dist/ref-B6cTthTi.mjs.map +1 -0
  281. package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs +57 -0
  282. package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs.map +1 -0
  283. package/dist/ref-resolution-BjJBWPjX.mjs +250 -0
  284. package/dist/ref-resolution-BjJBWPjX.mjs.map +1 -0
  285. package/dist/ref-resolution-COGOSL57.d.mts +127 -0
  286. package/dist/ref-resolution-COGOSL57.d.mts.map +1 -0
  287. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs +241 -0
  288. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +1 -0
  289. package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts +43 -0
  290. package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts.map +1 -0
  291. package/dist/schemas-CeGMYFYX-h3OcU__O.d.mts +192 -0
  292. package/dist/schemas-CeGMYFYX-h3OcU__O.d.mts.map +1 -0
  293. package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs +112 -0
  294. package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs.map +1 -0
  295. package/dist/shells-BenrJHp2.mjs +602 -0
  296. package/dist/shells-BenrJHp2.mjs.map +1 -0
  297. package/dist/shells-COHV_Ozf.d.mts +135 -0
  298. package/dist/shells-COHV_Ozf.d.mts.map +1 -0
  299. package/dist/spaces-C27bA-xc.mjs +267 -0
  300. package/dist/spaces-C27bA-xc.mjs.map +1 -0
  301. package/dist/spaces-DxFj5y8l.d.mts +415 -0
  302. package/dist/spaces-DxFj5y8l.d.mts.map +1 -0
  303. package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs +120 -0
  304. package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs.map +1 -0
  305. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +133 -0
  306. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +1 -0
  307. package/dist/type-expression-safety-CgHTWypx.mjs +8 -0
  308. package/dist/type-expression-safety-CgHTWypx.mjs.map +1 -0
  309. package/dist/types-DZWEs4si-D8UlyJI0.d.mts +893 -0
  310. package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +1 -0
  311. package/dist/verify-DnVNjc5C-BGdsblBK.mjs +283 -0
  312. package/dist/verify-DnVNjc5C-BGdsblBK.mjs.map +1 -0
  313. package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs +252 -0
  314. package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map +1 -0
  315. package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts +136 -0
  316. package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map +1 -0
  317. package/dist/vite-plugin-contract-emit.d.mts +54 -0
  318. package/dist/vite-plugin-contract-emit.d.mts.map +1 -0
  319. package/dist/vite-plugin-contract-emit.mjs +303 -0
  320. package/dist/vite-plugin-contract-emit.mjs.map +1 -0
  321. package/package.json +127 -0
@@ -0,0 +1,136 @@
1
+ //#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-Cc1u_wJo.d.mts
2
+ //#region src/verify-contract-spaces.d.ts
3
+ /**
4
+ * List the per-space subdirectories under
5
+ * `<projectRoot>/migrations/`. Returns space-id directory names (sorted
6
+ * alphabetically) — i.e. any non-dot-prefixed, non-reserved
7
+ * ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does
8
+ * **not** contain a `migration.json` manifest. The manifest is the
9
+ * structural marker of a user-authored migration directory (see
10
+ * `readMigrationsDir` in `./io`); directory names themselves belong to
11
+ * the user and are not part of the contract. The reserved-name filter
12
+ * keeps `migrations/snapshots/` (the contract snapshot store) from ever
13
+ * being enumerated as a phantom contract space.
14
+ *
15
+ * Returns `[]` if the migrations directory does not exist (greenfield
16
+ * project).
17
+ *
18
+ * Reads only the user's repo. **No descriptor import.** The caller
19
+ * (verifier) feeds the result into {@link verifyContractSpaces} alongside
20
+ * the loaded-space set and the marker rows.
21
+ */
22
+ declare function listContractSpaceDirectories(projectMigrationsDir: string): Promise<readonly string[]>;
23
+ /**
24
+ * On-disk head value (`(hash, invariants)`) for one contract space.
25
+ * The verifier compares this against the marker row for the same space
26
+ * to detect drift between the user-emitted artifacts and the live DB
27
+ * marker.
28
+ */
29
+ interface ContractSpaceHeadRecord {
30
+ readonly hash: string;
31
+ readonly invariants: readonly string[];
32
+ }
33
+ /**
34
+ * Marker row read from `prisma_contract.marker` (one per `space`).
35
+ * Caller resolves these via the family runtime's marker reader before
36
+ * invoking {@link verifyContractSpaces}.
37
+ */
38
+ interface SpaceMarkerRecord {
39
+ readonly hash: string;
40
+ readonly invariants: readonly string[];
41
+ }
42
+ interface VerifyContractSpacesInputs {
43
+ /**
44
+ * Set of contract spaces the project declares: `'app'` plus each
45
+ * extension space in `extensions`. The caller's discovery path
46
+ * never reads the extension descriptor module — it walks the
47
+ * `extensions` configuration in `prisma-next.config.ts` for the
48
+ * space ids.
49
+ */
50
+ readonly loadedSpaces: ReadonlySet<string>;
51
+ /**
52
+ * Per-space subdirectories observed under
53
+ * `<projectRoot>/migrations/`. Resolved via
54
+ * {@link listContractSpaceDirectories}.
55
+ */
56
+ readonly spaceDirsOnDisk: readonly string[];
57
+ /**
58
+ * Head ref per space, keyed by space id. Caller reads
59
+ * `<projectRoot>/migrations/<space-id>/contract.json` and
60
+ * `<projectRoot>/migrations/<space-id>/refs/head.json` to construct
61
+ * this map. Spaces with no contract-space dir on disk simply omit a
62
+ * map entry.
63
+ */
64
+ readonly headRefsBySpace: ReadonlyMap<string, ContractSpaceHeadRecord>;
65
+ /**
66
+ * Marker rows keyed by `space`. Caller reads them from the
67
+ * `prisma_contract.marker` table.
68
+ */
69
+ readonly markerRowsBySpace: ReadonlyMap<string, SpaceMarkerRecord>;
70
+ }
71
+ type SpaceVerifierViolation = {
72
+ readonly kind: 'declaredButUnmigrated';
73
+ readonly spaceId: string;
74
+ readonly remediation: string;
75
+ } | {
76
+ readonly kind: 'orphanMarker';
77
+ readonly spaceId: string;
78
+ readonly remediation: string;
79
+ } | {
80
+ readonly kind: 'orphanSpaceDir';
81
+ readonly spaceId: string;
82
+ readonly remediation: string;
83
+ } | {
84
+ readonly kind: 'hashMismatch';
85
+ readonly spaceId: string;
86
+ readonly priorHeadHash: string;
87
+ readonly markerHash: string;
88
+ readonly remediation: string;
89
+ } | {
90
+ readonly kind: 'invariantsMismatch';
91
+ readonly spaceId: string;
92
+ readonly onDiskInvariants: readonly string[];
93
+ readonly markerInvariants: readonly string[];
94
+ readonly remediation: string;
95
+ };
96
+ type VerifyContractSpacesResult = {
97
+ readonly ok: true;
98
+ } | {
99
+ readonly ok: false;
100
+ readonly violations: readonly SpaceVerifierViolation[];
101
+ };
102
+ /**
103
+ * Pure structural verifier for the per-space mechanism. Aggregates the
104
+ * three orphan / missing checks plus per-space hash and invariant
105
+ * comparison.
106
+ *
107
+ * Algorithm:
108
+ *
109
+ * - For every extension space declared in `loadedSpaces` (`'app'`
110
+ * excluded — the per-space verifier is scoped to extension spaces;
111
+ * the app is verified through the aggregate path):
112
+ * - If no contract-space dir on disk → `declaredButUnmigrated`.
113
+ * - Else if `markerRowsBySpace` lacks an entry → no violation here;
114
+ * the live-DB compare done outside this helper is where the
115
+ * absence shows up.
116
+ * - Else compare marker hash / invariants vs. on-disk head hash /
117
+ * invariants → `hashMismatch` / `invariantsMismatch` on drift.
118
+ * - For every contract-space dir on disk that is not in `loadedSpaces` →
119
+ * `orphanSpaceDir`.
120
+ * - For every marker row whose `space` is not in `loadedSpaces` →
121
+ * `orphanMarker`. The app-space marker is always loaded (`'app'` is
122
+ * in `loadedSpaces` by definition).
123
+ *
124
+ * Output is deterministic: violations are sorted first by `kind`
125
+ * (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →
126
+ * `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers
127
+ * passing equivalent inputs see byte-identical violation lists.
128
+ *
129
+ * Synchronous, pure, no I/O. **Does not import the extension descriptor**
130
+ * (the inputs are pre-resolved by the caller); the verifier reads only
131
+ * the user repo, not `node_modules`.
132
+ */
133
+ declare function verifyContractSpaces(inputs: VerifyContractSpacesInputs): VerifyContractSpacesResult;
134
+ //#endregion
135
+ export { VerifyContractSpacesResult as a, VerifyContractSpacesInputs as i, SpaceMarkerRecord as n, listContractSpaceDirectories as o, SpaceVerifierViolation as r, verifyContractSpaces as s, ContractSpaceHeadRecord as t };
136
+ //# sourceMappingURL=verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-Cc1u_wJo.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAoBiB,6BAA6B,+BAA+B;;;;;;;UAOnE;WACC;WACA;;;;;;;UAOD;WACC;WACA;;UAED;;;;;;;;WAQC,cAAc;;;;;;WAMd;;;;;;;;WAQA,iBAAiB,oBAAoB;;;;;WAKrC,mBAAmB,oBAAoB;;KAE7C;WACM;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;;KAEN;WACM;;WAEA;WACA,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCf,qBAAqB,QAAQ,6BAA6B"}
@@ -0,0 +1,54 @@
1
+ import { Plugin } from "vite";
2
+ //#region ../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.d.mts
3
+ //#region src/types.d.ts
4
+ /**
5
+ * Options for the Prisma Vite plugin.
6
+ */
7
+ interface PrismaVitePluginOptions {
8
+ /**
9
+ * Debounce delay in milliseconds for re-emit on file changes.
10
+ * @default 150
11
+ */
12
+ readonly debounceMs?: number;
13
+ /**
14
+ * Log level for plugin output.
15
+ * - 'silent': No output
16
+ * - 'info': Success messages and errors
17
+ * - 'debug': Verbose output including watched files
18
+ * @default 'info'
19
+ */
20
+ readonly logLevel?: 'silent' | 'info' | 'debug';
21
+ }
22
+ //#endregion
23
+ //#region src/plugin.d.ts
24
+ /**
25
+ * Creates a Vite plugin that automatically emits Prisma Next contract artifacts.
26
+ *
27
+ * The plugin resolves watched files from contract source provider metadata,
28
+ * re-emitting contract artifacts on changes with debounce while serializing
29
+ * overlapping emits into a single follow-up run.
30
+ *
31
+ * @param configPath - Path to prisma-next.config.ts (relative or absolute). Defaults to 'prisma-next.config.ts'
32
+ * @param options - Optional plugin configuration
33
+ * @returns Vite plugin
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { defineConfig } from 'vite';
38
+ * import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';
39
+ *
40
+ * // Use default config path
41
+ * export default defineConfig({
42
+ * plugins: [prismaVitePlugin()],
43
+ * });
44
+ *
45
+ * // Or specify a custom path
46
+ * export default defineConfig({
47
+ * plugins: [prismaVitePlugin('custom/prisma-next.config.ts')],
48
+ * });
49
+ * ```
50
+ */
51
+ declare function prismaVitePlugin(configPath?: string, options?: PrismaVitePluginOptions): Plugin;
52
+ //#endregion
53
+ export { type PrismaVitePluginOptions, prismaVitePlugin };
54
+ //# sourceMappingURL=vite-plugin-contract-emit.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin-contract-emit.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.d.mts"],"mappings":";;;;;;UAKU;;;;;WAKC;;;;;;;;WAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+BM,iBAAiB,qBAAqB,UAAU,0BAA0B"}
@@ -0,0 +1,303 @@
1
+ import { n as disposeEmitQueue, r as executeContractEmit } from "./contract-emit-B6odMoem-CK3diBPk.mjs";
2
+ import { r as getEmittedArtifactPaths } from "./exports-D3-NwrMA-CadaBGQ3.mjs";
3
+ import { r as loadConfig } from "./exports-Dl2aGAk7.mjs";
4
+ import { extname, resolve } from "pathe";
5
+ //#region ../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs
6
+ const PLUGIN_NAME = "prisma-vite-plugin-contract-emit";
7
+ const DEFAULT_DEBOUNCE_MS = 150;
8
+ const DEFAULT_CONFIG_PATH = "prisma-next.config.ts";
9
+ const MODULE_GRAPH_EXTENSIONS = /* @__PURE__ */ new Set([
10
+ ".js",
11
+ ".jsx",
12
+ ".mjs",
13
+ ".cjs",
14
+ ".ts",
15
+ ".tsx",
16
+ ".mts",
17
+ ".cts"
18
+ ]);
19
+ /**
20
+ * Creates a Vite plugin that automatically emits Prisma Next contract artifacts.
21
+ *
22
+ * The plugin resolves watched files from contract source provider metadata,
23
+ * re-emitting contract artifacts on changes with debounce while serializing
24
+ * overlapping emits into a single follow-up run.
25
+ *
26
+ * @param configPath - Path to prisma-next.config.ts (relative or absolute). Defaults to 'prisma-next.config.ts'
27
+ * @param options - Optional plugin configuration
28
+ * @returns Vite plugin
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * import { defineConfig } from 'vite';
33
+ * import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';
34
+ *
35
+ * // Use default config path
36
+ * export default defineConfig({
37
+ * plugins: [prismaVitePlugin()],
38
+ * });
39
+ *
40
+ * // Or specify a custom path
41
+ * export default defineConfig({
42
+ * plugins: [prismaVitePlugin('custom/prisma-next.config.ts')],
43
+ * });
44
+ * ```
45
+ */
46
+ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
47
+ const debounceMs = options?.debounceMs ?? DEFAULT_DEBOUNCE_MS;
48
+ const logLevel = options?.logLevel ?? "info";
49
+ let absoluteConfigPath;
50
+ const watchedFiles = /* @__PURE__ */ new Set();
51
+ const ignoredOutputFiles = /* @__PURE__ */ new Set();
52
+ const ownedOutputJsonPaths = /* @__PURE__ */ new Set();
53
+ let debounceTimer = null;
54
+ let lifecycleAbortController = new AbortController();
55
+ let server = null;
56
+ let isEmitInFlight = false;
57
+ let hasQueuedEmit = false;
58
+ let queuedEmitNeedsWatchedFileRefresh = false;
59
+ let didWarnConfigWatchFallback = false;
60
+ function log(message, level = "info") {
61
+ if (logLevel === "silent") return;
62
+ if (level === "debug" && logLevel !== "debug") return;
63
+ console.log(`[${PLUGIN_NAME}] ${message}`);
64
+ }
65
+ function logError(message, error) {
66
+ if (logLevel === "silent") return;
67
+ const errorMessage = error instanceof Error ? error.message : error ? String(error) : "";
68
+ console.error(`[${PLUGIN_NAME}] ${message}${errorMessage ? ` ${errorMessage}` : ""}`);
69
+ if (error instanceof Error && error.stack && logLevel === "debug") console.error(error.stack);
70
+ }
71
+ function logWarning(message) {
72
+ if (logLevel === "silent") return;
73
+ console.warn(`[${PLUGIN_NAME}] ${message}`);
74
+ }
75
+ function handleTrackedFileChange(file) {
76
+ const normalized = resolve(file);
77
+ if (ignoredOutputFiles.has(normalized)) {
78
+ log(`Ignoring emitted artifact update: ${normalized}`, "debug");
79
+ return;
80
+ }
81
+ if (watchedFiles.has(normalized)) {
82
+ log(`Detected change: ${normalized}`, "debug");
83
+ scheduleEmit();
84
+ }
85
+ }
86
+ async function emitContract({ refreshWatchedFiles = true } = {}) {
87
+ const signal = lifecycleAbortController.signal;
88
+ try {
89
+ if (server && refreshWatchedFiles) await updateWatchedFiles(server);
90
+ const result = await executeContractEmit({
91
+ configPath: absoluteConfigPath,
92
+ signal
93
+ });
94
+ log(`Emitted contract (storageHash: ${result.storageHash.slice(0, 8)}...)`);
95
+ log(` → ${result.files.json}`, "debug");
96
+ log(` → ${result.files.dts}`, "debug");
97
+ if (server) {
98
+ server.moduleGraph.onFileChange(result.files.json);
99
+ server.moduleGraph.onFileChange(result.files.dts);
100
+ }
101
+ if (server && !hasQueuedEmit) server.ws.send({ type: "full-reload" });
102
+ else if (hasQueuedEmit) log("Skipped full reload because a newer emit is queued", "debug");
103
+ return result;
104
+ } catch (error) {
105
+ if (signal.aborted || error instanceof Error && error.name === "AbortError") {
106
+ log("Emit cancelled", "debug");
107
+ return null;
108
+ }
109
+ logError("Contract emit failed:", error);
110
+ if (server) {
111
+ const errorMessage = error instanceof Error ? error.message : String(error);
112
+ const errorStack = error instanceof Error ? error.stack : void 0;
113
+ server.ws.send({
114
+ type: "error",
115
+ err: {
116
+ message: `[prisma-next] ${errorMessage}`,
117
+ stack: errorStack ?? "",
118
+ plugin: PLUGIN_NAME
119
+ }
120
+ });
121
+ }
122
+ return null;
123
+ }
124
+ }
125
+ async function drainQueuedEmits() {
126
+ if (isEmitInFlight || lifecycleAbortController.signal.aborted) return;
127
+ isEmitInFlight = true;
128
+ try {
129
+ while (hasQueuedEmit && !lifecycleAbortController.signal.aborted) {
130
+ const refreshWatchedFiles = queuedEmitNeedsWatchedFileRefresh;
131
+ hasQueuedEmit = false;
132
+ queuedEmitNeedsWatchedFileRefresh = false;
133
+ await emitContract({ refreshWatchedFiles });
134
+ }
135
+ } finally {
136
+ isEmitInFlight = false;
137
+ }
138
+ }
139
+ function requestEmit({ refreshWatchedFiles = true } = {}) {
140
+ if (lifecycleAbortController.signal.aborted) return Promise.resolve();
141
+ hasQueuedEmit = true;
142
+ queuedEmitNeedsWatchedFileRefresh ||= refreshWatchedFiles;
143
+ if (isEmitInFlight) {
144
+ log("Queued follow-up emit while another emit is running", "debug");
145
+ return Promise.resolve();
146
+ }
147
+ return drainQueuedEmits();
148
+ }
149
+ function scheduleEmit() {
150
+ if (debounceTimer) clearTimeout(debounceTimer);
151
+ debounceTimer = setTimeout(() => {
152
+ debounceTimer = null;
153
+ requestEmit();
154
+ }, debounceMs);
155
+ }
156
+ function resolveContractOutputFiles(contractOutput) {
157
+ if (contractOutput === void 0) return /* @__PURE__ */ new Set();
158
+ const { jsonPath, dtsPath } = getEmittedArtifactPaths(contractOutput);
159
+ ownedOutputJsonPaths.add(jsonPath);
160
+ return /* @__PURE__ */ new Set([jsonPath, dtsPath]);
161
+ }
162
+ function isModuleGraphRoot(filePath) {
163
+ return MODULE_GRAPH_EXTENSIONS.has(extname(filePath));
164
+ }
165
+ async function collectModuleGraphFiles(viteServer, roots) {
166
+ const files = /* @__PURE__ */ new Set();
167
+ const uniqueRoots = [...new Set(roots)];
168
+ for (const root of uniqueRoots) try {
169
+ await viteServer.ssrLoadModule(root);
170
+ } catch (error) {
171
+ if (root === absoluteConfigPath) logError("Failed to load config module graph root:", error);
172
+ else log(`Skipped module-graph root after load failure: ${root}`, "debug");
173
+ }
174
+ try {
175
+ const visited = /* @__PURE__ */ new Set();
176
+ const queue = [...uniqueRoots];
177
+ while (queue.length > 0) {
178
+ const current = queue.shift();
179
+ if (current === void 0 || visited.has(current)) continue;
180
+ visited.add(current);
181
+ const mod = viteServer.moduleGraph.getModuleById(current);
182
+ if (!mod) continue;
183
+ if (mod.file) files.add(mod.file);
184
+ for (const imported of mod.importedModules) if (imported.id && !visited.has(imported.id)) queue.push(imported.id);
185
+ }
186
+ } catch (error) {
187
+ logError("Failed to collect watched files:", error);
188
+ }
189
+ return files;
190
+ }
191
+ async function resolveWatchedFiles(viteServer) {
192
+ const previousWatchedFiles = new Set(watchedFiles);
193
+ const previousIgnoredOutputFiles = new Set(ignoredOutputFiles);
194
+ ignoredOutputFiles.clear();
195
+ try {
196
+ const config = await loadConfig(absoluteConfigPath);
197
+ didWarnConfigWatchFallback = false;
198
+ const contract = config.contract;
199
+ if (!contract) return /* @__PURE__ */ new Set([absoluteConfigPath]);
200
+ const files = /* @__PURE__ */ new Set([absoluteConfigPath]);
201
+ const inputs = contract.source.inputs ?? [];
202
+ for (const outputFile of resolveContractOutputFiles(contract.output)) ignoredOutputFiles.add(outputFile);
203
+ const moduleGraphRoots = [absoluteConfigPath];
204
+ for (const input of inputs) {
205
+ if (!ignoredOutputFiles.has(input)) files.add(input);
206
+ if (isModuleGraphRoot(input)) moduleGraphRoots.push(input);
207
+ }
208
+ for (const file of await collectModuleGraphFiles(viteServer, moduleGraphRoots)) if (!ignoredOutputFiles.has(file)) files.add(file);
209
+ return files;
210
+ } catch (error) {
211
+ if (previousIgnoredOutputFiles.size > 0) for (const outputFile of previousIgnoredOutputFiles) ignoredOutputFiles.add(outputFile);
212
+ if (!didWarnConfigWatchFallback) {
213
+ didWarnConfigWatchFallback = true;
214
+ const reason = error instanceof Error ? ` ${error.message}` : "";
215
+ logWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma Next config inputs could not be resolved.${reason} Contract watch coverage is partial.`);
216
+ }
217
+ if (previousWatchedFiles.size > 0) {
218
+ previousWatchedFiles.add(absoluteConfigPath);
219
+ return previousWatchedFiles;
220
+ }
221
+ return /* @__PURE__ */ new Set([absoluteConfigPath]);
222
+ }
223
+ }
224
+ async function updateWatchedFiles(viteServer) {
225
+ const newWatchedFiles = await resolveWatchedFiles(viteServer);
226
+ const toAdd = [];
227
+ const toRemove = [];
228
+ for (const file of newWatchedFiles) if (!watchedFiles.has(file)) toAdd.push(file);
229
+ for (const file of watchedFiles) if (!newWatchedFiles.has(file)) toRemove.push(file);
230
+ for (const file of toAdd) viteServer.watcher.add(file);
231
+ for (const file of toRemove) viteServer.watcher.unwatch(file);
232
+ watchedFiles.clear();
233
+ for (const file of newWatchedFiles) watchedFiles.add(file);
234
+ if (toAdd.length > 0 || toRemove.length > 0) log(`Updated watched files: +${toAdd.length} -${toRemove.length}`, "debug");
235
+ }
236
+ return {
237
+ name: PLUGIN_NAME,
238
+ configResolved(config) {
239
+ absoluteConfigPath = resolve(config.root, configPath);
240
+ log(`Config path: ${absoluteConfigPath}`, "debug");
241
+ },
242
+ async configureServer(viteServer) {
243
+ server = viteServer;
244
+ lifecycleAbortController = new AbortController();
245
+ isEmitInFlight = false;
246
+ hasQueuedEmit = false;
247
+ queuedEmitNeedsWatchedFileRefresh = false;
248
+ const onTrackedWatcherEvent = (file) => {
249
+ handleTrackedFileChange(file);
250
+ };
251
+ const cleanup = () => {
252
+ if (debounceTimer) {
253
+ clearTimeout(debounceTimer);
254
+ debounceTimer = null;
255
+ }
256
+ hasQueuedEmit = false;
257
+ queuedEmitNeedsWatchedFileRefresh = false;
258
+ lifecycleAbortController.abort();
259
+ viteServer.watcher.off?.("change", onTrackedWatcherEvent);
260
+ viteServer.watcher.off?.("add", onTrackedWatcherEvent);
261
+ viteServer.watcher.off?.("unlink", onTrackedWatcherEvent);
262
+ ignoredOutputFiles.clear();
263
+ for (const outputJsonPath of ownedOutputJsonPaths) disposeEmitQueue(outputJsonPath);
264
+ ownedOutputJsonPaths.clear();
265
+ didWarnConfigWatchFallback = false;
266
+ server = null;
267
+ watchedFiles.clear();
268
+ log("Server closed, cleaned up resources", "debug");
269
+ };
270
+ viteServer.httpServer?.on("close", cleanup);
271
+ viteServer.watcher?.on?.("close", cleanup);
272
+ viteServer.watcher.on("change", onTrackedWatcherEvent);
273
+ viteServer.watcher.on("add", onTrackedWatcherEvent);
274
+ viteServer.watcher.on("unlink", onTrackedWatcherEvent);
275
+ const initialWatchedFiles = await resolveWatchedFiles(viteServer);
276
+ for (const file of initialWatchedFiles) watchedFiles.add(file);
277
+ for (const file of watchedFiles) viteServer.watcher.add(file);
278
+ if (watchedFiles.size === 0) {
279
+ const errorMessage = `No files are being watched. The config file "${absoluteConfigPath}" could not be loaded or has no dependencies. HMR for contract changes will not work.`;
280
+ logError(errorMessage);
281
+ viteServer.ws.send({
282
+ type: "error",
283
+ err: {
284
+ message: `[prisma-next] ${errorMessage}`,
285
+ stack: "",
286
+ plugin: PLUGIN_NAME
287
+ }
288
+ });
289
+ } else {
290
+ log(`Watching ${watchedFiles.size} files`, "debug");
291
+ if (logLevel === "debug") for (const file of watchedFiles) log(` ${file}`, "debug");
292
+ }
293
+ await requestEmit({ refreshWatchedFiles: false });
294
+ },
295
+ handleHotUpdate(ctx) {
296
+ handleTrackedFileChange(ctx.file);
297
+ }
298
+ };
299
+ }
300
+ //#endregion
301
+ export { prismaVitePlugin };
302
+
303
+ //# sourceMappingURL=vite-plugin-contract-emit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin-contract-emit.mjs","names":[],"sources":["../../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs"],"sourcesContent":["import { disposeEmitQueue, executeContractEmit } from \"@internal/cli/control-api\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { extname, resolve } from \"pathe\";\n//#region src/plugin.ts\nconst PLUGIN_NAME = \"prisma-vite-plugin-contract-emit\";\nconst DEFAULT_DEBOUNCE_MS = 150;\nconst DEFAULT_CONFIG_PATH = \"prisma-next.config.ts\";\nconst MODULE_GRAPH_EXTENSIONS = /* @__PURE__ */ new Set([\n\t\".js\",\n\t\".jsx\",\n\t\".mjs\",\n\t\".cjs\",\n\t\".ts\",\n\t\".tsx\",\n\t\".mts\",\n\t\".cts\"\n]);\n/**\n* Creates a Vite plugin that automatically emits Prisma Next contract artifacts.\n*\n* The plugin resolves watched files from contract source provider metadata,\n* re-emitting contract artifacts on changes with debounce while serializing\n* overlapping emits into a single follow-up run.\n*\n* @param configPath - Path to prisma-next.config.ts (relative or absolute). Defaults to 'prisma-next.config.ts'\n* @param options - Optional plugin configuration\n* @returns Vite plugin\n*\n* @example\n* ```ts\n* import { defineConfig } from 'vite';\n* import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';\n*\n* // Use default config path\n* export default defineConfig({\n* plugins: [prismaVitePlugin()],\n* });\n*\n* // Or specify a custom path\n* export default defineConfig({\n* plugins: [prismaVitePlugin('custom/prisma-next.config.ts')],\n* });\n* ```\n*/\nfunction prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {\n\tconst debounceMs = options?.debounceMs ?? DEFAULT_DEBOUNCE_MS;\n\tconst logLevel = options?.logLevel ?? \"info\";\n\tlet absoluteConfigPath;\n\tconst watchedFiles = /* @__PURE__ */ new Set();\n\tconst ignoredOutputFiles = /* @__PURE__ */ new Set();\n\tconst ownedOutputJsonPaths = /* @__PURE__ */ new Set();\n\tlet debounceTimer = null;\n\tlet lifecycleAbortController = new AbortController();\n\tlet server = null;\n\tlet isEmitInFlight = false;\n\tlet hasQueuedEmit = false;\n\tlet queuedEmitNeedsWatchedFileRefresh = false;\n\tlet didWarnConfigWatchFallback = false;\n\tfunction log(message, level = \"info\") {\n\t\tif (logLevel === \"silent\") return;\n\t\tif (level === \"debug\" && logLevel !== \"debug\") return;\n\t\tconsole.log(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction logError(message, error) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconst errorMessage = error instanceof Error ? error.message : error ? String(error) : \"\";\n\t\tconsole.error(`[${PLUGIN_NAME}] ${message}${errorMessage ? ` ${errorMessage}` : \"\"}`);\n\t\tif (error instanceof Error && error.stack && logLevel === \"debug\") console.error(error.stack);\n\t}\n\tfunction logWarning(message) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconsole.warn(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction handleTrackedFileChange(file) {\n\t\tconst normalized = resolve(file);\n\t\tif (ignoredOutputFiles.has(normalized)) {\n\t\t\tlog(`Ignoring emitted artifact update: ${normalized}`, \"debug\");\n\t\t\treturn;\n\t\t}\n\t\tif (watchedFiles.has(normalized)) {\n\t\t\tlog(`Detected change: ${normalized}`, \"debug\");\n\t\t\tscheduleEmit();\n\t\t}\n\t}\n\tasync function emitContract({ refreshWatchedFiles = true } = {}) {\n\t\tconst signal = lifecycleAbortController.signal;\n\t\ttry {\n\t\t\tif (server && refreshWatchedFiles) await updateWatchedFiles(server);\n\t\t\tconst result = await executeContractEmit({\n\t\t\t\tconfigPath: absoluteConfigPath,\n\t\t\t\tsignal\n\t\t\t});\n\t\t\tlog(`Emitted contract (storageHash: ${result.storageHash.slice(0, 8)}...)`);\n\t\t\tlog(` → ${result.files.json}`, \"debug\");\n\t\t\tlog(` → ${result.files.dts}`, \"debug\");\n\t\t\tif (server) {\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.json);\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.dts);\n\t\t\t}\n\t\t\tif (server && !hasQueuedEmit) server.ws.send({ type: \"full-reload\" });\n\t\t\telse if (hasQueuedEmit) log(\"Skipped full reload because a newer emit is queued\", \"debug\");\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (signal.aborted || error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tlog(\"Emit cancelled\", \"debug\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlogError(\"Contract emit failed:\", error);\n\t\t\tif (server) {\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\t\tconst errorStack = error instanceof Error ? error.stack : void 0;\n\t\t\t\tserver.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: errorStack ?? \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\tasync function drainQueuedEmits() {\n\t\tif (isEmitInFlight || lifecycleAbortController.signal.aborted) return;\n\t\tisEmitInFlight = true;\n\t\ttry {\n\t\t\twhile (hasQueuedEmit && !lifecycleAbortController.signal.aborted) {\n\t\t\t\tconst refreshWatchedFiles = queuedEmitNeedsWatchedFileRefresh;\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tawait emitContract({ refreshWatchedFiles });\n\t\t\t}\n\t\t} finally {\n\t\t\tisEmitInFlight = false;\n\t\t}\n\t}\n\tfunction requestEmit({ refreshWatchedFiles = true } = {}) {\n\t\tif (lifecycleAbortController.signal.aborted) return Promise.resolve();\n\t\thasQueuedEmit = true;\n\t\tqueuedEmitNeedsWatchedFileRefresh ||= refreshWatchedFiles;\n\t\tif (isEmitInFlight) {\n\t\t\tlog(\"Queued follow-up emit while another emit is running\", \"debug\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn drainQueuedEmits();\n\t}\n\tfunction scheduleEmit() {\n\t\tif (debounceTimer) clearTimeout(debounceTimer);\n\t\tdebounceTimer = setTimeout(() => {\n\t\t\tdebounceTimer = null;\n\t\t\trequestEmit();\n\t\t}, debounceMs);\n\t}\n\tfunction resolveContractOutputFiles(contractOutput) {\n\t\tif (contractOutput === void 0) return /* @__PURE__ */ new Set();\n\t\tconst { jsonPath, dtsPath } = getEmittedArtifactPaths(contractOutput);\n\t\townedOutputJsonPaths.add(jsonPath);\n\t\treturn /* @__PURE__ */ new Set([jsonPath, dtsPath]);\n\t}\n\tfunction isModuleGraphRoot(filePath) {\n\t\treturn MODULE_GRAPH_EXTENSIONS.has(extname(filePath));\n\t}\n\tasync function collectModuleGraphFiles(viteServer, roots) {\n\t\tconst files = /* @__PURE__ */ new Set();\n\t\tconst uniqueRoots = [...new Set(roots)];\n\t\tfor (const root of uniqueRoots) try {\n\t\t\tawait viteServer.ssrLoadModule(root);\n\t\t} catch (error) {\n\t\t\tif (root === absoluteConfigPath) logError(\"Failed to load config module graph root:\", error);\n\t\t\telse log(`Skipped module-graph root after load failure: ${root}`, \"debug\");\n\t\t}\n\t\ttry {\n\t\t\tconst visited = /* @__PURE__ */ new Set();\n\t\t\tconst queue = [...uniqueRoots];\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst current = queue.shift();\n\t\t\t\tif (current === void 0 || visited.has(current)) continue;\n\t\t\t\tvisited.add(current);\n\t\t\t\tconst mod = viteServer.moduleGraph.getModuleById(current);\n\t\t\t\tif (!mod) continue;\n\t\t\t\tif (mod.file) files.add(mod.file);\n\t\t\t\tfor (const imported of mod.importedModules) if (imported.id && !visited.has(imported.id)) queue.push(imported.id);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogError(\"Failed to collect watched files:\", error);\n\t\t}\n\t\treturn files;\n\t}\n\tasync function resolveWatchedFiles(viteServer) {\n\t\tconst previousWatchedFiles = new Set(watchedFiles);\n\t\tconst previousIgnoredOutputFiles = new Set(ignoredOutputFiles);\n\t\tignoredOutputFiles.clear();\n\t\ttry {\n\t\t\tconst config = await loadConfig(absoluteConfigPath);\n\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\tconst contract = config.contract;\n\t\t\tif (!contract) return /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst files = /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst inputs = contract.source.inputs ?? [];\n\t\t\tfor (const outputFile of resolveContractOutputFiles(contract.output)) ignoredOutputFiles.add(outputFile);\n\t\t\tconst moduleGraphRoots = [absoluteConfigPath];\n\t\t\tfor (const input of inputs) {\n\t\t\t\tif (!ignoredOutputFiles.has(input)) files.add(input);\n\t\t\t\tif (isModuleGraphRoot(input)) moduleGraphRoots.push(input);\n\t\t\t}\n\t\t\tfor (const file of await collectModuleGraphFiles(viteServer, moduleGraphRoots)) if (!ignoredOutputFiles.has(file)) files.add(file);\n\t\t\treturn files;\n\t\t} catch (error) {\n\t\t\tif (previousIgnoredOutputFiles.size > 0) for (const outputFile of previousIgnoredOutputFiles) ignoredOutputFiles.add(outputFile);\n\t\t\tif (!didWarnConfigWatchFallback) {\n\t\t\t\tdidWarnConfigWatchFallback = true;\n\t\t\t\tconst reason = error instanceof Error ? ` ${error.message}` : \"\";\n\t\t\t\tlogWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma Next config inputs could not be resolved.${reason} Contract watch coverage is partial.`);\n\t\t\t}\n\t\t\tif (previousWatchedFiles.size > 0) {\n\t\t\t\tpreviousWatchedFiles.add(absoluteConfigPath);\n\t\t\t\treturn previousWatchedFiles;\n\t\t\t}\n\t\t\treturn /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t}\n\t}\n\tasync function updateWatchedFiles(viteServer) {\n\t\tconst newWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\tconst toAdd = [];\n\t\tconst toRemove = [];\n\t\tfor (const file of newWatchedFiles) if (!watchedFiles.has(file)) toAdd.push(file);\n\t\tfor (const file of watchedFiles) if (!newWatchedFiles.has(file)) toRemove.push(file);\n\t\tfor (const file of toAdd) viteServer.watcher.add(file);\n\t\tfor (const file of toRemove) viteServer.watcher.unwatch(file);\n\t\twatchedFiles.clear();\n\t\tfor (const file of newWatchedFiles) watchedFiles.add(file);\n\t\tif (toAdd.length > 0 || toRemove.length > 0) log(`Updated watched files: +${toAdd.length} -${toRemove.length}`, \"debug\");\n\t}\n\treturn {\n\t\tname: PLUGIN_NAME,\n\t\tconfigResolved(config) {\n\t\t\tabsoluteConfigPath = resolve(config.root, configPath);\n\t\t\tlog(`Config path: ${absoluteConfigPath}`, \"debug\");\n\t\t},\n\t\tasync configureServer(viteServer) {\n\t\t\tserver = viteServer;\n\t\t\tlifecycleAbortController = new AbortController();\n\t\t\tisEmitInFlight = false;\n\t\t\thasQueuedEmit = false;\n\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\tconst onTrackedWatcherEvent = (file) => {\n\t\t\t\thandleTrackedFileChange(file);\n\t\t\t};\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (debounceTimer) {\n\t\t\t\t\tclearTimeout(debounceTimer);\n\t\t\t\t\tdebounceTimer = null;\n\t\t\t\t}\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tlifecycleAbortController.abort();\n\t\t\t\tviteServer.watcher.off?.(\"change\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"add\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"unlink\", onTrackedWatcherEvent);\n\t\t\t\tignoredOutputFiles.clear();\n\t\t\t\tfor (const outputJsonPath of ownedOutputJsonPaths) disposeEmitQueue(outputJsonPath);\n\t\t\t\townedOutputJsonPaths.clear();\n\t\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\t\tserver = null;\n\t\t\t\twatchedFiles.clear();\n\t\t\t\tlog(\"Server closed, cleaned up resources\", \"debug\");\n\t\t\t};\n\t\t\tviteServer.httpServer?.on(\"close\", cleanup);\n\t\t\tviteServer.watcher?.on?.(\"close\", cleanup);\n\t\t\tviteServer.watcher.on(\"change\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"add\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"unlink\", onTrackedWatcherEvent);\n\t\t\tconst initialWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\t\tfor (const file of initialWatchedFiles) watchedFiles.add(file);\n\t\t\tfor (const file of watchedFiles) viteServer.watcher.add(file);\n\t\t\tif (watchedFiles.size === 0) {\n\t\t\t\tconst errorMessage = `No files are being watched. The config file \"${absoluteConfigPath}\" could not be loaded or has no dependencies. HMR for contract changes will not work.`;\n\t\t\t\tlogError(errorMessage);\n\t\t\t\tviteServer.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlog(`Watching ${watchedFiles.size} files`, \"debug\");\n\t\t\t\tif (logLevel === \"debug\") for (const file of watchedFiles) log(` ${file}`, \"debug\");\n\t\t\t}\n\t\t\tawait requestEmit({ refreshWatchedFiles: false });\n\t\t},\n\t\thandleHotUpdate(ctx) {\n\t\t\thandleTrackedFileChange(ctx.file);\n\t\t}\n\t};\n}\n//#endregion\nexport { prismaVitePlugin };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;AAKA,MAAM,cAAc;AACpB,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB;AAC5B,MAAM,0CAA0C,IAAI,IAAI;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BD,SAAS,iBAAiB,aAAa,qBAAqB,SAAS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