@prisma/orm-toolchain 8.0.0-rc.2-dev.3 → 8.0.0-rc.20

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 (196) hide show
  1. package/README.md +1 -5
  2. package/dist/{aggregate-DLUJLq5Y.d.mts → aggregate-BpcQdygS.d.mts} +83 -36
  3. package/dist/aggregate-BpcQdygS.d.mts.map +1 -0
  4. package/dist/{aggregate-CPZB020V.mjs → aggregate-T_HG6gq6.mjs} +118 -57
  5. package/dist/aggregate-T_HG6gq6.mjs.map +1 -0
  6. package/dist/caught-errors-Bmbi1dBu-DKO5X2tN.mjs +1026 -0
  7. package/dist/caught-errors-Bmbi1dBu-DKO5X2tN.mjs.map +1 -0
  8. package/dist/cli-telemetry.d.mts +9 -8
  9. package/dist/cli-telemetry.d.mts.map +1 -1
  10. package/dist/cli-telemetry.mjs +30 -27
  11. package/dist/cli-telemetry.mjs.map +1 -1
  12. package/dist/cli.d.mts +7 -14
  13. package/dist/cli.d.mts.map +1 -1
  14. package/dist/cli.mjs +3769 -1506
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/cli__control-api.d.mts +233 -93
  17. package/dist/cli__control-api.d.mts.map +1 -1
  18. package/dist/cli__control-api.mjs +3 -2
  19. package/dist/cli__control-api__testing.d.mts +5 -4
  20. package/dist/cli__control-api__testing.d.mts.map +1 -1
  21. package/dist/cli__control-api__testing.mjs +21 -16
  22. package/dist/cli__control-api__testing.mjs.map +1 -1
  23. package/dist/cli__init-output.d.mts +11 -1
  24. package/dist/cli__init-output.d.mts.map +1 -1
  25. package/dist/cli__init-output.mjs +1 -1
  26. package/dist/cli__migration-cli.d.mts +1 -1
  27. package/dist/cli__migration-cli.mjs +65 -19
  28. package/dist/cli__migration-cli.mjs.map +1 -1
  29. package/dist/config-loader.d.mts +2 -2
  30. package/dist/config-loader.mjs +2 -2
  31. package/dist/{contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs → contract-snapshot-store-6gIBcUeb-DJK3OM0j.mjs} +44 -16
  32. package/dist/contract-snapshot-store-6gIBcUeb-DJK3OM0j.mjs.map +1 -0
  33. package/dist/contract-snapshot-store-Bok5nQYi-D3g_P7im.d.mts +59 -0
  34. package/dist/contract-snapshot-store-Bok5nQYi-D3g_P7im.d.mts.map +1 -0
  35. package/dist/contract-snapshot-store-DrIwu5pn.d.mts +2 -0
  36. package/dist/{db-verify-BwgNK50T-DGvKgFCK.d.mts → db-sign-gvrl0kFE-D-nTGx88.d.mts} +330 -230
  37. package/dist/db-sign-gvrl0kFE-D-nTGx88.d.mts.map +1 -0
  38. package/dist/{domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs → domain-type-generation-B4m774CV-WAjyhZHw.mjs} +144 -154
  39. package/dist/domain-type-generation-B4m774CV-WAjyhZHw.mjs.map +1 -0
  40. package/dist/domain-type-generation-DZjtzrbE-BpOOD3YV.d.mts +78 -0
  41. package/dist/domain-type-generation-DZjtzrbE-BpOOD3YV.d.mts.map +1 -0
  42. package/dist/emitter.d.mts +3 -3
  43. package/dist/emitter.mjs +3 -3
  44. package/dist/emitter__domain-type-generation.d.mts +2 -2
  45. package/dist/emitter__domain-type-generation.mjs +2 -2
  46. package/dist/{errors-D59OCpoI.d.mts → errors-CLwhWJiz.d.mts} +14 -3
  47. package/dist/errors-CLwhWJiz.d.mts.map +1 -0
  48. package/dist/{errors-CXbGUWGu-CstQHPh6.mjs → errors-DXha_4l--relAaiI4.mjs} +37 -42
  49. package/dist/errors-DXha_4l--relAaiI4.mjs.map +1 -0
  50. package/dist/exports-BCIlMjIW-DkUBVDzl.mjs +421 -0
  51. package/dist/exports-BCIlMjIW-DkUBVDzl.mjs.map +1 -0
  52. package/dist/exports-BlYTE3-J.mjs +539 -0
  53. package/dist/exports-BlYTE3-J.mjs.map +1 -0
  54. package/dist/exports-CKgwcXbp.mjs +3973 -0
  55. package/dist/exports-CKgwcXbp.mjs.map +1 -0
  56. package/dist/graph-membership-DxpNgxfZ-BfqA-H7V.mjs +19 -0
  57. package/dist/graph-membership-DxpNgxfZ-BfqA-H7V.mjs.map +1 -0
  58. package/dist/{hash-DH8hl5Rq-BpM2t3Nu.mjs → hash-BAZVWU4a-BQovI7hF.mjs} +24 -3
  59. package/dist/hash-BAZVWU4a-BQovI7hF.mjs.map +1 -0
  60. package/dist/hash-CwWGlFWV.d.mts +1 -0
  61. package/dist/{hash-XZYYKJ-i.d.mts → hash-DclMqd7S-WBvXJ_4C.d.mts} +17 -4
  62. package/dist/hash-DclMqd7S-WBvXJ_4C.d.mts.map +1 -0
  63. package/dist/{import-roots-CfoYgejL.d.mts → import-roots-ARK1wjzc.d.mts} +3 -3
  64. package/dist/{import-roots-CfoYgejL.d.mts.map → import-roots-ARK1wjzc.d.mts.map} +1 -1
  65. package/dist/{import-roots-CNFBPAT1.mjs → import-roots-BPn2s_fq.mjs} +6 -6
  66. package/dist/import-roots-BPn2s_fq.mjs.map +1 -0
  67. package/dist/index-CWPFeYyi.d.mts +204 -0
  68. package/dist/index-CWPFeYyi.d.mts.map +1 -0
  69. package/dist/{index-Dgwl8Tzs.d.mts → index-tAySVPvZ.d.mts} +16 -4
  70. package/dist/index-tAySVPvZ.d.mts.map +1 -0
  71. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs → invariants-DrF9p5Gd-BF70vGl1.mjs} +3 -3
  72. package/dist/{invariants-CTHy88OP-CYI2a8IO.mjs.map → invariants-DrF9p5Gd-BF70vGl1.mjs.map} +1 -1
  73. package/dist/{io-635GlNx1-D3zrw2qu.mjs → io-BNxFm3eg-DYD82QeZ.mjs} +8 -8
  74. package/dist/io-BNxFm3eg-DYD82QeZ.mjs.map +1 -0
  75. package/dist/io-D8Epu7iY.d.mts +1 -0
  76. package/dist/{io-sr4CO9_t-C3eV_kn-.d.mts → io-DZfMV51z-BKlH5Dhb.d.mts} +9 -2
  77. package/dist/io-DZfMV51z-BKlH5Dhb.d.mts.map +1 -0
  78. package/dist/{migration-B2ljMJim.d.mts → migration-Bjz05034.d.mts} +12 -5
  79. package/dist/migration-Bjz05034.d.mts.map +1 -0
  80. package/dist/{migration-hspPIEeV.mjs → migration-CWyjX9vz.mjs} +18 -6
  81. package/dist/migration-CWyjX9vz.mjs.map +1 -0
  82. package/dist/{migration-graph-_SJImD5V-BURyY1KM.mjs → migration-graph-BoiiZAaU-DLht12k7.mjs} +6 -89
  83. package/dist/migration-graph-BoiiZAaU-DLht12k7.mjs.map +1 -0
  84. package/dist/{migration-graph-tarTxJ99-BrGBANeE.d.mts → migration-graph-D8IuOkZb-pSI7-k4_.d.mts} +7 -29
  85. package/dist/migration-graph-D8IuOkZb-pSI7-k4_.d.mts.map +1 -0
  86. package/dist/migration-graph-Dra4CcyN.d.mts +14 -0
  87. package/dist/migration-graph-Dra4CcyN.d.mts.map +1 -0
  88. package/dist/migration-tools.d.mts +17 -15
  89. package/dist/migration-tools.mjs +15 -15
  90. package/dist/migration-tools__aggregate.d.mts +2 -2
  91. package/dist/migration-tools__aggregate.mjs +2 -2
  92. package/dist/migration-tools__contract-snapshot-store.d.mts +4 -2
  93. package/dist/migration-tools__contract-snapshot-store.mjs +2 -2
  94. package/dist/migration-tools__errors.d.mts +2 -2
  95. package/dist/migration-tools__errors.mjs +1 -1
  96. package/dist/migration-tools__hash.d.mts +2 -1
  97. package/dist/migration-tools__hash.mjs +1 -1
  98. package/dist/migration-tools__invariants.mjs +1 -1
  99. package/dist/migration-tools__io.d.mts +2 -2
  100. package/dist/migration-tools__io.mjs +1 -1
  101. package/dist/migration-tools__migration-graph.d.mts +3 -3
  102. package/dist/migration-tools__migration-graph.mjs +3 -3
  103. package/dist/migration-tools__migration-ts.d.mts +2 -2
  104. package/dist/migration-tools__migration-ts.mjs +2 -2
  105. package/dist/migration-tools__migration.d.mts +1 -1
  106. package/dist/migration-tools__migration.mjs +1 -1
  107. package/dist/migration-tools__ref-resolution.d.mts +2 -2
  108. package/dist/migration-tools__ref-resolution.mjs +2 -2
  109. package/dist/migration-tools__refs.mjs +1 -1
  110. package/dist/migration-tools__spaces.d.mts +1 -1
  111. package/dist/migration-tools__spaces.mjs +2 -2
  112. package/dist/{migration-ts-DdVm0rws.mjs → migration-ts-DDgjsR1O.mjs} +6 -5
  113. package/dist/migration-ts-DDgjsR1O.mjs.map +1 -0
  114. package/dist/{migration-ts-CNaAtK8C.d.mts → migration-ts-SGer0PXq.d.mts} +4 -2
  115. package/dist/migration-ts-SGer0PXq.d.mts.map +1 -0
  116. package/dist/op-schema-3tXg0LTS-DqpOKDEa.mjs +23 -0
  117. package/dist/op-schema-3tXg0LTS-DqpOKDEa.mjs.map +1 -0
  118. package/dist/output-BcC8eB0h-C5bRd-aC.mjs +129 -0
  119. package/dist/output-BcC8eB0h-C5bRd-aC.mjs.map +1 -0
  120. package/dist/publish-surface.d.mts +1 -1
  121. package/dist/publish-surface.mjs +2 -2
  122. package/dist/publish-surface__import-roots.d.mts +1 -1
  123. package/dist/publish-surface__import-roots.mjs +1 -1
  124. package/dist/publish-surface__shells.mjs +1 -1
  125. package/dist/quick-reference-mongo.md +12 -12
  126. package/dist/quick-reference-postgres.md +10 -10
  127. package/dist/quick-reference-prisma7.md +80 -0
  128. package/dist/readme-mongo.md +6 -6
  129. package/dist/readme-postgres.md +6 -6
  130. package/dist/ref-DEiY2Cbd-1ZImpUEN.mjs +6663 -0
  131. package/dist/ref-DEiY2Cbd-1ZImpUEN.mjs.map +1 -0
  132. package/dist/{ref-resolution-COGOSL57.d.mts → ref-resolution-BPhR-kta.d.mts} +29 -11
  133. package/dist/ref-resolution-BPhR-kta.d.mts.map +1 -0
  134. package/dist/{ref-resolution-HeNBXW53.mjs → ref-resolution-Eo0QHp4f.mjs} +30 -6
  135. package/dist/ref-resolution-Eo0QHp4f.mjs.map +1 -0
  136. package/dist/{refs-WK86uYYp-gM8tvWQP.mjs → refs-DM3q3IZC-BC6H6P0X.mjs} +9 -9
  137. package/dist/refs-DM3q3IZC-BC6H6P0X.mjs.map +1 -0
  138. package/dist/{shells-C4HbRAr5.mjs → shells-w_yEDhe8.mjs} +98 -31
  139. package/dist/shells-w_yEDhe8.mjs.map +1 -0
  140. package/dist/{spaces-Dj65JrwZ.d.mts → spaces-BWULKO54.d.mts} +3 -3
  141. package/dist/{spaces-Dj65JrwZ.d.mts.map → spaces-BWULKO54.d.mts.map} +1 -1
  142. package/dist/{spaces-4qMOAYE9.mjs → spaces-c9xdiXW8.mjs} +14 -13
  143. package/dist/spaces-c9xdiXW8.mjs.map +1 -0
  144. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs → verify-contract-spaces-YzEHF9zj-DGZgox_3.mjs} +7 -7
  145. package/dist/{verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map → verify-contract-spaces-YzEHF9zj-DGZgox_3.mjs.map} +1 -1
  146. package/dist/vite-plugin-contract-emit.d.mts +1 -1
  147. package/dist/vite-plugin-contract-emit.mjs +10 -10
  148. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  149. package/package.json +16 -15
  150. package/dist/aggregate-CPZB020V.mjs.map +0 -1
  151. package/dist/aggregate-DLUJLq5Y.d.mts.map +0 -1
  152. package/dist/contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map +0 -1
  153. package/dist/contract-snapshot-store-CbqynbtE.d.mts +0 -28
  154. package/dist/contract-snapshot-store-CbqynbtE.d.mts.map +0 -1
  155. package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +0 -1
  156. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts +0 -63
  157. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +0 -1
  158. package/dist/domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map +0 -1
  159. package/dist/errors-CXbGUWGu-CstQHPh6.mjs.map +0 -1
  160. package/dist/errors-D59OCpoI.d.mts.map +0 -1
  161. package/dist/exports-8ZUN43ve.mjs +0 -1734
  162. package/dist/exports-8ZUN43ve.mjs.map +0 -1
  163. package/dist/exports-BCLg4CiV-05kuwcb0.mjs +0 -160
  164. package/dist/exports-BCLg4CiV-05kuwcb0.mjs.map +0 -1
  165. package/dist/exports-BZaG8_w_.mjs +0 -243
  166. package/dist/exports-BZaG8_w_.mjs.map +0 -1
  167. package/dist/graph-membership-BViWUMpP-C4lYYJdU.mjs +0 -14
  168. package/dist/graph-membership-BViWUMpP-C4lYYJdU.mjs.map +0 -1
  169. package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs.map +0 -1
  170. package/dist/hash-XZYYKJ-i.d.mts.map +0 -1
  171. package/dist/import-roots-CNFBPAT1.mjs.map +0 -1
  172. package/dist/index-DRs7L6N0.d.mts +0 -57
  173. package/dist/index-DRs7L6N0.d.mts.map +0 -1
  174. package/dist/index-Dgwl8Tzs.d.mts.map +0 -1
  175. package/dist/io-635GlNx1-D3zrw2qu.mjs.map +0 -1
  176. package/dist/io-DYfeLJxR.d.mts +0 -1
  177. package/dist/io-sr4CO9_t-C3eV_kn-.d.mts.map +0 -1
  178. package/dist/migration-B2ljMJim.d.mts.map +0 -1
  179. package/dist/migration-graph-Dqndu0i5.d.mts +0 -9
  180. package/dist/migration-graph-Dqndu0i5.d.mts.map +0 -1
  181. package/dist/migration-graph-_SJImD5V-BURyY1KM.mjs.map +0 -1
  182. package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts.map +0 -1
  183. package/dist/migration-hspPIEeV.mjs.map +0 -1
  184. package/dist/migration-ts-CNaAtK8C.d.mts.map +0 -1
  185. package/dist/migration-ts-DdVm0rws.mjs.map +0 -1
  186. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs +0 -13
  187. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs.map +0 -1
  188. package/dist/output-CovTDY14-CUoAqLML.mjs +0 -77
  189. package/dist/output-CovTDY14-CUoAqLML.mjs.map +0 -1
  190. package/dist/ref-h6InR6dO-rGfl18Jv.mjs +0 -4686
  191. package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +0 -1
  192. package/dist/ref-resolution-COGOSL57.d.mts.map +0 -1
  193. package/dist/ref-resolution-HeNBXW53.mjs.map +0 -1
  194. package/dist/refs-WK86uYYp-gM8tvWQP.mjs.map +0 -1
  195. package/dist/shells-C4HbRAr5.mjs.map +0 -1
  196. package/dist/spaces-4qMOAYE9.mjs.map +0 -1
