@geekmidas/cli 10.0.0-alpha.2 → 10.0.0-alpha.21
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 +25 -48
- package/bin/adjacent-tsconfig.mjs +59 -0
- package/bin/gkm.mjs +7 -1
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-BY26bWwB.mjs} +20 -21
- package/dist/HostingerProvider-BY26bWwB.mjs.map +1 -0
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.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/{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/{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-BY1OmV1e.cjs → bundler-mjqGAvu1.cjs} +10 -28
- package/dist/bundler-mjqGAvu1.cjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler-mwH7WOb1.mjs} +9 -26
- package/dist/bundler-mwH7WOb1.mjs.map +1 -0
- package/dist/{config-BholeD-0.cjs → config-DSXI480r.cjs} +80 -148
- package/dist/config-DSXI480r.cjs.map +1 -0
- package/dist/{config-CzWnfcXM.mjs → config-DdKkoUE1.mjs} +33 -88
- package/dist/config-DdKkoUE1.mjs.map +1 -0
- package/dist/config.cjs +4 -5
- package/dist/config.d.cts +14 -17
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +14 -17
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/{credentials-DQmbRnr1.cjs → credentials-BfmmB4WD.cjs} +1508 -1243
- package/dist/credentials-BfmmB4WD.cjs.map +1 -0
- package/dist/{credentials-BZcp3CGx.mjs → credentials-CD8ftUS6.mjs} +1374 -1114
- package/dist/credentials-CD8ftUS6.mjs.map +1 -0
- 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 +2 -2
- 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-BERGFg8v.cjs} +81 -64
- package/dist/discover-BERGFg8v.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-CK-n3w6b.mjs} +35 -20
- package/dist/discover-CK-n3w6b.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/{generator-VE2JrFlY.mjs → generator-LfZU7NlU.mjs} +8 -14
- package/dist/generator-LfZU7NlU.mjs.map +1 -0
- package/dist/{generator-CNzBw7g5.cjs → generator-Wdfp0jCS.cjs} +38 -45
- package/dist/generator-Wdfp0jCS.cjs.map +1 -0
- package/dist/github-Bho-C6Zg.cjs +216 -0
- package/dist/github-Bho-C6Zg.cjs.map +1 -0
- package/dist/github-De-yMwVt.mjs +216 -0
- package/dist/github-De-yMwVt.mjs.map +1 -0
- package/dist/{index-CHB4tSzX.d.cts → index-B4H4XF7A.d.mts} +4 -13
- package/dist/index-B4H4XF7A.d.mts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-RCUizGxL.d.cts} +4 -13
- package/dist/index-RCUizGxL.d.cts.map +1 -0
- package/dist/index.cjs +5108 -3381
- 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 +5025 -3315
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-c9bpieI5.cjs → openapi-B8bu_OXN.cjs} +228 -188
- package/dist/openapi-B8bu_OXN.cjs.map +1 -0
- package/dist/{openapi-CY9xFkTH.mjs → openapi-DfjbhrsM.mjs} +172 -143
- package/dist/openapi-DfjbhrsM.mjs.map +1 -0
- package/dist/openapi.cjs +5 -6
- 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 +2 -6
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +8 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +8 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{fullstack-secrets-D1o9-G5l.mjs → reconcile-gb1lz1Dk.mjs} +43 -17
- package/dist/reconcile-gb1lz1Dk.mjs.map +1 -0
- package/dist/{fullstack-secrets-C-GGohke.cjs → reconcile-hx_vBvux.cjs} +63 -38
- package/dist/reconcile-hx_vBvux.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/ssm-BKN1Cg4z.mjs +60 -0
- package/dist/ssm-BKN1Cg4z.mjs.map +1 -0
- package/dist/ssm-FxeSAt35.cjs +60 -0
- package/dist/ssm-FxeSAt35.cjs.map +1 -0
- package/dist/{storage-BJmzYxt8.cjs → storage-DgypfSD6.cjs} +65 -77
- package/dist/storage-DgypfSD6.cjs.map +1 -0
- package/dist/{storage-Bi24WfoW.mjs → storage-TP0x118M.mjs} +22 -15
- package/dist/storage-TP0x118M.mjs.map +1 -0
- package/dist/transfer-CXoyQZbB.cjs +151 -0
- package/dist/transfer-CXoyQZbB.cjs.map +1 -0
- package/dist/transfer-Gsxfy6m-.mjs +122 -0
- package/dist/transfer-Gsxfy6m-.mjs.map +1 -0
- package/dist/types-7R81hu0i.d.mts +6302 -0
- package/dist/types-7R81hu0i.d.mts.map +1 -0
- package/dist/types-N7c2O2m7.d.cts +6303 -0
- package/dist/types-N7c2O2m7.d.cts.map +1 -0
- package/dist/workspace/index.cjs +3 -3
- 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/workspace-Bu3xNCej.mjs +6563 -0
- package/dist/workspace-Bu3xNCej.mjs.map +1 -0
- package/dist/workspace-CRD9YinV.cjs +6741 -0
- package/dist/workspace-CRD9YinV.cjs.map +1 -0
- package/package.json +33 -43
- 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-BholeD-0.cjs.map +0 -1
- package/dist/config-CzWnfcXM.mjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BZcp3CGx.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-DQmbRnr1.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.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-CHB4tSzX.d.cts.map +0 -1
- package/dist/openapi-CY9xFkTH.mjs.map +0 -1
- package/dist/openapi-c9bpieI5.cjs.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 +0 -37
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs +0 -37
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-Bc73t0ve.mjs +0 -443
- package/dist/setup-Bc73t0ve.mjs.map +0 -1
- package/dist/setup-C48C9hto.cjs +0 -473
- package/dist/setup-C48C9hto.cjs.map +0 -1
- package/dist/setup-DCuudnCl.mjs +0 -11
- package/dist/setup-fG_ivuxO.cjs +0 -11
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- 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-C-arnQ1r.d.mts +0 -2184
- package/dist/types-C-arnQ1r.d.mts.map +0 -1
- package/dist/types-abJQuk7m.d.cts +0 -2184
- package/dist/types-abJQuk7m.d.cts.map +0 -1
- package/dist/workspace-7FqprxuJ.mjs +0 -4323
- package/dist/workspace-7FqprxuJ.mjs.map +0 -1
- package/dist/workspace-BO_KWohI.cjs +0 -9
- package/dist/workspace-DK4WWJIn.mjs +0 -8
- package/dist/workspace-XvqO9jIv.cjs +0 -4472
- package/dist/workspace-XvqO9jIv.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.d.mts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.d.mts","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"mappings":";;QAaQ;MAEH,cAAcA;;UAUT,aAAa;EACtB,SAAS;EACT;IAAe;IAAe,MAAM;;IAAQ;IAAgB,OAAO;;;KAI/D,cAAc;EAClB;IAAY;IAAiB;;EAC7B;IAAY;IAAiB;;EAC7B;IAAa;IAAkB;;EAC/B,YAAY;EACZ,QAAQ,iBAAiB;;;;;;;;;cAUpB;EACL,OAAO,gBAAgB,yBACtB,UAAU,KAAK,eAAe,UAC5B,aAAa"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { SnifferEnvironmentParser, SnifferEnvironmentParser as SnifferEnvironmentParser$1 } from "@geekmidas/envkit/sniffer";
|
|
2
|
-
|
|
3
2
|
//#region src/deploy/sniffer-envkit-patch.ts
|
|
3
|
+
/**
|
|
4
|
+
* Patched @geekmidas/envkit module for entry app sniffing.
|
|
5
|
+
*
|
|
6
|
+
* This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
|
|
7
|
+
* allowing entry apps to be imported while capturing their env var usage.
|
|
8
|
+
*
|
|
9
|
+
* The actual sniffer instance is stored in globalThis.__envSniffer
|
|
10
|
+
* so the worker script can retrieve the captured variables.
|
|
11
|
+
*/
|
|
4
12
|
if (!globalThis.__envSniffer) globalThis.__envSniffer = new SnifferEnvironmentParser$1();
|
|
5
13
|
/**
|
|
6
14
|
* Patched EnvironmentParser that uses the global sniffer instance.
|
|
@@ -14,7 +22,7 @@ var PatchedEnvironmentParser = class {
|
|
|
14
22
|
return globalThis.__envSniffer.create(builder);
|
|
15
23
|
}
|
|
16
24
|
};
|
|
17
|
-
|
|
18
25
|
//#endregion
|
|
19
26
|
export { PatchedEnvironmentParser as EnvironmentParser, SnifferEnvironmentParser };
|
|
27
|
+
|
|
20
28
|
//# sourceMappingURL=sniffer-envkit-patch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { 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// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;;;;;;;;AAoBA,IAAI,CAAC,WAAW,cACf,WAAW,eAAe,IAAIA,2BAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
let node_path = require("node:path");
|
|
6
4
|
//#region src/deploy/sniffer-hooks.ts
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Module loader hooks for entry app sniffing.
|
|
7
|
+
*
|
|
8
|
+
* This module provides the resolve hook that intercepts '@geekmidas/envkit'
|
|
9
|
+
* imports and redirects them to the patched sniffer version.
|
|
10
|
+
*
|
|
11
|
+
* This file is registered via module.register() from sniffer-loader.ts.
|
|
12
|
+
*/
|
|
13
|
+
const __filename$1 = (0, require("node:url").fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
8
14
|
const __dirname$1 = (0, node_path.dirname)(__filename$1);
|
|
9
15
|
const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.mjs");
|
|
10
16
|
const tsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.ts");
|
|
@@ -19,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
|
|
|
19
25
|
};
|
|
20
26
|
return nextResolve(specifier, context);
|
|
21
27
|
}
|
|
22
|
-
|
|
23
28
|
//#endregion
|
|
24
29
|
exports.resolve = resolve;
|
|
30
|
+
|
|
25
31
|
//# sourceMappingURL=sniffer-hooks.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.cjs","names":["__filename","__dirname","
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.cjs","names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync"],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit 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-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,gBAAAA,qBAAaC,CAAAA,CAAAA,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,0BAA0B;AAC1D,MAAM,UAAA,GAASE,UAAAA,KAAAA,CAAKF,aAAW,yBAAyB;AACxD,MAAM,qBAAA,GAAoBG,QAAAA,WAAAA,CAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
|
|
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
|
|
|
21
21
|
/**
|
|
22
22
|
* Resolve hook - intercepts module resolution for @geekmidas/envkit
|
|
23
23
|
*/
|
|
24
|
-
declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
24
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { resolve };
|
|
27
26
|
//# sourceMappingURL=sniffer-hooks.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
|
|
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
|
|
|
21
21
|
/**
|
|
22
22
|
* Resolve hook - intercepts module resolution for @geekmidas/envkit
|
|
23
23
|
*/
|
|
24
|
-
declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
24
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { resolve };
|
|
27
26
|
//# sourceMappingURL=sniffer-hooks.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
4
|
//#region src/deploy/sniffer-hooks.ts
|
|
5
|
+
/**
|
|
6
|
+
* Module loader hooks for entry app sniffing.
|
|
7
|
+
*
|
|
8
|
+
* This module provides the resolve hook that intercepts '@geekmidas/envkit'
|
|
9
|
+
* imports and redirects them to the patched sniffer version.
|
|
10
|
+
*
|
|
11
|
+
* This file is registered via module.register() from sniffer-loader.ts.
|
|
12
|
+
*/
|
|
6
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
14
|
const __dirname = dirname(__filename);
|
|
8
15
|
const mjsPath = join(__dirname, "sniffer-envkit-patch.mjs");
|
|
@@ -18,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
|
|
|
18
25
|
};
|
|
19
26
|
return nextResolve(specifier, context);
|
|
20
27
|
}
|
|
21
|
-
|
|
22
28
|
//#endregion
|
|
23
29
|
export { resolve };
|
|
30
|
+
|
|
24
31
|
//# sourceMappingURL=sniffer-hooks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.mjs","names":[
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.mjs","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit 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-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAGpC,MAAM,UAAU,KAAK,WAAW,0BAA0B;AAC1D,MAAM,SAAS,KAAK,WAAW,yBAAyB;AACxD,MAAM,oBAAoB,WAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const node_module = require_chunk.__toESM(require("node:module"));
|
|
6
|
-
|
|
1
|
+
let node_fs = require("node:fs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_url = require("node:url");
|
|
4
|
+
let node_module = require("node:module");
|
|
7
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
|
+
*/
|
|
8
17
|
const __filename$1 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
9
18
|
const __dirname$1 = (0, node_path.dirname)(__filename$1);
|
|
10
19
|
const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.mjs");
|
|
11
20
|
const tsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.ts");
|
|
12
21
|
const hooksPath = (0, node_fs.existsSync)(mjsPath) ? mjsPath : tsPath;
|
|
13
22
|
(0, node_module.register)((0, node_url.pathToFileURL)(hooksPath).href, require("url").pathToFileURL(__filename).href);
|
|
14
|
-
|
|
15
23
|
//#endregion
|
|
24
|
+
|
|
16
25
|
//# sourceMappingURL=sniffer-loader.cjs.map
|
|
@@ -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_crons = require("@geekmidas/constructs/crons");
|
|
5
|
+
let _geekmidas_constructs_endpoints = require("@geekmidas/constructs/endpoints");
|
|
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 {}
|
|
@@ -3,7 +3,6 @@ import { Cron } from "@geekmidas/constructs/crons";
|
|
|
3
3
|
import { Endpoint } from "@geekmidas/constructs/endpoints";
|
|
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"}
|