@prisma/orm-toolchain 8.0.0-rc.1-dev.22 → 8.0.0-rc.1-dev.24
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.
- package/dist/{aggregate-D53gnb7v.mjs → aggregate-BKbHUHLA.mjs} +7 -7
- package/dist/{aggregate-D53gnb7v.mjs.map → aggregate-BKbHUHLA.mjs.map} +1 -1
- package/dist/{aggregate-BflrjWPO.d.mts → aggregate-CA6bJ8UO.d.mts} +3 -3
- package/dist/{aggregate-BflrjWPO.d.mts.map → aggregate-CA6bJ8UO.d.mts.map} +1 -1
- package/dist/bin__prisma-next.mjs +31 -26
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/{caught-errors-D7Qznyrm-BzYooF6H.mjs → caught-errors-nYuTn3NK-DkD-ZrDr.mjs} +3 -3
- package/dist/caught-errors-nYuTn3NK-DkD-ZrDr.mjs.map +1 -0
- package/dist/{cli-errors-CDr3WcJP-NFry5GHb.d.mts → cli-errors-C7vbvQuK-DLpSxz4U.d.mts} +16 -8
- package/dist/{cli-errors-CDr3WcJP-NFry5GHb.d.mts.map → cli-errors-C7vbvQuK-DLpSxz4U.d.mts.map} +1 -1
- package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs +235 -0
- package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs.map +1 -0
- package/dist/cli-telemetry.mjs +7 -6
- package/dist/cli-telemetry.mjs.map +1 -1
- package/dist/cli.d.mts +38 -2
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +358 -5
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__commands__contract-emit.d.mts +1 -1
- package/dist/cli__commands__contract-emit.mjs +1 -1
- package/dist/cli__commands__contract-infer.mjs +1 -1
- package/dist/cli__commands__db-init.mjs +1 -1
- package/dist/cli__commands__db-schema.mjs +1 -1
- package/dist/cli__commands__db-sign.mjs +1 -1
- package/dist/cli__commands__db-update.mjs +1 -1
- package/dist/cli__commands__db-verify.mjs +1 -1
- package/dist/cli__commands__migrate.d.mts +2 -2
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.mjs +1 -1
- package/dist/cli__commands__migration-graph.d.mts +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +2 -2
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.d.mts +1 -1
- package/dist/cli__commands__migration-log.mjs +1 -1
- package/dist/cli__commands__migration-new.mjs +1 -1
- package/dist/cli__commands__migration-plan.d.mts +1 -1
- package/dist/cli__commands__migration-plan.mjs +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.d.mts +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +26 -19
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +16 -16
- package/dist/cli__control-api__testing.d.mts +66 -0
- package/dist/cli__control-api__testing.d.mts.map +1 -0
- package/dist/cli__control-api__testing.mjs +255 -0
- package/dist/cli__control-api__testing.mjs.map +1 -0
- package/dist/cli__migration-cli.mjs +16 -7
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/{client-Y6qbDk7X-BzKLmBZo.mjs → client-milNsAnF-B92uF3yv.mjs} +11 -11
- package/dist/client-milNsAnF-B92uF3yv.mjs.map +1 -0
- package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs +765 -0
- package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs.map +1 -0
- package/dist/config-loader.d.mts +2 -2
- package/dist/config-loader.mjs +2 -2
- package/dist/{contract-at-errors-Dv1mxKYO-C29YB4RC.mjs → contract-at-errors-BTeDEXm4-BAIDia2-.mjs} +3 -3
- package/dist/contract-at-errors-BTeDEXm4-BAIDia2-.mjs.map +1 -0
- package/dist/{contract-emit-CTm2zfuG-7PV9SBY6.mjs → contract-emit-Bdf4DAR4-lKqkbfZT.mjs} +8 -38
- package/dist/contract-emit-Bdf4DAR4-lKqkbfZT.mjs.map +1 -0
- package/dist/{contract-emit-D8IXP9Qp-Df6NwXn8.mjs → contract-emit-Ci-8sP-b-QzQXK2xQ.mjs} +29 -23
- package/dist/contract-emit-Ci-8sP-b-QzQXK2xQ.mjs.map +1 -0
- package/dist/{contract-emit-B65_UiFn.d.mts → contract-emit-CvwNE4R1-DEn1V1Zo.d.mts} +2 -2
- package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +1 -0
- package/dist/contract-emit-E6m8HE42-Bfiodzf_.mjs +2 -0
- package/dist/{contract-infer-BwT7ngoo-Dx6aAwIN.mjs → contract-infer-hhyMJiwS-BJ5cYC9P.mjs} +7 -6
- package/dist/contract-infer-hhyMJiwS-BJ5cYC9P.mjs.map +1 -0
- package/dist/{contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs → contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs} +7 -7
- package/dist/contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs.map +1 -0
- package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs} +2 -2
- package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs.map → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs → contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs} +7 -6
- package/dist/contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs.map +1 -0
- package/dist/{db-init-CBj_EWg3.mjs → db-init-3CbSYxRI-BlTkWh8n.mjs} +10 -8
- package/dist/db-init-3CbSYxRI-BlTkWh8n.mjs.map +1 -0
- package/dist/{db-schema-BWpeh0Q_.mjs → db-schema-BVLbe3EL-WLnbuo77.mjs} +6 -5
- package/dist/db-schema-BVLbe3EL-WLnbuo77.mjs.map +1 -0
- package/dist/{db-sign-DCb_DKtv.mjs → db-sign-Cdw2RmoG-C-X5UheR.mjs} +24 -11
- package/dist/db-sign-Cdw2RmoG-C-X5UheR.mjs.map +1 -0
- package/dist/{db-update-WX0KitcX.mjs → db-update-BHOdo8PV-BVBNKrJc.mjs} +11 -9
- package/dist/db-update-BHOdo8PV-BVBNKrJc.mjs.map +1 -0
- package/dist/{db-verify-B8ax2Y_x-Bp4s5Ra6.mjs → db-verify-C9P9oNCs-gieY7hV2.mjs} +33 -16
- package/dist/db-verify-C9P9oNCs-gieY7hV2.mjs.map +1 -0
- package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs} +2 -2
- package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs.map → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map} +1 -1
- package/dist/emitter.d.mts +1 -1
- package/dist/emitter.mjs +2 -2
- package/dist/emitter__domain-type-generation.mjs +1 -1
- package/dist/{exports-BCLg4CiV-okAfZydo.mjs → exports-BCLg4CiV-05kuwcb0.mjs} +4 -4
- package/dist/{exports-BCLg4CiV-okAfZydo.mjs.map → exports-BCLg4CiV-05kuwcb0.mjs.map} +1 -1
- package/dist/exports-BZLNbtkY.mjs +215 -0
- package/dist/exports-BZLNbtkY.mjs.map +1 -0
- package/dist/{exports-BN0vFTxG.mjs → exports-CqNUihkI.mjs} +2 -2
- package/dist/{exports-BN0vFTxG.mjs.map → exports-CqNUihkI.mjs.map} +1 -1
- package/dist/{exports-BnihzVhw.mjs → exports-DaxzMVtq.mjs} +16 -4
- package/dist/exports-DaxzMVtq.mjs.map +1 -0
- package/dist/{format-Bw3LVJ1v-BJ6lVFMA.mjs → format-Ddhz7xFW-Bo1nhay8.mjs} +18 -15
- package/dist/format-Ddhz7xFW-Bo1nhay8.mjs.map +1 -0
- package/dist/{framework-components-3DdB31mk-BHyX-OlJ.mjs → framework-components-Cruf6BPK-CaQvMI3T.mjs} +7 -5
- package/dist/framework-components-Cruf6BPK-CaQvMI3T.mjs.map +1 -0
- package/dist/index-mCsi_ND5.d.mts +49 -0
- package/dist/index-mCsi_ND5.d.mts.map +1 -0
- package/dist/{init-CPB89WK2-DPZRZ9Ee.mjs → init-BbmawfZx-DCylULYh.mjs} +23 -8
- package/dist/init-BbmawfZx-DCylULYh.mjs.map +1 -0
- package/dist/{inspect-live-schema-Da76TWOs-CAFqkhGb.mjs → inspect-live-schema-BEQun_1x-CZpCgg8A.mjs} +17 -13
- package/dist/inspect-live-schema-BEQun_1x-CZpCgg8A.mjs.map +1 -0
- package/dist/{invariants-BzYfO9IL-BXTvx0z9.mjs → invariants-D5TNnX5E-rjPoJGFq.mjs} +4 -3
- package/dist/invariants-D5TNnX5E-rjPoJGFq.mjs.map +1 -0
- package/dist/{io-CHUUeHh0-CoCBe9eN.mjs → io-CHUUeHh0-CbyTkKP6.mjs} +2 -2
- package/dist/{io-CHUUeHh0-CoCBe9eN.mjs.map → io-CHUUeHh0-CbyTkKP6.mjs.map} +1 -1
- package/dist/{legend-5iwwlLU2-CB8bdQKJ.mjs → legend-BBtAETiW-BHqTbUjx.mjs} +3 -3
- package/dist/legend-BBtAETiW-BHqTbUjx.mjs.map +1 -0
- package/dist/{migrate-B-NAuO90.mjs → migrate-B-hpVTxi-DJzFYT2w.mjs} +44 -17
- package/dist/migrate-B-hpVTxi-DJzFYT2w.mjs.map +1 -0
- package/dist/{migrate-show-B2LkXkoB-D1ZNl84C.mjs → migrate-show-CUymfnbM-BbpcO2FY.mjs} +9 -12
- package/dist/migrate-show-CUymfnbM-BbpcO2FY.mjs.map +1 -0
- package/dist/{migrate-show-60NNqVia-oGqMaVA9.d.mts → migrate-show-g71Z4vJw-ocdTvf70.d.mts} +10 -5
- package/dist/migrate-show-g71Z4vJw-ocdTvf70.d.mts.map +1 -0
- package/dist/{migration-DAJY-NmR.mjs → migration-_C5W2uXF.mjs} +2 -2
- package/dist/{migration-DAJY-NmR.mjs.map → migration-_C5W2uXF.mjs.map} +1 -1
- package/dist/{migration-check-DONPyXff-CGTUpLv-.mjs → migration-check-DHYPMUFe-Cni_ZUzB.mjs} +33 -30
- package/dist/migration-check-DHYPMUFe-Cni_ZUzB.mjs.map +1 -0
- package/dist/{migration-check-BDjtAn7x-B0nEBR0k.mjs → migration-check-zgqYe3SB-B6LI6wY7.mjs} +22 -9
- package/dist/migration-check-zgqYe3SB-B6LI6wY7.mjs.map +1 -0
- package/dist/{migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs → migration-command-scaffold-DsT7ke7B-D3u913Po.mjs} +26 -8
- package/dist/migration-command-scaffold-DsT7ke7B-D3u913Po.mjs.map +1 -0
- package/dist/{migration-graph-HKch1Xk4-DyWhXtjZ.mjs → migration-graph-CChCjts3-ERrIm5aT.mjs} +3 -3
- package/dist/{migration-graph-HKch1Xk4-DyWhXtjZ.mjs.map → migration-graph-CChCjts3-ERrIm5aT.mjs.map} +1 -1
- package/dist/{migration-graph-Dn469b0l.mjs → migration-graph-Dm9gU0oE-DxPD_SNA.mjs} +20 -10
- package/dist/migration-graph-Dm9gU0oE-DxPD_SNA.mjs.map +1 -0
- package/dist/{migration-list-C9OPCMt--C28yBgVr.mjs → migration-list-Bkase_ZM-D-bErpSr.mjs} +4 -4
- package/dist/migration-list-Bkase_ZM-D-bErpSr.mjs.map +1 -0
- package/dist/{migration-list-jk4iCtmO.mjs → migration-list-DDGUTC8Y-B_X7rkez.mjs} +19 -9
- package/dist/migration-list-DDGUTC8Y-B_X7rkez.mjs.map +1 -0
- package/dist/{migration-log-DQzUBrm8-D3m9wcuf.mjs → migration-log-Cft50PRu-DcnHdxT4.mjs} +20 -8
- package/dist/migration-log-Cft50PRu-DcnHdxT4.mjs.map +1 -0
- package/dist/{migration-new-BkSY6m0t.mjs → migration-new-D9GHbYwF-C8D22HXG.mjs} +25 -5
- package/dist/migration-new-D9GHbYwF-C8D22HXG.mjs.map +1 -0
- package/dist/{migration-new-g98oB3nC-BcrkxAAt.mjs → migration-new-RorO1I8r-Ch8NQ4GQ.mjs} +19 -18
- package/dist/migration-new-RorO1I8r-Ch8NQ4GQ.mjs.map +1 -0
- package/dist/{migration-path-target-BPYp3LNc-DsDdLU0J.mjs → migration-path-target-DhGt62Mi-dm4TU1hJ.mjs} +4 -4
- package/dist/migration-path-target-DhGt62Mi-dm4TU1hJ.mjs.map +1 -0
- package/dist/{migration-plan-CjIYMJZy.mjs → migration-plan-BOhasCLr-GJWYoOA8.mjs} +25 -5
- package/dist/migration-plan-BOhasCLr-GJWYoOA8.mjs.map +1 -0
- package/dist/{migration-plan-CwuZLXVE-DAJ-JUQT.mjs → migration-plan-DrCTzrXH-CDJbdiC6.mjs} +29 -28
- package/dist/migration-plan-DrCTzrXH-CDJbdiC6.mjs.map +1 -0
- package/dist/{migration-plan-BsOYRogP-CC1UFAbu.d.mts → migration-plan-t2e_8yD2-w5Ffa0V_.d.mts} +10 -5
- package/dist/migration-plan-t2e_8yD2-w5Ffa0V_.d.mts.map +1 -0
- package/dist/{migration-show-CW6EKtfw.mjs → migration-show-DRARjIbv-1p6EE_Uw.mjs} +24 -12
- package/dist/migration-show-DRARjIbv-1p6EE_Uw.mjs.map +1 -0
- package/dist/{migration-status-DSQcBhiN.mjs → migration-status-Yh0eOQJN-YpcPDpNh.mjs} +26 -13
- package/dist/migration-status-Yh0eOQJN-YpcPDpNh.mjs.map +1 -0
- package/dist/migration-tools.d.mts +2 -2
- package/dist/migration-tools.mjs +8 -8
- package/dist/migration-tools__aggregate.d.mts +1 -1
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
- package/dist/migration-tools__io.mjs +1 -1
- package/dist/migration-tools__migration-ts.mjs +1 -1
- package/dist/migration-tools__migration.mjs +1 -1
- package/dist/migration-tools__spaces.d.mts +1 -1
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{migration-ts-FyF55c4M.mjs → migration-ts-BoHxxGvi.mjs} +2 -2
- package/dist/{migration-ts-FyF55c4M.mjs.map → migration-ts-BoHxxGvi.mjs.map} +1 -1
- package/dist/{project-import-root-C_bd0ooL-WkbJLnAA.mjs → project-import-root--e8xli8Z-Bfrvrv67.mjs} +3 -3
- package/dist/project-import-root--e8xli8Z-Bfrvrv67.mjs.map +1 -0
- package/dist/{ref-eJjxzYTh-CNiyDL4p.mjs → ref-BQcl8Ksv-BYZY0Ktb.mjs} +12 -17
- package/dist/ref-BQcl8Ksv-BYZY0Ktb.mjs.map +1 -0
- package/dist/{ref-DSAZime8.mjs → ref-Cu7Zc1Hv-_R4MnDfr.mjs} +30 -7
- package/dist/ref-Cu7Zc1Hv-_R4MnDfr.mjs.map +1 -0
- package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs} +3 -3
- package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs.map → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs.map} +1 -1
- package/dist/{ref-resolution-_S4xTT2L-BE5zgO2W.mjs → ref-resolution-BYCRg72z-DFhwf-XR.mjs} +3 -3
- package/dist/ref-resolution-BYCRg72z-DFhwf-XR.mjs.map +1 -0
- package/dist/{spaces-DxuvClN9.mjs → spaces-DBTCE3Js.mjs} +6 -6
- package/dist/{spaces-DxuvClN9.mjs.map → spaces-DBTCE3Js.mjs.map} +1 -1
- package/dist/{spaces-D5qtTlhj.d.mts → spaces-tWQi7CUv.d.mts} +2 -2
- package/dist/{spaces-D5qtTlhj.d.mts.map → spaces-tWQi7CUv.d.mts.map} +1 -1
- package/dist/{telemetry-DVBHDQd6-Ckn5oClN.mjs → telemetry-Dh6e0ams-BsjGN3tQ.mjs} +5 -4
- package/dist/telemetry-Dh6e0ams-BsjGN3tQ.mjs.map +1 -0
- package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs +645 -0
- package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map +1 -0
- package/dist/{verify-C6L_hiJU-B4V3bqvG.mjs → verify-DBsKxZrK-eDPxNiSS.mjs} +3 -3
- package/dist/verify-DBsKxZrK-eDPxNiSS.mjs.map +1 -0
- package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs} +2 -2
- package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs.map → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +16 -4
- package/dist/vite-plugin-contract-emit.mjs.map +1 -1
- package/package.json +14 -12
- package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs.map +0 -1
- package/dist/client-Y6qbDk7X-BzKLmBZo.mjs.map +0 -1
- package/dist/command-helpers-C4WpR-QE-DE494TSG.mjs +0 -1627
- package/dist/command-helpers-C4WpR-QE-DE494TSG.mjs.map +0 -1
- package/dist/contract-at-errors-Dv1mxKYO-C29YB4RC.mjs.map +0 -1
- package/dist/contract-emit-B65_UiFn.d.mts.map +0 -1
- package/dist/contract-emit-CTm2zfuG-7PV9SBY6.mjs.map +0 -1
- package/dist/contract-emit-D8IXP9Qp-Df6NwXn8.mjs.map +0 -1
- package/dist/contract-infer-BwT7ngoo-Dx6aAwIN.mjs.map +0 -1
- package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs.map +0 -1
- package/dist/db-init-CBj_EWg3.mjs.map +0 -1
- package/dist/db-schema-BWpeh0Q_.mjs.map +0 -1
- package/dist/db-sign-DCb_DKtv.mjs.map +0 -1
- package/dist/db-update-WX0KitcX.mjs.map +0 -1
- package/dist/db-verify-B8ax2Y_x-Bp4s5Ra6.mjs.map +0 -1
- package/dist/exports-BnihzVhw.mjs.map +0 -1
- package/dist/exports-CDX9kZuw.mjs +0 -119
- package/dist/exports-CDX9kZuw.mjs.map +0 -1
- package/dist/format-Bw3LVJ1v-BJ6lVFMA.mjs.map +0 -1
- package/dist/framework-components-3DdB31mk-BHyX-OlJ.mjs.map +0 -1
- package/dist/index-Df9igRvP.d.mts +0 -18
- package/dist/index-Df9igRvP.d.mts.map +0 -1
- package/dist/init-CPB89WK2-DPZRZ9Ee.mjs.map +0 -1
- package/dist/inspect-live-schema-Da76TWOs-CAFqkhGb.mjs.map +0 -1
- package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs.map +0 -1
- package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs.map +0 -1
- package/dist/migrate-B-NAuO90.mjs.map +0 -1
- package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts.map +0 -1
- package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs.map +0 -1
- package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs.map +0 -1
- package/dist/migration-check-DONPyXff-CGTUpLv-.mjs.map +0 -1
- package/dist/migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs.map +0 -1
- package/dist/migration-graph-Dn469b0l.mjs.map +0 -1
- package/dist/migration-list-C9OPCMt--C28yBgVr.mjs.map +0 -1
- package/dist/migration-list-jk4iCtmO.mjs.map +0 -1
- package/dist/migration-log-DQzUBrm8-D3m9wcuf.mjs.map +0 -1
- package/dist/migration-new-BkSY6m0t.mjs.map +0 -1
- package/dist/migration-new-g98oB3nC-BcrkxAAt.mjs.map +0 -1
- package/dist/migration-path-target-BPYp3LNc-DsDdLU0J.mjs.map +0 -1
- package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts.map +0 -1
- package/dist/migration-plan-CjIYMJZy.mjs.map +0 -1
- package/dist/migration-plan-CwuZLXVE-DAJ-JUQT.mjs.map +0 -1
- package/dist/migration-show-CW6EKtfw.mjs.map +0 -1
- package/dist/migration-status-DSQcBhiN.mjs.map +0 -1
- package/dist/project-import-root-C_bd0ooL-WkbJLnAA.mjs.map +0 -1
- package/dist/ref-DSAZime8.mjs.map +0 -1
- package/dist/ref-eJjxzYTh-CNiyDL4p.mjs.map +0 -1
- package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs.map +0 -1
- package/dist/telemetry-DVBHDQd6-Ckn5oClN.mjs.map +0 -1
- package/dist/verify-C6L_hiJU-B4V3bqvG.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-ui-ypPE9cN6-ilMBkmwT.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/terminal-ui-ypPE9cN6.mjs"],"sourcesContent":["import { bold, cyan, dim, green, red, yellow } from \"colorette\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport * as clack from \"@clack/prompts\";\n//#region src/utils/formatters/helpers.ts\n/**\n* Checks if verbose output is enabled at the specified level.\n*/\nfunction isVerbose(flags, level) {\n\treturn (flags.verbose ?? 0) >= level;\n}\n/**\n* Creates a color-aware formatter function.\n* Returns a function that applies the color only if colors are enabled.\n*/\nfunction createColorFormatter(useColor, colorFn) {\n\treturn useColor ? colorFn : (text) => text;\n}\n/**\n* Formats text with dim styling if colors are enabled.\n*/\nfunction formatDim(useColor, text) {\n\treturn useColor ? dim(text) : text;\n}\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\nfunction formatPlannerWarningsBlock(warnings, useColor) {\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [\"\", \"Warnings:\"];\n\tfor (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);\n\treturn lines;\n}\n/**\n* Render the shared per-space execution block consumed by the `db init`\n* / `db update` / `migrate` summaries. Always shows: space\n* label (`Extension space: <id>` or `App space`) → per-op lines under\n* each space → per-space marker hash (when known).\n*\n* `mode` controls the marker label phrasing — `'apply'` shows\n* `marker → <hash>` (post-apply), `'plan'` omits the marker line\n* entirely (no marker has been written yet).\n*/\nfunction formatPerSpaceBlock(perSpace, mode, useColor) {\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatCyan = createColorFormatter(useColor, cyan);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tfor (let s = 0; s < perSpace.length; s++) {\n\t\tconst space = perSpace[s];\n\t\tif (s > 0) lines.push(\"\");\n\t\tconst header = space.kind === \"app\" ? formatCyan(\"App space\") : formatCyan(`Extension space: ${space.spaceId}`);\n\t\tlines.push(header);\n\t\tif (space.operations.length === 0) lines.push(` ${formatDimText(\"(no operations)\")}`);\n\t\telse for (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (mode === \"apply\" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in plan mode.\n*/\nfunction formatMigrationPlanOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst operationCount = result.plan?.operations.length ?? 0;\n\tconst spaceCount = result.perSpace?.length ?? 0;\n\tif (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\telse lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s)`);\n\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tif (result.perSpace && result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"plan\", useColor));\n\t\tif (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === \"destructive\"))) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t} else if (result.plan?.operations && result.plan.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < result.plan.operations.length; i++) {\n\t\t\tconst op = result.plan.operations[i];\n\t\t\tif (!op) continue;\n\t\t\tconst treeChar = i === result.plan.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (result.plan.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (result.plan?.destination) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);\n\t}\n\tif (result.plannedAdvanceRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Would advance ref \"${result.plannedAdvanceRef.name}\" → ${result.plannedAdvanceRef.hash}`));\n\t}\n\tconst preview = result.plan?.preview;\n\tif (preview) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(preview))}`);\n\t\tif (preview.statements.length === 0) lines.push(`${formatDimText(\"No operations.\")}`);\n\t\telse {\n\t\t\tlines.push(\"\");\n\t\t\tfor (const statement of preview.statements) {\n\t\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\t\tif (rendered) lines.push(rendered);\n\t\t\t}\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);\n\tlines.push(\"\");\n\tlines.push(`${formatDimText(\"This is a dry run. No changes were applied.\")}`);\n\tlines.push(`${formatDimText(\"Run without --dry-run to apply changes.\")}`);\n\treturn lines.join(\"\\n\");\n}\nfunction formatMigrationApplyCommandOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tif (result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tfor (const line of formatPerSpaceBlock(result.perSpace, \"apply\", useColor)) lines.push(line);\n\t}\n\tif (result.advancedRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\tlines.push(\"\");\n\tlines.push(formatDimText(\"Next: prisma-next migration status\"));\n\tif (isVerbose(flags, 1) && result.timings) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Total time: ${result.timings.total}ms`));\n\t}\n\treturn lines.join(\"\\n\");\n}\nfunction formatSpaceShowBlock(space, useColor) {\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tlines.push(`${formatGreen(\"✔\")} ${space.name}`);\n\tlines.push(`${formatDimText(` from: ${space.fromContract ?? \"(baseline)\"}`)}`);\n\tlines.push(`${formatDimText(` to: ${space.toContract}`)}`);\n\tlines.push(`${formatDimText(` hash: ${space.hash}`)}`);\n\tlines.push(`${formatDimText(` created: ${space.createdAt}`)}`);\n\tlines.push(\"\");\n\tlines.push(`${space.operations.length} operation(s)`);\n\tif (space.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (space.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (space.preview.statements.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(space.preview))}`);\n\t\tlines.push(\"\");\n\t\tfor (const statement of space.preview.statements) {\n\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\tif (rendered) lines.push(rendered);\n\t\t}\n\t}\n\treturn lines;\n}\nfunction formatMigrationShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst useColor = flags.color !== false;\n\treturn formatSpaceShowBlock(result.migration, useColor).join(\"\\n\");\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in apply mode.\n*/\nfunction formatMigrationApplyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tconst executed = result.execution?.operationsExecuted ?? 0;\n\t\tconst spaceCount = result.perSpace?.length ?? 0;\n\t\tif (executed === 0) {\n\t\t\tconst acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}` : \"\";\n\t\t\tlines.push(`${formatGreen(\"✔\")} Database already matches contract${acrossClause}`);\n\t\t} else if (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\t\telse lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s)`);\n\t\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\t\tif (result.perSpace && result.perSpace.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"apply\", useColor));\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? \"the space is\" : \"all spaces are\"} up to date.`));\n\t\t} else if (result.marker) {\n\t\t\tlines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);\n\t\t\tif (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);\n\t\t}\n\t\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\tif (result.advancedRef) lines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for migration commands (db init, db update).\n*/\nfunction formatMigrationJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\n//#region src/utils/formatters/errors.ts\n/**\n* The display label for a schema-diff issue in the shared error envelope,\n* derived from which sides are present: expected-only is a missing object,\n* actual-only an extra one, both a mismatch. `undefined` when the entry is not\n* a schema-diff issue (it carries neither side) so the caller can fall through\n* to its generic label.\n*/\nfunction schemaDiffIssueLabel(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"mismatch\";\n\tif (hasExpected) return \"missing\";\n\tif (hasActual) return \"extra\";\n}\n/**\n* Formats error output for human-readable display.\n*/\nfunction formatErrorOutput(error, flags) {\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatRed(\"✖\")} ${error.summary} (${error.code})`);\n\tif (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);\n\tif (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);\n\tif (error.where?.path) {\n\t\tconst whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;\n\t\tlines.push(`${formatDimText(` Where: ${whereLine}`)}`);\n\t}\n\tif (error.meta?.[\"conflicts\"]) {\n\t\tconst conflicts = error.meta[\"conflicts\"];\n\t\tif (conflicts.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Conflicts:\" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);\n\t\t\tif (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all conflicts\")}`);\n\t\t}\n\t}\n\tif (error.meta?.[\"issues\"]) {\n\t\tconst issues = error.meta[\"issues\"];\n\t\tif (issues.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Issues:\" : ` Issues (showing ${maxToShow} of ${issues.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const issue of issues.slice(0, maxToShow)) {\n\t\t\t\tconst label = issue.kind ?? schemaDiffIssueLabel(issue) ?? \"issue\";\n\t\t\t\tconst message = issue.message ?? issue.path?.join(\"/\") ?? \"\";\n\t\t\t\tlines.push(`${formatDimText(` - [${label}] ${message}`)}`);\n\t\t\t}\n\t\t\tif (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all issues\")}`);\n\t\t}\n\t}\n\tif (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));\n\tconst plannerWarnings = error.meta?.[\"plannerWarnings\"];\n\tif (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {\n\t\tconst typedWarnings = blindCast(plannerWarnings);\n\t\tlines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));\n\t}\n\tif (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats error output as JSON.\n*/\nfunction formatErrorJson(error) {\n\treturn JSON.stringify(error, null, 2);\n}\n//#endregion\n//#region src/utils/glyph-mode.ts\nfunction localeString(env) {\n\treturn env[\"LC_ALL\"] ?? env[\"LC_CTYPE\"] ?? env[\"LANG\"] ?? \"\";\n}\nfunction isUtf8Locale(env) {\n\tconst locale = localeString(env);\n\tif (locale.length === 0) return false;\n\treturn /UTF-8|utf8/i.test(locale);\n}\nfunction detectGlyphMode(input) {\n\tif (!input.isTTY) return \"ascii\";\n\tif (!isUtf8Locale(input.env)) return \"ascii\";\n\treturn \"unicode\";\n}\n//#endregion\n//#region src/utils/shutdown.ts\nfunction createShutdownHandler(options) {\n\tconst exit = options?.exit ?? ((code) => process.exit(code));\n\tconst gracePeriodMs = options?.gracePeriodMs ?? 3e3;\n\tconst controller = new AbortController();\n\tlet shuttingDown = false;\n\tlet graceTimer;\n\tconst onSignal = () => {\n\t\tif (shuttingDown) {\n\t\t\texit(130);\n\t\t\treturn;\n\t\t}\n\t\tshuttingDown = true;\n\t\tcontroller.abort();\n\t\tgraceTimer = setTimeout(() => exit(130), gracePeriodMs);\n\t\tgraceTimer.unref();\n\t};\n\treturn {\n\t\tsignal: controller.signal,\n\t\tisShuttingDown: () => shuttingDown,\n\t\tonSignal,\n\t\tclearGraceTimer: () => {\n\t\t\tif (graceTimer !== void 0) {\n\t\t\t\tclearTimeout(graceTimer);\n\t\t\t\tgraceTimer = void 0;\n\t\t\t}\n\t\t}\n\t};\n}\nconst globalHandler = createShutdownHandler();\n/**\n* The global AbortSignal. Pass this to any async operation that should\n* be cancellable on Ctrl+C (e.g., DB queries, long-running emit).\n*/\nconst shutdownSignal = globalHandler.signal;\n/**\n* Installs SIGINT and SIGTERM handlers. Call once at CLI startup.\n*\n* - First signal: aborts the controller, starts a 3s grace timer.\n* - Second signal: force-exits immediately.\n*/\nlet installed = false;\nfunction installShutdownHandlers() {\n\tif (installed) return;\n\tinstalled = true;\n\tprocess.on(\"SIGINT\", globalHandler.onSignal);\n\tprocess.on(\"SIGTERM\", globalHandler.onSignal);\n}\n//#endregion\n//#region src/utils/terminal-ui.ts\n/**\n* Composable CLI output abstraction.\n*\n* Follows the Unix convention of separating data from decoration:\n* - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.\n* - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.\n*\n* Rules:\n* 1. All methods except `output()` and `error()` write to stderr only in interactive mode.\n* 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.\n* 3. `error()` always writes to stderr — errors matter even when piped.\n* 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).\n* 5. Never write data to stderr — decoration methods are for human context only.\n* 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.\n*/\nvar TerminalUI = class TerminalUI {\n\t/**\n\t* True when stdout is a TTY (interactive terminal).\n\t* False when piped (e.g., `prisma-next db verify | jq`).\n\t*/\n\tisInteractive;\n\t/**\n\t* Whether color output is enabled.\n\t*/\n\tuseColor;\n\t/**\n\t* When true, decoration methods write even on non-TTY stdout\n\t* (explicit `--format pretty`).\n\t*/\n\tforcePretty;\n\t/**\n\t* Whether stdout is a TTY — used for migration-list graph glyph detection.\n\t*/\n\tstdoutIsTTY;\n\t/**\n\t* Process environment snapshot for locale-aware glyph detection.\n\t*/\n\tenv;\n\tstatic stderrOpts = { output: process.stderr };\n\tconstructor(options) {\n\t\tthis.isInteractive = options?.interactive ?? !!process.stdout.isTTY;\n\t\tthis.forcePretty = options?.forcePretty ?? false;\n\t\tthis.useColor = options?.color ?? (this.isInteractive || this.forcePretty);\n\t\tthis.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;\n\t\tthis.env = options?.env ?? process.env;\n\t}\n\tget isTTY() {\n\t\treturn this.stdoutIsTTY;\n\t}\n\t/**\n\t* Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;\n\t* otherwise delegates to the pure {@link detectGlyphMode} helper.\n\t*/\n\tresolveGlyphMode(forceAscii) {\n\t\tif (forceAscii) return \"ascii\";\n\t\treturn detectGlyphMode(this.glyphModeInput());\n\t}\n\tglyphModeInput() {\n\t\treturn {\n\t\t\tisTTY: this.stdoutIsTTY,\n\t\t\tenv: this.env\n\t\t};\n\t}\n\tget shouldDecorate() {\n\t\treturn this.isInteractive || this.forcePretty;\n\t}\n\t/**\n\t* Log a message line to stderr. No-op when piped unless forcePretty.\n\t*/\n\tlog(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.message(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a success message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tsuccess(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.success(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a warning message to stderr. No-op when piped unless forcePretty.\n\t*/\n\twarn(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.warn(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an error message to stderr. Always writes (errors matter even in pipes).\n\t*/\n\terror(message) {\n\t\tclack.log.error(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an info message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tinfo(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.info(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a step message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tstep(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.step(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display a note box on stderr. No-op when piped unless forcePretty.\n\t*/\n\tnote(message, title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.note(message, title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display intro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\tintro(title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.intro(title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display outro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\toutro(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.outro(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Create a Clack spinner on stderr with a 100ms delay threshold.\n\t* The spinner only appears if the operation takes longer than the threshold,\n\t* avoiding flicker for fast operations. Returns a no-op spinner when not decorating.\n\t*/\n\tspinner(delayMs = 100) {\n\t\tconst noop = {\n\t\t\tstart: () => {},\n\t\t\tstop: () => {},\n\t\t\tcancel: () => {},\n\t\t\terror: () => {},\n\t\t\tmessage: () => {},\n\t\t\tclear: () => {},\n\t\t\tget isCancelled() {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\tif (!this.shouldDecorate) return noop;\n\t\tlet inner;\n\t\tlet timer;\n\t\tlet pendingMsg;\n\t\tlet settled = false;\n\t\tconst ensureCleared = () => {\n\t\t\tif (timer !== void 0) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t};\n\t\tconst onAbort = () => {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(\"Interrupted\");\n\t\t\t}\n\t\t};\n\t\tif (!shutdownSignal.aborted) shutdownSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\treturn {\n\t\t\tstart(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tif (!settled) {\n\t\t\t\t\t\tinner = clack.spinner(TerminalUI.stderrOpts);\n\t\t\t\t\t\tinner.start(pendingMsg);\n\t\t\t\t\t}\n\t\t\t\t}, delayMs);\n\t\t\t},\n\t\t\tstop(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.stop(msg);\n\t\t\t},\n\t\t\tcancel(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(msg);\n\t\t\t},\n\t\t\terror(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.error(msg);\n\t\t\t},\n\t\t\tmessage(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\tif (inner) inner.message(msg);\n\t\t\t},\n\t\t\tclear() {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.clear();\n\t\t\t},\n\t\t\tget isCancelled() {\n\t\t\t\treturn inner?.isCancelled ?? false;\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Prompt for yes/no confirmation on stderr. Returns true if confirmed.\n\t* In non-interactive mode or when cancelled (Ctrl-C), returns false.\n\t*/\n\tasync confirm(message) {\n\t\tif (!this.isInteractive) return false;\n\t\tconst result = await clack.confirm({\n\t\t\tmessage,\n\t\t\t...TerminalUI.stderrOpts\n\t\t});\n\t\tif (clack.isCancel(result)) return false;\n\t\treturn result;\n\t}\n\t/**\n\t* Write a raw line to stderr. No-op when piped unless forcePretty.\n\t* Use for decoration that doesn't fit Clack's log format (e.g. styled headers).\n\t*/\n\tstderr(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tprocess.stderr.write(`${message}\\n`);\n\t}\n\t/**\n\t* Write machine-readable data to stdout.\n\t* Always writes — if a command calls output(), there is data to emit.\n\t*\n\t* This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`\n\t*/\n\toutput(data) {\n\t\tprocess.stdout.write(`${data}\\n`);\n\t}\n\tgreen(text) {\n\t\treturn this.useColor ? green(text) : text;\n\t}\n\tred(text) {\n\t\treturn this.useColor ? red(text) : text;\n\t}\n\tcyan(text) {\n\t\treturn this.useColor ? cyan(text) : text;\n\t}\n\tdim(text) {\n\t\treturn this.useColor ? dim(text) : text;\n\t}\n\tbold(text) {\n\t\treturn this.useColor ? bold(text) : text;\n\t}\n\tyellow(text) {\n\t\treturn this.useColor ? yellow(text) : text;\n\t}\n};\nfunction createTerminalUI(flags, runtime) {\n\treturn new TerminalUI({\n\t\tcolor: flags.color,\n\t\tinteractive: flags.interactive,\n\t\tforcePretty: flags.format === \"pretty\" && flags.explicitFormat,\n\t\tstdoutIsTTY: runtime?.isTTY,\n\t\tenv: runtime?.env\n\t});\n}\n//#endregion\nexport { formatMigrationApplyCommandOutput as a, formatMigrationPlanOutput as c, formatDim as d, isVerbose as f, formatErrorOutput as i, formatMigrationShowOutput as l, installShutdownHandlers as n, formatMigrationApplyOutput as o, formatErrorJson as r, formatMigrationJson as s, createTerminalUI as t, createColorFormatter as u };\n\n//# sourceMappingURL=terminal-ui-ypPE9cN6.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,UAAU,OAAO,OAAO;CAChC,QAAQ,MAAM,WAAW,MAAM;AAChC;;;;;AAKA,SAAS,qBAAqB,UAAU,SAAS;CAChD,OAAO,WAAW,WAAW,SAAS;AACvC;;;;AAIA,SAAS,UAAU,UAAU,MAAM;CAClC,OAAO,WAAW,IAAI,IAAI,IAAI;AAC/B;;;;;;;AASA,SAAS,uBAAuB,MAAM,UAAU;CAC/C,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,SAAS,OAAO,KAAK;CAC1B,IAAI,aAAa,OAAO,OAAO,QAAQ,SAAS,GAAG,IAAI,UAAU,GAAG,QAAQ;CAC5E,OAAO;AACR;;;;;;;;;;;;;AAaA,SAAS,mBAAmB,SAAS;CACpC,OAAO,QAAQ,WAAW,SAAS,KAAK,QAAQ,WAAW,OAAO,MAAM,EAAE,aAAa,KAAK,IAAI,gBAAgB;AACjH;AACA,SAAS,2BAA2B,UAAU,UAAU;CACvD,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,MAAM,QAAQ,CAAC,IAAI,WAAW;CAC9B,KAAK,MAAM,WAAW,UAAU,MAAM,KAAK,KAAK,cAAc,KAAK,QAAQ,SAAS,GAAG;CACvF,OAAO;AACR;;;;;;;;;;;AAWA,SAAS,oBAAoB,UAAU,MAAM,UAAU;CACtD,MAAM,eAAe,qBAAqB,UAAU,MAAM;CAC1D,MAAM,aAAa,qBAAqB,UAAU,IAAI;CACtD,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,MAAM,QAAQ,CAAC;CACf,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACzC,MAAM,QAAQ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AAM;EACT,OAAO,KAAK,WAAW,IAAI,IAAI,IAAI;CACpC;CACA,KAAK,MAAM;EACV,OAAO,KAAK,WAAW,KAAK,IAAI,IAAI;CACrC;CACA,IAAI,MAAM;EACT,OAAO,KAAK,WAAW,IAAI,IAAI,IAAI;CACpC;CACA,KAAK,MAAM;EACV,OAAO,KAAK,WAAW,KAAK,IAAI,IAAI;CACrC;CACA,OAAO,MAAM;EACZ,OAAO,KAAK,WAAW,OAAO,IAAI,IAAI;CACvC;AACD;AACA,SAAS,iBAAiB,OAAO,SAAS;CACzC,OAAO,IAAI,WAAW;EACrB,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,aAAa,MAAM,WAAW,YAAY,MAAM;EAChD,aAAa,SAAS;EACtB,KAAK,SAAS;CACf,CAAC;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as isVerbose, r as formatDim, t as createColorFormatter } from "./terminal-ui-ypPE9cN6-ilMBkmwT.mjs";
|
|
2
2
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
3
|
import { issueOutcome } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { bold, cyan, dim, green, magenta, red, yellow } from "colorette";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/verify-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/verify-DBsKxZrK.mjs
|
|
6
6
|
/** Human-readable label for each outcome, prefixed onto an issue's message for display. */
|
|
7
7
|
const OUTCOME_LABEL = {
|
|
8
8
|
"not-found": "missing",
|
|
@@ -280,4 +280,4 @@ function formatSignJson(result) {
|
|
|
280
280
|
//#endregion
|
|
281
281
|
export { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };
|
|
282
282
|
|
|
283
|
-
//# sourceMappingURL=verify-
|
|
283
|
+
//# sourceMappingURL=verify-DBsKxZrK-eDPxNiSS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-DBsKxZrK-eDPxNiSS.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/verify-DBsKxZrK.mjs"],"sourcesContent":["import { d as formatDim, f as isVerbose, u as createColorFormatter } from \"./terminal-ui-ypPE9cN6.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { bold, cyan, dim, green, magenta, red, yellow } from \"colorette\";\n//#region src/utils/formatters/verify.ts\n/** Human-readable label for each outcome, prefixed onto an issue's message for display. */\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/**\n* The issue's display text: its own path, prefixed with a human label for\n* why it's flagged. Turning the presence-derived outcome (and the path) into\n* prose is this formatter's job, not the differ's — the differ's issue is\n* data (`path` + nodes), not prose.\n*/\nfunction formatIssueMessage(issue) {\n\treturn `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n}\n/**\n* Formats human-readable output for database verify.\n*/\nfunction formatVerifyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst verificationMode = result.mode === \"full\" ? `marker + schema${result.schema?.strict ? \" (strict)\" : \" (tolerant)\"}` : \"marker only (--marker-only)\";\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tlines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n\tlines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\tif (result.schema?.warnings && result.schema.warnings.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of result.schema.warnings) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (result.unclaimed && result.unclaimed.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of result.unclaimed) lines.push(` ${formatYellow(\"⚠\")} ${name}`);\n\t}\n\tif (result.warning) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatYellow(\"⚠\")} ${result.warning}`);\n\t}\n\tif (isVerbose(flags, 1)) {\n\t\tif (result.codecCoverageSkipped) lines.push(`${formatDimText(\" Codec coverage check skipped (helper returned no supported types)\")}`);\n\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database verify.\n*/\nfunction formatVerifyJson(result) {\n\tconst output = {\n\t\tok: result.ok,\n\t\tsummary: result.summary,\n\t\tmode: result.mode,\n\t\tcontract: result.contract,\n\t\t...ifDefined(\"marker\", result.marker),\n\t\ttarget: result.target,\n\t\t...ifDefined(\"missingCodecs\", result.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", result.codecCoverageSkipped),\n\t\t...ifDefined(\"schema\", result.schema),\n\t\tunclaimed: result.unclaimed ?? [],\n\t\t...ifDefined(\"warning\", result.warning),\n\t\t...ifDefined(\"meta\", result.meta),\n\t\ttimings: result.timings\n\t};\n\treturn JSON.stringify(output, null, 2);\n}\n/**\n* Formats JSON output for database introspection.\n*/\nfunction formatIntrospectJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n/**\n* Renders a schema tree structure from CoreSchemaView.\n* Status-glyph tree styling shared with the retired verification-tree renderer.\n*/\nfunction renderSchemaTree(node, flags, options) {\n\tconst { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n\tconst lines = [];\n\tlet formattedLabel = node.label;\n\tif (useColor) switch (node.kind) {\n\t\tcase \"root\":\n\t\t\tformattedLabel = bold(node.label);\n\t\t\tbreak;\n\t\tcase \"entity\": {\n\t\t\tconst tableMatch = node.label.match(/^table\\s+(.+)$/);\n\t\t\tif (tableMatch?.[1]) {\n\t\t\t\tconst tableName = tableMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"table\")} ${cyan(tableName)}`;\n\t\t\t} else formattedLabel = cyan(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"collection\":\n\t\t\tformattedLabel = dim(node.label);\n\t\t\tbreak;\n\t\tcase \"field\": {\n\t\t\tconst columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n\t\t\tif (columnMatch?.[1] && columnMatch[2]) {\n\t\t\t\tconst columnName = columnMatch[1];\n\t\t\t\tconst rest = columnMatch[2];\n\t\t\t\tconst typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n\t\t\t\tif (typeMatch?.[1] && typeMatch[2]) {\n\t\t\t\t\tconst typeDisplay = typeMatch[1];\n\t\t\t\t\tconst nullability = typeMatch[2];\n\t\t\t\t\tformattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n\t\t\t\t} else formattedLabel = `${cyan(columnName)}: ${rest}`;\n\t\t\t} else formattedLabel = node.label;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"index\": {\n\t\t\tconst pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n\t\t\tif (pkMatch?.[1]) {\n\t\t\t\tconst columnNames = pkMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"primary key\")}: ${cyan(columnNames)}`;\n\t\t\t} else {\n\t\t\t\tconst uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n\t\t\t\tif (uniqueMatch?.[1]) {\n\t\t\t\t\tconst name = uniqueMatch[1];\n\t\t\t\t\tformattedLabel = `${dim(\"unique\")} ${cyan(name)}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n\t\t\t\t\tif (indexMatch?.[2]) {\n\t\t\t\t\t\tconst indexPrefix = indexMatch[1] ? `${dim(\"unique\")} ` : \"\";\n\t\t\t\t\t\tconst name = indexMatch[2];\n\t\t\t\t\t\tformattedLabel = `${indexPrefix}${dim(\"index\")} ${cyan(name)}`;\n\t\t\t\t\t} else formattedLabel = dim(node.label);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"dependency\": {\n\t\t\tconst extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n\t\t\tif (extMatch?.[1] && extMatch[2]) {\n\t\t\t\tconst extName = extMatch[1];\n\t\t\t\tconst rest = extMatch[2];\n\t\t\t\tformattedLabel = `${cyan(extName)} ${dim(rest)}`;\n\t\t\t} else formattedLabel = magenta(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tformattedLabel = node.label;\n\t\t\tbreak;\n\t}\n\tif (isRoot) lines.push(formattedLabel);\n\telse {\n\t\tconst treePrefix = `${formatDimText(isLast ? \"└\" : \"├\")}─ `;\n\t\tlines.push(`${prefix}${treePrefix}${formattedLabel}`);\n\t}\n\tif (node.children && node.children.length > 0) {\n\t\tconst childPrefix = isRoot ? \"\" : `${prefix}${isLast ? \" \" : `${formatDimText(\"│\")} `}`;\n\t\tfor (let i = 0; i < node.children.length; i++) {\n\t\t\tconst child = node.children[i];\n\t\t\tif (!child) continue;\n\t\t\tconst childLines = renderSchemaTree(child, flags, {\n\t\t\t\tisLast: i === node.children.length - 1,\n\t\t\t\tprefix: childPrefix,\n\t\t\t\tuseColor,\n\t\t\t\tformatDimText,\n\t\t\t\tisRoot: false\n\t\t\t});\n\t\t\tlines.push(...childLines);\n\t\t}\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for database introspection.\n*/\nfunction formatIntrospectOutput(result, schemaView, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (schemaView) {\n\t\tconst treeLines = renderSchemaTree(schemaView.root, flags, {\n\t\t\tisLast: true,\n\t\t\tprefix: \"\",\n\t\t\tuseColor,\n\t\t\tformatDimText,\n\t\t\tisRoot: true\n\t\t});\n\t\tlines.push(...treeLines);\n\t} else {\n\t\tlines.push(`✔ ${result.summary}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tlines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n\t\t\tif (result.meta?.dbUrl) lines.push(` Database: ${result.meta.dbUrl}`);\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats human-readable output for database schema verification.\n*/\nfunction formatSchemaVerifyOutput(result, flags, unclaimed = []) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst issueMessages = result.schema.issues.map(formatIssueMessage);\n\tif (issueMessages.length > 0) {\n\t\tlines.push(formatRed(\"Schema issues:\"));\n\t\tfor (const message of issueMessages) lines.push(` ${formatRed(\"✖\")} ${message}`);\n\t}\n\tconst warningMessages = (result.schema.warnings?.issues ?? []).map(formatIssueMessage);\n\tif (warningMessages.length > 0) {\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of warningMessages) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (unclaimed.length > 0) {\n\t\tconst strict = result.meta?.strict ?? false;\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push((strict ? formatRed : formatYellow)(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of unclaimed) lines.push(` ${(strict ? formatRed : formatYellow)(strict ? \"✖\" : \"⚠\")} ${name}`);\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\tif (lines.length > 0) lines.push(\"\");\n\tif (result.ok) lines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\telse {\n\t\tconst codeText = result.code ? ` (${result.code})` : \"\";\n\t\tlines.push(`${formatRed(\"✖\")} ${result.summary}${codeText}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database schema verification. The unclaimed-elements\n* list is a top-level field alongside the combined result, reported once for\n* the whole database.\n*/\nfunction formatSchemaVerifyJson(result, unclaimed = []) {\n\treturn JSON.stringify({\n\t\t...result,\n\t\tunclaimed\n\t}, null, 2);\n}\n/**\n* Formats human-readable output for database sign.\n*/\nfunction formatSignOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tlines.push(`${formatGreen(\"✔\")} Database signed`);\n\t\tconst previousHash = result.marker.previous?.storageHash ?? \"none\";\n\t\tconst currentHash = result.contract.storageHash;\n\t\tlines.push(`${formatDimText(` from: ${previousHash}`)}`);\n\t\tlines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\t\t\tif (result.marker.previous?.profileHash) lines.push(`${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`);\n\t\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database sign.\n*/\nfunction formatSignJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\nexport { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };\n\n//# sourceMappingURL=verify-DBsKxZrK.mjs.map"],"mappings":";;;;;;AAMA,MAAM,gBAAgB;CACrB,aAAa;CACb,gBAAgB;CAChB,aAAa;AACd;;;;;;;AAOA,SAAS,mBAAmB,OAAO;CAClC,OAAO,GAAG,cAAc,aAAa,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,GAAG;AACrE;;;;AAIA,SAAS,mBAAmB,QAAQ,OAAO;CAC1C,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,QAAQ,CAAC;CACf,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,KAAK;CACxD,MAAM,eAAe,qBAAqB,UAAU,MAAM;CAC1D,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,MAAM,mBAAmB,OAAO,SAAS,SAAS,kBAAkB,OAAO,QAAQ,SAAS,cAAc,kBAAkB;CAC5H,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,GAAG,OAAO,SAAS;CAClD,MAAM,KAAK,GAAG,cAAc,mBAAmB,kBAAkB,GAAG;CACpE,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAC9E,IAAI,OAAO,SAAS,aAAa,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAC/G,IAAI,OAAO,QAAQ,YAAY,OAAO,OAAO,SAAS,SAAS,GAAG;EACjE,MAAM,KAAK,EAAE;EACb,MAAM,KAAK,aAAa,kBAAkB,CAAC;EAC3C,KAAK,MAAM,WAAW,OAAO,OAAO,UAAU,MAAM,KAAK,KAAK,aAAa,GAAG,EAAE,GAAG,SAAS;CAC7F;CACA,IAAI,OAAO,aAAa,OAAO,UAAU,SAAS,GAAG;EACpD,MAAM,KAAK,EAAE;EACb,MAAM,K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B,IAAI,OAAO,SAAS,aAAa,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;GAC/G,IAAI,OAAO,OAAO,UAAU,aAAa,MAAM,KAAK,GAAG,cAAc,2BAA2B,OAAO,OAAO,SAAS,aAAa,GAAG;GACvI,MAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,GAAG,GAAG;EACzE;CACD;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;;;;AAIA,SAAS,eAAe,QAAQ;CAC/B,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from "./errors-Co-8oaiB-CB-6Uqki.mjs";
|
|
2
|
-
import { t as MANIFEST_FILE } from "./io-CHUUeHh0-
|
|
2
|
+
import { t as MANIFEST_FILE } from "./io-CHUUeHh0-CbyTkKP6.mjs";
|
|
3
3
|
import { join } from "pathe";
|
|
4
4
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
5
5
|
import { APP_SPACE_ID as APP_SPACE_ID$1, CONTRACT_SNAPSHOTS_DIRNAME } from "@prisma/orm-framework/components/control";
|
|
@@ -249,4 +249,4 @@ function verifyContractSpaces(inputs) {
|
|
|
249
249
|
//#endregion
|
|
250
250
|
export { isValidSpaceId as a, spaceMigrationDirectory as c, assertValidSpaceId as i, spaceRefsDirectory as l, RESERVED_SPACE_SUBDIR_NAMES as n, listContractSpaceDirectories as o, SPACE_REFS_DIRNAME as r, readContractSpaceHeadRef as s, APP_SPACE_ID$1 as t, verifyContractSpaces as u };
|
|
251
251
|
|
|
252
|
-
//# sourceMappingURL=verify-contract-spaces-WvjSiWcB-
|
|
252
|
+
//# sourceMappingURL=verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs","names":["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-WvjSiWcB.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-Co-8oaiB.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-CHUUeHh0.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`prisma-next migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`prisma-next db update\\` to advance the database, or \\`prisma-next migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`prisma-next db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-WvjSiWcB.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD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["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-WvjSiWcB.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-Co-8oaiB.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-CHUUeHh0.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`prisma-next migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`prisma-next db update\\` to advance the database, or \\`prisma-next migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`prisma-next db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-WvjSiWcB.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;;;;;;;;;;;;;;A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CLg4CiV-
|
|
3
|
-
import {
|
|
1
|
+
import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
|
|
2
|
+
import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
|
|
3
|
+
import { n as executeContractEmit, t as disposeEmitQueue } from "./contract-emit-Bdf4DAR4-lKqkbfZT.mjs";
|
|
4
4
|
import { extname, resolve } from "pathe";
|
|
5
5
|
//#region ../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs
|
|
6
6
|
const PLUGIN_NAME = "prisma-vite-plugin-contract-emit";
|
|
@@ -87,7 +87,17 @@ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
|
|
|
87
87
|
const signal = lifecycleAbortController.signal;
|
|
88
88
|
try {
|
|
89
89
|
if (server && refreshWatchedFiles) await updateWatchedFiles(server);
|
|
90
|
+
const configResult = await loadConfigForSections(absoluteConfigPath, [
|
|
91
|
+
"contract",
|
|
92
|
+
"family",
|
|
93
|
+
"target",
|
|
94
|
+
"adapter",
|
|
95
|
+
"extensions"
|
|
96
|
+
]);
|
|
97
|
+
if (!configResult.ok) throw configResult.failure;
|
|
90
98
|
const result = await executeContractEmit({
|
|
99
|
+
config: configResult.value,
|
|
100
|
+
cwd: process.cwd(),
|
|
91
101
|
configPath: absoluteConfigPath,
|
|
92
102
|
signal
|
|
93
103
|
});
|
|
@@ -193,7 +203,9 @@ function prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {
|
|
|
193
203
|
const previousIgnoredOutputFiles = new Set(ignoredOutputFiles);
|
|
194
204
|
ignoredOutputFiles.clear();
|
|
195
205
|
try {
|
|
196
|
-
const
|
|
206
|
+
const configResult = await loadConfigForSections(absoluteConfigPath, ["contract"]);
|
|
207
|
+
if (!configResult.ok) throw configResult.failure;
|
|
208
|
+
const config = configResult.value;
|
|
197
209
|
didWarnConfigWatchFallback = false;
|
|
198
210
|
const contract = config.contract;
|
|
199
211
|
if (!contract) return /* @__PURE__ */ new Set([absoluteConfigPath]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-contract-emit.mjs","names":[],"sources":["../../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs"],"sourcesContent":["import { disposeEmitQueue, executeContractEmit } from \"@internal/cli/control-api\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { extname, resolve } from \"pathe\";\n//#region src/plugin.ts\nconst PLUGIN_NAME = \"prisma-vite-plugin-contract-emit\";\nconst DEFAULT_DEBOUNCE_MS = 150;\nconst DEFAULT_CONFIG_PATH = \"prisma-next.config.ts\";\nconst MODULE_GRAPH_EXTENSIONS = /* @__PURE__ */ new Set([\n\t\".js\",\n\t\".jsx\",\n\t\".mjs\",\n\t\".cjs\",\n\t\".ts\",\n\t\".tsx\",\n\t\".mts\",\n\t\".cts\"\n]);\n/**\n* Creates a Vite plugin that automatically emits Prisma Next contract artifacts.\n*\n* The plugin resolves watched files from contract source provider metadata,\n* re-emitting contract artifacts on changes with debounce while serializing\n* overlapping emits into a single follow-up run.\n*\n* @param configPath - Path to prisma-next.config.ts (relative or absolute). Defaults to 'prisma-next.config.ts'\n* @param options - Optional plugin configuration\n* @returns Vite plugin\n*\n* @example\n* ```ts\n* import { defineConfig } from 'vite';\n* import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';\n*\n* // Use default config path\n* export default defineConfig({\n* plugins: [prismaVitePlugin()],\n* });\n*\n* // Or specify a custom path\n* export default defineConfig({\n* plugins: [prismaVitePlugin('custom/prisma-next.config.ts')],\n* });\n* ```\n*/\nfunction prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {\n\tconst debounceMs = options?.debounceMs ?? DEFAULT_DEBOUNCE_MS;\n\tconst logLevel = options?.logLevel ?? \"info\";\n\tlet absoluteConfigPath;\n\tconst watchedFiles = /* @__PURE__ */ new Set();\n\tconst ignoredOutputFiles = /* @__PURE__ */ new Set();\n\tconst ownedOutputJsonPaths = /* @__PURE__ */ new Set();\n\tlet debounceTimer = null;\n\tlet lifecycleAbortController = new AbortController();\n\tlet server = null;\n\tlet isEmitInFlight = false;\n\tlet hasQueuedEmit = false;\n\tlet queuedEmitNeedsWatchedFileRefresh = false;\n\tlet didWarnConfigWatchFallback = false;\n\tfunction log(message, level = \"info\") {\n\t\tif (logLevel === \"silent\") return;\n\t\tif (level === \"debug\" && logLevel !== \"debug\") return;\n\t\tconsole.log(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction logError(message, error) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconst errorMessage = error instanceof Error ? error.message : error ? String(error) : \"\";\n\t\tconsole.error(`[${PLUGIN_NAME}] ${message}${errorMessage ? ` ${errorMessage}` : \"\"}`);\n\t\tif (error instanceof Error && error.stack && logLevel === \"debug\") console.error(error.stack);\n\t}\n\tfunction logWarning(message) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconsole.warn(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction handleTrackedFileChange(file) {\n\t\tconst normalized = resolve(file);\n\t\tif (ignoredOutputFiles.has(normalized)) {\n\t\t\tlog(`Ignoring emitted artifact update: ${normalized}`, \"debug\");\n\t\t\treturn;\n\t\t}\n\t\tif (watchedFiles.has(normalized)) {\n\t\t\tlog(`Detected change: ${normalized}`, \"debug\");\n\t\t\tscheduleEmit();\n\t\t}\n\t}\n\tasync function emitContract({ refreshWatchedFiles = true } = {}) {\n\t\tconst signal = lifecycleAbortController.signal;\n\t\ttry {\n\t\t\tif (server && refreshWatchedFiles) await updateWatchedFiles(server);\n\t\t\tconst result = await executeContractEmit({\n\t\t\t\tconfigPath: absoluteConfigPath,\n\t\t\t\tsignal\n\t\t\t});\n\t\t\tlog(`Emitted contract (storageHash: ${result.storageHash.slice(0, 8)}...)`);\n\t\t\tlog(` → ${result.files.json}`, \"debug\");\n\t\t\tlog(` → ${result.files.dts}`, \"debug\");\n\t\t\tif (server) {\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.json);\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.dts);\n\t\t\t}\n\t\t\tif (server && !hasQueuedEmit) server.ws.send({ type: \"full-reload\" });\n\t\t\telse if (hasQueuedEmit) log(\"Skipped full reload because a newer emit is queued\", \"debug\");\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (signal.aborted || error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tlog(\"Emit cancelled\", \"debug\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlogError(\"Contract emit failed:\", error);\n\t\t\tif (server) {\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\t\tconst errorStack = error instanceof Error ? error.stack : void 0;\n\t\t\t\tserver.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: errorStack ?? \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\tasync function drainQueuedEmits() {\n\t\tif (isEmitInFlight || lifecycleAbortController.signal.aborted) return;\n\t\tisEmitInFlight = true;\n\t\ttry {\n\t\t\twhile (hasQueuedEmit && !lifecycleAbortController.signal.aborted) {\n\t\t\t\tconst refreshWatchedFiles = queuedEmitNeedsWatchedFileRefresh;\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tawait emitContract({ refreshWatchedFiles });\n\t\t\t}\n\t\t} finally {\n\t\t\tisEmitInFlight = false;\n\t\t}\n\t}\n\tfunction requestEmit({ refreshWatchedFiles = true } = {}) {\n\t\tif (lifecycleAbortController.signal.aborted) return Promise.resolve();\n\t\thasQueuedEmit = true;\n\t\tqueuedEmitNeedsWatchedFileRefresh ||= refreshWatchedFiles;\n\t\tif (isEmitInFlight) {\n\t\t\tlog(\"Queued follow-up emit while another emit is running\", \"debug\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn drainQueuedEmits();\n\t}\n\tfunction scheduleEmit() {\n\t\tif (debounceTimer) clearTimeout(debounceTimer);\n\t\tdebounceTimer = setTimeout(() => {\n\t\t\tdebounceTimer = null;\n\t\t\trequestEmit();\n\t\t}, debounceMs);\n\t}\n\tfunction resolveContractOutputFiles(contractOutput) {\n\t\tif (contractOutput === void 0) return /* @__PURE__ */ new Set();\n\t\tconst { jsonPath, dtsPath } = getEmittedArtifactPaths(contractOutput);\n\t\townedOutputJsonPaths.add(jsonPath);\n\t\treturn /* @__PURE__ */ new Set([jsonPath, dtsPath]);\n\t}\n\tfunction isModuleGraphRoot(filePath) {\n\t\treturn MODULE_GRAPH_EXTENSIONS.has(extname(filePath));\n\t}\n\tasync function collectModuleGraphFiles(viteServer, roots) {\n\t\tconst files = /* @__PURE__ */ new Set();\n\t\tconst uniqueRoots = [...new Set(roots)];\n\t\tfor (const root of uniqueRoots) try {\n\t\t\tawait viteServer.ssrLoadModule(root);\n\t\t} catch (error) {\n\t\t\tif (root === absoluteConfigPath) logError(\"Failed to load config module graph root:\", error);\n\t\t\telse log(`Skipped module-graph root after load failure: ${root}`, \"debug\");\n\t\t}\n\t\ttry {\n\t\t\tconst visited = /* @__PURE__ */ new Set();\n\t\t\tconst queue = [...uniqueRoots];\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst current = queue.shift();\n\t\t\t\tif (current === void 0 || visited.has(current)) continue;\n\t\t\t\tvisited.add(current);\n\t\t\t\tconst mod = viteServer.moduleGraph.getModuleById(current);\n\t\t\t\tif (!mod) continue;\n\t\t\t\tif (mod.file) files.add(mod.file);\n\t\t\t\tfor (const imported of mod.importedModules) if (imported.id && !visited.has(imported.id)) queue.push(imported.id);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogError(\"Failed to collect watched files:\", error);\n\t\t}\n\t\treturn files;\n\t}\n\tasync function resolveWatchedFiles(viteServer) {\n\t\tconst previousWatchedFiles = new Set(watchedFiles);\n\t\tconst previousIgnoredOutputFiles = new Set(ignoredOutputFiles);\n\t\tignoredOutputFiles.clear();\n\t\ttry {\n\t\t\tconst config = await loadConfig(absoluteConfigPath);\n\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\tconst contract = config.contract;\n\t\t\tif (!contract) return /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst files = /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst inputs = contract.source.inputs ?? [];\n\t\t\tfor (const outputFile of resolveContractOutputFiles(contract.output)) ignoredOutputFiles.add(outputFile);\n\t\t\tconst moduleGraphRoots = [absoluteConfigPath];\n\t\t\tfor (const input of inputs) {\n\t\t\t\tif (!ignoredOutputFiles.has(input)) files.add(input);\n\t\t\t\tif (isModuleGraphRoot(input)) moduleGraphRoots.push(input);\n\t\t\t}\n\t\t\tfor (const file of await collectModuleGraphFiles(viteServer, moduleGraphRoots)) if (!ignoredOutputFiles.has(file)) files.add(file);\n\t\t\treturn files;\n\t\t} catch (error) {\n\t\t\tif (previousIgnoredOutputFiles.size > 0) for (const outputFile of previousIgnoredOutputFiles) ignoredOutputFiles.add(outputFile);\n\t\t\tif (!didWarnConfigWatchFallback) {\n\t\t\t\tdidWarnConfigWatchFallback = true;\n\t\t\t\tconst reason = error instanceof Error ? ` ${error.message}` : \"\";\n\t\t\t\tlogWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma Next config inputs could not be resolved.${reason} Contract watch coverage is partial.`);\n\t\t\t}\n\t\t\tif (previousWatchedFiles.size > 0) {\n\t\t\t\tpreviousWatchedFiles.add(absoluteConfigPath);\n\t\t\t\treturn previousWatchedFiles;\n\t\t\t}\n\t\t\treturn /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t}\n\t}\n\tasync function updateWatchedFiles(viteServer) {\n\t\tconst newWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\tconst toAdd = [];\n\t\tconst toRemove = [];\n\t\tfor (const file of newWatchedFiles) if (!watchedFiles.has(file)) toAdd.push(file);\n\t\tfor (const file of watchedFiles) if (!newWatchedFiles.has(file)) toRemove.push(file);\n\t\tfor (const file of toAdd) viteServer.watcher.add(file);\n\t\tfor (const file of toRemove) viteServer.watcher.unwatch(file);\n\t\twatchedFiles.clear();\n\t\tfor (const file of newWatchedFiles) watchedFiles.add(file);\n\t\tif (toAdd.length > 0 || toRemove.length > 0) log(`Updated watched files: +${toAdd.length} -${toRemove.length}`, \"debug\");\n\t}\n\treturn {\n\t\tname: PLUGIN_NAME,\n\t\tconfigResolved(config) {\n\t\t\tabsoluteConfigPath = resolve(config.root, configPath);\n\t\t\tlog(`Config path: ${absoluteConfigPath}`, \"debug\");\n\t\t},\n\t\tasync configureServer(viteServer) {\n\t\t\tserver = viteServer;\n\t\t\tlifecycleAbortController = new AbortController();\n\t\t\tisEmitInFlight = false;\n\t\t\thasQueuedEmit = false;\n\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\tconst onTrackedWatcherEvent = (file) => {\n\t\t\t\thandleTrackedFileChange(file);\n\t\t\t};\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (debounceTimer) {\n\t\t\t\t\tclearTimeout(debounceTimer);\n\t\t\t\t\tdebounceTimer = null;\n\t\t\t\t}\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tlifecycleAbortController.abort();\n\t\t\t\tviteServer.watcher.off?.(\"change\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"add\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"unlink\", onTrackedWatcherEvent);\n\t\t\t\tignoredOutputFiles.clear();\n\t\t\t\tfor (const outputJsonPath of ownedOutputJsonPaths) disposeEmitQueue(outputJsonPath);\n\t\t\t\townedOutputJsonPaths.clear();\n\t\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\t\tserver = null;\n\t\t\t\twatchedFiles.clear();\n\t\t\t\tlog(\"Server closed, cleaned up resources\", \"debug\");\n\t\t\t};\n\t\t\tviteServer.httpServer?.on(\"close\", cleanup);\n\t\t\tviteServer.watcher?.on?.(\"close\", cleanup);\n\t\t\tviteServer.watcher.on(\"change\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"add\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"unlink\", onTrackedWatcherEvent);\n\t\t\tconst initialWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\t\tfor (const file of initialWatchedFiles) watchedFiles.add(file);\n\t\t\tfor (const file of watchedFiles) viteServer.watcher.add(file);\n\t\t\tif (watchedFiles.size === 0) {\n\t\t\t\tconst errorMessage = `No files are being watched. The config file \"${absoluteConfigPath}\" could not be loaded or has no dependencies. HMR for contract changes will not work.`;\n\t\t\t\tlogError(errorMessage);\n\t\t\t\tviteServer.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlog(`Watching ${watchedFiles.size} files`, \"debug\");\n\t\t\t\tif (logLevel === \"debug\") for (const file of watchedFiles) log(` ${file}`, \"debug\");\n\t\t\t}\n\t\t\tawait requestEmit({ refreshWatchedFiles: false });\n\t\t},\n\t\thandleHotUpdate(ctx) {\n\t\t\thandleTrackedFileChange(ctx.file);\n\t\t}\n\t};\n}\n//#endregion\nexport { prismaVitePlugin };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;AAKA,MAAM,cAAc;AACpB,MAAM,sBAAsB;AAC5B,MAAM,sBAAsB;AAC5B,MAAM,0CAA0C,IAAI,IAAI;CACv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AAQ,MAAM,OAAO,qBAAqB;IACrD,WAAW,QAAQ,MAAM,UAAU,qBAAqB;IACxD,mBAAmB,MAAM;IACzB,KAAK,MAAM,kBAAkB,sBAAsB,iBAAiB,cAAc;IAClF,qBAAqB,MAAM;IAC3B,6BAA6B;IAC7B,SAAS;IACT,aAAa,MAAM;IACnB,IAAI,uCAAuC,OAAO;GACnD;GACA,WAAW,YAAY,GAAG,SAAS,OAAO;GAC1C,WAAW,SAAS,KAAK,SAAS,OAAO;GACzC,WAAW,QAAQ,GAAG,UAAU,qBAAqB;GACrD,WAAW,QAAQ,GAAG,OAAO,qBAAqB;GAClD,WAAW,QAAQ,GAAG,UAAU,qBAAqB;GACrD,MAAM,sBAAsB,MAAM,oBAAoB,UAAU;GAChE,KAAK,MAAM,QAAQ,qBAAqB,aAAa,IAAI,IAAI;GAC7D,KAAK,MAAM,QAAQ,cAAc,WAAW,QAAQ,IAAI,IAAI;GAC5D,IAAI,aAAa,SAAS,GAAG;IAC5B,MAAM,eAAe,gDAAgD,mBAAmB;IACxF,SAAS,YAAY;IACrB,WAAW,GAAG,KAAK;KAClB,MAAM;KACN,KAAK;MACJ,SAAS,iBAAiB;MAC1B,OAAO;MACP,QAAQ;KACT;IACD,CAAC;GACF,OAAO;IACN,IAAI,YAAY,aAAa,KAAK,SAAS,OAAO;IAClD,IAAI,aAAa,SAAS,KAAK,MAAM,QAAQ,cAAc,IAAI,KAAK,QAAQ,OAAO;GACpF;GACA,MAAM,YAAY,EAAE,qBAAqB,MAAM,CAAC;EACjD;EACA,gBAAgB,KAAK;GACpB,wBAAwB,IAAI,IAAI;EACjC;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"vite-plugin-contract-emit.mjs","names":[],"sources":["../../../../1-framework/3-tooling/vite-plugin-contract-emit/dist/index.mjs"],"sourcesContent":["import { disposeEmitQueue, executeContractEmit } from \"@internal/cli/control-api\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { extname, resolve } from \"pathe\";\n//#region src/plugin.ts\nconst PLUGIN_NAME = \"prisma-vite-plugin-contract-emit\";\nconst DEFAULT_DEBOUNCE_MS = 150;\nconst DEFAULT_CONFIG_PATH = \"prisma-next.config.ts\";\nconst MODULE_GRAPH_EXTENSIONS = /* @__PURE__ */ new Set([\n\t\".js\",\n\t\".jsx\",\n\t\".mjs\",\n\t\".cjs\",\n\t\".ts\",\n\t\".tsx\",\n\t\".mts\",\n\t\".cts\"\n]);\n/**\n* Creates a Vite plugin that automatically emits Prisma Next contract artifacts.\n*\n* The plugin resolves watched files from contract source provider metadata,\n* re-emitting contract artifacts on changes with debounce while serializing\n* overlapping emits into a single follow-up run.\n*\n* @param configPath - Path to prisma-next.config.ts (relative or absolute). Defaults to 'prisma-next.config.ts'\n* @param options - Optional plugin configuration\n* @returns Vite plugin\n*\n* @example\n* ```ts\n* import { defineConfig } from 'vite';\n* import { prismaVitePlugin } from '@internal/vite-plugin-contract-emit';\n*\n* // Use default config path\n* export default defineConfig({\n* plugins: [prismaVitePlugin()],\n* });\n*\n* // Or specify a custom path\n* export default defineConfig({\n* plugins: [prismaVitePlugin('custom/prisma-next.config.ts')],\n* });\n* ```\n*/\nfunction prismaVitePlugin(configPath = DEFAULT_CONFIG_PATH, options) {\n\tconst debounceMs = options?.debounceMs ?? DEFAULT_DEBOUNCE_MS;\n\tconst logLevel = options?.logLevel ?? \"info\";\n\tlet absoluteConfigPath;\n\tconst watchedFiles = /* @__PURE__ */ new Set();\n\tconst ignoredOutputFiles = /* @__PURE__ */ new Set();\n\tconst ownedOutputJsonPaths = /* @__PURE__ */ new Set();\n\tlet debounceTimer = null;\n\tlet lifecycleAbortController = new AbortController();\n\tlet server = null;\n\tlet isEmitInFlight = false;\n\tlet hasQueuedEmit = false;\n\tlet queuedEmitNeedsWatchedFileRefresh = false;\n\tlet didWarnConfigWatchFallback = false;\n\tfunction log(message, level = \"info\") {\n\t\tif (logLevel === \"silent\") return;\n\t\tif (level === \"debug\" && logLevel !== \"debug\") return;\n\t\tconsole.log(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction logError(message, error) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconst errorMessage = error instanceof Error ? error.message : error ? String(error) : \"\";\n\t\tconsole.error(`[${PLUGIN_NAME}] ${message}${errorMessage ? ` ${errorMessage}` : \"\"}`);\n\t\tif (error instanceof Error && error.stack && logLevel === \"debug\") console.error(error.stack);\n\t}\n\tfunction logWarning(message) {\n\t\tif (logLevel === \"silent\") return;\n\t\tconsole.warn(`[${PLUGIN_NAME}] ${message}`);\n\t}\n\tfunction handleTrackedFileChange(file) {\n\t\tconst normalized = resolve(file);\n\t\tif (ignoredOutputFiles.has(normalized)) {\n\t\t\tlog(`Ignoring emitted artifact update: ${normalized}`, \"debug\");\n\t\t\treturn;\n\t\t}\n\t\tif (watchedFiles.has(normalized)) {\n\t\t\tlog(`Detected change: ${normalized}`, \"debug\");\n\t\t\tscheduleEmit();\n\t\t}\n\t}\n\tasync function emitContract({ refreshWatchedFiles = true } = {}) {\n\t\tconst signal = lifecycleAbortController.signal;\n\t\ttry {\n\t\t\tif (server && refreshWatchedFiles) await updateWatchedFiles(server);\n\t\t\tconst configResult = await loadConfigForSections(absoluteConfigPath, [\n\t\t\t\t\"contract\",\n\t\t\t\t\"family\",\n\t\t\t\t\"target\",\n\t\t\t\t\"adapter\",\n\t\t\t\t\"extensions\"\n\t\t\t]);\n\t\t\tif (!configResult.ok) throw configResult.failure;\n\t\t\tconst result = await executeContractEmit({\n\t\t\t\tconfig: configResult.value,\n\t\t\t\tcwd: process.cwd(),\n\t\t\t\tconfigPath: absoluteConfigPath,\n\t\t\t\tsignal\n\t\t\t});\n\t\t\tlog(`Emitted contract (storageHash: ${result.storageHash.slice(0, 8)}...)`);\n\t\t\tlog(` → ${result.files.json}`, \"debug\");\n\t\t\tlog(` → ${result.files.dts}`, \"debug\");\n\t\t\tif (server) {\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.json);\n\t\t\t\tserver.moduleGraph.onFileChange(result.files.dts);\n\t\t\t}\n\t\t\tif (server && !hasQueuedEmit) server.ws.send({ type: \"full-reload\" });\n\t\t\telse if (hasQueuedEmit) log(\"Skipped full reload because a newer emit is queued\", \"debug\");\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (signal.aborted || error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tlog(\"Emit cancelled\", \"debug\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlogError(\"Contract emit failed:\", error);\n\t\t\tif (server) {\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\t\t\t\tconst errorStack = error instanceof Error ? error.stack : void 0;\n\t\t\t\tserver.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: errorStack ?? \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t}\n\tasync function drainQueuedEmits() {\n\t\tif (isEmitInFlight || lifecycleAbortController.signal.aborted) return;\n\t\tisEmitInFlight = true;\n\t\ttry {\n\t\t\twhile (hasQueuedEmit && !lifecycleAbortController.signal.aborted) {\n\t\t\t\tconst refreshWatchedFiles = queuedEmitNeedsWatchedFileRefresh;\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tawait emitContract({ refreshWatchedFiles });\n\t\t\t}\n\t\t} finally {\n\t\t\tisEmitInFlight = false;\n\t\t}\n\t}\n\tfunction requestEmit({ refreshWatchedFiles = true } = {}) {\n\t\tif (lifecycleAbortController.signal.aborted) return Promise.resolve();\n\t\thasQueuedEmit = true;\n\t\tqueuedEmitNeedsWatchedFileRefresh ||= refreshWatchedFiles;\n\t\tif (isEmitInFlight) {\n\t\t\tlog(\"Queued follow-up emit while another emit is running\", \"debug\");\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\treturn drainQueuedEmits();\n\t}\n\tfunction scheduleEmit() {\n\t\tif (debounceTimer) clearTimeout(debounceTimer);\n\t\tdebounceTimer = setTimeout(() => {\n\t\t\tdebounceTimer = null;\n\t\t\trequestEmit();\n\t\t}, debounceMs);\n\t}\n\tfunction resolveContractOutputFiles(contractOutput) {\n\t\tif (contractOutput === void 0) return /* @__PURE__ */ new Set();\n\t\tconst { jsonPath, dtsPath } = getEmittedArtifactPaths(contractOutput);\n\t\townedOutputJsonPaths.add(jsonPath);\n\t\treturn /* @__PURE__ */ new Set([jsonPath, dtsPath]);\n\t}\n\tfunction isModuleGraphRoot(filePath) {\n\t\treturn MODULE_GRAPH_EXTENSIONS.has(extname(filePath));\n\t}\n\tasync function collectModuleGraphFiles(viteServer, roots) {\n\t\tconst files = /* @__PURE__ */ new Set();\n\t\tconst uniqueRoots = [...new Set(roots)];\n\t\tfor (const root of uniqueRoots) try {\n\t\t\tawait viteServer.ssrLoadModule(root);\n\t\t} catch (error) {\n\t\t\tif (root === absoluteConfigPath) logError(\"Failed to load config module graph root:\", error);\n\t\t\telse log(`Skipped module-graph root after load failure: ${root}`, \"debug\");\n\t\t}\n\t\ttry {\n\t\t\tconst visited = /* @__PURE__ */ new Set();\n\t\t\tconst queue = [...uniqueRoots];\n\t\t\twhile (queue.length > 0) {\n\t\t\t\tconst current = queue.shift();\n\t\t\t\tif (current === void 0 || visited.has(current)) continue;\n\t\t\t\tvisited.add(current);\n\t\t\t\tconst mod = viteServer.moduleGraph.getModuleById(current);\n\t\t\t\tif (!mod) continue;\n\t\t\t\tif (mod.file) files.add(mod.file);\n\t\t\t\tfor (const imported of mod.importedModules) if (imported.id && !visited.has(imported.id)) queue.push(imported.id);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlogError(\"Failed to collect watched files:\", error);\n\t\t}\n\t\treturn files;\n\t}\n\tasync function resolveWatchedFiles(viteServer) {\n\t\tconst previousWatchedFiles = new Set(watchedFiles);\n\t\tconst previousIgnoredOutputFiles = new Set(ignoredOutputFiles);\n\t\tignoredOutputFiles.clear();\n\t\ttry {\n\t\t\tconst configResult = await loadConfigForSections(absoluteConfigPath, [\"contract\"]);\n\t\t\tif (!configResult.ok) throw configResult.failure;\n\t\t\tconst config = configResult.value;\n\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\tconst contract = config.contract;\n\t\t\tif (!contract) return /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst files = /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t\tconst inputs = contract.source.inputs ?? [];\n\t\t\tfor (const outputFile of resolveContractOutputFiles(contract.output)) ignoredOutputFiles.add(outputFile);\n\t\t\tconst moduleGraphRoots = [absoluteConfigPath];\n\t\t\tfor (const input of inputs) {\n\t\t\t\tif (!ignoredOutputFiles.has(input)) files.add(input);\n\t\t\t\tif (isModuleGraphRoot(input)) moduleGraphRoots.push(input);\n\t\t\t}\n\t\t\tfor (const file of await collectModuleGraphFiles(viteServer, moduleGraphRoots)) if (!ignoredOutputFiles.has(file)) files.add(file);\n\t\t\treturn files;\n\t\t} catch (error) {\n\t\t\tif (previousIgnoredOutputFiles.size > 0) for (const outputFile of previousIgnoredOutputFiles) ignoredOutputFiles.add(outputFile);\n\t\t\tif (!didWarnConfigWatchFallback) {\n\t\t\t\tdidWarnConfigWatchFallback = true;\n\t\t\t\tconst reason = error instanceof Error ? ` ${error.message}` : \"\";\n\t\t\t\tlogWarning(`${previousWatchedFiles.size > 0 ? `Watching the previous dependency set plus ${absoluteConfigPath}` : `Watching only ${absoluteConfigPath}`} because Prisma Next config inputs could not be resolved.${reason} Contract watch coverage is partial.`);\n\t\t\t}\n\t\t\tif (previousWatchedFiles.size > 0) {\n\t\t\t\tpreviousWatchedFiles.add(absoluteConfigPath);\n\t\t\t\treturn previousWatchedFiles;\n\t\t\t}\n\t\t\treturn /* @__PURE__ */ new Set([absoluteConfigPath]);\n\t\t}\n\t}\n\tasync function updateWatchedFiles(viteServer) {\n\t\tconst newWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\tconst toAdd = [];\n\t\tconst toRemove = [];\n\t\tfor (const file of newWatchedFiles) if (!watchedFiles.has(file)) toAdd.push(file);\n\t\tfor (const file of watchedFiles) if (!newWatchedFiles.has(file)) toRemove.push(file);\n\t\tfor (const file of toAdd) viteServer.watcher.add(file);\n\t\tfor (const file of toRemove) viteServer.watcher.unwatch(file);\n\t\twatchedFiles.clear();\n\t\tfor (const file of newWatchedFiles) watchedFiles.add(file);\n\t\tif (toAdd.length > 0 || toRemove.length > 0) log(`Updated watched files: +${toAdd.length} -${toRemove.length}`, \"debug\");\n\t}\n\treturn {\n\t\tname: PLUGIN_NAME,\n\t\tconfigResolved(config) {\n\t\t\tabsoluteConfigPath = resolve(config.root, configPath);\n\t\t\tlog(`Config path: ${absoluteConfigPath}`, \"debug\");\n\t\t},\n\t\tasync configureServer(viteServer) {\n\t\t\tserver = viteServer;\n\t\t\tlifecycleAbortController = new AbortController();\n\t\t\tisEmitInFlight = false;\n\t\t\thasQueuedEmit = false;\n\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\tconst onTrackedWatcherEvent = (file) => {\n\t\t\t\thandleTrackedFileChange(file);\n\t\t\t};\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (debounceTimer) {\n\t\t\t\t\tclearTimeout(debounceTimer);\n\t\t\t\t\tdebounceTimer = null;\n\t\t\t\t}\n\t\t\t\thasQueuedEmit = false;\n\t\t\t\tqueuedEmitNeedsWatchedFileRefresh = false;\n\t\t\t\tlifecycleAbortController.abort();\n\t\t\t\tviteServer.watcher.off?.(\"change\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"add\", onTrackedWatcherEvent);\n\t\t\t\tviteServer.watcher.off?.(\"unlink\", onTrackedWatcherEvent);\n\t\t\t\tignoredOutputFiles.clear();\n\t\t\t\tfor (const outputJsonPath of ownedOutputJsonPaths) disposeEmitQueue(outputJsonPath);\n\t\t\t\townedOutputJsonPaths.clear();\n\t\t\t\tdidWarnConfigWatchFallback = false;\n\t\t\t\tserver = null;\n\t\t\t\twatchedFiles.clear();\n\t\t\t\tlog(\"Server closed, cleaned up resources\", \"debug\");\n\t\t\t};\n\t\t\tviteServer.httpServer?.on(\"close\", cleanup);\n\t\t\tviteServer.watcher?.on?.(\"close\", cleanup);\n\t\t\tviteServer.watcher.on(\"change\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"add\", onTrackedWatcherEvent);\n\t\t\tviteServer.watcher.on(\"unlink\", onTrackedWatcherEvent);\n\t\t\tconst initialWatchedFiles = await resolveWatchedFiles(viteServer);\n\t\t\tfor (const file of initialWatchedFiles) watchedFiles.add(file);\n\t\t\tfor (const file of watchedFiles) viteServer.watcher.add(file);\n\t\t\tif (watchedFiles.size === 0) {\n\t\t\t\tconst errorMessage = `No files are being watched. The config file \"${absoluteConfigPath}\" could not be loaded or has no dependencies. HMR for contract changes will not work.`;\n\t\t\t\tlogError(errorMessage);\n\t\t\t\tviteServer.ws.send({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\terr: {\n\t\t\t\t\t\tmessage: `[prisma-next] ${errorMessage}`,\n\t\t\t\t\t\tstack: \"\",\n\t\t\t\t\t\tplugin: PLUGIN_NAME\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tlog(`Watching ${watchedFiles.size} files`, \"debug\");\n\t\t\t\tif (logLevel === \"debug\") for (const file of watchedFiles) log(` ${file}`, \"debug\");\n\t\t\t}\n\t\t\tawait requestEmit({ refreshWatchedFiles: false });\n\t\t},\n\t\thandleHotUpdate(ctx) {\n\t\t\thandleTrackedFileChange(ctx.file);\n\t\t}\n\t};\n}\n//#endregion\nexport { prismaVitePlugin };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;AAKA,MAAM,cAAc;AACpB,MAAM,sBAAsB;AAC5B,MAAM,s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M,CAAC;EACjD;EACA,gBAAgB,KAAK;GACpB,wBAAwB,IAAI,IAAI;EACjC;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-toolchain",
|
|
3
|
-
"version": "8.0.0-rc.1-dev.
|
|
3
|
+
"version": "8.0.0-rc.1-dev.24",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@clack/prompts": "^1.7.0",
|
|
16
|
-
"@prisma/
|
|
16
|
+
"@prisma/cli-engine": "0.0.3",
|
|
17
|
+
"@prisma/orm-framework": "8.0.0-rc.1-dev.24",
|
|
17
18
|
"@vercel/detect-agent": "^1.2.4",
|
|
18
19
|
"arktype": "^2.2.2",
|
|
19
20
|
"c12": "^3.3.4",
|
|
@@ -34,16 +35,16 @@
|
|
|
34
35
|
"wrap-ansi": "^10.0.0"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@internal/cli": "8.0.0-rc.1-dev.
|
|
38
|
-
"@internal/cli-telemetry": "8.0.0-rc.1-dev.
|
|
39
|
-
"@internal/config-loader": "8.0.0-rc.1-dev.
|
|
40
|
-
"@internal/emitter": "8.0.0-rc.1-dev.
|
|
41
|
-
"@internal/language-server": "8.0.0-rc.1-dev.
|
|
42
|
-
"@internal/migration-tools": "8.0.0-rc.1-dev.
|
|
43
|
-
"@internal/publish-surface": "8.0.0-rc.1-dev.
|
|
44
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
45
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
46
|
-
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.
|
|
38
|
+
"@internal/cli": "8.0.0-rc.1-dev.24",
|
|
39
|
+
"@internal/cli-telemetry": "8.0.0-rc.1-dev.24",
|
|
40
|
+
"@internal/config-loader": "8.0.0-rc.1-dev.24",
|
|
41
|
+
"@internal/emitter": "8.0.0-rc.1-dev.24",
|
|
42
|
+
"@internal/language-server": "8.0.0-rc.1-dev.24",
|
|
43
|
+
"@internal/migration-tools": "8.0.0-rc.1-dev.24",
|
|
44
|
+
"@internal/publish-surface": "8.0.0-rc.1-dev.24",
|
|
45
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.24",
|
|
46
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.24",
|
|
47
|
+
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.24",
|
|
47
48
|
"tsdown": "0.22.14",
|
|
48
49
|
"typescript": "5.9.3"
|
|
49
50
|
},
|
|
@@ -82,6 +83,7 @@
|
|
|
82
83
|
"./cli/commands/telemetry": "./dist/cli__commands__telemetry.mjs",
|
|
83
84
|
"./cli/config-types": "./dist/cli__config-types.mjs",
|
|
84
85
|
"./cli/control-api": "./dist/cli__control-api.mjs",
|
|
86
|
+
"./cli/control-api/testing": "./dist/cli__control-api__testing.mjs",
|
|
85
87
|
"./cli/init-output": "./dist/cli__init-output.mjs",
|
|
86
88
|
"./cli/migration-cli": "./dist/cli__migration-cli.mjs",
|
|
87
89
|
"./cli-telemetry": "./dist/cli-telemetry.mjs",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"caught-errors-D7Qznyrm-BzYooF6H.mjs","names":["CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/caught-errors-D7Qznyrm.mjs"],"sourcesContent":["import { F as CliStructuredError } from \"./command-helpers-C4WpR-QE.mjs\";\n//#region src/control-api/operations/caught-errors.ts\n/**\n* Classifies errors caught around migration-tools calls so commands never import the MigrationToolsError class directly.\n*/\n/** CliStructuredError (including MigrationToolsError) → identity; anything else → null (caller rethrows/wraps). */\nfunction mapCaughtMigrationError(error) {\n\tif (CliStructuredError.is(error)) return error;\n\treturn null;\n}\n//#endregion\nexport { mapCaughtMigrationError as t };\n\n//# sourceMappingURL=caught-errors-D7Qznyrm.mjs.map"],"mappings":";;;;;;AAMA,SAAS,wBAAwB,OAAO;CACvC,IAAIA,qBAAmB,GAAG,KAAK,GAAG,OAAO;CACzC,OAAO;AACR"}
|