@@ -1,2 +1,3 @@
1
- import { n as computeMigrationHash, r as verifyMigrationHash, t as VerifyResult } from "./hash-XZYYKJ-i.mjs";
1
+ import { i as verifyMigrationHash, n as VerifyResult, r as computeMigrationHash } from "./hash-DclMqd7S-WBvXJ_4C.mjs";
2
+ import "./hash-CwWGlFWV.mjs";
2
3
  export { type VerifyResult, computeMigrationHash, verifyMigrationHash };
@@ -1,2 +1,2 @@
1
- import { n as verifyMigrationHash, t as computeMigrationHash } from "./hash-DH8hl5Rq-BpM2t3Nu.mjs";
1
+ import { r as verifyMigrationHash, t as computeMigrationHash } from "./hash-BAZVWU4a-BQovI7hF.mjs";
2
2
  export { computeMigrationHash, verifyMigrationHash };
@@ -1,2 +1,2 @@
1
- import { n as validateInvariantId, t as deriveProvidedInvariants } from "./invariants-CTHy88OP-CYI2a8IO.mjs";
1
+ import { n as validateInvariantId, t as deriveProvidedInvariants } from "./invariants-DrF9p5Gd-BF70vGl1.mjs";
2
2
  export { deriveProvidedInvariants, validateInvariantId };
@@ -1,3 +1,3 @@
1
- import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "./io-sr4CO9_t-C3eV_kn-.mjs";
2
- import "./io-DYfeLJxR.mjs";
1
+ import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "./io-DZfMV51z-BKlH5Dhb.mjs";
2
+ import "./io-D8Epu7iY.mjs";
3
3
  export { type PackageLoadProblem, type ReadMigrationsDirResult, copyFilesWithRename, formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, readMigrationPackage, readMigrationsDir, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage };
