@prisma/orm-toolchain 0.16.0-dev.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-CcG-fB8r-CDs5C9vt.mjs +597 -0
- package/dist/migration-check-CcG-fB8r-CDs5C9vt.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-CFlzlRmu-DewBN8Ys.mjs +444 -0
- package/dist/migration-status-CFlzlRmu-DewBN8Ys.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-CeGMYFYX-h3OcU__O.d.mts +192 -0
- package/dist/schemas-CeGMYFYX-h3OcU__O.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 +127 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin__prisma-next.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/cli.mjs"],"sourcesContent":["#!/usr/bin/env node\nimport { D as isCI, O as formatCommandHelp, g as parseGlobalFlagsOrExit, h as parseGlobalFlags, k as formatRootHelp, l as setCommandDescriptions, m as deriveCanPrompt, t as addGlobalOptions, u as setCommandExamples, v as installShutdownHandlers } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { t as createContractEmitCommand } from \"./contract-emit-0hSjbuxp.mjs\";\nimport { t as createContractInferCommand } from \"./contract-infer-BnkqpftN.mjs\";\nimport { createDbInitCommand } from \"./commands/db-init.mjs\";\nimport { createDbSchemaCommand } from \"./commands/db-schema.mjs\";\nimport { createDbSignCommand } from \"./commands/db-sign.mjs\";\nimport { createDbUpdateCommand } from \"./commands/db-update.mjs\";\nimport { t as createDbVerifyCommand } from \"./db-verify-CKPsRFrj.mjs\";\nimport { t as createFormatCommand } from \"./format-ByDm2goZ.mjs\";\nimport { t as createMigrationListCommand } from \"./migration-list-BFBeo1_X.mjs\";\nimport { createMigrateCommand } from \"./commands/migrate.mjs\";\nimport { t as createMigrationCheckCommand } from \"./migration-check-CcG-fB8r.mjs\";\nimport { createMigrationGraphCommand } from \"./commands/migration-graph.mjs\";\nimport { t as createMigrationLogCommand } from \"./migration-log-CS5IWcNq.mjs\";\nimport { createMigrationNewCommand } from \"./commands/migration-new.mjs\";\nimport { t as createMigrationPlanCommand } from \"./migration-plan-q_L84PN1.mjs\";\nimport { createMigrationShowCommand } from \"./commands/migration-show.mjs\";\nimport { r as createMigrationStatusCommand } from \"./migration-status-CFlzlRmu.mjs\";\nimport { createRefCommand } from \"./commands/ref.mjs\";\nimport { t as createTelemetryCommand } from \"./telemetry-CmbCa3Ld.mjs\";\nimport { Command } from \"commander\";\nimport { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, userConfigPath } from \"@internal/cli-telemetry\";\nimport { distance } from \"closest-match\";\nimport { fileURLToPath } from \"node:url\";\n//#region package.json\nvar version = \"0.16.0-dev.36\";\n//#endregion\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\n//#region src/commands/init/index.ts\nfunction createInitCommand() {\n\tconst command = new Command(\"init\");\n\tsetCommandDescriptions(command, \"Initialize a new Prisma Next project\", `Scaffolds config, schema, and runtime files, installs dependencies,\nand emits the contract. Gets you from zero to typed queries in one step.\n\nRun interactively for a guided experience, or supply --target / --authoring\nand --yes for a fully scriptable run (CI, AI coding agents, automation).\n\nExit codes (see CLI Style Guide § Exit Codes):\n 0 OK Init succeeded.\\n 1 INTERNAL_ERROR Unexpected bug in prisma-next (please report).\\n 2 PRECONDITION Bad flags / missing prerequisite (e.g. no package.json).\\n 3 USER_ABORTED User cancelled an interactive prompt.\\n 4 INSTALL_FAILED Dependency installation failed (init-specific).\\n 5 EMIT_FAILED \\`contract emit\\` failed after install (init-specific).\\n 6 SKILL_INSTALL_FAILED Agent-skill install failed (re-run with --no-skill to skip).`);\n\tsetCommandExamples(command, [\n\t\t\"prisma-next init\",\n\t\t\"prisma-next init --yes --target postgres --authoring psl\",\n\t\t\"prisma-next init --yes --target mongodb --authoring typescript --json\",\n\t\t\"prisma-next init --yes --force --target postgres --authoring psl # overwrite an existing scaffold\",\n\t\t\"prisma-next init --no-install # skip pnpm/npm install + emit\",\n\t\t\"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)\"\n\t]);\n\treturn addGlobalOptions(command).option(\"--target <db>\", \"Database target: postgres or mongodb\").option(\"--authoring <style>\", \"Schema authoring style: psl or typescript\").option(\"--schema-path <path>\", `Where to write the starter schema (default: ${defaultSchemaPath(\"psl\")})`).option(\"--force\", \"Overwrite an existing scaffold without prompting\").option(\"--write-env\", \"Write a .env file from .env.example (gitignored; default: only .env.example)\").option(\"--probe-db\", \"Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)\").option(\"--strict-probe\", \"Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)\").option(\"--no-install\", \"Skip dependency installation and contract emission\").option(\"--no-skill\", \"Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)\").action(async (options) => {\n\t\tconst { runInit } = await import(\"./init-DHctXAI9.mjs\");\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst canPrompt = deriveCanPrompt({\n\t\t\tflagsInteractive: flags.interactive,\n\t\t\toptionInteractive: options.interactive,\n\t\t\tstdinIsTTY: Boolean(process.stdin.isTTY)\n\t\t});\n\t\tconst exitCode = await runInit(process.cwd(), {\n\t\t\toptions,\n\t\t\tflags,\n\t\t\tcanPrompt\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n}\n//#endregion\n//#region src/commands/lsp.ts\nfunction createLspCommand() {\n\tconst command = new Command(\"lsp\");\n\tsetCommandDescriptions(command, \"Start the Prisma Next language server\", \"Launches a Language Server Protocol server that publishes PSL parse diagnostics\\nand handles whole-document PSL formatting for the schema inputs declared in\\nyour config (contract.source.inputs). Formatting uses the Prisma Next PSL\\nformatter and the formatter block from the project config.\\nCommunicates over stdio; intended to be spawned by an\\neditor, not run interactively. The server keeps running until the editor client\\ndisconnects.\");\n\tsetCommandExamples(command, [\"prisma-next lsp --stdio\"]);\n\taddGlobalOptions(command).option(\"--stdio\", \"Communicate with the editor over stdio (the default and only transport)\").action(async () => {\n\t\tconst { startServer } = await import(\"@internal/language-server\");\n\t\tstartServer();\n\t});\n\treturn command;\n}\n//#endregion\n//#region src/utils/suggest-command.ts\n/**\n* Suggests similar command names for a mistyped input.\n*\n* Uses Levenshtein distance to find close matches. Only suggests commands\n* within a reasonable distance threshold (40% of the input length, minimum 2).\n* Returns up to 3 suggestions in case of ties.\n*\n* @returns Array of suggested command names (empty if nothing is close enough).\n*/\nfunction suggestCommands(input, candidates) {\n\tif (candidates.length === 0) return [];\n\tconst maxDistance = Math.max(2, Math.ceil(input.length * .4));\n\tconst scored = candidates.map((name) => ({\n\t\tname,\n\t\tdist: distance(input, name)\n\t})).filter((entry) => entry.dist <= maxDistance).sort((a, b) => a.dist - b.dist);\n\tif (scored.length === 0) return [];\n\tconst bestDist = scored[0].dist;\n\treturn scored.filter((entry) => entry.dist === bestDist).slice(0, 3).map((entry) => entry.name);\n}\n//#endregion\n//#region src/utils/telemetry.ts\n/**\n* Resolve the commander command path from a leaf `Command`, walking up\n* the parent chain. Result is rooted at the program name and ends at\n* the leaf — `['prisma-next', 'migration', 'new']` for\n* `prisma-next migration new …`.\n*/\nfunction commandPathFor(actionCommand) {\n\tconst path = [];\n\tlet cursor = actionCommand;\n\twhile (cursor !== null) {\n\t\tpath.unshift(cursor.name());\n\t\tcursor = cursor.parent;\n\t}\n\treturn path;\n}\nfunction commanderOptionSnapshots(actionCommand) {\n\treturn actionCommand.options.map((option) => {\n\t\tconst attributeName = option.attributeName();\n\t\treturn {\n\t\t\tattributeName,\n\t\t\tlongName: option.long ?? null,\n\t\t\tsource: actionCommand.getOptionValueSource(attributeName) ?? null\n\t\t};\n\t});\n}\n/**\n* Project commander's leaf `Command` into the wire-shape snapshot the\n* telemetry sanitiser consumes. Pure projection — no env, no I/O.\n*/\nfunction commanderSnapshotForTelemetry(actionCommand) {\n\treturn {\n\t\tcommandPath: commandPathFor(actionCommand),\n\t\tpositionalArgs: actionCommand.args,\n\t\toptions: commanderOptionSnapshots(actionCommand)\n\t};\n}\nfunction resolveTelemetryGate() {\n\tif (isCI()) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"ci\"\n\t\t}\n\t};\n\tconst userConfig = readUserConfig();\n\tif (!resolveGating({\n\t\tenv: process.env,\n\t\tconfig: userConfig\n\t}).enabled) return {\n\t\tenabled: false,\n\t\toutcome: {\n\t\t\tspawned: false,\n\t\t\treason: \"gated-off\"\n\t\t}\n\t};\n\treturn {\n\t\tenabled: true,\n\t\tuserConfig\n\t};\n}\n/**\n* Path to the compiled sender script inside `@internal/cli-telemetry`'s\n* `dist/`. Resolved off this module's `import.meta.url` via the package\n* specifier `@internal/cli-telemetry/sender`, so the consumer pays\n* no attention to internal package layout.\n*/\nfunction senderPath() {\n\treturn fileURLToPath(new URL(import.meta.resolve(\"@internal/cli-telemetry/sender\")));\n}\nfunction fireTelemetry(actionCommand, userConfig) {\n\treturn runTelemetry({\n\t\tcommand: commanderSnapshotForTelemetry(actionCommand),\n\t\tversion,\n\t\tprojectRoot: process.cwd(),\n\t\tsenderPath: senderPath(),\n\t\tisCI: isCI(),\n\t\tenv: process.env,\n\t\tuserConfig\n\t});\n}\n/**\n* preAction-stage entry point. Synchronous by construction: resolve\n* env/CI/user-consent gates (cheap, all in-memory and a single tiny\n* user-config read), then — only when enabled — `fork()` the detached\n* sender script. The forked child loads `prisma-next.config.*` via\n* c12 on its own (see `loadProjectConfig` in cli-telemetry); the\n* parent does no project-config I/O on the command's hot path.\n*\n* Privacy invariant: gate resolution always happens before any project\n* config touches disk. The child loading user TS code is acceptable\n* only because it's gated behind the same resolved-enabled signal.\n*/\n/**\n* Builds the one-time first-run disclosure. The resolved absolute path to\n* the user-level config file is substituted in so the user can see exactly\n* which file to edit (it must not be confused with `prisma-next.config.ts`).\n* `prisma-next telemetry disable` is named as the primary, friendliest\n* opt-out, alongside the env vars and the config edit.\n*/\nfunction firstRunNotice(configPath) {\n\treturn [\n\t\t\"Prisma Next collects anonymous CLI usage data, enabled by default.\",\n\t\t\"What's collected and why: https://prisma-next.dev/docs/cli/telemetry.\",\n\t\t\"Opt out: run \\\"prisma-next telemetry disable\\\", set DO_NOT_TRACK=1 or\",\n\t\t`PRISMA_NEXT_DISABLE_TELEMETRY=1, or set \"enableTelemetry\": false in ${configPath}.`\n\t].join(\" \");\n}\n/**\n* Best-effort first-run disclosure + installationId mint. Runs only on the\n* gating-enabled path. Prints the notice to stderr (never stdout) and mints\n* a persistent id without touching `enableTelemetry`, so the opt-out default\n* stays intact and no unasked-for consent is recorded.\n*\n* Every step is wrapped so an un-writable config dir (or any other failure)\n* never throws and never blocks the command. Returns the minted (or\n* pre-existing) id so the caller can forward it to `runTelemetry` without a\n* redundant disk read. On mint failure it returns `undefined`: the notice may\n* reprint next run, and `runTelemetry` no-ops on the missing id.\n*/\nfunction discloseAndMintOnFirstRun() {\n\ttry {\n\t\tprocess.stderr.write(`${firstRunNotice(userConfigPath())}\\n`);\n\t} catch {}\n\ttry {\n\t\treturn ensureInstallationId();\n\t} catch {}\n}\n/**\n* True when the run is the `telemetry` command (or one of its\n* subcommands). The usage-telemetry preAction fire is exempted for it:\n* it would be absurd for `telemetry disable` to send a usage event before\n* disabling, or for `telemetry status` to mint an id + send while merely\n* reporting state. This is the only command-specific exemption.\n*\n* The check is rooted at the program: the path must be\n* `['prisma-next', 'telemetry', …]`, so it matches the top-level\n* `telemetry` command and its subcommands without matching a hypothetical\n* nested `… telemetry` elsewhere.\n*/\nfunction isTelemetryCommand(actionCommand) {\n\treturn commandPathFor(actionCommand)[1] === \"telemetry\";\n}\nfunction fireTelemetryFromPreAction(actionCommand) {\n\tif (isTelemetryCommand(actionCommand)) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst gate = resolveTelemetryGate();\n\tif (!gate.enabled) return gate.outcome;\n\tconst storedId = gate.userConfig.installationId;\n\tif (typeof storedId !== \"string\" || storedId.length === 0) {\n\t\tconst installationId = discloseAndMintOnFirstRun();\n\t\treturn fireTelemetry(actionCommand, installationId === void 0 ? gate.userConfig : {\n\t\t\t...gate.userConfig,\n\t\t\tinstallationId\n\t\t});\n\t}\n\treturn fireTelemetry(actionCommand, gate.userConfig);\n}\n//#endregion\n//#region src/cli.ts\ninstallShutdownHandlers();\n/**\n* Lookup table mapping removed subcommands to their replacement verbs.\n* Keyed by `<parent>:<subcommand>` (e.g. `migration:apply`).\n* The handler consults this before falling back to the fuzzy suggest engine.\n*/\nconst removedVerbRedirects = {\n\t\"migration:apply\": \"Use `prisma-next migrate --to <contract>` instead.\",\n\t\"migration:ref\": \"Use `prisma-next ref set|list|delete` instead.\"\n};\n/**\n* Removed flags on specific subcommands. Keyed by `<parent>:<sub>:<flag>`.\n* Checked during the pre-parse argv scan before commander sees the flags.\n*/\nconst removedFlagRedirects = {\n\t\"migration:status:graph\": \"Use `prisma-next migration graph` to view the migration graph.\",\n\t\"migration:status:all\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:limit\": \"Use `prisma-next migration log --db <url>` to view the full execution history.\",\n\t\"migration:status:ref\": \"Use `--to <contract>` instead of `--ref`.\"\n};\n/**\n* Formats the \"Did you mean ...?\" hint for an unknown command.\n*/\nfunction formatSuggestion(input, candidates) {\n\tconst suggestions = suggestCommands(input, candidates.map((c) => c));\n\tif (suggestions.length === 0) return \"\";\n\tif (suggestions.length === 1) return `\\nDid you mean ${suggestions[0]}?\\n`;\n\treturn `\\nDid you mean one of these?\\n${suggestions.map((s) => ` ${s}`).join(\"\\n\")}\\n`;\n}\nconst program = new Command();\nprogram.name(\"prisma-next\").description(\"Prisma Next CLI\").version(version);\nprogram.hook(\"preAction\", (_thisCommand, actionCommand) => {\n\ttry {\n\t\tfireTelemetryFromPreAction(actionCommand);\n\t} catch {}\n});\nconst versionOption = program.options.find((opt) => opt.flags.includes(\"--version\"));\nif (versionOption) versionOption.description = \"Output the version number\";\nprogram.configureOutput({\n\twriteErr: () => {},\n\twriteOut: (str) => {\n\t\tprocess.stdout.write(str);\n\t}\n});\nconst rootHelpFormatter = (cmd) => {\n\treturn formatRootHelp({\n\t\tprogram: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n};\nprogram.configureHelp({\n\tformatHelp: rootHelpFormatter,\n\tsubcommandDescription: () => \"\"\n});\nprogram.exitOverride((err) => {\n\tif (err) {\n\t\tconst errorCode = err.code;\n\t\tconst errorMessage = String(err.message ?? \"\");\n\t\tconst errorName = err.name ?? \"\";\n\t\tif (errorCode === \"commander.unknownCommand\" || errorCode === \"commander.unknownArgument\" || errorName === \"CommanderError\" && (errorMessage.includes(\"unknown command\") || errorMessage.includes(\"unknown argument\"))) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst match = errorMessage.match(/unknown command ['\"]([^'\"]+)['\"]/);\n\t\t\tconst commandName = match ? match[1] : process.argv[3] || process.argv[2] || \"unknown\";\n\t\t\tconst firstArg = process.argv[2];\n\t\t\tconst parentCommand = firstArg ? program.commands.find((cmd) => cmd.name() === firstArg) : void 0;\n\t\t\tif (parentCommand && commandName !== firstArg) {\n\t\t\t\tconst subNames = parentCommand.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, subNames)}\\n`);\n\t\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\t\tcommand: parentCommand,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t} else {\n\t\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\t\tconst helpText = formatRootHelp({\n\t\t\t\t\tprogram,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\t}\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.help\" || errorCode === \"commander.helpDisplayed\" || errorCode === \"outputHelp\" || errorMessage === \"(outputHelp)\" || errorMessage.includes(\"outputHelp\") || errorName === \"CommanderError\" && errorMessage.includes(\"outputHelp\")) {\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (errorCode === \"commander.missingArgument\" || errorCode === \"commander.missingMandatoryOptionValue\" || errorName === \"CommanderError\" && (errorMessage.includes(\"missing\") || errorMessage.includes(\"required\"))) {\n\t\t\tprocess.exit(2);\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(`Unhandled error: ${err.message}\\n`);\n\t\tif (err.stack) process.stderr.write(`${err.stack}\\n`);\n\t\tprocess.exit(1);\n\t}\n\tprocess.exit(0);\n});\nconst contractCommand = new Command(\"contract\");\nsetCommandDescriptions(contractCommand, \"Contract management commands\", \"Define and emit your application data contract. The contract describes your schema as a\\ndeclarative data structure that can be signed and verified against your database.\");\ncontractCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst contractEmitCommand = createContractEmitCommand();\ncontractCommand.addCommand(contractEmitCommand);\nconst contractInferCommand = createContractInferCommand();\ncontractCommand.addCommand(contractInferCommand);\nconst dbCommand = new Command(\"db\");\nsetCommandDescriptions(dbCommand, \"Database management commands\", \"Verify and sign your database with your contract. Ensure your database schema matches\\nyour contract, and sign it to record the contract hash for future verification.\");\ndbCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst dbVerifyCommand = createDbVerifyCommand();\ndbCommand.addCommand(dbVerifyCommand);\nconst dbInitCommand = createDbInitCommand();\ndbCommand.addCommand(dbInitCommand);\nconst dbUpdateCommand = createDbUpdateCommand();\ndbCommand.addCommand(dbUpdateCommand);\nconst dbSchemaCommand = createDbSchemaCommand();\ndbCommand.addCommand(dbSchemaCommand);\nconst dbSignCommand = createDbSignCommand();\ndbCommand.addCommand(dbSignCommand);\nconst migrationCommand = new Command(\"migration\");\nsetCommandDescriptions(migrationCommand, \"On-disk migration management commands\", \"Plan, apply, and scaffold on-disk migration packages. Migrations are\\ncontract-to-contract edges stored as versioned directories under migrations/.\");\nmigrationCommand.configureHelp({\n\tformatHelp: (cmd) => {\n\t\treturn formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t});\n\t},\n\tsubcommandDescription: () => \"\"\n});\nconst migrationPlanCommand = createMigrationPlanCommand();\nmigrationCommand.addCommand(migrationPlanCommand);\nconst migrationNewCommand = createMigrationNewCommand();\nmigrationCommand.addCommand(migrationNewCommand);\nconst migrationShowCommand = createMigrationShowCommand();\nmigrationCommand.addCommand(migrationShowCommand);\nconst migrationStatusCommand = createMigrationStatusCommand();\nmigrationCommand.addCommand(migrationStatusCommand);\nconst migrationLogCommand = createMigrationLogCommand();\nmigrationCommand.addCommand(migrationLogCommand);\nconst migrationListCommand = createMigrationListCommand();\nmigrationCommand.addCommand(migrationListCommand);\nconst migrationGraphCommand = createMigrationGraphCommand();\nmigrationCommand.addCommand(migrationGraphCommand);\nconst migrationCheckCommand = createMigrationCheckCommand();\nmigrationCommand.addCommand(migrationCheckCommand);\nconst migrateCommand = createMigrateCommand();\nconst refCommand = createRefCommand();\nconst telemetryCommand = createTelemetryCommand();\nconst initCommand = createInitCommand();\nconst formatCommand = createFormatCommand();\nconst lspCommand = createLspCommand();\nprogram.addCommand(initCommand);\nprogram.addCommand(migrateCommand);\nprogram.addCommand(formatCommand);\nprogram.addCommand(lspCommand);\nprogram.addCommand(contractCommand);\nprogram.addCommand(dbCommand);\nprogram.addCommand(migrationCommand);\nprogram.addCommand(refCommand);\nprogram.addCommand(telemetryCommand);\nconst TELEMETRY_CRASH_TEST_SLEEP_MS = 200;\nif (process.env[\"PRISMA_NEXT_ENABLE_TEST_COMMANDS\"] === \"1\") {\n\tconst telemetryCrashTestCommand = new Command(\"__telemetry-crash-test\").description(\"Internal: deliberately throw for the telemetry e2e suite.\").action(async () => {\n\t\tawait new Promise((settle) => setTimeout(settle, TELEMETRY_CRASH_TEST_SLEEP_MS));\n\t\tthrow new Error(\"__telemetry-crash-test: intentional crash for e2e coverage\");\n\t});\n\ttelemetryCrashTestCommand.configureHelp({ visibleCommands: () => [] });\n\tprogram.addCommand(telemetryCrashTestCommand, { hidden: true });\n}\nconst helpCommand = new Command(\"help\").description(\"Show usage instructions\").configureHelp({ formatHelp: (cmd) => {\n\treturn formatCommandHelp({\n\t\tcommand: cmd,\n\t\tflags: parseGlobalFlags({})\n\t});\n} }).action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stdout.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nprogram.addCommand(helpCommand);\nprogram.action(() => {\n\tconst flags = parseGlobalFlags({});\n\tconst helpText = formatRootHelp({\n\t\tprogram,\n\t\tflags\n\t});\n\tprocess.stderr.write(`${helpText}\\n`);\n\tprocess.exit(0);\n});\nconst args = process.argv.slice(2);\nif (args.length > 0) {\n\tconst commandName = args[0];\n\tif (commandName === \"--version\" || commandName === \"-V\") {\n\t\tprocess.stdout.write(`${program.version()}\\n`);\n\t\tprocess.exit(0);\n\t}\n\tif (!(commandName === \"--help\" || commandName === \"-h\")) {\n\t\tconst command = program.commands.find((cmd) => cmd.name() === commandName);\n\t\tif (!command) {\n\t\t\tconst flags = parseGlobalFlags({});\n\t\t\tconst topNames = program.commands.map((c) => c.name());\n\t\t\tprocess.stderr.write(`Unknown command: ${commandName}${formatSuggestion(commandName, topNames)}\\n`);\n\t\t\tconst helpText = formatRootHelp({\n\t\t\t\tprogram,\n\t\t\t\tflags\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(2);\n\t\t} else if (command.commands.length > 0 && args.length >= 2) {\n\t\t\tconst subcommandName = args[1];\n\t\t\tconst redirect = removedVerbRedirects[`${commandName}:${subcommandName}`];\n\t\t\tif (redirect) {\n\t\t\t\tprocess.stderr.write(`Unknown command: ${subcommandName}\\n${redirect}\\n`);\n\t\t\t\tprocess.exit(2);\n\t\t\t}\n\t\t\tfor (let i = 2; i < args.length; i++) {\n\t\t\t\tconst arg = args[i];\n\t\t\t\tif (!arg.startsWith(\"--\")) continue;\n\t\t\t\tconst flagRedirect = removedFlagRedirects[`${commandName}:${subcommandName}:${arg.slice(2)}`];\n\t\t\t\tif (flagRedirect) {\n\t\t\t\t\tprocess.stderr.write(`Unknown option: ${arg}\\n${flagRedirect}\\n`);\n\t\t\t\t\tprocess.exit(2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (command.commands.length > 0 && args.length === 1) {\n\t\t\tconst helpText = formatCommandHelp({\n\t\t\t\tcommand,\n\t\t\t\tflags: parseGlobalFlags({})\n\t\t\t});\n\t\t\tprocess.stderr.write(`${helpText}\\n`);\n\t\t\tprocess.exit(0);\n\t\t}\n\t}\n}\nprogram.parse();\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t, version as u };\n\n//# sourceMappingURL=cli.mjs.map"],"mappings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EACD;EACA,IAAI,QAAQ,SAAS,SAAS,KAAK,KAAK,WAAW,GAAG;GACrD,MAAM,WAAW,kBAAkB;IAClC;IACA,OAAO,iBAAiB,CAAC,CAAC;GAC3B,CAAC;GACD,QAAQ,OAAO,MAAM,GAAG,SAAS,GAAG;GACpC,QAAQ,KAAK,CAAC;EACf;CACD;AACD;AACA,QAAQ,MAAM"}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
//#region ../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.d.mts
|
|
2
|
+
//#region src/endpoint.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Production endpoint pinned to the deployed Prisma Compute backend.
|
|
5
|
+
* Compiled as a build-time constant; not user-configurable.
|
|
6
|
+
*/
|
|
7
|
+
declare const TELEMETRY_BACKEND_URL = "https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build";
|
|
8
|
+
/**
|
|
9
|
+
* Path within the backend that accepts telemetry POSTs.
|
|
10
|
+
*/
|
|
11
|
+
declare const TELEMETRY_ENDPOINT_PATH = "/events";
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the full POST URL the sender targets. The
|
|
14
|
+
* `PRISMA_NEXT_TELEMETRY_ENDPOINT` env var is an integration-testing
|
|
15
|
+
* affordance only — it lets the test suite spin up a mock HTTP server
|
|
16
|
+
* on an ephemeral port and point the spawned sender at it. The override
|
|
17
|
+
* is intentionally undocumented in user-facing material.
|
|
18
|
+
*
|
|
19
|
+
* Fail-open: a malformed override (typo in a dev shell, bad CI config)
|
|
20
|
+
* silently falls back to the production backend rather than throwing,
|
|
21
|
+
* matching the telemetry layer's broader silent-on-failure contract.
|
|
22
|
+
*/
|
|
23
|
+
declare function resolveTelemetryEndpoint(env?: Readonly<Record<string, string | undefined>>): string;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/payload.d.ts
|
|
26
|
+
/**
|
|
27
|
+
* Wire-shape payload the parent IPC-sends to the forked child sender.
|
|
28
|
+
* Mirrors only the fields the parent has naturally in hand at command
|
|
29
|
+
* start: installation id, sanitised command + flags, CLI version, and
|
|
30
|
+
* the project root the child uses to discover everything else. The
|
|
31
|
+
* child probes its own process (runtime/os/arch, package manager, ts
|
|
32
|
+
* version, agent) and reads the user's `prisma-next.config.*` via
|
|
33
|
+
* c12 to derive `databaseTarget` and `extensions`.
|
|
34
|
+
*
|
|
35
|
+
* Loading c12 on the parent side would put a `loadConfig()` await on
|
|
36
|
+
* the command's hot path between gate resolution and `fork()`,
|
|
37
|
+
* opening a race against any CLI command that throws synchronously
|
|
38
|
+
* before that await resolves (the parent exits before forking the
|
|
39
|
+
* sender, and the telemetry event is lost). Moving the load into the
|
|
40
|
+
* detached child eliminates that race; the trade is that the child
|
|
41
|
+
* now evaluates user TS config code, so it's gated behind the same
|
|
42
|
+
* privacy checks the parent already resolved before forking.
|
|
43
|
+
*
|
|
44
|
+
* `databaseTarget` is an optional parent-side override for the
|
|
45
|
+
* c12-derived value: the first-`init` invocation supplies the
|
|
46
|
+
* prompt-chosen target via this field because the config file does
|
|
47
|
+
* not yet exist on disk at that moment. Every other invocation
|
|
48
|
+
* leaves it unset (`undefined`) and the child's c12 load determines
|
|
49
|
+
* the value — there is no third state, so the field's type is
|
|
50
|
+
* `string | undefined`, not `string | null | undefined`.
|
|
51
|
+
*
|
|
52
|
+
* Both sides version-couple on this shape because the IPC carrier is
|
|
53
|
+
* structured-cloned by Node and there's no on-wire compat to maintain.
|
|
54
|
+
*/
|
|
55
|
+
interface ParentToSenderPayload {
|
|
56
|
+
readonly installationId: string;
|
|
57
|
+
readonly version: string;
|
|
58
|
+
readonly command: string;
|
|
59
|
+
readonly flags: readonly string[];
|
|
60
|
+
/**
|
|
61
|
+
* Absolute path of the user's project. The child reads
|
|
62
|
+
* `<projectRoot>/package.json` for `tsVersion` and loads
|
|
63
|
+
* `<projectRoot>/prisma-next.config.*` via c12 for `databaseTarget`
|
|
64
|
+
* + `extensions`.
|
|
65
|
+
*/
|
|
66
|
+
readonly projectRoot: string;
|
|
67
|
+
/** Resolved endpoint URL (already includes the `/events` path). */
|
|
68
|
+
readonly endpoint: string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional parent-side override for the c12-derived database target.
|
|
71
|
+
* Set by `fireTelemetryAfterInitConsent` (the first-`init` path,
|
|
72
|
+
* where the config file is about to be written but doesn't exist
|
|
73
|
+
* yet); left undefined by `fireTelemetryFromPreAction` (steady
|
|
74
|
+
* state, child resolves the value via c12). The wire-format
|
|
75
|
+
* `TelemetryEvent.databaseTarget: string | null` keeps `null` as
|
|
76
|
+
* the on-the-wire "no target known" marker, but the IPC override
|
|
77
|
+
* channel only needs two states so it's `string | undefined`.
|
|
78
|
+
*/
|
|
79
|
+
readonly databaseTarget?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The full event the child POSTs to the backend. Shape matches the
|
|
83
|
+
* backend's arktype schema (`apps/telemetry-backend/src/schema.ts`).
|
|
84
|
+
*/
|
|
85
|
+
interface TelemetryEvent {
|
|
86
|
+
readonly installationId: string;
|
|
87
|
+
readonly version: string;
|
|
88
|
+
readonly command: string;
|
|
89
|
+
readonly flags: readonly string[];
|
|
90
|
+
readonly runtimeName: string;
|
|
91
|
+
readonly runtimeVersion: string;
|
|
92
|
+
readonly os: string;
|
|
93
|
+
readonly arch: string;
|
|
94
|
+
readonly packageManager: string | null;
|
|
95
|
+
readonly databaseTarget: string | null;
|
|
96
|
+
readonly tsVersion: string | null;
|
|
97
|
+
readonly agent: string | null;
|
|
98
|
+
readonly extensions: readonly string[];
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/enrich.d.ts
|
|
102
|
+
/**
|
|
103
|
+
* Subset of the user's `prisma-next.config.*` the telemetry event
|
|
104
|
+
* surfaces. Loaded inside the detached child via {@link loadProjectConfig}
|
|
105
|
+
* — see the design rationale on {@link ParentToSenderPayload} for why
|
|
106
|
+
* this side runs c12 instead of the parent CLI.
|
|
107
|
+
*/
|
|
108
|
+
interface ProjectConfigFields {
|
|
109
|
+
readonly databaseTarget: string | null;
|
|
110
|
+
readonly extensions: readonly string[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Best-effort load of `prisma-next.config.*` from `projectRoot`,
|
|
114
|
+
* validated against the canonical `@internal/config` schema.
|
|
115
|
+
* Returns `{ databaseTarget: null, extensions: [] }` on any failure
|
|
116
|
+
* mode — missing config file (e.g. before `prisma-next init`), c12
|
|
117
|
+
* throws while evaluating user TS, validator rejects a malformed
|
|
118
|
+
* shape, etc. Telemetry is non-blocking and best-effort; an empty
|
|
119
|
+
* result is the only downside of an unloadable or invalid config.
|
|
120
|
+
*
|
|
121
|
+
* Both `c12` and `@internal/config/config-validation` are imported
|
|
122
|
+
* lazily so the detached sender's cold-start cost is paid only when
|
|
123
|
+
* telemetry actually fires, not on every fork even when gates
|
|
124
|
+
* short-circuit before reaching this code path.
|
|
125
|
+
*/
|
|
126
|
+
declare function loadProjectConfig(projectRoot: string): Promise<ProjectConfigFields>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/user-config.d.ts
|
|
129
|
+
/**
|
|
130
|
+
* The user-level config file. Persists the telemetry flag and the
|
|
131
|
+
* installation UUID. Under the opt-out model the flag stays `undefined`
|
|
132
|
+
* until the user makes an explicit choice (default-on first run mints
|
|
133
|
+
* only the id via {@link ensureInstallationId}), and an env-var opt-out
|
|
134
|
+
* never mutates disk. Once the id exists it survives any
|
|
135
|
+
* on → off → on cycle, keeping the same UUID (correct for MAU continuity).
|
|
136
|
+
*
|
|
137
|
+
* Readers tolerate unknown fields for forward compat; writers merge
|
|
138
|
+
* partials into the existing object so unknown fields are preserved.
|
|
139
|
+
*/
|
|
140
|
+
interface UserConfig {
|
|
141
|
+
readonly enableTelemetry?: boolean;
|
|
142
|
+
readonly installationId?: string;
|
|
143
|
+
readonly [key: string]: unknown;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Path to the user-level config file. Resolved per call so test
|
|
147
|
+
* harnesses can mutate `$XDG_CONFIG_HOME` between cases.
|
|
148
|
+
*/
|
|
149
|
+
declare function userConfigPath(): string;
|
|
150
|
+
/**
|
|
151
|
+
* Reads the user-level config. File-missing, unreadable, or malformed →
|
|
152
|
+
* `{}` (the absence of consent is the same answer in every error mode).
|
|
153
|
+
* Unknown fields from a future client are passed through verbatim.
|
|
154
|
+
*/
|
|
155
|
+
declare function readUserConfig(): UserConfig;
|
|
156
|
+
/**
|
|
157
|
+
* Merges `partial` into the current config and writes the result
|
|
158
|
+
* atomically (temp file + rename) so a crash mid-write never leaves a
|
|
159
|
+
* half-baked file readable on disk. Unknown fields already on disk are
|
|
160
|
+
* preserved.
|
|
161
|
+
*
|
|
162
|
+
* When `partial.enableTelemetry === true` and no `installationId` is
|
|
163
|
+
* stored yet, generates a v4 random UUID and persists both fields in
|
|
164
|
+
* the same write. An existing `installationId` is never rotated. This is
|
|
165
|
+
* the *explicit-consent* mint path: a `false` answer
|
|
166
|
+
* (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare
|
|
167
|
+
* `writeUserConfig({ installationId })` mints nothing extra. The default-on
|
|
168
|
+
* first-send path mints its id separately via {@link ensureInstallationId},
|
|
169
|
+
* which records no consent answer.
|
|
170
|
+
*/
|
|
171
|
+
declare function writeUserConfig(partial: Partial<UserConfig>): void;
|
|
172
|
+
/**
|
|
173
|
+
* Returns the stored `installationId`, minting and persisting a fresh v4
|
|
174
|
+
* UUID when none exists yet. Crucially, this persists *only* the id —
|
|
175
|
+
* `enableTelemetry` is left untouched (stays `undefined` on a default-on
|
|
176
|
+
* first run), so the interactive `init` consent prompt is not wrongly
|
|
177
|
+
* suppressed and no explicit consent the user never gave is recorded.
|
|
178
|
+
*
|
|
179
|
+
* Used by the default-on first-run fire path: the gate has already
|
|
180
|
+
* resolved enabled, so this only ever runs when telemetry is on.
|
|
181
|
+
*/
|
|
182
|
+
declare function ensureInstallationId(): string;
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/gating.d.ts
|
|
185
|
+
/**
|
|
186
|
+
* Why telemetry was disabled. Useful for debug-mode logging in the
|
|
187
|
+
* parent; never surfaces to users.
|
|
188
|
+
*/
|
|
189
|
+
type GatingDisabledReason = 'env-override' | 'stored-opt-out';
|
|
190
|
+
type GatingResolution = {
|
|
191
|
+
readonly enabled: true;
|
|
192
|
+
} | {
|
|
193
|
+
readonly enabled: false;
|
|
194
|
+
readonly reason: GatingDisabledReason;
|
|
195
|
+
};
|
|
196
|
+
interface GatingInputs {
|
|
197
|
+
/**
|
|
198
|
+
* Environment-variable lookups the resolver consults. Tests pass a
|
|
199
|
+
* literal record; production passes `process.env`. The two opt-out
|
|
200
|
+
* signals are `PRISMA_NEXT_DISABLE_TELEMETRY` (Prisma-specific) and
|
|
201
|
+
* `DO_NOT_TRACK` (community convention).
|
|
202
|
+
*/
|
|
203
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
204
|
+
/** Result of `readUserConfig()` — file-missing tolerated as `{}`. */
|
|
205
|
+
readonly config: UserConfig;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Pure-function resolution of the gating decision. Same input → same
|
|
209
|
+
* output; no I/O. The caller is responsible for reading the env and the
|
|
210
|
+
* user config.
|
|
211
|
+
*
|
|
212
|
+
* Decision order:
|
|
213
|
+
* 1. Env-var override (`PRISMA_NEXT_DISABLE_TELEMETRY` truthy, or
|
|
214
|
+
* `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an
|
|
215
|
+
* opt-out env var wins over any stored or unset preference.
|
|
216
|
+
* 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).
|
|
217
|
+
* 3. Stored `enableTelemetry === true` → enabled.
|
|
218
|
+
* 4. Stored `enableTelemetry === undefined` (file missing, or field
|
|
219
|
+
* not set) → ENABLED. This is the opt-out default: absence of an
|
|
220
|
+
* explicit choice means telemetry is on. This is the load-bearing,
|
|
221
|
+
* counter-intuitive branch — do not "fix" it to default-off.
|
|
222
|
+
*
|
|
223
|
+
* Telemetry is disabled only when an env override is active or
|
|
224
|
+
* `enableTelemetry` is explicitly `false`.
|
|
225
|
+
*/
|
|
226
|
+
declare function resolveGating(inputs: GatingInputs): GatingResolution;
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/sanitize.d.ts
|
|
229
|
+
interface CommanderOptionShape {
|
|
230
|
+
/** Commander's option attribute name, e.g. `dryRun` for `--dry-run`. */
|
|
231
|
+
readonly attributeName: string;
|
|
232
|
+
/** Commander's long, user-facing flag spelling, e.g. `--dry-run` or `--no-install`. */
|
|
233
|
+
readonly longName: string | null;
|
|
234
|
+
/** Commander's value source for this option. Only `cli` is user-supplied. */
|
|
235
|
+
readonly source: string | null;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Input shape: a thin projection of commander's parsed-result surface.
|
|
239
|
+
* The parent extracts the command path, positional args, and per-option
|
|
240
|
+
* metadata from the leaf command. The sanitiser never consumes raw
|
|
241
|
+
* argv, never reads `process.argv`, and never sees flag values.
|
|
242
|
+
*/
|
|
243
|
+
interface CommanderResultShape {
|
|
244
|
+
/**
|
|
245
|
+
* The full command path from the root program to the leaf, including
|
|
246
|
+
* the root program name as the first element (the sanitiser drops it).
|
|
247
|
+
* Example: `['prisma-next', 'migration', 'new']`.
|
|
248
|
+
*/
|
|
249
|
+
readonly commandPath: readonly string[];
|
|
250
|
+
/**
|
|
251
|
+
* Positional arguments commander parsed for the leaf command.
|
|
252
|
+
* **Intentionally never read.** Accepted so the call site doesn't have
|
|
253
|
+
* to think about whether to pass it; the sanitiser's contract is that
|
|
254
|
+
* positionals never leave the parent process.
|
|
255
|
+
*/
|
|
256
|
+
readonly positionalArgs: readonly string[];
|
|
257
|
+
/**
|
|
258
|
+
* Per-option Commander metadata. The sanitiser emits only options whose
|
|
259
|
+
* source is `cli`, and uses `longName` so telemetry sees user-facing
|
|
260
|
+
* names (`dry-run`, `connection-string`, `no-install`) rather than
|
|
261
|
+
* Commander's internal camelCase attribute names or defaulted options.
|
|
262
|
+
*/
|
|
263
|
+
readonly options: readonly CommanderOptionShape[];
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Output shape: the sanitised projection that flows into the telemetry
|
|
267
|
+
* payload. Two fields only — command name (space-delimited subcommand
|
|
268
|
+
* path) and flag names (in commander's option declaration order).
|
|
269
|
+
*/
|
|
270
|
+
interface SanitisedCommand {
|
|
271
|
+
readonly command: string;
|
|
272
|
+
readonly flags: readonly string[];
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Project commander's parsed result into the wire-shape command and
|
|
276
|
+
* flag-name list. Pure; the only allowed inputs are the fields of
|
|
277
|
+
* `CommanderResultShape`.
|
|
278
|
+
*
|
|
279
|
+
* Sanitiser contract — no flag values, no positionals, no raw argv:
|
|
280
|
+
* - Drop the root program name (`commandPath[0]`); the wire ships
|
|
281
|
+
* `migration new`, not `prisma-next migration new`.
|
|
282
|
+
* - Emit only options whose Commander source is `cli`.
|
|
283
|
+
* - Emit the long user-facing flag spelling without the `--` prefix;
|
|
284
|
+
* never emit Commander's camelCase attribute names.
|
|
285
|
+
* - `positionalArgs` is accepted but never consumed; the field exists
|
|
286
|
+
* in the input type to make it obvious at the call site that
|
|
287
|
+
* positionals were deliberately excluded.
|
|
288
|
+
*/
|
|
289
|
+
declare function sanitizeCommanderResult(input: CommanderResultShape): SanitisedCommand;
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/spawn.d.ts
|
|
292
|
+
/**
|
|
293
|
+
* Inputs the CLI entry point hands the telemetry layer at command
|
|
294
|
+
* start. The CLI is responsible for stitching commander's result and
|
|
295
|
+
* the project root together; the telemetry module does no I/O of its
|
|
296
|
+
* own except for the user-config read (skipped when `userConfig` is
|
|
297
|
+
* provided). `extensions` is deliberately absent: the detached child
|
|
298
|
+
* loads `prisma-next.config.*` via c12 itself and derives the
|
|
299
|
+
* extension-pack ids from the validated config — see the rationale
|
|
300
|
+
* on `ParentToSenderPayload` for why c12 lives in the child rather
|
|
301
|
+
* than on the parent's hot path.
|
|
302
|
+
*
|
|
303
|
+
* `databaseTarget` is an optional parent-side override forwarded to
|
|
304
|
+
* the child. Set by `fireTelemetryAfterInitConsent` (where the
|
|
305
|
+
* config file does not yet exist on disk); left unset by the
|
|
306
|
+
* preAction-hook path so the child's c12 load supplies the value.
|
|
307
|
+
*/
|
|
308
|
+
interface RunTelemetryInputs {
|
|
309
|
+
/** Sanitised commander snapshot — see `CommanderResultShape`. */
|
|
310
|
+
readonly command: CommanderResultShape;
|
|
311
|
+
/** This CLI's own version (from its `package.json`). */
|
|
312
|
+
readonly version: string;
|
|
313
|
+
/** Absolute path of the project root (typically `process.cwd()`). */
|
|
314
|
+
readonly projectRoot: string;
|
|
315
|
+
/**
|
|
316
|
+
* Optional parent-side override for the c12-derived database target,
|
|
317
|
+
* forwarded verbatim to the child sender. Wins over the child's
|
|
318
|
+
* c12-derived value when present; `undefined` means "no override".
|
|
319
|
+
*/
|
|
320
|
+
readonly databaseTarget?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Path to the sender entry compiled into this package's `dist/`.
|
|
323
|
+
* Resolved by the caller because the compiled sender lives at
|
|
324
|
+
* `<package>/dist/sender.mjs` and only the consumer knows its own
|
|
325
|
+
* `import.meta.url`.
|
|
326
|
+
*/
|
|
327
|
+
readonly senderPath: string;
|
|
328
|
+
/**
|
|
329
|
+
* `isCI()` result from the consumer. Telemetry is suppressed when
|
|
330
|
+
* `true` regardless of the stored consent answer — CI environments
|
|
331
|
+
* never emit (matches the colour-output convention's CI suppression).
|
|
332
|
+
*/
|
|
333
|
+
readonly isCI: boolean;
|
|
334
|
+
/** Process env to read for opt-out signals. Defaults to `process.env`. */
|
|
335
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
336
|
+
/** Cached user config when the caller already read it to resolve gates before other work. */
|
|
337
|
+
readonly userConfig?: UserConfig;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Best-effort telemetry spawn at command start. Returns synchronously —
|
|
341
|
+
* the fork runs in the background and never blocks the parent. Every
|
|
342
|
+
* failure mode is swallowed; the parent's stdout/stderr is untouched in
|
|
343
|
+
* normal operation, the only escape valve being
|
|
344
|
+
* `PRISMA_NEXT_DEBUG=1` which routes diagnostics to stderr.
|
|
345
|
+
*
|
|
346
|
+
* Returns the spawn outcome so debug-mode logging and the test-harness
|
|
347
|
+
* probe (which verifies test runs short-circuit the fork) can inspect
|
|
348
|
+
* the decision without scraping stderr.
|
|
349
|
+
*/
|
|
350
|
+
type TelemetryRunOutcome = {
|
|
351
|
+
readonly spawned: true;
|
|
352
|
+
} | {
|
|
353
|
+
readonly spawned: false;
|
|
354
|
+
readonly reason: 'gated-off' | 'ci' | 'fork-failed';
|
|
355
|
+
};
|
|
356
|
+
declare function runTelemetry(inputs: RunTelemetryInputs): TelemetryRunOutcome;
|
|
357
|
+
/**
|
|
358
|
+
* Resolve the path to the compiled sender entry relative to a consumer
|
|
359
|
+
* that has captured its own `import.meta.url`. The CLI's
|
|
360
|
+
* `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the
|
|
361
|
+
* consumer asks `senderModuleUrl()` and forwards the result to
|
|
362
|
+
* `runTelemetry({ senderPath })`.
|
|
363
|
+
*/
|
|
364
|
+
declare function senderModuleUrl(importMetaUrl: string): string;
|
|
365
|
+
//#endregion
|
|
366
|
+
export { type CommanderOptionShape, type CommanderResultShape, type GatingDisabledReason, type GatingInputs, type GatingResolution, type ParentToSenderPayload, type ProjectConfigFields, type RunTelemetryInputs, type SanitisedCommand, TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, type TelemetryEvent, type TelemetryRunOutcome, type UserConfig, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };
|
|
367
|
+
//# sourceMappingURL=cli-telemetry.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-telemetry.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.d.mts"],"mappings":";;;;;;cAKc;;;;cAIA;;;;;;;;;;;;iBAYG,yBAAyB,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAgC/C;WACC;WACA;WACA;WACA;;;;;;;WAOA;;WAEA;;;;;;;;;;;WAWA;;;;;;UAMD;WACC;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;;;;;UAUD;WACC;WACA;;;;;;;;;;;;;;;;iBAgBM,kBAAkB,sBAAsB,QAAQ;;;;;;;;;;;;;;UAcvD;WACC;WACA;YACC;;;;;;iBAMK;;;;;;iBAMA,kBAAkB;;;;;;;;;;;;;;;;iBAgBlB,gBAAgB,SAAS,QAAQ;;;;;;;;;;;iBAWjC;;;;;;;KAOZ;KACA;WACM;;WAEA;WACA,QAAQ;;UAET;;;;;;;WAOC,KAAK,SAAS;;WAEd,QAAQ;;;;;;;;;;;;;;;;;;;;;iBAqBF,cAAc,QAAQ,eAAe;;;UAG5C;;WAEC;;WAEA;;WAEA;;;;;;;;UAQD;;;;;;WAMC;;;;;;;WAOA;;;;;;;WAOA,kBAAkB;;;;;;;UAOnB;WACC;WACA;;;;;;;;;;;;;;;;;iBAiBM,wBAAwB,OAAO,uBAAuB;;;;;;;;;;;;;;;;;;;UAmB7D;;WAEC,SAAS;;WAET;;WAEA;;;;;;WAMA;;;;;;;WAOA;;;;;;WAMA;;WAEA,MAAM,SAAS;;WAEf,aAAa;;;;;;;;;;;;;KAanB;WACM;;WAEA;WACA;;iBAEM,aAAa,QAAQ,qBAAqB;;;;;;;;iBAQ1C,gBAAgB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { a as resolveGating, c as sanitizeCommanderResult, d as writeUserConfig, i as readUserConfig, l as senderModuleUrl, n as TELEMETRY_ENDPOINT_PATH, o as resolveTelemetryEndpoint, r as ensureInstallationId, s as runTelemetry, t as TELEMETRY_BACKEND_URL, u as userConfigPath } from "./exports-BN0vFTxG.mjs";
|
|
2
|
+
import "pathe";
|
|
3
|
+
import "node:fs";
|
|
4
|
+
import "@vercel/detect-agent";
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli-telemetry/dist/enrich-CtoCke3N.mjs
|
|
6
|
+
const EMPTY_PROJECT_CONFIG = {
|
|
7
|
+
databaseTarget: null,
|
|
8
|
+
extensions: []
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Best-effort load of `prisma-next.config.*` from `projectRoot`,
|
|
12
|
+
* validated against the canonical `@internal/config` schema.
|
|
13
|
+
* Returns `{ databaseTarget: null, extensions: [] }` on any failure
|
|
14
|
+
* mode — missing config file (e.g. before `prisma-next init`), c12
|
|
15
|
+
* throws while evaluating user TS, validator rejects a malformed
|
|
16
|
+
* shape, etc. Telemetry is non-blocking and best-effort; an empty
|
|
17
|
+
* result is the only downside of an unloadable or invalid config.
|
|
18
|
+
*
|
|
19
|
+
* Both `c12` and `@internal/config/config-validation` are imported
|
|
20
|
+
* lazily so the detached sender's cold-start cost is paid only when
|
|
21
|
+
* telemetry actually fires, not on every fork even when gates
|
|
22
|
+
* short-circuit before reaching this code path.
|
|
23
|
+
*/
|
|
24
|
+
async function loadProjectConfig(projectRoot) {
|
|
25
|
+
try {
|
|
26
|
+
const { loadConfig } = await import("c12");
|
|
27
|
+
const config = (await loadConfig({
|
|
28
|
+
name: "prisma-next",
|
|
29
|
+
cwd: projectRoot,
|
|
30
|
+
dotenv: false,
|
|
31
|
+
rcFile: false,
|
|
32
|
+
globalRc: false
|
|
33
|
+
})).config ?? null;
|
|
34
|
+
if (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;
|
|
35
|
+
const validate = (await import("@prisma/orm-framework/config/config-validation")).validateConfig;
|
|
36
|
+
validate(config);
|
|
37
|
+
return {
|
|
38
|
+
databaseTarget: config.target.targetId,
|
|
39
|
+
extensions: (config.extensions ?? []).map((pack) => pack.id)
|
|
40
|
+
};
|
|
41
|
+
} catch {
|
|
42
|
+
return EMPTY_PROJECT_CONFIG;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=cli-telemetry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-telemetry.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/enrich-CtoCke3N.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { determineAgent } from \"@vercel/detect-agent\";\nimport { join } from \"pathe\";\n//#region src/enrich.ts\nconst EMPTY_PROJECT_CONFIG = {\n\tdatabaseTarget: null,\n\textensions: []\n};\n/**\n* Best-effort load of `prisma-next.config.*` from `projectRoot`,\n* validated against the canonical `@internal/config` schema.\n* Returns `{ databaseTarget: null, extensions: [] }` on any failure\n* mode — missing config file (e.g. before `prisma-next init`), c12\n* throws while evaluating user TS, validator rejects a malformed\n* shape, etc. Telemetry is non-blocking and best-effort; an empty\n* result is the only downside of an unloadable or invalid config.\n*\n* Both `c12` and `@internal/config/config-validation` are imported\n* lazily so the detached sender's cold-start cost is paid only when\n* telemetry actually fires, not on every fork even when gates\n* short-circuit before reaching this code path.\n*/\nasync function loadProjectConfig(projectRoot) {\n\ttry {\n\t\tconst { loadConfig } = await import(\"c12\");\n\t\tconst config = (await loadConfig({\n\t\t\tname: \"prisma-next\",\n\t\t\tcwd: projectRoot,\n\t\t\tdotenv: false,\n\t\t\trcFile: false,\n\t\t\tglobalRc: false\n\t\t})).config ?? null;\n\t\tif (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst validate = (await import(\"@internal/config/config-validation\")).validateConfig;\n\t\tvalidate(config);\n\t\treturn {\n\t\t\tdatabaseTarget: config.target.targetId,\n\t\t\textensions: (config.extensions ?? []).map((pack) => pack.id)\n\t\t};\n\t} catch {\n\t\treturn EMPTY_PROJECT_CONFIG;\n\t}\n}\n/**\n* Identify the runtime the sender is running in. Same-runtime as the\n* parent is a correctness requirement: the parent forked us via\n* `child_process.fork`, which inherits the parent's runtime. Detection\n* keys on the runtime-specific version field rather than env vars so a\n* spoofed env can't lie about the actual interpreter.\n*/\nfunction resolveRuntime(versions) {\n\tif (versions.bun !== void 0) return {\n\t\tname: \"bun\",\n\t\tversion: versions.bun\n\t};\n\tif (versions.deno !== void 0) return {\n\t\tname: \"deno\",\n\t\tversion: versions.deno\n\t};\n\treturn {\n\t\tname: \"node\",\n\t\tversion: versions.node\n\t};\n}\n/**\n* Parse `npm_config_user_agent` into a `<pm>/<version>` token. The\n* value, when present, looks like\n* `\"pnpm/10.27.0 npm/? node/v24.13.0 darwin arm64\"` — we take the first\n* whitespace-separated token. Any failure → `null`.\n*/\nfunction parsePackageManager(userAgent) {\n\tif (userAgent === void 0) return null;\n\tconst first = userAgent.split(/\\s+/)[0];\n\tif (first === void 0 || first.length === 0) return null;\n\tif (!first.includes(\"/\")) return null;\n\treturn first;\n}\n/**\n* Read the user's project `package.json` and resolve a TypeScript\n* version from `devDependencies.typescript` (preferred) or\n* `dependencies.typescript`. Strips a leading `^` or `~` semver\n* prefix. Returns `null` on any failure mode — file missing,\n* unreadable, malformed JSON, key absent, not a string.\n*/\nfunction readTsVersionFromPackageJson(raw) {\n\tif (raw === null) return null;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst candidate = pickStringDep(parsed[\"devDependencies\"]) ?? pickStringDep(parsed[\"dependencies\"]);\n\tif (candidate === null) return null;\n\treturn candidate.replace(/^[\\^~]/, \"\");\n}\nfunction pickStringDep(deps) {\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tconst value = deps[\"typescript\"];\n\treturn typeof value === \"string\" ? value : null;\n}\n/**\n* Build the full backend event from the parent's payload, the\n* c12-loaded project-config slice, and the child's per-process\n* snapshot. Pure given a `projectConfig` + `EnrichEnvironment`.\n*/\nfunction buildTelemetryEvent(payload, projectConfig, env) {\n\tconst runtime = resolveRuntime(env.versions);\n\treturn {\n\t\tinstallationId: payload.installationId,\n\t\tversion: payload.version,\n\t\tcommand: payload.command,\n\t\tflags: payload.flags,\n\t\truntimeName: runtime.name,\n\t\truntimeVersion: runtime.version,\n\t\tos: env.platform,\n\t\tarch: env.arch,\n\t\tpackageManager: parsePackageManager(env.env[\"npm_config_user_agent\"]),\n\t\tdatabaseTarget: projectConfig.databaseTarget,\n\t\ttsVersion: readTsVersionFromPackageJson(env.readProjectPackageJson()),\n\t\tagent: env.agent,\n\t\textensions: projectConfig.extensions\n\t};\n}\n/**\n* Resolve the agent label for the telemetry event via\n* `@vercel/detect-agent`, collapsing its discriminated result to the\n* event's `string | null` shape. Any detection failure counts as\n* \"no agent\" — telemetry is best-effort and non-blocking.\n*/\nasync function resolveAgentLabel() {\n\ttry {\n\t\tconst result = await determineAgent();\n\t\treturn result.isAgent ? result.agent.name : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Convenience for the sender entry: build the event from the live\n* `process` plus a c12 load of `prisma-next.config.*` from\n* `payload.projectRoot` plus a real project-package.json reader,\n* swallowing any I/O errors in the file read.\n*\n* The parent's `payload.databaseTarget` (when present) wins over the\n* c12-derived value. The parent sets this for the first-`init` run,\n* where the config file does not exist on disk yet but the user has\n* just declared a target via the consent prompt; every other\n* invocation leaves it unset and the c12 load supplies the value.\n*/\nasync function buildTelemetryEventFromProcess(payload) {\n\tconst loadedConfig = await loadProjectConfig(payload.projectRoot);\n\treturn buildTelemetryEvent(payload, {\n\t\tdatabaseTarget: payload.databaseTarget ?? loadedConfig.databaseTarget,\n\t\textensions: loadedConfig.extensions\n\t}, {\n\t\tplatform: process.platform,\n\t\tarch: process.arch,\n\t\tversions: process.versions,\n\t\tenv: process.env,\n\t\tagent: await resolveAgentLabel(),\n\t\treadProjectPackageJson: () => {\n\t\t\ttry {\n\t\t\t\treturn readFileSync(join(payload.projectRoot, \"package.json\"), \"utf-8\");\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { loadProjectConfig as n, buildTelemetryEventFromProcess as t };\n\n//# sourceMappingURL=enrich-CtoCke3N.mjs.map"],"mappings":";;;;;AAIA,MAAM,uBAAuB;CAC5B,gBAAgB;CAChB,YAAY,CAAC;AACd;;;;;;;;;;;;;;;AAeA,eAAe,kBAAkB,aAAa;CAC7C,IAAI;EACH,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,MAAM,UAAU,MAAM,WAAW;GAChC,MAAM;GACN,KAAK;GACL,QAAQ;GACR,QAAQ;GACR,UAAU;EACX,CAAC,EAAA,CAAG,UAAU;EACd,IAAI,WAAW,QAAQ,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG,OAAO;EAChE,MAAM,YAAY,MAAM,OAAO,kDAAA,CAAuC;EACtE,SAAS,MAAM;EACf,OAAO;GACN,gBAAgB,OAAO,OAAO;GAC9B,aAAa,OAAO,cAAc,CAAC,EAAA,CAAG,KAAK,SAAS,KAAK,EAAE;EAC5D;CACD,QAAQ;EACP,OAAO;CACR;AACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as createContractEmitCommand } from "./contract-emit-B65_UiFn.mjs";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
4
|
+
//#region ../../../1-framework/3-tooling/cli/dist/exports/index.d.mts
|
|
5
|
+
//#region src/commands/format.d.ts
|
|
6
|
+
declare function createFormatCommand(): Command;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/load-ts-contract.d.ts
|
|
9
|
+
interface LoadTsContractOptions {
|
|
10
|
+
readonly allowlist?: ReadonlyArray<string>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Loads a contract from a TypeScript file and returns it as Contract.
|
|
14
|
+
*
|
|
15
|
+
* **Responsibility: Parsing Only**
|
|
16
|
+
* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.
|
|
17
|
+
* The contract should already be normalized if it was built using the contract builder.
|
|
18
|
+
*
|
|
19
|
+
* Normalization must happen in the contract builder when the contract is created.
|
|
20
|
+
* This function only validates that the contract is JSON-serializable and returns it as-is.
|
|
21
|
+
*
|
|
22
|
+
* @param entryPath - Path to the TypeScript contract file
|
|
23
|
+
* @param options - Optional configuration (import allowlist)
|
|
24
|
+
* @returns The contract as Contract (should already be normalized)
|
|
25
|
+
* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,
|
|
26
|
+
* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`
|
|
27
|
+
*/
|
|
28
|
+
declare function loadContractFromTs(entryPath: string, options?: LoadTsContractOptions): Promise<Contract>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type LoadTsContractOptions, createContractEmitCommand, createFormatCommand, loadContractFromTs };
|
|
31
|
+
//# sourceMappingURL=cli.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.d.mts"],"mappings":";;;;;iBAIiB,uBAAuB;;;UAG9B;WACC,YAAY;;;;;;;;;;;;;;;;;;iBAkBN,mBAAmB,mBAAmB,UAAU,wBAAwB,QAAQ"}
|