@geekmidas/cli 10.0.0-alpha.3 → 10.0.0-alpha.30
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 +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-GF6NAZAK.mjs} +20 -21
- package/dist/HostingerProvider-GF6NAZAK.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-c9bpieI5.cjs → OpenApiTsGenerator-D1nhN98m.cjs} +135 -298
- package/dist/OpenApiTsGenerator-D1nhN98m.cjs.map +1 -0
- package/dist/{openapi-CY9xFkTH.mjs → OpenApiTsGenerator-hDINScnz.mjs} +106 -250
- package/dist/OpenApiTsGenerator-hDINScnz.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-CYF5mWi9.cjs} +10 -28
- package/dist/bundler-CYF5mWi9.cjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler-D9IPNvDt.mjs} +9 -26
- package/dist/bundler-D9IPNvDt.mjs.map +1 -0
- package/dist/{config-CzWnfcXM.mjs → config-BH3Ki69F.mjs} +49 -89
- package/dist/config-BH3Ki69F.mjs.map +1 -0
- package/dist/{config-BholeD-0.cjs → config-URVD4bTj.cjs} +101 -148
- package/dist/config-URVD4bTj.cjs.map +1 -0
- package/dist/config.cjs +5 -5
- package/dist/config.d.cts +25 -17
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +25 -17
- 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-CAlFgYec.mjs → discover-CMxesskG.mjs} +66 -22
- package/dist/discover-CMxesskG.mjs.map +1 -0
- package/dist/{discover-DTmFeloL.cjs → discover-CroTIm0K.cjs} +117 -66
- package/dist/discover-CroTIm0K.cjs.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-B2fis34P.cjs +216 -0
- package/dist/github-B2fis34P.cjs.map +1 -0
- package/dist/github-BrDmlm1x.mjs +216 -0
- package/dist/github-BrDmlm1x.mjs.map +1 -0
- package/dist/{index-CHB4tSzX.d.cts → index-p89EzILa.d.mts} +4 -23
- package/dist/index-p89EzILa.d.mts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-rU9u761a.d.cts} +4 -23
- package/dist/index-rU9u761a.d.cts.map +1 -0
- package/dist/index.cjs +6001 -4452
- 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 +5895 -4367
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-BuCx7tIv.cjs +498 -0
- package/dist/migrate-BuCx7tIv.cjs.map +1 -0
- package/dist/migrate-CBICVMAi.mjs +493 -0
- package/dist/migrate-CBICVMAi.mjs.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-CvP3JVEw.mjs +355 -0
- package/dist/ready-CvP3JVEw.mjs.map +1 -0
- package/dist/ready-DXtNfk7v.cjs +390 -0
- package/dist/ready-DXtNfk7v.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-BxZTV2vl.cjs +332 -0
- package/dist/reconcile-BxZTV2vl.cjs.map +1 -0
- package/dist/reconcile-yNq6Shau.mjs +279 -0
- package/dist/reconcile-yNq6Shau.mjs.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-Bi24WfoW.mjs → storage-BjTLjDDp.mjs} +22 -22
- package/dist/storage-BjTLjDDp.mjs.map +1 -0
- package/dist/{storage-BJmzYxt8.cjs → storage-C2JC31V9.cjs} +65 -84
- package/dist/storage-C2JC31V9.cjs.map +1 -0
- package/dist/types-CzK6hsXP.d.mts +6286 -0
- package/dist/types-CzK6hsXP.d.mts.map +1 -0
- package/dist/types-DOOAevjG.d.cts +6287 -0
- package/dist/types-DOOAevjG.d.cts.map +1 -0
- package/dist/vitest.cjs +61 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +28 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +28 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +61 -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/workspace-Bav3TVrP.cjs +6710 -0
- package/dist/workspace-Bav3TVrP.cjs.map +1 -0
- package/dist/{credentials-DQmbRnr1.cjs → workspace-BhiMkRuA.cjs} +2076 -1963
- package/dist/workspace-BhiMkRuA.cjs.map +1 -0
- package/dist/{credentials-BZcp3CGx.mjs → workspace-C97QUCIf.mjs} +1957 -1837
- package/dist/workspace-C97QUCIf.mjs.map +1 -0
- package/dist/workspace-T4IVGSoB.mjs +6538 -0
- package/dist/workspace-T4IVGSoB.mjs.map +1 -0
- package/package.json +45 -38
- 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 +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-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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-URVD4bTj.cjs","names":["kebabCase","existsSync","dirname","parse","join","readFileSync","isWorkspaceConfig","processConfig","allConstructGlobs","discover","getAppGkmConfig"],"sources":["../src/workspace/derive.ts","../src/config.ts"],"sourcesContent":["/**\n * The apps a manifest implies.\n *\n * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its\n * path, its port, its framework, which other apps it depended on. Every one of\n * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`\n * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',\n * dependencies: ['api'] }` are the same statement written twice, and only one of\n * them was checked against anything — so the copy in config was free to drift,\n * and a surface config had no entry for simply never deployed.\n *\n * So the list comes from the graph. A `site` is an app, and so is every\n * `rest-api` — one surface, one container, at the `path` it declared.\n *\n * What config still supplies is what no graph can answer: the backends a cache\n * and a mailer resolve to, the deploy endpoint, the stage's domain.\n */\n\nimport {\n\ttype AppSpec,\n\ttype ConstructManifest,\n\tkebabCase,\n} from '@geekmidas/manifest';\nimport type {\n\tAppDomainConfig,\n\tDeployTarget,\n\tFramework,\n\tNormalizedAppConfig,\n\tNormalizedWorkspace,\n} from './types.js';\n\n/** Which frontend framework builds each site variant. */\nconst FRAMEWORKS: Record<string, Framework> = {\n\tstatic: 'vite',\n\tnext: 'nextjs',\n\ttanstack: 'tanstack-start',\n};\n\n/**\n * The app key a construct id becomes.\n *\n * The same kebab form every physical name is built from, so `Api` is `api` in\n * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an\n * environment — one id, three renderings, no second list.\n */\nexport function appKey(id: string): string {\n\treturn kebabCase(id);\n}\n\n/**\n * The app serving a surface: its own, always.\n *\n * Every surface gets a container. There is no arrangement in which one runs\n * inside another — two surfaces in a process share a filesystem, an\n * environment, and every credential either was granted, so an auth server\n * beside an API is one bug in the API away from being read by it.\n */\nexport function hostOf(\n\tmanifest: ConstructManifest,\n\tid: string,\n): string | undefined {\n\tconst declaration = manifest[id];\n\tif (!declaration || declaration.kind !== 'rest-api') return undefined;\n\n\treturn id;\n}\n\n/**\n * Local ports, assigned so that adding a site does not renumber the others.\n *\n * Backends first, then the site holding the base domain, then the rest\n * alphabetically. The ordering is arbitrary but it is *fixed*, which is the\n * property that matters: a port that moves when an unrelated app is added is a\n * port nobody can put in a bookmark. A construct that names its own port keeps\n * it, and is skipped here.\n */\nfunction assignPorts(apps: Record<string, NormalizedAppConfig>): void {\n\tconst rank = (\n\t\tname: string,\n\t\tapp: NormalizedAppConfig,\n\t): [number, number, string] => [\n\t\tapp.type === 'backend' ? 0 : app.type === 'web' ? 1 : 2,\n\t\tapp.root ? 0 : 1,\n\t\tname,\n\t];\n\n\tconst ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {\n\t\tconst [at, ar, an] = rank(aName, a);\n\t\tconst [bt, br, bn] = rank(bName, b);\n\t\treturn at - bt || ar - br || an.localeCompare(bn);\n\t});\n\n\tconst taken = new Set(\n\t\tordered.map(([, app]) => app.port).filter((p): p is number => !!p),\n\t);\n\n\tlet next = 3000;\n\tfor (const [, app] of ordered) {\n\t\tif (app.port) continue;\n\t\twhile (taken.has(next)) next += 1;\n\t\tapp.port = next;\n\t\ttaken.add(next);\n\t}\n}\n\n/**\n * Whichever site holds the base domain.\n *\n * The convention first — a site named `web` — because it is one people already\n * rely on. Then an explicit `root: true`. A project with one site needs neither.\n */\nfunction markRoot(apps: Record<string, NormalizedAppConfig>): void {\n\tconst sites = Object.entries(apps).filter(([, a]) => a.type === 'web');\n\tif (sites.length === 0) return;\n\tif (sites.some(([, a]) => a.root)) return;\n\n\tconst chosen =\n\t\tsites.find(([name]) => name === 'web') ??\n\t\t(sites.length === 1 ? sites[0] : undefined);\n\tif (chosen) chosen[1].root = true;\n}\n\nexport function derivedApps(\n\tmanifest: ConstructManifest,\n\tworkspace: NormalizedWorkspace,\n): Record<string, NormalizedAppConfig> {\n\tconst apps: Record<string, NormalizedAppConfig> = {};\n\tconst defaultTarget: DeployTarget = workspace.deploy?.default ?? 'dokploy';\n\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\t// Two kinds are apps: a site and an HTTP surface. A worker is not one —\n\t\t// it names the process that runs a cron or a subscriber, and that process\n\t\t// is the app's server, which already exists. Everything else is a\n\t\t// resource one of them uses.\n\t\tif (declaration.kind !== 'site' && declaration.kind !== 'rest-api')\n\t\t\tcontinue;\n\n\t\t// No opt-in to be had. A site is an app and so is a surface, and each\n\t\t// says where it lives.\n\t\tconst spec: AppSpec =\n\t\t\tdeclaration.kind === 'site'\n\t\t\t\t? declaration.app\n\t\t\t\t: {\n\t\t\t\t\t\tpath: declaration.path,\n\t\t\t\t\t\t...(declaration.telescope ? { telescope: true } : {}),\n\t\t\t\t\t};\n\n\t\tconst name = appKey(id);\n\t\t// A config entry of the same name still wins, so a workspace can override\n\t\t// one field without restating the app. Nothing in this repo needs to.\n\t\tconst configured = workspace.apps[name];\n\n\t\tapps[name] = {\n\t\t\t...configured,\n\t\t\ttype: declaration.kind === 'site' ? 'web' : 'backend',\n\t\t\tpath: spec.path,\n\t\t\tport: spec.port ?? configured?.port ?? 0,\n\t\t\tdependencies: [],\n\t\t\tresolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,\n\t\t\t...(declaration.kind === 'site'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? FRAMEWORKS[declaration.variant],\n\t\t\t\t\t\t...(declaration.root ? { root: true } : {}),\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// One glob fans out to the six the build reads, because each generator\n\t\t\t// already inspects every export and keeps what it recognises. A\n\t\t\t// per-kind field still wins where one was given.\n\t\t\t...(spec.telescope !== undefined ? { telescope: spec.telescope } : {}),\n\t\t\t...(spec.studio !== undefined ? { studio: spec.studio } : {}),\n\t\t\t...(spec.openapi !== undefined ? { openapi: spec.openapi } : {}),\n\t\t\t...(spec.runtime !== undefined ? { runtime: spec.runtime } : {}),\n\t\t\t...(spec.env !== undefined ? { env: spec.env } : {}),\n\t\t\t...(spec.entry !== undefined ? { entry: spec.entry } : {}),\n\t\t\t...(configured?.domain\n\t\t\t\t? { domain: configured.domain as AppDomainConfig }\n\t\t\t\t: {}),\n\t\t} as NormalizedAppConfig;\n\t}\n\n\t// Build order, from the edges rather than from a hand-kept list. A site that\n\t// depends on a surface depends on the app that serves it — which for a\n\t// mounted auth server is its host, not a container that does not exist.\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\t// Two kinds are apps: a site and an HTTP surface. A worker is not one —\n\t\t// it names the process that runs a cron or a subscriber, and that process\n\t\t// is the app's server, which already exists. Everything else is a\n\t\t// resource one of them uses.\n\t\tif (declaration.kind !== 'site' && declaration.kind !== 'rest-api')\n\t\t\tcontinue;\n\n\t\tconst app = apps[appKey(id)];\n\t\tif (!app) continue;\n\n\t\t// A site names its edges `dependencies`; a surface names them `calls`.\n\t\tconst edges =\n\t\t\tdeclaration.kind === 'rest-api'\n\t\t\t\t? (declaration.calls ?? [])\n\t\t\t\t: (declaration.dependencies ?? []);\n\n\t\tconst names = new Set<string>();\n\t\tfor (const edge of edges) {\n\t\t\tif (edge.kind !== 'rest-api') continue;\n\t\t\tconst host = hostOf(manifest, edge.target);\n\t\t\tif (!host) continue;\n\t\t\tconst key = appKey(host);\n\t\t\tif (key !== appKey(id) && apps[key]) names.add(key);\n\t\t}\n\n\t\tapp.dependencies = [...names].sort();\n\t}\n\n\tmarkRoot(apps);\n\tassignPorts(apps);\n\n\t// Apps config declared that the graph knows nothing about — a `type: 'mobile'`\n\t// entry, or a hand-run process. Kept rather than dropped: config is still the\n\t// escape hatch for what nothing declares.\n\tfor (const [name, app] of Object.entries(workspace.apps)) {\n\t\tif (!apps[name]) apps[name] = app;\n\t}\n\n\treturn apps;\n}\n","import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, parse } from 'node:path';\nimport { discover } from './reconcile/discover.js';\nimport type { GkmConfig } from './types.js';\nimport { derivedApps } from './workspace/derive.js';\nimport {\n\tallConstructGlobs,\n\tgetAppGkmConfig,\n\tisWorkspaceConfig,\n\ttype LoadedConfig,\n\ttype NormalizedAppConfig,\n\ttype NormalizedWorkspace,\n\tprocessConfig,\n\ttype WorkspaceConfig,\n} from './workspace/index.js';\n\nexport type { GkmConfig } from './types.js';\nexport type { LoadedConfig, WorkspaceConfig } from './workspace/index.js';\nexport { defineWorkspace } from './workspace/index.js';\n/**\n * Define GKM configuration with full TypeScript support.\n * This is an identity function that provides type safety and autocomplete.\n *\n * @example\n * ```ts\n * // gkm.config.ts\n * import { defineConfig } from '@geekmidas/cli/config';\n *\n * export default defineConfig({\n * routes: './src/endpoints/**\\/*.ts',\n * envParser: './src/config/env',\n * logger: './src/config/logger',\n * telescope: true,\n * });\n * ```\n */\nexport function defineConfig(config: GkmConfig): GkmConfig {\n\treturn config;\n}\n\nexport interface ParsedModuleConfig {\n\tpath: string;\n\timportPattern: string;\n}\n\n/**\n * Parse a module config string into path and import pattern.\n *\n * @param configString - Config string in format \"./path/to/module\" or \"./path/to/module#exportName\"\n * @param defaultAlias - The default alias name to use if no export name specified\n * @returns Object with path and import pattern\n *\n * @example\n * parseModuleConfig('./src/config/env', 'envParser')\n * // { path: './src/config/env', importPattern: 'envParser' }\n *\n * parseModuleConfig('./src/config/env#envParser', 'envParser')\n * // { path: './src/config/env', importPattern: '{ envParser }' }\n *\n * parseModuleConfig('./src/config/env#myEnv', 'envParser')\n * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }\n */\nexport function parseModuleConfig(\n\tconfigString: string,\n\tdefaultAlias: string,\n): ParsedModuleConfig {\n\tconst parts = configString.split('#');\n\tconst path = parts[0] ?? configString;\n\tconst exportName = parts[1];\n\tconst importPattern = !exportName\n\t\t? defaultAlias\n\t\t: exportName === defaultAlias\n\t\t\t? `{ ${defaultAlias} }`\n\t\t\t: `{ ${exportName} as ${defaultAlias} }`;\n\n\treturn { path, importPattern };\n}\n\nexport interface ConfigDiscoveryResult {\n\tconfigPath: string;\n\tworkspaceRoot: string;\n}\n\n/**\n * Find and return the path to the config file.\n *\n * Resolution order:\n * 1. GKM_CONFIG_PATH env var (set by workspace dev command)\n * 2. Walk up directory tree from cwd\n */\nfunction findConfigPath(cwd: string): ConfigDiscoveryResult {\n\tconst files = ['gkm.config.json', 'gkm.config.ts', 'gkm.config.js'];\n\n\t// Check GKM_CONFIG_PATH env var first (set by workspace dev command)\n\tconst envConfigPath = process.env.GKM_CONFIG_PATH;\n\tif (envConfigPath && existsSync(envConfigPath)) {\n\t\treturn {\n\t\t\tconfigPath: envConfigPath,\n\t\t\tworkspaceRoot: dirname(envConfigPath),\n\t\t};\n\t}\n\n\t// Walk up directory tree to find config\n\tlet currentDir = cwd;\n\tconst { root } = parse(currentDir);\n\n\twhile (currentDir !== root) {\n\t\tfor (const file of files) {\n\t\t\tconst configPath = join(currentDir, file);\n\t\t\tif (existsSync(configPath)) {\n\t\t\t\treturn {\n\t\t\t\t\tconfigPath,\n\t\t\t\t\tworkspaceRoot: currentDir,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcurrentDir = dirname(currentDir);\n\t}\n\n\tthrow new Error(\n\t\t'Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.',\n\t);\n}\n\n/**\n * Get app name from package.json in the given directory.\n * Handles scoped packages by extracting the name after the scope.\n *\n * @example\n * getAppNameFromCwd('/path/to/apps/api')\n * // package.json: { \"name\": \"@myorg/api\" }\n * // Returns: 'api'\n */\nexport function getAppNameFromCwd(cwd: string = process.cwd()): string | null {\n\tconst packageJsonPath = join(cwd, 'package.json');\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n\t\tconst name = packageJson.name as string | undefined;\n\n\t\tif (!name) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Handle scoped packages: @scope/name -> name\n\t\tif (name.startsWith('@') && name.includes('/')) {\n\t\t\treturn name.split('/')[1] ?? null;\n\t\t}\n\n\t\treturn name;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\ninterface RawConfigResult {\n\tconfig: GkmConfig | WorkspaceConfig;\n\tworkspaceRoot: string;\n}\n\n/**\n * Load raw configuration from file.\n */\nasync function loadRawConfig(cwd: string): Promise<RawConfigResult> {\n\tconst { configPath, workspaceRoot } = findConfigPath(cwd);\n\n\ttry {\n\t\tconst config = await import(configPath);\n\t\treturn {\n\t\t\tconfig: config.default,\n\t\t\tworkspaceRoot,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(`Failed to load config: ${(error as Error).message}`);\n\t}\n}\n\n/**\n * Load configuration file (single-app format).\n * For backwards compatibility with existing code.\n *\n * @deprecated Use loadWorkspaceConfig for new code\n */\nexport async function loadConfig(\n\tcwd: string = process.cwd(),\n): Promise<GkmConfig> {\n\tconst { config } = await loadRawConfig(cwd);\n\n\t// If it's a workspace config, throw an error\n\tif (isWorkspaceConfig(config)) {\n\t\tthrow new Error(\n\t\t\t'Workspace configuration detected. Use loadWorkspaceConfig() instead.',\n\t\t);\n\t}\n\n\treturn config;\n}\n\n/**\n * Load configuration file and process it as a workspace.\n * Works with both single-app and workspace configurations.\n *\n * Single-app configs are automatically wrapped as a workspace with one app.\n *\n * @example\n * ```ts\n * const { type, workspace } = await loadWorkspaceConfig();\n *\n * if (type === 'workspace') {\n * console.log('Multi-app workspace:', workspace.apps);\n * } else {\n * console.log('Single app wrapped as workspace');\n * }\n * ```\n */\nexport async function loadWorkspaceConfig(\n\tcwd: string = process.cwd(),\n): Promise<LoadedConfig> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\treturn withDerivedApps(processConfig(config, workspaceRoot));\n}\n\n/**\n * The loaded config, with its apps read off the graph.\n *\n * Here rather than at each call site because every command needs the same\n * answer, and the ones that forgot to ask were exactly the bugs: a site that\n * never deployed, a surface that could not be its own process. `gkm dev`,\n * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without\n * any of them knowing a derivation happened.\n *\n * Discovery imports the construct modules — declarations only, not endpoints —\n * which is the same import the reconciler and the build already do. A workspace\n * with no `constructs` glob discovers nothing and keeps whatever its config\n * said, so nothing that worked before changes.\n *\n * A construct file that throws is reported and skipped rather than taking the\n * command down: `gkm dev` failing to start because a half-written declaration\n * cannot be imported is a worse failure than starting with the app it does not\n * describe yet.\n */\nasync function withDerivedApps(loaded: LoadedConfig): Promise<LoadedConfig> {\n\tconst globs = allConstructGlobs(loaded.workspace);\n\tif (globs.length === 0) {\n\t\tthrow new WorkspaceDeclaresNoConstructs(loaded.workspace.root);\n\t}\n\n\ttry {\n\t\tconst manifest = await discover({\n\t\t\tpatterns: globs,\n\t\t\tcwd: loaded.workspace.root,\n\t\t});\n\n\t\treturn {\n\t\t\t...loaded,\n\t\t\tmanifest,\n\t\t\tworkspace: {\n\t\t\t\t...loaded.workspace,\n\t\t\t\tapps: derivedApps(manifest, loaded.workspace),\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(\n\t\t\t`⚠️ Could not read constructs, so apps come from config alone: ${message}`,\n\t\t);\n\t\treturn loaded;\n\t}\n}\n\n/**\n * A workspace with no `constructs` glob.\n *\n * In v10 every address, container and app comes from what the workspace\n * declares — there is no second path that reads a hand-written compose file or\n * an `apps` block's ports. A config that declares nothing has nothing to run.\n */\nexport class WorkspaceDeclaresNoConstructs extends Error {\n\tconstructor(readonly root: string) {\n\t\tsuper(\n\t\t\t`The workspace at ${root} declares no constructs. Every workspace names ` +\n\t\t\t\t\"where its constructs live — `constructs: ['./constructs/**/*.ts', \" +\n\t\t\t\t\"'./apps/*/endpoints/**/*.ts']` in gkm.config.ts — and its apps, \" +\n\t\t\t\t'containers and URLs are derived from them.',\n\t\t);\n\t\tthis.name = 'WorkspaceDeclaresNoConstructs';\n\t}\n}\n\nexport interface AppConfigResult {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tgkmConfig: GkmConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n\tappRoot: string;\n}\n\n/**\n * The app a package directory refers to, and what the workspace calls it.\n *\n * A single-app config is wrapped as a one-app workspace keyed `api`, which is\n * almost never the package name. Matching on the key alone means an app like\n * `@geekmidas/example` resolves to nothing and silently loses everything that\n * comes from the workspace — including the URLs its constructs declare.\n */\nfunction resolveWorkspaceApp(\n\tloadedConfig: LoadedConfig,\n\tappName: string,\n): { key: string; app: NormalizedAppConfig } | undefined {\n\tconst apps = loadedConfig.workspace.apps;\n\n\tconst named = apps[appName];\n\tif (named) return { key: appName, app: named };\n\n\tconst names = Object.keys(apps);\n\tconst only = names[0];\n\tif (loadedConfig.type !== 'single' || names.length !== 1 || !only) {\n\t\treturn undefined;\n\t}\n\n\tconst app = apps[only];\n\n\treturn app ? { key: only, app } : undefined;\n}\n\n/**\n * Load app-specific configuration from workspace.\n * Uses the app name from package.json to find the correct app config.\n *\n * @example\n * ```ts\n * // From apps/api directory with package.json: { \"name\": \"@myorg/api\" }\n * const { app, workspace, workspaceRoot } = await loadAppConfig();\n * console.log(app.routes); // './src/endpoints/**\\/*.ts'\n * ```\n */\nexport async function loadAppConfig(\n\tcwd: string = process.cwd(),\n): Promise<AppConfigResult> {\n\tconst appName = getAppNameFromCwd(cwd);\n\n\tif (!appName) {\n\t\tthrow new Error(\n\t\t\t'Could not determine app name. Ensure package.json exists with a \"name\" field.',\n\t\t);\n\t}\n\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, appName);\n\n\tif (!resolved) {\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" not found in workspace config. Available apps: ${Object.keys(\n\t\t\t\tloadedConfig.workspace.apps,\n\t\t\t).join(', ')}. ` +\n\t\t\t\t`Ensure the package.json name matches the app key in gkm.config.ts.`,\n\t\t);\n\t}\n\n\tconst { key, app } = resolved;\n\n\t// Keyed by what the workspace calls the app, not by the package name — for a\n\t// single-app config those differ.\n\tconst gkmConfig = getAppGkmConfig(loadedConfig.workspace, key);\n\n\tif (!gkmConfig) {\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" is not a backend app and cannot be run with gkm dev.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tappName,\n\t\tapp,\n\t\tgkmConfig,\n\t\tworkspace: loadedConfig.workspace,\n\t\tworkspaceRoot,\n\t\tappRoot: join(workspaceRoot, app.path),\n\t};\n}\n\nexport interface WorkspaceAppInfo {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n}\n\n/**\n * Load workspace info for any app (frontend or backend).\n * Unlike loadAppConfig, this does NOT require the app to have a gkm config\n * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.\n */\nexport async function loadWorkspaceAppInfo(\n\tcwd: string = process.cwd(),\n): Promise<WorkspaceAppInfo> {\n\tconst appName = getAppNameFromCwd(cwd);\n\n\tif (!appName) {\n\t\tthrow new Error(\n\t\t\t'Could not determine app name. Ensure package.json exists with a \"name\" field.',\n\t\t);\n\t}\n\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, appName);\n\n\tif (!resolved) {\n\t\tconst availableApps = Object.keys(loadedConfig.workspace.apps).join(', ');\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" not found in workspace config. Available apps: ${availableApps}. ` +\n\t\t\t\t`Ensure the package.json name matches the app key in gkm.config.ts.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tappName,\n\t\tapp: resolved.app,\n\t\tworkspace: loadedConfig.workspace,\n\t\tworkspaceRoot,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,aAAwC;CAC7C,QAAQ;CACR,MAAM;CACN,UAAU;AACX;;;;;;;;AASA,SAAgB,OAAO,IAAoB;CAC1C,QAAA,GAAOA,oBAAAA,UAAAA,CAAU,EAAE;AACpB;;;;;;;;;AAUA,SAAgB,OACf,UACA,IACqB;CACrB,MAAM,cAAc,SAAS;CAC7B,IAAI,CAAC,eAAe,YAAY,SAAS,YAAY,OAAO,KAAA;CAE5D,OAAO;AACR;;;;;;;;;;AAWA,SAAS,YAAY,MAAiD;CACrE,MAAM,QACL,MACA,QAC8B;EAC9B,IAAI,SAAS,YAAY,IAAI,IAAI,SAAS,QAAQ,IAAI;EACtD,IAAI,OAAO,IAAI;E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,CACpC;CAEA,MAAM,WAAW,oBAAoB,cAAc,OAAO;CAE1D,IAAI,CAAC,UACJ,MAAM,IAAI,MACT,QAAQ,QAAQ,mDAAmD,OAAO,KACzE,aAAa,UAAU,IACxB,CAAC,CAAC,KAAK,IAAI,EAAE,qEAEd;CAGD,MAAM,EAAE,KAAK,QAAQ;CAIrB,MAAM,YAAYG,kBAAAA,gBAAgB,aAAa,WAAW,GAAG;CAE7D,IAAI,CAAC,WACJ,MAAM,IAAI,MACT,QAAQ,QAAQ,uDACjB;CAGD,OAAO;EACN;EACA;EACA;EACA,WAAW,aAAa;EACxB;EACA,UAAA,GAASN,UAAAA,KAAAA,CAAK,eAAe,IAAI,IAAI;CACtC;AACD;;;;;;AAcA,eAAsB,qBACrB,MAAc,QAAQ,IAAI,GACE;CAC5B,MAAM,UAAU,kBAAkB,GAAG;CAErC,IAAI,CAAC,SACJ,MAAM,IAAI,MACT,iFACD;CAGD,MAAM,EAAE,QAAQ,kBAAkB,MAAM,cAAc,GAAG;CACzD,MAAM,eAAe,MAAM,gBAC1BG,kBAAAA,cAAc,QAAQ,aAAa,CACpC;CAEA,MAAM,WAAW,oBAAoB,cAAc,OAAO;CAE1D,IAAI,CAAC,UAAU;EACd,MAAM,gBAAgB,OAAO,KAAK,aAAa,UAAU,IAAI,CAAC,CAAC,KAAK,IAAI;EACxE,MAAM,IAAI,MACT,QAAQ,QAAQ,mDAAmD,cAAc,qEAElF;CACD;CAEA,OAAO;EACN;EACA,KAAK,SAAS;EACd,WAAW,aAAa;EACxB;CACD;AACD"}
|
package/dist/config.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const require_config = require(
|
|
3
|
-
const require_workspace = require(
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_config = require("./config-URVD4bTj.cjs");
|
|
3
|
+
const require_workspace = require("./workspace-Bav3TVrP.cjs");
|
|
4
|
+
exports.WorkspaceDeclaresNoConstructs = require_config.WorkspaceDeclaresNoConstructs;
|
|
5
5
|
exports.defineConfig = require_config.defineConfig;
|
|
6
6
|
exports.defineWorkspace = require_workspace.defineWorkspace;
|
|
7
7
|
exports.getAppNameFromCwd = require_config.getAppNameFromCwd;
|
|
@@ -9,4 +9,4 @@ exports.loadAppConfig = require_config.loadAppConfig;
|
|
|
9
9
|
exports.loadConfig = require_config.loadConfig;
|
|
10
10
|
exports.loadWorkspaceAppInfo = require_config.loadWorkspaceAppInfo;
|
|
11
11
|
exports.loadWorkspaceConfig = require_config.loadWorkspaceConfig;
|
|
12
|
-
exports.parseModuleConfig = require_config.parseModuleConfig;
|
|
12
|
+
exports.parseModuleConfig = require_config.parseModuleConfig;
|
package/dist/config.d.cts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineWorkspace } from "./index-
|
|
3
|
-
|
|
1
|
+
import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-DOOAevjG.cjs";
|
|
2
|
+
import { i as defineWorkspace } from "./index-rU9u761a.cjs";
|
|
4
3
|
//#region src/config.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Define GKM configuration with full TypeScript support.
|
|
8
6
|
* This is an identity function that provides type safety and autocomplete.
|
|
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-CHB4tSzX.cjs";
|
|
|
20
18
|
* });
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
|
-
declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
24
|
-
interface ParsedModuleConfig {
|
|
21
|
+
export declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
22
|
+
export interface ParsedModuleConfig {
|
|
25
23
|
path: string;
|
|
26
24
|
importPattern: string;
|
|
27
25
|
}
|
|
@@ -42,8 +40,8 @@ interface ParsedModuleConfig {
|
|
|
42
40
|
* parseModuleConfig('./src/config/env#myEnv', 'envParser')
|
|
43
41
|
* // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
|
|
44
42
|
*/
|
|
45
|
-
declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
46
|
-
interface ConfigDiscoveryResult {
|
|
43
|
+
export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
44
|
+
export interface ConfigDiscoveryResult {
|
|
47
45
|
configPath: string;
|
|
48
46
|
workspaceRoot: string;
|
|
49
47
|
}
|
|
@@ -56,14 +54,14 @@ interface ConfigDiscoveryResult {
|
|
|
56
54
|
* // package.json: { "name": "@myorg/api" }
|
|
57
55
|
* // Returns: 'api'
|
|
58
56
|
*/
|
|
59
|
-
declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
57
|
+
export declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
60
58
|
/**
|
|
61
59
|
* Load configuration file (single-app format).
|
|
62
60
|
* For backwards compatibility with existing code.
|
|
63
61
|
*
|
|
64
62
|
* @deprecated Use loadWorkspaceConfig for new code
|
|
65
63
|
*/
|
|
66
|
-
declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
64
|
+
export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
67
65
|
/**
|
|
68
66
|
* Load configuration file and process it as a workspace.
|
|
69
67
|
* Works with both single-app and workspace configurations.
|
|
@@ -81,8 +79,19 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
|
81
79
|
* }
|
|
82
80
|
* ```
|
|
83
81
|
*/
|
|
84
|
-
declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
85
|
-
|
|
82
|
+
export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
83
|
+
/**
|
|
84
|
+
* A workspace with no `constructs` glob.
|
|
85
|
+
*
|
|
86
|
+
* In v10 every address, container and app comes from what the workspace
|
|
87
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
88
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
89
|
+
*/
|
|
90
|
+
export declare class WorkspaceDeclaresNoConstructs extends Error {
|
|
91
|
+
readonly root: string;
|
|
92
|
+
constructor(root: string);
|
|
93
|
+
}
|
|
94
|
+
export interface AppConfigResult {
|
|
86
95
|
appName: string;
|
|
87
96
|
app: NormalizedAppConfig;
|
|
88
97
|
gkmConfig: GkmConfig;
|
|
@@ -101,8 +110,8 @@ interface AppConfigResult {
|
|
|
101
110
|
* console.log(app.routes); // './src/endpoints/**\/*.ts'
|
|
102
111
|
* ```
|
|
103
112
|
*/
|
|
104
|
-
declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
105
|
-
interface WorkspaceAppInfo {
|
|
113
|
+
export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
114
|
+
export interface WorkspaceAppInfo {
|
|
106
115
|
appName: string;
|
|
107
116
|
app: NormalizedAppConfig;
|
|
108
117
|
workspace: NormalizedWorkspace;
|
|
@@ -113,8 +122,7 @@ interface WorkspaceAppInfo {
|
|
|
113
122
|
* Unlike loadAppConfig, this does NOT require the app to have a gkm config
|
|
114
123
|
* (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
|
|
115
124
|
*/
|
|
116
|
-
declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
117
|
-
//# sourceMappingURL=config.d.ts.map
|
|
125
|
+
export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
118
126
|
//#endregion
|
|
119
|
-
export {
|
|
127
|
+
export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
|
|
120
128
|
//# sourceMappingURL=config.d.cts.map
|
package/dist/config.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;;;;;;;;;wBAqDe,kBAAkB;;;;;;;wBAsDZ,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;wBA8BW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;;;;;;;;;;;wBA0CqB,cACrB,eACE,QAAQ;iBA+CM;EAChB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;wBAQqB,qBACrB,eACE,QAAQ"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineWorkspace } from "./index-
|
|
3
|
-
|
|
1
|
+
import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-CzK6hsXP.mjs";
|
|
2
|
+
import { i as defineWorkspace } from "./index-p89EzILa.mjs";
|
|
4
3
|
//#region src/config.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Define GKM configuration with full TypeScript support.
|
|
8
6
|
* This is an identity function that provides type safety and autocomplete.
|
|
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-BThUzEIp.mjs";
|
|
|
20
18
|
* });
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
|
-
declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
24
|
-
interface ParsedModuleConfig {
|
|
21
|
+
export declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
22
|
+
export interface ParsedModuleConfig {
|
|
25
23
|
path: string;
|
|
26
24
|
importPattern: string;
|
|
27
25
|
}
|
|
@@ -42,8 +40,8 @@ interface ParsedModuleConfig {
|
|
|
42
40
|
* parseModuleConfig('./src/config/env#myEnv', 'envParser')
|
|
43
41
|
* // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
|
|
44
42
|
*/
|
|
45
|
-
declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
46
|
-
interface ConfigDiscoveryResult {
|
|
43
|
+
export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
44
|
+
export interface ConfigDiscoveryResult {
|
|
47
45
|
configPath: string;
|
|
48
46
|
workspaceRoot: string;
|
|
49
47
|
}
|
|
@@ -56,14 +54,14 @@ interface ConfigDiscoveryResult {
|
|
|
56
54
|
* // package.json: { "name": "@myorg/api" }
|
|
57
55
|
* // Returns: 'api'
|
|
58
56
|
*/
|
|
59
|
-
declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
57
|
+
export declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
60
58
|
/**
|
|
61
59
|
* Load configuration file (single-app format).
|
|
62
60
|
* For backwards compatibility with existing code.
|
|
63
61
|
*
|
|
64
62
|
* @deprecated Use loadWorkspaceConfig for new code
|
|
65
63
|
*/
|
|
66
|
-
declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
64
|
+
export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
67
65
|
/**
|
|
68
66
|
* Load configuration file and process it as a workspace.
|
|
69
67
|
* Works with both single-app and workspace configurations.
|
|
@@ -81,8 +79,19 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
|
81
79
|
* }
|
|
82
80
|
* ```
|
|
83
81
|
*/
|
|
84
|
-
declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
85
|
-
|
|
82
|
+
export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
83
|
+
/**
|
|
84
|
+
* A workspace with no `constructs` glob.
|
|
85
|
+
*
|
|
86
|
+
* In v10 every address, container and app comes from what the workspace
|
|
87
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
88
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
89
|
+
*/
|
|
90
|
+
export declare class WorkspaceDeclaresNoConstructs extends Error {
|
|
91
|
+
readonly root: string;
|
|
92
|
+
constructor(root: string);
|
|
93
|
+
}
|
|
94
|
+
export interface AppConfigResult {
|
|
86
95
|
appName: string;
|
|
87
96
|
app: NormalizedAppConfig;
|
|
88
97
|
gkmConfig: GkmConfig;
|
|
@@ -101,8 +110,8 @@ interface AppConfigResult {
|
|
|
101
110
|
* console.log(app.routes); // './src/endpoints/**\/*.ts'
|
|
102
111
|
* ```
|
|
103
112
|
*/
|
|
104
|
-
declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
105
|
-
interface WorkspaceAppInfo {
|
|
113
|
+
export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
114
|
+
export interface WorkspaceAppInfo {
|
|
106
115
|
appName: string;
|
|
107
116
|
app: NormalizedAppConfig;
|
|
108
117
|
workspace: NormalizedWorkspace;
|
|
@@ -113,8 +122,7 @@ interface WorkspaceAppInfo {
|
|
|
113
122
|
* Unlike loadAppConfig, this does NOT require the app to have a gkm config
|
|
114
123
|
* (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
|
|
115
124
|
*/
|
|
116
|
-
declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
117
|
-
//# sourceMappingURL=config.d.ts.map
|
|
125
|
+
export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
118
126
|
//#endregion
|
|
119
|
-
export {
|
|
127
|
+
export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
|
|
120
128
|
//# sourceMappingURL=config.d.mts.map
|
package/dist/config.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;;;;;;;;;wBAqDe,kBAAkB;;;;;;;wBAsDZ,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;wBA8BW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;;;;;;;;;;;wBA0CqB,cACrB,eACE,QAAQ;iBA+CM;EAChB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;wBAQqB,qBACrB,eACE,QAAQ"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
|
|
1
|
+
import { a as loadConfig, c as parseModuleConfig, i as loadAppConfig, n as defineConfig, o as loadWorkspaceAppInfo, r as getAppNameFromCwd, s as loadWorkspaceConfig, t as WorkspaceDeclaresNoConstructs } from "./config-BH3Ki69F.mjs";
|
|
2
|
+
import { i as defineWorkspace } from "./workspace-T4IVGSoB.mjs";
|
|
3
|
+
export { WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _geekmidas_envkit_sniffer = require("@geekmidas/envkit/sniffer");
|
|
4
3
|
//#region src/deploy/sniffer-envkit-patch.ts
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Patched @geekmidas/envkit module for entry app sniffing.
|
|
6
|
+
*
|
|
7
|
+
* This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
|
|
8
|
+
* allowing entry apps to be imported while capturing their env var usage.
|
|
9
|
+
*
|
|
10
|
+
* The actual sniffer instance is stored in globalThis.__envSniffer
|
|
11
|
+
* so the worker script can retrieve the captured variables.
|
|
12
|
+
*/
|
|
13
|
+
if (!globalThis.__envSniffer) globalThis.__envSniffer = new _geekmidas_envkit_sniffer.SnifferEnvironmentParser();
|
|
6
14
|
/**
|
|
7
15
|
* Patched EnvironmentParser that uses the global sniffer instance.
|
|
8
16
|
*
|
|
@@ -15,13 +23,13 @@ var PatchedEnvironmentParser = class {
|
|
|
15
23
|
return globalThis.__envSniffer.create(builder);
|
|
16
24
|
}
|
|
17
25
|
};
|
|
18
|
-
|
|
19
26
|
//#endregion
|
|
20
27
|
exports.EnvironmentParser = PatchedEnvironmentParser;
|
|
21
|
-
Object.defineProperty(exports,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
Object.defineProperty(exports, "SnifferEnvironmentParser", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return _geekmidas_envkit_sniffer.SnifferEnvironmentParser;
|
|
32
|
+
}
|
|
26
33
|
});
|
|
34
|
+
|
|
27
35
|
//# sourceMappingURL=sniffer-envkit-patch.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.cjs","names":["SnifferEnvironmentParser"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.cjs","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,0BAAAA,yBAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.d.cts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.d.cts","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 +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_module = require("node:module");
|
|
4
|
+
let node_url = require("node:url");
|
|
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 {}
|