@geekmidas/cli 10.0.0-alpha.4 → 10.0.0-alpha.40
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 +52 -74
- package/bin/adjacent-tsconfig.mjs +97 -0
- package/bin/gkm.mjs +7 -1
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-Bh6K7QYz.mjs} +20 -21
- package/dist/HostingerProvider-Bh6K7QYz.mjs.map +1 -0
- package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
- package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
- package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-B4Kj_qNU.cjs} +142 -303
- package/dist/OpenApiTsGenerator-B4Kj_qNU.cjs.map +1 -0
- package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-CEh3EKN3.mjs} +113 -255
- package/dist/OpenApiTsGenerator-CEh3EKN3.mjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/aws-DkHdTV-p.cjs +61 -0
- package/dist/aws-DkHdTV-p.cjs.map +1 -0
- package/dist/aws-DojzQnLd.mjs +61 -0
- package/dist/aws-DojzQnLd.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
- package/dist/bundler--fyybf1N.mjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
- package/dist/bundler-By6_sXiL.cjs.map +1 -0
- package/dist/{config-WRdsQYZK.mjs → config-5watB1D0.mjs} +142 -154
- package/dist/config-5watB1D0.mjs.map +1 -0
- package/dist/{config-C21ocYNd.cjs → config-CJ-PAb7M.cjs} +209 -210
- package/dist/config-CJ-PAb7M.cjs.map +1 -0
- package/dist/config.cjs +9 -6
- package/dist/config.d.cts +62 -33
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +62 -33
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +3 -3
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-DTmFeloL.cjs → discover-B0f_kuNN.cjs} +118 -66
- package/dist/discover-B0f_kuNN.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-BLhf7V_J.mjs} +67 -22
- package/dist/discover-BLhf7V_J.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
- package/dist/emit-BdoPFjZf.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
- package/dist/emit-Bzq7JsMP.mjs.map +1 -0
- package/dist/github-BAr8WGkR.cjs +213 -0
- package/dist/github-BAr8WGkR.cjs.map +1 -0
- package/dist/github-D5MthUlR.mjs +213 -0
- package/dist/github-D5MthUlR.mjs.map +1 -0
- package/dist/{index-DCtipn2h.d.cts → index-B3PeGOQp.d.cts} +4 -23
- package/dist/index-B3PeGOQp.d.cts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-BOyaGcCm.d.mts} +4 -23
- package/dist/index-BOyaGcCm.d.mts.map +1 -0
- package/dist/index.cjs +7071 -4519
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +7117 -4586
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-BVI3yqcE.mjs +736 -0
- package/dist/migrate-BVI3yqcE.mjs.map +1 -0
- package/dist/migrate-CFOUApUt.cjs +743 -0
- package/dist/migrate-CFOUApUt.cjs.map +1 -0
- package/dist/openapi.cjs +197 -8
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +47 -14
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +47 -14
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +191 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/ready-D8UXsP6q.mjs +516 -0
- package/dist/ready-D8UXsP6q.mjs.map +1 -0
- package/dist/ready-mcxamf73.cjs +563 -0
- package/dist/ready-mcxamf73.cjs.map +1 -0
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +27 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +27 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/storage-BzaUxmqe.mjs +124 -0
- package/dist/storage-BzaUxmqe.mjs.map +1 -0
- package/dist/storage-CSGoC3bK.cjs +152 -0
- package/dist/storage-CSGoC3bK.cjs.map +1 -0
- package/dist/store-DQgxT_WR.cjs +211 -0
- package/dist/store-DQgxT_WR.cjs.map +1 -0
- package/dist/store-DeGATCS-.mjs +182 -0
- package/dist/store-DeGATCS-.mjs.map +1 -0
- package/dist/types-0R124hrY.d.mts +6324 -0
- package/dist/types-0R124hrY.d.mts.map +1 -0
- package/dist/types-DfdYe31u.d.cts +6325 -0
- package/dist/types-DfdYe31u.d.cts.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/workspace/index.cjs +3 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{credentials-G1JwBoXH.cjs → workspace-BIqeeqcR.cjs} +2248 -1809
- package/dist/workspace-BIqeeqcR.cjs.map +1 -0
- package/dist/{workspace-BFMrAKqI.mjs → workspace-DOmIhiau.mjs} +863 -952
- package/dist/workspace-DOmIhiau.mjs.map +1 -0
- package/dist/{credentials-BBIRJVp4.mjs → workspace-DwS1JK5u.mjs} +2114 -1706
- package/dist/workspace-DwS1JK5u.mjs.map +1 -0
- package/dist/{workspace-BcucjwvA.cjs → workspace-RYSYtHP7.cjs} +1032 -1098
- package/dist/workspace-RYSYtHP7.cjs.map +1 -0
- package/package.json +29 -20
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-C21ocYNd.cjs.map +0 -1
- package/dist/config-WRdsQYZK.mjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BBIRJVp4.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-G1JwBoXH.cjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-DCtipn2h.d.cts.map +0 -1
- package/dist/openapi-CA0yJUTN.cjs.map +0 -1
- package/dist/openapi-kkQbsRVj.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-B5_oHHUj.cjs +0 -11
- package/dist/setup-Cm2UnAdh.cjs +0 -473
- package/dist/setup-Cm2UnAdh.cjs.map +0 -1
- package/dist/setup-DXvRLTZN.mjs +0 -443
- package/dist/setup-DXvRLTZN.mjs.map +0 -1
- package/dist/setup-ZijS4qeC.mjs +0 -11
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-BhIl-COG.d.cts +0 -2184
- package/dist/types-BhIl-COG.d.cts.map +0 -1
- package/dist/types-C-arnQ1r.d.mts +0 -2184
- package/dist/types-C-arnQ1r.d.mts.map +0 -1
- package/dist/workspace-BFMrAKqI.mjs.map +0 -1
- package/dist/workspace-BcucjwvA.cjs.map +0 -1
- package/dist/workspace-DdJss8I6.cjs +0 -9
- package/dist/workspace-k4l3rsFh.mjs +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-loader.cjs","names":["__filename","__dirname"],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sniffer-loader.cjs","names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync","register","pathToFileURL"],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAMA,gBAAAA,GAAaC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAChD,MAAMC,eAAAA,GAAYC,UAAAA,QAAAA,CAAQH,YAAU;AAGpC,MAAM,WAAA,GAAUI,UAAAA,KAAAA,CAAKF,aAAW,mBAAmB;AACnD,MAAM,UAAA,GAASE,UAAAA,KAAAA,CAAKF,aAAW,kBAAkB;AACjD,MAAM,aAAA,GAAYG,QAAAA,WAAAA,CAAW,OAAO,IAAI,UAAU;CAGlDC,GAAAA,YAAAA,SAAAA,EAAAA,GAASC,SAAAA,cAAAA,CAAc,SAAS,CAAC,CAAC,MAAA,QAAA,KAAA,CAAA,CAAA,cAAA,UAAA,CAAA,CAAA,IAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -2,14 +2,25 @@ import { register } from "node:module";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
-
|
|
6
5
|
//#region src/deploy/sniffer-loader.ts
|
|
6
|
+
/**
|
|
7
|
+
* Node.js module loader registration for entry app sniffing.
|
|
8
|
+
*
|
|
9
|
+
* This module registers a custom loader hook that intercepts imports of
|
|
10
|
+
* '@geekmidas/envkit' and replaces the EnvironmentParser with
|
|
11
|
+
* SnifferEnvironmentParser, allowing us to capture which environment
|
|
12
|
+
* variables an entry app accesses.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts
|
|
16
|
+
*/
|
|
7
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
18
|
const __dirname = dirname(__filename);
|
|
9
19
|
const mjsPath = join(__dirname, "sniffer-hooks.mjs");
|
|
10
20
|
const tsPath = join(__dirname, "sniffer-hooks.ts");
|
|
11
21
|
const hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;
|
|
12
22
|
register(pathToFileURL(hooksPath).href, import.meta.url);
|
|
13
|
-
|
|
14
23
|
//#endregion
|
|
24
|
+
export {};
|
|
25
|
+
|
|
15
26
|
//# sourceMappingURL=sniffer-loader.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-loader.mjs","names":[],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sniffer-loader.mjs","names":[],"sources":["../../src/deploy/sniffer-loader.ts"],"sourcesContent":["/**\n * Node.js module loader registration for entry app sniffing.\n *\n * This module registers a custom loader hook that intercepts imports of\n * '@geekmidas/envkit' and replaces the EnvironmentParser with\n * SnifferEnvironmentParser, allowing us to capture which environment\n * variables an entry app accesses.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts\n */\n\nimport { existsSync } from 'node:fs';\nimport { register } from 'node:module';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\n// Resolve path to the loader hooks module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-hooks.mjs');\nconst tsPath = join(__dirname, 'sniffer-hooks.ts');\nconst hooksPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\n// Register the loader hooks\nregister(pathToFileURL(hooksPath).href, import.meta.url);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAGpC,MAAM,UAAU,KAAK,WAAW,mBAAmB;AACnD,MAAM,SAAS,KAAK,WAAW,kBAAkB;AACjD,MAAM,YAAY,WAAW,OAAO,IAAI,UAAU;AAGlD,SAAS,cAAc,SAAS,CAAC,CAAC,MAAM,YAAY,GAAG"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const require_rolldown_runtime = require("../rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
+
let fast_glob = require("fast-glob");
|
|
3
|
+
fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
|
|
4
|
+
let _geekmidas_constructs_endpoints = require("@geekmidas/constructs/endpoints");
|
|
5
|
+
let _geekmidas_constructs_crons = require("@geekmidas/constructs/crons");
|
|
6
|
+
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
7
|
+
let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribers");
|
|
8
8
|
//#region src/deploy/sniffer-routes-worker.ts
|
|
9
9
|
const appPathArg = process.argv[2];
|
|
10
10
|
const routesPatternArg = process.argv[3];
|
|
@@ -21,7 +21,7 @@ const routesPattern = routesPatternArg;
|
|
|
21
21
|
* Check if a value is a gkm construct.
|
|
22
22
|
*/
|
|
23
23
|
function isConstruct(value) {
|
|
24
|
-
return
|
|
24
|
+
return _geekmidas_constructs_endpoints.Endpoint.isEndpoint(value) || _geekmidas_constructs_functions.Function.isFunction(value) || _geekmidas_constructs_crons.Cron.isCron(value) || _geekmidas_constructs_subscribers.Subscriber.isSubscriber(value);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Main sniffing function
|
|
@@ -36,8 +36,8 @@ async function sniff() {
|
|
|
36
36
|
absolute: true
|
|
37
37
|
});
|
|
38
38
|
for (const file of files) try {
|
|
39
|
-
const module
|
|
40
|
-
for (const [, exportValue] of Object.entries(module
|
|
39
|
+
const module = await import(file);
|
|
40
|
+
for (const [, exportValue] of Object.entries(module)) if (isConstruct(exportValue)) try {
|
|
41
41
|
const constructEnvVars = await exportValue.getEnvironment({ markOptional: true });
|
|
42
42
|
for (const name of constructEnvVars) if (name.endsWith("?")) optionalEnvVars.add(name.slice(0, -1));
|
|
43
43
|
else envVars.add(name);
|
|
@@ -64,6 +64,6 @@ sniff().catch((e) => {
|
|
|
64
64
|
}));
|
|
65
65
|
process.exit(1);
|
|
66
66
|
});
|
|
67
|
-
|
|
68
67
|
//#endregion
|
|
68
|
+
|
|
69
69
|
//# sourceMappingURL=sniffer-routes-worker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-routes-worker.cjs","names":["
|
|
1
|
+
{"version":3,"file":"sniffer-routes-worker.cjs","names":["Endpoint","GkmFunction","Cron","Subscriber","fg"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,IAAI,CAAC,cAAc,CAAC,kBAAkB;CACrC,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAC;EACV,OAAO;CACR,CAAC,CACF;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,UAAkB;AACxB,MAAM,gBAAwB;;;;AAK9B,SAAS,YAAY,OAAoC;CACxD,OACCA,gCAAAA,SAAS,WAAW,KAAK,KACzBC,gCAAAA,SAAY,WAAW,KAAK,KAC5BC,4BAAAA,KAAK,OAAO,KAAK,KACjBC,kCAAAA,WAAW,aAAa,KAAK;AAE/B;;;;AAKA,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,kCAAkB,IAAI,IAAY;CACxC,IAAI,QAAuB;CAE3B,IAAI;EAEH,MAAM,QAAQ,OAAA,GAAMC,UAAAA,QAAAA,CAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACX,CAAC;EAGD,KAAK,MAAM,QAAQ,OAClB,IAAI;GACH,MAAM,SAAS,MAAM,OAAO;GAG5B,KAAK,MAAM,GAAG,gBAAgB,OAAO,QAAQ,MAAM,GAClD,IAAI,YAAY,WAAW,GAC1B,IAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACf,CAAC;IACD,KAAK,MAAM,QAAQ,kBAClB,IAAI,KAAK,SAAS,GAAG,GAAG,gBAAgB,IAAI,KAAK,MAAM,GAAG,EAAE,CAAC;SACxD,QAAQ,IAAI,IAAI;GAEvB,QAAQ,CAER;EAGH,SAAS,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;GACrD,QAAQ,MAAM,8BAA8B,KAAK,IAAI,KAAK;EAC3D;CAEF,SAAS,GAAG;EACX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAKA,KAAK,MAAM,QAAQ,SAAS,gBAAgB,OAAO,IAAI;CAEvD,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK;EAClC,iBAAiB,MAAM,KAAK,eAAe,CAAC,CAAC,KAAK;EAClD;CACD,CAAC,CACF;AACD;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import fg from "fast-glob";
|
|
2
|
-
import { Cron } from "@geekmidas/constructs/crons";
|
|
3
2
|
import { Endpoint } from "@geekmidas/constructs/endpoints";
|
|
3
|
+
import { Cron } from "@geekmidas/constructs/crons";
|
|
4
4
|
import { Function } from "@geekmidas/constructs/functions";
|
|
5
5
|
import { Subscriber } from "@geekmidas/constructs/subscribers";
|
|
6
|
-
|
|
7
6
|
//#region src/deploy/sniffer-routes-worker.ts
|
|
8
7
|
const appPathArg = process.argv[2];
|
|
9
8
|
const routesPatternArg = process.argv[3];
|
|
@@ -63,6 +62,7 @@ sniff().catch((e) => {
|
|
|
63
62
|
}));
|
|
64
63
|
process.exit(1);
|
|
65
64
|
});
|
|
66
|
-
|
|
67
65
|
//#endregion
|
|
66
|
+
export {};
|
|
67
|
+
|
|
68
68
|
//# sourceMappingURL=sniffer-routes-worker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-routes-worker.mjs","names":["
|
|
1
|
+
{"version":3,"file":"sniffer-routes-worker.mjs","names":["GkmFunction"],"sources":["../../src/deploy/sniffer-routes-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for route-based app sniffing.\n *\n * This script is executed in a subprocess with tsx loader,\n * which handles TypeScript compilation and path alias resolution.\n *\n * Usage:\n * node --import tsx ./sniffer-routes-worker.ts \"/path/to/app\" \"./src/endpoints/**\\/*.ts\"\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport type { Construct } from '@geekmidas/constructs';\nimport { Cron } from '@geekmidas/constructs/crons';\nimport { Endpoint } from '@geekmidas/constructs/endpoints';\nimport { Function as GkmFunction } from '@geekmidas/constructs/functions';\nimport { Subscriber } from '@geekmidas/constructs/subscribers';\nimport fg from 'fast-glob';\n\n// Get args from command line\nconst appPathArg = process.argv[2];\nconst routesPatternArg = process.argv[3];\n\nif (!appPathArg || !routesPatternArg) {\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: [],\n\t\t\terror: 'App path and routes pattern are required',\n\t\t}),\n\t);\n\tprocess.exit(1);\n}\n\n// After validation, these are guaranteed to be strings\nconst appPath: string = appPathArg;\nconst routesPattern: string = routesPatternArg;\n\n/**\n * Check if a value is a gkm construct.\n */\nfunction isConstruct(value: unknown): value is Construct {\n\treturn (\n\t\tEndpoint.isEndpoint(value) ||\n\t\tGkmFunction.isFunction(value) ||\n\t\tCron.isCron(value) ||\n\t\tSubscriber.isSubscriber(value)\n\t);\n}\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tconst envVars = new Set<string>();\n\tconst optionalEnvVars = new Set<string>();\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Find all route files matching the pattern\n\t\tconst files = await fg(routesPattern, {\n\t\t\tcwd: appPath,\n\t\t\tabsolute: true,\n\t\t});\n\n\t\t// Import each route file and find constructs\n\t\tfor (const file of files) {\n\t\t\ttry {\n\t\t\t\tconst module = await import(file);\n\n\t\t\t\t// Check all exports for constructs\n\t\t\t\tfor (const [, exportValue] of Object.entries(module)) {\n\t\t\t\t\tif (isConstruct(exportValue)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// `markOptional`, so a key read through `.optional()` or\n\t\t\t\t\t\t\t// `.default()` comes back suffixed `?` and is reported\n\t\t\t\t\t\t\t// apart from the rest. Without it every sniffed read\n\t\t\t\t\t\t\t// looked required, and a key that is *absent by design*\n\t\t\t\t\t\t\t// — `AUTH_COOKIE_DOMAIN`, published only when a surface\n\t\t\t\t\t\t\t// has a domain to widen a cookie to — failed the deploy\n\t\t\t\t\t\t\t// as though it were a missing secret.\n\t\t\t\t\t\t\tconst constructEnvVars = await exportValue.getEnvironment({\n\t\t\t\t\t\t\t\tmarkOptional: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const name of constructEnvVars) {\n\t\t\t\t\t\t\t\tif (name.endsWith('?')) optionalEnvVars.add(name.slice(0, -1));\n\t\t\t\t\t\t\t\telse envVars.add(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Individual construct may fail, continue with others\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t// Log import errors but continue with other files\n\t\t\t\tconst msg = e instanceof Error ? e.message : String(e);\n\t\t\t\tconsole.error(`[sniffer] Failed to import ${file}: ${msg}`);\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Output result as JSON (last line of stdout)\n\t// A key required by one construct and optional in another is required: the\n\t// strictest read is the one that fails at runtime.\n\tfor (const name of envVars) optionalEnvVars.delete(name);\n\n\tconsole.log(\n\t\tJSON.stringify({\n\t\t\tenvVars: Array.from(envVars).sort(),\n\t\t\toptionalEnvVars: Array.from(optionalEnvVars).sort(),\n\t\t\terror,\n\t\t}),\n\t);\n}\n\n// Handle unhandled rejections\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;AAqBA,MAAM,aAAa,QAAQ,KAAK;AAChC,MAAM,mBAAmB,QAAQ,KAAK;AAEtC,IAAI,CAAC,cAAc,CAAC,kBAAkB;CACrC,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,CAAC;EACV,OAAO;CACR,CAAC,CACF;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,UAAkB;AACxB,MAAM,gBAAwB;;;;AAK9B,SAAS,YAAY,OAAoC;CACxD,OACC,SAAS,WAAW,KAAK,KACzBA,SAAY,WAAW,KAAK,KAC5B,KAAK,OAAO,KAAK,KACjB,WAAW,aAAa,KAAK;AAE/B;;;;AAKA,eAAe,QAAuB;CACrC,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,kCAAkB,IAAI,IAAY;CACxC,IAAI,QAAuB;CAE3B,IAAI;EAEH,MAAM,QAAQ,MAAM,GAAG,eAAe;GACrC,KAAK;GACL,UAAU;EACX,CAAC;EAGD,KAAK,MAAM,QAAQ,OAClB,IAAI;GACH,MAAM,SAAS,MAAM,OAAO;GAG5B,KAAK,MAAM,GAAG,gBAAgB,OAAO,QAAQ,MAAM,GAClD,IAAI,YAAY,WAAW,GAC1B,IAAI;IAQH,MAAM,mBAAmB,MAAM,YAAY,eAAe,EACzD,cAAc,KACf,CAAC;IACD,KAAK,MAAM,QAAQ,kBAClB,IAAI,KAAK,SAAS,GAAG,GAAG,gBAAgB,IAAI,KAAK,MAAM,GAAG,EAAE,CAAC;SACxD,QAAQ,IAAI,IAAI;GAEvB,QAAQ,CAER;EAGH,SAAS,GAAG;GAEX,MAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;GACrD,QAAQ,MAAM,8BAA8B,KAAK,IAAI,KAAK;EAC3D;CAEF,SAAS,GAAG;EACX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAKA,KAAK,MAAM,QAAQ,SAAS,gBAAgB,OAAO,IAAI;CAEvD,QAAQ,IACP,KAAK,UAAU;EACd,SAAS,MAAM,KAAK,OAAO,CAAC,CAAC,KAAK;EAClC,iBAAiB,MAAM,KAAK,eAAe,CAAC,CAAC,KAAK;EAClD;CACD,CAAC,CACF;AACD;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
const node_url = require_chunk.__toESM(require("node:url"));
|
|
3
|
-
|
|
1
|
+
let node_url = require("node:url");
|
|
4
2
|
//#region src/deploy/sniffer-worker.ts
|
|
3
|
+
/**
|
|
4
|
+
* Subprocess worker for entry app sniffing.
|
|
5
|
+
*
|
|
6
|
+
* This script is executed in a subprocess with the sniffer-loader.ts
|
|
7
|
+
* registered, which intercepts @geekmidas/envkit imports.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts
|
|
11
|
+
*
|
|
12
|
+
* Output (JSON to stdout):
|
|
13
|
+
* { "envVars": ["PORT", "DATABASE_URL", ...], "error": null }
|
|
14
|
+
*/
|
|
5
15
|
const entryPath = process.argv[2];
|
|
6
16
|
if (!entryPath) {
|
|
7
17
|
console.log(JSON.stringify({
|
|
@@ -17,8 +27,7 @@ const validEntryPath = entryPath;
|
|
|
17
27
|
async function sniff() {
|
|
18
28
|
let error = null;
|
|
19
29
|
try {
|
|
20
|
-
|
|
21
|
-
await import(entryUrl);
|
|
30
|
+
await import((0, node_url.pathToFileURL)(validEntryPath).href);
|
|
22
31
|
} catch (e) {
|
|
23
32
|
error = e instanceof Error ? e.message : String(e);
|
|
24
33
|
}
|
|
@@ -39,6 +48,6 @@ sniff().catch((e) => {
|
|
|
39
48
|
}));
|
|
40
49
|
process.exit(1);
|
|
41
50
|
});
|
|
42
|
-
|
|
43
51
|
//#endregion
|
|
52
|
+
|
|
44
53
|
//# sourceMappingURL=sniffer-worker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-worker.cjs","names":["
|
|
1
|
+
{"version":3,"file":"sniffer-worker.cjs","names":["pathToFileURL"],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,IAAI,CAAC,WAAW;CACf,QAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO;CAA8B,CAAC,CACrE;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAI,QAAuB;CAE3B,IAAI;EAQH,MAAM,QAAA,GADWA,SAAAA,cAAAA,CAAc,cAAc,CAAC,CAAC;CAEhD,SAAS,GAAG;EAGX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAGA,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,wBAAwB,IAAI,CAAC;CAC/D,MAAM,kBAAkB,UAAU,QAAQ,qBAAqB,IAAI,CAAC;CAGpE,QAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAM,CAAC,CAAC;AAChE;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { SnifferEnvironmentParser } from "@geekmidas/envkit/sniffer";
|
|
2
|
-
|
|
3
2
|
//#region src/deploy/sniffer-worker.d.ts
|
|
4
|
-
|
|
5
3
|
declare global {
|
|
6
4
|
var __envSniffer: SnifferEnvironmentParser | undefined;
|
|
7
5
|
}
|
|
8
|
-
//#
|
|
6
|
+
//#endregion
|
|
9
7
|
//# sourceMappingURL=sniffer-worker.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-worker.d.cts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-worker.d.cts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"mappings":";;QAiBQ;MAEH,cAAc"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { SnifferEnvironmentParser } from "@geekmidas/envkit/sniffer";
|
|
2
|
-
|
|
3
2
|
//#region src/deploy/sniffer-worker.d.ts
|
|
4
|
-
|
|
5
3
|
declare global {
|
|
6
4
|
var __envSniffer: SnifferEnvironmentParser | undefined;
|
|
7
5
|
}
|
|
8
|
-
//#
|
|
6
|
+
//#endregion
|
|
9
7
|
//# sourceMappingURL=sniffer-worker.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-worker.d.mts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-worker.d.mts","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"mappings":";;QAiBQ;MAEH,cAAc"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url";
|
|
2
|
-
|
|
3
2
|
//#region src/deploy/sniffer-worker.ts
|
|
3
|
+
/**
|
|
4
|
+
* Subprocess worker for entry app sniffing.
|
|
5
|
+
*
|
|
6
|
+
* This script is executed in a subprocess with the sniffer-loader.ts
|
|
7
|
+
* registered, which intercepts @geekmidas/envkit imports.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts
|
|
11
|
+
*
|
|
12
|
+
* Output (JSON to stdout):
|
|
13
|
+
* { "envVars": ["PORT", "DATABASE_URL", ...], "error": null }
|
|
14
|
+
*/
|
|
4
15
|
const entryPath = process.argv[2];
|
|
5
16
|
if (!entryPath) {
|
|
6
17
|
console.log(JSON.stringify({
|
|
@@ -16,8 +27,7 @@ const validEntryPath = entryPath;
|
|
|
16
27
|
async function sniff() {
|
|
17
28
|
let error = null;
|
|
18
29
|
try {
|
|
19
|
-
|
|
20
|
-
await import(entryUrl);
|
|
30
|
+
await import(pathToFileURL(validEntryPath).href);
|
|
21
31
|
} catch (e) {
|
|
22
32
|
error = e instanceof Error ? e.message : String(e);
|
|
23
33
|
}
|
|
@@ -38,6 +48,7 @@ sniff().catch((e) => {
|
|
|
38
48
|
}));
|
|
39
49
|
process.exit(1);
|
|
40
50
|
});
|
|
41
|
-
|
|
42
51
|
//#endregion
|
|
52
|
+
export {};
|
|
53
|
+
|
|
43
54
|
//# sourceMappingURL=sniffer-worker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-worker.mjs","names":[
|
|
1
|
+
{"version":3,"file":"sniffer-worker.mjs","names":[],"sources":["../../src/deploy/sniffer-worker.ts"],"sourcesContent":["/**\n * Subprocess worker for entry app sniffing.\n *\n * This script is executed in a subprocess with the sniffer-loader.ts\n * registered, which intercepts @geekmidas/envkit imports.\n *\n * Usage:\n * node --import tsx --import ./sniffer-loader.ts ./sniffer-worker.ts /path/to/entry.ts\n *\n * Output (JSON to stdout):\n * { \"envVars\": [\"PORT\", \"DATABASE_URL\", ...], \"error\": null }\n */\n\nimport { pathToFileURL } from 'node:url';\nimport type { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Get the entry file path from command line args\nconst entryPath = process.argv[2] as string | undefined;\n\nif (!entryPath) {\n\tconsole.log(\n\t\tJSON.stringify({ envVars: [], error: 'No entry file path provided' }),\n\t);\n\tprocess.exit(1);\n}\n\n// entryPath is guaranteed to be defined after the check above\nconst validEntryPath: string = entryPath;\n\n/**\n * Main sniffing function\n */\nasync function sniff(): Promise<void> {\n\tlet error: string | null = null;\n\n\ttry {\n\t\t// Import the entry file - this triggers:\n\t\t// 1. Entry imports config module\n\t\t// 2. Config module imports @geekmidas/envkit (intercepted by loader)\n\t\t// 3. Config creates EnvironmentParser (actually SnifferEnvironmentParser)\n\t\t// 4. Config calls .create() and .parse()\n\t\t// 5. Sniffer captures all accessed env var names\n\t\tconst entryUrl = pathToFileURL(validEntryPath).href;\n\t\tawait import(entryUrl);\n\t} catch (e) {\n\t\t// Entry may fail due to missing env vars or other runtime issues.\n\t\t// This is expected - we still capture the env vars that were accessed.\n\t\terror = e instanceof Error ? e.message : String(e);\n\t}\n\n\t// Retrieve captured env vars from the global sniffer\n\tconst sniffer = globalThis.__envSniffer;\n\tconst envVars = sniffer ? sniffer.getEnvironmentVariables() : [];\n\tconst optionalEnvVars = sniffer ? sniffer.getOptionalVariables() : [];\n\n\t// Output result as JSON\n\tconsole.log(JSON.stringify({ envVars, optionalEnvVars, error }));\n}\n\n// Handle unhandled rejections (fire-and-forget promises)\nprocess.on('unhandledRejection', () => {\n\t// Silently ignore - we only care about env var capture\n});\n\n// Run the sniffer\nsniff().catch((e) => {\n\tconsole.log(JSON.stringify({ envVars: [], error: e.message || String(e) }));\n\tprocess.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,YAAY,QAAQ,KAAK;AAE/B,IAAI,CAAC,WAAW;CACf,QAAQ,IACP,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO;CAA8B,CAAC,CACrE;CACA,QAAQ,KAAK,CAAC;AACf;AAGA,MAAM,iBAAyB;;;;AAK/B,eAAe,QAAuB;CACrC,IAAI,QAAuB;CAE3B,IAAI;EAQH,MAAM,OADW,cAAc,cAAc,CAAC,CAAC;CAEhD,SAAS,GAAG;EAGX,QAAQ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClD;CAGA,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,UAAU,QAAQ,wBAAwB,IAAI,CAAC;CAC/D,MAAM,kBAAkB,UAAU,QAAQ,qBAAqB,IAAI,CAAC;CAGpE,QAAQ,IAAI,KAAK,UAAU;EAAE;EAAS;EAAiB;CAAM,CAAC,CAAC;AAChE;AAGA,QAAQ,GAAG,4BAA4B,CAEvC,CAAC;AAGD,MAAM,CAAC,CAAC,OAAO,MAAM;CACpB,QAAQ,IAAI,KAAK,UAAU;EAAE,SAAS,CAAC;EAAG,OAAO,EAAE,WAAW,OAAO,CAAC;CAAE,CAAC,CAAC;CAC1E,QAAQ,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let _geekmidas_manifest = require("@geekmidas/manifest");
|
|
4
|
+
let fast_glob = require("fast-glob");
|
|
5
|
+
fast_glob = require_rolldown_runtime.__toESM(fast_glob, 1);
|
|
6
|
+
let lodash_kebabcase = require("lodash.kebabcase");
|
|
7
|
+
lodash_kebabcase = require_rolldown_runtime.__toESM(lodash_kebabcase, 1);
|
|
7
8
|
//#region src/types.ts
|
|
8
9
|
function isPartitionedRoutes(routes) {
|
|
9
10
|
return typeof routes === "object" && routes !== null && !Array.isArray(routes) && "paths" in routes;
|
|
@@ -30,21 +31,24 @@ const DEFAULT_CACHE = {
|
|
|
30
31
|
aws: "upstash",
|
|
31
32
|
server: "db"
|
|
32
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Which broker carries a declared queue or topic, by target.
|
|
36
|
+
*
|
|
37
|
+
* Whether there are events at all is the manifest's answer — a declared
|
|
38
|
+
* `Topic` or `Queue` — so this only ever answers the second question. AWS
|
|
39
|
+
* deploys them to SNS and SQS, and locally the AWS emulator stands in, so the
|
|
40
|
+
* broker a developer runs is the one production has. A server has a Postgres
|
|
41
|
+
* already, and pg-boss keeps its queues there.
|
|
42
|
+
*/
|
|
43
|
+
const DEFAULT_EVENTS = {
|
|
44
|
+
aws: "sns",
|
|
45
|
+
server: "pgboss"
|
|
46
|
+
};
|
|
33
47
|
/** Where a bucket lives when nobody said — see {@link DEFAULT_CACHE}. */
|
|
34
48
|
const DEFAULT_STORAGE = {
|
|
35
49
|
aws: "s3",
|
|
36
50
|
server: "minio"
|
|
37
51
|
};
|
|
38
|
-
/**
|
|
39
|
-
* Who delivers mail when nobody said.
|
|
40
|
-
*
|
|
41
|
-
* Flat, unlike the others, and deliberately: mail is a SaaS on every target.
|
|
42
|
-
* There is no self-hosted preset to default a container deploy to — Mailpit is
|
|
43
|
-
* a development inbox, not a sender — so `server` has no answer of its own to
|
|
44
|
-
* give and would only be `ses` written twice.
|
|
45
|
-
*/
|
|
46
|
-
const DEFAULT_EMAIL = "ses";
|
|
47
|
-
|
|
48
52
|
//#endregion
|
|
49
53
|
//#region src/generators/Generator.ts
|
|
50
54
|
/**
|
|
@@ -68,7 +72,7 @@ var ConstructGenerator = class {
|
|
|
68
72
|
return generator.build(context, constructs, outputDir, options);
|
|
69
73
|
}
|
|
70
74
|
async load(patterns, cwd = process.cwd(), bustCache = false) {
|
|
71
|
-
const logger
|
|
75
|
+
const logger = console;
|
|
72
76
|
let globPatterns;
|
|
73
77
|
let partitionFn;
|
|
74
78
|
if (isPartitionedRoutes(patterns)) {
|
|
@@ -83,10 +87,9 @@ var ConstructGenerator = class {
|
|
|
83
87
|
const constructs = [];
|
|
84
88
|
for await (const f of files) try {
|
|
85
89
|
const file = f.toString();
|
|
86
|
-
const
|
|
87
|
-
const module$1 = await import(importPath);
|
|
90
|
+
const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
|
|
88
91
|
const partition = partitionFn ? partitionFn(file) : void 0;
|
|
89
|
-
for (const [key, construct] of Object.entries(module
|
|
92
|
+
for (const [key, construct] of Object.entries(module)) if (this.isConstruct(construct)) constructs.push({
|
|
90
93
|
key,
|
|
91
94
|
name: (0, lodash_kebabcase.default)(key),
|
|
92
95
|
construct,
|
|
@@ -98,16 +101,35 @@ var ConstructGenerator = class {
|
|
|
98
101
|
});
|
|
99
102
|
} catch (error) {
|
|
100
103
|
const err = error;
|
|
101
|
-
logger
|
|
102
|
-
if (err.stack) logger
|
|
104
|
+
logger.error(`Failed to load ${f}: ${err.message}`);
|
|
105
|
+
if (err.stack) logger.error(err.stack);
|
|
103
106
|
throw error;
|
|
104
107
|
}
|
|
105
108
|
return constructs;
|
|
106
109
|
}
|
|
107
110
|
};
|
|
108
|
-
|
|
109
111
|
//#endregion
|
|
110
112
|
//#region src/reconcile/discover.ts
|
|
113
|
+
/**
|
|
114
|
+
* Discovery — one glob, one structural test.
|
|
115
|
+
*
|
|
116
|
+
* A glob per kind is the same specialness the construct model removes, and
|
|
117
|
+
* resources have no kind to be listed under: a declared `ObjectStorage` would
|
|
118
|
+
* never be found by `routes:` or `crons:`. So there is one `constructs` glob,
|
|
119
|
+
* every export of every matching module is inspected, and the per-kind
|
|
120
|
+
* `isConstruct` checks collapse into a single question — does it have an id and
|
|
121
|
+
* can it declare?
|
|
122
|
+
*
|
|
123
|
+
* Structural rather than `instanceof` on purpose. A construct from a different
|
|
124
|
+
* copy of `@geekmidas/constructs` — a linked workspace, two versions in a
|
|
125
|
+
* lockfile — is still a construct, and `instanceof` is exactly the check that
|
|
126
|
+
* says otherwise.
|
|
127
|
+
*/
|
|
128
|
+
var discover_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
129
|
+
DuplicateConstruct: () => DuplicateConstruct,
|
|
130
|
+
discover: () => discover,
|
|
131
|
+
isDeclarable: () => isDeclarable
|
|
132
|
+
});
|
|
111
133
|
/** Matches the rest of the CLI, which logs through `console` directly. */
|
|
112
134
|
const logger = console;
|
|
113
135
|
/**
|
|
@@ -160,13 +182,17 @@ async function discover(options) {
|
|
|
160
182
|
for await (const found of files) {
|
|
161
183
|
matched++;
|
|
162
184
|
const file = found.toString();
|
|
163
|
-
const module
|
|
164
|
-
for (const [exportName, exported] of Object.entries(module
|
|
165
|
-
if (!isDeclarable(exported))
|
|
185
|
+
const module = await (bustCache ? import(`${file}?t=${Date.now()}`) : import(file));
|
|
186
|
+
for (const [exportName, exported] of Object.entries(module)) {
|
|
187
|
+
if (!isDeclarable(exported)) {
|
|
188
|
+
if (options.runnables) recordRunnable(options.runnables, exported);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
166
191
|
if (seen.has(exported)) continue;
|
|
167
192
|
seen.add(exported);
|
|
193
|
+
if (options.runnables && typeof exported.owner === "string") recordRunnable(options.runnables, exported);
|
|
168
194
|
for (const declaration of exported.declare()) {
|
|
169
|
-
const id = (0,
|
|
195
|
+
const id = (0, _geekmidas_manifest.canonicalId)(declaration.id);
|
|
170
196
|
const source = (0, node_path.relative)(cwd, file);
|
|
171
197
|
const claimed = sources[id];
|
|
172
198
|
if (claimed !== void 0 && claimed !== source) throw new DuplicateConstruct(id, [claimed, source]);
|
|
@@ -177,16 +203,36 @@ async function discover(options) {
|
|
|
177
203
|
sources[id] = source;
|
|
178
204
|
if (out) out[id] = {
|
|
179
205
|
file,
|
|
180
|
-
exportName
|
|
206
|
+
exportName,
|
|
207
|
+
construct: exported
|
|
181
208
|
};
|
|
182
209
|
}
|
|
183
210
|
}
|
|
184
211
|
}
|
|
185
|
-
(0,
|
|
212
|
+
(0, _geekmidas_manifest.assertDerivations)(manifest);
|
|
186
213
|
warnIfNothingFound(globs, matched, Object.keys(manifest).length);
|
|
187
214
|
return manifest;
|
|
188
215
|
}
|
|
189
216
|
/**
|
|
217
|
+
* Record a runnable's edges under the construct that owns it — the surface an
|
|
218
|
+
* endpoint was built from, or the worker a cron or subscriber was. Anything
|
|
219
|
+
* with no owner, or that is not a runnable at all, is left alone.
|
|
220
|
+
*/
|
|
221
|
+
function recordRunnable(runnables, exported) {
|
|
222
|
+
if (typeof exported !== "object" || exported === null) return;
|
|
223
|
+
const runnable = exported;
|
|
224
|
+
const owner = typeof runnable.surface?.id === "string" ? runnable.surface.id : typeof runnable.owner === "string" ? runnable.owner : void 0;
|
|
225
|
+
if (!owner || !Array.isArray(runnable.constructs)) return;
|
|
226
|
+
const key = (0, _geekmidas_manifest.canonicalId)(owner);
|
|
227
|
+
const edges = runnables[key] ?? [];
|
|
228
|
+
runnables[key] = edges;
|
|
229
|
+
for (const id of runnable.constructs) {
|
|
230
|
+
if (typeof id !== "string") continue;
|
|
231
|
+
const target = (0, _geekmidas_manifest.canonicalId)(id);
|
|
232
|
+
if (!edges.includes(target)) edges.push(target);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
190
236
|
* Say so when a glob was configured and found nothing.
|
|
191
237
|
*
|
|
192
238
|
* The glob is not a filter over declarations already known — it is *how they
|
|
@@ -224,48 +270,54 @@ var DuplicateConstruct = class extends Error {
|
|
|
224
270
|
this.sources = sources;
|
|
225
271
|
}
|
|
226
272
|
};
|
|
227
|
-
|
|
228
273
|
//#endregion
|
|
229
|
-
Object.defineProperty(exports,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
274
|
+
Object.defineProperty(exports, "ConstructGenerator", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
get: function() {
|
|
277
|
+
return ConstructGenerator;
|
|
278
|
+
}
|
|
234
279
|
});
|
|
235
|
-
Object.defineProperty(exports,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
280
|
+
Object.defineProperty(exports, "DEFAULT_CACHE", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: function() {
|
|
283
|
+
return DEFAULT_CACHE;
|
|
284
|
+
}
|
|
240
285
|
});
|
|
241
|
-
Object.defineProperty(exports,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
286
|
+
Object.defineProperty(exports, "DEFAULT_EVENTS", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
get: function() {
|
|
289
|
+
return DEFAULT_EVENTS;
|
|
290
|
+
}
|
|
246
291
|
});
|
|
247
|
-
Object.defineProperty(exports,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
292
|
+
Object.defineProperty(exports, "DEFAULT_STORAGE", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: function() {
|
|
295
|
+
return DEFAULT_STORAGE;
|
|
296
|
+
}
|
|
252
297
|
});
|
|
253
|
-
Object.defineProperty(exports,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
298
|
+
Object.defineProperty(exports, "discover", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get: function() {
|
|
301
|
+
return discover;
|
|
302
|
+
}
|
|
258
303
|
});
|
|
259
|
-
Object.defineProperty(exports,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
304
|
+
Object.defineProperty(exports, "discover_exports", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function() {
|
|
307
|
+
return discover_exports;
|
|
308
|
+
}
|
|
264
309
|
});
|
|
265
|
-
Object.defineProperty(exports,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
310
|
+
Object.defineProperty(exports, "isDeclarable", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function() {
|
|
313
|
+
return isDeclarable;
|
|
314
|
+
}
|
|
270
315
|
});
|
|
271
|
-
|
|
316
|
+
Object.defineProperty(exports, "isPartitionedRoutes", {
|
|
317
|
+
enumerable: true,
|
|
318
|
+
get: function() {
|
|
319
|
+
return isPartitionedRoutes;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
//# sourceMappingURL=discover-B0f_kuNN.cjs.map
|