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