@geekmidas/cli 10.0.0-alpha.15 → 10.0.0-alpha.150
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/README.md +313 -380
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-CusLH-9S.mjs +1037 -0
- package/dist/EndpointGenerator-CusLH-9S.mjs.map +1 -0
- package/dist/EndpointGenerator-DyLMYClE.cjs +1096 -0
- package/dist/EndpointGenerator-DyLMYClE.cjs.map +1 -0
- package/dist/GoDaddyProvider-CytuBrRm.cjs +412 -0
- package/dist/GoDaddyProvider-CytuBrRm.cjs.map +1 -0
- package/dist/GoDaddyProvider-W0Dxd5v9.mjs +412 -0
- package/dist/GoDaddyProvider-W0Dxd5v9.mjs.map +1 -0
- package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-CCc9xoBN.cjs} +23 -9
- package/dist/HostingerProvider-CCc9xoBN.cjs.map +1 -0
- package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-DaQr2ueR.mjs} +23 -9
- package/dist/HostingerProvider-DaQr2ueR.mjs.map +1 -0
- package/dist/LegacyStateStore-BDA0rx3b.cjs +124 -0
- package/dist/LegacyStateStore-BDA0rx3b.cjs.map +1 -0
- package/dist/LegacyStateStore-BTcTbCGk.mjs +124 -0
- package/dist/LegacyStateStore-BTcTbCGk.mjs.map +1 -0
- package/dist/LocalStateStore-BNuQoZYe.cjs +178 -0
- package/dist/LocalStateStore-BNuQoZYe.cjs.map +1 -0
- package/dist/LocalStateStore-CqpCKVvi.mjs +167 -0
- package/dist/LocalStateStore-CqpCKVvi.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-BTMuu1WS.mjs +534 -0
- package/dist/OpenApiTsGenerator-BTMuu1WS.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-CI-tceXV.cjs +539 -0
- package/dist/OpenApiTsGenerator-CI-tceXV.cjs.map +1 -0
- package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
- package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
- package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
- package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
- package/dist/S3StateStore-BpsGWDMK.mjs +223 -0
- package/dist/S3StateStore-BpsGWDMK.mjs.map +1 -0
- package/dist/S3StateStore-nrmSClXN.cjs +222 -0
- package/dist/S3StateStore-nrmSClXN.cjs.map +1 -0
- package/dist/SSMStateStore-DrPCC_VN.mjs +205 -0
- package/dist/SSMStateStore-DrPCC_VN.mjs.map +1 -0
- package/dist/SSMStateStore-hexM8C7n.cjs +204 -0
- package/dist/SSMStateStore-hexM8C7n.cjs.map +1 -0
- package/dist/SubscriberGenerator-BNJyPmXJ.cjs +848 -0
- package/dist/SubscriberGenerator-BNJyPmXJ.cjs.map +1 -0
- package/dist/SubscriberGenerator-CzPrixYu.mjs +783 -0
- package/dist/SubscriberGenerator-CzPrixYu.mjs.map +1 -0
- package/dist/add-DXMYV5ak.mjs +711 -0
- package/dist/add-DXMYV5ak.mjs.map +1 -0
- package/dist/add-DgAeo6ht.cjs +713 -0
- package/dist/add-DgAeo6ht.cjs.map +1 -0
- package/dist/appPorts-BoXMwolc.mjs +249 -0
- package/dist/appPorts-BoXMwolc.mjs.map +1 -0
- package/dist/appPorts-IW-OZmRi.cjs +296 -0
- package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
- package/dist/apps-Bb05wCBm.mjs +5534 -0
- package/dist/apps-Bb05wCBm.mjs.map +1 -0
- package/dist/apps-CMLyyVGQ.cjs +6148 -0
- package/dist/apps-CMLyyVGQ.cjs.map +1 -0
- package/dist/aws-8QQ8n-t6.mjs +89 -0
- package/dist/aws-8QQ8n-t6.mjs.map +1 -0
- package/dist/aws-DY9NqQIT.cjs +100 -0
- package/dist/aws-DY9NqQIT.cjs.map +1 -0
- package/dist/awsStore-Bx5nCFnS.mjs +121 -0
- package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
- package/dist/awsStore-u3ehhMoY.cjs +138 -0
- package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
- package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/backups/runner.cjs +519 -0
- package/dist/backups/runner.cjs.map +1 -0
- package/dist/backups/runner.d.cts +102 -0
- package/dist/backups/runner.d.cts.map +1 -0
- package/dist/backups/runner.d.mts +102 -0
- package/dist/backups/runner.d.mts.map +1 -0
- package/dist/backups/runner.mjs +506 -0
- package/dist/backups/runner.mjs.map +1 -0
- package/dist/{bundler-BodTL4kf.mjs → bundler-C1kDZyQ-.mjs} +59 -14
- package/dist/bundler-C1kDZyQ-.mjs.map +1 -0
- package/dist/{bundler-BeNDZdHQ.cjs → bundler-CD9Ug2uu.cjs} +59 -14
- package/dist/bundler-CD9Ug2uu.cjs.map +1 -0
- package/dist/cli-35yoGg9o.cjs +71 -0
- package/dist/cli-35yoGg9o.cjs.map +1 -0
- package/dist/cli-BAcJaRG7.mjs +71 -0
- package/dist/cli-BAcJaRG7.mjs.map +1 -0
- package/dist/compose-BZTh5HR3.mjs +1560 -0
- package/dist/compose-BZTh5HR3.mjs.map +1 -0
- package/dist/compose-CAhGIfG8.mjs +2877 -0
- package/dist/compose-CAhGIfG8.mjs.map +1 -0
- package/dist/compose-DF08HNJE.cjs +2966 -0
- package/dist/compose-DF08HNJE.cjs.map +1 -0
- package/dist/compose-KV6q3cEz.cjs +1919 -0
- package/dist/compose-KV6q3cEz.cjs.map +1 -0
- package/dist/config-BLrAd7Of.mjs +659 -0
- package/dist/config-BLrAd7Of.mjs.map +1 -0
- package/dist/config-CRk2vdSp.d.mts +268 -0
- package/dist/config-CRk2vdSp.d.mts.map +1 -0
- package/dist/config-juUyBlb1.cjs +772 -0
- package/dist/config-juUyBlb1.cjs.map +1 -0
- package/dist/config-oBgsbLip.d.cts +268 -0
- package/dist/config-oBgsbLip.d.cts.map +1 -0
- package/dist/config.cjs +11 -3
- package/dist/config.d.cts +4 -117
- package/dist/config.d.mts +4 -117
- package/dist/config.mjs +3 -3
- package/dist/credentialSchemas-BAklWDna.cjs +271 -0
- package/dist/credentialSchemas-BAklWDna.cjs.map +1 -0
- package/dist/credentialSchemas-mz9QZTYh.mjs +236 -0
- package/dist/credentialSchemas-mz9QZTYh.mjs.map +1 -0
- package/dist/credentials-B72Jrk66.mjs +1817 -0
- package/dist/credentials-B72Jrk66.mjs.map +1 -0
- package/dist/credentials-Dmhuj3FX.cjs +2272 -0
- package/dist/credentials-Dmhuj3FX.cjs.map +1 -0
- package/dist/databases-DawSdqBI.cjs +703 -0
- package/dist/databases-DawSdqBI.cjs.map +1 -0
- package/dist/databases-mzSUFBTw.mjs +588 -0
- package/dist/databases-mzSUFBTw.mjs.map +1 -0
- package/dist/define-6poNqm5O.mjs +106 -0
- package/dist/define-6poNqm5O.mjs.map +1 -0
- package/dist/define-crmMcXFS.cjs +153 -0
- package/dist/define-crmMcXFS.cjs.map +1 -0
- package/dist/deploy/public.cjs +211 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +647 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +647 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +144 -0
- package/dist/deploy/public.mjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- package/dist/deploy/sniffer-hooks.cjs +1 -1
- package/dist/deploy/sniffer-hooks.mjs +1 -1
- package/dist/deploy/sniffer-loader.cjs +2 -2
- package/dist/deploy/sniffer-loader.mjs +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +1 -1
- package/dist/deploy-BV6Tw73K.cjs +3892 -0
- package/dist/deploy-BV6Tw73K.cjs.map +1 -0
- package/dist/deploy-C4XjPy-a.mjs +3836 -0
- package/dist/deploy-C4XjPy-a.mjs.map +1 -0
- package/dist/discover-CRywE7yc.cjs +1085 -0
- package/dist/discover-CRywE7yc.cjs.map +1 -0
- package/dist/discover-DbDrCQ8h.mjs +940 -0
- package/dist/discover-DbDrCQ8h.mjs.map +1 -0
- package/dist/docker-B0di7_Ub.cjs +1514 -0
- package/dist/docker-B0di7_Ub.cjs.map +1 -0
- package/dist/docker-D_NN2Z6W.mjs +1407 -0
- package/dist/docker-D_NN2Z6W.mjs.map +1 -0
- package/dist/dokploy-DDyZ0o4M.mjs +38 -0
- package/dist/dokploy-DDyZ0o4M.mjs.map +1 -0
- package/dist/dokploy-FFNHKz37.cjs +38 -0
- package/dist/dokploy-FFNHKz37.cjs.map +1 -0
- package/dist/drivers-aM87NQJi.cjs +224 -0
- package/dist/drivers-aM87NQJi.cjs.map +1 -0
- package/dist/drivers-uxLBq3e3.mjs +195 -0
- package/dist/drivers-uxLBq3e3.mjs.map +1 -0
- package/dist/eas-6_Z1ImVg.mjs +334 -0
- package/dist/eas-6_Z1ImVg.mjs.map +1 -0
- package/dist/eas-BetrZzjq.cjs +337 -0
- package/dist/eas-BetrZzjq.cjs.map +1 -0
- package/dist/emit-Bj6XSivk.mjs +136 -0
- package/dist/emit-Bj6XSivk.mjs.map +1 -0
- package/dist/emit-CDC__ubE.cjs +147 -0
- package/dist/emit-CDC__ubE.cjs.map +1 -0
- package/dist/encryption-BrRVjItb.cjs +90 -0
- package/dist/encryption-BrRVjItb.cjs.map +1 -0
- package/dist/encryption-DGnfdO68.mjs +89 -0
- package/dist/encryption-DGnfdO68.mjs.map +1 -0
- package/dist/engine-8TjM26dd.mjs +3217 -0
- package/dist/engine-8TjM26dd.mjs.map +1 -0
- package/dist/engine-C36N8por.cjs +3330 -0
- package/dist/engine-C36N8por.cjs.map +1 -0
- package/dist/errors-D8Gwp5kU.mjs +23 -0
- package/dist/errors-D8Gwp5kU.mjs.map +1 -0
- package/dist/errors-DMC4Umsb.cjs +34 -0
- package/dist/errors-DMC4Umsb.cjs.map +1 -0
- package/dist/github-BOu0bETi.cjs +901 -0
- package/dist/github-BOu0bETi.cjs.map +1 -0
- package/dist/github-Ct6XDkzE.mjs +900 -0
- package/dist/github-Ct6XDkzE.mjs.map +1 -0
- package/dist/googlePlay-BaRsxlJo.mjs +931 -0
- package/dist/googlePlay-BaRsxlJo.mjs.map +1 -0
- package/dist/googlePlay-JAxXMaGu.cjs +931 -0
- package/dist/googlePlay-JAxXMaGu.cjs.map +1 -0
- package/dist/{index-D-iAVHx-.d.cts → index-B35vTdAW.d.cts} +39 -15
- package/dist/index-B35vTdAW.d.cts.map +1 -0
- package/dist/{index-Cd-qeOam.d.mts → index-Dv1Zj86i.d.mts} +39 -15
- package/dist/index-Dv1Zj86i.d.mts.map +1 -0
- package/dist/index.cjs +13594 -12347
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13541 -12292
- package/dist/index.mjs.map +1 -1
- package/dist/local-D7WVQcJJ.mjs +224 -0
- package/dist/local-D7WVQcJJ.mjs.map +1 -0
- package/dist/local-DFPeCIJi.cjs +241 -0
- package/dist/local-DFPeCIJi.cjs.map +1 -0
- package/dist/migrate-BMIUYmpM.mjs +267 -0
- package/dist/migrate-BMIUYmpM.mjs.map +1 -0
- package/dist/migrate-CnE-X40v.mjs +181 -0
- package/dist/migrate-CnE-X40v.mjs.map +1 -0
- package/dist/migrate-CvuWFjos.cjs +181 -0
- package/dist/migrate-CvuWFjos.cjs.map +1 -0
- package/dist/migrate-DdE8kF0j.cjs +272 -0
- package/dist/migrate-DdE8kF0j.cjs.map +1 -0
- package/dist/notes-C_4SO0x4.mjs +399 -0
- package/dist/notes-C_4SO0x4.mjs.map +1 -0
- package/dist/notes-ORze6zXA.cjs +500 -0
- package/dist/notes-ORze6zXA.cjs.map +1 -0
- package/dist/openapi.cjs +213 -7
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +32 -8
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +32 -8
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +208 -2
- package/dist/openapi.mjs.map +1 -0
- package/dist/projectBucket-C9x0gzEO.cjs +263 -0
- package/dist/projectBucket-C9x0gzEO.cjs.map +1 -0
- package/dist/projectBucket-CdRj4IyR.mjs +222 -0
- package/dist/projectBucket-CdRj4IyR.mjs.map +1 -0
- package/dist/provider-BqpjG9QM.cjs +57 -0
- package/dist/provider-BqpjG9QM.cjs.map +1 -0
- package/dist/provider-CEOKk8NS.mjs +46 -0
- package/dist/provider-CEOKk8NS.mjs.map +1 -0
- package/dist/publish-CL376jrq.cjs +124 -0
- package/dist/publish-CL376jrq.cjs.map +1 -0
- package/dist/publish-DkkWS3Pj.mjs +123 -0
- package/dist/publish-DkkWS3Pj.mjs.map +1 -0
- package/dist/ready-BNh3zsSn.cjs +404 -0
- package/dist/ready-BNh3zsSn.cjs.map +1 -0
- package/dist/ready-g25dcGzK.mjs +375 -0
- package/dist/ready-g25dcGzK.mjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +31 -89
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +31 -89
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -3
- package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
- package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
- package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
- package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
- package/dist/resolve-BXzDwYUS.cjs +316 -0
- package/dist/resolve-BXzDwYUS.cjs.map +1 -0
- package/dist/resolve-CZ_Wel7j.mjs +263 -0
- package/dist/resolve-CZ_Wel7j.mjs.map +1 -0
- package/dist/rollback-D_FXI_K5.mjs +136 -0
- package/dist/rollback-D_FXI_K5.mjs.map +1 -0
- package/dist/rollback-p1y0KlED.cjs +165 -0
- package/dist/rollback-p1y0KlED.cjs.map +1 -0
- package/dist/runtime-CFvcLEJW.d.cts +82 -0
- package/dist/runtime-CFvcLEJW.d.cts.map +1 -0
- package/dist/runtime-dwsH6ddo.d.mts +82 -0
- package/dist/runtime-dwsH6ddo.d.mts.map +1 -0
- package/dist/s3-CV5baYeq.mjs +215 -0
- package/dist/s3-CV5baYeq.mjs.map +1 -0
- package/dist/s3-DTX4Kkmn.cjs +215 -0
- package/dist/s3-DTX4Kkmn.cjs.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +53 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +54 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +47 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +48 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +75 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +76 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
- package/dist/schemas-BCwKKA42.mjs.map +1 -0
- package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
- package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
- package/dist/secretsManager-CQORubp9.mjs +97 -0
- package/dist/secretsManager-CQORubp9.mjs.map +1 -0
- package/dist/secretsManager-RAGcEDX1.cjs +108 -0
- package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
- package/dist/seeds-B3xvUAQf.cjs +363 -0
- package/dist/seeds-B3xvUAQf.cjs.map +1 -0
- package/dist/seeds-BCC8vAXR.mjs +298 -0
- package/dist/seeds-BCC8vAXR.mjs.map +1 -0
- package/dist/serverSetup-BykJrnYe.cjs +652 -0
- package/dist/serverSetup-BykJrnYe.cjs.map +1 -0
- package/dist/serverSetup-CkuvIoej.mjs +652 -0
- package/dist/serverSetup-CkuvIoej.mjs.map +1 -0
- package/dist/sniffer-BIpoMNGz.mjs +1824 -0
- package/dist/sniffer-BIpoMNGz.mjs.map +1 -0
- package/dist/sniffer-DiBMi93N.cjs +1997 -0
- package/dist/sniffer-DiBMi93N.cjs.map +1 -0
- package/dist/snsSubscriptions-CkO_zk0j.cjs +1173 -0
- package/dist/snsSubscriptions-CkO_zk0j.cjs.map +1 -0
- package/dist/snsSubscriptions-CrmfcJfv.mjs +1048 -0
- package/dist/snsSubscriptions-CrmfcJfv.mjs.map +1 -0
- package/dist/sst-BZ9sTG8H.mjs +462 -0
- package/dist/sst-BZ9sTG8H.mjs.map +1 -0
- package/dist/sst-D233GoQY.cjs +485 -0
- package/dist/sst-D233GoQY.cjs.map +1 -0
- package/dist/stack-1yXKqI83.cjs +2287 -0
- package/dist/stack-1yXKqI83.cjs.map +1 -0
- package/dist/stack-pUz70Rmw.mjs +2124 -0
- package/dist/stack-pUz70Rmw.mjs.map +1 -0
- package/dist/stage-D6E_TlvR.mjs +302 -0
- package/dist/stage-D6E_TlvR.mjs.map +1 -0
- package/dist/stage-DAhomyUk.cjs +313 -0
- package/dist/stage-DAhomyUk.cjs.map +1 -0
- package/dist/stages-Bs1THSy7.cjs +190 -0
- package/dist/stages-Bs1THSy7.cjs.map +1 -0
- package/dist/stages-_xCG4Ymu.mjs +190 -0
- package/dist/stages-_xCG4Ymu.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-CKBLsg6b.cjs +85 -0
- package/dist/terminal-CKBLsg6b.cjs.map +1 -0
- package/dist/terminal-CRinpE1t.mjs +85 -0
- package/dist/terminal-CRinpE1t.mjs.map +1 -0
- package/dist/types-Bl_CwZC9.cjs +90 -0
- package/dist/types-Bl_CwZC9.cjs.map +1 -0
- package/dist/{types-BGo5TaNE.d.mts → types-Dk--xVOT.d.cts} +2234 -439
- package/dist/types-Dk--xVOT.d.cts.map +1 -0
- package/dist/{types-C5ZNpUad.d.cts → types-DwQYpd_0.d.mts} +2232 -439
- package/dist/types-DwQYpd_0.d.mts.map +1 -0
- package/dist/types-Y1NfWlyG.mjs +61 -0
- package/dist/types-Y1NfWlyG.mjs.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +6 -2
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -2
- package/dist/workspace-1szcahj9.cjs +2916 -0
- package/dist/workspace-1szcahj9.cjs.map +1 -0
- package/dist/workspace-DFGsrjGD.mjs +2480 -0
- package/dist/workspace-DFGsrjGD.mjs.map +1 -0
- package/package.json +66 -14
- package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
- package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
- package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
- package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
- package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
- package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
- package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
- package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
- package/dist/bundler-BodTL4kf.mjs.map +0 -1
- package/dist/config-Q1rvKHvw.cjs +0 -467
- package/dist/config-Q1rvKHvw.cjs.map +0 -1
- package/dist/config-pqGD3hF9.mjs +0 -414
- package/dist/config-pqGD3hF9.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/credentials-BekkKtY_.mjs +0 -2780
- package/dist/credentials-BekkKtY_.mjs.map +0 -1
- package/dist/credentials-Q6F0uqJq.cjs +0 -2917
- package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
- package/dist/discover-BERGFg8v.cjs +0 -288
- package/dist/discover-BERGFg8v.cjs.map +0 -1
- package/dist/discover-CK-n3w6b.mjs +0 -244
- package/dist/discover-CK-n3w6b.mjs.map +0 -1
- package/dist/emit-BdoPFjZf.cjs +0 -253
- package/dist/emit-BdoPFjZf.cjs.map +0 -1
- package/dist/emit-Bzq7JsMP.mjs +0 -224
- package/dist/emit-Bzq7JsMP.mjs.map +0 -1
- package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
- package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
- package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
- package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
- package/dist/generator-LfZU7NlU.mjs +0 -247
- package/dist/generator-LfZU7NlU.mjs.map +0 -1
- package/dist/generator-Wdfp0jCS.cjs +0 -282
- package/dist/generator-Wdfp0jCS.cjs.map +0 -1
- package/dist/github-BfflNPVe.cjs +0 -203
- package/dist/github-BfflNPVe.cjs.map +0 -1
- package/dist/github-CRwnxKmD.mjs +0 -203
- package/dist/github-CRwnxKmD.mjs.map +0 -1
- package/dist/index-Cd-qeOam.d.mts.map +0 -1
- package/dist/index-D-iAVHx-.d.cts.map +0 -1
- package/dist/keystore-B4PRlbgE.mjs +0 -81
- package/dist/keystore-B4PRlbgE.mjs.map +0 -1
- package/dist/keystore-DgGRj2Yy.cjs +0 -98
- package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
- package/dist/openapi-Dcbme-Us.cjs +0 -2038
- package/dist/openapi-Dcbme-Us.cjs.map +0 -1
- package/dist/openapi-vy4JzhUv.mjs +0 -1991
- package/dist/openapi-vy4JzhUv.mjs.map +0 -1
- package/dist/storage-C-30BD1e.cjs +0 -272
- package/dist/storage-C-30BD1e.cjs.map +0 -1
- package/dist/storage-P_b3w7uj.mjs +0 -231
- package/dist/storage-P_b3w7uj.mjs.map +0 -1
- package/dist/sync-B3xxXtJT.mjs +0 -88
- package/dist/sync-B3xxXtJT.mjs.map +0 -1
- package/dist/sync-D7uTIIEi.cjs +0 -111
- package/dist/sync-D7uTIIEi.cjs.map +0 -1
- package/dist/types-BGo5TaNE.d.mts.map +0 -1
- package/dist/types-C5ZNpUad.d.cts.map +0 -1
- package/dist/workspace-CgwmXEtc.mjs.map +0 -1
- package/dist/workspace-mFpI_ky_.cjs.map +0 -1
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
|
|
2
|
+
import { a as allConstructGlobs, b as isWorkspaceConfig, d as getAppGkmConfig, m as processConfig } from "./workspace-DFGsrjGD.mjs";
|
|
3
|
+
import { a as discriminatedUnion, c as literal, d as object, f as record, g as unknown, n as array, p as string } from "./schemas-BCwKKA42.mjs";
|
|
4
|
+
import { i as discover, l as runWorker, m as activeSandbox, y as output } from "./discover-DbDrCQ8h.mjs";
|
|
5
|
+
import { dirname, join, parse, resolve, sep } from "node:path";
|
|
6
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
7
|
+
import { WILDCARD_SUBDOMAIN, dependenciesOf, isWildcardSite, kebabCase } from "@geekmidas/manifest";
|
|
8
|
+
//#region src/workspace/subdomains.ts
|
|
9
|
+
/**
|
|
10
|
+
* The subdomains of a stage's domain, as a wildcard site sees them.
|
|
11
|
+
*
|
|
12
|
+
* A site declared `subdomain: '*'` answers on every label nothing else does,
|
|
13
|
+
* so the labels something else does answer on are the ones a tenant can never
|
|
14
|
+
* take. They come from two places and from nowhere else: every app's own
|
|
15
|
+
* label, read off the constructs and never listed by hand, and the names no
|
|
16
|
+
* construct declares (`www`, `mail`, `status`), listed once in the workspace
|
|
17
|
+
* config as `protectedSubdomains`.
|
|
18
|
+
*/
|
|
19
|
+
/** A `protectedSubdomains` entry an app already answers on. */
|
|
20
|
+
var ProtectedSubdomainIsAnApp = class extends GkmError {
|
|
21
|
+
subdomain;
|
|
22
|
+
app;
|
|
23
|
+
constructor(subdomain, app) {
|
|
24
|
+
super(`protectedSubdomains lists '${subdomain}', which '${app}' already answers on — a construct's own subdomain is protected without being listed. Remove it from protectedSubdomains.`);
|
|
25
|
+
this.subdomain = subdomain;
|
|
26
|
+
this.app = app;
|
|
27
|
+
this.name = "ProtectedSubdomainIsAnApp";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/** Two sites that both answer on every subdomain. */
|
|
31
|
+
var SecondWildcardSite = class extends GkmError {
|
|
32
|
+
sites;
|
|
33
|
+
constructor(sites) {
|
|
34
|
+
super(`${sites.join(" and ")} both declare subdomain: '*', and two sites cannot share the same hosts. Keep one wildcard site per project; give the other a subdomain of its own.`);
|
|
35
|
+
this.sites = sites;
|
|
36
|
+
this.name = "SecondWildcardSite";
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/** A wildcard site whose `hosts` route is on no surface the project declares. */
|
|
40
|
+
var SiteHostsEndpointMissing = class extends GkmError {
|
|
41
|
+
site;
|
|
42
|
+
surface;
|
|
43
|
+
path;
|
|
44
|
+
constructor(site, surface, path) {
|
|
45
|
+
super(`'${site}' checks its hosts with GET ${path} on '${surface}', but '${surface}' serves no such route. Export the endpoint from the surface's endpoints, or point \`hosts\` at one it serves.`);
|
|
46
|
+
this.site = site;
|
|
47
|
+
this.surface = surface;
|
|
48
|
+
this.path = path;
|
|
49
|
+
this.name = "SiteHostsEndpointMissing";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/** The project's one wildcard site, or `undefined` when it has none. */
|
|
53
|
+
function wildcardSite(manifest) {
|
|
54
|
+
return Object.values(manifest).find(isWildcardSite);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Every label an app answers on, by the app it belongs to — what a deploy
|
|
58
|
+
* puts under the stage's domain: a surface's or site's `subdomain` (or its id
|
|
59
|
+
* kebab-cased), each file server and its processors' origin, and each worker,
|
|
60
|
+
* which SNS may push to on a host of its own.
|
|
61
|
+
*
|
|
62
|
+
* The root site's is kept although it answers on the domain itself: which
|
|
63
|
+
* site is the root can change without a tenant's slug changing meaning. The
|
|
64
|
+
* wildcard site has none — its labels are whatever is left.
|
|
65
|
+
*/
|
|
66
|
+
function appSubdomains(manifest) {
|
|
67
|
+
const labels = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const [id, declaration] of Object.entries(manifest)) switch (declaration.kind) {
|
|
69
|
+
case "rest-api":
|
|
70
|
+
case "websocket-api":
|
|
71
|
+
labels.set(declaration.subdomain ?? kebabCase(id), id);
|
|
72
|
+
break;
|
|
73
|
+
case "site":
|
|
74
|
+
if (declaration.subdomain === WILDCARD_SUBDOMAIN) break;
|
|
75
|
+
labels.set(declaration.subdomain ?? kebabCase(id), id);
|
|
76
|
+
break;
|
|
77
|
+
case "file-server":
|
|
78
|
+
labels.set(kebabCase(id), id);
|
|
79
|
+
if (declaration.processors?.length) labels.set(`${kebabCase(id)}-processors`, id);
|
|
80
|
+
break;
|
|
81
|
+
case "worker": labels.set(kebabCase(id), id);
|
|
82
|
+
}
|
|
83
|
+
return labels;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The labels no tenant may take: every app's own and the workspace's
|
|
87
|
+
* `protectedSubdomains`, sorted.
|
|
88
|
+
*/
|
|
89
|
+
function protectedSubdomains(manifest, configured = []) {
|
|
90
|
+
return [.../* @__PURE__ */ new Set([...appSubdomains(manifest).keys(), ...configured])].sort();
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What a project's subdomains have to satisfy before anything is derived
|
|
94
|
+
* from them.
|
|
95
|
+
*
|
|
96
|
+
* @throws {SecondWildcardSite} when two sites declare `subdomain: '*'`
|
|
97
|
+
* @throws {SiteHostsEndpointMissing} when the wildcard site's `hosts` route is not served
|
|
98
|
+
* @throws {ProtectedSubdomainIsAnApp} when `protectedSubdomains` repeats an app's own
|
|
99
|
+
*/
|
|
100
|
+
function assertSubdomains(manifest, configured = []) {
|
|
101
|
+
const wildcards = Object.values(manifest).filter(isWildcardSite);
|
|
102
|
+
if (wildcards.length > 1) throw new SecondWildcardSite(wildcards.map((site) => site.id).sort());
|
|
103
|
+
const site = wildcards[0];
|
|
104
|
+
if (site?.hosts) {
|
|
105
|
+
const surface = manifest[site.hosts.surface];
|
|
106
|
+
if (!(surface?.kind === "rest-api" && surface.endpoints.some((endpoint) => endpoint.method.toUpperCase() === "GET" && endpoint.path === site.hosts?.path))) throw new SiteHostsEndpointMissing(site.id, site.hosts.surface, site.hosts.path);
|
|
107
|
+
}
|
|
108
|
+
const labels = appSubdomains(manifest);
|
|
109
|
+
for (const subdomain of configured) {
|
|
110
|
+
const app = labels.get(subdomain);
|
|
111
|
+
if (app) throw new ProtectedSubdomainIsAnApp(subdomain, app);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/workspace/derive.ts
|
|
116
|
+
/**
|
|
117
|
+
* The apps a manifest implies.
|
|
118
|
+
*
|
|
119
|
+
* `gkm.config.ts` used to carry an `apps` block naming every app: its type, its
|
|
120
|
+
* path, its port, its framework, which other apps it depended on. Every one of
|
|
121
|
+
* those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`
|
|
122
|
+
* and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',
|
|
123
|
+
* dependencies: ['api'] }` are the same statement written twice, and only one of
|
|
124
|
+
* them was checked against anything — so the copy in config was free to drift,
|
|
125
|
+
* and a surface config had no entry for simply never deployed.
|
|
126
|
+
*
|
|
127
|
+
* So the list comes from the graph. A `site` is an app, and so is every
|
|
128
|
+
* `rest-api` — one surface, one container, at the `path` it declared.
|
|
129
|
+
*
|
|
130
|
+
* What config still supplies is what no graph can answer: the backends a cache
|
|
131
|
+
* and a mailer resolve to, the deploy endpoint, the stage's domain.
|
|
132
|
+
*/
|
|
133
|
+
/** Which frontend framework builds each site variant. */
|
|
134
|
+
const FRAMEWORKS = {
|
|
135
|
+
static: "vite",
|
|
136
|
+
next: "nextjs",
|
|
137
|
+
tanstack: "tanstack-start"
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* The app key a construct id becomes.
|
|
141
|
+
*
|
|
142
|
+
* The same kebab form every physical name is built from, so `Api` is `api` in
|
|
143
|
+
* the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an
|
|
144
|
+
* environment — one id, three renderings, no second list.
|
|
145
|
+
*/
|
|
146
|
+
function appKey(id) {
|
|
147
|
+
return kebabCase(id);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The app serving a surface: its own, always.
|
|
151
|
+
*
|
|
152
|
+
* Every surface gets a container. There is no arrangement in which one runs
|
|
153
|
+
* inside another — two surfaces in a process share a filesystem, an
|
|
154
|
+
* environment, and every credential either was granted, so an auth server
|
|
155
|
+
* beside an API is one bug in the API away from being read by it.
|
|
156
|
+
*/
|
|
157
|
+
function hostOf(manifest, id) {
|
|
158
|
+
const declaration = manifest[id];
|
|
159
|
+
if (!declaration || declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") return void 0;
|
|
160
|
+
return id;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Local ports, assigned so that adding a site does not renumber the others.
|
|
164
|
+
*
|
|
165
|
+
* Backends first, then the site holding the base domain, then the rest
|
|
166
|
+
* alphabetically. The ordering is arbitrary but it is *fixed*, which is the
|
|
167
|
+
* property that matters: a port that moves when an unrelated app is added is a
|
|
168
|
+
* port nobody can put in a bookmark. A construct that names its own port keeps
|
|
169
|
+
* it, and is skipped here.
|
|
170
|
+
*/
|
|
171
|
+
function assignPorts(apps) {
|
|
172
|
+
const rank = (name, app) => [
|
|
173
|
+
app.type === "backend" ? 0 : app.type === "web" ? 1 : 2,
|
|
174
|
+
app.root ? 0 : 1,
|
|
175
|
+
name
|
|
176
|
+
];
|
|
177
|
+
const ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {
|
|
178
|
+
const [at, ar, an] = rank(aName, a);
|
|
179
|
+
const [bt, br, bn] = rank(bName, b);
|
|
180
|
+
return at - bt || ar - br || an.localeCompare(bn);
|
|
181
|
+
});
|
|
182
|
+
const taken = new Set(ordered.map(([, app]) => app.port).filter((p) => !!p));
|
|
183
|
+
let next = 3e3;
|
|
184
|
+
for (const [, app] of ordered) {
|
|
185
|
+
if (app.port) continue;
|
|
186
|
+
while (taken.has(next)) next += 1;
|
|
187
|
+
app.port = next;
|
|
188
|
+
taken.add(next);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Whichever site holds the base domain.
|
|
193
|
+
*
|
|
194
|
+
* The convention first — a site named `web` — because it is one people already
|
|
195
|
+
* rely on. Then an explicit `root: true`. A project with one site needs neither.
|
|
196
|
+
*/
|
|
197
|
+
function markRoot(apps) {
|
|
198
|
+
const sites = Object.entries(apps).filter(([, a]) => a.type === "web" && a.subdomain !== WILDCARD_SUBDOMAIN);
|
|
199
|
+
if (sites.length === 0) return;
|
|
200
|
+
if (sites.some(([, a]) => a.root)) return;
|
|
201
|
+
const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
|
|
202
|
+
if (chosen) chosen[1].root = true;
|
|
203
|
+
}
|
|
204
|
+
function derivedApps(manifest, workspace) {
|
|
205
|
+
assertSubdomains(manifest, workspace.protectedSubdomains);
|
|
206
|
+
const apps = {};
|
|
207
|
+
const defaultTarget = workspace.deploy?.default ?? "dokploy";
|
|
208
|
+
for (const [id, declaration] of Object.entries(manifest)) {
|
|
209
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
|
|
210
|
+
const spec = declaration.kind === "site" || declaration.kind === "mobile-app" ? declaration.app : {
|
|
211
|
+
path: declaration.path,
|
|
212
|
+
...declaration.kind === "rest-api" && declaration.telescope ? { telescope: true } : {}
|
|
213
|
+
};
|
|
214
|
+
const name = appKey(id);
|
|
215
|
+
const configured = workspace.apps[name];
|
|
216
|
+
apps[name] = {
|
|
217
|
+
...configured,
|
|
218
|
+
type: declaration.kind === "site" ? "web" : declaration.kind === "mobile-app" ? "mobile" : "backend",
|
|
219
|
+
path: spec.path,
|
|
220
|
+
port: spec.port ?? configured?.port ?? 0,
|
|
221
|
+
...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
222
|
+
dependencies: [],
|
|
223
|
+
resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
|
|
224
|
+
...declaration.kind === "site" ? {
|
|
225
|
+
framework: configured?.framework ?? FRAMEWORKS[declaration.variant],
|
|
226
|
+
...declaration.root ? { root: true } : {},
|
|
227
|
+
...spec.config ? { config: spec.config } : {}
|
|
228
|
+
} : {},
|
|
229
|
+
...declaration.kind === "mobile-app" ? {
|
|
230
|
+
framework: configured?.framework ?? declaration.variant,
|
|
231
|
+
...spec.config ? { config: spec.config } : {}
|
|
232
|
+
} : {},
|
|
233
|
+
...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
|
|
234
|
+
...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
|
|
235
|
+
...spec.runtime !== void 0 ? { runtime: spec.runtime } : {},
|
|
236
|
+
...spec.env !== void 0 ? { env: spec.env } : {},
|
|
237
|
+
...spec.entry !== void 0 ? { entry: spec.entry } : {},
|
|
238
|
+
...configured?.domain ? { domain: configured.domain } : {}
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
for (const [id, declaration] of Object.entries(manifest)) {
|
|
242
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
|
|
243
|
+
const app = apps[appKey(id)];
|
|
244
|
+
if (!app) continue;
|
|
245
|
+
const edges = dependenciesOf(declaration);
|
|
246
|
+
const names = /* @__PURE__ */ new Set();
|
|
247
|
+
for (const edge of edges) {
|
|
248
|
+
if (edge.kind !== "rest-api") continue;
|
|
249
|
+
const host = hostOf(manifest, edge.target);
|
|
250
|
+
if (!host) continue;
|
|
251
|
+
const key = appKey(host);
|
|
252
|
+
if (key !== appKey(id) && apps[key]) names.add(key);
|
|
253
|
+
}
|
|
254
|
+
app.dependencies = [...names].sort();
|
|
255
|
+
}
|
|
256
|
+
markRoot(apps);
|
|
257
|
+
assignPorts(apps);
|
|
258
|
+
for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
|
|
259
|
+
return apps;
|
|
260
|
+
}
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/config.ts
|
|
263
|
+
/**
|
|
264
|
+
* Define GKM configuration with full TypeScript support.
|
|
265
|
+
* This is an identity function that provides type safety and autocomplete.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```ts
|
|
269
|
+
* // gkm.config.ts
|
|
270
|
+
* import { defineConfig } from '@geekmidas/cli/config';
|
|
271
|
+
*
|
|
272
|
+
* export default defineConfig({
|
|
273
|
+
* routes: './src/endpoints/**\/*.ts',
|
|
274
|
+
* envParser: './src/config/env',
|
|
275
|
+
* logger: './src/config/logger',
|
|
276
|
+
* telescope: true,
|
|
277
|
+
* });
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
function defineConfig(config) {
|
|
281
|
+
return config;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Parse a module config string into path and import pattern.
|
|
285
|
+
*
|
|
286
|
+
* @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
|
|
287
|
+
* @param defaultAlias - The default alias name to use if no export name specified
|
|
288
|
+
* @returns Object with path and import pattern
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* parseModuleConfig('./src/config/env', 'envParser')
|
|
292
|
+
* // { path: './src/config/env', importPattern: 'envParser' }
|
|
293
|
+
*
|
|
294
|
+
* parseModuleConfig('./src/config/env#envParser', 'envParser')
|
|
295
|
+
* // { path: './src/config/env', importPattern: '{ envParser }' }
|
|
296
|
+
*
|
|
297
|
+
* parseModuleConfig('./src/config/env#myEnv', 'envParser')
|
|
298
|
+
* // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
|
|
299
|
+
*/
|
|
300
|
+
function parseModuleConfig(configString, defaultAlias) {
|
|
301
|
+
const parts = configString.split("#");
|
|
302
|
+
const path = parts[0] ?? configString;
|
|
303
|
+
const exportName = parts[1];
|
|
304
|
+
return {
|
|
305
|
+
path,
|
|
306
|
+
importPattern: !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Find and return the path to the config file.
|
|
311
|
+
*
|
|
312
|
+
* Resolution order:
|
|
313
|
+
* 1. GKM_CONFIG_PATH env var (set by workspace dev command)
|
|
314
|
+
* 2. Walk up directory tree from cwd
|
|
315
|
+
*/
|
|
316
|
+
function findConfigPath(cwd) {
|
|
317
|
+
const files = [
|
|
318
|
+
"gkm.config.json",
|
|
319
|
+
"gkm.config.ts",
|
|
320
|
+
"gkm.config.js"
|
|
321
|
+
];
|
|
322
|
+
const envConfigPath = process.env.GKM_CONFIG_PATH;
|
|
323
|
+
if (envConfigPath && existsSync(envConfigPath)) return {
|
|
324
|
+
configPath: envConfigPath,
|
|
325
|
+
workspaceRoot: dirname(envConfigPath)
|
|
326
|
+
};
|
|
327
|
+
let currentDir = cwd;
|
|
328
|
+
const { root } = parse(currentDir);
|
|
329
|
+
while (currentDir !== root) {
|
|
330
|
+
for (const file of files) {
|
|
331
|
+
const configPath = join(currentDir, file);
|
|
332
|
+
if (existsSync(configPath)) return {
|
|
333
|
+
configPath,
|
|
334
|
+
workspaceRoot: currentDir
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
currentDir = dirname(currentDir);
|
|
338
|
+
}
|
|
339
|
+
throw new ConfigNotFound(cwd);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* The directory holding the gkm config that `cwd` belongs to — the project a
|
|
343
|
+
* sandbox for it is confined to.
|
|
344
|
+
*
|
|
345
|
+
* @throws {ConfigNotFound} when neither `cwd` nor any parent has one.
|
|
346
|
+
*/
|
|
347
|
+
function findWorkspaceRoot(cwd) {
|
|
348
|
+
return findConfigPath(cwd).workspaceRoot;
|
|
349
|
+
}
|
|
350
|
+
/** No gkm config in a directory or any of its parents. */
|
|
351
|
+
var ConfigNotFound = class extends GkmError {
|
|
352
|
+
cwd;
|
|
353
|
+
constructor(cwd) {
|
|
354
|
+
super("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
|
|
355
|
+
this.cwd = cwd;
|
|
356
|
+
this.name = "ConfigNotFound";
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* How long loading a config, or discovering its constructs, may take in a
|
|
361
|
+
* sandbox: room for tsx to compile a large project cold, and not a deploy
|
|
362
|
+
* held open by a config that never finishes importing.
|
|
363
|
+
*/
|
|
364
|
+
const CONFIG_LOAD_TIMEOUT_MS = 6e4;
|
|
365
|
+
/** The config failed to import, or threw while it ran. */
|
|
366
|
+
var ConfigLoadFailed = class extends Error {
|
|
367
|
+
configPath;
|
|
368
|
+
detail;
|
|
369
|
+
constructor(configPath, detail) {
|
|
370
|
+
super(`Failed to load config: ${detail}`);
|
|
371
|
+
this.configPath = configPath;
|
|
372
|
+
this.detail = detail;
|
|
373
|
+
this.name = "ConfigLoadFailed";
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* The config holds something that is not data — a custom state store, an
|
|
378
|
+
* inline deploy target, a function — and the sandbox it was loaded in hands
|
|
379
|
+
* the deploy nothing but data.
|
|
380
|
+
*/
|
|
381
|
+
var ConfigObjectNotSerializable = class extends Error {
|
|
382
|
+
configPath;
|
|
383
|
+
paths;
|
|
384
|
+
constructor(configPath, paths) {
|
|
385
|
+
super(`${configPath} holds values that are not plain data at: ${paths.join(", ")}. It was loaded in an isolating sandbox, which hands the deploy the config as JSON, so a live object — a custom store, an inline target, a function — cannot reach it. Configure these with plain values instead, or deploy this project with a sandbox that is not isolating (the default) if the host trusts it.`);
|
|
386
|
+
this.configPath = configPath;
|
|
387
|
+
this.paths = paths;
|
|
388
|
+
this.name = "ConfigObjectNotSerializable";
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
/** What the config worker answers. Checked: the worker ran project code. */
|
|
392
|
+
const ConfigAnswer = discriminatedUnion("reason", [
|
|
393
|
+
object({
|
|
394
|
+
reason: literal("loaded"),
|
|
395
|
+
config: record(string(), unknown())
|
|
396
|
+
}),
|
|
397
|
+
object({
|
|
398
|
+
reason: literal("live"),
|
|
399
|
+
paths: array(string())
|
|
400
|
+
}),
|
|
401
|
+
object({
|
|
402
|
+
reason: literal("failed"),
|
|
403
|
+
error: object({
|
|
404
|
+
name: string(),
|
|
405
|
+
message: string()
|
|
406
|
+
})
|
|
407
|
+
})
|
|
408
|
+
]);
|
|
409
|
+
/** Import the config in this process — live objects and all. */
|
|
410
|
+
async function importConfig(configPath) {
|
|
411
|
+
try {
|
|
412
|
+
return (await import(configPath)).default;
|
|
413
|
+
} catch (error) {
|
|
414
|
+
throw new ConfigLoadFailed(configPath, error.message);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The config, loaded in `sandbox` and handed back as JSON.
|
|
419
|
+
*
|
|
420
|
+
* A config holding live objects cannot come back that way. An isolating
|
|
421
|
+
* sandbox refuses it with {@link ConfigObjectNotSerializable}; any other
|
|
422
|
+
* imports it here as well, as before, since the host already runs this
|
|
423
|
+
* project's code as its own.
|
|
424
|
+
*/
|
|
425
|
+
async function loadConfigInSandbox(sandbox, configPath, workspaceRoot, timeoutMs = CONFIG_LOAD_TIMEOUT_MS) {
|
|
426
|
+
const { value } = await runWorker(sandbox, "config load", {
|
|
427
|
+
name: "config-worker",
|
|
428
|
+
args: [configPath],
|
|
429
|
+
cwd: workspaceRoot,
|
|
430
|
+
timeoutMs,
|
|
431
|
+
schema: ConfigAnswer
|
|
432
|
+
});
|
|
433
|
+
switch (value.reason) {
|
|
434
|
+
case "loaded": return value.config;
|
|
435
|
+
case "failed": throw new ConfigLoadFailed(configPath, value.error.message);
|
|
436
|
+
case "live":
|
|
437
|
+
if (sandbox.isolating) throw new ConfigObjectNotSerializable(configPath, value.paths);
|
|
438
|
+
return importConfig(configPath);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Load raw configuration from file.
|
|
443
|
+
*/
|
|
444
|
+
async function loadRawConfig(cwd, options = {}) {
|
|
445
|
+
const { configPath, workspaceRoot } = findConfigPath(cwd);
|
|
446
|
+
const sandbox = options.sandbox ?? activeSandbox();
|
|
447
|
+
return {
|
|
448
|
+
config: sandbox ? await loadConfigInSandbox(sandbox, configPath, workspaceRoot, options.timeoutMs) : await importConfig(configPath),
|
|
449
|
+
workspaceRoot
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Load configuration file (single-app format).
|
|
454
|
+
* For backwards compatibility with existing code.
|
|
455
|
+
*
|
|
456
|
+
* @deprecated Use loadWorkspaceConfig for new code
|
|
457
|
+
*/
|
|
458
|
+
async function loadConfig(cwd = process.cwd()) {
|
|
459
|
+
const { config } = await loadRawConfig(cwd);
|
|
460
|
+
if (isWorkspaceConfig(config)) throw new Error("Workspace configuration detected. Use loadWorkspaceConfig() instead.");
|
|
461
|
+
return config;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Load configuration file and process it as a workspace.
|
|
465
|
+
* Works with both single-app and workspace configurations.
|
|
466
|
+
*
|
|
467
|
+
* Single-app configs are automatically wrapped as a workspace with one app.
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```ts
|
|
471
|
+
* const { type, workspace } = await loadWorkspaceConfig();
|
|
472
|
+
*
|
|
473
|
+
* if (type === 'workspace') {
|
|
474
|
+
* console.log('Multi-app workspace:', workspace.apps);
|
|
475
|
+
* } else {
|
|
476
|
+
* console.log('Single app wrapped as workspace');
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*/
|
|
480
|
+
/**
|
|
481
|
+
* The workspace a directory belongs to, as its config states it — without
|
|
482
|
+
* discovering its constructs.
|
|
483
|
+
*
|
|
484
|
+
* For callers that need a fact the config holds (where a stage's secrets are
|
|
485
|
+
* stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
|
|
486
|
+
* construct module to derive the apps, which is a cost a secrets read should
|
|
487
|
+
* not pay.
|
|
488
|
+
*/
|
|
489
|
+
async function loadWorkspaceSettings(cwd = process.cwd(), options = {}) {
|
|
490
|
+
const { config, workspaceRoot } = await loadRawConfig(cwd, options);
|
|
491
|
+
return processConfig(config, workspaceRoot).workspace;
|
|
492
|
+
}
|
|
493
|
+
async function loadWorkspaceConfig(cwd = process.cwd(), options = {}) {
|
|
494
|
+
const { config, workspaceRoot } = await loadRawConfig(cwd, options);
|
|
495
|
+
return withDerivedApps(processConfig(config, workspaceRoot), options.sandbox);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* The loaded config, with its apps read off the graph.
|
|
499
|
+
*
|
|
500
|
+
* Here rather than at each call site because every command needs the same
|
|
501
|
+
* answer, and the ones that forgot to ask were exactly the bugs: a site that
|
|
502
|
+
* never deployed, a surface that could not be its own process. `gkm dev`,
|
|
503
|
+
* `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without
|
|
504
|
+
* any of them knowing a derivation happened.
|
|
505
|
+
*
|
|
506
|
+
* Discovery imports the construct modules — declarations only, not endpoints —
|
|
507
|
+
* which is the same import the reconciler and the build already do. A workspace
|
|
508
|
+
* with no `constructs` glob discovers nothing and keeps whatever its config
|
|
509
|
+
* said, so nothing that worked before changes.
|
|
510
|
+
*
|
|
511
|
+
* A construct file that throws is reported and skipped rather than taking the
|
|
512
|
+
* command down: `gkm dev` failing to start because a half-written declaration
|
|
513
|
+
* cannot be imported is a worse failure than starting with the app it does not
|
|
514
|
+
* describe yet.
|
|
515
|
+
*/
|
|
516
|
+
async function withDerivedApps(loaded, sandbox) {
|
|
517
|
+
const globs = allConstructGlobs(loaded.workspace);
|
|
518
|
+
if (globs.length === 0) throw new WorkspaceDeclaresNoConstructs(loaded.workspace.root);
|
|
519
|
+
try {
|
|
520
|
+
const background = {};
|
|
521
|
+
const manifest = await discover({
|
|
522
|
+
patterns: globs,
|
|
523
|
+
cwd: loaded.workspace.root,
|
|
524
|
+
background,
|
|
525
|
+
...sandbox ? { sandbox } : {}
|
|
526
|
+
});
|
|
527
|
+
return {
|
|
528
|
+
...loaded,
|
|
529
|
+
manifest,
|
|
530
|
+
background,
|
|
531
|
+
workspace: {
|
|
532
|
+
...loaded.workspace,
|
|
533
|
+
apps: derivedApps(manifest, loaded.workspace)
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
} catch (error) {
|
|
537
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
538
|
+
output.warn(`⚠️ Could not read constructs, so apps come from config alone: ${message}`);
|
|
539
|
+
return loaded;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* A workspace with no `constructs` glob.
|
|
544
|
+
*
|
|
545
|
+
* In v10 every address, container and app comes from what the workspace
|
|
546
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
547
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
548
|
+
*/
|
|
549
|
+
var WorkspaceDeclaresNoConstructs = class extends GkmError {
|
|
550
|
+
root;
|
|
551
|
+
constructor(root) {
|
|
552
|
+
super(`The workspace at ${root} declares no constructs. Every workspace names where its constructs live — \`constructs: ['./constructs/**/*.ts', './apps/*/endpoints/**/*.ts']\` in gkm.config.ts — and its apps, containers and URLs are derived from them.`);
|
|
553
|
+
this.root = root;
|
|
554
|
+
this.name = "WorkspaceDeclaresNoConstructs";
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* The app a directory is part of: the one whose `path` contains it.
|
|
559
|
+
*
|
|
560
|
+
* An app's path is the one its construct declares — `new RestApi('Api',
|
|
561
|
+
* { path: 'apps/api' })` — read off the workspace the constructs were derived
|
|
562
|
+
* into, never off the filesystem's package names. The deepest match wins, so
|
|
563
|
+
* an app inside another app's folder is its own; the workspace root belongs to
|
|
564
|
+
* no app unless one lives there.
|
|
565
|
+
*/
|
|
566
|
+
function resolveWorkspaceApp(loadedConfig, cwd) {
|
|
567
|
+
const here = real(cwd);
|
|
568
|
+
let found;
|
|
569
|
+
for (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {
|
|
570
|
+
const dir = real(join(loadedConfig.workspace.root, app.path));
|
|
571
|
+
if ((here === dir || here.startsWith(`${dir}${sep}`)) && (!found || dir.length > found.dir.length)) found = {
|
|
572
|
+
key,
|
|
573
|
+
app,
|
|
574
|
+
dir
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
return found && {
|
|
578
|
+
key: found.key,
|
|
579
|
+
app: found.app
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
/** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */
|
|
583
|
+
function real(path) {
|
|
584
|
+
const absolute = resolve(path);
|
|
585
|
+
return existsSync(absolute) ? realpathSync(absolute) : absolute;
|
|
586
|
+
}
|
|
587
|
+
/** A directory that no app in the workspace lives in. */
|
|
588
|
+
var NotInAnApp = class extends GkmError {
|
|
589
|
+
cwd;
|
|
590
|
+
apps;
|
|
591
|
+
constructor(cwd, apps) {
|
|
592
|
+
super(`${cwd} is not inside any app's path. Apps: ` + Object.entries(apps).map(([key, path]) => `${key} (${path})`).join(", ") + ".");
|
|
593
|
+
this.cwd = cwd;
|
|
594
|
+
this.apps = apps;
|
|
595
|
+
this.name = "NotInAnApp";
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
/** Every app's path, by key — what `NotInAnApp` lists. */
|
|
599
|
+
function appPaths(loadedConfig) {
|
|
600
|
+
return Object.fromEntries(Object.entries(loadedConfig.workspace.apps).map(([key, app]) => [key, app.path]));
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* The backend app a directory is part of, with its gkm config — found by the
|
|
604
|
+
* `path` its construct declares.
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```ts
|
|
608
|
+
* // From apps/api, where a construct declares `path: 'apps/api'`
|
|
609
|
+
* const { app, workspace, workspaceRoot } = await loadAppConfig();
|
|
610
|
+
* ```
|
|
611
|
+
*
|
|
612
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
613
|
+
* @throws {NotABackendApp} when the app it is in has no gkm config to run.
|
|
614
|
+
*/
|
|
615
|
+
async function loadAppConfig(cwd = process.cwd()) {
|
|
616
|
+
const { appName, app, workspace, workspaceRoot } = await loadWorkspaceAppInfo(cwd);
|
|
617
|
+
const gkmConfig = getAppGkmConfig(workspace, appName);
|
|
618
|
+
if (!gkmConfig) throw new NotABackendApp(appName);
|
|
619
|
+
return {
|
|
620
|
+
appName,
|
|
621
|
+
app,
|
|
622
|
+
gkmConfig,
|
|
623
|
+
workspace,
|
|
624
|
+
workspaceRoot,
|
|
625
|
+
appRoot: join(workspaceRoot, app.path)
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
/** The app a directory is in has no gkm config — a site, or an entry app. */
|
|
629
|
+
var NotABackendApp = class extends GkmError {
|
|
630
|
+
appName;
|
|
631
|
+
constructor(appName) {
|
|
632
|
+
super(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
|
|
633
|
+
this.appName = appName;
|
|
634
|
+
this.name = "NotABackendApp";
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* The app a directory is part of, frontend or backend — found by the `path`
|
|
639
|
+
* its construct declares. Unlike `loadAppConfig`, the app need not have a
|
|
640
|
+
* gkm config, which is what `gkm exec` and `gkm test` from a site need.
|
|
641
|
+
*
|
|
642
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
643
|
+
*/
|
|
644
|
+
async function loadWorkspaceAppInfo(cwd = process.cwd()) {
|
|
645
|
+
const { config, workspaceRoot } = await loadRawConfig(cwd);
|
|
646
|
+
const loadedConfig = await withDerivedApps(processConfig(config, workspaceRoot));
|
|
647
|
+
const resolved = resolveWorkspaceApp(loadedConfig, cwd);
|
|
648
|
+
if (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));
|
|
649
|
+
return {
|
|
650
|
+
appName: resolved.key,
|
|
651
|
+
app: resolved.app,
|
|
652
|
+
workspace: loadedConfig.workspace,
|
|
653
|
+
workspaceRoot
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
//#endregion
|
|
657
|
+
export { derivedApps as _, NotABackendApp as a, defineConfig as c, loadConfig as d, loadWorkspaceAppInfo as f, appKey as g, parseModuleConfig as h, ConfigObjectNotSerializable as i, findWorkspaceRoot as l, loadWorkspaceSettings as m, ConfigLoadFailed as n, NotInAnApp as o, loadWorkspaceConfig as p, ConfigNotFound as r, WorkspaceDeclaresNoConstructs as s, CONFIG_LOAD_TIMEOUT_MS as t, loadAppConfig as u, protectedSubdomains as v, wildcardSite as y };
|
|
658
|
+
|
|
659
|
+
//# sourceMappingURL=config-BLrAd7Of.mjs.map
|