@@ -1,2 +1,2 @@
1
- import { a as materialiseMigrationPackage, c as writeMigrationMetadata, i as materialiseExtensionMigrationPackageIfMissing, l as writeMigrationOps, n as copyFilesWithRename, o as readMigrationPackage, r as formatMigrationDirName, s as readMigrationsDir, u as writeMigrationPackage } from "./io-635GlNx1-D3zrw2qu.mjs";
1
+ import { a as materialiseMigrationPackage, c as writeMigrationMetadata, i as materialiseExtensionMigrationPackageIfMissing, l as writeMigrationOps, n as copyFilesWithRename, o as readMigrationPackage, r as formatMigrationDirName, s as readMigrationsDir, u as writeMigrationPackage } from "./io-BNxFm3eg-DYD82QeZ.mjs";
2
2
  export { copyFilesWithRename, formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, readMigrationPackage, readMigrationsDir, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage };
@@ -1,3 +1,3 @@
1
- import { a as findLeaf, c as findPathWithInvariants, i as findLatestMigration, l as findReachableLeaves, n as detectCycles, o as findPath, r as detectOrphans, s as findPathWithDecision, t as PathDecision, u as reconstructGraph } from "./migration-graph-tarTxJ99-BrGBANeE.mjs";
2
- import { n as isGraphNode, t as assertHashIsGraphNode } from "./migration-graph-Dqndu0i5.mjs";
3
- export { type PathDecision, assertHashIsGraphNode, detectCycles, detectOrphans, findLatestMigration, findLeaf, findPath, findPathWithDecision, findPathWithInvariants, findReachableLeaves, isGraphNode, reconstructGraph };
1
+ import { a as findPathWithDecision, i as findPath, n as detectCycles, o as findPathWithInvariants, r as detectOrphans, s as reconstructGraph, t as PathDecision } from "./migration-graph-D8IuOkZb-pSI7-k4_.mjs";
2
+ import { n as isGraphNode, r as isInSpaceHistory, t as assertHashIsGraphNode } from "./migration-graph-Dra4CcyN.mjs";
3
+ export { type PathDecision, assertHashIsGraphNode, detectCycles, detectOrphans, findPath, findPathWithDecision, findPathWithInvariants, isGraphNode, isInSpaceHistory, reconstructGraph };
@@ -1,3 +1,3 @@
1
- import { n as isGraphNode, t as assertHashIsGraphNode } from "./graph-membership-BViWUMpP-C4lYYJdU.mjs";
2
- import { a as findPath, c as findReachableLeaves, i as findLeaf, l as reconstructGraph, n as detectOrphans, o as findPathWithDecision, r as findLatestMigration, s as findPathWithInvariants, t as detectCycles } from "./migration-graph-_SJImD5V-BURyY1KM.mjs";
3
- export { assertHashIsGraphNode, detectCycles, detectOrphans, findLatestMigration, findLeaf, findPath, findPathWithDecision, findPathWithInvariants, findReachableLeaves, isGraphNode, reconstructGraph };
1
+ import { a as findPathWithInvariants, i as findPathWithDecision, n as detectOrphans, o as reconstructGraph, r as findPath, t as detectCycles } from "./migration-graph-BoiiZAaU-DLht12k7.mjs";
2
+ import { n as isGraphNode, r as isInSpaceHistory, t as assertHashIsGraphNode } from "./graph-membership-DxpNgxfZ-BfqA-H7V.mjs";
3
+ export { assertHashIsGraphNode, detectCycles, detectOrphans, findPath, findPathWithDecision, findPathWithInvariants, isGraphNode, isInSpaceHistory, reconstructGraph };
@@ -1,2 +1,2 @@
1
- import { a as writeMigrationTs, i as shebangLineFor, n as detectScaffoldRuntime, r as hasMigrationTs, t as ScaffoldRuntime } from "./migration-ts-CNaAtK8C.mjs";
2
- export { type ScaffoldRuntime, detectScaffoldRuntime, hasMigrationTs, shebangLineFor, writeMigrationTs };
1
+ import { a as shebangLineFor, i as hasMigrationTs, n as detectScaffoldRuntime, o as writeMigrationTs, r as formatMigrationTs, t as ScaffoldRuntime } from "./migration-ts-SGer0PXq.mjs";
2
+ export { type ScaffoldRuntime, detectScaffoldRuntime, formatMigrationTs, hasMigrationTs, shebangLineFor, writeMigrationTs };
@@ -1,2 +1,2 @@
1
- import { i as writeMigrationTs, n as hasMigrationTs, r as shebangLineFor, t as detectScaffoldRuntime } from "./migration-ts-DdVm0rws.mjs";
2
- export { detectScaffoldRuntime, hasMigrationTs, shebangLineFor, writeMigrationTs };
1
+ import { a as writeMigrationTs, i as shebangLineFor, n as formatMigrationTs, r as hasMigrationTs, t as detectScaffoldRuntime } from "./migration-ts-DDgjsR1O.mjs";
2
+ export { detectScaffoldRuntime, formatMigrationTs, hasMigrationTs, shebangLineFor, writeMigrationTs };
@@ -1,2 +1,2 @@
1
- import { a as buildMigrationArtifacts, i as MigrationMeta, n as MigrationArtifacts, o as isDirectEntrypoint, r as MigrationContractViews, t as Migration } from "./migration-B2ljMJim.mjs";
1
+ import { a as buildMigrationArtifacts, i as MigrationMeta, n as MigrationArtifacts, o as isDirectEntrypoint, r as MigrationContractViews, t as Migration } from "./migration-Bjz05034.mjs";
2
2
  export { Migration, type MigrationArtifacts, MigrationContractViews, type MigrationMeta, buildMigrationArtifacts, isDirectEntrypoint };
@@ -1,2 +1,2 @@
1
- import { i as isDirectEntrypoint, n as MigrationContractViews, r as buildMigrationArtifacts, t as Migration } from "./migration-hspPIEeV.mjs";
1
+ import { i as isDirectEntrypoint, n as MigrationContractViews, r as buildMigrationArtifacts, t as Migration } from "./migration-CWyjX9vz.mjs";
2
2
  export { Migration, MigrationContractViews, buildMigrationArtifacts, isDirectEntrypoint };
@@ -1,2 +1,2 @@
1
- import { a as RefResolutionAmbiguous, c as RefResolutionInvalidFormat, d as findEdgeByDirName, f as parseContractRef, i as MigrationRefProvenance, l as RefResolutionNotFound, n as ContractRefProvenance, o as RefResolutionContext, p as parseMigrationRef, r as MigrationRef, s as RefResolutionError, t as ContractRef, u as RefResolutionWrongGrammar } from "./ref-resolution-COGOSL57.mjs";
2
- export { type ContractRef, type ContractRefProvenance, type MigrationRef, type MigrationRefProvenance, type RefResolutionAmbiguous, type RefResolutionContext, type RefResolutionError, type RefResolutionInvalidFormat, type RefResolutionNotFound, type RefResolutionWrongGrammar, findEdgeByDirName, parseContractRef, parseMigrationRef };
1
+ import { _ as isReservedContractRef, a as MigrationRef, c as RefResolutionAmbiguous, d as RefResolutionInvalidFormat, f as RefResolutionNotFound, g as isLiveMarkerRef, h as findEdgeByDirName, i as LIVE_MARKER_REF, l as RefResolutionContext, m as WORKING_CONTRACT_REF, n as ContractRefProvenance, o as MigrationRefProvenance, p as RefResolutionWrongGrammar, r as EMPTY_CONTRACT_REF, s as RESERVED_CONTRACT_REFS, t as ContractRef, u as RefResolutionError, v as parseContractRef, y as parseMigrationRef } from "./ref-resolution-BPhR-kta.mjs";
2
+ export { type ContractRef, type ContractRefProvenance, EMPTY_CONTRACT_REF, LIVE_MARKER_REF, type MigrationRef, type MigrationRefProvenance, RESERVED_CONTRACT_REFS, type RefResolutionAmbiguous, type RefResolutionContext, type RefResolutionError, type RefResolutionInvalidFormat, type RefResolutionNotFound, type RefResolutionWrongGrammar, WORKING_CONTRACT_REF, findEdgeByDirName, isLiveMarkerRef, isReservedContractRef, parseContractRef, parseMigrationRef };
@@ -1,2 +1,2 @@
1
- import { n as parseContractRef, r as parseMigrationRef, t as findEdgeByDirName } from "./ref-resolution-HeNBXW53.mjs";
2
- export { findEdgeByDirName, parseContractRef, parseMigrationRef };
1
+ import { a as findEdgeByDirName, c as parseContractRef, i as WORKING_CONTRACT_REF, l as parseMigrationRef, n as LIVE_MARKER_REF, o as isLiveMarkerRef, r as RESERVED_CONTRACT_REFS, s as isReservedContractRef, t as EMPTY_CONTRACT_REF } from "./ref-resolution-Eo0QHp4f.mjs";
2
+ export { EMPTY_CONTRACT_REF, LIVE_MARKER_REF, RESERVED_CONTRACT_REFS, WORKING_CONTRACT_REF, findEdgeByDirName, isLiveMarkerRef, isReservedContractRef, parseContractRef, parseMigrationRef };
@@ -1,2 +1,2 @@
1
- import { c as resolveRefsByContractHash, d as writeRef, i as readRefs, l as validateRefName, n as deleteRef, o as refsByContractHash, r as readRef, s as resolveRef, t as HEAD_REF_NAME, u as validateRefValue } from "./refs-WK86uYYp-gM8tvWQP.mjs";
1
+ import { c as resolveRefsByContractHash, d as writeRef, i as readRefs, l as validateRefName, n as deleteRef, o as refsByContractHash, r as readRef, s as resolveRef, t as HEAD_REF_NAME, u as validateRefValue } from "./refs-DM3q3IZC-BC6H6P0X.mjs";
2
2
  export { HEAD_REF_NAME, deleteRef, readRef, readRefs, refsByContractHash, resolveRef, resolveRefsByContractHash, validateRefName, validateRefValue, writeRef };
