@geekmidas/cli 10.0.0-alpha.136 → 10.0.0-alpha.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EndpointGenerator-D3p5WQOv.cjs → EndpointGenerator-BGKb_Ie6.cjs} +2 -2
- package/dist/{EndpointGenerator-D3p5WQOv.cjs.map → EndpointGenerator-BGKb_Ie6.cjs.map} +1 -1
- package/dist/{EndpointGenerator-Bm6xwLIF.mjs → EndpointGenerator-DDfPq2AZ.mjs} +2 -2
- package/dist/{EndpointGenerator-Bm6xwLIF.mjs.map → EndpointGenerator-DDfPq2AZ.mjs.map} +1 -1
- package/dist/{GoDaddyProvider-BZJtRv5p.cjs → GoDaddyProvider-BcP8dWX-.cjs} +2 -2
- package/dist/{GoDaddyProvider-BZJtRv5p.cjs.map → GoDaddyProvider-BcP8dWX-.cjs.map} +1 -1
- package/dist/{GoDaddyProvider-CDTSKt1k.mjs → GoDaddyProvider-D8KVrUYm.mjs} +2 -2
- package/dist/{GoDaddyProvider-CDTSKt1k.mjs.map → GoDaddyProvider-D8KVrUYm.mjs.map} +1 -1
- package/dist/{LegacyStateStore-CfhOur9W.mjs → LegacyStateStore-63cJw4AV.mjs} +3 -3
- package/dist/{LegacyStateStore-CfhOur9W.mjs.map → LegacyStateStore-63cJw4AV.mjs.map} +1 -1
- package/dist/{LegacyStateStore-CmQbzQGC.cjs → LegacyStateStore-De4hd05H.cjs} +3 -3
- package/dist/{LegacyStateStore-CmQbzQGC.cjs.map → LegacyStateStore-De4hd05H.cjs.map} +1 -1
- package/dist/{LocalStateStore-3ZT4-yUX.cjs → LocalStateStore-SiFl-guR.cjs} +2 -2
- package/dist/{LocalStateStore-3ZT4-yUX.cjs.map → LocalStateStore-SiFl-guR.cjs.map} +1 -1
- package/dist/{LocalStateStore-k3i8wp2q.mjs → LocalStateStore-jDPIJHLS.mjs} +2 -2
- package/dist/{LocalStateStore-k3i8wp2q.mjs.map → LocalStateStore-jDPIJHLS.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-HkNH_xw-.cjs → OpenApiTsGenerator-DoLFZu4i.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-HkNH_xw-.cjs.map → OpenApiTsGenerator-DoLFZu4i.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-BB6dGP8i.mjs → OpenApiTsGenerator-l1DUhgLV.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-BB6dGP8i.mjs.map → OpenApiTsGenerator-l1DUhgLV.mjs.map} +1 -1
- package/dist/{S3StateStore-D71GhBoc.mjs → S3StateStore-CudutATE.mjs} +2 -2
- package/dist/{S3StateStore-D71GhBoc.mjs.map → S3StateStore-CudutATE.mjs.map} +1 -1
- package/dist/{S3StateStore-Cf2DoRBZ.cjs → S3StateStore-UvVhNR69.cjs} +2 -2
- package/dist/{S3StateStore-Cf2DoRBZ.cjs.map → S3StateStore-UvVhNR69.cjs.map} +1 -1
- package/dist/{SSMStateStore-agvlAonC.cjs → SSMStateStore-BpZqNwDW.cjs} +2 -2
- package/dist/{SSMStateStore-agvlAonC.cjs.map → SSMStateStore-BpZqNwDW.cjs.map} +1 -1
- package/dist/{SSMStateStore-B40DvAuy.mjs → SSMStateStore-kpFFubgP.mjs} +2 -2
- package/dist/{SSMStateStore-B40DvAuy.mjs.map → SSMStateStore-kpFFubgP.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-uDZW1ddC.cjs → SubscriberGenerator-DDCqRTbq.cjs} +3 -3
- package/dist/{SubscriberGenerator-uDZW1ddC.cjs.map → SubscriberGenerator-DDCqRTbq.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-CI7roxx9.mjs → SubscriberGenerator-zUd87wvg.mjs} +3 -3
- package/dist/{SubscriberGenerator-CI7roxx9.mjs.map → SubscriberGenerator-zUd87wvg.mjs.map} +1 -1
- package/dist/{add-BpJ40b1f.cjs → add-BDCl-l_l.cjs} +9 -15
- package/dist/add-BDCl-l_l.cjs.map +1 -0
- package/dist/{add-Cj6yp560.mjs → add-D1cRGiH4.mjs} +9 -15
- package/dist/add-D1cRGiH4.mjs.map +1 -0
- package/dist/{bundler-BjIag8nr.mjs → bundler-BKE3xo6D.mjs} +5 -5
- package/dist/{bundler-BjIag8nr.mjs.map → bundler-BKE3xo6D.mjs.map} +1 -1
- package/dist/{bundler-D0YmORqs.cjs → bundler-p1JT47FO.cjs} +5 -5
- package/dist/{bundler-D0YmORqs.cjs.map → bundler-p1JT47FO.cjs.map} +1 -1
- package/dist/{cli-ffQmsXua.cjs → cli-BxWKJRgE.cjs} +3 -3
- package/dist/{cli-ffQmsXua.cjs.map → cli-BxWKJRgE.cjs.map} +1 -1
- package/dist/{cli-CJwPXzWW.mjs → cli-CaqHWpud.mjs} +3 -3
- package/dist/{cli-CJwPXzWW.mjs.map → cli-CaqHWpud.mjs.map} +1 -1
- package/dist/{compose-D6L79YLV.mjs → compose-BAT7wsdE.mjs} +13 -19
- package/dist/compose-BAT7wsdE.mjs.map +1 -0
- package/dist/{compose-Diz_QC7m.cjs → compose-DKddjrXC.cjs} +13 -19
- package/dist/compose-DKddjrXC.cjs.map +1 -0
- package/dist/{config-CnrwEcSa.d.mts → config-B7HaIfYM.d.mts} +3 -3
- package/dist/{config-CnrwEcSa.d.mts.map → config-B7HaIfYM.d.mts.map} +1 -1
- package/dist/{config-DlKOvs3Y.d.cts → config-DySjXKd2.d.cts} +3 -3
- package/dist/{config-DlKOvs3Y.d.cts.map → config-DySjXKd2.d.cts.map} +1 -1
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -2
- package/dist/{credentialSchemas-CM0rxWmS.cjs → credentialSchemas-BJMvQlks.cjs} +2 -2
- package/dist/{credentialSchemas-CM0rxWmS.cjs.map → credentialSchemas-BJMvQlks.cjs.map} +1 -1
- package/dist/{credentialSchemas-DPOGqOrU.mjs → credentialSchemas-DYzO2_yG.mjs} +2 -2
- package/dist/{credentialSchemas-DPOGqOrU.mjs.map → credentialSchemas-DYzO2_yG.mjs.map} +1 -1
- package/dist/deploy/public.cjs +8 -8
- package/dist/deploy/public.d.cts +3 -3
- package/dist/deploy/public.d.mts +3 -3
- package/dist/deploy/public.mjs +8 -8
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +2 -2
- package/dist/{deploy-D6wCG-OQ.mjs → deploy-C5UDDUU7.mjs} +26 -40
- package/dist/deploy-C5UDDUU7.mjs.map +1 -0
- package/dist/{deploy-CZHTReh1.cjs → deploy-CwlYj_tU.cjs} +26 -40
- package/dist/deploy-CwlYj_tU.cjs.map +1 -0
- package/dist/{derive-Bsnm81mg.mjs → derive-Cd7Hl3r2.mjs} +4 -4
- package/dist/derive-Cd7Hl3r2.mjs.map +1 -0
- package/dist/{derive-ClMgyPzp.cjs → derive-CgZfoBU2.cjs} +3 -3
- package/dist/derive-CgZfoBU2.cjs.map +1 -0
- package/dist/{discover-DEOspD9M.cjs → discover-B3G8eyWX.cjs} +181 -43
- package/dist/discover-B3G8eyWX.cjs.map +1 -0
- package/dist/{discover-DOhYSKY_.mjs → discover-DWtHjc1x.mjs} +177 -39
- package/dist/discover-DWtHjc1x.mjs.map +1 -0
- package/dist/{dokploy-Dad-f6mO.mjs → dokploy-BaGPz931.mjs} +2 -2
- package/dist/{dokploy-Dad-f6mO.mjs.map → dokploy-BaGPz931.mjs.map} +1 -1
- package/dist/{dokploy-BeqMm-aL.cjs → dokploy-D8JRpnNM.cjs} +2 -2
- package/dist/{dokploy-BeqMm-aL.cjs.map → dokploy-D8JRpnNM.cjs.map} +1 -1
- package/dist/{eas-CamaGWDL.mjs → eas-_k4YqH8L.mjs} +3 -3
- package/dist/{eas-CamaGWDL.mjs.map → eas-_k4YqH8L.mjs.map} +1 -1
- package/dist/{eas-DWYhlJCr.cjs → eas-m37zU75L.cjs} +3 -3
- package/dist/{eas-DWYhlJCr.cjs.map → eas-m37zU75L.cjs.map} +1 -1
- 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-DmDnVYe4.mjs → encryption-B1wVX-iK.mjs} +2 -2
- package/dist/{encryption-DmDnVYe4.mjs.map → encryption-B1wVX-iK.mjs.map} +1 -1
- package/dist/{encryption-UjD4kDRB.cjs → encryption-CKt33qlB.cjs} +2 -2
- package/dist/{encryption-UjD4kDRB.cjs.map → encryption-CKt33qlB.cjs.map} +1 -1
- package/dist/{engine-BxHQrByl.mjs → engine-B66avdZg.mjs} +9 -14
- package/dist/engine-B66avdZg.mjs.map +1 -0
- package/dist/{engine-BaRuSjJf.cjs → engine-CazVehBM.cjs} +9 -14
- package/dist/engine-CazVehBM.cjs.map +1 -0
- package/dist/{github-Fvg_6wTt.mjs → github-DJS6FXj4.mjs} +5 -5
- package/dist/{github-Fvg_6wTt.mjs.map → github-DJS6FXj4.mjs.map} +1 -1
- package/dist/{github-BO-bu8kf.cjs → github-DvoKzLo9.cjs} +5 -5
- package/dist/{github-BO-bu8kf.cjs.map → github-DvoKzLo9.cjs.map} +1 -1
- package/dist/{googlePlay-Dnlvz3rE.cjs → googlePlay-BRAykqXD.cjs} +3 -3
- package/dist/{googlePlay-Dnlvz3rE.cjs.map → googlePlay-BRAykqXD.cjs.map} +1 -1
- package/dist/{googlePlay-C5TgJQcS.mjs → googlePlay-B_5CB5YP.mjs} +3 -3
- package/dist/{googlePlay-C5TgJQcS.mjs.map → googlePlay-B_5CB5YP.mjs.map} +1 -1
- package/dist/{index-BYJMHnMt.d.cts → index-BymyHYdL.d.mts} +2 -2
- package/dist/{index-BYJMHnMt.d.cts.map → index-BymyHYdL.d.mts.map} +1 -1
- package/dist/{index-CBCGDhD6.d.mts → index-CTKfBwU3.d.cts} +2 -2
- package/dist/{index-CBCGDhD6.d.mts.map → index-CTKfBwU3.d.cts.map} +1 -1
- package/dist/index.cjs +68 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +68 -68
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-Qe7kNf7P.mjs → migrate-CUXjEMyM.mjs} +3 -3
- package/dist/{migrate-Qe7kNf7P.mjs.map → migrate-CUXjEMyM.mjs.map} +1 -1
- package/dist/{migrate-BYvhE1Ek.cjs → migrate-DgBQ5hMl.cjs} +3 -3
- package/dist/{migrate-BYvhE1Ek.cjs.map → migrate-DgBQ5hMl.cjs.map} +1 -1
- package/dist/{migrate-DYncKsiF.cjs → migrate-Vz5SqDC9.cjs} +2 -2
- package/dist/{migrate-DYncKsiF.cjs.map → migrate-Vz5SqDC9.cjs.map} +1 -1
- package/dist/{migrate-SLRDSOkN.mjs → migrate-wns_j863.mjs} +2 -2
- package/dist/{migrate-SLRDSOkN.mjs.map → migrate-wns_j863.mjs.map} +1 -1
- package/dist/openapi.cjs +3 -3
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +3 -3
- package/dist/{publish-CZ7650El.mjs → publish-BZ4WnlQF.mjs} +2 -2
- package/dist/{publish-CZ7650El.mjs.map → publish-BZ4WnlQF.mjs.map} +1 -1
- package/dist/{publish-CdgAuHGF.cjs → publish-C1WzNW-y.cjs} +2 -2
- package/dist/{publish-CdgAuHGF.cjs.map → publish-C1WzNW-y.cjs.map} +1 -1
- package/dist/{ready-DhkmqsOH.cjs → ready-D0u7jGFV.cjs} +5 -5
- package/dist/{ready-DhkmqsOH.cjs.map → ready-D0u7jGFV.cjs.map} +1 -1
- package/dist/{ready-AcAH2WL6.mjs → ready-DyvWvbiq.mjs} +5 -5
- package/dist/{ready-AcAH2WL6.mjs.map → ready-DyvWvbiq.mjs.map} +1 -1
- package/dist/reconcile/public.cjs +3 -3
- package/dist/reconcile/public.d.cts +24 -29
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +24 -29
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -3
- package/dist/{resolve-MoZFp8BC.mjs → resolve-D42nz9oe.mjs} +4 -4
- package/dist/{resolve-MoZFp8BC.mjs.map → resolve-D42nz9oe.mjs.map} +1 -1
- package/dist/{resolve-jB0LX21y.cjs → resolve-DBXRljeQ.cjs} +4 -4
- package/dist/{resolve-jB0LX21y.cjs.map → resolve-DBXRljeQ.cjs.map} +1 -1
- package/dist/{rollback-BpM_ekEG.mjs → rollback-DKWjVtwa.mjs} +4 -4
- package/dist/{rollback-BpM_ekEG.mjs.map → rollback-DKWjVtwa.mjs.map} +1 -1
- package/dist/{rollback-CTkBmEzm.cjs → rollback-s8OXlOCr.cjs} +4 -4
- package/dist/{rollback-CTkBmEzm.cjs.map → rollback-s8OXlOCr.cjs.map} +1 -1
- package/dist/{runtime-CBro-1N4.d.cts → runtime-Dl601UcU.d.cts} +2 -2
- package/dist/{runtime-CBro-1N4.d.cts.map → runtime-Dl601UcU.d.cts.map} +1 -1
- package/dist/{runtime-f9aiOHxq.d.mts → runtime-mR2O0z64.d.mts} +2 -2
- package/dist/{runtime-f9aiOHxq.d.mts.map → runtime-mR2O0z64.d.mts.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +2 -2
- package/dist/sandbox/credentials-worker.mjs +2 -2
- package/dist/sandbox/discover-worker.cjs +1 -4
- package/dist/sandbox/discover-worker.cjs.map +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -4
- package/dist/sandbox/discover-worker.mjs.map +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{seeds-6IhH9esB.cjs → seeds-D70hodXu.cjs} +25 -30
- package/dist/seeds-D70hodXu.cjs.map +1 -0
- package/dist/{seeds-D4qjzFDF.mjs → seeds-WyxyXjxu.mjs} +25 -30
- package/dist/seeds-WyxyXjxu.mjs.map +1 -0
- package/dist/{serverSetup-CRJvE-KF.cjs → serverSetup-3kQPTiSi.cjs} +5 -5
- package/dist/{serverSetup-CRJvE-KF.cjs.map → serverSetup-3kQPTiSi.cjs.map} +1 -1
- package/dist/{serverSetup-23Jmihhj.mjs → serverSetup-D2CKwf96.mjs} +5 -5
- package/dist/{serverSetup-23Jmihhj.mjs.map → serverSetup-D2CKwf96.mjs.map} +1 -1
- package/dist/{sniffer-Ve5oNbHX.cjs → sniffer-BXvUF1hF.cjs} +7 -7
- package/dist/{sniffer-Ve5oNbHX.cjs.map → sniffer-BXvUF1hF.cjs.map} +1 -1
- package/dist/{sniffer-DbGKPWFo.mjs → sniffer-C7Y1pnTH.mjs} +7 -7
- package/dist/{sniffer-DbGKPWFo.mjs.map → sniffer-C7Y1pnTH.mjs.map} +1 -1
- package/dist/{snsSubscriptions-Cr6pcIgx.cjs → snsSubscriptions-DNVQKnuw.cjs} +3 -3
- package/dist/{snsSubscriptions-Cr6pcIgx.cjs.map → snsSubscriptions-DNVQKnuw.cjs.map} +1 -1
- package/dist/{snsSubscriptions-CUi0Wtto.mjs → snsSubscriptions-DS6047gE.mjs} +3 -3
- package/dist/{snsSubscriptions-CUi0Wtto.mjs.map → snsSubscriptions-DS6047gE.mjs.map} +1 -1
- package/dist/{sst-WPkIfa64.mjs → sst-Bz2HJlqc.mjs} +2 -2
- package/dist/{sst-WPkIfa64.mjs.map → sst-Bz2HJlqc.mjs.map} +1 -1
- package/dist/{sst-CHOp2-qt.cjs → sst-lvCHdYsY.cjs} +2 -2
- package/dist/{sst-CHOp2-qt.cjs.map → sst-lvCHdYsY.cjs.map} +1 -1
- package/dist/{stage-BiLP7bXI.cjs → stage-BBre_tHU.cjs} +5 -8
- package/dist/stage-BBre_tHU.cjs.map +1 -0
- package/dist/{stage-DrHKRHLN.mjs → stage-_YcfLSj-.mjs} +5 -8
- package/dist/stage-_YcfLSj-.mjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-DBwedwSS.cjs → terminal-BIZRxV-e.cjs} +2 -2
- package/dist/{terminal-DBwedwSS.cjs.map → terminal-BIZRxV-e.cjs.map} +1 -1
- package/dist/{terminal-CebFDhWQ.mjs → terminal-PEvt24kO.mjs} +2 -2
- package/dist/{terminal-CebFDhWQ.mjs.map → terminal-PEvt24kO.mjs.map} +1 -1
- package/dist/{types-C5Zvkpc_.d.mts → types-C-uwKr3O.d.mts} +1 -18
- package/dist/types-C-uwKr3O.d.mts.map +1 -0
- package/dist/{types-CSOoemtk.d.cts → types-DOYYfQme.d.cts} +1 -18
- package/dist/types-DOYYfQme.d.cts.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/package.json +15 -15
- package/dist/add-BpJ40b1f.cjs.map +0 -1
- package/dist/add-Cj6yp560.mjs.map +0 -1
- package/dist/compose-D6L79YLV.mjs.map +0 -1
- package/dist/compose-Diz_QC7m.cjs.map +0 -1
- package/dist/deploy-CZHTReh1.cjs.map +0 -1
- package/dist/deploy-D6wCG-OQ.mjs.map +0 -1
- package/dist/derive-Bsnm81mg.mjs.map +0 -1
- package/dist/derive-ClMgyPzp.cjs.map +0 -1
- package/dist/discover-DEOspD9M.cjs.map +0 -1
- package/dist/discover-DOhYSKY_.mjs.map +0 -1
- package/dist/emit-CYloptRS.cjs +0 -243
- package/dist/emit-CYloptRS.cjs.map +0 -1
- package/dist/emit-CiJGdy_f.mjs +0 -226
- package/dist/emit-CiJGdy_f.mjs.map +0 -1
- package/dist/engine-BaRuSjJf.cjs.map +0 -1
- package/dist/engine-BxHQrByl.mjs.map +0 -1
- package/dist/seeds-6IhH9esB.cjs.map +0 -1
- package/dist/seeds-D4qjzFDF.mjs.map +0 -1
- package/dist/stage-BiLP7bXI.cjs.map +0 -1
- package/dist/stage-DrHKRHLN.mjs.map +0 -1
- package/dist/types-C5Zvkpc_.d.mts.map +0 -1
- package/dist/types-CSOoemtk.d.cts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emit-CYloptRS.cjs","names":["provideKey","canonicalId"],"sources":["../src/reconcile/emit.ts"],"sourcesContent":["/**\n * The manifest, written out as a module.\n *\n * Discovery imports the application's own code — that is how it finds\n * constructs — so anything calling it evaluates the whole runtime graph: React\n * email templates, database clients, modules that read env at import time. That\n * is fine inside `gkm dev`, which is already running the app. It is not fine\n * inside a deploy config, where it fails on the first thing the deploy toolchain\n * does not expect and would keep failing on the next.\n *\n * So discovery happens once, in the build, and everything downstream reads what\n * it wrote. The same split `RestApi` makes by naming a routes glob rather than\n * importing route modules.\n *\n * A module rather than JSON, because a manifest is not just data to this\n * codebase — `as const satisfies ConstructManifest` is what keeps every id,\n * kind and provided key a *literal*, so `IdsOf`, `ProvidedKeys` and the rest\n * can select out of it. `JSON.parse` returns `any` and gives all of that up.\n */\n\nimport type {\n\tConstructManifest,\n\tCronInfo,\n\tDeclaration,\n\tDependency,\n\tFunctionInfo,\n\tProcessorInfo,\n\tQueueInfo,\n\tRestApiEndpoint,\n\tRouteInfo,\n\tSubscriberInfo,\n} from '@geekmidas/manifest';\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\nimport type { CacheBackend, EmailBackend } from '../types.js';\n\n/**\n * Fold the build's generated routes into the surface that serves them.\n *\n * The routes already exist: `gkm build` generates one handler per endpoint and\n * records its path, method and environment. What was missing is that the\n * *construct* manifest never learned about them, so a `rest-api` node said\n * `endpoints: []` while five handlers sat in `.gkm/`. Two documents describing\n * the same routes, one of them wrong.\n *\n * Merging here rather than making the construct name a glob or import its\n * endpoints: the build is the thing that already walked the filesystem and\n * already knows where it wrote each handler. Asking the declaration to restate\n * any of that is how the two come to disagree.\n *\n * Attribution is to the surface the build served — the one whose `path` is\n * the app being built. Without one, routes go to the surface that declared none\n * of its own; a surface with static endpoints (an auth server's single\n * wildcard) keeps them.\n *\n * **Only from a provider that generates one handler per route.** The `server`\n * provider generates a single catch-all — `ALL *` pointing at the Hono app that\n * routes in-process — which is a true description of that build and a false\n * description of the application. Merging it wrote `endpoints: [{ method:\n * 'ALL', path: '*' }]` into a manifest for an app with five routes, and made the\n * document's contents depend on which `--provider` ran last. A manifest must not\n * do that.\n */\nexport function withRoutes(\n\tmanifest: ConstructManifest,\n\troutes: readonly RouteInfo[],\n\toptions: { perRoute: boolean; surface?: string },\n): ConstructManifest {\n\tif (routes.length === 0 || !options.perRoute) return manifest;\n\n\tconst target = Object.entries(manifest).find(([id, declaration]) =>\n\t\toptions.surface\n\t\t\t? id === options.surface\n\t\t\t: declaration.kind === 'rest-api' && declaration.endpoints.length === 0,\n\t);\n\n\tif (!target) return manifest;\n\n\tconst [id, declaration] = target;\n\tif (declaration.kind !== 'rest-api') return manifest;\n\n\treturn {\n\t\t...manifest,\n\t\t[id]: {\n\t\t\t...declaration,\n\t\t\tendpoints: routes.map((route) => asEndpoint(manifest, id, route)),\n\t\t},\n\t};\n}\n\n/**\n * Fold in the compute the build generated: functions, crons, queue workers and\n * topic subscribers.\n *\n * All four are named by their *export*, the same way an endpoint's handler is —\n * `CronGenerator` uses the export key as the name — so none of them can declare\n * themselves and all of them are the build's to add. That is why a `Function`\n * has no `declare()` and never will.\n *\n * A worker and a subscriber **nest** inside the queue or topic that triggers\n * them, because position carries the trigger. A function and a cron are\n * top-level, because nothing triggers them but a caller or a clock.\n */\nexport function withCompute(\n\tmanifest: ConstructManifest,\n\tcompute: {\n\t\tfunctions?: readonly FunctionInfo[];\n\t\tcrons?: readonly CronInfo[];\n\t\tqueues?: readonly QueueInfo[];\n\t\tsubscribers?: readonly SubscriberInfo[];\n\t\tprocessors?: readonly ProcessorInfo[];\n\t},\n): ConstructManifest {\n\tconst next: Record<string, Declaration> = { ...manifest };\n\n\tfor (const fn of compute.functions ?? []) {\n\t\tnext[fn.name] = {\n\t\t\tkind: 'function',\n\t\t\tid: fn.name,\n\t\t\thandler: fn.handler,\n\t\t\tdependencies: edgesTo(manifest, fn.dependencies),\n\t\t\tprovides: [provideKey(fn.name, 'url')],\n\t\t};\n\t}\n\n\tfor (const cron of compute.crons ?? []) {\n\t\tnext[cron.name] = {\n\t\t\tkind: 'cron',\n\t\t\tid: cron.name,\n\t\t\thandler: cron.handler,\n\t\t\tschedule: cron.schedule,\n\t\t\tdependencies: edgesTo(manifest, cron.dependencies),\n\t\t};\n\t}\n\n\t// A worker drains exactly one queue, so it is matched by the queue it names\n\t// rather than by anything about the handler.\n\tfor (const worker of compute.queues ?? []) {\n\t\tconst queue = next[canonicalId(worker.name)];\n\t\tif (queue?.kind !== 'queue') continue;\n\n\t\tnext[queue.id] = {\n\t\t\t...queue,\n\t\t\tworker: {\n\t\t\t\tid: `${queue.id}Worker`,\n\t\t\t\thandler: worker.handler,\n\t\t\t\tdependencies: edgesTo(manifest, worker.dependencies),\n\t\t\t},\n\t\t};\n\t}\n\n\tfor (const subscriber of compute.subscribers ?? []) {\n\t\t// A bucket's subscriber nests in the bucket, as a topic's does in the\n\t\t// topic: the storage is what triggers it.\n\t\tif (subscriber.bucket) {\n\t\t\tconst bucket = next[canonicalId(subscriber.bucket)];\n\t\t\tif (bucket?.kind !== 'objects') continue;\n\n\t\t\tnext[bucket.id] = {\n\t\t\t\t...bucket,\n\t\t\t\tsubscribers: [\n\t\t\t\t\t...(bucket.subscribers ?? []),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: subscriber.name,\n\t\t\t\t\t\thandler: subscriber.handler,\n\t\t\t\t\t\tevents: subscriber.subscribedEvents,\n\t\t\t\t\t\t...(subscriber.prefix ? { prefix: subscriber.prefix } : {}),\n\t\t\t\t\t\t...(subscriber.suffix ? { suffix: subscriber.suffix } : {}),\n\t\t\t\t\t\tdependencies: edgesTo(manifest, subscriber.dependencies),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst topicId = subscriber.topic && canonicalId(subscriber.topic);\n\t\tconst topic = topicId ? next[topicId] : undefined;\n\t\tif (topic?.kind !== 'topic') continue;\n\n\t\tnext[topic.id] = {\n\t\t\t...topic,\n\t\t\tsubscribers: [\n\t\t\t\t...topic.subscribers,\n\t\t\t\t{\n\t\t\t\t\tid: subscriber.name,\n\t\t\t\t\thandler: subscriber.handler,\n\t\t\t\t\tevents: subscriber.subscribedEvents,\n\t\t\t\t\tdependencies: edgesTo(manifest, subscriber.dependencies),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\t// Discovery nested each processor with its source as its handler; the\n\t// build's is the one a target runs.\n\tfor (const processor of compute.processors ?? []) {\n\t\tconst server = next[processor.fileServer];\n\t\tif (server?.kind !== 'file-server') continue;\n\n\t\tnext[server.id] = {\n\t\t\t...server,\n\t\t\tprocessors: [\n\t\t\t\t...(server.processors ?? []).filter((p) => p.id !== processor.name),\n\t\t\t\t{\n\t\t\t\t\tid: processor.name,\n\t\t\t\t\thandler: processor.handler,\n\t\t\t\t\tpath: processor.path,\n\t\t\t\t\tprefix: processor.prefix,\n\t\t\t\t\t...(processor.native?.length ? { native: processor.native } : {}),\n\t\t\t\t\t...(processor.timeout !== undefined\n\t\t\t\t\t\t? { timeout: processor.timeout }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(processor.memorySize !== undefined\n\t\t\t\t\t\t? { memorySize: processor.memorySize }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\tdependencies: edgesTo(manifest, processor.dependencies),\n\t\t\t\t},\n\t\t\t].sort((a, b) => a.id.localeCompare(b.id)),\n\t\t};\n\t}\n\n\treturn next;\n}\n\n/**\n * Construct ids as manifest edges.\n *\n * A `Dependency` carries the target's kind as well as its id, and the kind is\n * read off the manifest rather than recorded beside the edge — the same rule\n * `edgeTo` follows, for the same reason: a hand-written kind is one fact stated\n * twice, and the copy is what goes stale.\n *\n * An id that names nothing is dropped rather than thrown on. A handler can\n * depend on a construct that declares no node of its own — a lifted `Service`\n * is exactly that — and a build is the wrong place to refuse it; what a target\n * needs from this list is the subset it can actually grant.\n */\nfunction edgesTo(\n\tmanifest: ConstructManifest,\n\tids: readonly string[] = [],\n): Dependency[] {\n\treturn ids.flatMap((target) => {\n\t\tconst declaration = manifest[target];\n\n\t\treturn declaration ? [{ target, kind: declaration.kind }] : [];\n\t});\n}\n\n/** One generated route as the manifest's shape. */\nfunction asEndpoint(\n\tmanifest: ConstructManifest,\n\tsurface: string,\n\troute: RouteInfo,\n): RestApiEndpoint {\n\treturn {\n\t\t// The handler path is already unique per route and is what a target needs\n\t\t// to point a function at, so it is also the natural id.\n\t\tid: `${surface}${route.method}${route.path}`,\n\t\thandler: route.handler,\n\t\tmethod: route.method,\n\t\tpath: route.path,\n\t\t// The edges the handler declared, which is what a target reads to grant\n\t\t// this one function access to exactly those constructs. `environment` is\n\t\t// the same edges' shadow — the keys read — and cannot be turned back into\n\t\t// them, which is why the ids are carried rather than inferred.\n\t\tdependencies: edgesTo(manifest, route.dependencies),\n\t\t...(route.authorizer ? { authorizer: route.authorizer } : {}),\n\t};\n}\n\n/**\n * The manifest as TypeScript source.\n *\n * Pure, so what gets written can be asserted without touching a filesystem.\n */\nexport function manifestModule(\n\tmanifest: ConstructManifest,\n\tbackends: Backends = {},\n): string {\n\treturn `${HEADER}\nexport const constructs = ${serialise(manifest)} as const satisfies ConstructManifest;\n\n/**\n * Where the backends that are *config* rather than declaration resolved to.\n *\n * Recorded because they were being answered twice: once by the build, which\n * registers exactly one cache driver, and once by a deploy config, which told\n * the provisioner something else. The result was a deployed URL the running code\n * had no driver for — two documents disagreeing about one fact, which is what\n * this manifest exists to stop.\n */\nexport const backends = ${serialise(backends)} as const;\n\n// Derived types\nexport type Ids = IdsOf<typeof constructs>;\nexport type Construct<Id extends Ids> = DeclarationOf<typeof constructs, Id>;\nexport type Kind = Construct<Ids>['kind'];\n\n// Useful union types\nexport type ProvidedKeys = AllProvidedKeys<typeof constructs>;\nexport type Surfaces = IdsOfKind<typeof constructs, 'rest-api'>;\nexport type CacheBackend = (typeof backends)['cache'];\nexport type EmailBackend = (typeof backends)['email'];\n`;\n}\n\n/** The choices that are deployment config rather than declaration. */\nexport interface Backends {\n\tcache?: CacheBackend;\n\temail?: EmailBackend;\n\t/**\n\t * The labels no tenant of the wildcard site may take — every app's own\n\t * and the workspace's `protectedSubdomains`. Config the AWS target cannot\n\t * read for itself, so it travels with the manifest.\n\t */\n\tprotectedSubdomains?: readonly string[];\n}\n\nconst HEADER = `// Generated by \\`gkm build\\`. Do not edit.\n//\n// Discovery imports application code, so it runs once here rather than in every\n// consumer — a deploy config that discovered for itself would evaluate the whole\n// runtime graph inside its own toolchain. This is the result, as literals.\n\nimport type {\n\tAllProvidedKeys,\n\tConstructManifest,\n\tDeclarationOf,\n\tIdsOf,\n\tIdsOfKind,\n} from '@geekmidas/manifest';\n`;\n\n/**\n * JSON, re-indented with tabs and with keys left unquoted where they can be.\n *\n * Cosmetic, and worth it: this file is read by people trying to work out what\n * their app declares, and a wall of quoted keys reads as output rather than as\n * something anyone is expected to understand.\n */\nfunction serialise(value: object): string {\n\treturn JSON.stringify(value, null, '\\t')\n\t\t.replace(/^(\\t*)\"([A-Za-z_$][\\w$]*)\":/gm, '$1$2:')\n\t\t.replace(/\"/g, \"'\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,WACf,UACA,QACA,SACoB;CACpB,IAAI,OAAO,WAAW,KAAK,CAAC,QAAQ,UAAU,OAAO;CAErD,MAAM,SAAS,OAAO,QAAQ,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,iBAClD,QAAQ,UACL,OAAO,QAAQ,UACf,YAAY,SAAS,cAAc,YAAY,UAAU,WAAW,CACxE;CAEA,IAAI,CAAC,QAAQ,OAAO;CAEpB,MAAM,CAAC,IAAI,eAAe;CAC1B,IAAI,YAAY,SAAS,YAAY,OAAO;CAE5C,OAAO;EACN,GAAG;GACF,KAAK;GACL,GAAG;GACH,WAAW,OAAO,KAAK,UAAU,WA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AAQ,MAAM,YAAY;EAAK,CAAC,IAAI,CAAC;CAC9D,CAAC;AACF;;AAGA,SAAS,WACR,UACA,SACA,OACkB;CAClB,OAAO;EAGN,IAAI,GAAG,UAAU,MAAM,SAAS,MAAM;EACtC,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,MAAM,MAAM;EAKZ,cAAc,QAAQ,UAAU,MAAM,YAAY;EAClD,GAAI,MAAM,aAAa,EAAE,YAAY,MAAM,WAAW,IAAI,CAAC;CAC5D;AACD;;;;;;AAOA,SAAgB,eACf,UACA,WAAqB,CAAC,GACb;CACT,OAAO,GAAG,OAAO;4BACU,UAAU,QAAQ,EAAE;;;;;;;;;;;0BAWtB,UAAU,QAAQ,EAAE;;;;;;;;;;;;;AAa9C;AAcA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;AAsBf,SAAS,UAAU,OAAuB;CACzC,OAAO,KAAK,UAAU,OAAO,MAAM,GAAI,CAAC,CACtC,QAAQ,iCAAiC,OAAO,CAAC,CACjD,QAAQ,MAAM,GAAG;AACpB"}
|
package/dist/emit-CiJGdy_f.mjs
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { canonicalId, provideKey } from "@geekmidas/manifest";
|
|
2
|
-
//#region src/reconcile/emit.ts
|
|
3
|
-
/**
|
|
4
|
-
* Fold the build's generated routes into the surface that serves them.
|
|
5
|
-
*
|
|
6
|
-
* The routes already exist: `gkm build` generates one handler per endpoint and
|
|
7
|
-
* records its path, method and environment. What was missing is that the
|
|
8
|
-
* *construct* manifest never learned about them, so a `rest-api` node said
|
|
9
|
-
* `endpoints: []` while five handlers sat in `.gkm/`. Two documents describing
|
|
10
|
-
* the same routes, one of them wrong.
|
|
11
|
-
*
|
|
12
|
-
* Merging here rather than making the construct name a glob or import its
|
|
13
|
-
* endpoints: the build is the thing that already walked the filesystem and
|
|
14
|
-
* already knows where it wrote each handler. Asking the declaration to restate
|
|
15
|
-
* any of that is how the two come to disagree.
|
|
16
|
-
*
|
|
17
|
-
* Attribution is to the surface the build served — the one whose `path` is
|
|
18
|
-
* the app being built. Without one, routes go to the surface that declared none
|
|
19
|
-
* of its own; a surface with static endpoints (an auth server's single
|
|
20
|
-
* wildcard) keeps them.
|
|
21
|
-
*
|
|
22
|
-
* **Only from a provider that generates one handler per route.** The `server`
|
|
23
|
-
* provider generates a single catch-all — `ALL *` pointing at the Hono app that
|
|
24
|
-
* routes in-process — which is a true description of that build and a false
|
|
25
|
-
* description of the application. Merging it wrote `endpoints: [{ method:
|
|
26
|
-
* 'ALL', path: '*' }]` into a manifest for an app with five routes, and made the
|
|
27
|
-
* document's contents depend on which `--provider` ran last. A manifest must not
|
|
28
|
-
* do that.
|
|
29
|
-
*/
|
|
30
|
-
function withRoutes(manifest, routes, options) {
|
|
31
|
-
if (routes.length === 0 || !options.perRoute) return manifest;
|
|
32
|
-
const target = Object.entries(manifest).find(([id, declaration]) => options.surface ? id === options.surface : declaration.kind === "rest-api" && declaration.endpoints.length === 0);
|
|
33
|
-
if (!target) return manifest;
|
|
34
|
-
const [id, declaration] = target;
|
|
35
|
-
if (declaration.kind !== "rest-api") return manifest;
|
|
36
|
-
return {
|
|
37
|
-
...manifest,
|
|
38
|
-
[id]: {
|
|
39
|
-
...declaration,
|
|
40
|
-
endpoints: routes.map((route) => asEndpoint(manifest, id, route))
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Fold in the compute the build generated: functions, crons, queue workers and
|
|
46
|
-
* topic subscribers.
|
|
47
|
-
*
|
|
48
|
-
* All four are named by their *export*, the same way an endpoint's handler is —
|
|
49
|
-
* `CronGenerator` uses the export key as the name — so none of them can declare
|
|
50
|
-
* themselves and all of them are the build's to add. That is why a `Function`
|
|
51
|
-
* has no `declare()` and never will.
|
|
52
|
-
*
|
|
53
|
-
* A worker and a subscriber **nest** inside the queue or topic that triggers
|
|
54
|
-
* them, because position carries the trigger. A function and a cron are
|
|
55
|
-
* top-level, because nothing triggers them but a caller or a clock.
|
|
56
|
-
*/
|
|
57
|
-
function withCompute(manifest, compute) {
|
|
58
|
-
const next = { ...manifest };
|
|
59
|
-
for (const fn of compute.functions ?? []) next[fn.name] = {
|
|
60
|
-
kind: "function",
|
|
61
|
-
id: fn.name,
|
|
62
|
-
handler: fn.handler,
|
|
63
|
-
dependencies: edgesTo(manifest, fn.dependencies),
|
|
64
|
-
provides: [provideKey(fn.name, "url")]
|
|
65
|
-
};
|
|
66
|
-
for (const cron of compute.crons ?? []) next[cron.name] = {
|
|
67
|
-
kind: "cron",
|
|
68
|
-
id: cron.name,
|
|
69
|
-
handler: cron.handler,
|
|
70
|
-
schedule: cron.schedule,
|
|
71
|
-
dependencies: edgesTo(manifest, cron.dependencies)
|
|
72
|
-
};
|
|
73
|
-
for (const worker of compute.queues ?? []) {
|
|
74
|
-
const queue = next[canonicalId(worker.name)];
|
|
75
|
-
if (queue?.kind !== "queue") continue;
|
|
76
|
-
next[queue.id] = {
|
|
77
|
-
...queue,
|
|
78
|
-
worker: {
|
|
79
|
-
id: `${queue.id}Worker`,
|
|
80
|
-
handler: worker.handler,
|
|
81
|
-
dependencies: edgesTo(manifest, worker.dependencies)
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
for (const subscriber of compute.subscribers ?? []) {
|
|
86
|
-
if (subscriber.bucket) {
|
|
87
|
-
const bucket = next[canonicalId(subscriber.bucket)];
|
|
88
|
-
if (bucket?.kind !== "objects") continue;
|
|
89
|
-
next[bucket.id] = {
|
|
90
|
-
...bucket,
|
|
91
|
-
subscribers: [...bucket.subscribers ?? [], {
|
|
92
|
-
id: subscriber.name,
|
|
93
|
-
handler: subscriber.handler,
|
|
94
|
-
events: subscriber.subscribedEvents,
|
|
95
|
-
...subscriber.prefix ? { prefix: subscriber.prefix } : {},
|
|
96
|
-
...subscriber.suffix ? { suffix: subscriber.suffix } : {},
|
|
97
|
-
dependencies: edgesTo(manifest, subscriber.dependencies)
|
|
98
|
-
}]
|
|
99
|
-
};
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
const topicId = subscriber.topic && canonicalId(subscriber.topic);
|
|
103
|
-
const topic = topicId ? next[topicId] : void 0;
|
|
104
|
-
if (topic?.kind !== "topic") continue;
|
|
105
|
-
next[topic.id] = {
|
|
106
|
-
...topic,
|
|
107
|
-
subscribers: [...topic.subscribers, {
|
|
108
|
-
id: subscriber.name,
|
|
109
|
-
handler: subscriber.handler,
|
|
110
|
-
events: subscriber.subscribedEvents,
|
|
111
|
-
dependencies: edgesTo(manifest, subscriber.dependencies)
|
|
112
|
-
}]
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
for (const processor of compute.processors ?? []) {
|
|
116
|
-
const server = next[processor.fileServer];
|
|
117
|
-
if (server?.kind !== "file-server") continue;
|
|
118
|
-
next[server.id] = {
|
|
119
|
-
...server,
|
|
120
|
-
processors: [...(server.processors ?? []).filter((p) => p.id !== processor.name), {
|
|
121
|
-
id: processor.name,
|
|
122
|
-
handler: processor.handler,
|
|
123
|
-
path: processor.path,
|
|
124
|
-
prefix: processor.prefix,
|
|
125
|
-
...processor.native?.length ? { native: processor.native } : {},
|
|
126
|
-
...processor.timeout !== void 0 ? { timeout: processor.timeout } : {},
|
|
127
|
-
...processor.memorySize !== void 0 ? { memorySize: processor.memorySize } : {},
|
|
128
|
-
dependencies: edgesTo(manifest, processor.dependencies)
|
|
129
|
-
}].sort((a, b) => a.id.localeCompare(b.id))
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
return next;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Construct ids as manifest edges.
|
|
136
|
-
*
|
|
137
|
-
* A `Dependency` carries the target's kind as well as its id, and the kind is
|
|
138
|
-
* read off the manifest rather than recorded beside the edge — the same rule
|
|
139
|
-
* `edgeTo` follows, for the same reason: a hand-written kind is one fact stated
|
|
140
|
-
* twice, and the copy is what goes stale.
|
|
141
|
-
*
|
|
142
|
-
* An id that names nothing is dropped rather than thrown on. A handler can
|
|
143
|
-
* depend on a construct that declares no node of its own — a lifted `Service`
|
|
144
|
-
* is exactly that — and a build is the wrong place to refuse it; what a target
|
|
145
|
-
* needs from this list is the subset it can actually grant.
|
|
146
|
-
*/
|
|
147
|
-
function edgesTo(manifest, ids = []) {
|
|
148
|
-
return ids.flatMap((target) => {
|
|
149
|
-
const declaration = manifest[target];
|
|
150
|
-
return declaration ? [{
|
|
151
|
-
target,
|
|
152
|
-
kind: declaration.kind
|
|
153
|
-
}] : [];
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
/** One generated route as the manifest's shape. */
|
|
157
|
-
function asEndpoint(manifest, surface, route) {
|
|
158
|
-
return {
|
|
159
|
-
id: `${surface}${route.method}${route.path}`,
|
|
160
|
-
handler: route.handler,
|
|
161
|
-
method: route.method,
|
|
162
|
-
path: route.path,
|
|
163
|
-
dependencies: edgesTo(manifest, route.dependencies),
|
|
164
|
-
...route.authorizer ? { authorizer: route.authorizer } : {}
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* The manifest as TypeScript source.
|
|
169
|
-
*
|
|
170
|
-
* Pure, so what gets written can be asserted without touching a filesystem.
|
|
171
|
-
*/
|
|
172
|
-
function manifestModule(manifest, backends = {}) {
|
|
173
|
-
return `${HEADER}
|
|
174
|
-
export const constructs = ${serialise(manifest)} as const satisfies ConstructManifest;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Where the backends that are *config* rather than declaration resolved to.
|
|
178
|
-
*
|
|
179
|
-
* Recorded because they were being answered twice: once by the build, which
|
|
180
|
-
* registers exactly one cache driver, and once by a deploy config, which told
|
|
181
|
-
* the provisioner something else. The result was a deployed URL the running code
|
|
182
|
-
* had no driver for — two documents disagreeing about one fact, which is what
|
|
183
|
-
* this manifest exists to stop.
|
|
184
|
-
*/
|
|
185
|
-
export const backends = ${serialise(backends)} as const;
|
|
186
|
-
|
|
187
|
-
// Derived types
|
|
188
|
-
export type Ids = IdsOf<typeof constructs>;
|
|
189
|
-
export type Construct<Id extends Ids> = DeclarationOf<typeof constructs, Id>;
|
|
190
|
-
export type Kind = Construct<Ids>['kind'];
|
|
191
|
-
|
|
192
|
-
// Useful union types
|
|
193
|
-
export type ProvidedKeys = AllProvidedKeys<typeof constructs>;
|
|
194
|
-
export type Surfaces = IdsOfKind<typeof constructs, 'rest-api'>;
|
|
195
|
-
export type CacheBackend = (typeof backends)['cache'];
|
|
196
|
-
export type EmailBackend = (typeof backends)['email'];
|
|
197
|
-
`;
|
|
198
|
-
}
|
|
199
|
-
const HEADER = `// Generated by \`gkm build\`. Do not edit.
|
|
200
|
-
//
|
|
201
|
-
// Discovery imports application code, so it runs once here rather than in every
|
|
202
|
-
// consumer — a deploy config that discovered for itself would evaluate the whole
|
|
203
|
-
// runtime graph inside its own toolchain. This is the result, as literals.
|
|
204
|
-
|
|
205
|
-
import type {
|
|
206
|
-
AllProvidedKeys,
|
|
207
|
-
ConstructManifest,
|
|
208
|
-
DeclarationOf,
|
|
209
|
-
IdsOf,
|
|
210
|
-
IdsOfKind,
|
|
211
|
-
} from '@geekmidas/manifest';
|
|
212
|
-
`;
|
|
213
|
-
/**
|
|
214
|
-
* JSON, re-indented with tabs and with keys left unquoted where they can be.
|
|
215
|
-
*
|
|
216
|
-
* Cosmetic, and worth it: this file is read by people trying to work out what
|
|
217
|
-
* their app declares, and a wall of quoted keys reads as output rather than as
|
|
218
|
-
* something anyone is expected to understand.
|
|
219
|
-
*/
|
|
220
|
-
function serialise(value) {
|
|
221
|
-
return JSON.stringify(value, null, " ").replace(/^(\t*)"([A-Za-z_$][\w$]*)":/gm, "$1$2:").replace(/"/g, "'");
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
export { withCompute as n, withRoutes as r, manifestModule as t };
|
|
225
|
-
|
|
226
|
-
//# sourceMappingURL=emit-CiJGdy_f.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emit-CiJGdy_f.mjs","names":[],"sources":["../src/reconcile/emit.ts"],"sourcesContent":["/**\n * The manifest, written out as a module.\n *\n * Discovery imports the application's own code — that is how it finds\n * constructs — so anything calling it evaluates the whole runtime graph: React\n * email templates, database clients, modules that read env at import time. That\n * is fine inside `gkm dev`, which is already running the app. It is not fine\n * inside a deploy config, where it fails on the first thing the deploy toolchain\n * does not expect and would keep failing on the next.\n *\n * So discovery happens once, in the build, and everything downstream reads what\n * it wrote. The same split `RestApi` makes by naming a routes glob rather than\n * importing route modules.\n *\n * A module rather than JSON, because a manifest is not just data to this\n * codebase — `as const satisfies ConstructManifest` is what keeps every id,\n * kind and provided key a *literal*, so `IdsOf`, `ProvidedKeys` and the rest\n * can select out of it. `JSON.parse` returns `any` and gives all of that up.\n */\n\nimport type {\n\tConstructManifest,\n\tCronInfo,\n\tDeclaration,\n\tDependency,\n\tFunctionInfo,\n\tProcessorInfo,\n\tQueueInfo,\n\tRestApiEndpoint,\n\tRouteInfo,\n\tSubscriberInfo,\n} from '@geekmidas/manifest';\nimport { canonicalId, provideKey } from '@geekmidas/manifest';\nimport type { CacheBackend, EmailBackend } from '../types.js';\n\n/**\n * Fold the build's generated routes into the surface that serves them.\n *\n * The routes already exist: `gkm build` generates one handler per endpoint and\n * records its path, method and environment. What was missing is that the\n * *construct* manifest never learned about them, so a `rest-api` node said\n * `endpoints: []` while five handlers sat in `.gkm/`. Two documents describing\n * the same routes, one of them wrong.\n *\n * Merging here rather than making the construct name a glob or import its\n * endpoints: the build is the thing that already walked the filesystem and\n * already knows where it wrote each handler. Asking the declaration to restate\n * any of that is how the two come to disagree.\n *\n * Attribution is to the surface the build served — the one whose `path` is\n * the app being built. Without one, routes go to the surface that declared none\n * of its own; a surface with static endpoints (an auth server's single\n * wildcard) keeps them.\n *\n * **Only from a provider that generates one handler per route.** The `server`\n * provider generates a single catch-all — `ALL *` pointing at the Hono app that\n * routes in-process — which is a true description of that build and a false\n * description of the application. Merging it wrote `endpoints: [{ method:\n * 'ALL', path: '*' }]` into a manifest for an app with five routes, and made the\n * document's contents depend on which `--provider` ran last. A manifest must not\n * do that.\n */\nexport function withRoutes(\n\tmanifest: ConstructManifest,\n\troutes: readonly RouteInfo[],\n\toptions: { perRoute: boolean; surface?: string },\n): ConstructManifest {\n\tif (routes.length === 0 || !options.perRoute) return manifest;\n\n\tconst target = Object.entries(manifest).find(([id, declaration]) =>\n\t\toptions.surface\n\t\t\t? id === options.surface\n\t\t\t: declaration.kind === 'rest-api' && declaration.endpoints.length === 0,\n\t);\n\n\tif (!target) return manifest;\n\n\tconst [id, declaration] = target;\n\tif (declaration.kind !== 'rest-api') return manifest;\n\n\treturn {\n\t\t...manifest,\n\t\t[id]: {\n\t\t\t...declaration,\n\t\t\tendpoints: routes.map((route) => asEndpoint(manifest, id, route)),\n\t\t},\n\t};\n}\n\n/**\n * Fold in the compute the build generated: functions, crons, queue workers and\n * topic subscribers.\n *\n * All four are named by their *export*, the same way an endpoint's handler is —\n * `CronGenerator` uses the export key as the name — so none of them can declare\n * themselves and all of them are the build's to add. That is why a `Function`\n * has no `declare()` and never will.\n *\n * A worker and a subscriber **nest** inside the queue or topic that triggers\n * them, because position carries the trigger. A function and a cron are\n * top-level, because nothing triggers them but a caller or a clock.\n */\nexport function withCompute(\n\tmanifest: ConstructManifest,\n\tcompute: {\n\t\tfunctions?: readonly FunctionInfo[];\n\t\tcrons?: readonly CronInfo[];\n\t\tqueues?: readonly QueueInfo[];\n\t\tsubscribers?: readonly SubscriberInfo[];\n\t\tprocessors?: readonly ProcessorInfo[];\n\t},\n): ConstructManifest {\n\tconst next: Record<string, Declaration> = { ...manifest };\n\n\tfor (const fn of compute.functions ?? []) {\n\t\tnext[fn.name] = {\n\t\t\tkind: 'function',\n\t\t\tid: fn.name,\n\t\t\thandler: fn.handler,\n\t\t\tdependencies: edgesTo(manifest, fn.dependencies),\n\t\t\tprovides: [provideKey(fn.name, 'url')],\n\t\t};\n\t}\n\n\tfor (const cron of compute.crons ?? []) {\n\t\tnext[cron.name] = {\n\t\t\tkind: 'cron',\n\t\t\tid: cron.name,\n\t\t\thandler: cron.handler,\n\t\t\tschedule: cron.schedule,\n\t\t\tdependencies: edgesTo(manifest, cron.dependencies),\n\t\t};\n\t}\n\n\t// A worker drains exactly one queue, so it is matched by the queue it names\n\t// rather than by anything about the handler.\n\tfor (const worker of compute.queues ?? []) {\n\t\tconst queue = next[canonicalId(worker.name)];\n\t\tif (queue?.kind !== 'queue') continue;\n\n\t\tnext[queue.id] = {\n\t\t\t...queue,\n\t\t\tworker: {\n\t\t\t\tid: `${queue.id}Worker`,\n\t\t\t\thandler: worker.handler,\n\t\t\t\tdependencies: edgesTo(manifest, worker.dependencies),\n\t\t\t},\n\t\t};\n\t}\n\n\tfor (const subscriber of compute.subscribers ?? []) {\n\t\t// A bucket's subscriber nests in the bucket, as a topic's does in the\n\t\t// topic: the storage is what triggers it.\n\t\tif (subscriber.bucket) {\n\t\t\tconst bucket = next[canonicalId(subscriber.bucket)];\n\t\t\tif (bucket?.kind !== 'objects') continue;\n\n\t\t\tnext[bucket.id] = {\n\t\t\t\t...bucket,\n\t\t\t\tsubscribers: [\n\t\t\t\t\t...(bucket.subscribers ?? []),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: subscriber.name,\n\t\t\t\t\t\thandler: subscriber.handler,\n\t\t\t\t\t\tevents: subscriber.subscribedEvents,\n\t\t\t\t\t\t...(subscriber.prefix ? { prefix: subscriber.prefix } : {}),\n\t\t\t\t\t\t...(subscriber.suffix ? { suffix: subscriber.suffix } : {}),\n\t\t\t\t\t\tdependencies: edgesTo(manifest, subscriber.dependencies),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst topicId = subscriber.topic && canonicalId(subscriber.topic);\n\t\tconst topic = topicId ? next[topicId] : undefined;\n\t\tif (topic?.kind !== 'topic') continue;\n\n\t\tnext[topic.id] = {\n\t\t\t...topic,\n\t\t\tsubscribers: [\n\t\t\t\t...topic.subscribers,\n\t\t\t\t{\n\t\t\t\t\tid: subscriber.name,\n\t\t\t\t\thandler: subscriber.handler,\n\t\t\t\t\tevents: subscriber.subscribedEvents,\n\t\t\t\t\tdependencies: edgesTo(manifest, subscriber.dependencies),\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t}\n\n\t// Discovery nested each processor with its source as its handler; the\n\t// build's is the one a target runs.\n\tfor (const processor of compute.processors ?? []) {\n\t\tconst server = next[processor.fileServer];\n\t\tif (server?.kind !== 'file-server') continue;\n\n\t\tnext[server.id] = {\n\t\t\t...server,\n\t\t\tprocessors: [\n\t\t\t\t...(server.processors ?? []).filter((p) => p.id !== processor.name),\n\t\t\t\t{\n\t\t\t\t\tid: processor.name,\n\t\t\t\t\thandler: processor.handler,\n\t\t\t\t\tpath: processor.path,\n\t\t\t\t\tprefix: processor.prefix,\n\t\t\t\t\t...(processor.native?.length ? { native: processor.native } : {}),\n\t\t\t\t\t...(processor.timeout !== undefined\n\t\t\t\t\t\t? { timeout: processor.timeout }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\t...(processor.memorySize !== undefined\n\t\t\t\t\t\t? { memorySize: processor.memorySize }\n\t\t\t\t\t\t: {}),\n\t\t\t\t\tdependencies: edgesTo(manifest, processor.dependencies),\n\t\t\t\t},\n\t\t\t].sort((a, b) => a.id.localeCompare(b.id)),\n\t\t};\n\t}\n\n\treturn next;\n}\n\n/**\n * Construct ids as manifest edges.\n *\n * A `Dependency` carries the target's kind as well as its id, and the kind is\n * read off the manifest rather than recorded beside the edge — the same rule\n * `edgeTo` follows, for the same reason: a hand-written kind is one fact stated\n * twice, and the copy is what goes stale.\n *\n * An id that names nothing is dropped rather than thrown on. A handler can\n * depend on a construct that declares no node of its own — a lifted `Service`\n * is exactly that — and a build is the wrong place to refuse it; what a target\n * needs from this list is the subset it can actually grant.\n */\nfunction edgesTo(\n\tmanifest: ConstructManifest,\n\tids: readonly string[] = [],\n): Dependency[] {\n\treturn ids.flatMap((target) => {\n\t\tconst declaration = manifest[target];\n\n\t\treturn declaration ? [{ target, kind: declaration.kind }] : [];\n\t});\n}\n\n/** One generated route as the manifest's shape. */\nfunction asEndpoint(\n\tmanifest: ConstructManifest,\n\tsurface: string,\n\troute: RouteInfo,\n): RestApiEndpoint {\n\treturn {\n\t\t// The handler path is already unique per route and is what a target needs\n\t\t// to point a function at, so it is also the natural id.\n\t\tid: `${surface}${route.method}${route.path}`,\n\t\thandler: route.handler,\n\t\tmethod: route.method,\n\t\tpath: route.path,\n\t\t// The edges the handler declared, which is what a target reads to grant\n\t\t// this one function access to exactly those constructs. `environment` is\n\t\t// the same edges' shadow — the keys read — and cannot be turned back into\n\t\t// them, which is why the ids are carried rather than inferred.\n\t\tdependencies: edgesTo(manifest, route.dependencies),\n\t\t...(route.authorizer ? { authorizer: route.authorizer } : {}),\n\t};\n}\n\n/**\n * The manifest as TypeScript source.\n *\n * Pure, so what gets written can be asserted without touching a filesystem.\n */\nexport function manifestModule(\n\tmanifest: ConstructManifest,\n\tbackends: Backends = {},\n): string {\n\treturn `${HEADER}\nexport const constructs = ${serialise(manifest)} as const satisfies ConstructManifest;\n\n/**\n * Where the backends that are *config* rather than declaration resolved to.\n *\n * Recorded because they were being answered twice: once by the build, which\n * registers exactly one cache driver, and once by a deploy config, which told\n * the provisioner something else. The result was a deployed URL the running code\n * had no driver for — two documents disagreeing about one fact, which is what\n * this manifest exists to stop.\n */\nexport const backends = ${serialise(backends)} as const;\n\n// Derived types\nexport type Ids = IdsOf<typeof constructs>;\nexport type Construct<Id extends Ids> = DeclarationOf<typeof constructs, Id>;\nexport type Kind = Construct<Ids>['kind'];\n\n// Useful union types\nexport type ProvidedKeys = AllProvidedKeys<typeof constructs>;\nexport type Surfaces = IdsOfKind<typeof constructs, 'rest-api'>;\nexport type CacheBackend = (typeof backends)['cache'];\nexport type EmailBackend = (typeof backends)['email'];\n`;\n}\n\n/** The choices that are deployment config rather than declaration. */\nexport interface Backends {\n\tcache?: CacheBackend;\n\temail?: EmailBackend;\n\t/**\n\t * The labels no tenant of the wildcard site may take — every app's own\n\t * and the workspace's `protectedSubdomains`. Config the AWS target cannot\n\t * read for itself, so it travels with the manifest.\n\t */\n\tprotectedSubdomains?: readonly string[];\n}\n\nconst HEADER = `// Generated by \\`gkm build\\`. Do not edit.\n//\n// Discovery imports application code, so it runs once here rather than in every\n// consumer — a deploy config that discovered for itself would evaluate the whole\n// runtime graph inside its own toolchain. This is the result, as literals.\n\nimport type {\n\tAllProvidedKeys,\n\tConstructManifest,\n\tDeclarationOf,\n\tIdsOf,\n\tIdsOfKind,\n} from '@geekmidas/manifest';\n`;\n\n/**\n * JSON, re-indented with tabs and with keys left unquoted where they can be.\n *\n * Cosmetic, and worth it: this file is read by people trying to work out what\n * their app declares, and a wall of quoted keys reads as output rather than as\n * something anyone is expected to understand.\n */\nfunction serialise(value: object): string {\n\treturn JSON.stringify(value, null, '\\t')\n\t\t.replace(/^(\\t*)\"([A-Za-z_$][\\w$]*)\":/gm, '$1$2:')\n\t\t.replace(/\"/g, \"'\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,WACf,UACA,QACA,SACoB;CACpB,IAAI,OAAO,WAAW,KAAK,CAAC,QAAQ,UAAU,OAAO;CAErD,MAAM,SAAS,OAAO,QAAQ,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,iBAClD,QAAQ,UACL,OAAO,QAAQ,UACf,YAAY,SAAS,cAAc,YAAY,UAAU,WAAW,CACxE;CAEA,IAAI,CAAC,QAAQ,OAAO;CAEpB,MAAM,CAAC,IAAI,eAAe;CAC1B,IAAI,YAAY,SAAS,YAAY,OAAO;CAE5C,OAAO;EACN,GAAG;GACF,KAAK;GACL,GAAG;GACH,WAAW,OAAO,KAAK,UAAU,WAAW,UAAU,IAAI,KAAK,CAAC;EACjE;CACD;AACD;;;;;;;;;;;;;;AAeA,SAAgB,YACf,UACA,SAOoB;CACpB,M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