@prisma/orm-toolchain 0.16.0

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-DcwUnadt-B6Qoh0ot.mjs +597 -0
  191. package/dist/migration-check-DcwUnadt-B6Qoh0ot.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-CE7cQLDq-B1jDVmqG.mjs +444 -0
  217. package/dist/migration-status-CE7cQLDq-B1jDVmqG.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-CfGSxH5b-BSjB3nZS.d.mts +192 -0
  292. package/dist/schemas-CfGSxH5b-BSjB3nZS.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 +122 -0
@@ -0,0 +1,168 @@
1
+ import { a as snapshotsImportPathFrom, o as writeContractSnapshot, t as contractSnapshotDir } from "./contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs";
2
+ import { t as computeMigrationHash } from "./hash-DH8hl5Rq-BpM2t3Nu.mjs";
3
+ import { r as formatMigrationDirName, u as writeMigrationPackage } from "./io-C8TdyBKt-DloEBi70.mjs";
4
+ import { r as findLatestMigration } from "./migration-graph-CBf9ORe7-B4xAF8GN.mjs";
5
+ import { K as getTargetMigrations, N as errorUnexpected, O as errorRuntime$1, W as formatStyledHeader, at as resolveMigrationPaths, ct as setCommandExamples, it as resolveContractPath, j as errorTargetMigrationNotSupported, o as createTerminalUI, q as handleResult, r as addGlobalOptions, st as setCommandDescriptions, t as CliStructuredError$1, tt as parseGlobalFlagsOrExit } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
6
+ import { t as assertFrameworkComponentsCompatible } from "./framework-components-CjshQKHA-Dlp6Leo5.mjs";
7
+ import { t as createProjectSpecifierResolver } from "./project-import-root-CpwLCDLY-DkVwAnWj.mjs";
8
+ import { r as getEmittedArtifactPaths } from "./exports-D3-NwrMA-CadaBGQ3.mjs";
9
+ import { r as loadConfig } from "./exports-Dl2aGAk7.mjs";
10
+ import { s as loadContractSpaceAggregate } from "./aggregate-B4mhR4Sk.mjs";
11
+ import { o as refusePackageCorruptionOnAggregate } from "./contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs";
12
+ import { i as writeMigrationTs } from "./migration-ts-FyF55c4M.mjs";
13
+ import { notOk, ok } from "@prisma/orm-framework/utils/result";
14
+ import { join, relative } from "pathe";
15
+ import { readFile } from "node:fs/promises";
16
+ import { APP_SPACE_ID, createControlStack } from "@prisma/orm-framework/components/control";
17
+ import { Command } from "commander";
18
+ //#region ../../../1-framework/3-tooling/cli/dist/commands/migration-new.mjs
19
+ /**
20
+ * `migration new` — scaffolds a migration package with a `migration.ts` file
21
+ * for manual authoring.
22
+ *
23
+ * The planner's `emptyMigration(context)` returns a
24
+ * `MigrationPlanWithAuthoringSurface`, whose `renderTypeScript(resolver)`
25
+ * produces the target-appropriate empty stub. The CLI writes the returned
26
+ * source verbatim.
27
+ *
28
+ * The resolver is the one this project's own manifest implies, so the
29
+ * scaffold names packages the project can resolve — the same resolver
30
+ * `contract emit` hands to the emitter (ADR 242).
31
+ */
32
+ async function executeMigrationNewCommand(options) {
33
+ const config = await loadConfig(options.config);
34
+ const { migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config);
35
+ const stack = createControlStack(config);
36
+ const familyInstance = config.family.create(stack);
37
+ const controlAdapter = config.adapter.create(stack);
38
+ const contractPathAbsolute = resolveContractPath(config);
39
+ let contractJsonContent;
40
+ try {
41
+ contractJsonContent = await readFile(contractPathAbsolute, "utf-8");
42
+ } catch (error) {
43
+ if (error instanceof Error && error.code === "ENOENT") return notOk(errorRuntime$1(`Contract file not found at ${contractPathAbsolute}`, {
44
+ why: `Contract file not found at ${contractPathAbsolute}`,
45
+ fix: "Run `prisma-next contract emit` first to generate the contract"
46
+ }));
47
+ throw error;
48
+ }
49
+ let toContract;
50
+ try {
51
+ const parsedContract = JSON.parse(contractJsonContent);
52
+ toContract = familyInstance.deserializeContract(parsedContract);
53
+ } catch (error) {
54
+ return notOk(errorRuntime$1("Contract JSON is invalid", {
55
+ why: `Failed to deserialize ${contractPathAbsolute}: ${error instanceof Error ? error.message : String(error)}`,
56
+ fix: "Run `prisma-next contract emit` to regenerate the contract"
57
+ }));
58
+ }
59
+ const toStorageHash = toContract.storage?.storageHash;
60
+ if (typeof toStorageHash !== "string") return notOk(errorRuntime$1("Contract is missing storageHash", {
61
+ why: `Contract at ${contractPathAbsolute} has no storageHash`,
62
+ fix: "Run `prisma-next contract emit` to regenerate the contract"
63
+ }));
64
+ const aggregate = await loadContractSpaceAggregate({
65
+ migrationsDir,
66
+ deserializeContract: (json) => familyInstance.deserializeContract(json),
67
+ appContract: toContract
68
+ });
69
+ const packageCorruptionFailure = refusePackageCorruptionOnAggregate(aggregate);
70
+ if (packageCorruptionFailure) return notOk(packageCorruptionFailure);
71
+ const packages = aggregate.app.packages;
72
+ const graph = aggregate.app.graph();
73
+ let fromHash = null;
74
+ if (packages.length > 0) if (options.from) {
75
+ const match = packages.find((p) => p.metadata.to.startsWith(options.from));
76
+ if (!match) return notOk(errorRuntime$1("Starting contract not found", {
77
+ why: `No migration with to hash matching "${options.from}" exists in ${appMigrationsRelative}`,
78
+ fix: "Check that the --from hash matches a known migration target hash."
79
+ }));
80
+ fromHash = match.metadata.to;
81
+ } else {
82
+ const latestMigration = findLatestMigration(graph);
83
+ if (latestMigration) fromHash = latestMigration.to;
84
+ }
85
+ if (fromHash === toStorageHash && !options.from) return notOk(errorRuntime$1("No changes detected", {
86
+ why: "The from and to contract hashes are identical — there is nothing to migrate.",
87
+ fix: "Change the contract and run `prisma-next contract emit` before creating a new migration. To author a data-only migration on the current contract hash, pass `--from <hash>` explicitly."
88
+ }));
89
+ const timestamp = /* @__PURE__ */ new Date();
90
+ const packageDir = join(appMigrationsDir, formatMigrationDirName(timestamp, options.name ?? "migration"));
91
+ const baseMetadata = {
92
+ from: fromHash,
93
+ to: toStorageHash,
94
+ providedInvariants: [],
95
+ createdAt: timestamp.toISOString()
96
+ };
97
+ const metadata = {
98
+ ...baseMetadata,
99
+ migrationHash: computeMigrationHash(baseMetadata, [])
100
+ };
101
+ const migrations = getTargetMigrations(config.target);
102
+ if (!migrations) return notOk(errorTargetMigrationNotSupported({ why: `Target "${config.target.targetId}" does not support migrations` }));
103
+ try {
104
+ assertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [
105
+ config.target,
106
+ config.adapter,
107
+ ...config.extensions ?? []
108
+ ]);
109
+ const resolveSpecifier = createProjectSpecifierResolver(options.config);
110
+ await writeMigrationPackage(packageDir, metadata, []);
111
+ const destinationArtifacts = getEmittedArtifactPaths(contractPathAbsolute);
112
+ const [contractJsonRaw, contractDts] = await Promise.all([readFile(destinationArtifacts.jsonPath, "utf-8"), readFile(destinationArtifacts.dtsPath, "utf-8")]);
113
+ await writeContractSnapshot(migrationsDir, toStorageHash, {
114
+ contractJson: JSON.parse(contractJsonRaw),
115
+ contractDts
116
+ });
117
+ await writeMigrationTs(packageDir, migrations.createPlanner(controlAdapter).emptyMigration({
118
+ packageDir,
119
+ contractJsonPath: join(contractSnapshotDir(migrationsDir, toStorageHash), "contract.json"),
120
+ fromHash,
121
+ toHash: toStorageHash,
122
+ snapshotsImportPath: snapshotsImportPathFrom(packageDir, migrationsDir)
123
+ }, APP_SPACE_ID).renderTypeScript(resolveSpecifier));
124
+ return ok({
125
+ ok: true,
126
+ dir: relative(process.cwd(), packageDir),
127
+ from: fromHash,
128
+ to: toStorageHash,
129
+ summary: `Scaffolded migration at ${relative(process.cwd(), packageDir)}`
130
+ });
131
+ } catch (error) {
132
+ if (CliStructuredError$1.is(error)) return notOk(error);
133
+ return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to scaffold migration: ${error instanceof Error ? error.message : String(error)}` }));
134
+ }
135
+ }
136
+ function createMigrationNewCommand() {
137
+ const command = new Command("new");
138
+ setCommandDescriptions(command, "Scaffold a new migration for manual authoring", "Creates a migration package with a migration.ts file for manual authoring.\nWrite the migration body in migration.ts, then run the file with Node\n(`node migration.ts`) to self-emit ops.json and attest the package.");
139
+ setCommandExamples(command, ["prisma-next migration new --name split-name", "prisma-next migration new --name custom-fk --from abc123..."]);
140
+ addGlobalOptions(command).option("--name <slug>", "Migration name (used in directory name)").option("--from <hash>", "Starting contract hash (default: latest migration target)").option("--config <path>", "Path to prisma-next.config.ts").action(async (options) => {
141
+ const flags = parseGlobalFlagsOrExit(options);
142
+ const ui = createTerminalUI(flags);
143
+ if (!flags.json && !flags.quiet) {
144
+ const header = formatStyledHeader({
145
+ command: "migration new",
146
+ description: "Scaffold a new migration",
147
+ details: [],
148
+ flags
149
+ });
150
+ ui.stderr(header);
151
+ }
152
+ const exitCode = handleResult(await executeMigrationNewCommand(options), flags, ui, (value) => {
153
+ if (flags.json) ui.output(JSON.stringify(value, null, 2));
154
+ else if (!flags.quiet) {
155
+ ui.output(`\nScaffolded migration at ${value.dir}`);
156
+ ui.output(` from: ${value.from}`);
157
+ ui.output(` to: ${value.to}`);
158
+ ui.output(`\nEdit migration.ts, then run it directly (\`node "${value.dir}/migration.ts"\`) to self-emit and attest.`);
159
+ }
160
+ });
161
+ process.exit(exitCode);
162
+ });
163
+ return command;
164
+ }
165
+ //#endregion
166
+ export { createMigrationNewCommand as t };
167
+
168
+ //# sourceMappingURL=migration-new-BurCjyaQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-new-BurCjyaQ.mjs","names":["errorRuntime","CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migration-new.mjs"],"sourcesContent":["import { A as formatStyledHeader, F as CliStructuredError, _ as createTerminalUI, ct as errorUnexpected, g as parseGlobalFlagsOrExit, l as setCommandDescriptions, o as resolveContractPath, ot as errorTargetMigrationNotSupported, r as getTargetMigrations, rt as errorRuntime, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"../command-helpers-CAoXqAY9.mjs\";\nimport { t as assertFrameworkComponentsCompatible } from \"../framework-components-CjshQKHA.mjs\";\nimport { t as createProjectSpecifierResolver } from \"../project-import-root-CpwLCDLY.mjs\";\nimport { o as refusePackageCorruptionOnAggregate } from \"../contract-space-aggregate-loader-CFH-336b.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { join, relative } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID, createControlStack } from \"@internal/framework-components/control\";\nimport { loadContractSpaceAggregate } from \"@internal/migration-tools/aggregate\";\nimport { findLatestMigration } from \"@internal/migration-tools/migration-graph\";\nimport { contractSnapshotDir, snapshotsImportPathFrom, writeContractSnapshot } from \"@internal/migration-tools/contract-snapshot-store\";\nimport { computeMigrationHash } from \"@internal/migration-tools/hash\";\nimport { formatMigrationDirName, writeMigrationPackage } from \"@internal/migration-tools/io\";\nimport { writeMigrationTs } from \"@internal/migration-tools/migration-ts\";\n//#region src/commands/migration-new.ts\n/**\n* `migration new` — scaffolds a migration package with a `migration.ts` file\n* for manual authoring.\n*\n* The planner's `emptyMigration(context)` returns a\n* `MigrationPlanWithAuthoringSurface`, whose `renderTypeScript(resolver)`\n* produces the target-appropriate empty stub. The CLI writes the returned\n* source verbatim.\n*\n* The resolver is the one this project's own manifest implies, so the\n* scaffold names packages the project can resolve — the same resolver\n* `contract emit` hands to the emitter (ADR 242).\n*/\nasync function executeMigrationNewCommand(options) {\n\tconst config = await loadConfig(options.config);\n\tconst { migrationsDir, appMigrationsDir, appMigrationsRelative } = resolveMigrationPaths(options.config, config);\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst controlAdapter = config.adapter.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorRuntime(`Contract file not found at ${contractPathAbsolute}`, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `prisma-next contract emit` first to generate the contract\"\n\t\t}));\n\t\tthrow error;\n\t}\n\tlet toContract;\n\ttry {\n\t\tconst parsedContract = JSON.parse(contractJsonContent);\n\t\ttoContract = familyInstance.deserializeContract(parsedContract);\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"Contract JSON is invalid\", {\n\t\t\twhy: `Failed to deserialize ${contractPathAbsolute}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\tfix: \"Run `prisma-next contract emit` to regenerate the contract\"\n\t\t}));\n\t}\n\tconst toStorageHash = toContract.storage?.storageHash;\n\tif (typeof toStorageHash !== \"string\") return notOk(errorRuntime(\"Contract is missing storageHash\", {\n\t\twhy: `Contract at ${contractPathAbsolute} has no storageHash`,\n\t\tfix: \"Run `prisma-next contract emit` to regenerate the contract\"\n\t}));\n\tconst aggregate = await loadContractSpaceAggregate({\n\t\tmigrationsDir,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json),\n\t\tappContract: toContract\n\t});\n\tconst packageCorruptionFailure = refusePackageCorruptionOnAggregate(aggregate);\n\tif (packageCorruptionFailure) return notOk(packageCorruptionFailure);\n\tconst packages = aggregate.app.packages;\n\tconst graph = aggregate.app.graph();\n\tlet fromHash = null;\n\tif (packages.length > 0) if (options.from) {\n\t\tconst match = packages.find((p) => p.metadata.to.startsWith(options.from));\n\t\tif (!match) return notOk(errorRuntime(\"Starting contract not found\", {\n\t\t\twhy: `No migration with to hash matching \"${options.from}\" exists in ${appMigrationsRelative}`,\n\t\t\tfix: \"Check that the --from hash matches a known migration target hash.\"\n\t\t}));\n\t\tfromHash = match.metadata.to;\n\t} else {\n\t\tconst latestMigration = findLatestMigration(graph);\n\t\tif (latestMigration) fromHash = latestMigration.to;\n\t}\n\tif (fromHash === toStorageHash && !options.from) return notOk(errorRuntime(\"No changes detected\", {\n\t\twhy: \"The from and to contract hashes are identical — there is nothing to migrate.\",\n\t\tfix: \"Change the contract and run `prisma-next contract emit` before creating a new migration. To author a data-only migration on the current contract hash, pass `--from <hash>` explicitly.\"\n\t}));\n\tconst timestamp = /* @__PURE__ */ new Date();\n\tconst packageDir = join(appMigrationsDir, formatMigrationDirName(timestamp, options.name ?? \"migration\"));\n\tconst baseMetadata = {\n\t\tfrom: fromHash,\n\t\tto: toStorageHash,\n\t\tprovidedInvariants: [],\n\t\tcreatedAt: timestamp.toISOString()\n\t};\n\tconst metadata = {\n\t\t...baseMetadata,\n\t\tmigrationHash: computeMigrationHash(baseMetadata, [])\n\t};\n\tconst migrations = getTargetMigrations(config.target);\n\tif (!migrations) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.targetId}\" does not support migrations` }));\n\ttry {\n\t\tassertFrameworkComponentsCompatible(config.family.familyId, config.target.targetId, [\n\t\t\tconfig.target,\n\t\t\tconfig.adapter,\n\t\t\t...config.extensions ?? []\n\t\t]);\n\t\tconst resolveSpecifier = createProjectSpecifierResolver(options.config);\n\t\tawait writeMigrationPackage(packageDir, metadata, []);\n\t\tconst destinationArtifacts = getEmittedArtifactPaths(contractPathAbsolute);\n\t\tconst [contractJsonRaw, contractDts] = await Promise.all([readFile(destinationArtifacts.jsonPath, \"utf-8\"), readFile(destinationArtifacts.dtsPath, \"utf-8\")]);\n\t\tawait writeContractSnapshot(migrationsDir, toStorageHash, {\n\t\t\tcontractJson: JSON.parse(contractJsonRaw),\n\t\t\tcontractDts\n\t\t});\n\t\tawait writeMigrationTs(packageDir, migrations.createPlanner(controlAdapter).emptyMigration({\n\t\t\tpackageDir,\n\t\t\tcontractJsonPath: join(contractSnapshotDir(migrationsDir, toStorageHash), \"contract.json\"),\n\t\t\tfromHash,\n\t\t\ttoHash: toStorageHash,\n\t\t\tsnapshotsImportPath: snapshotsImportPathFrom(packageDir, migrationsDir)\n\t\t}, APP_SPACE_ID).renderTypeScript(resolveSpecifier));\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tdir: relative(process.cwd(), packageDir),\n\t\t\tfrom: fromHash,\n\t\t\tto: toStorageHash,\n\t\t\tsummary: `Scaffolded migration at ${relative(process.cwd(), packageDir)}`\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to scaffold migration: ${error instanceof Error ? error.message : String(error)}` }));\n\t}\n}\nfunction createMigrationNewCommand() {\n\tconst command = new Command(\"new\");\n\tsetCommandDescriptions(command, \"Scaffold a new migration for manual authoring\", \"Creates a migration package with a migration.ts file for manual authoring.\\nWrite the migration body in migration.ts, then run the file with Node\\n(`node migration.ts`) to self-emit ops.json and attest the package.\");\n\tsetCommandExamples(command, [\"prisma-next migration new --name split-name\", \"prisma-next migration new --name custom-fk --from abc123...\"]);\n\taddGlobalOptions(command).option(\"--name <slug>\", \"Migration name (used in directory name)\").option(\"--from <hash>\", \"Starting contract hash (default: latest migration target)\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (!flags.json && !flags.quiet) {\n\t\t\tconst header = formatStyledHeader({\n\t\t\t\tcommand: \"migration new\",\n\t\t\t\tdescription: \"Scaffold a new migration\",\n\t\t\t\tdetails: [],\n\t\t\t\tflags\n\t\t\t});\n\t\t\tui.stderr(header);\n\t\t}\n\t\tconst exitCode = handleResult(await executeMigrationNewCommand(options), flags, ui, (value) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(value, null, 2));\n\t\t\telse if (!flags.quiet) {\n\t\t\t\tui.output(`\\nScaffolded migration at ${value.dir}`);\n\t\t\t\tui.output(` from: ${value.from}`);\n\t\t\t\tui.output(` to: ${value.to}`);\n\t\t\t\tui.output(`\\nEdit migration.ts, then run it directly (\\`node \"${value.dir}/migration.ts\"\\`) to self-emit and attest.`);\n\t\t\t}\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrationNewCommand };\n\n//# sourceMappingURL=migration-new.mjs.map"],"mappings":"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"}
@@ -0,0 +1,38 @@
1
+ import { O as errorRuntime$1 } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
2
+ import { notOk, ok } from "@prisma/orm-framework/utils/result";
3
+ import { isAbsolute, relative, resolve } from "pathe";
4
+ //#region ../../../1-framework/3-tooling/cli/dist/migration-path-target-D3Sj55PI.mjs
5
+ function looksLikePath(target) {
6
+ return target.includes("/") || target.includes("\\");
7
+ }
8
+ function resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative) {
9
+ const targetPath = resolve(target);
10
+ const relativeToApp = relative(appMigrationsDir, targetPath);
11
+ if (relativeToApp === "" || relativeToApp === "." || relativeToApp.startsWith("..") || isAbsolute(relativeToApp)) return notOk(errorRuntime$1("Target must point to an app-space migration", {
12
+ why: `Expected a path under ${appMigrationsRelative}, got ${target}`,
13
+ fix: "Pass an app-space migration directory or use a hash prefix."
14
+ }));
15
+ return ok(targetPath);
16
+ }
17
+ /**
18
+ * Resolve a filesystem-path target to the migration dir that contains it,
19
+ * searching each in-scope space's `migrationsDir`. A path is explicit, so
20
+ * it can belong to at most one space — returns the first match, or `null`
21
+ * when the path falls outside every space dir.
22
+ */
23
+ function resolveTargetPathAcrossSpaces(target, spaces) {
24
+ const targetPath = resolve(target);
25
+ for (const space of spaces) {
26
+ const rel = relative(space.migrationsDir, targetPath);
27
+ if (!(rel === "" || rel === "." || rel.startsWith("..") || isAbsolute(rel))) return targetPath;
28
+ }
29
+ return null;
30
+ }
31
+ function findPackageByDirPath(packages, resolvedDirPath) {
32
+ const normalized = resolve(resolvedDirPath);
33
+ return packages.find((p) => resolve(p.dirPath) === normalized);
34
+ }
35
+ //#endregion
36
+ export { resolveTargetPathAcrossSpaces as i, looksLikePath as n, resolveAppTargetPath as r, findPackageByDirPath as t };
37
+
38
+ //# sourceMappingURL=migration-path-target-D3Sj55PI-BICblCuk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-path-target-D3Sj55PI-BICblCuk.mjs","names":["errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/migration-path-target-D3Sj55PI.mjs"],"sourcesContent":["import { rt as errorRuntime } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isAbsolute, relative, resolve } from \"pathe\";\n//#region src/utils/migration-path-target.ts\nfunction looksLikePath(target) {\n\treturn target.includes(\"/\") || target.includes(\"\\\\\");\n}\nfunction resolveAppTargetPath(target, appMigrationsDir, appMigrationsRelative) {\n\tconst targetPath = resolve(target);\n\tconst relativeToApp = relative(appMigrationsDir, targetPath);\n\tif (relativeToApp === \"\" || relativeToApp === \".\" || relativeToApp.startsWith(\"..\") || isAbsolute(relativeToApp)) return notOk(errorRuntime(\"Target must point to an app-space migration\", {\n\t\twhy: `Expected a path under ${appMigrationsRelative}, got ${target}`,\n\t\tfix: \"Pass an app-space migration directory or use a hash prefix.\"\n\t}));\n\treturn ok(targetPath);\n}\n/**\n* Resolve a filesystem-path target to the migration dir that contains it,\n* searching each in-scope space's `migrationsDir`. A path is explicit, so\n* it can belong to at most one space — returns the first match, or `null`\n* when the path falls outside every space dir.\n*/\nfunction resolveTargetPathAcrossSpaces(target, spaces) {\n\tconst targetPath = resolve(target);\n\tfor (const space of spaces) {\n\t\tconst rel = relative(space.migrationsDir, targetPath);\n\t\tif (!(rel === \"\" || rel === \".\" || rel.startsWith(\"..\") || isAbsolute(rel))) return targetPath;\n\t}\n\treturn null;\n}\nfunction findPackageByDirPath(packages, resolvedDirPath) {\n\tconst normalized = resolve(resolvedDirPath);\n\treturn packages.find((p) => resolve(p.dirPath) === normalized);\n}\n//#endregion\nexport { resolveTargetPathAcrossSpaces as i, looksLikePath as n, resolveAppTargetPath as r, findPackageByDirPath as t };\n\n//# sourceMappingURL=migration-path-target-D3Sj55PI.mjs.map"],"mappings":";;;;AAIA,SAAS,cAAc,QAAQ;CAC9B,OAAO,OAAO,SAAS,GAAG,KAAK,OAAO,SAAS,IAAI;AACpD;AACA,SAAS,qBAAqB,QAAQ,kBAAkB,uBAAuB;CAC9E,MAAM,aAAa,QAAQ,MAAM;CACjC,MAAM,gBAAgB,SAAS,kBAAkB,UAAU;CAC3D,IAAI,kBAAkB,MAAM,kBAAkB,OAAO,cAAc,WAAW,IAAI,KAAK,WAAW,aAAa,GAAG,OAAO,MAAMA,eAAa,+CAA+C;EAC1L,KAAK,yBAAyB,sBAAsB,QAAQ;EAC5D,KAAK;CACN,CAAC,CAAC;CACF,OAAO,GAAG,UAAU;AACrB;;;;;;;AAOA,SAAS,8BAA8B,QAAQ,QAAQ;CACtD,MAAM,aAAa,QAAQ,MAAM;CACjC,KAAK,MAAM,SAAS,QAAQ;EAC3B,MAAM,MAAM,SAAS,MAAM,eAAe,UAAU;EACpD,IAAI,EAAE,QAAQ,MAAM,QAAQ,OAAO,IAAI,WAAW,IAAI,KAAK,WAAW,GAAG,IAAI,OAAO;CACrF;CACA,OAAO;AACR;AACA,SAAS,qBAAqB,UAAU,iBAAiB;CACxD,MAAM,aAAa,QAAQ,eAAe;CAC1C,OAAO,SAAS,MAAM,MAAM,QAAQ,EAAE,OAAO,MAAM,UAAU;AAC9D"}