@@ -1,3 +1,3 @@
1
1
  import { a as VerifyContractSpacesResult, i as VerifyContractSpacesInputs, n as SpaceMarkerRecord, o as listContractSpaceDirectories, r as SpaceVerifierViolation, s as verifyContractSpaces, t as ContractSpaceHeadRecord } from "./verify-contract-spaces-C3PiFBk3-DfomYyOE.mjs";
2
- import { C as spaceMigrationDirectory, S as readContractSpaceHeadRef, _ as contractSpaceFromJson, a as DescriptorSelfConsistencyInputs, b as isValidSpaceId, c as RESERVED_SPACE_SUBDIR_NAMES, d as SpacePlanInput, f as SpacePlanOutput, g as computeExtensionSpaceApplyPath, h as assertValidSpaceId, i as ContractSpaceHeadRef, l as SPACE_REFS_DIRNAME, m as assertDescriptorSelfConsistency, n as ComputeExtensionSpaceApplyPathInputs, o as DiskContractSpaceState, p as ValidSpaceId, r as ContractSpaceArtifactInputs, s as ExtensionSpaceApplyPathOutcome, t as APP_SPACE_ID, u as SpaceApplyInput, v as emitContractSpaceArtifacts, w as spaceRefsDirectory, x as planAllSpaces, y as gatherDiskContractSpaceState } from "./spaces-Dj65JrwZ.mjs";
2
+ import { C as spaceMigrationDirectory, S as readContractSpaceHeadRef, _ as contractSpaceFromJson, a as DescriptorSelfConsistencyInputs, b as isValidSpaceId, c as RESERVED_SPACE_SUBDIR_NAMES, d as SpacePlanInput, f as SpacePlanOutput, g as computeExtensionSpaceApplyPath, h as assertValidSpaceId, i as ContractSpaceHeadRef, l as SPACE_REFS_DIRNAME, m as assertDescriptorSelfConsistency, n as ComputeExtensionSpaceApplyPathInputs, o as DiskContractSpaceState, p as ValidSpaceId, r as ContractSpaceArtifactInputs, s as ExtensionSpaceApplyPathOutcome, t as APP_SPACE_ID, u as SpaceApplyInput, v as emitContractSpaceArtifacts, w as spaceRefsDirectory, x as planAllSpaces, y as gatherDiskContractSpaceState } from "./spaces-BWULKO54.mjs";
3
3
  export { APP_SPACE_ID, type ComputeExtensionSpaceApplyPathInputs, type ContractSpaceArtifactInputs, type ContractSpaceHeadRecord, type ContractSpaceHeadRef, type DescriptorSelfConsistencyInputs, type DiskContractSpaceState, type ExtensionSpaceApplyPathOutcome, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, type SpaceApplyInput, type SpaceMarkerRecord, type SpacePlanInput, type SpacePlanOutput, type SpaceVerifierViolation, type ValidSpaceId, type VerifyContractSpacesInputs, type VerifyContractSpacesResult, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };
@@ -1,3 +1,3 @@
1
- import { a as isValidSpaceId, c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, n as RESERVED_SPACE_SUBDIR_NAMES, o as listContractSpaceDirectories, r as SPACE_REFS_DIRNAME, s as readContractSpaceHeadRef, t as APP_SPACE_ID, u as verifyContractSpaces } from "./verify-contract-spaces-DhJTb0zM-B62maCfE.mjs";
2
- import { a as gatherDiskContractSpaceState, i as emitContractSpaceArtifacts, n as computeExtensionSpaceApplyPath, o as planAllSpaces, r as contractSpaceFromJson, t as assertDescriptorSelfConsistency } from "./spaces-4qMOAYE9.mjs";
1
+ import { a as isValidSpaceId, c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, n as RESERVED_SPACE_SUBDIR_NAMES, o as listContractSpaceDirectories, r as SPACE_REFS_DIRNAME, s as readContractSpaceHeadRef, t as APP_SPACE_ID, u as verifyContractSpaces } from "./verify-contract-spaces-YzEHF9zj-DGZgox_3.mjs";
2
+ import { a as gatherDiskContractSpaceState, i as emitContractSpaceArtifacts, n as computeExtensionSpaceApplyPath, o as planAllSpaces, r as contractSpaceFromJson, t as assertDescriptorSelfConsistency } from "./spaces-c9xdiXW8.mjs";
3
3
  export { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };
@@ -1,6 +1,6 @@
1
- import { format } from "prettier";
2
1
  import { join } from "pathe";
3
2
  import { stat, writeFile } from "node:fs/promises";
3
+ import { format } from "prettier";
4
4
  //#region ../../../1-framework/3-tooling/migration/dist/exports/migration-ts.mjs
5
5
  /**
6
6
  * Utilities for reading/writing `migration.ts` files.
@@ -27,11 +27,12 @@ const MIGRATION_TS_FILE = "migration.ts";
27
27
  * already does for generated `contract.d.ts`.
28
28
  */
29
29
  async function writeMigrationTs(packageDir, content) {
30
- const formatted = await formatMigrationTsSource(content);
30
+ const formatted = await formatMigrationTs(content);
31
31
  const isExecutable = formatted.startsWith("#!");
32
32
  await writeFile(join(packageDir, MIGRATION_TS_FILE), formatted, isExecutable ? { mode: 493 } : void 0);
33
33
  }
