@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,3 @@
|
|
|
1
|
+
import { a as materialiseExtensionMigrationPackageIfMissing, c as readMigrationsDir, d as writeMigrationPackage, i as formatMigrationDirName, l as writeMigrationMetadata, n as ReadMigrationsDirResult, o as materialiseMigrationPackage, r as copyFilesWithRename, s as readMigrationPackage, t as PackageLoadProblem, u as writeMigrationOps } from "./io-sr4CO9_t-C3eV_kn-.mjs";
|
|
2
|
+
import "./io-DYfeLJxR.mjs";
|
|
3
|
+
export { type PackageLoadProblem, type ReadMigrationsDirResult, copyFilesWithRename, formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, readMigrationPackage, readMigrationsDir, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as materialiseMigrationPackage, c as writeMigrationMetadata, i as materialiseExtensionMigrationPackageIfMissing, l as writeMigrationOps, n as copyFilesWithRename, o as readMigrationPackage, r as formatMigrationDirName, s as readMigrationsDir, u as writeMigrationPackage } from "./io-C8TdyBKt-DloEBi70.mjs";
|
|
2
|
+
export { copyFilesWithRename, formatMigrationDirName, materialiseExtensionMigrationPackageIfMissing, materialiseMigrationPackage, readMigrationPackage, readMigrationsDir, writeMigrationMetadata, writeMigrationOps, writeMigrationPackage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as findLeaf, c as findPathWithInvariants, i as findLatestMigration, l as findReachableLeaves, n as detectCycles, o as findPath, r as detectOrphans, s as findPathWithDecision, t as PathDecision, u as reconstructGraph } from "./migration-graph-tarTxJ99-BrGBANeE.mjs";
|
|
2
|
+
import { n as isGraphNode, t as assertHashIsGraphNode } from "./migration-graph-Dqndu0i5.mjs";
|
|
3
|
+
export { type PathDecision, assertHashIsGraphNode, detectCycles, detectOrphans, findLatestMigration, findLeaf, findPath, findPathWithDecision, findPathWithInvariants, findReachableLeaves, isGraphNode, reconstructGraph };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as findPath, c as findReachableLeaves, i as findLeaf, l as reconstructGraph, n as detectOrphans, o as findPathWithDecision, r as findLatestMigration, s as findPathWithInvariants, t as detectCycles } from "./migration-graph-CBf9ORe7-B4xAF8GN.mjs";
|
|
2
|
+
import { n as isGraphNode, t as assertHashIsGraphNode } from "./graph-membership-DW6nnbyQ-Bp2KcVwR.mjs";
|
|
3
|
+
export { assertHashIsGraphNode, detectCycles, detectOrphans, findLatestMigration, findLeaf, findPath, findPathWithDecision, findPathWithInvariants, findReachableLeaves, isGraphNode, reconstructGraph };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildMigrationArtifacts, i as MigrationMeta, n as MigrationArtifacts, o as isDirectEntrypoint, r as MigrationContractViews, t as Migration } from "./migration-B2ljMJim.mjs";
|
|
2
|
+
export { Migration, type MigrationArtifacts, MigrationContractViews, type MigrationMeta, buildMigrationArtifacts, isDirectEntrypoint };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RefResolutionAmbiguous, c as RefResolutionInvalidFormat, d as findEdgeByDirName, f as parseContractRef, i as MigrationRefProvenance, l as RefResolutionNotFound, n as ContractRefProvenance, o as RefResolutionContext, p as parseMigrationRef, r as MigrationRef, s as RefResolutionError, t as ContractRef, u as RefResolutionWrongGrammar } from "./ref-resolution-COGOSL57.mjs";
|
|
2
|
+
export { type ContractRef, type ContractRefProvenance, type MigrationRef, type MigrationRefProvenance, type RefResolutionAmbiguous, type RefResolutionContext, type RefResolutionError, type RefResolutionInvalidFormat, type RefResolutionNotFound, type RefResolutionWrongGrammar, findEdgeByDirName, parseContractRef, parseMigrationRef };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as deleteRef, c as refsByContractHash, d as validateRefName, f as validateRefValue, i as Refs, l as resolveRef, n as RefEntry, o as readRef, p as writeRef, s as readRefs, t as HEAD_REF_NAME, u as resolveRefsByContractHash } from "./refs-BNCUu58Y-BIso5Jfg.mjs";
|
|
2
|
+
export { HEAD_REF_NAME, type RefEntry, type Refs, deleteRef, readRef, readRefs, refsByContractHash, resolveRef, resolveRefsByContractHash, validateRefName, validateRefValue, writeRef };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { c as resolveRefsByContractHash, d as writeRef, i as readRefs, l as validateRefName, n as deleteRef, o as refsByContractHash, r as readRef, s as resolveRef, t as HEAD_REF_NAME, u as validateRefValue } from "./refs-BDbB9BRB-D6Za3Q49.mjs";
|
|
2
|
+
export { HEAD_REF_NAME, deleteRef, readRef, readRefs, refsByContractHash, resolveRef, resolveRefsByContractHash, validateRefName, validateRefValue, writeRef };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as VerifyContractSpacesResult, i as VerifyContractSpacesInputs, n as SpaceMarkerRecord, o as listContractSpaceDirectories, r as SpaceVerifierViolation, s as verifyContractSpaces, t as ContractSpaceHeadRecord } from "./verify-contract-spaces-Cc1u_wJo-BilPJS2S.mjs";
|
|
2
|
+
import { C as spaceMigrationDirectory, S as readContractSpaceHeadRef, _ as contractSpaceFromJson, a as DescriptorSelfConsistencyInputs, b as isValidSpaceId, c as RESERVED_SPACE_SUBDIR_NAMES, d as SpacePlanInput, f as SpacePlanOutput, g as computeExtensionSpaceApplyPath, h as assertValidSpaceId, i as ContractSpaceHeadRef, l as SPACE_REFS_DIRNAME, m as assertDescriptorSelfConsistency, n as ComputeExtensionSpaceApplyPathInputs, o as DiskContractSpaceState, p as ValidSpaceId, r as ContractSpaceArtifactInputs, s as ExtensionSpaceApplyPathOutcome, t as APP_SPACE_ID, u as SpaceApplyInput, v as emitContractSpaceArtifacts, w as spaceRefsDirectory, x as planAllSpaces, y as gatherDiskContractSpaceState } from "./spaces-DxFj5y8l.mjs";
|
|
3
|
+
export { APP_SPACE_ID, type ComputeExtensionSpaceApplyPathInputs, type ContractSpaceArtifactInputs, type ContractSpaceHeadRecord, type ContractSpaceHeadRef, type DescriptorSelfConsistencyInputs, type DiskContractSpaceState, type ExtensionSpaceApplyPathOutcome, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, type SpaceApplyInput, type SpaceMarkerRecord, type SpacePlanInput, type SpacePlanOutput, type SpaceVerifierViolation, type ValidSpaceId, type VerifyContractSpacesInputs, type VerifyContractSpacesResult, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as isValidSpaceId, c as spaceMigrationDirectory, i as assertValidSpaceId, l as spaceRefsDirectory, n as RESERVED_SPACE_SUBDIR_NAMES, o as listContractSpaceDirectories, r as SPACE_REFS_DIRNAME, s as readContractSpaceHeadRef, t as APP_SPACE_ID, u as verifyContractSpaces } from "./verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs";
|
|
2
|
+
import { a as gatherDiskContractSpaceState, i as emitContractSpaceArtifacts, n as computeExtensionSpaceApplyPath, o as planAllSpaces, r as contractSpaceFromJson, t as assertDescriptorSelfConsistency } from "./spaces-C27bA-xc.mjs";
|
|
3
|
+
export { APP_SPACE_ID, RESERVED_SPACE_SUBDIR_NAMES, SPACE_REFS_DIRNAME, assertDescriptorSelfConsistency, assertValidSpaceId, computeExtensionSpaceApplyPath, contractSpaceFromJson, emitContractSpaceArtifacts, gatherDiskContractSpaceState, isValidSpaceId, listContractSpaceDirectories, planAllSpaces, readContractSpaceHeadRef, spaceMigrationDirectory, spaceRefsDirectory, verifyContractSpaces };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region ../../../1-framework/3-tooling/migration/dist/exports/migration-ts.d.mts
|
|
2
|
+
//#region src/migration-ts.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Utilities for reading/writing `migration.ts` files.
|
|
5
|
+
*
|
|
6
|
+
* Rendering migration.ts source is the target's responsibility — the CLI
|
|
7
|
+
* obtains source strings from a planner's `plan.renderTypeScript()`. The
|
|
8
|
+
* helper here is limited to file I/O: writing the returned source with the
|
|
9
|
+
* right executable bit and probing for existence.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Writes a pre-rendered `migration.ts` source string to the given package
|
|
13
|
+
* directory. If the source begins with a shebang, the file is written with
|
|
14
|
+
* executable permissions (0o755) so it can be run directly via
|
|
15
|
+
* `./migration.ts` — the rendered scaffold ends with
|
|
16
|
+
* `MigrationCLI.run(import.meta.url, M)` from
|
|
17
|
+
* `@internal/cli/migration-cli` (re-exported by the postgres facade),
|
|
18
|
+
* which guards on the entrypoint and serializes when the file is the main
|
|
19
|
+
* module.
|
|
20
|
+
*
|
|
21
|
+
* The source is run through prettier before writing so migration renderers
|
|
22
|
+
* can produce structurally-correct but loosely-indented source and rely on
|
|
23
|
+
* a single canonical format on disk. Matches what `@internal/emitter`
|
|
24
|
+
* already does for generated `contract.d.ts`.
|
|
25
|
+
*/
|
|
26
|
+
declare function writeMigrationTs(packageDir: string, content: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Checks whether a migration.ts file exists in the package directory.
|
|
29
|
+
*/
|
|
30
|
+
declare function hasMigrationTs(packageDir: string): Promise<boolean>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/runtime-detection.d.ts
|
|
33
|
+
type ScaffoldRuntime = 'node' | 'bun' | 'deno';
|
|
34
|
+
declare function detectScaffoldRuntime(): ScaffoldRuntime;
|
|
35
|
+
declare function shebangLineFor(runtime: ScaffoldRuntime): string;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { writeMigrationTs as a, shebangLineFor as i, detectScaffoldRuntime as n, hasMigrationTs as r, ScaffoldRuntime as t };
|
|
38
|
+
//# sourceMappingURL=migration-ts-CNaAtK8C.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-ts-CNaAtK8C.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/migration-ts.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iBAwBiB,iBAAiB,oBAAoB,kBAAkB;;;;iBAIvD,eAAe,qBAAqB;;;KAGhD;iBACY,yBAAyB;iBACzB,eAAe,SAAS"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { join } from "pathe";
|
|
2
|
+
import { stat, writeFile } from "node:fs/promises";
|
|
3
|
+
import { format } from "prettier";
|
|
4
|
+
//#region ../../../1-framework/3-tooling/migration/dist/exports/migration-ts.mjs
|
|
5
|
+
/**
|
|
6
|
+
* Utilities for reading/writing `migration.ts` files.
|
|
7
|
+
*
|
|
8
|
+
* Rendering migration.ts source is the target's responsibility — the CLI
|
|
9
|
+
* obtains source strings from a planner's `plan.renderTypeScript()`. The
|
|
10
|
+
* helper here is limited to file I/O: writing the returned source with the
|
|
11
|
+
* right executable bit and probing for existence.
|
|
12
|
+
*/
|
|
13
|
+
const MIGRATION_TS_FILE = "migration.ts";
|
|
14
|
+
/**
|
|
15
|
+
* Writes a pre-rendered `migration.ts` source string to the given package
|
|
16
|
+
* directory. If the source begins with a shebang, the file is written with
|
|
17
|
+
* executable permissions (0o755) so it can be run directly via
|
|
18
|
+
* `./migration.ts` — the rendered scaffold ends with
|
|
19
|
+
* `MigrationCLI.run(import.meta.url, M)` from
|
|
20
|
+
* `@internal/cli/migration-cli` (re-exported by the postgres facade),
|
|
21
|
+
* which guards on the entrypoint and serializes when the file is the main
|
|
22
|
+
* module.
|
|
23
|
+
*
|
|
24
|
+
* The source is run through prettier before writing so migration renderers
|
|
25
|
+
* can produce structurally-correct but loosely-indented source and rely on
|
|
26
|
+
* a single canonical format on disk. Matches what `@internal/emitter`
|
|
27
|
+
* already does for generated `contract.d.ts`.
|
|
28
|
+
*/
|
|
29
|
+
async function writeMigrationTs(packageDir, content) {
|
|
30
|
+
const formatted = await formatMigrationTsSource(content);
|
|
31
|
+
const isExecutable = formatted.startsWith("#!");
|
|
32
|
+
await writeFile(join(packageDir, MIGRATION_TS_FILE), formatted, isExecutable ? { mode: 493 } : void 0);
|
|
33
|
+
}
|
|
34
|
+
async function formatMigrationTsSource(source) {
|
|
35
|
+
return format(source, {
|
|
36
|
+
parser: "typescript",
|
|
37
|
+
singleQuote: true,
|
|
38
|
+
semi: true,
|
|
39
|
+
printWidth: 100
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Checks whether a migration.ts file exists in the package directory.
|
|
44
|
+
*/
|
|
45
|
+
async function hasMigrationTs(packageDir) {
|
|
46
|
+
try {
|
|
47
|
+
return (await stat(join(packageDir, MIGRATION_TS_FILE))).isFile();
|
|
48
|
+
} catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function detectScaffoldRuntime() {
|
|
53
|
+
if (typeof globalThis.Bun !== "undefined") return "bun";
|
|
54
|
+
if (typeof globalThis.Deno !== "undefined") return "deno";
|
|
55
|
+
return "node";
|
|
56
|
+
}
|
|
57
|
+
function shebangLineFor(runtime) {
|
|
58
|
+
switch (runtime) {
|
|
59
|
+
case "bun": return "#!/usr/bin/env -S bun";
|
|
60
|
+
case "deno": return "#!/usr/bin/env -S deno run -A";
|
|
61
|
+
case "node": return "#!/usr/bin/env -S node";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { writeMigrationTs as i, hasMigrationTs as n, shebangLineFor as r, detectScaffoldRuntime as t };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=migration-ts-FyF55c4M.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-ts-FyF55c4M.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/migration-ts.mjs"],"sourcesContent":["import { join } from \"pathe\";\nimport { stat, writeFile } from \"node:fs/promises\";\nimport { format } from \"prettier\";\n//#region src/migration-ts.ts\n/**\n* Utilities for reading/writing `migration.ts` files.\n*\n* Rendering migration.ts source is the target's responsibility — the CLI\n* obtains source strings from a planner's `plan.renderTypeScript()`. The\n* helper here is limited to file I/O: writing the returned source with the\n* right executable bit and probing for existence.\n*/\nconst MIGRATION_TS_FILE = \"migration.ts\";\n/**\n* Writes a pre-rendered `migration.ts` source string to the given package\n* directory. If the source begins with a shebang, the file is written with\n* executable permissions (0o755) so it can be run directly via\n* `./migration.ts` — the rendered scaffold ends with\n* `MigrationCLI.run(import.meta.url, M)` from\n* `@internal/cli/migration-cli` (re-exported by the postgres facade),\n* which guards on the entrypoint and serializes when the file is the main\n* module.\n*\n* The source is run through prettier before writing so migration renderers\n* can produce structurally-correct but loosely-indented source and rely on\n* a single canonical format on disk. Matches what `@internal/emitter`\n* already does for generated `contract.d.ts`.\n*/\nasync function writeMigrationTs(packageDir, content) {\n\tconst formatted = await formatMigrationTsSource(content);\n\tconst isExecutable = formatted.startsWith(\"#!\");\n\tawait writeFile(join(packageDir, MIGRATION_TS_FILE), formatted, isExecutable ? { mode: 493 } : void 0);\n}\nasync function formatMigrationTsSource(source) {\n\treturn format(source, {\n\t\tparser: \"typescript\",\n\t\tsingleQuote: true,\n\t\tsemi: true,\n\t\tprintWidth: 100\n\t});\n}\n/**\n* Checks whether a migration.ts file exists in the package directory.\n*/\nasync function hasMigrationTs(packageDir) {\n\ttry {\n\t\treturn (await stat(join(packageDir, MIGRATION_TS_FILE))).isFile();\n\t} catch {\n\t\treturn false;\n\t}\n}\n//#endregion\n//#region src/runtime-detection.ts\nfunction detectScaffoldRuntime() {\n\tif (typeof globalThis.Bun !== \"undefined\") return \"bun\";\n\tif (typeof globalThis.Deno !== \"undefined\") return \"deno\";\n\treturn \"node\";\n}\nfunction shebangLineFor(runtime) {\n\tswitch (runtime) {\n\t\tcase \"bun\": return \"#!/usr/bin/env -S bun\";\n\t\tcase \"deno\": return \"#!/usr/bin/env -S deno run -A\";\n\t\tcase \"node\": return \"#!/usr/bin/env -S node\";\n\t}\n}\n//#endregion\nexport { detectScaffoldRuntime, hasMigrationTs, shebangLineFor, writeMigrationTs };\n\n//# sourceMappingURL=migration-ts.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,oBAAoB;;;;;;;;;;;;;;;;AAgB1B,eAAe,iBAAiB,YAAY,SAAS;CACpD,MAAM,YAAY,MAAM,wBAAwB,OAAO;CACvD,MAAM,eAAe,UAAU,WAAW,IAAI;CAC9C,MAAM,UAAU,KAAK,YAAY,iBAAiB,GAAG,WAAW,eAAe,EAAE,MAAM,IAAI,IAAI,KAAK,CAAC;AACtG;AACA,eAAe,wBAAwB,QAAQ;CAC9C,OAAO,OAAO,QAAQ;EACrB,QAAQ;EACR,aAAa;EACb,MAAM;EACN,YAAY;CACb,CAAC;AACF;;;;AAIA,eAAe,eAAe,YAAY;CACzC,IAAI;EACH,QAAQ,MAAM,KAAK,KAAK,YAAY,iBAAiB,CAAC,EAAA,CAAG,OAAO;CACjE,QAAQ;EACP,OAAO;CACR;AACD;AAGA,SAAS,wBAAwB;CAChC,IAAI,OAAO,WAAW,QAAQ,aAAa,OAAO;CAClD,IAAI,OAAO,WAAW,SAAS,aAAa,OAAO;CACnD,OAAO;AACR;AACA,SAAS,eAAe,SAAS;CAChC,QAAQ,SAAR;EACC,KAAK,OAAO,OAAO;EACnB,KAAK,QAAQ,OAAO;EACpB,KAAK,QAAQ,OAAO;CACrB;AACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type } from "arktype";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/migration/dist/op-schema-BSVHzEQN.mjs
|
|
3
|
+
const MigrationOpSchema = type({
|
|
4
|
+
id: "string",
|
|
5
|
+
label: "string",
|
|
6
|
+
operationClass: "'additive' | 'widening' | 'destructive' | 'data'",
|
|
7
|
+
"invariantId?": "string"
|
|
8
|
+
});
|
|
9
|
+
const MigrationOpsSchema = MigrationOpSchema.array();
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MigrationOpsSchema as n, MigrationOpSchema as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=op-schema-BSVHzEQN-DIWt28D8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-schema-BSVHzEQN-DIWt28D8.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/op-schema-BSVHzEQN.mjs"],"sourcesContent":["import { type } from \"arktype\";\n//#region src/op-schema.ts\nconst MigrationOpSchema = type({\n\tid: \"string\",\n\tlabel: \"string\",\n\toperationClass: \"'additive' | 'widening' | 'destructive' | 'data'\",\n\t\"invariantId?\": \"string\"\n});\nconst MigrationOpsSchema = MigrationOpSchema.array();\n//#endregion\nexport { MigrationOpsSchema as n, MigrationOpSchema as t };\n\n//# sourceMappingURL=op-schema-BSVHzEQN.mjs.map"],"mappings":";;AAEA,MAAM,oBAAoB,KAAK;CAC9B,IAAI;CACJ,OAAO;CACP,gBAAgB;CAChB,gBAAgB;AACjB,CAAC;AACD,MAAM,qBAAqB,kBAAkB,MAAM"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type } from "arktype";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/output-DWNYqZGc.mjs
|
|
3
|
+
/**
|
|
4
|
+
* arktype schema for the structured success document `init --json` writes
|
|
5
|
+
* to stdout (FR1.5). The same shape backs the human-readable outro
|
|
6
|
+
* renderer (FR10), so the two output modes carry identical information.
|
|
7
|
+
*
|
|
8
|
+
* `target` is normalised to the user-facing flag value (`mongodb` rather
|
|
9
|
+
* than the internal `mongo`) so consumers can round-trip the document
|
|
10
|
+
* straight into a follow-up `--target` invocation.
|
|
11
|
+
*
|
|
12
|
+
* The `ok: true` literal is the documented success/error discriminator —
|
|
13
|
+
* see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).
|
|
14
|
+
* Error envelopes (`CliErrorEnvelope`) carry `ok: false` so consumers can
|
|
15
|
+
* branch with `if (doc.ok)` without inspecting the rest of the structure.
|
|
16
|
+
*/
|
|
17
|
+
const InitOutputSchema = type({
|
|
18
|
+
ok: "true",
|
|
19
|
+
target: "'postgres'|'mongodb'",
|
|
20
|
+
authoring: "'psl'|'typescript'",
|
|
21
|
+
schemaPath: "string",
|
|
22
|
+
filesWritten: "string[]",
|
|
23
|
+
/**
|
|
24
|
+
* FR9.1 — files removed from disk during this run. Populated only on
|
|
25
|
+
* re-init when previously-emitted contract artifacts (`contract.json`,
|
|
26
|
+
* `contract.d.ts`, `ops.json`, `migration.json`) were left behind by an
|
|
27
|
+
* earlier run. Empty on a green-field init.
|
|
28
|
+
*/
|
|
29
|
+
filesDeleted: "string[]",
|
|
30
|
+
packagesInstalled: {
|
|
31
|
+
skipped: "boolean",
|
|
32
|
+
deps: "string[]",
|
|
33
|
+
devDeps: "string[]"
|
|
34
|
+
},
|
|
35
|
+
contractEmitted: "boolean",
|
|
36
|
+
nextSteps: "string[]",
|
|
37
|
+
warnings: "string[]"
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Serialises the output document for `--json`. Sorted keys are not enforced
|
|
41
|
+
* — `JSON.stringify` preserves insertion order, and the schema field order
|
|
42
|
+
* is the documented order, which matches what users will see when they
|
|
43
|
+
* `jq .` the result.
|
|
44
|
+
*/
|
|
45
|
+
function formatInitJson(output) {
|
|
46
|
+
return JSON.stringify(output, null, 2);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Renders the human-readable outro on stderr (FR10.1). Re-uses the same
|
|
50
|
+
* data structure as the JSON output so the two stay in lock-step.
|
|
51
|
+
*
|
|
52
|
+
* Warnings come before "Next steps" because they describe state the user
|
|
53
|
+
* needs to be aware of before acting on the next-steps list.
|
|
54
|
+
*/
|
|
55
|
+
function renderInitOutro(ui, output, flags) {
|
|
56
|
+
if (flags.quiet || flags.json) return;
|
|
57
|
+
for (const warning of output.warnings) ui.warn(warning);
|
|
58
|
+
const lines = [];
|
|
59
|
+
lines.push(`Target: ${output.target}`);
|
|
60
|
+
lines.push(`Authoring: ${output.authoring}`);
|
|
61
|
+
lines.push(`Schema: ${output.schemaPath}`);
|
|
62
|
+
lines.push("");
|
|
63
|
+
lines.push("Files written:");
|
|
64
|
+
for (const file of output.filesWritten) lines.push(` • ${file}`);
|
|
65
|
+
if (output.filesDeleted.length > 0) {
|
|
66
|
+
lines.push("");
|
|
67
|
+
lines.push("Files deleted (stale contract artifacts):");
|
|
68
|
+
for (const file of output.filesDeleted) lines.push(` • ${file}`);
|
|
69
|
+
}
|
|
70
|
+
if (!output.packagesInstalled.skipped) {
|
|
71
|
+
lines.push("");
|
|
72
|
+
lines.push("Packages installed:");
|
|
73
|
+
for (const dep of output.packagesInstalled.deps) lines.push(` • ${dep}`);
|
|
74
|
+
for (const dep of output.packagesInstalled.devDeps) lines.push(` • ${dep} (dev)`);
|
|
75
|
+
}
|
|
76
|
+
lines.push("");
|
|
77
|
+
lines.push("Next steps:");
|
|
78
|
+
for (const step of output.nextSteps) lines.push(` ${step}`);
|
|
79
|
+
ui.note(lines.join("\n"), "Done");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the `nextSteps` array from the resolved scaffold state. Steps are
|
|
83
|
+
* ordered by the workflow a user needs to follow: configure connection →
|
|
84
|
+
* (emit if not yet done) → run a starter query → docs / agent skill.
|
|
85
|
+
*
|
|
86
|
+
* The strings are stable and human-readable; agents wanting to act on them
|
|
87
|
+
* should match on substrings (e.g. "DATABASE_URL") rather than exact text,
|
|
88
|
+
* since copy may evolve.
|
|
89
|
+
*/
|
|
90
|
+
function buildNextSteps(options) {
|
|
91
|
+
const steps = [];
|
|
92
|
+
let stepNumber = 1;
|
|
93
|
+
const push = (text) => {
|
|
94
|
+
steps.push(`${stepNumber}. ${text}`);
|
|
95
|
+
stepNumber += 1;
|
|
96
|
+
};
|
|
97
|
+
push("Set DATABASE_URL in your environment (export it or add it to .env).");
|
|
98
|
+
if (!options.contractEmitted) {
|
|
99
|
+
push(`Emit the contract: \`${options.emitCommand}\``);
|
|
100
|
+
push(`Edit your schema at ${options.schemaPath}, then re-run the emit command.`);
|
|
101
|
+
} else push(`Edit your schema at ${options.schemaPath}, then re-run \`${options.emitCommand}\`.`);
|
|
102
|
+
push("Open prisma-next.md for a quick reference on how to write your first typed query.");
|
|
103
|
+
if (options.skillRegistered) push("Prisma Next skills are registered with your agent runtime — open the project in your IDE and ask the agent to add a model, run a query, or plan a migration.");
|
|
104
|
+
return steps;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { renderInitOutro as i, buildNextSteps as n, formatInitJson as r, InitOutputSchema as t };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=output-DWNYqZGc-D2sRgLAm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-DWNYqZGc-D2sRgLAm.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/output-DWNYqZGc.mjs"],"sourcesContent":["import { type } from \"arktype\";\n//#region src/commands/init/output.ts\n/**\n* arktype schema for the structured success document `init --json` writes\n* to stdout (FR1.5). The same shape backs the human-readable outro\n* renderer (FR10), so the two output modes carry identical information.\n*\n* `target` is normalised to the user-facing flag value (`mongodb` rather\n* than the internal `mongo`) so consumers can round-trip the document\n* straight into a follow-up `--target` invocation.\n*\n* The `ok: true` literal is the documented success/error discriminator —\n* see [Style Guide § JSON Semantics](../../../../../../../docs/CLI%20Style%20Guide.md#json-semantics).\n* Error envelopes (`CliErrorEnvelope`) carry `ok: false` so consumers can\n* branch with `if (doc.ok)` without inspecting the rest of the structure.\n*/\nconst InitOutputSchema = type({\n\tok: \"true\",\n\ttarget: \"'postgres'|'mongodb'\",\n\tauthoring: \"'psl'|'typescript'\",\n\tschemaPath: \"string\",\n\tfilesWritten: \"string[]\",\n\t/**\n\t* FR9.1 — files removed from disk during this run. Populated only on\n\t* re-init when previously-emitted contract artifacts (`contract.json`,\n\t* `contract.d.ts`, `ops.json`, `migration.json`) were left behind by an\n\t* earlier run. Empty on a green-field init.\n\t*/\n\tfilesDeleted: \"string[]\",\n\tpackagesInstalled: {\n\t\tskipped: \"boolean\",\n\t\tdeps: \"string[]\",\n\t\tdevDeps: \"string[]\"\n\t},\n\tcontractEmitted: \"boolean\",\n\tnextSteps: \"string[]\",\n\twarnings: \"string[]\"\n});\n/**\n* Serialises the output document for `--json`. Sorted keys are not enforced\n* — `JSON.stringify` preserves insertion order, and the schema field order\n* is the documented order, which matches what users will see when they\n* `jq .` the result.\n*/\nfunction formatInitJson(output) {\n\treturn JSON.stringify(output, null, 2);\n}\n/**\n* Renders the human-readable outro on stderr (FR10.1). Re-uses the same\n* data structure as the JSON output so the two stay in lock-step.\n*\n* Warnings come before \"Next steps\" because they describe state the user\n* needs to be aware of before acting on the next-steps list.\n*/\nfunction renderInitOutro(ui, output, flags) {\n\tif (flags.quiet || flags.json) return;\n\tfor (const warning of output.warnings) ui.warn(warning);\n\tconst lines = [];\n\tlines.push(`Target: ${output.target}`);\n\tlines.push(`Authoring: ${output.authoring}`);\n\tlines.push(`Schema: ${output.schemaPath}`);\n\tlines.push(\"\");\n\tlines.push(\"Files written:\");\n\tfor (const file of output.filesWritten) lines.push(` • ${file}`);\n\tif (output.filesDeleted.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Files deleted (stale contract artifacts):\");\n\t\tfor (const file of output.filesDeleted) lines.push(` • ${file}`);\n\t}\n\tif (!output.packagesInstalled.skipped) {\n\t\tlines.push(\"\");\n\t\tlines.push(\"Packages installed:\");\n\t\tfor (const dep of output.packagesInstalled.deps) lines.push(` • ${dep}`);\n\t\tfor (const dep of output.packagesInstalled.devDeps) lines.push(` • ${dep} (dev)`);\n\t}\n\tlines.push(\"\");\n\tlines.push(\"Next steps:\");\n\tfor (const step of output.nextSteps) lines.push(` ${step}`);\n\tui.note(lines.join(\"\\n\"), \"Done\");\n}\n/**\n* Builds the `nextSteps` array from the resolved scaffold state. Steps are\n* ordered by the workflow a user needs to follow: configure connection →\n* (emit if not yet done) → run a starter query → docs / agent skill.\n*\n* The strings are stable and human-readable; agents wanting to act on them\n* should match on substrings (e.g. \"DATABASE_URL\") rather than exact text,\n* since copy may evolve.\n*/\nfunction buildNextSteps(options) {\n\tconst steps = [];\n\tlet stepNumber = 1;\n\tconst push = (text) => {\n\t\tsteps.push(`${stepNumber}. ${text}`);\n\t\tstepNumber += 1;\n\t};\n\tpush(\"Set DATABASE_URL in your environment (export it or add it to .env).\");\n\tif (!options.contractEmitted) {\n\t\tpush(`Emit the contract: \\`${options.emitCommand}\\``);\n\t\tpush(`Edit your schema at ${options.schemaPath}, then re-run the emit command.`);\n\t} else push(`Edit your schema at ${options.schemaPath}, then re-run \\`${options.emitCommand}\\`.`);\n\tpush(\"Open prisma-next.md for a quick reference on how to write your first typed query.\");\n\tif (options.skillRegistered) push(\"Prisma Next skills are registered with your agent runtime — open the project in your IDE and ask the agent to add a model, run a query, or plan a migration.\");\n\treturn steps;\n}\n//#endregion\nexport { renderInitOutro as i, buildNextSteps as n, formatInitJson as r, InitOutputSchema as t };\n\n//# sourceMappingURL=output-DWNYqZGc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,MAAM,mBAAmB,KAAK;CAC7B,IAAI;CACJ,QAAQ;CACR,WAAW;CACX,YAAY;CACZ,cAAc;;;;;;;CAOd,cAAc;CACd,mBAAmB;EAClB,SAAS;EACT,MAAM;EACN,SAAS;CACV;CACA,iBAAiB;CACjB,WAAW;CACX,UAAU;AACX,CAAC;;;;;;;AAOD,SAAS,eAAe,QAAQ;CAC/B,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACtC;;;;;;;;AAQA,SAAS,gBAAgB,IAAI,QAAQ,OAAO;CAC3C,IAAI,MAAM,SAAS,MAAM,MAAM;CAC/B,KAAK,MAAM,WAAW,OAAO,UAAU,GAAG,KAAK,OAAO;CACtD,MAAM,QAAQ,CAAC;CACf,MAAM,KAAK,cAAc,OAAO,QAAQ;CACxC,MAAM,KAAK,cAAc,OAAO,WAAW;CAC3C,MAAM,KAAK,cAAc,OAAO,YAAY;CAC5C,MAAM,KAAK,EAAE;CACb,MAAM,KAAK,gBAAgB;CAC3B,KAAK,MAAM,QAAQ,OAAO,cAAc,MAAM,KAAK,OAAO,MAAM;CAChE,IAAI,OAAO,aAAa,SAAS,GAAG;EACnC,MAAM,KAAK,EAAE;EACb,MAAM,KAAK,2CAA2C;EACtD,KAAK,MAAM,QAAQ,OAAO,cAAc,MAAM,KAAK,OAAO,MAAM;CACjE;CACA,IAAI,CAAC,OAAO,kBAAkB,SAAS;EACtC,MAAM,KAAK,EAAE;EACb,MAAM,KAAK,qBAAqB;EAChC,KAAK,MAAM,OAAO,OAAO,kBAAkB,MAAM,MAAM,KAAK,OAAO,KAAK;EACxE,KAAK,MAAM,OAAO,OAAO,kBAAkB,SAAS,MAAM,KAAK,OAAO,IAAI,OAAO;CAClF;CACA,MAAM,KAAK,EAAE;CACb,MAAM,KAAK,aAAa;CACxB,KAAK,MAAM,QAAQ,OAAO,WAAW,MAAM,KAAK,KAAK,MAAM;CAC3D,GAAG,KAAK,MAAM,KAAK,IAAI,GAAG,MAAM;AACjC;;;;;;;;;;AAUA,SAAS,eAAe,SAAS;CAChC,MAAM,QAAQ,CAAC;CACf,IAAI,aAAa;CACjB,MAAM,QAAQ,SAAS;EACtB,MAAM,KAAK,GAAG,WAAW,IAAI,MAAM;EACnC,cAAc;CACf;CACA,KAAK,qEAAqE;CAC1E,IAAI,CAAC,QAAQ,iBAAiB;EAC7B,KAAK,wBAAwB,QAAQ,YAAY,GAAG;EACpD,KAAK,uBAAuB,QAAQ,WAAW,gCAAgC;CAChF,OAAO,KAAK,uBAAuB,QAAQ,WAAW,kBAAkB,QAAQ,YAAY,IAAI;CAChG,KAAK,mFAAmF;CACxF,IAAI,QAAQ,iBAAiB,KAAK,8JAA8J;CAChM,OAAO;AACR"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MigrationPackage, MigrationPlanOperation } from "@prisma/orm-framework/components/control";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/migration/dist/package-CfWiDNrr.d.mts
|
|
3
|
+
//#region src/package.d.ts
|
|
4
|
+
type MigrationOps = readonly MigrationPlanOperation[];
|
|
5
|
+
/**
|
|
6
|
+
* Augmented form of the canonical {@link MigrationPackage} returned by
|
|
7
|
+
* the on-disk readers (`readMigrationPackage`, `readMigrationsDir`).
|
|
8
|
+
* Adds `dirPath` — the absolute path the package was loaded from — so
|
|
9
|
+
* downstream diagnostics can point operators at a concrete directory.
|
|
10
|
+
*
|
|
11
|
+
* Holding an `OnDiskMigrationPackage` value implies the loader verified
|
|
12
|
+
* the package's integrity (hash recomputation against the stored
|
|
13
|
+
* `migrationHash`); the canonical structural shape carries no such
|
|
14
|
+
* guarantee on its own.
|
|
15
|
+
*/
|
|
16
|
+
interface OnDiskMigrationPackage extends MigrationPackage {
|
|
17
|
+
readonly dirPath: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { OnDiskMigrationPackage as n, MigrationOps as t };
|
|
21
|
+
//# sourceMappingURL=package-CfWiDNrr-ZR4HM_Iz.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-CfWiDNrr-ZR4HM_Iz.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/package-CfWiDNrr.d.mts"],"mappings":";;;KAEK,wBAAwB;;;;;;;;;;;;UAYnB,+BAA+B;WAC9B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region ../../../1-framework/3-tooling/cli/dist/progress-adapter-CjAeTxY_.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Creates a progress adapter that converts control-api progress events
|
|
4
|
+
* into CLI spinner/progress output on stderr.
|
|
5
|
+
*
|
|
6
|
+
* The adapter:
|
|
7
|
+
* - Starts/succeeds spinners for top-level span boundaries
|
|
8
|
+
* - Prints per-operation lines for nested spans (e.g., migration operations under 'apply')
|
|
9
|
+
* - Respects quiet/json/non-TTY flags (no-op in those cases)
|
|
10
|
+
*/
|
|
11
|
+
function createProgressAdapter(options) {
|
|
12
|
+
const { ui, flags } = options;
|
|
13
|
+
if (flags.quiet || flags.json || !ui.isInteractive) return () => {};
|
|
14
|
+
const activeSpans = /* @__PURE__ */ new Map();
|
|
15
|
+
return (event) => {
|
|
16
|
+
if (event.kind === "spanStart") {
|
|
17
|
+
if (event.parentSpanId) {
|
|
18
|
+
ui.step(`${event.label}...`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const spinner = ui.spinner();
|
|
22
|
+
spinner.start(event.label);
|
|
23
|
+
activeSpans.set(event.spanId, {
|
|
24
|
+
spinner,
|
|
25
|
+
startTime: Date.now(),
|
|
26
|
+
label: event.label
|
|
27
|
+
});
|
|
28
|
+
} else if (event.kind === "spanEnd") {
|
|
29
|
+
const spanState = activeSpans.get(event.spanId);
|
|
30
|
+
if (spanState) {
|
|
31
|
+
const elapsed = Date.now() - spanState.startTime;
|
|
32
|
+
if (event.outcome === "error") spanState.spinner.error(`${spanState.label} (failed)`);
|
|
33
|
+
else if (event.outcome === "skipped") spanState.spinner.stop(`${spanState.label} (skipped)`);
|
|
34
|
+
else spanState.spinner.stop(`${spanState.label} (${elapsed}ms)`);
|
|
35
|
+
activeSpans.delete(event.spanId);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { createProgressAdapter as t };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-adapter-CjAeTxY_-BXYSd1eY.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/progress-adapter-CjAeTxY_.mjs"],"sourcesContent":["//#region src/utils/progress-adapter.ts\n/**\n* Creates a progress adapter that converts control-api progress events\n* into CLI spinner/progress output on stderr.\n*\n* The adapter:\n* - Starts/succeeds spinners for top-level span boundaries\n* - Prints per-operation lines for nested spans (e.g., migration operations under 'apply')\n* - Respects quiet/json/non-TTY flags (no-op in those cases)\n*/\nfunction createProgressAdapter(options) {\n\tconst { ui, flags } = options;\n\tif (flags.quiet || flags.json || !ui.isInteractive) return () => {};\n\tconst activeSpans = /* @__PURE__ */ new Map();\n\treturn (event) => {\n\t\tif (event.kind === \"spanStart\") {\n\t\t\tif (event.parentSpanId) {\n\t\t\t\tui.step(`${event.label}...`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst spinner = ui.spinner();\n\t\t\tspinner.start(event.label);\n\t\t\tactiveSpans.set(event.spanId, {\n\t\t\t\tspinner,\n\t\t\t\tstartTime: Date.now(),\n\t\t\t\tlabel: event.label\n\t\t\t});\n\t\t} else if (event.kind === \"spanEnd\") {\n\t\t\tconst spanState = activeSpans.get(event.spanId);\n\t\t\tif (spanState) {\n\t\t\t\tconst elapsed = Date.now() - spanState.startTime;\n\t\t\t\tif (event.outcome === \"error\") spanState.spinner.error(`${spanState.label} (failed)`);\n\t\t\t\telse if (event.outcome === \"skipped\") spanState.spinner.stop(`${spanState.label} (skipped)`);\n\t\t\t\telse spanState.spinner.stop(`${spanState.label} (${elapsed}ms)`);\n\t\t\t\tactiveSpans.delete(event.spanId);\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { createProgressAdapter as t };\n\n//# sourceMappingURL=progress-adapter-CjAeTxY_.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,sBAAsB,SAAS;CACvC,MAAM,EAAE,IAAI,UAAU;CACtB,IAAI,MAAM,SAAS,MAAM,QAAQ,CAAC,GAAG,eAAe,aAAa,CAAC;CAClE,MAAM,8BAA8B,IAAI,IAAI;CAC5C,QAAQ,UAAU;EACjB,IAAI,MAAM,SAAS,aAAa;GAC/B,IAAI,MAAM,cAAc;IACvB,GAAG,KAAK,GAAG,MAAM,MAAM,IAAI;IAC3B;GACD;GACA,MAAM,UAAU,GAAG,QAAQ;GAC3B,QAAQ,MAAM,MAAM,KAAK;GACzB,YAAY,IAAI,MAAM,QAAQ;IAC7B;IACA,WAAW,KAAK,IAAI;IACpB,OAAO,MAAM;GACd,CAAC;EACF,OAAO,IAAI,MAAM,SAAS,WAAW;GACpC,MAAM,YAAY,YAAY,IAAI,MAAM,MAAM;GAC9C,IAAI,WAAW;IACd,MAAM,UAAU,KAAK,IAAI,IAAI,UAAU;IACvC,IAAI,MAAM,YAAY,SAAS,UAAU,QAAQ,MAAM,GAAG,UAAU,MAAM,UAAU;SAC/E,IAAI,MAAM,YAAY,WAAW,UAAU,QAAQ,KAAK,GAAG,UAAU,MAAM,WAAW;SACtF,UAAU,QAAQ,KAAK,GAAG,UAAU,MAAM,IAAI,QAAQ,IAAI;IAC/D,YAAY,OAAO,MAAM,MAAM;GAChC;EACD;CACD;AACD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { O as errorRuntime$1 } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
|
|
2
|
+
import { c as internalImportRoot, o as importRootForDependencies, r as createImportSpecifierResolver } from "./import-roots-NDOIEDVj.mjs";
|
|
3
|
+
import { dirname, join, resolve } from "pathe";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/project-import-root-CpwLCDLY.mjs
|
|
6
|
+
/**
|
|
7
|
+
* The import root of the project being emitted for, read from its own
|
|
8
|
+
* manifest.
|
|
9
|
+
*
|
|
10
|
+
* Generated files are kept by the application, so every package name in them
|
|
11
|
+
* has to be one the application can resolve — which means one of its direct
|
|
12
|
+
* dependencies (ADR 242). The application already states those in
|
|
13
|
+
* `package.json`, so emission reads them instead of taking a mode from
|
|
14
|
+
* configuration that could disagree with what is installed.
|
|
15
|
+
*/
|
|
16
|
+
const DEPENDENCY_FIELDS = ["dependencies", "devDependencies"];
|
|
17
|
+
function isRecord(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19
|
+
}
|
|
20
|
+
/** The error codes that mean "no manifest here", as opposed to "cannot read it". */
|
|
21
|
+
const MANIFEST_ABSENT_CODES = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR"]);
|
|
22
|
+
function errorCode(error) {
|
|
23
|
+
if (!isRecord(error)) return void 0;
|
|
24
|
+
const code = error["code"];
|
|
25
|
+
return typeof code === "string" ? code : void 0;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The nearest `package.json` at or above `from`, or `undefined` if there is
|
|
29
|
+
* none. The nearest one wins: a package inside a workspace states its own
|
|
30
|
+
* dependencies, and the workspace root's are somebody else's.
|
|
31
|
+
*
|
|
32
|
+
* @throws {CliStructuredError} when a manifest is there but cannot be used —
|
|
33
|
+
* unreadable, not valid JSON, or not a JSON object. Only "there is no manifest
|
|
34
|
+
* at this level" continues the walk up; treating a permissions failure that
|
|
35
|
+
* way would silently emit against the wrong project's dependencies.
|
|
36
|
+
*/
|
|
37
|
+
function nearestManifest(from) {
|
|
38
|
+
let dir = from;
|
|
39
|
+
while (true) {
|
|
40
|
+
const path = join(dir, "package.json");
|
|
41
|
+
let raw;
|
|
42
|
+
try {
|
|
43
|
+
raw = readFileSync(path, "utf8");
|
|
44
|
+
} catch (cause) {
|
|
45
|
+
if (!MANIFEST_ABSENT_CODES.has(errorCode(cause) ?? "")) throw errorRuntime$1(`Failed to read ${path}`, {
|
|
46
|
+
why: `\`${path}\` exists but could not be read: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
47
|
+
fix: `Make \`${path}\` readable, then re-run the command. Emission reads it to decide which package names generated files should import.`,
|
|
48
|
+
meta: { path }
|
|
49
|
+
});
|
|
50
|
+
const parent = dirname(dir);
|
|
51
|
+
if (parent === dir) return void 0;
|
|
52
|
+
dir = parent;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
let parsed;
|
|
56
|
+
try {
|
|
57
|
+
parsed = JSON.parse(raw);
|
|
58
|
+
} catch (cause) {
|
|
59
|
+
throw errorRuntime$1(`Failed to parse ${path}`, {
|
|
60
|
+
why: `\`${path}\` is not valid JSON: ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
61
|
+
fix: `Fix the JSON syntax in \`${path}\` (a missing comma or unbalanced brace is the most common cause), then re-run the command. Emission reads it to decide which package names generated files should import.`,
|
|
62
|
+
meta: { path }
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!isRecord(parsed)) throw errorRuntime$1(`Failed to read ${path}`, {
|
|
66
|
+
why: `\`${path}\` is valid JSON but not a JSON object, so it states no dependencies.`,
|
|
67
|
+
fix: `Make \`${path}\` a JSON object with the usual manifest fields, then re-run the command. Emission reads it to decide which package names generated files should import.`,
|
|
68
|
+
meta: { path }
|
|
69
|
+
});
|
|
70
|
+
return parsed;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function declaredDependencies(manifest) {
|
|
74
|
+
return DEPENDENCY_FIELDS.flatMap((field) => {
|
|
75
|
+
const value = manifest[field];
|
|
76
|
+
return isRecord(value) ? Object.keys(value) : [];
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The import root for the project that owns `configPath`, or for the working
|
|
81
|
+
* directory when the config was discovered rather than named.
|
|
82
|
+
*
|
|
83
|
+
* A project with no manifest, or one that names no published package, is on
|
|
84
|
+
* the internal root — which emits every specifier exactly as authored, so a
|
|
85
|
+
* project that has not moved to published names is unaffected.
|
|
86
|
+
*/
|
|
87
|
+
function projectImportRoot(configPath) {
|
|
88
|
+
const manifest = nearestManifest(configPath === void 0 ? resolve(".") : dirname(resolve(configPath)));
|
|
89
|
+
if (manifest === void 0) return internalImportRoot;
|
|
90
|
+
return importRootForDependencies(declaredDependencies(manifest));
|
|
91
|
+
}
|
|
92
|
+
/** The specifier resolver emission should use for the project owning `configPath`. */
|
|
93
|
+
function createProjectSpecifierResolver(configPath) {
|
|
94
|
+
return createImportSpecifierResolver(projectImportRoot(configPath));
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { createProjectSpecifierResolver as t };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=project-import-root-CpwLCDLY-DkVwAnWj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-import-root-CpwLCDLY-DkVwAnWj.mjs","names":["errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/project-import-root-CpwLCDLY.mjs"],"sourcesContent":["import { rt as errorRuntime } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { dirname, join, resolve } from \"pathe\";\nimport { readFileSync } from \"node:fs\";\nimport { createImportSpecifierResolver, importRootForDependencies, internalImportRoot } from \"@internal/publish-surface/import-roots\";\n//#region src/utils/project-import-root.ts\n/**\n* The import root of the project being emitted for, read from its own\n* manifest.\n*\n* Generated files are kept by the application, so every package name in them\n* has to be one the application can resolve — which means one of its direct\n* dependencies (ADR 242). The application already states those in\n* `package.json`, so emission reads them instead of taking a mode from\n* configuration that could disagree with what is installed.\n*/\nconst DEPENDENCY_FIELDS = [\"dependencies\", \"devDependencies\"];\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n/** The error codes that mean \"no manifest here\", as opposed to \"cannot read it\". */\nconst MANIFEST_ABSENT_CODES = /* @__PURE__ */ new Set([\"ENOENT\", \"ENOTDIR\"]);\nfunction errorCode(error) {\n\tif (!isRecord(error)) return void 0;\n\tconst code = error[\"code\"];\n\treturn typeof code === \"string\" ? code : void 0;\n}\n/**\n* The nearest `package.json` at or above `from`, or `undefined` if there is\n* none. The nearest one wins: a package inside a workspace states its own\n* dependencies, and the workspace root's are somebody else's.\n*\n* @throws {CliStructuredError} when a manifest is there but cannot be used —\n* unreadable, not valid JSON, or not a JSON object. Only \"there is no manifest\n* at this level\" continues the walk up; treating a permissions failure that\n* way would silently emit against the wrong project's dependencies.\n*/\nfunction nearestManifest(from) {\n\tlet dir = from;\n\twhile (true) {\n\t\tconst path = join(dir, \"package.json\");\n\t\tlet raw;\n\t\ttry {\n\t\t\traw = readFileSync(path, \"utf8\");\n\t\t} catch (cause) {\n\t\t\tif (!MANIFEST_ABSENT_CODES.has(errorCode(cause) ?? \"\")) throw errorRuntime(`Failed to read ${path}`, {\n\t\t\t\twhy: `\\`${path}\\` exists but could not be read: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: `Make \\`${path}\\` readable, then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\t\tmeta: { path }\n\t\t\t});\n\t\t\tconst parent = dirname(dir);\n\t\t\tif (parent === dir) return void 0;\n\t\t\tdir = parent;\n\t\t\tcontinue;\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = JSON.parse(raw);\n\t\t} catch (cause) {\n\t\t\tthrow errorRuntime(`Failed to parse ${path}`, {\n\t\t\t\twhy: `\\`${path}\\` is not valid JSON: ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t\t\tfix: `Fix the JSON syntax in \\`${path}\\` (a missing comma or unbalanced brace is the most common cause), then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\t\tmeta: { path }\n\t\t\t});\n\t\t}\n\t\tif (!isRecord(parsed)) throw errorRuntime(`Failed to read ${path}`, {\n\t\t\twhy: `\\`${path}\\` is valid JSON but not a JSON object, so it states no dependencies.`,\n\t\t\tfix: `Make \\`${path}\\` a JSON object with the usual manifest fields, then re-run the command. Emission reads it to decide which package names generated files should import.`,\n\t\t\tmeta: { path }\n\t\t});\n\t\treturn parsed;\n\t}\n}\nfunction declaredDependencies(manifest) {\n\treturn DEPENDENCY_FIELDS.flatMap((field) => {\n\t\tconst value = manifest[field];\n\t\treturn isRecord(value) ? Object.keys(value) : [];\n\t});\n}\n/**\n* The import root for the project that owns `configPath`, or for the working\n* directory when the config was discovered rather than named.\n*\n* A project with no manifest, or one that names no published package, is on\n* the internal root — which emits every specifier exactly as authored, so a\n* project that has not moved to published names is unaffected.\n*/\nfunction projectImportRoot(configPath) {\n\tconst manifest = nearestManifest(configPath === void 0 ? resolve(\".\") : dirname(resolve(configPath)));\n\tif (manifest === void 0) return internalImportRoot;\n\treturn importRootForDependencies(declaredDependencies(manifest));\n}\n/** The specifier resolver emission should use for the project owning `configPath`. */\nfunction createProjectSpecifierResolver(configPath) {\n\treturn createImportSpecifierResolver(projectImportRoot(configPath));\n}\n//#endregion\nexport { createProjectSpecifierResolver as t };\n\n//# sourceMappingURL=project-import-root-CpwLCDLY.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,oBAAoB,CAAC,gBAAgB,iBAAiB;AAC5D,SAAS,SAAS,OAAO;CACxB,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;;AAEA,MAAM,wCAAwC,IAAI,IAAI,CAAC,UAAU,SAAS,CAAC;AAC3E,SAAS,UAAU,OAAO;CACzB,IAAI,CAAC,SAAS,KAAK,GAAG,OAAO,KAAK;CAClC,MAAM,OAAO,MAAM;CACnB,OAAO,OAAO,SAAS,WAAW,OAAO,KAAK;AAC/C;;;;;;;;;;;AAWA,SAAS,gBAAgB,MAAM;CAC9B,IAAI,MAAM;CACV,OAAO,MAAM;EACZ,MAAM,OAAO,KAAK,KAAK,cAAc;EACrC,IAAI;EACJ,IAAI;GACH,MAAM,aAAa,MAAM,MAAM;EAChC,SAAS,OAAO;GACf,IAAI,CAAC,sBAAsB,IAAI,UAAU,KAAK,KAAK,EAAE,GAAG,MAAMA,eAAa,kBAAkB,QAAQ;IACpG,KAAK,KAAK,KAAK,mCAAmC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IACvG,KAAK,UAAU,KAAK;IACpB,MAAM,EAAE,KAAK;GACd,CAAC;GACD,MAAM,SAAS,QAAQ,GAAG;GAC1B,IAAI,WAAW,KAAK,OAAO,KAAK;GAChC,MAAM;GACN;EACD;EACA,IAAI;EACJ,IAAI;GACH,SAAS,KAAK,MAAM,GAAG;EACxB,SAAS,OAAO;GACf,MAAMA,eAAa,mBAAmB,QAAQ;IAC7C,KAAK,KAAK,KAAK,wBAAwB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;IAC5F,KAAK,4BAA4B,KAAK;IACtC,MAAM,EAAE,KAAK;GACd,CAAC;EACF;EACA,IAAI,CAAC,SAAS,MAAM,GAAG,MAAMA,eAAa,kBAAkB,QAAQ;GACnE,KAAK,KAAK,KAAK;GACf,KAAK,UAAU,KAAK;GACpB,MAAM,EAAE,KAAK;EACd,CAAC;EACD,OAAO;CACR;AACD;AACA,SAAS,qBAAqB,UAAU;CACvC,OAAO,kBAAkB,SAAS,UAAU;EAC3C,MAAM,QAAQ,SAAS;EACvB,OAAO,SAAS,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC;CAChD,CAAC;AACF;;;;;;;;;AASA,SAAS,kBAAkB,YAAY;CACtC,MAAM,WAAW,gBAAgB,eAAe,KAAK,IAAI,QAAQ,GAAG,IAAI,QAAQ,QAAQ,UAAU,CAAC,CAAC;CACpG,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,OAAO,0BAA0B,qBAAqB,QAAQ,CAAC;AAChE;;AAEA,SAAS,+BAA+B,YAAY;CACnD,OAAO,8BAA8B,kBAAkB,UAAU,CAAC;AACnE"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as ShellReexportMapping, i as ShellPackageMapping, n as ShellKind, o as excludedSubpaths, r as ShellName, s as publicShells, t as ShellDefinition } from "./shells-COHV_Ozf.mjs";
|
|
2
|
+
import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-B6CtsWXb.mjs";
|
|
3
|
+
export { ImportRoot, ImportRootError, ImportRootMode, ImportSpecifierResolver, ScaffoldImportRoot, ShellDefinition, ShellKind, ShellName, ShellPackageMapping, ShellReexportMapping, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, excludedSubpaths, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, publicShells, resolveImportSpecifier, transitiveImports };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as publicShells, t as excludedSubpaths } from "./shells-BenrJHp2.mjs";
|
|
2
|
+
import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-NDOIEDVj.mjs";
|
|
3
|
+
export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, excludedSubpaths, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, publicShells, resolveImportSpecifier, transitiveImports };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ScaffoldImportRoot, c as createScaffoldSpecifierResolver, d as importedSpecifiers, f as internalImportRoot, h as transitiveImports, i as ImportSpecifierResolver, l as directDependencyShells, m as resolveImportSpecifier, n as ImportRootError, o as buildOwnerIndex, p as platformEntrypointOf, r as ImportRootMode, s as createImportSpecifierResolver, t as ImportRoot, u as importRootForDependencies } from "./import-roots-B6CtsWXb.mjs";
|
|
2
|
+
export { ImportRoot, ImportRootError, ImportRootMode, ImportSpecifierResolver, ScaffoldImportRoot, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as directDependencyShells, c as internalImportRoot, d as transitiveImports, i as createScaffoldSpecifierResolver, l as platformEntrypointOf, n as buildOwnerIndex, o as importRootForDependencies, r as createImportSpecifierResolver, s as importedSpecifiers, t as ImportRootError, u as resolveImportSpecifier } from "./import-roots-NDOIEDVj.mjs";
|
|
2
|
+
export { ImportRootError, buildOwnerIndex, createImportSpecifierResolver, createScaffoldSpecifierResolver, directDependencyShells, importRootForDependencies, importedSpecifiers, internalImportRoot, platformEntrypointOf, resolveImportSpecifier, transitiveImports };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ShellReexportMapping, i as ShellPackageMapping, n as ShellKind, o as excludedSubpaths, r as ShellName, s as publicShells, t as ShellDefinition } from "./shells-COHV_Ozf.mjs";
|
|
2
|
+
export { ShellDefinition, ShellKind, ShellName, ShellPackageMapping, ShellReexportMapping, excludedSubpaths, publicShells };
|