@geekmidas/cli 10.0.0-alpha.5 → 10.0.0-alpha.51
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 +196 -257
- package/bin/adjacent-tsconfig.mjs +97 -0
- package/bin/gkm.mjs +16 -2
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- 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-CA0yJUTN.cjs → OpenApiTsGenerator-BN0PIZxd.cjs} +157 -372
- package/dist/OpenApiTsGenerator-BN0PIZxd.cjs.map +1 -0
- package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-BzIGy8KE.mjs} +128 -324
- package/dist/OpenApiTsGenerator-BzIGy8KE.mjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/aws-DkHdTV-p.cjs +61 -0
- package/dist/aws-DkHdTV-p.cjs.map +1 -0
- package/dist/aws-DojzQnLd.mjs +61 -0
- package/dist/aws-DojzQnLd.mjs.map +1 -0
- package/dist/backends-B9V2XD2M.cjs +82 -0
- package/dist/backends-B9V2XD2M.cjs.map +1 -0
- package/dist/backends-CSuLl0YP.mjs +59 -0
- package/dist/backends-CSuLl0YP.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
- package/dist/bundler--fyybf1N.mjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
- package/dist/bundler-By6_sXiL.cjs.map +1 -0
- package/dist/{config-C21ocYNd.cjs → config-Cvr5fCbn.cjs} +210 -210
- package/dist/config-Cvr5fCbn.cjs.map +1 -0
- package/dist/{config-WRdsQYZK.mjs → config-SOkDH-n1.mjs} +143 -154
- package/dist/config-SOkDH-n1.mjs.map +1 -0
- package/dist/config.cjs +9 -6
- package/dist/config.d.cts +62 -33
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +62 -33
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +3 -3
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-CAlFgYec.mjs → discover-Cf2jAcgF.mjs} +56 -63
- package/dist/discover-Cf2jAcgF.mjs.map +1 -0
- package/dist/{discover-DTmFeloL.cjs → discover-DXNviAh-.cjs} +86 -110
- package/dist/discover-DXNviAh-.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
- package/dist/emit-C1e8qD08.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
- package/dist/emit-Dmc1nvdS.cjs.map +1 -0
- package/dist/encryption-Bt8SHRI6.cjs +91 -0
- package/dist/encryption-Bt8SHRI6.cjs.map +1 -0
- package/dist/encryption-DRCXp-U4.mjs +90 -0
- package/dist/encryption-DRCXp-U4.mjs.map +1 -0
- package/dist/github-BGx4U61b.cjs +213 -0
- package/dist/github-BGx4U61b.cjs.map +1 -0
- package/dist/github-U_frvZgD.mjs +213 -0
- package/dist/github-U_frvZgD.mjs.map +1 -0
- package/dist/{index-CHB4tSzX.d.cts → index-DYh5TrsZ.d.mts} +4 -23
- package/dist/index-DYh5TrsZ.d.mts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-fU3qHy7c.d.cts} +4 -23
- package/dist/index-fU3qHy7c.d.cts.map +1 -0
- package/dist/index.cjs +9561 -7232
- 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 +9479 -7177
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-dx4I0epp.cjs +743 -0
- package/dist/migrate-dx4I0epp.cjs.map +1 -0
- package/dist/migrate-soUQtku3.mjs +736 -0
- package/dist/migrate-soUQtku3.mjs.map +1 -0
- package/dist/openapi.cjs +198 -8
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +53 -15
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +53 -15
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +193 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/ready-WfT-eWlm.mjs +861 -0
- package/dist/ready-WfT-eWlm.mjs.map +1 -0
- package/dist/ready-lr2Fm-ep.cjs +932 -0
- package/dist/ready-lr2Fm-ep.cjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +30 -33
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +30 -33
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/storage-BzaUxmqe.mjs +124 -0
- package/dist/storage-BzaUxmqe.mjs.map +1 -0
- package/dist/storage-CSGoC3bK.cjs +152 -0
- package/dist/storage-CSGoC3bK.cjs.map +1 -0
- package/dist/store-DQgxT_WR.cjs +211 -0
- package/dist/store-DQgxT_WR.cjs.map +1 -0
- package/dist/store-DeGATCS-.mjs +182 -0
- package/dist/store-DeGATCS-.mjs.map +1 -0
- package/dist/types-CT0ymlBk.d.mts +6230 -0
- package/dist/types-CT0ymlBk.d.mts.map +1 -0
- package/dist/types-DYDT4FfE.d.cts +6231 -0
- package/dist/types-DYDT4FfE.d.cts.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workspace/index.cjs +3 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{workspace-BcucjwvA.cjs → workspace-BcCiLzTO.cjs} +1040 -1120
- package/dist/workspace-BcCiLzTO.cjs.map +1 -0
- package/dist/{credentials-BBIRJVp4.mjs → workspace-Dp2zK_Nk.mjs} +2212 -1732
- package/dist/workspace-Dp2zK_Nk.mjs.map +1 -0
- package/dist/{credentials-G1JwBoXH.cjs → workspace-GBzR_hID.cjs} +2348 -1849
- package/dist/workspace-GBzR_hID.cjs.map +1 -0
- package/dist/{workspace-BFMrAKqI.mjs → workspace-bOsks1uk.mjs} +871 -974
- package/dist/workspace-bOsks1uk.mjs.map +1 -0
- package/package.json +29 -20
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-C21ocYNd.cjs.map +0 -1
- package/dist/config-WRdsQYZK.mjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BBIRJVp4.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-G1JwBoXH.cjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-CHB4tSzX.d.cts.map +0 -1
- package/dist/openapi-CA0yJUTN.cjs.map +0 -1
- package/dist/openapi-kkQbsRVj.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-B5_oHHUj.cjs +0 -11
- package/dist/setup-Cm2UnAdh.cjs +0 -473
- package/dist/setup-Cm2UnAdh.cjs.map +0 -1
- package/dist/setup-DXvRLTZN.mjs +0 -443
- package/dist/setup-DXvRLTZN.mjs.map +0 -1
- package/dist/setup-ZijS4qeC.mjs +0 -11
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-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-BFMrAKqI.mjs.map +0 -1
- package/dist/workspace-BcucjwvA.cjs.map +0 -1
- package/dist/workspace-DdJss8I6.cjs +0 -9
- package/dist/workspace-k4l3rsFh.mjs +0 -8
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { discover } from "./discover-
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync,
|
|
4
|
-
import { dirname, join, parse } from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { t as discover } from "./discover-Cf2jAcgF.mjs";
|
|
2
|
+
import { h as isWorkspaceConfig, l as processConfig, o as getAppGkmConfig, t as allConstructGlobs } from "./workspace-bOsks1uk.mjs";
|
|
3
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
4
|
+
import { dirname, join, parse, resolve, sep } from "node:path";
|
|
5
|
+
import { kebabCase } from "@geekmidas/manifest";
|
|
7
6
|
//#region src/workspace/derive.ts
|
|
7
|
+
/**
|
|
8
|
+
* The apps a manifest implies.
|
|
9
|
+
*
|
|
10
|
+
* `gkm.config.ts` used to carry an `apps` block naming every app: its type, its
|
|
11
|
+
* path, its port, its framework, which other apps it depended on. Every one of
|
|
12
|
+
* those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`
|
|
13
|
+
* and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',
|
|
14
|
+
* dependencies: ['api'] }` are the same statement written twice, and only one of
|
|
15
|
+
* them was checked against anything — so the copy in config was free to drift,
|
|
16
|
+
* and a surface config had no entry for simply never deployed.
|
|
17
|
+
*
|
|
18
|
+
* So the list comes from the graph. A `site` is an app, and so is every
|
|
19
|
+
* `rest-api` — one surface, one container, at the `path` it declared.
|
|
20
|
+
*
|
|
21
|
+
* What config still supplies is what no graph can answer: the backends a cache
|
|
22
|
+
* and a mailer resolve to, the deploy endpoint, the stage's domain.
|
|
23
|
+
*/
|
|
8
24
|
/** Which frontend framework builds each site variant. */
|
|
9
25
|
const FRAMEWORKS = {
|
|
10
26
|
static: "vite",
|
|
@@ -76,73 +92,23 @@ function markRoot(apps) {
|
|
|
76
92
|
const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
|
|
77
93
|
if (chosen) chosen[1].root = true;
|
|
78
94
|
}
|
|
79
|
-
/**
|
|
80
|
-
* What `app: true` means, and what the object form leaves out.
|
|
81
|
-
*
|
|
82
|
-
* Both fields follow from the construct's own id, so neither was worth making
|
|
83
|
-
* someone write down:
|
|
84
|
-
*
|
|
85
|
-
* - `path` is `apps/<kebab-id>` where that directory exists, and the workspace
|
|
86
|
-
* root otherwise. `Api` means `apps/api` in a monorepo and `.` in a
|
|
87
|
-
* single-app project, and which of the two you are in is answerable by
|
|
88
|
-
* looking.
|
|
89
|
-
* - `code` is the conventional directories under `path`. A glob is worth
|
|
90
|
-
* writing only when the code is somewhere else, which is the case the field
|
|
91
|
-
* still exists for.
|
|
92
|
-
*
|
|
93
|
-
* A site takes no `code`: its build is its framework's, not ours.
|
|
94
|
-
*/
|
|
95
|
-
/**
|
|
96
|
-
* Where an app lives when it did not say.
|
|
97
|
-
*
|
|
98
|
-
* `apps/<kebab-id>`, which is what the id already said — or the project root
|
|
99
|
-
* when there is no `apps/` at all, because then there is one app and it is the
|
|
100
|
-
* project.
|
|
101
|
-
*
|
|
102
|
-
* In between, it refuses. A workspace *with* an `apps/` directory and no
|
|
103
|
-
* `apps/<key>` in it is a construct naming a directory nobody wrote, and
|
|
104
|
-
* quietly answering `.` there makes the app the whole repository: the build
|
|
105
|
-
* filters turbo on the root `package.json` and builds the wrong thing, or
|
|
106
|
-
* itself. A missing directory is a typo or an unconventional layout, and both
|
|
107
|
-
* want saying out loud.
|
|
108
|
-
*/
|
|
109
|
-
function conventionalPath(id, workspaceRoot) {
|
|
110
|
-
const conventional = join("apps", appKey(id));
|
|
111
|
-
if (existsSync(join(workspaceRoot, conventional))) return conventional;
|
|
112
|
-
if (!existsSync(join(workspaceRoot, "apps"))) return ".";
|
|
113
|
-
throw new MisplacedApp(id, conventional);
|
|
114
|
-
}
|
|
115
|
-
/** A construct whose directory is not where its id says it is. */
|
|
116
|
-
var MisplacedApp = class extends Error {
|
|
117
|
-
constructor(construct, expected) {
|
|
118
|
-
super(`"${construct}" has no directory at ${expected}.\nCreate it, or say where it lives:\n new StaticSite('${construct}', { path: 'sites/${appKey(construct)}' })\n new RestApi('${construct}', { …, app: { path: 'services/${appKey(construct)}' } })`);
|
|
119
|
-
this.construct = construct;
|
|
120
|
-
this.expected = expected;
|
|
121
|
-
this.name = "MisplacedApp";
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
function resolveAppSpec(id, spec, workspaceRoot, kind) {
|
|
125
|
-
const path = spec.path ?? conventionalPath(id, workspaceRoot);
|
|
126
|
-
const givenAGlob = spec.code !== void 0 || spec.routes !== void 0 || spec.functions !== void 0 || spec.crons !== void 0 || spec.queues !== void 0 || spec.topics !== void 0 || spec.subscribers !== void 0;
|
|
127
|
-
return {
|
|
128
|
-
...spec,
|
|
129
|
-
path,
|
|
130
|
-
...kind !== "site" && !givenAGlob ? { code: DEFAULT_APP_CODE } : {}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
95
|
function derivedApps(manifest, workspace) {
|
|
134
96
|
const apps = {};
|
|
135
97
|
const defaultTarget = workspace.deploy?.default ?? "dokploy";
|
|
136
98
|
for (const [id, declaration] of Object.entries(manifest)) {
|
|
137
|
-
if (declaration.kind !== "site" && declaration.kind !== "
|
|
138
|
-
const spec =
|
|
99
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api") continue;
|
|
100
|
+
const spec = declaration.kind === "site" || declaration.kind === "mobile-app" ? declaration.app : {
|
|
101
|
+
path: declaration.path,
|
|
102
|
+
...declaration.telescope ? { telescope: true } : {}
|
|
103
|
+
};
|
|
139
104
|
const name = appKey(id);
|
|
140
105
|
const configured = workspace.apps[name];
|
|
141
106
|
apps[name] = {
|
|
142
107
|
...configured,
|
|
143
|
-
type: declaration.kind === "site" ? "web" : "backend",
|
|
108
|
+
type: declaration.kind === "site" ? "web" : declaration.kind === "mobile-app" ? "mobile" : "backend",
|
|
144
109
|
path: spec.path,
|
|
145
110
|
port: spec.port ?? configured?.port ?? 0,
|
|
111
|
+
...(declaration.kind === "rest-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
|
|
146
112
|
dependencies: [],
|
|
147
113
|
resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
|
|
148
114
|
...declaration.kind === "site" ? {
|
|
@@ -150,22 +116,10 @@ function derivedApps(manifest, workspace) {
|
|
|
150
116
|
...declaration.root ? { root: true } : {},
|
|
151
117
|
...spec.config ? { config: spec.config } : {}
|
|
152
118
|
} : {},
|
|
153
|
-
...
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
crons: spec.code,
|
|
157
|
-
queues: spec.code,
|
|
158
|
-
topics: spec.code,
|
|
159
|
-
subscribers: spec.code
|
|
119
|
+
...declaration.kind === "mobile-app" ? {
|
|
120
|
+
framework: configured?.framework ?? declaration.variant,
|
|
121
|
+
...spec.config ? { config: spec.config } : {}
|
|
160
122
|
} : {},
|
|
161
|
-
...spec.routes !== void 0 ? { routes: spec.routes } : {},
|
|
162
|
-
...spec.functions !== void 0 ? { functions: spec.functions } : {},
|
|
163
|
-
...spec.crons !== void 0 ? { crons: spec.crons } : {},
|
|
164
|
-
...spec.queues !== void 0 ? { queues: spec.queues } : {},
|
|
165
|
-
...spec.topics !== void 0 ? { topics: spec.topics } : {},
|
|
166
|
-
...spec.subscribers !== void 0 ? { subscribers: spec.subscribers } : {},
|
|
167
|
-
...spec.envParser !== void 0 ? { envParser: spec.envParser } : {},
|
|
168
|
-
...spec.logger !== void 0 ? { logger: spec.logger } : {},
|
|
169
123
|
...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
|
|
170
124
|
...spec.studio !== void 0 ? { studio: spec.studio } : {},
|
|
171
125
|
...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
|
|
@@ -176,7 +130,7 @@ function derivedApps(manifest, workspace) {
|
|
|
176
130
|
};
|
|
177
131
|
}
|
|
178
132
|
for (const [id, declaration] of Object.entries(manifest)) {
|
|
179
|
-
if (declaration.kind !== "site" && declaration.kind !== "
|
|
133
|
+
if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api") continue;
|
|
180
134
|
const app = apps[appKey(id)];
|
|
181
135
|
if (!app) continue;
|
|
182
136
|
const edges = declaration.kind === "rest-api" ? declaration.calls ?? [] : declaration.dependencies ?? [];
|
|
@@ -195,7 +149,6 @@ function derivedApps(manifest, workspace) {
|
|
|
195
149
|
for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
|
|
196
150
|
return apps;
|
|
197
151
|
}
|
|
198
|
-
|
|
199
152
|
//#endregion
|
|
200
153
|
//#region src/config.ts
|
|
201
154
|
/**
|
|
@@ -239,10 +192,9 @@ function parseModuleConfig(configString, defaultAlias) {
|
|
|
239
192
|
const parts = configString.split("#");
|
|
240
193
|
const path = parts[0] ?? configString;
|
|
241
194
|
const exportName = parts[1];
|
|
242
|
-
const importPattern = !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`;
|
|
243
195
|
return {
|
|
244
196
|
path,
|
|
245
|
-
importPattern
|
|
197
|
+
importPattern: !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`
|
|
246
198
|
};
|
|
247
199
|
}
|
|
248
200
|
/**
|
|
@@ -275,39 +227,25 @@ function findConfigPath(cwd) {
|
|
|
275
227
|
}
|
|
276
228
|
currentDir = dirname(currentDir);
|
|
277
229
|
}
|
|
278
|
-
throw new
|
|
230
|
+
throw new ConfigNotFound(cwd);
|
|
279
231
|
}
|
|
280
|
-
/**
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
* // Returns: 'api'
|
|
288
|
-
*/
|
|
289
|
-
function getAppNameFromCwd(cwd = process.cwd()) {
|
|
290
|
-
const packageJsonPath = join(cwd, "package.json");
|
|
291
|
-
if (!existsSync(packageJsonPath)) return null;
|
|
292
|
-
try {
|
|
293
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
294
|
-
const name = packageJson.name;
|
|
295
|
-
if (!name) return null;
|
|
296
|
-
if (name.startsWith("@") && name.includes("/")) return name.split("/")[1] ?? null;
|
|
297
|
-
return name;
|
|
298
|
-
} catch {
|
|
299
|
-
return null;
|
|
232
|
+
/** No gkm config in a directory or any of its parents. */
|
|
233
|
+
var ConfigNotFound = class extends Error {
|
|
234
|
+
cwd;
|
|
235
|
+
constructor(cwd) {
|
|
236
|
+
super("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
|
|
237
|
+
this.cwd = cwd;
|
|
238
|
+
this.name = "ConfigNotFound";
|
|
300
239
|
}
|
|
301
|
-
}
|
|
240
|
+
};
|
|
302
241
|
/**
|
|
303
242
|
* Load raw configuration from file.
|
|
304
243
|
*/
|
|
305
244
|
async function loadRawConfig(cwd) {
|
|
306
245
|
const { configPath, workspaceRoot } = findConfigPath(cwd);
|
|
307
246
|
try {
|
|
308
|
-
const config = await import(configPath);
|
|
309
247
|
return {
|
|
310
|
-
config:
|
|
248
|
+
config: (await import(configPath)).default,
|
|
311
249
|
workspaceRoot
|
|
312
250
|
};
|
|
313
251
|
} catch (error) {
|
|
@@ -342,6 +280,19 @@ async function loadConfig(cwd = process.cwd()) {
|
|
|
342
280
|
* }
|
|
343
281
|
* ```
|
|
344
282
|
*/
|
|
283
|
+
/**
|
|
284
|
+
* The workspace a directory belongs to, as its config states it — without
|
|
285
|
+
* discovering its constructs.
|
|
286
|
+
*
|
|
287
|
+
* For callers that need a fact the config holds (where a stage's secrets are
|
|
288
|
+
* stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
|
|
289
|
+
* construct module to derive the apps, which is a cost a secrets read should
|
|
290
|
+
* not pay.
|
|
291
|
+
*/
|
|
292
|
+
async function loadWorkspaceSettings(cwd = process.cwd()) {
|
|
293
|
+
const { config, workspaceRoot } = await loadRawConfig(cwd);
|
|
294
|
+
return processConfig(config, workspaceRoot).workspace;
|
|
295
|
+
}
|
|
345
296
|
async function loadWorkspaceConfig(cwd = process.cwd()) {
|
|
346
297
|
const { config, workspaceRoot } = await loadRawConfig(cwd);
|
|
347
298
|
return withDerivedApps(processConfig(config, workspaceRoot));
|
|
@@ -367,7 +318,7 @@ async function loadWorkspaceConfig(cwd = process.cwd()) {
|
|
|
367
318
|
*/
|
|
368
319
|
async function withDerivedApps(loaded) {
|
|
369
320
|
const globs = allConstructGlobs(loaded.workspace);
|
|
370
|
-
if (globs.length === 0)
|
|
321
|
+
if (globs.length === 0) throw new WorkspaceDeclaresNoConstructs(loaded.workspace.root);
|
|
371
322
|
try {
|
|
372
323
|
const manifest = await discover({
|
|
373
324
|
patterns: globs,
|
|
@@ -388,82 +339,120 @@ async function withDerivedApps(loaded) {
|
|
|
388
339
|
}
|
|
389
340
|
}
|
|
390
341
|
/**
|
|
391
|
-
*
|
|
342
|
+
* A workspace with no `constructs` glob.
|
|
392
343
|
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* comes from the workspace — including the URLs its constructs declare.
|
|
344
|
+
* In v10 every address, container and app comes from what the workspace
|
|
345
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
346
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
397
347
|
*/
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
348
|
+
var WorkspaceDeclaresNoConstructs = class extends Error {
|
|
349
|
+
root;
|
|
350
|
+
constructor(root) {
|
|
351
|
+
super(`The workspace at ${root} declares no constructs. Every workspace names where its constructs live — \`constructs: ['./constructs/**/*.ts', './apps/*/endpoints/**/*.ts']\` in gkm.config.ts — and its apps, containers and URLs are derived from them.`);
|
|
352
|
+
this.root = root;
|
|
353
|
+
this.name = "WorkspaceDeclaresNoConstructs";
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* The app a directory is part of: the one whose `path` contains it.
|
|
358
|
+
*
|
|
359
|
+
* An app's path is the one its construct declares — `new RestApi('Api',
|
|
360
|
+
* { path: 'apps/api' })` — read off the workspace the constructs were derived
|
|
361
|
+
* into, never off the filesystem's package names. The deepest match wins, so
|
|
362
|
+
* an app inside another app's folder is its own; the workspace root belongs to
|
|
363
|
+
* no app unless one lives there.
|
|
364
|
+
*/
|
|
365
|
+
function resolveWorkspaceApp(loadedConfig, cwd) {
|
|
366
|
+
const here = real(cwd);
|
|
367
|
+
let found;
|
|
368
|
+
for (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {
|
|
369
|
+
const dir = real(join(loadedConfig.workspace.root, app.path));
|
|
370
|
+
if ((here === dir || here.startsWith(`${dir}${sep}`)) && (!found || dir.length > found.dir.length)) found = {
|
|
371
|
+
key,
|
|
372
|
+
app,
|
|
373
|
+
dir
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
return found && {
|
|
377
|
+
key: found.key,
|
|
378
|
+
app: found.app
|
|
404
379
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const
|
|
409
|
-
return
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
380
|
+
}
|
|
381
|
+
/** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */
|
|
382
|
+
function real(path) {
|
|
383
|
+
const absolute = resolve(path);
|
|
384
|
+
return existsSync(absolute) ? realpathSync(absolute) : absolute;
|
|
385
|
+
}
|
|
386
|
+
/** A directory that no app in the workspace lives in. */
|
|
387
|
+
var NotInAnApp = class extends Error {
|
|
388
|
+
cwd;
|
|
389
|
+
apps;
|
|
390
|
+
constructor(cwd, apps) {
|
|
391
|
+
super(`${cwd} is not inside any app's path. Apps: ` + Object.entries(apps).map(([key, path]) => `${key} (${path})`).join(", ") + ".");
|
|
392
|
+
this.cwd = cwd;
|
|
393
|
+
this.apps = apps;
|
|
394
|
+
this.name = "NotInAnApp";
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
/** Every app's path, by key — what `NotInAnApp` lists. */
|
|
398
|
+
function appPaths(loadedConfig) {
|
|
399
|
+
return Object.fromEntries(Object.entries(loadedConfig.workspace.apps).map(([key, app]) => [key, app.path]));
|
|
413
400
|
}
|
|
414
401
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
402
|
+
* The backend app a directory is part of, with its gkm config — found by the
|
|
403
|
+
* `path` its construct declares.
|
|
417
404
|
*
|
|
418
405
|
* @example
|
|
419
406
|
* ```ts
|
|
420
|
-
* // From apps/api
|
|
407
|
+
* // From apps/api, where a construct declares `path: 'apps/api'`
|
|
421
408
|
* const { app, workspace, workspaceRoot } = await loadAppConfig();
|
|
422
|
-
* console.log(app.routes); // './src/endpoints/**\/*.ts'
|
|
423
409
|
* ```
|
|
410
|
+
*
|
|
411
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
412
|
+
* @throws {NotABackendApp} when the app it is in has no gkm config to run.
|
|
424
413
|
*/
|
|
425
414
|
async function loadAppConfig(cwd = process.cwd()) {
|
|
426
|
-
const appName =
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
const loadedConfig = await withDerivedApps(processConfig(config, workspaceRoot));
|
|
430
|
-
const resolved = resolveWorkspaceApp(loadedConfig, appName);
|
|
431
|
-
if (!resolved) throw new Error(`App "${appName}" not found in workspace config. Available apps: ${Object.keys(loadedConfig.workspace.apps).join(", ")}. Ensure the package.json name matches the app key in gkm.config.ts.`);
|
|
432
|
-
const { key, app } = resolved;
|
|
433
|
-
const gkmConfig = getAppGkmConfig(loadedConfig.workspace, key);
|
|
434
|
-
if (!gkmConfig) throw new Error(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
|
|
415
|
+
const { appName, app, workspace, workspaceRoot } = await loadWorkspaceAppInfo(cwd);
|
|
416
|
+
const gkmConfig = getAppGkmConfig(workspace, appName);
|
|
417
|
+
if (!gkmConfig) throw new NotABackendApp(appName);
|
|
435
418
|
return {
|
|
436
419
|
appName,
|
|
437
420
|
app,
|
|
438
421
|
gkmConfig,
|
|
439
|
-
workspace
|
|
422
|
+
workspace,
|
|
440
423
|
workspaceRoot,
|
|
441
424
|
appRoot: join(workspaceRoot, app.path)
|
|
442
425
|
};
|
|
443
426
|
}
|
|
427
|
+
/** The app a directory is in has no gkm config — a site, or an entry app. */
|
|
428
|
+
var NotABackendApp = class extends Error {
|
|
429
|
+
appName;
|
|
430
|
+
constructor(appName) {
|
|
431
|
+
super(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
|
|
432
|
+
this.appName = appName;
|
|
433
|
+
this.name = "NotABackendApp";
|
|
434
|
+
}
|
|
435
|
+
};
|
|
444
436
|
/**
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
437
|
+
* The app a directory is part of, frontend or backend — found by the `path`
|
|
438
|
+
* its construct declares. Unlike `loadAppConfig`, the app need not have a
|
|
439
|
+
* gkm config, which is what `gkm exec` and `gkm test` from a site need.
|
|
440
|
+
*
|
|
441
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
448
442
|
*/
|
|
449
443
|
async function loadWorkspaceAppInfo(cwd = process.cwd()) {
|
|
450
|
-
const appName = getAppNameFromCwd(cwd);
|
|
451
|
-
if (!appName) throw new Error("Could not determine app name. Ensure package.json exists with a \"name\" field.");
|
|
452
444
|
const { config, workspaceRoot } = await loadRawConfig(cwd);
|
|
453
445
|
const loadedConfig = await withDerivedApps(processConfig(config, workspaceRoot));
|
|
454
|
-
const resolved = resolveWorkspaceApp(loadedConfig,
|
|
455
|
-
if (!resolved)
|
|
456
|
-
const availableApps = Object.keys(loadedConfig.workspace.apps).join(", ");
|
|
457
|
-
throw new Error(`App "${appName}" not found in workspace config. Available apps: ${availableApps}. Ensure the package.json name matches the app key in gkm.config.ts.`);
|
|
458
|
-
}
|
|
446
|
+
const resolved = resolveWorkspaceApp(loadedConfig, cwd);
|
|
447
|
+
if (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));
|
|
459
448
|
return {
|
|
460
|
-
appName,
|
|
449
|
+
appName: resolved.key,
|
|
461
450
|
app: resolved.app,
|
|
462
451
|
workspace: loadedConfig.workspace,
|
|
463
452
|
workspaceRoot
|
|
464
453
|
};
|
|
465
454
|
}
|
|
466
|
-
|
|
467
455
|
//#endregion
|
|
468
|
-
export {
|
|
469
|
-
|
|
456
|
+
export { defineConfig as a, loadWorkspaceAppInfo as c, parseModuleConfig as d, appKey as f, WorkspaceDeclaresNoConstructs as i, loadWorkspaceConfig as l, NotABackendApp as n, loadAppConfig as o, derivedApps as p, NotInAnApp as r, loadConfig as s, ConfigNotFound as t, loadWorkspaceSettings as u };
|
|
457
|
+
|
|
458
|
+
//# sourceMappingURL=config-SOkDH-n1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-SOkDH-n1.mjs","names":[],"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// Three kinds are apps: a site, a mobile app and an HTTP surface. A worker\n\t\t// is not one — it names the process that runs a cron or a subscriber, and\n\t\t// that process is the app's server, which already exists. Everything else\n\t\t// is a resource one of them uses.\n\t\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api'\n\t\t)\n\t\t\tcontinue;\n\n\t\t// No opt-in to be had. Each says where it lives.\n\t\tconst spec: AppSpec =\n\t\t\tdeclaration.kind === 'site' || declaration.kind === 'mobile-app'\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:\n\t\t\t\tdeclaration.kind === 'site'\n\t\t\t\t\t? 'web'\n\t\t\t\t\t: declaration.kind === 'mobile-app'\n\t\t\t\t\t\t? 'mobile'\n\t\t\t\t\t\t: 'backend',\n\t\t\tpath: spec.path,\n\t\t\tport: spec.port ?? configured?.port ?? 0,\n\t\t\t// The label it answers on, under a stage's domain and locally alike.\n\t\t\t...((declaration.kind === 'rest-api' || declaration.kind === 'site') &&\n\t\t\tdeclaration.subdomain\n\t\t\t\t? { subdomain: declaration.subdomain }\n\t\t\t\t: {}),\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...(declaration.kind === 'mobile-app'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? declaration.variant,\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\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api'\n\t\t)\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, realpathSync } from 'node:fs';\nimport { dirname, join, parse, resolve, sep } 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 ConfigNotFound(cwd);\n}\n\n/** No gkm config in a directory or any of its parents. */\nexport class ConfigNotFound extends Error {\n\tconstructor(readonly cwd: string) {\n\t\tsuper(\n\t\t\t'Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.',\n\t\t);\n\t\tthis.name = 'ConfigNotFound';\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 */\n/**\n * The workspace a directory belongs to, as its config states it — without\n * discovering its constructs.\n *\n * For callers that need a fact the config holds (where a stage's secrets are\n * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every\n * construct module to derive the apps, which is a cost a secrets read should\n * not pay.\n */\nexport async function loadWorkspaceSettings(\n\tcwd: string = process.cwd(),\n): Promise<LoadedConfig['workspace']> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\treturn processConfig(config, workspaceRoot).workspace;\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 directory is part of: the one whose `path` contains it.\n *\n * An app's path is the one its construct declares — `new RestApi('Api',\n * { path: 'apps/api' })` — read off the workspace the constructs were derived\n * into, never off the filesystem's package names. The deepest match wins, so\n * an app inside another app's folder is its own; the workspace root belongs to\n * no app unless one lives there.\n */\nfunction resolveWorkspaceApp(\n\tloadedConfig: LoadedConfig,\n\tcwd: string,\n): { key: string; app: NormalizedAppConfig } | undefined {\n\tconst here = real(cwd);\n\tlet found: { key: string; app: NormalizedAppConfig; dir: string } | undefined;\n\n\tfor (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {\n\t\tconst dir = real(join(loadedConfig.workspace.root, app.path));\n\t\tconst inside = here === dir || here.startsWith(`${dir}${sep}`);\n\t\tif (inside && (!found || dir.length > found.dir.length)) {\n\t\t\tfound = { key, app, dir };\n\t\t}\n\t}\n\n\treturn found && { key: found.key, app: found.app };\n}\n\n/** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */\nfunction real(path: string): string {\n\tconst absolute = resolve(path);\n\treturn existsSync(absolute) ? realpathSync(absolute) : absolute;\n}\n\n/** A directory that no app in the workspace lives in. */\nexport class NotInAnApp extends Error {\n\tconstructor(\n\t\treadonly cwd: string,\n\t\treadonly apps: Readonly<Record<string, string>>,\n\t) {\n\t\tsuper(\n\t\t\t`${cwd} is not inside any app's path. Apps: ` +\n\t\t\t\tObject.entries(apps)\n\t\t\t\t\t.map(([key, path]) => `${key} (${path})`)\n\t\t\t\t\t.join(', ') +\n\t\t\t\t'.',\n\t\t);\n\t\tthis.name = 'NotInAnApp';\n\t}\n}\n\n/** Every app's path, by key — what `NotInAnApp` lists. */\nfunction appPaths(loadedConfig: LoadedConfig): Record<string, string> {\n\treturn Object.fromEntries(\n\t\tObject.entries(loadedConfig.workspace.apps).map(([key, app]) => [\n\t\t\tkey,\n\t\t\tapp.path,\n\t\t]),\n\t);\n}\n\n/**\n * The backend app a directory is part of, with its gkm config — found by the\n * `path` its construct declares.\n *\n * @example\n * ```ts\n * // From apps/api, where a construct declares `path: 'apps/api'`\n * const { app, workspace, workspaceRoot } = await loadAppConfig();\n * ```\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n * @throws {NotABackendApp} when the app it is in has no gkm config to run.\n */\nexport async function loadAppConfig(\n\tcwd: string = process.cwd(),\n): Promise<AppConfigResult> {\n\tconst { appName, app, workspace, workspaceRoot } =\n\t\tawait loadWorkspaceAppInfo(cwd);\n\n\tconst gkmConfig = getAppGkmConfig(workspace, appName);\n\tif (!gkmConfig) throw new NotABackendApp(appName);\n\n\treturn {\n\t\tappName,\n\t\tapp,\n\t\tgkmConfig,\n\t\tworkspace,\n\t\tworkspaceRoot,\n\t\tappRoot: join(workspaceRoot, app.path),\n\t};\n}\n\n/** The app a directory is in has no gkm config — a site, or an entry app. */\nexport class NotABackendApp extends Error {\n\tconstructor(readonly appName: string) {\n\t\tsuper(\n\t\t\t`App \"${appName}\" is not a backend app and cannot be run with gkm dev.`,\n\t\t);\n\t\tthis.name = 'NotABackendApp';\n\t}\n}\n\nexport interface WorkspaceAppInfo {\n\t/** The app's key in the workspace. */\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n}\n\n/**\n * The app a directory is part of, frontend or backend — found by the `path`\n * its construct declares. Unlike `loadAppConfig`, the app need not have a\n * gkm config, which is what `gkm exec` and `gkm test` from a site need.\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n */\nexport async function loadWorkspaceAppInfo(\n\tcwd: string = process.cwd(),\n): Promise<WorkspaceAppInfo> {\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, cwd);\n\tif (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));\n\n\treturn {\n\t\tappName: resolved.key,\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,OAAO,UAAU,EAAE;AACpB;;;;;;;;;AAUA,SAAgB,OACf,UACA,IACqB;CACrB,MAAM,cAAc,SAAS;CAC7B,IAAI,CAAC,eAAe,YAAY,SAA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AAS,SAAS;EAClB,KAAK,SAAS;EACd,WAAW,aAAa;EACxB;CACD;AACD"}
|
package/dist/config.cjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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-Cvr5fCbn.cjs");
|
|
3
|
+
const require_workspace = require("./workspace-BcCiLzTO.cjs");
|
|
4
|
+
exports.ConfigNotFound = require_config.ConfigNotFound;
|
|
5
|
+
exports.NotABackendApp = require_config.NotABackendApp;
|
|
6
|
+
exports.NotInAnApp = require_config.NotInAnApp;
|
|
7
|
+
exports.WorkspaceDeclaresNoConstructs = require_config.WorkspaceDeclaresNoConstructs;
|
|
5
8
|
exports.defineConfig = require_config.defineConfig;
|
|
6
9
|
exports.defineWorkspace = require_workspace.defineWorkspace;
|
|
7
|
-
exports.getAppNameFromCwd = require_config.getAppNameFromCwd;
|
|
8
10
|
exports.loadAppConfig = require_config.loadAppConfig;
|
|
9
11
|
exports.loadConfig = require_config.loadConfig;
|
|
10
12
|
exports.loadWorkspaceAppInfo = require_config.loadWorkspaceAppInfo;
|
|
11
13
|
exports.loadWorkspaceConfig = require_config.loadWorkspaceConfig;
|
|
12
|
-
exports.
|
|
14
|
+
exports.loadWorkspaceSettings = require_config.loadWorkspaceSettings;
|
|
15
|
+
exports.parseModuleConfig = require_config.parseModuleConfig;
|