34
- async function formatMigrationTsSource(source) {
34
+ /** `source` as `writeMigrationTs` writes it: formatted by prettier. */
35
+ async function formatMigrationTs(source) {
35
36
  return format(source, {
36
37
  parser: "typescript",
37
38
  singleQuote: true,
@@ -62,6 +63,6 @@ function shebangLineFor(runtime) {
62
63
  }
63
64
  }
64
65
  //#endregion
65
- export { writeMigrationTs as i, hasMigrationTs as n, shebangLineFor as r, detectScaffoldRuntime as t };
66
+ export { writeMigrationTs as a, shebangLineFor as i, formatMigrationTs as n, hasMigrationTs as r, detectScaffoldRuntime as t };
66
67
 
67
- //# sourceMappingURL=migration-ts-DdVm0rws.mjs.map
68
+ //# sourceMappingURL=migration-ts-DDgjsR1O.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-ts-DDgjsR1O.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/migration-ts.mjs"],"sourcesContent":["import { join } from \"pathe\";\nimport { stat, writeFile } from \"node:fs/promises\";\nimport { format } from \"prettier\";\n//#region src/migration-ts.ts\n/**\n* Utilities for reading/writing `migration.ts` files.\n*\n* Rendering migration.ts source is the target's responsibility — the CLI\n* obtains source strings from a planner's `plan.renderTypeScript()`. The\n* helper here is limited to file I/O: writing the returned source with the\n* right executable bit and probing for existence.\n*/\nconst MIGRATION_TS_FILE = \"migration.ts\";\n/**\n* Writes a pre-rendered `migration.ts` source string to the given package\n* directory. If the source begins with a shebang, the file is written with\n* executable permissions (0o755) so it can be run directly via\n* `./migration.ts` — the rendered scaffold ends with\n* `MigrationCLI.run(import.meta.url, M)` from\n* `@internal/cli/migration-cli` (re-exported by the postgres facade),\n* which guards on the entrypoint and serializes when the file is the main\n* module.\n*\n* The source is run through prettier before writing so migration renderers\n* can produce structurally-correct but loosely-indented source and rely on\n* a single canonical format on disk. Matches what `@internal/emitter`\n* already does for generated `contract.d.ts`.\n*/\nasync function writeMigrationTs(packageDir, content) {\n\tconst formatted = await formatMigrationTs(content);\n\tconst isExecutable = formatted.startsWith(\"#!\");\n\tawait writeFile(join(packageDir, MIGRATION_TS_FILE), formatted, isExecutable ? { mode: 493 } : void 0);\n}\n/** `source` as `writeMigrationTs` writes it: formatted by prettier. */\nasync function formatMigrationTs(source) {\n\treturn format(source, {\n\t\tparser: \"typescript\",\n\t\tsingleQuote: true,\n\t\tsemi: true,\n\t\tprintWidth: 100\n\t});\n}\n/**\n* Checks whether a migration.ts file exists in the package directory.\n*/\nasync function hasMigrationTs(packageDir) {\n\ttry {\n\t\treturn (await stat(join(packageDir, MIGRATION_TS_FILE))).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n//#endregion\n//#region src/runtime-detection.ts\nfunction detectScaffoldRuntime() {\n\tif (typeof globalThis.Bun !== \"undefined\") return \"bun\";\n\tif (typeof globalThis.Deno !== \"undefined\") return \"deno\";\n\treturn \"node\";\n}\nfunction shebangLineFor(runtime) {\n\tswitch (runtime) {\n\t\tcase \"bun\": return \"#!/usr/bin/env -S bun\";\n\t\tcase \"deno\": return \"#!/usr/bin/env -S deno run -A\";\n\t\tcase \"node\": return \"#!/usr/bin/env -S node\";\n\t}\n}\n//#endregion\nexport { detectScaffoldRuntime, formatMigrationTs, hasMigrationTs, shebangLineFor, writeMigrationTs };\n\n//# sourceMappingURL=migration-ts.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,oBAAoB;;;;;;;;;;;;;;;;AAgB1B,eAAe,iBAAiB,YAAY,SAAS;CACpD,MAAM,YAAY,MAAM,kBAAkB,OAAO;CACjD,MAAM,eAAe,UAAU,WAAW,IAAI;CAC9C,MAAM,UAAU,KAAK,YAAY,iBAAiB,GAAG,WAAW,eAAe,EAAE,MAAM,IAAI,IAAI,KAAK,CAAC;AACtG;;AAEA,eAAe,kBAAkB,QAAQ;CACxC,OAAO,OAAO,QAAQ;EACrB,QAAQ;EACR,aAAa;EACb,MAAM;EACN,YAAY;CACb,CAAC;AACF;;;;AAIA,eAAe,eAAe,YAAY;CACzC,IAAI;EACH,QAAQ,MAAM,KAAK,KAAK,YAAY,iBAAiB,CAAC,EAAA,CAAG,OAAO;CACjE,QAAQ;EACP,OAAO;CACR;AACD;AAGA,SAAS,wBAAwB;CAChC,IAAI,OAAO,WAAW,QAAQ,aAAa,OAAO;CAClD,IAAI,OAAO,WAAW,SAAS,aAAa,OAAO;CACnD,OAAO;AACR;AACA,SAAS,eAAe,SAAS;CAChC,QAAQ,SAAR;EACC,KAAK,OAAO,OAAO;EACnB,KAAK,QAAQ,OAAO;EACpB,KAAK,QAAQ,OAAO;CACrB;AACD"}
@@ -24,6 +24,8 @@
24
24
  * already does for generated `contract.d.ts`.
25
25
  */
26
26
  declare function writeMigrationTs(packageDir: string, content: string): Promise<void>;
27
+ /** `source` as `writeMigrationTs` writes it: formatted by prettier. */
28
+ declare function formatMigrationTs(source: string): Promise<string>;
27
29
  /**
28
30
  * Checks whether a migration.ts file exists in the package directory.
29
31
  */
@@ -34,5 +36,5 @@ type ScaffoldRuntime = 'node' | 'bun' | 'deno';
34
36
  declare function detectScaffoldRuntime(): ScaffoldRuntime;
35
37
  declare function shebangLineFor(runtime: ScaffoldRuntime): string;
36
38
  //#endregion
37
- export { writeMigrationTs as a, shebangLineFor as i, detectScaffoldRuntime as n, hasMigrationTs as r, ScaffoldRuntime as t };
38
- //# sourceMappingURL=migration-ts-CNaAtK8C.d.mts.map
39
+ export { shebangLineFor as a, hasMigrationTs as i, detectScaffoldRuntime as n, writeMigrationTs as o, formatMigrationTs as r, ScaffoldRuntime as t };
40
+ //# sourceMappingURL=migration-ts-SGer0PXq.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-ts-SGer0PXq.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/migration-ts.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBAwBiB,iBAAiB,oBAAoB,kBAAkB;;iBAEvD,kBAAkB,iBAAiB;;;;iBAInC,eAAe,qBAAqB;;;KAGhD;iBACY,yBAAyB;iBACzB,eAAe,SAAS"}
@@ -0,0 +1,23 @@
1
+ import { type } from "arktype";
2
+ //#region ../../../1-framework/3-tooling/migration/dist/op-schema-3tXg0LTS.mjs
3
+ /** What a check may say of the object it is about: an expectation, or the object's name alone. */
4
+ const CheckSchema = type({
5
+ "expectation?": type({
6
+ expects: "'absent' | 'present'",
7
+ object: "string > 0"
8
+ }),
9
+ "object?": "string > 0"
10
+ });
11
+ const MigrationOpSchema = type({
12
+ id: "string",
13
+ label: "string",
14
+ operationClass: "'additive' | 'widening' | 'destructive' | 'data'",
15
+ "invariantId?": "string",
16
+ "precheck?": CheckSchema.array(),
17
+ "postcheck?": CheckSchema.array()
18
+ });
19
+ const MigrationOpsSchema = MigrationOpSchema.array();
20
+ //#endregion
21
+ export { MigrationOpsSchema as n, MigrationOpSchema as t };
22
+
23
+ //# sourceMappingURL=op-schema-3tXg0LTS-DqpOKDEa.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-schema-3tXg0LTS-DqpOKDEa.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/op-schema-3tXg0LTS.mjs"],"sourcesContent":["import { type } from \"arktype\";\n//#region src/op-schema.ts\n/** What a check may say of the object it is about: an expectation, or the object's name alone. */\nconst CheckSchema = type({\n\t\"expectation?\": type({\n\t\texpects: \"'absent' | 'present'\",\n\t\tobject: \"string > 0\"\n\t}),\n\t\"object?\": \"string > 0\"\n});\nconst MigrationOpSchema = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"'additive' | 'widening' | 'destructive' | 'data'\",\n\t\"invariantId?\": \"string\",\n\t\"precheck?\": CheckSchema.array(),\n\t\"postcheck?\": CheckSchema.array()\n});\nconst MigrationOpsSchema = MigrationOpSchema.array();\n//#endregion\nexport { MigrationOpsSchema as n, MigrationOpSchema as t };\n\n//# sourceMappingURL=op-schema-3tXg0LTS.mjs.map"],"mappings":";;;AAGA,MAAM,cAAc,KAAK;CACxB,gBAAgB,KAAK;EACpB,SAAS;EACT,QAAQ;CACT,CAAC;CACD,WAAW;AACZ,CAAC;AACD,MAAM,oBAAoB,KAAK;CAC9B,IAAI;CACJ,OAAO;CACP,gBAAgB;CAChB,gBAAgB;CAChB,aAAa,YAAY,MAAM;CAC/B,cAAc,YAAY,MAAM;AACjC,CAAC;AACD,MAAM,qBAAqB,kBAAkB,MAAM"}
@@ -0,0 +1,129 @@
1
+ import { type } from "arktype";
2
+ //#region ../../../1-framework/3-tooling/cli/dist/output-BcC8eB0h.mjs
3
+ /**
4
+ * arktype schema for the structured success document `init --json` writes
5
+ * to stdout (FR1.5). The same shape backs the human-readable outro
6
+ * renderer (FR10), so the two output modes carry identical information.
7
+ *
8
+ * `target` is normalised to the user-facing flag value (`mongodb` rather
9
+ * than the internal `mongo`) so consumers can round-trip the document
10
+ * straight into a follow-up `--target` invocation.
11
+ *
12
+ * The `ok: true` literal is the documented success/error discriminator —
13
+ * see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).
14
+ * Error envelopes (`CliErrorEnvelope`) carry `ok: false` so consumers can
15
+ * branch with `if (doc.ok)` without inspecting the rest of the structure.
16
+ */
17
+ const InitOutputSchema = type({
18
+ ok: "true",
19
+ target: "'postgres'|'mongodb'",
20
+ /** `prisma7` when an existing Prisma 7 schema is the contract source. */
21
+ authoring: "'psl'|'typescript'|'prisma7'",
22
+ /** The starter schema init wrote, or the Prisma 7 schema it points the config at. */
23
+ schemaPath: "string",
24
+ filesWritten: "string[]",
25
+ /**
26
+ * FR9.1 — paths removed from disk during this run: contract artifacts
27
+ * (`contract.json`, `contract.d.ts`, `ops.json`, `migration.json`) an
28
+ * earlier run left behind, which only a re-init has, and the retired
29
+ * agent-skill directories, which every run removes when it finds them.
30
+ */
31
+ filesDeleted: "string[]",
32
+ /** The Prisma 7 config moved out of Prisma 8's way; empty on a normal run. */
33
+ filesRenamed: type({
34
+ from: "string",
35
+ to: "string"
36
+ }).array(),
37
+ /**
38
+ * What became of the dependency install. `skipped` is the deliberate
39
+ * `--skip-install`; `failed` is an install that ran and did not succeed,
40
+ * which leaves a scaffolded project that cannot run yet. `deps` and
41
+ * `devDeps` list what was installed, so both non-`installed` states
42
+ * carry them empty.
43
+ */
44
+ packagesInstalled: {
45
+ status: "'installed'|'skipped'|'failed'",
46
+ deps: "string[]",
47
+ devDeps: "string[]"
48
+ },
49
+ contractEmitted: "boolean",
50
+ /**
51
+ * What the Prisma 7 path did beyond a normal run: the schema adopted, the
52
+ * config renamed (or `null` when it was already `prisma7.config.*`), the
53
+ * `package.json` scripts now invoking `prisma7`, and the Prisma 7 package
54
+ * specs installed or listed to install. `null` on a normal run.
55
+ */
56
+ prisma7: type({
57
+ schemaPath: "string",
58
+ configRenamedTo: "string | null",
59
+ scriptsRewritten: "string[]",
60
+ packagesMoved: "string[]"
61
+ }).or("null"),
62
+ nextSteps: "string[]",
63
+ warnings: "string[]"
64
+ });
65
+ /**
66
+ * Builds the `nextSteps` array from the resolved scaffold state. Steps are
67
+ * ordered by the workflow a user needs to follow: install what is missing →
68
+ * configure connection → (emit if not yet done) → run a starter query →
69
+ * docs / agent skill.
70
+ *
71
+ * The strings are stable and human-readable; agents wanting to act on them
72
+ * should match on substrings (e.g. "DATABASE_URL") rather than exact text,
73
+ * since copy may evolve.
74
+ */
75
+ function buildNextSteps(options) {
76
+ const steps = [];
77
+ let stepNumber = 1;
78
+ const push = (text) => {
79
+ steps.push(`${stepNumber}. ${text}`);
80
+ stepNumber += 1;
81
+ };
82
+ if (options.prisma7 !== null) {
83
+ pushPrisma7Steps(push, {
84
+ ...options,
85
+ prisma7: options.prisma7
86
+ });
87
+ return steps;
88
+ }
89
+ if (options.packagesInstalled === "failed") push("Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.");
90
+ if (options.packagesInstalled === "skipped") push("Install the project dependencies with your package manager (this run skipped them).");
91
+ push("Set DATABASE_URL in your environment (export it or add it to .env).");
92
+ if (!options.contractEmitted) {
93
+ push(`Emit the contract: \`${options.emitCommand}\``);
94
+ push(`Edit your schema at ${options.schemaPath}, then re-run the emit command.`);
95
+ } else push(`Edit your schema at ${options.schemaPath}, then re-run \`${options.emitCommand}\`.`);
96
+ push("Open prisma-8.md for a quick reference on how to write your first typed query.");
97
+ push("Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.");
98
+ return steps;
99
+ }
100
+ /** The install that precedes the Prisma 7 check failed, so nothing was written. */
101
+ const NEXT_STEPS_BEFORE_SCAFFOLD = ["1. Install the project dependencies with your package manager. The install this run attempted failed before anything was written.", "2. Run `prisma orm init` again."];
102
+ const DB_SIGN_STEP = "Adopt your existing database: `prisma db sign` verifies it against the contract and records the signing marker and the `db` ref. It makes no change to the database schema.";
103
+ const PRISMA7_ROUTES_STEP = "Move your routes one at a time to the Prisma 8 client in src/prisma/db.ts.";
104
+ const PRISMA7_LOOP_STEP = "After each `prisma7 migrate dev`, run `prisma contract emit` and then `prisma db sign`.";
105
+ const PRISMA7_GENERATE_STEP = "Run `prisma7 generate` so the Prisma 7 client matches the Prisma 7 CLI.";
106
+ const PRISMA7_QUICK_REFERENCE_STEP = "Open prisma-8.md for a quick reference on the transition loop and your first typed query.";
107
+ const AGENT_SKILLS_STEP = "Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.";
108
+ /**
109
+ * The transition routine, project requirement 7: init set Prisma 8 up beside
110
+ * Prisma 7 and stopped, so every database action here is one the user runs.
111
+ */
112
+ function pushPrisma7Steps(push, options) {
113
+ const moved = options.prisma7.packagesMoved;
114
+ const including = moved.length === 0 ? "" : ` That includes ${moved.join(", ")}.`;
115
+ push("Set DATABASE_URL in your environment (export it or add it to .env).");
116
+ if (options.packagesInstalled === "failed") push(`Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.${including}`);
117
+ if (options.packagesInstalled === "skipped") push(`Install the project dependencies with your package manager (this run skipped them)${moved.length === 0 ? "" : `, including ${moved.join(", ")}`}.`);
118
+ if (!options.contractEmitted) push(`Emit the contract: \`${options.emitCommand}\``);
119
+ push(DB_SIGN_STEP);
120
+ push(PRISMA7_ROUTES_STEP);
121
+ push(PRISMA7_LOOP_STEP);
122
+ if (options.prisma7.clientMoved) push(PRISMA7_GENERATE_STEP);
123
+ push(PRISMA7_QUICK_REFERENCE_STEP);
124
+ push(AGENT_SKILLS_STEP);
125
+ }
126
+ //#endregion
127
+ export { PRISMA7_QUICK_REFERENCE_STEP as a, PRISMA7_LOOP_STEP as i, InitOutputSchema as n, buildNextSteps as o, NEXT_STEPS_BEFORE_SCAFFOLD as r, DB_SIGN_STEP as t };
128
+
129
+ //# sourceMappingURL=output-BcC8eB0h-C5bRd-aC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-BcC8eB0h-C5bRd-aC.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/output-BcC8eB0h.mjs"],"sourcesContent":["import { type } from \"arktype\";\n//#region src/commands/init/output.ts\n/**\n* arktype schema for the structured success document `init --json` writes\n* to stdout (FR1.5). The same shape backs the human-readable outro\n* renderer (FR10), so the two output modes carry identical information.\n*\n* `target` is normalised to the user-facing flag value (`mongodb` rather\n* than the internal `mongo`) so consumers can round-trip the document\n* straight into a follow-up `--target` invocation.\n*\n* The `ok: true` literal is the documented success/error discriminator —\n* see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).\n* Error envelopes (`CliErrorEnvelope`) carry `ok: false` so consumers can\n* branch with `if (doc.ok)` without inspecting the rest of the structure.\n*/\nconst InitOutputSchema = type({\n\tok: \"true\",\n\ttarget: \"'postgres'|'mongodb'\",\n\t/** `prisma7` when an existing Prisma 7 schema is the contract source. */\n\tauthoring: \"'psl'|'typescript'|'prisma7'\",\n\t/** The starter schema init wrote, or the Prisma 7 schema it points the config at. */\n\tschemaPath: \"string\",\n\tfilesWritten: \"string[]\",\n\t/**\n\t* FR9.1 — paths removed from disk during this run: contract artifacts\n\t* (`contract.json`, `contract.d.ts`, `ops.json`, `migration.json`) an\n\t* earlier run left behind, which only a re-init has, and the retired\n\t* agent-skill directories, which every run removes when it finds them.\n\t*/\n\tfilesDeleted: \"string[]\",\n\t/** The Prisma 7 config moved out of Prisma 8's way; empty on a normal run. */\n\tfilesRenamed: type({\n\t\tfrom: \"string\",\n\t\tto: \"string\"\n\t}).array(),\n\t/**\n\t* What became of the dependency install. `skipped` is the deliberate\n\t* `--skip-install`; `failed` is an install that ran and did not succeed,\n\t* which leaves a scaffolded project that cannot run yet. `deps` and\n\t* `devDeps` list what was installed, so both non-`installed` states\n\t* carry them empty.\n\t*/\n\tpackagesInstalled: {\n\t\tstatus: \"'installed'|'skipped'|'failed'\",\n\t\tdeps: \"string[]\",\n\t\tdevDeps: \"string[]\"\n\t},\n\tcontractEmitted: \"boolean\",\n\t/**\n\t* What the Prisma 7 path did beyond a normal run: the schema adopted, the\n\t* config renamed (or `null` when it was already `prisma7.config.*`), the\n\t* `package.json` scripts now invoking `prisma7`, and the Prisma 7 package\n\t* specs installed or listed to install. `null` on a normal run.\n\t*/\n\tprisma7: type({\n\t\tschemaPath: \"string\",\n\t\tconfigRenamedTo: \"string | null\",\n\t\tscriptsRewritten: \"string[]\",\n\t\tpackagesMoved: \"string[]\"\n\t}).or(\"null\"),\n\tnextSteps: \"string[]\",\n\twarnings: \"string[]\"\n});\n/**\n* Builds the `nextSteps` array from the resolved scaffold state. Steps are\n* ordered by the workflow a user needs to follow: install what is missing →\n* configure connection → (emit if not yet done) → run a starter query →\n* docs / agent skill.\n*\n* The strings are stable and human-readable; agents wanting to act on them\n* should match on substrings (e.g. \"DATABASE_URL\") rather than exact text,\n* since copy may evolve.\n*/\nfunction buildNextSteps(options) {\n\tconst steps = [];\n\tlet stepNumber = 1;\n\tconst push = (text) => {\n\t\tsteps.push(`${stepNumber}. ${text}`);\n\t\tstepNumber += 1;\n\t};\n\tif (options.prisma7 !== null) {\n\t\tpushPrisma7Steps(push, {\n\t\t\t...options,\n\t\t\tprisma7: options.prisma7\n\t\t});\n\t\treturn steps;\n\t}\n\tif (options.packagesInstalled === \"failed\") push(\"Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.\");\n\tif (options.packagesInstalled === \"skipped\") push(\"Install the project dependencies with your package manager (this run skipped them).\");\n\tpush(\"Set DATABASE_URL in your environment (export it or add it to .env).\");\n\tif (!options.contractEmitted) {\n\t\tpush(`Emit the contract: \\`${options.emitCommand}\\``);\n\t\tpush(`Edit your schema at ${options.schemaPath}, then re-run the emit command.`);\n\t} else push(`Edit your schema at ${options.schemaPath}, then re-run \\`${options.emitCommand}\\`.`);\n\tpush(\"Open prisma-8.md for a quick reference on how to write your first typed query.\");\n\tpush(\"Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.\");\n\treturn steps;\n}\n/** The install that precedes the Prisma 7 check failed, so nothing was written. */\nconst NEXT_STEPS_BEFORE_SCAFFOLD = [\"1. Install the project dependencies with your package manager. The install this run attempted failed before anything was written.\", \"2. Run `prisma orm init` again.\"];\nconst DB_SIGN_STEP = \"Adopt your existing database: `prisma db sign` verifies it against the contract and records the signing marker and the `db` ref. It makes no change to the database schema.\";\nconst PRISMA7_ROUTES_STEP = \"Move your routes one at a time to the Prisma 8 client in src/prisma/db.ts.\";\nconst PRISMA7_LOOP_STEP = \"After each `prisma7 migrate dev`, run `prisma contract emit` and then `prisma db sign`.\";\nconst PRISMA7_GENERATE_STEP = \"Run `prisma7 generate` so the Prisma 7 client matches the Prisma 7 CLI.\";\nconst PRISMA7_QUICK_REFERENCE_STEP = \"Open prisma-8.md for a quick reference on the transition loop and your first typed query.\";\nconst AGENT_SKILLS_STEP = \"Working with a coding agent? Run `prisma init` in this project to set up the Prisma agent skills.\";\n/**\n* The transition routine, project requirement 7: init set Prisma 8 up beside\n* Prisma 7 and stopped, so every database action here is one the user runs.\n*/\nfunction pushPrisma7Steps(push, options) {\n\tconst moved = options.prisma7.packagesMoved;\n\tconst including = moved.length === 0 ? \"\" : ` That includes ${moved.join(\", \")}.`;\n\tpush(\"Set DATABASE_URL in your environment (export it or add it to .env).\");\n\tif (options.packagesInstalled === \"failed\") push(`Install the project dependencies with your package manager — the install this run attempted failed, so nothing else here will work yet.${including}`);\n\tif (options.packagesInstalled === \"skipped\") push(`Install the project dependencies with your package manager (this run skipped them)${moved.length === 0 ? \"\" : `, including ${moved.join(\", \")}`}.`);\n\tif (!options.contractEmitted) push(`Emit the contract: \\`${options.emitCommand}\\``);\n\tpush(DB_SIGN_STEP);\n\tpush(PRISMA7_ROUTES_STEP);\n\tpush(PRISMA7_LOOP_STEP);\n\tif (options.prisma7.clientMoved) push(PRISMA7_GENERATE_STEP);\n\tpush(PRISMA7_QUICK_REFERENCE_STEP);\n\tpush(AGENT_SKILLS_STEP);\n}\n//#endregion\nexport { PRISMA7_QUICK_REFERENCE_STEP as a, PRISMA7_LOOP_STEP as i, InitOutputSchema as n, buildNextSteps as o, NEXT_STEPS_BEFORE_SCAFFOLD as r, DB_SIGN_STEP as t };\n\n//# sourceMappingURL=output-BcC8eB0h.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,mBAAmB,KAAK;CAC7B,IAAI;CACJ,QAAQ;;CAER,WAAW;;CAEX,YAAY;CACZ,cAAc;;;;;;;CAOd,cAAc;;CAEd,cAAc,KAAK;EAClB,MAAM;EACN,IAAI;CACL,CAAC,CAAC,CAAC,MAAM;;;;;;;;CAQT,mBAAmB;EAClB,QAAQ;EACR,MAAM;EACN,SAAS;CACV;CACA,iBAAiB;;;;;;;CAOjB,SAAS,KAAK;EACb,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;CAChB,CAAC,CAAC,CAAC,GAAG,MAAM;CACZ,WAAW;CACX,UAAU;AACX,CAAC;;;;;;;;;;;AAWD,SAAS,eAAe,SAAS;CAChC,MAAM,QAAQ,CAAC;CACf,IAAI,aAAa;CACjB,MAAM,QAAQ,SAAS;EACtB,MAAM,KAAK,GAAG,WAAW,IAAI,MAAM;EACnC,cAAc;CACf;CACA,IAAI,QAAQ,YAAY,MAAM;EAC7B,iBAAiB,MAAM;GACtB,GAAG;GACH,SAAS,QAAQ;EAClB,CAAC;EACD,OAAO;CACR;CACA,IAAI,QAAQ,sBAAsB,UAAU,KAAK,yIAAyI;CAC1L,IAAI,QAAQ,sBAAsB,WAAW,KAAK,qFAAqF;CACvI,KAAK,qEAAqE;CAC1E,IAAI,CAAC,QAAQ,iBAAiB;EAC7B,KAAK,wBAAwB,QAAQ,YAAY,GAAG;EACpD,KAAK,uBAAuB,QAAQ,WAAW,gCAAgC;CAChF,OAAO,KAAK,uBAAuB,QAAQ,WAAW,kBAAkB,QAAQ,YAAY,IAAI;CAChG,KAAK,gFAAgF;CACrF,KAAK,mGAAmG;CACxG,OAAO;AACR;;AAEA,MAAM,6BAA6B,CAAC,qIAAqI,iCAAiC;AAC1M,MAAM,eAAe;AACrB,MAAM,sBAAsB;AAC5B,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAC9B,MAAM,+BAA+B;AACrC,MAAM,oBAAoB;;;;;AAK1B,SAAS,iBAAiB,MAAM,SAAS;CACxC,MAAM,QAAQ,QAAQ,QAAQ;CAC9B,MAAM,YAAY,MAAM,WAAW,IAAI,KAAK,kBAAkB,MAAM,KAAK,IAAI,EAAE;CAC/E,KAAK,qEAAqE;CAC1E,IAAI,QAAQ,sBAAsB,UAAU,KAAK,0IAA0I,WAAW;CACtM,IAAI,QAAQ,sBAAsB,WAAW,KAAK,qFAAqF,MAAM,WAAW,IAAI,KAAK,eAAe,MAAM,KAAK,IAAI,IAAI,EAAE;CACrM,IAAI,CAAC,QAAQ,iBAAiB,KAAK,wBAAwB,QAAQ,YAAY,GAAG;CAClF,KAAK,YAAY;CACjB,KAAK,mBAAmB;CACxB,KAAK,iBAAiB;CACtB,IAAI,QAAQ,QAAQ,aAAa,KAAK,qBAAqB;CAC3D,KAAK,4BAA4B;CACjC,KAAK,iBAAiB;AACvB"}
@@ -1,3 +1,3 @@
1
1
  import { a as ShellReexportMapping, i as ShellPackageMapping, n as ShellKind, o as excludedSubpaths, r as ShellName, s as publicShells, t as ShellDefinition } from "./shells-CIUmT4u4.mjs";
2
- import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-CfoYgejL.mjs";
2
+ import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-ARK1wjzc.mjs";
3
3
  export { ImportRoot, ImportRootError, ImportRootMode, ImportSpecifierResolver, ScaffoldImportRoot, ShellDefinition, ShellKind, ShellName, ShellPackageMapping, ShellReexportMapping, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, excludedSubpaths, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, publicShells, resolveImportSpecifier, transitiveImports };
@@ -1,3 +1,3 @@
1
- import { n as publicShells, t as excludedSubpaths } from "./shells-C4HbRAr5.mjs";
2
- import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-CNFBPAT1.mjs";
1
+ import { n as publicShells, t as excludedSubpaths } from "./shells-w_yEDhe8.mjs";
2
+ import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-BPn2s_fq.mjs";
3
3
  export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, excludedSubpaths, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, publicShells, resolveImportSpecifier, transitiveImports };
@@ -1,2 +1,2 @@
1
- import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-CfoYgejL.mjs";
1
+ import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-ARK1wjzc.mjs";
2
2
  export { ImportRoot, ImportRootError, ImportRootMode, ImportSpecifierResolver, ScaffoldImportRoot, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };
@@ -1,2 +1,2 @@
1
- import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-CNFBPAT1.mjs";
1
+ import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-BPn2s_fq.mjs";
2
2
  export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };
@@ -1,2 +1,2 @@
1
- import { n as publicShells, t as excludedSubpaths } from "./shells-C4HbRAr5.mjs";
1
+ import { n as publicShells, t as excludedSubpaths } from "./shells-w_yEDhe8.mjs";
2
2
  export { excludedSubpaths, publicShells };
@@ -1,8 +1,8 @@
1
- # Welcome to Prisma Next!
1
+ # Welcome to Prisma ORM!
2
2
 
3
- Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every collection, field, and relation.
3
+ Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every collection, field, and relation.
4
4
 
5
- This project is set up for MongoDB. Prisma Next also supports other databases.
5
+ This project is set up for MongoDB. Prisma ORM also supports other databases.
6
6
 
7
7
  {{requirements}}
8
8
 
@@ -22,7 +22,7 @@ const user = await db.orm.users
22
22
  .first();
23
23
 
24
24
  // Your editor will show the type of user as
25
- // { _id: ObjectId; email: string; username: string | null; name: string | null; posts: Post[] } | null
25
+ // { id: ObjectId; email: string; username: string | null; name: string | null; posts: Post[] } | null
26
26
  ```
27
27
 
28
28
  `db` connects to MongoDB lazily on the first query, so there is no manual `connect(...)` step in your application code. Call `await db.close()` if you need to release the underlying connection (typically only in tests or short-lived scripts). After `close()` the client is single-shot — any further query, `connect()`, or `runtime()` call rejects with `"Mongo client is closed"`. Construct a new `mongo({...})` if you need to use it again.
@@ -34,7 +34,7 @@ Your contract has two companion files in the same directory:
34
34
 
35
35
  Commit both files to git. When you change your contract, run `{{pkgRun}} contract emit` to update them.
36
36
 
37
- If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically.
37
+ If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically.
38
38
 
39
39
  ## Configuration
40
40
 
@@ -42,10 +42,10 @@ If you use a framework like Next.js or Vite, the Prisma Next plugin will do this
42
42
 
43
43
  ```typescript
44
44
  import 'dotenv/config';
45
- import { defineConfig } from '@prisma/cli-engine';
45
+ import { definePrismaConfig } from '@prisma/cli-engine';
46
46
  import { defineConfig as ormConfig } from '{{configEntrypoint}}';
47
47
 
48
- export default defineConfig({
48
+ export default definePrismaConfig({
49
49
  orm: ormConfig({
50
50
  contract: './{{schemaPath}}',
51
51
  db: {
@@ -97,14 +97,14 @@ Multi-document transactions and change streams require MongoDB to run as a **rep
97
97
  - **`mongodb-memory-server`:** use `MongoMemoryReplSet` instead of `MongoMemoryServer` in tests.
98
98
  - **MongoDB Atlas:** every Atlas cluster is already a replica set.
99
99
 
100
- The transaction API (`db.transaction(...)`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma Next's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw `MongoClient` using the escape hatch in the next section.
100
+ The transaction API (`db.transaction(...)`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma ORM's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw `MongoClient` using the escape hatch in the next section.
101
101
 
102
102
  ## Escape hatches
103
103
 
104
104
  The ORM covers the common cases. For the rest, two escape hatches are designed in:
105
105
 
106
106
  - **Typed raw aggregations — `db.query`.** The facade exposes `db.query`, a typed builder for aggregation pipelines that runs through the same runtime + middleware + codec stack as `db.orm`. Reach for it when the ORM can't express a `$lookup`/`$facet`/`$graphLookup`/window-function pipeline.
107
- - **Direct `mongodb` driver control — `mongoClient` binding.** Construct your own `MongoClient` and pass it to `mongo({ mongoClient, dbName, contractJson })`. Your code keeps the `MongoClient` reference and uses it directly (transactions, change streams, sessions, anything Prisma Next doesn't surface yet); the same `db` object continues to give you the typed ORM.
107
+ - **Direct `mongodb` driver control — `mongoClient` binding.** Construct your own `MongoClient` and pass it to `mongo({ contract, mongoClient, dbName })`. Your code keeps the `MongoClient` reference and uses it directly (transactions, change streams, sessions, anything Prisma ORM doesn't surface yet); the same `db` object continues to give you the typed ORM.
108
108
 
109
109
  `db.runtime()` is **not** the escape hatch — it returns the internal executor (`MongoRuntime`), not a `mongodb` `MongoClient` or `Db`. Use `db.query` for raw aggregations and the `mongoClient` binding for direct driver control.
110
110
 
@@ -112,6 +112,6 @@ The ORM covers the common cases. For the rest, two escape hatches are designed i
112
112
 
113
113
  If this project lives inside a pnpm workspace, a few things are worth knowing:
114
114
 
115
- - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `@prisma/cli` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`.
116
- - **`pnpm dlx`.** `pnpm dlx @prisma/cli@next init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than `latest`.
117
- - **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma Next with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`.
115
+ - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `prisma` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`.
116
+ - **`pnpm dlx`.** `pnpm dlx prisma@latest orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than `latest`.
117
+ - **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma ORM with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`.
@@ -1,8 +1,8 @@
1
- # Welcome to Prisma Next!
1
+ # Welcome to Prisma ORM!
2
2
 
3
- Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every table, column, and relation.
3
+ Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every table, column, and relation.
4
4
 
5
- This project is set up for PostgreSQL. Prisma Next also supports other databases.
5
+ This project is set up for PostgreSQL. Prisma ORM also supports other databases.
6
6
 
7
7
  {{requirements}}
8
8
 
@@ -17,7 +17,7 @@ Every model you define in your contract can be queried from your app. Your edito
17
17
  ```typescript
18
18
  import { db } from '{{dbImportPath}}';
19
19
 
20
- const user = await db.orm.User
20
+ const user = await db.orm.public.User
21
21
  .where({ email: 'alice@example.com' })
22
22
  .first();
23
23
 
@@ -32,7 +32,7 @@ Your contract has two companion files in the same directory:
32
32
 
33
33
  Commit both files to git. When you change your contract, run `{{pkgRun}} contract emit` to update them.
34
34
 
35
- If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically.
35
+ If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically.
36
36
 
37
37
  ## Configuration
38
38
 
@@ -40,10 +40,10 @@ If you use a framework like Next.js or Vite, the Prisma Next plugin will do this
40
40
 
41
41
  ```typescript
42
42
  import 'dotenv/config';
43
- import { defineConfig } from '@prisma/cli-engine';
43
+ import { definePrismaConfig } from '@prisma/cli-engine';
44
44
  import { defineConfig as ormConfig } from '{{configEntrypoint}}';
45
45
 
46
- export default defineConfig({
46
+ export default definePrismaConfig({
47
47
  orm: ormConfig({
48
48
  contract: './{{schemaPath}}',
49
49
  db: {
@@ -91,6 +91,6 @@ You can customize how your environment variables are loaded by changing or remov
91
91
 
92
92
  If this project lives inside a pnpm workspace, a few things are worth knowing:
93
93
 
94
- - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `@prisma/cli` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`.
95
- - **`pnpm dlx`.** `pnpm dlx @prisma/cli@next init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than `latest`.
96
- - **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma Next with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`.
94
+ - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `prisma` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`.
95
+ - **`pnpm dlx`.** `pnpm dlx prisma@latest orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than `latest`.
96
+ - **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma ORM with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`.
@@ -0,0 +1,80 @@
1
+ # Welcome to Prisma ORM 8!
2
+
3
+ Prisma ORM lets you query your database in simple, easy-to-read TypeScript. This project keeps its Prisma 7 schema and migrations, and Prisma 8 reads that schema as its contract source, so both run side by side while you move your code over.
4
+
5
+ {{requirements}}
6
+
7
+ ## Your contract source
8
+
9
+ Your contract source is your Prisma 7 schema at [`{{schemaPath}}`]({{schemaPath}}). Prisma 7 keeps owning it: edit it as before and migrate with `prisma7 migrate dev`. Prisma 8 compiles it into two companion files under `{{outputDir}}/`:
10
+
11
+ - **`contract.json`** — this tells your application what models exist, just like `package-lock.json` tells your package manager what dependencies your project has
12
+ - **`contract.d.ts`** — this powers autocomplete and type checking in your editor
13
+
14
+ Commit both files to git. When the schema changes, run `{{pkgRun}} contract emit` to update them.
15
+
16
+ Every model in your schema can be queried from your app through the Prisma 8 client:
17
+
18
+ ```typescript
19
+ import { db } from '{{dbImportPath}}';
20
+
21
+ const user = await db.orm.public.User
22
+ .where({ email: 'alice@example.com' })
23
+ .first();
24
+ ```
25
+
26
+ ## Configuration
27
+
28
+ [`prisma.config.ts`](prisma.config.ts) tells the Prisma 8 CLI where your contract source lives and how to connect to your database.{{prisma7ConfigSentence}}
29
+
30
+ ```typescript
31
+ import 'dotenv/config';
32
+ import { definePrismaConfig } from '@prisma/cli-engine';
33
+ import { defineConfig as ormConfig, prisma7Schema } from '{{configEntrypoint}}';
34
+
35
+ export default definePrismaConfig({
36
+ orm: ormConfig({
37
+ contract: prisma7Schema('{{schemaPath}}'),
38
+ output: '{{outputDir}}',
39
+ db: {
40
+ connection: process.env['DATABASE_URL']!,
41
+ },
42
+ }),
43
+ });
44
+ ```
45
+
46
+ `DATABASE_URL` is read from your [`.env`](./.env) file:
47
+
48
+ ```env
49
+ DATABASE_URL="postgresql://user:password@localhost:5432/mydb"
50
+ ```
51
+
52
+ ## The transition loop
53
+
54
+ 1. Run `{{pkgRun}} db sign` once so Prisma 8 knows the database matches the contract.
55
+ 2. Move your routes to the Prisma 8 client in [`{{outputDir}}/db.ts`]({{outputDir}}/db.ts) one at a time.
56
+ 3. After each `prisma7 migrate dev`, run `{{pkgRun}} contract emit` and then `{{pkgRun}} db sign`.
57
+
58
+ ## Quick reference
59
+
60
+ ### Commands
61
+
62
+ ```bash
63
+ {{pkgRun}} contract emit # Update contract.json and contract.d.ts from the schema
64
+ {{pkgRun}} db sign # Record that the database matches the contract
65
+ prisma7 migrate dev # Migrate with Prisma 7, as before
66
+ ```
67
+
68
+ ### Files
69
+
70
+ | File | Purpose |
71
+ |---|---|
72
+ | [`{{schemaPath}}`]({{schemaPath}}) | Your Prisma 7 schema — the contract source |
73
+ | [`prisma.config.ts`](prisma.config.ts) | Prisma 8 CLI configuration |{{prisma7ConfigRow}}
74
+ | [`{{outputDir}}/db.ts`]({{outputDir}}/db.ts) | Database client — `import { db } from '{{dbImportPath}}'` |
75
+ | `{{outputDir}}/contract.json` | Compiled contract (generated) |
76
+ | `{{outputDir}}/contract.d.ts` | Contract types (generated) |
77
+
78
+ ## Monorepo notes (pnpm workspaces)
79
+
80
+ If this project lives inside a pnpm workspace, `pnpm-workspace.yaml` catalogs for `prisma` or `{{pkg}}` take precedence over `latest`; update or remove the catalog entry and re-run `pnpm install` if you wanted the published version.