@geekmidas/cli 10.0.0-alpha.63 → 10.0.0-alpha.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HostingerProvider-mJ7YruxH.cjs → HostingerProvider-Bx2lHHvu.cjs} +3 -3
- package/dist/{HostingerProvider-mJ7YruxH.cjs.map → HostingerProvider-Bx2lHHvu.cjs.map} +1 -1
- package/dist/{HostingerProvider-DBBwpDjn.mjs → HostingerProvider-Cd4aS5Kj.mjs} +2 -2
- package/dist/{HostingerProvider-DBBwpDjn.mjs.map → HostingerProvider-Cd4aS5Kj.mjs.map} +1 -1
- package/dist/{LegacyStateStore-CP7SZwTP.cjs → LegacyStateStore-C2abV49N.cjs} +2 -2
- package/dist/{LegacyStateStore-CP7SZwTP.cjs.map → LegacyStateStore-C2abV49N.cjs.map} +1 -1
- package/dist/{LegacyStateStore-Q3GmKOdw.mjs → LegacyStateStore-DIgkGaUP.mjs} +2 -2
- package/dist/{LegacyStateStore-Q3GmKOdw.mjs.map → LegacyStateStore-DIgkGaUP.mjs.map} +1 -1
- package/dist/{LocalStateStore-BGIXcrvX.mjs → LocalStateStore-Cy1ZBW7U.mjs} +2 -2
- package/dist/{LocalStateStore-BGIXcrvX.mjs.map → LocalStateStore-Cy1ZBW7U.mjs.map} +1 -1
- package/dist/{LocalStateStore-sS8mvLeq.cjs → LocalStateStore-DiJqKyPy.cjs} +2 -2
- package/dist/{LocalStateStore-sS8mvLeq.cjs.map → LocalStateStore-DiJqKyPy.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-CjHWFRDd.cjs → OpenApiTsGenerator-BWuDRHe9.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-CjHWFRDd.cjs.map → OpenApiTsGenerator-BWuDRHe9.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-CnAwhGxi.mjs → OpenApiTsGenerator-C6v-IeHt.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-CnAwhGxi.mjs.map → OpenApiTsGenerator-C6v-IeHt.mjs.map} +1 -1
- package/dist/{S3StateStore-D7l_lWJ3.mjs → S3StateStore-D3x6ivBL.mjs} +2 -2
- package/dist/{S3StateStore-D7l_lWJ3.mjs.map → S3StateStore-D3x6ivBL.mjs.map} +1 -1
- package/dist/{S3StateStore-6jqITH2F.cjs → S3StateStore-Ds0V1Lgm.cjs} +2 -2
- package/dist/{S3StateStore-6jqITH2F.cjs.map → S3StateStore-Ds0V1Lgm.cjs.map} +1 -1
- package/dist/{SSMStateStore-B__F7IJa.cjs → SSMStateStore-CLipvx47.cjs} +2 -2
- package/dist/{SSMStateStore-B__F7IJa.cjs.map → SSMStateStore-CLipvx47.cjs.map} +1 -1
- package/dist/{SSMStateStore-CAQDVpoc.mjs → SSMStateStore-DfF174xQ.mjs} +2 -2
- package/dist/{SSMStateStore-CAQDVpoc.mjs.map → SSMStateStore-DfF174xQ.mjs.map} +1 -1
- package/dist/{bundler-DLfOn0ls.cjs → bundler-C8uJf324.cjs} +3 -3
- package/dist/{bundler-DLfOn0ls.cjs.map → bundler-C8uJf324.cjs.map} +1 -1
- package/dist/{bundler-DyWI41Iy.mjs → bundler-DYgm9xsd.mjs} +3 -3
- package/dist/{bundler-DyWI41Iy.mjs.map → bundler-DYgm9xsd.mjs.map} +1 -1
- package/dist/{cli-PkVF28LM.mjs → cli-Bogz-zEj.mjs} +5 -4
- package/dist/{cli-PkVF28LM.mjs.map → cli-Bogz-zEj.mjs.map} +1 -1
- package/dist/{cli-D-ZM-X2s.cjs → cli-D3jofJ6j.cjs} +7 -6
- package/dist/{cli-D-ZM-X2s.cjs.map → cli-D3jofJ6j.cjs.map} +1 -1
- package/dist/{config-CemHVcIr.d.cts → config-Be-4_I6H.d.cts} +3 -3
- package/dist/{config-C2BUosLm.d.mts.map → config-Be-4_I6H.d.cts.map} +1 -1
- package/dist/{config-C2BUosLm.d.mts → config-DqNRiQOp.d.mts} +3 -3
- package/dist/{config-CemHVcIr.d.cts.map → config-DqNRiQOp.d.mts.map} +1 -1
- package/dist/config.cjs +416 -17
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +401 -2
- package/dist/config.mjs.map +1 -0
- package/dist/credentials-B70vmLcm.cjs +125 -0
- package/dist/credentials-B70vmLcm.cjs.map +1 -0
- package/dist/credentials-s0wMeZBU.mjs +108 -0
- package/dist/credentials-s0wMeZBU.mjs.map +1 -0
- package/dist/{define-CHBIEc5j.mjs → define-CYs0PEfZ.mjs} +2 -3
- package/dist/define-CYs0PEfZ.mjs.map +1 -0
- package/dist/{define-Cv_QvDrg.cjs → define-zUsP72ym.cjs} +2 -3
- package/dist/define-zUsP72ym.cjs.map +1 -0
- package/dist/deploy/public.cjs +32 -26
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts +40 -4
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +40 -4
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +15 -12
- package/dist/deploy/public.mjs.map +1 -1
- package/dist/{deploy-ABBI0lf1.cjs → deploy-55rJkdKz.cjs} +17 -14
- package/dist/{deploy-ABBI0lf1.cjs.map → deploy-55rJkdKz.cjs.map} +1 -1
- package/dist/{deploy-CGW-QY9D.mjs → deploy-Dc2LBJaK.mjs} +8 -7
- package/dist/{deploy-CGW-QY9D.mjs.map → deploy-Dc2LBJaK.mjs.map} +1 -1
- package/dist/{deploy-CG8bfFij.mjs → deploy-ZRXIPp1c.mjs} +11 -8
- package/dist/{deploy-CG8bfFij.mjs.map → deploy-ZRXIPp1c.mjs.map} +1 -1
- package/dist/{deploy-BiMrP9i7.cjs → deploy-yUcR2OlW.cjs} +12 -11
- package/dist/{deploy-BiMrP9i7.cjs.map → deploy-yUcR2OlW.cjs.map} +1 -1
- package/dist/derive-B4vDpzgP.mjs +150 -0
- package/dist/derive-B4vDpzgP.mjs.map +1 -0
- package/dist/derive-DAbo49sm.cjs +161 -0
- package/dist/derive-DAbo49sm.cjs.map +1 -0
- package/dist/{discover-C_6COHEv.cjs → discover-DHdECueV.cjs} +6 -157
- package/dist/discover-DHdECueV.cjs.map +1 -0
- package/dist/{discover-BaT6bpnA.mjs → discover-LMrqsWSU.mjs} +8 -117
- package/dist/discover-LMrqsWSU.mjs.map +1 -0
- package/dist/{dokploy-CwdmlyQL.mjs → dokploy-CepdXuMl.mjs} +3 -3
- package/dist/{dokploy-CwdmlyQL.mjs.map → dokploy-CepdXuMl.mjs.map} +1 -1
- package/dist/{dokploy-QJxMhxdf.cjs → dokploy-D1d37rvM.cjs} +3 -3
- package/dist/{dokploy-QJxMhxdf.cjs.map → dokploy-D1d37rvM.cjs.map} +1 -1
- package/dist/{encryption-DXw3jj0c.cjs → encryption-C9X98u2F.cjs} +5 -5
- package/dist/{encryption-DXw3jj0c.cjs.map → encryption-C9X98u2F.cjs.map} +1 -1
- package/dist/{encryption-CbQG_ayW.mjs → encryption-CKHjMpCr.mjs} +5 -5
- package/dist/{encryption-CbQG_ayW.mjs.map → encryption-CKHjMpCr.mjs.map} +1 -1
- package/dist/{github-ciwbIwVa.mjs → github-D-byNI7T.mjs} +4 -4
- package/dist/{github-ciwbIwVa.mjs.map → github-D-byNI7T.mjs.map} +1 -1
- package/dist/{github-BH_mETav.cjs → github-Dd3tMa1u.cjs} +4 -4
- package/dist/{github-BH_mETav.cjs.map → github-Dd3tMa1u.cjs.map} +1 -1
- package/dist/{index-DrKzpHl-.d.mts → index-CJ2qsSpp.d.mts} +2 -2
- package/dist/{index-BtXDZQuF.d.cts.map → index-CJ2qsSpp.d.mts.map} +1 -1
- package/dist/{index-BtXDZQuF.d.cts → index-CfE9Y885.d.cts} +2 -2
- package/dist/{index-DrKzpHl-.d.mts.map → index-CfE9Y885.d.cts.map} +1 -1
- package/dist/index.cjs +100 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +71 -206
- package/dist/index.mjs.map +1 -1
- package/dist/local-C7wnrcYK.cjs +586 -0
- package/dist/local-C7wnrcYK.cjs.map +1 -0
- package/dist/local-Cd8ZYQG3.mjs +473 -0
- package/dist/local-Cd8ZYQG3.mjs.map +1 -0
- package/dist/{migrate-ImBKTBcW.mjs → migrate-B4gngTLe.mjs} +6 -6
- package/dist/{migrate-ImBKTBcW.mjs.map → migrate-B4gngTLe.mjs.map} +1 -1
- package/dist/{migrate-6oa9y_f2.cjs → migrate-tx9-P9uz.cjs} +6 -6
- package/dist/{migrate-6oa9y_f2.cjs.map → migrate-tx9-P9uz.cjs.map} +1 -1
- package/dist/openapi.cjs +2 -2
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +2 -2
- package/dist/{ready-Bpdnn2ON.mjs → ready-bQfu9GES.mjs} +3 -3
- package/dist/{ready-Bpdnn2ON.mjs.map → ready-bQfu9GES.mjs.map} +1 -1
- package/dist/{ready-BiG0rt4h.cjs → ready-brEhh68f.cjs} +3 -3
- package/dist/{ready-BiG0rt4h.cjs.map → ready-brEhh68f.cjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-xytBTtG4.cjs → resolve-BXsNQjMR.cjs} +9 -6
- package/dist/resolve-BXsNQjMR.cjs.map +1 -0
- package/dist/{resolve-B1T0hUaR.mjs → resolve-DZ2IJ0qY.mjs} +9 -6
- package/dist/resolve-DZ2IJ0qY.mjs.map +1 -0
- package/dist/{runtime-CMwtq0AL.cjs → runtime-BGNDrHzh.cjs} +2 -2
- package/dist/{runtime-CMwtq0AL.cjs.map → runtime-BGNDrHzh.cjs.map} +1 -1
- package/dist/{runtime-Dn_n-29S.d.cts → runtime-CJEYK4Gz.d.mts} +2 -2
- package/dist/{runtime-CXPlkZzs.d.mts.map → runtime-CJEYK4Gz.d.mts.map} +1 -1
- package/dist/{runtime-CXPlkZzs.d.mts → runtime-Cjq1jlVX.d.cts} +2 -2
- package/dist/{runtime-Dn_n-29S.d.cts.map → runtime-Cjq1jlVX.d.cts.map} +1 -1
- package/dist/{runtime-DbakJS8u.mjs → runtime-Cmn-FeYO.mjs} +2 -2
- package/dist/{runtime-DbakJS8u.mjs.map → runtime-Cmn-FeYO.mjs.map} +1 -1
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox-CL--ZDui.cjs +164 -0
- package/dist/sandbox-CL--ZDui.cjs.map +1 -0
- package/dist/sandbox-Dm247NGx.mjs +117 -0
- package/dist/sandbox-Dm247NGx.mjs.map +1 -0
- package/dist/{sniffer-aO_-s5vq.mjs → sniffer-49KPbDgq.mjs} +25 -470
- package/dist/sniffer-49KPbDgq.mjs.map +1 -0
- package/dist/{sniffer-D_SYc_pO.cjs → sniffer-ByhbEW5A.cjs} +38 -567
- package/dist/sniffer-ByhbEW5A.cjs.map +1 -0
- package/dist/sst-BdALKEas.cjs +453 -0
- package/dist/sst-BdALKEas.cjs.map +1 -0
- package/dist/sst-Cper040I.mjs +430 -0
- package/dist/sst-Cper040I.mjs.map +1 -0
- package/dist/{store-BS8A7NcA.mjs → store-BaaonhkJ.mjs} +2 -2
- package/dist/{store-BS8A7NcA.mjs.map → store-BaaonhkJ.mjs.map} +1 -1
- package/dist/{store-KvNQwYaB.cjs → store-D_2ByRtW.cjs} +4 -4
- package/dist/{store-KvNQwYaB.cjs.map → store-D_2ByRtW.cjs.map} +1 -1
- package/dist/target/public.cjs +3 -3
- package/dist/target/public.d.cts +3 -3
- package/dist/target/public.d.mts +3 -3
- package/dist/target/public.mjs +3 -3
- package/dist/{terminal-D0f1u0LG.cjs → terminal-Bdv--jhY.cjs} +16 -111
- package/dist/terminal-Bdv--jhY.cjs.map +1 -0
- package/dist/{terminal-gMxAo9Dj.mjs → terminal-D7Ntz6WE.mjs} +13 -90
- package/dist/terminal-D7Ntz6WE.mjs.map +1 -0
- package/dist/{types-DIA7Li-J.d.cts → types-B_bEQvb9.d.mts} +42 -7
- package/dist/types-B_bEQvb9.d.mts.map +1 -0
- package/dist/{types-CfLKGfC_.d.mts → types-DkrDOMxw.d.cts} +43 -6
- package/dist/types-DkrDOMxw.d.cts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-Kl4NG9IH.cjs → workspace-BwgWJK7h.cjs} +5 -5
- package/dist/workspace-BwgWJK7h.cjs.map +1 -0
- package/dist/{workspace-Dh7rr7l4.mjs → workspace-Bwit4q9O.mjs} +5 -5
- package/dist/workspace-Bwit4q9O.mjs.map +1 -0
- package/package.json +13 -13
- package/dist/config-BEJYKd4s.cjs +0 -648
- package/dist/config-BEJYKd4s.cjs.map +0 -1
- package/dist/config-LKKCVCnC.mjs +0 -547
- package/dist/config-LKKCVCnC.mjs.map +0 -1
- package/dist/define-CHBIEc5j.mjs.map +0 -1
- package/dist/define-Cv_QvDrg.cjs.map +0 -1
- package/dist/discover-BaT6bpnA.mjs.map +0 -1
- package/dist/discover-C_6COHEv.cjs.map +0 -1
- package/dist/home-DOzBaWaL.cjs +0 -33
- package/dist/home-DOzBaWaL.cjs.map +0 -1
- package/dist/home-GI7pJl1M.mjs +0 -22
- package/dist/home-GI7pJl1M.mjs.map +0 -1
- package/dist/resolve-B1T0hUaR.mjs.map +0 -1
- package/dist/resolve-xytBTtG4.cjs.map +0 -1
- package/dist/sniffer-D_SYc_pO.cjs.map +0 -1
- package/dist/sniffer-aO_-s5vq.mjs.map +0 -1
- package/dist/terminal-D0f1u0LG.cjs.map +0 -1
- package/dist/terminal-gMxAo9Dj.mjs.map +0 -1
- package/dist/types-CfLKGfC_.d.mts.map +0 -1
- package/dist/types-DIA7Li-J.d.cts.map +0 -1
- package/dist/workspace-Dh7rr7l4.mjs.map +0 -1
- package/dist/workspace-Kl4NG9IH.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env -S npx tsx
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
|
|
4
|
-
const require_sniffer = require("./sniffer-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
4
|
+
const require_sniffer = require("./sniffer-ByhbEW5A.cjs");
|
|
5
|
+
const require_local = require("./local-C7wnrcYK.cjs");
|
|
6
|
+
const require_discover = require("./discover-DHdECueV.cjs");
|
|
7
|
+
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
8
|
+
const require_workspace = require("./workspace-BwgWJK7h.cjs");
|
|
9
|
+
const require_config = require("./config.cjs");
|
|
8
10
|
const require_storage = require("./storage-CSGoC3bK.cjs");
|
|
9
|
-
const require_store = require("./store-
|
|
10
|
-
const require_OpenApiTsGenerator = require("./OpenApiTsGenerator-
|
|
11
|
+
const require_store = require("./store-D_2ByRtW.cjs");
|
|
12
|
+
const require_OpenApiTsGenerator = require("./OpenApiTsGenerator-BWuDRHe9.cjs");
|
|
11
13
|
const require_openapi = require("./openapi.cjs");
|
|
12
14
|
const require_fakes = require("./fakes-zW-jNAbQ.cjs");
|
|
13
15
|
const require_appPorts = require("./appPorts-Cu79hJF6.cjs");
|
|
14
|
-
const require_ready = require("./ready-
|
|
16
|
+
const require_ready = require("./ready-brEhh68f.cjs");
|
|
15
17
|
const require_emit = require("./emit-Dmc1nvdS.cjs");
|
|
16
|
-
const require_LocalStateStore = require("./LocalStateStore-
|
|
18
|
+
const require_LocalStateStore = require("./LocalStateStore-DiJqKyPy.cjs");
|
|
19
|
+
const require_utils = require("./utils-D2Nk1Nv2.cjs");
|
|
17
20
|
let node_path = require("node:path");
|
|
18
21
|
let commander = require("commander");
|
|
19
22
|
let node_fs = require("node:fs");
|
|
@@ -47,7 +50,7 @@ let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions")
|
|
|
47
50
|
let _geekmidas_constructs_queue = require("@geekmidas/constructs/queue");
|
|
48
51
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
49
52
|
//#region package.json
|
|
50
|
-
var version = "10.0.0-alpha.
|
|
53
|
+
var version = "10.0.0-alpha.64";
|
|
51
54
|
//#endregion
|
|
52
55
|
//#region src/trust/index.ts
|
|
53
56
|
/**
|
|
@@ -1515,7 +1518,7 @@ async function devCommand(options) {
|
|
|
1515
1518
|
for (const line of require_sniffer.describeServices(reconciled.services)) logger$6.log(line);
|
|
1516
1519
|
}
|
|
1517
1520
|
Object.assign(appSecrets, reconciled.env);
|
|
1518
|
-
const own = reconciled.plan.resources.find((r) => (r.kind === "rest-api" || r.kind === "site") &&
|
|
1521
|
+
const own = reconciled.plan.resources.find((r) => (r.kind === "rest-api" || r.kind === "site") && require_derive.appKey(r.id) === workspaceAppName);
|
|
1519
1522
|
publicUrl = own ? reconciled.env[own.envKey] : void 0;
|
|
1520
1523
|
manifest = reconciled.manifest;
|
|
1521
1524
|
}
|
|
@@ -1851,9 +1854,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
1851
1854
|
for (const { id, port } of fakes) logger$6.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
1852
1855
|
logger$6.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
1853
1856
|
if (options.migrate || options.seed) {
|
|
1854
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
1857
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs"));
|
|
1855
1858
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
1856
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
1859
|
+
} else await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
1857
1860
|
logger$6.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
1858
1861
|
});
|
|
1859
1862
|
const appUrls = {};
|
|
@@ -1884,14 +1887,14 @@ async function workspaceDevCommand(configured, options) {
|
|
|
1884
1887
|
const app = workspace.apps[appName];
|
|
1885
1888
|
if (!app) continue;
|
|
1886
1889
|
if (app.type === "mobile") {
|
|
1887
|
-
const own = reconciled.plan.resources.find((r) => r.kind === "mobile-app" &&
|
|
1890
|
+
const own = reconciled.plan.resources.find((r) => r.kind === "mobile-app" && require_derive.appKey(r.id) === appName);
|
|
1888
1891
|
const scheme = own ? reconciled.env[own.envKey] : void 0;
|
|
1889
1892
|
const device = Object.entries(reconciled.env).find(([key]) => key.endsWith("_DEVICE_URL"))?.[1];
|
|
1890
1893
|
logger$6.log(` ${appName.padEnd(width)} ${scheme ? `${scheme}://` : "mobile"}${device ? ` — devices reach ${new URL(device).hostname}` : ""}`);
|
|
1891
1894
|
continue;
|
|
1892
1895
|
}
|
|
1893
1896
|
const local = `http://localhost:${app.port}`;
|
|
1894
|
-
const url = Object.entries(appUrls).find(([id]) =>
|
|
1897
|
+
const url = Object.entries(appUrls).find(([id]) => require_derive.appKey(id) === appName)?.[1];
|
|
1895
1898
|
logger$6.log(` ${appName.padEnd(width)} ${url ? `${url} -> ${local}` : local}`);
|
|
1896
1899
|
}
|
|
1897
1900
|
logger$6.log("");
|
|
@@ -1921,7 +1924,7 @@ async function workspaceDevCommand(configured, options) {
|
|
|
1921
1924
|
apps: buildOrder.flatMap((name) => {
|
|
1922
1925
|
const app = workspace.apps[name];
|
|
1923
1926
|
if (!app) return [];
|
|
1924
|
-
const publicUrl = Object.entries(appUrls).find(([id]) =>
|
|
1927
|
+
const publicUrl = Object.entries(appUrls).find(([id]) => require_derive.appKey(id) === name)?.[1];
|
|
1925
1928
|
return [{
|
|
1926
1929
|
name,
|
|
1927
1930
|
type: app.type,
|
|
@@ -3233,7 +3236,7 @@ async function buildApp(input) {
|
|
|
3233
3236
|
if (production?.bundle && !input.skipBundle) {
|
|
3234
3237
|
const outputDir = (0, node_path.join)(appRoot, ".gkm", "server");
|
|
3235
3238
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3236
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3239
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-C8uJf324.cjs"));
|
|
3237
3240
|
await bundleServer({
|
|
3238
3241
|
entryPoint,
|
|
3239
3242
|
outputDir: (0, node_path.join)(outputDir, "dist"),
|
|
@@ -3371,7 +3374,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3371
3374
|
let masterKey;
|
|
3372
3375
|
if (context.production?.bundle && !skipBundle) {
|
|
3373
3376
|
logger$5.log(`\n📦 Bundling production server...`);
|
|
3374
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3377
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-C8uJf324.cjs"));
|
|
3375
3378
|
const allConstructs = [
|
|
3376
3379
|
...endpoints.map((e) => e.construct),
|
|
3377
3380
|
...functions.map((f) => f.construct),
|
|
@@ -3411,7 +3414,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3411
3414
|
* Detect available package manager.
|
|
3412
3415
|
* @internal Exported for testing
|
|
3413
3416
|
*/
|
|
3414
|
-
function detectPackageManager
|
|
3417
|
+
function detectPackageManager() {
|
|
3415
3418
|
if ((0, node_fs.existsSync)("pnpm-lock.yaml")) return "pnpm";
|
|
3416
3419
|
if ((0, node_fs.existsSync)("yarn.lock")) return "yarn";
|
|
3417
3420
|
return "npm";
|
|
@@ -3530,12 +3533,12 @@ async function workspaceBuildCommand(workspace, options) {
|
|
|
3530
3533
|
});
|
|
3531
3534
|
const { filters, unpackaged } = turboFilters(workspace, { exclude: "backend" });
|
|
3532
3535
|
if (unpackaged.length > 0) throw new Error(`No package.json for workspace app(s): ${unpackaged.join(", ")}. Each app needs one — turbo builds packages, and gkm reads the name back to know which app it is building.`);
|
|
3533
|
-
const pm = detectPackageManager
|
|
3536
|
+
const pm = detectPackageManager();
|
|
3534
3537
|
const [turboBin, turboArgs] = getTurboArgs(pm, filters, { only: true });
|
|
3535
3538
|
if (filters.length > 0) {
|
|
3536
3539
|
logger$5.log(`\n📦 Using ${pm} with Turbo for the other apps...\n`);
|
|
3537
3540
|
logger$5.log(`Running: ${[turboBin, ...turboArgs].join(" ")}`);
|
|
3538
|
-
const sandbox = options.sandbox ?? new
|
|
3541
|
+
const sandbox = options.sandbox ?? new require_local.LocalSandbox({
|
|
3539
3542
|
root: workspace.root,
|
|
3540
3543
|
passEnv: ["TURBO_TOKEN"]
|
|
3541
3544
|
});
|
|
@@ -3545,10 +3548,10 @@ async function workspaceBuildCommand(workspace, options) {
|
|
|
3545
3548
|
...sandbox.env,
|
|
3546
3549
|
NODE_ENV: options.production ? "production" : "development"
|
|
3547
3550
|
},
|
|
3548
|
-
timeoutMs:
|
|
3551
|
+
timeoutMs: require_local.DEFAULT_TIMEOUT_MS,
|
|
3549
3552
|
output: "inherit"
|
|
3550
3553
|
});
|
|
3551
|
-
if (built.exitCode !== 0) throw new
|
|
3554
|
+
if (built.exitCode !== 0) throw new require_local.CommandFailed(turboBin, turboArgs, built.exitCode, built.signal);
|
|
3552
3555
|
}
|
|
3553
3556
|
for (const [appName, app] of apps) {
|
|
3554
3557
|
const outputPath = getAppOutputPath(workspace, appName, app);
|
|
@@ -4171,7 +4174,7 @@ const dockerCompose = {
|
|
|
4171
4174
|
};
|
|
4172
4175
|
},
|
|
4173
4176
|
async build(stack, services) {
|
|
4174
|
-
await
|
|
4177
|
+
await require_local.run("docker", compose(stack, ["build", ...services]), {
|
|
4175
4178
|
cwd: stack.cwd,
|
|
4176
4179
|
env: {
|
|
4177
4180
|
...process.env,
|
|
@@ -4180,10 +4183,10 @@ const dockerCompose = {
|
|
|
4180
4183
|
});
|
|
4181
4184
|
},
|
|
4182
4185
|
async pull(stack, services) {
|
|
4183
|
-
await
|
|
4186
|
+
await require_local.run("docker", compose(stack, ["pull", ...services]), { cwd: stack.cwd });
|
|
4184
4187
|
},
|
|
4185
4188
|
async up(stack, services) {
|
|
4186
|
-
await
|
|
4189
|
+
await require_local.run("docker", compose(stack, [
|
|
4187
4190
|
"up",
|
|
4188
4191
|
"-d",
|
|
4189
4192
|
"--wait",
|
|
@@ -4193,10 +4196,10 @@ const dockerCompose = {
|
|
|
4193
4196
|
]), { cwd: stack.cwd });
|
|
4194
4197
|
},
|
|
4195
4198
|
async down(stack) {
|
|
4196
|
-
await
|
|
4199
|
+
await require_local.run("docker", compose(stack, ["down"]), { cwd: stack.cwd });
|
|
4197
4200
|
},
|
|
4198
4201
|
async port(stack, service, inside) {
|
|
4199
|
-
const output = await
|
|
4202
|
+
const output = await require_local.runOutput("docker", compose(stack, [
|
|
4200
4203
|
"port",
|
|
4201
4204
|
service,
|
|
4202
4205
|
String(inside)
|
|
@@ -4207,7 +4210,7 @@ const dockerCompose = {
|
|
|
4207
4210
|
},
|
|
4208
4211
|
async copyOut(stack, service, from, to) {
|
|
4209
4212
|
await (0, node_fs_promises.mkdir)((0, node_path.dirname)(to), { recursive: true });
|
|
4210
|
-
await
|
|
4213
|
+
await require_local.run("docker", compose(stack, [
|
|
4211
4214
|
"cp",
|
|
4212
4215
|
`${service}:${from}`,
|
|
4213
4216
|
to
|
|
@@ -4626,7 +4629,7 @@ function stackApps(workspace, manifest, plan, options) {
|
|
|
4626
4629
|
const resources = new Map(plan.resources.map((r) => [r.id, r]));
|
|
4627
4630
|
for (const [id, declaration] of Object.entries(manifest)) {
|
|
4628
4631
|
if (declaration.kind !== "rest-api" && declaration.kind !== "site") continue;
|
|
4629
|
-
const name =
|
|
4632
|
+
const name = require_derive.appKey(id);
|
|
4630
4633
|
const app = workspace.apps[name];
|
|
4631
4634
|
const resource = resources.get(id);
|
|
4632
4635
|
if (!app || !resource || !app.port) continue;
|
|
@@ -4791,7 +4794,7 @@ var EdgePortInvalid = class extends Error {
|
|
|
4791
4794
|
async function gitRevision(root) {
|
|
4792
4795
|
let sha;
|
|
4793
4796
|
try {
|
|
4794
|
-
sha = (await
|
|
4797
|
+
sha = (await require_local.runOutput("git", [
|
|
4795
4798
|
"rev-parse",
|
|
4796
4799
|
"--short",
|
|
4797
4800
|
"HEAD"
|
|
@@ -4800,7 +4803,7 @@ async function gitRevision(root) {
|
|
|
4800
4803
|
throw new NoGitRevision(root);
|
|
4801
4804
|
}
|
|
4802
4805
|
if (!sha) throw new NoGitRevision(root);
|
|
4803
|
-
return (await
|
|
4806
|
+
return (await require_local.runOutput("git", ["status", "--porcelain"], { cwd: root }).catch(() => "")).trim() ? `${sha}-dirty` : sha;
|
|
4804
4807
|
}
|
|
4805
4808
|
/**
|
|
4806
4809
|
* Bundle a backend with the gkm that is running — the same build a deploy
|
|
@@ -4809,7 +4812,7 @@ async function gitRevision(root) {
|
|
|
4809
4812
|
async function bundleWithThisCli(appRoot) {
|
|
4810
4813
|
const entry = process.argv[1];
|
|
4811
4814
|
if (!entry) return;
|
|
4812
|
-
await
|
|
4815
|
+
await require_local.run(process.execPath, [
|
|
4813
4816
|
...process.execArgv,
|
|
4814
4817
|
entry,
|
|
4815
4818
|
"build",
|
|
@@ -5105,7 +5108,7 @@ const logger$3 = console;
|
|
|
5105
5108
|
* Get the Dokploy API token from stored credentials or environment
|
|
5106
5109
|
*/
|
|
5107
5110
|
async function getApiToken() {
|
|
5108
|
-
const token = await
|
|
5111
|
+
const token = await require_local.getDokployToken();
|
|
5109
5112
|
if (!token) throw new Error("Dokploy credentials not found.\nRun \"gkm login --service dokploy\" to authenticate, or set DOKPLOY_API_TOKEN.");
|
|
5110
5113
|
return token;
|
|
5111
5114
|
}
|
|
@@ -5114,7 +5117,7 @@ async function getApiToken() {
|
|
|
5114
5117
|
*/
|
|
5115
5118
|
async function getEndpoint(providedEndpoint) {
|
|
5116
5119
|
if (providedEndpoint) return providedEndpoint;
|
|
5117
|
-
const stored = await
|
|
5120
|
+
const stored = await require_local.getDokployCredentials();
|
|
5118
5121
|
if (stored) return stored.endpoint;
|
|
5119
5122
|
throw new Error("Dokploy endpoint not specified.\nEither run \"gkm login --service dokploy\" first, or provide --endpoint.");
|
|
5120
5123
|
}
|
|
@@ -5217,7 +5220,7 @@ async function deployListCommand(options) {
|
|
|
5217
5220
|
logger$3.log(" Run \"gkm registry:setup\" to configure a registry");
|
|
5218
5221
|
return;
|
|
5219
5222
|
}
|
|
5220
|
-
const storedRegistryId = await
|
|
5223
|
+
const storedRegistryId = await require_local.getDokployRegistryId();
|
|
5221
5224
|
for (const registry of registries) {
|
|
5222
5225
|
const marker = registry.registryId === storedRegistryId ? " (default)" : "";
|
|
5223
5226
|
logger$3.log(`\n ${registry.registryName}${marker} (${registry.registryId})`);
|
|
@@ -6486,25 +6489,25 @@ function loadPackageJson() {
|
|
|
6486
6489
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
6487
6490
|
*/
|
|
6488
6491
|
const GEEKMIDAS_VERSIONS = {
|
|
6489
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
6490
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
6491
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
6492
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
6493
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
6494
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
6495
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
6496
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
6497
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
6498
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
6499
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
6500
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
6501
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
6502
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
6503
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
6504
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
6505
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
6506
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
6507
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
6492
|
+
"@geekmidas/audit": "~10.0.0-alpha.64",
|
|
6493
|
+
"@geekmidas/auth": "~10.0.0-alpha.64",
|
|
6494
|
+
"@geekmidas/cache": "~10.0.0-alpha.64",
|
|
6495
|
+
"@geekmidas/client": "~10.0.0-alpha.64",
|
|
6496
|
+
"@geekmidas/cloud": "~10.0.0-alpha.64",
|
|
6497
|
+
"@geekmidas/constructs": "~10.0.0-alpha.64",
|
|
6498
|
+
"@geekmidas/db": "~10.0.0-alpha.64",
|
|
6499
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.64",
|
|
6500
|
+
"@geekmidas/envkit": "~10.0.0-alpha.64",
|
|
6501
|
+
"@geekmidas/errors": "~10.0.0-alpha.64",
|
|
6502
|
+
"@geekmidas/events": "~10.0.0-alpha.64",
|
|
6503
|
+
"@geekmidas/logger": "~10.0.0-alpha.64",
|
|
6504
|
+
"@geekmidas/manifest": "~10.0.0-alpha.64",
|
|
6505
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.64",
|
|
6506
|
+
"@geekmidas/schema": "~10.0.0-alpha.64",
|
|
6507
|
+
"@geekmidas/services": "~10.0.0-alpha.64",
|
|
6508
|
+
"@geekmidas/storage": "~10.0.0-alpha.64",
|
|
6509
|
+
"@geekmidas/telescope": "~10.0.0-alpha.64",
|
|
6510
|
+
"@geekmidas/testkit": "~10.0.0-alpha.64",
|
|
6508
6511
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
6509
6512
|
};
|
|
6510
6513
|
//#endregion
|
|
@@ -7187,8 +7190,10 @@ ${pm.setup}
|
|
|
7187
7190
|
- name: Install
|
|
7188
7191
|
run: ${pm.install}
|
|
7189
7192
|
${stageSecrets}
|
|
7193
|
+
# Builds, releases and health-checks the stage through deploy.default
|
|
7194
|
+
# in gkm.config.ts, and fails the job if any of it fails.
|
|
7190
7195
|
- name: Deploy
|
|
7191
|
-
run: ${pm.
|
|
7196
|
+
run: ${pm.exec} gkm deploy --stage "$STAGE"
|
|
7192
7197
|
env:
|
|
7193
7198
|
STAGE: \${{ matrix.stage }}${deployEnv}
|
|
7194
7199
|
`;
|
|
@@ -8041,7 +8046,7 @@ function deployPackage(options) {
|
|
|
8041
8046
|
case "sst": {
|
|
8042
8047
|
const v = GEEKMIDAS_VERSIONS;
|
|
8043
8048
|
return {
|
|
8044
|
-
scripts: perStage(options, (stage) => `gkm
|
|
8049
|
+
scripts: perStage(options, (stage) => `gkm deploy --stage ${stage}`),
|
|
8045
8050
|
dependencies: {
|
|
8046
8051
|
"@geekmidas/cloud": v["@geekmidas/cloud"],
|
|
8047
8052
|
"@geekmidas/db": v["@geekmidas/db"],
|
|
@@ -8084,7 +8089,7 @@ function generateDeployFiles(options) {
|
|
|
8084
8089
|
* constructs the application declares, through \`fromManifest\`. What is here
|
|
8085
8090
|
* is what varies by stage, and the inputs a declaration cannot carry.
|
|
8086
8091
|
*
|
|
8087
|
-
* Deploy with \`
|
|
8092
|
+
* Deploy with \`gkm deploy --stage <stage>\`, which builds the manifest first.
|
|
8088
8093
|
*/
|
|
8089
8094
|
const region = '${options.region}';
|
|
8090
8095
|
|
|
@@ -8118,7 +8123,7 @@ ${hasDatabase ? " const vpc = new sst.aws.Vpc('Vpc', { nat: 'ec2' });\n\n" :
|
|
|
8118
8123
|
hostedZoneId: '',
|
|
8119
8124
|
});
|
|
8120
8125
|
|
|
8121
|
-
|
|
8126
|
+
const provisioned = fromManifest(
|
|
8122
8127
|
new Stack(app, '${(0, _geekmidas_manifest.canonicalId)(options.name)}'),
|
|
8123
8128
|
constructs,
|
|
8124
8129
|
{
|
|
@@ -8126,6 +8131,15 @@ ${inputs.join("\n")}
|
|
|
8126
8131
|
},
|
|
8127
8132
|
backends,
|
|
8128
8133
|
);
|
|
8134
|
+
|
|
8135
|
+
// Each surface's URL, by its id: SST prints these and writes them to
|
|
8136
|
+
// .sst/outputs.json, where \`gkm deploy\` reads them to health-check
|
|
8137
|
+
// what it released.
|
|
8138
|
+
return Object.fromEntries(
|
|
8139
|
+
Object.entries(constructs)
|
|
8140
|
+
.filter(([, c]) => c.kind === 'rest-api' || c.kind === 'site')
|
|
8141
|
+
.map(([id]) => [id, provisioned[id]!.provides().url]),
|
|
8142
|
+
);
|
|
8129
8143
|
},
|
|
8130
8144
|
});
|
|
8131
8145
|
`
|
|
@@ -8536,7 +8550,7 @@ ${workspaceConstructsGlobs(options.routesStructure, (0, node_path.dirname)(optio
|
|
|
8536
8550
|
function deployBlock(options) {
|
|
8537
8551
|
if (options.deployTarget !== "sst") return "";
|
|
8538
8552
|
return `
|
|
8539
|
-
//
|
|
8553
|
+
// \`gkm deploy\` runs \`sst deploy\` on the manifest \`gkm build\` writes to
|
|
8540
8554
|
// \`.gkm/manifest/aws.ts\`. Each construct becomes a managed AWS resource.
|
|
8541
8555
|
deploy: { default: 'sst' },
|
|
8542
8556
|
`;
|
|
@@ -11165,155 +11179,6 @@ function isFullstackTemplate(name) {
|
|
|
11165
11179
|
return name === "fullstack";
|
|
11166
11180
|
}
|
|
11167
11181
|
//#endregion
|
|
11168
|
-
//#region src/init/utils.ts
|
|
11169
|
-
/**
|
|
11170
|
-
* Detect the package manager being used based on lockfiles or npm_config_user_agent
|
|
11171
|
-
*/
|
|
11172
|
-
function detectPackageManager(cwd = process.cwd()) {
|
|
11173
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
11174
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "yarn.lock"))) return "yarn";
|
|
11175
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "bun.lockb"))) return "bun";
|
|
11176
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "package-lock.json"))) return "npm";
|
|
11177
|
-
const userAgent = process.env.npm_config_user_agent || "";
|
|
11178
|
-
if (userAgent.includes("pnpm")) return "pnpm";
|
|
11179
|
-
if (userAgent.includes("yarn")) return "yarn";
|
|
11180
|
-
if (userAgent.includes("bun")) return "bun";
|
|
11181
|
-
return "npm";
|
|
11182
|
-
}
|
|
11183
|
-
/** `gkm init`'s flags, which a name can swallow when a space goes missing. */
|
|
11184
|
-
const INIT_FLAGS = [
|
|
11185
|
-
"yes",
|
|
11186
|
-
"name",
|
|
11187
|
-
"template",
|
|
11188
|
-
"monorepo",
|
|
11189
|
-
"api-path",
|
|
11190
|
-
"pm",
|
|
11191
|
-
"skip-install"
|
|
11192
|
-
];
|
|
11193
|
-
/**
|
|
11194
|
-
* Validate project name for npm package naming conventions
|
|
11195
|
-
*/
|
|
11196
|
-
function validateProjectName(name) {
|
|
11197
|
-
if (!name) return "Project name is required";
|
|
11198
|
-
if (!/^[a-z0-9-_@/.]+$/i.test(name)) return "Project name can only contain letters, numbers, hyphens, underscores, @, /, and .";
|
|
11199
|
-
const flag = name.match(/--(\w[\w-]*)$/)?.[1];
|
|
11200
|
-
if (flag && INIT_FLAGS.includes(flag)) return `"${name}" ends in the --${flag} flag. Did you mean \`${name.slice(0, -(flag.length + 2))} --${flag}\`?`;
|
|
11201
|
-
if ([
|
|
11202
|
-
"node_modules",
|
|
11203
|
-
".git",
|
|
11204
|
-
"package.json",
|
|
11205
|
-
"src"
|
|
11206
|
-
].includes(name.toLowerCase())) return `"${name}" is a reserved name`;
|
|
11207
|
-
return true;
|
|
11208
|
-
}
|
|
11209
|
-
/**
|
|
11210
|
-
* Check if a directory already exists at the target path
|
|
11211
|
-
*/
|
|
11212
|
-
function checkDirectoryExists(name, cwd = process.cwd()) {
|
|
11213
|
-
const targetPath = (0, node_path.join)(cwd, name);
|
|
11214
|
-
if ((0, node_fs.existsSync)(targetPath)) return `Directory "${name}" already exists`;
|
|
11215
|
-
return true;
|
|
11216
|
-
}
|
|
11217
|
-
/**
|
|
11218
|
-
* Get the install command for a package manager
|
|
11219
|
-
*/
|
|
11220
|
-
function getInstallCommand(pkgManager) {
|
|
11221
|
-
switch (pkgManager) {
|
|
11222
|
-
case "pnpm": return "pnpm install";
|
|
11223
|
-
case "yarn": return "yarn";
|
|
11224
|
-
case "bun": return "bun install";
|
|
11225
|
-
default: return "npm install";
|
|
11226
|
-
}
|
|
11227
|
-
}
|
|
11228
|
-
/**
|
|
11229
|
-
* Get the dev command for a package manager
|
|
11230
|
-
*/
|
|
11231
|
-
function getRunCommand(pkgManager, script) {
|
|
11232
|
-
switch (pkgManager) {
|
|
11233
|
-
case "pnpm": return `pnpm ${script}`;
|
|
11234
|
-
case "yarn": return `yarn ${script}`;
|
|
11235
|
-
case "bun": return `bun run ${script}`;
|
|
11236
|
-
default: return `npm run ${script}`;
|
|
11237
|
-
}
|
|
11238
|
-
}
|
|
11239
|
-
/**
|
|
11240
|
-
* Run a binary the project installed, through its package manager — so it is
|
|
11241
|
-
* the project's own version, not whatever \`npx\` would fetch.
|
|
11242
|
-
*/
|
|
11243
|
-
function getExecCommand(pkgManager, command) {
|
|
11244
|
-
switch (pkgManager) {
|
|
11245
|
-
case "pnpm": return `pnpm exec ${command}`;
|
|
11246
|
-
case "yarn": return `yarn ${command}`;
|
|
11247
|
-
case "bun": return `bunx ${command}`;
|
|
11248
|
-
default: return `npx --no-install ${command}`;
|
|
11249
|
-
}
|
|
11250
|
-
}
|
|
11251
|
-
const lockfileByPm = {
|
|
11252
|
-
pnpm: "pnpm-lock.yaml",
|
|
11253
|
-
yarn: "yarn.lock",
|
|
11254
|
-
npm: "package-lock.json",
|
|
11255
|
-
bun: "bun.lockb"
|
|
11256
|
-
};
|
|
11257
|
-
/**
|
|
11258
|
-
* Find the workspace/project root by walking up from cwd.
|
|
11259
|
-
* Checks for PM-specific workspace config, package.json#workspaces,
|
|
11260
|
-
* and lockfiles.
|
|
11261
|
-
*/
|
|
11262
|
-
function findWorkspaceRoot(cwd, pm) {
|
|
11263
|
-
let dir = cwd;
|
|
11264
|
-
const root = (0, node_path.parse)(dir).root;
|
|
11265
|
-
const lockfile = lockfileByPm[pm];
|
|
11266
|
-
while (dir !== root) {
|
|
11267
|
-
if (pm === "pnpm" && (0, node_fs.existsSync)((0, node_path.join)(dir, "pnpm-workspace.yaml"))) return dir;
|
|
11268
|
-
const pkgJsonPath = (0, node_path.join)(dir, "package.json");
|
|
11269
|
-
if ((0, node_fs.existsSync)(pkgJsonPath)) try {
|
|
11270
|
-
if (JSON.parse((0, node_fs.readFileSync)(pkgJsonPath, "utf-8")).workspaces) return dir;
|
|
11271
|
-
} catch {}
|
|
11272
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(dir, lockfile))) return dir;
|
|
11273
|
-
dir = (0, node_path.dirname)(dir);
|
|
11274
|
-
}
|
|
11275
|
-
return cwd;
|
|
11276
|
-
}
|
|
11277
|
-
/**
|
|
11278
|
-
* Get workspace package glob patterns from pnpm-workspace.yaml
|
|
11279
|
-
* or package.json#workspaces.
|
|
11280
|
-
*/
|
|
11281
|
-
function getWorkspaceGlobs(root) {
|
|
11282
|
-
const pnpmWorkspacePath = (0, node_path.join)(root, "pnpm-workspace.yaml");
|
|
11283
|
-
if ((0, node_fs.existsSync)(pnpmWorkspacePath)) {
|
|
11284
|
-
const content = (0, node_fs.readFileSync)(pnpmWorkspacePath, "utf-8");
|
|
11285
|
-
return (0, yaml.parse)(content)?.packages ?? [];
|
|
11286
|
-
}
|
|
11287
|
-
const rootPkgJsonPath = (0, node_path.join)(root, "package.json");
|
|
11288
|
-
if ((0, node_fs.existsSync)(rootPkgJsonPath)) {
|
|
11289
|
-
const pkg = JSON.parse((0, node_fs.readFileSync)(rootPkgJsonPath, "utf-8"));
|
|
11290
|
-
if (Array.isArray(pkg.workspaces)) return pkg.workspaces;
|
|
11291
|
-
if (pkg.workspaces?.packages) return pkg.workspaces.packages;
|
|
11292
|
-
}
|
|
11293
|
-
return [];
|
|
11294
|
-
}
|
|
11295
|
-
/**
|
|
11296
|
-
* Find all package.json files across a workspace.
|
|
11297
|
-
* Returns the root package.json plus all workspace member package.json paths.
|
|
11298
|
-
*/
|
|
11299
|
-
function findWorkspacePackages(cwd, pm) {
|
|
11300
|
-
const workspaceRoot = findWorkspaceRoot(cwd, pm);
|
|
11301
|
-
const results = [];
|
|
11302
|
-
const rootPkgJson = (0, node_path.join)(workspaceRoot, "package.json");
|
|
11303
|
-
if ((0, node_fs.existsSync)(rootPkgJson)) results.push(rootPkgJson);
|
|
11304
|
-
const globs = getWorkspaceGlobs(workspaceRoot);
|
|
11305
|
-
for (const glob of globs) {
|
|
11306
|
-
const pattern = `${glob}/package.json`;
|
|
11307
|
-
const matches = fast_glob.default.sync(pattern, {
|
|
11308
|
-
cwd: workspaceRoot,
|
|
11309
|
-
absolute: true,
|
|
11310
|
-
ignore: ["**/node_modules/**"]
|
|
11311
|
-
});
|
|
11312
|
-
results.push(...matches);
|
|
11313
|
-
}
|
|
11314
|
-
return [...new Set(results)];
|
|
11315
|
-
}
|
|
11316
|
-
//#endregion
|
|
11317
11182
|
//#region src/init/index.ts
|
|
11318
11183
|
/** `' staging, prod '` → `['staging', 'prod']`. */
|
|
11319
11184
|
const stageList = (value) => value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
@@ -11324,7 +11189,7 @@ const AWS_REGION = /^[a-z]{2}(-gov)?-[a-z]+-\d$/;
|
|
|
11324
11189
|
*/
|
|
11325
11190
|
async function initCommand(projectName, options = {}) {
|
|
11326
11191
|
const cwd = process.cwd();
|
|
11327
|
-
const detectedPkgManager = detectPackageManager(cwd);
|
|
11192
|
+
const detectedPkgManager = require_utils.detectPackageManager(cwd);
|
|
11328
11193
|
if (options.deploy && !deployTargetChoices.some((choice) => choice.value === options.deploy)) throw new UnknownDeployTarget(options.deploy, deployTargetChoices.map((c) => c.value));
|
|
11329
11194
|
if (options.region && !AWS_REGION.test(options.region)) throw new NotAnAwsRegion(options.region);
|
|
11330
11195
|
if (options.stages || options.localStage || options.protectedStage) {
|
|
@@ -11351,9 +11216,9 @@ async function initCommand(projectName, options = {}) {
|
|
|
11351
11216
|
message: "Project name:",
|
|
11352
11217
|
initial: "my-app",
|
|
11353
11218
|
validate: (value) => {
|
|
11354
|
-
const nameValid = validateProjectName(value);
|
|
11219
|
+
const nameValid = require_utils.validateProjectName(value);
|
|
11355
11220
|
if (nameValid !== true) return nameValid;
|
|
11356
|
-
const dirValid = checkDirectoryExists(value, cwd);
|
|
11221
|
+
const dirValid = require_utils.checkDirectoryExists(value, cwd);
|
|
11357
11222
|
if (dirValid !== true) return dirValid;
|
|
11358
11223
|
return true;
|
|
11359
11224
|
}
|
|
@@ -11461,12 +11326,12 @@ async function initCommand(projectName, options = {}) {
|
|
|
11461
11326
|
}
|
|
11462
11327
|
if (projectName || options.name) {
|
|
11463
11328
|
const nameToValidate = projectName || options.name;
|
|
11464
|
-
const nameValid = validateProjectName(nameToValidate);
|
|
11329
|
+
const nameValid = require_utils.validateProjectName(nameToValidate);
|
|
11465
11330
|
if (nameValid !== true) {
|
|
11466
11331
|
console.error(nameValid);
|
|
11467
11332
|
process.exit(1);
|
|
11468
11333
|
}
|
|
11469
|
-
const dirValid = checkDirectoryExists(nameToValidate, cwd);
|
|
11334
|
+
const dirValid = require_utils.checkDirectoryExists(nameToValidate, cwd);
|
|
11470
11335
|
if (dirValid !== true) {
|
|
11471
11336
|
console.error(dirValid);
|
|
11472
11337
|
process.exit(1);
|
|
@@ -11572,7 +11437,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
11572
11437
|
if (!options.skipInstall) {
|
|
11573
11438
|
console.log("\n📦 Installing dependencies...\n");
|
|
11574
11439
|
try {
|
|
11575
|
-
(0, node_child_process.execSync)(getInstallCommand(pkgManager), {
|
|
11440
|
+
(0, node_child_process.execSync)(require_utils.getInstallCommand(pkgManager), {
|
|
11576
11441
|
cwd: targetDir,
|
|
11577
11442
|
stdio: "inherit"
|
|
11578
11443
|
});
|
|
@@ -11580,12 +11445,12 @@ async function initCommand(projectName, options = {}) {
|
|
|
11580
11445
|
console.error("Failed to install dependencies");
|
|
11581
11446
|
}
|
|
11582
11447
|
try {
|
|
11583
|
-
(0, node_child_process.execSync)(getExecCommand(pkgManager, "biome check --write ."), {
|
|
11448
|
+
(0, node_child_process.execSync)(require_utils.getExecCommand(pkgManager, "biome check --write ."), {
|
|
11584
11449
|
cwd: targetDir,
|
|
11585
11450
|
stdio: "inherit"
|
|
11586
11451
|
});
|
|
11587
11452
|
} catch {
|
|
11588
|
-
console.warn(`\n⚠️ Formatting did not finish cleanly. Run ${getRunCommand(pkgManager, "fmt")} to see why.`);
|
|
11453
|
+
console.warn(`\n⚠️ Formatting did not finish cleanly. Run ${require_utils.getRunCommand(pkgManager, "fmt")} to see why.`);
|
|
11589
11454
|
}
|
|
11590
11455
|
}
|
|
11591
11456
|
console.log("\n📦 Initializing git repository...\n");
|
|
@@ -11616,7 +11481,7 @@ async function initCommand(projectName, options = {}) {
|
|
|
11616
11481
|
* Print success message with next steps
|
|
11617
11482
|
*/
|
|
11618
11483
|
function printNextSteps(projectName, options, pkgManager) {
|
|
11619
|
-
const devCommand = getRunCommand(pkgManager, "dev");
|
|
11484
|
+
const devCommand = require_utils.getRunCommand(pkgManager, "dev");
|
|
11620
11485
|
const cdCommand = `cd ${projectName}`;
|
|
11621
11486
|
console.log(`\n${"─".repeat(50)}`);
|
|
11622
11487
|
console.log("\n✅ Project created successfully!\n");
|
|
@@ -11665,12 +11530,12 @@ function printNextSteps(projectName, options, pkgManager) {
|
|
|
11665
11530
|
console.log("");
|
|
11666
11531
|
if (options.deployTarget === "dokploy") {
|
|
11667
11532
|
console.log("🚀 Deployment:");
|
|
11668
|
-
for (const stage of deployed) console.log(` ${getRunCommand(pkgManager, `deploy:${stage}`)}`);
|
|
11533
|
+
for (const stage of deployed) console.log(` ${require_utils.getRunCommand(pkgManager, `deploy:${stage}`)}`);
|
|
11669
11534
|
console.log("");
|
|
11670
11535
|
}
|
|
11671
11536
|
if (options.deployTarget === "sst") {
|
|
11672
11537
|
console.log("🚀 Deployment (AWS, through SST):");
|
|
11673
|
-
for (const stage of deployed) console.log(` ${getRunCommand(pkgManager, `deploy:${stage}`)} # gkm build,
|
|
11538
|
+
for (const stage of deployed) console.log(` ${require_utils.getRunCommand(pkgManager, `deploy:${stage}`)} # gkm deploy: build, sst deploy, health checks`);
|
|
11674
11539
|
console.log(` Uses your AWS credentials, in ${options.region}.`);
|
|
11675
11540
|
if (options.constructs.mail) console.log(" Set MAIL_FROM to a sender verified in SES first.");
|
|
11676
11541
|
console.log("");
|
|
@@ -12405,8 +12270,8 @@ function testDatabases(reconciled) {
|
|
|
12405
12270
|
* starts without the reference data the app needs.
|
|
12406
12271
|
*/
|
|
12407
12272
|
async function migrateTestStage(workspace, env) {
|
|
12408
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
12409
|
-
const { discover } = await Promise.resolve().then(() => require("./discover-
|
|
12273
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs"));
|
|
12274
|
+
const { discover } = await Promise.resolve().then(() => require("./discover-DHdECueV.cjs")).then((n) => n.discover_exports);
|
|
12410
12275
|
const sources = {};
|
|
12411
12276
|
const manifest = await discover({
|
|
12412
12277
|
patterns: require_sniffer.constructGlobs(workspace),
|
|
@@ -12564,11 +12429,11 @@ function withVersion(range, version) {
|
|
|
12564
12429
|
}
|
|
12565
12430
|
async function upgradeCommand(options = {}) {
|
|
12566
12431
|
const cwd = process.cwd();
|
|
12567
|
-
const pm = detectPackageManager(cwd);
|
|
12568
|
-
const root = findWorkspaceRoot(cwd, pm);
|
|
12432
|
+
const pm = require_utils.detectPackageManager(cwd);
|
|
12433
|
+
const root = require_utils.findWorkspaceRoot(cwd, pm);
|
|
12569
12434
|
logger.log("\n📦 Scanning workspace for @geekmidas packages...\n");
|
|
12570
12435
|
logger.log(` Package manager: ${pm}`);
|
|
12571
|
-
const packageJsons = findWorkspacePackages(cwd, pm);
|
|
12436
|
+
const packageJsons = require_utils.findWorkspacePackages(cwd, pm);
|
|
12572
12437
|
const occurrences = [...packageOccurrences(packageJsons), ...catalogOccurrences(root)];
|
|
12573
12438
|
logger.log(` Found ${packageJsons.length} package(s) in workspace\n`);
|
|
12574
12439
|
const ours = occurrences.filter((o) => o.name.startsWith(SCOPE) && !isIndirect(o.range));
|
|
@@ -12679,7 +12544,7 @@ function applyChanges(changes) {
|
|
|
12679
12544
|
}
|
|
12680
12545
|
}
|
|
12681
12546
|
function install(pm, cwd) {
|
|
12682
|
-
const command = getInstallCommand(pm);
|
|
12547
|
+
const command = require_utils.getInstallCommand(pm);
|
|
12683
12548
|
logger.log(`\n Running: ${command}\n`);
|
|
12684
12549
|
try {
|
|
12685
12550
|
(0, node_child_process.execSync)(command, {
|
|
@@ -12836,7 +12701,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
12836
12701
|
try {
|
|
12837
12702
|
const globalOptions = program.opts();
|
|
12838
12703
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
12839
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
12704
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs"));
|
|
12840
12705
|
await migrateCommand({
|
|
12841
12706
|
...options,
|
|
12842
12707
|
...construct ? { construct } : {}
|
|
@@ -12850,7 +12715,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
12850
12715
|
try {
|
|
12851
12716
|
const globalOptions = program.opts();
|
|
12852
12717
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
12853
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
12718
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs"));
|
|
12854
12719
|
await seedCommand({
|
|
12855
12720
|
...options,
|
|
12856
12721
|
...construct ? { construct } : {}
|
|
@@ -12864,7 +12729,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
12864
12729
|
try {
|
|
12865
12730
|
const globalOptions = program.opts();
|
|
12866
12731
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
12867
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
12732
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-tx9-P9uz.cjs"));
|
|
12868
12733
|
await migrationCommand({
|
|
12869
12734
|
construct,
|
|
12870
12735
|
...name ? { name } : {}
|
|
@@ -12972,7 +12837,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
12972
12837
|
try {
|
|
12973
12838
|
const globalOptions = program.opts();
|
|
12974
12839
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
12975
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
12840
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-C9X98u2F.cjs"));
|
|
12976
12841
|
await encryptionRotateCommand(construct, options);
|
|
12977
12842
|
} catch (error) {
|
|
12978
12843
|
console.error(formatError(error));
|
|
@@ -12983,7 +12848,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
12983
12848
|
try {
|
|
12984
12849
|
const globalOptions = program.opts();
|
|
12985
12850
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
12986
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
12851
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-C9X98u2F.cjs"));
|
|
12987
12852
|
await encryptionRetireCommand(construct, key, options);
|
|
12988
12853
|
} catch (error) {
|
|
12989
12854
|
console.error(formatError(error));
|
|
@@ -13026,7 +12891,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
13026
12891
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
13027
12892
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
13028
12893
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
13029
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./store-
|
|
12894
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./store-D_2ByRtW.cjs")).then((n) => n.store_exports);
|
|
13030
12895
|
const { workspace } = await loadWorkspaceConfig();
|
|
13031
12896
|
const stage = options.stage ?? workspace.stages.local;
|
|
13032
12897
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -13035,7 +12900,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
13035
12900
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
13036
12901
|
process.exit(1);
|
|
13037
12902
|
}
|
|
13038
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./sniffer-
|
|
12903
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./sniffer-ByhbEW5A.cjs")).then((n) => n.workspace_exports);
|
|
13039
12904
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
13040
12905
|
if (!result) {
|
|
13041
12906
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -13049,8 +12914,8 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
13049
12914
|
process.exit(1);
|
|
13050
12915
|
}
|
|
13051
12916
|
});
|
|
13052
|
-
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp)").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").action(async (options) => {
|
|
13053
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
12917
|
+
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, sst, or one named in deploy.targets (default: deploy.default)").option("--provider <provider>", "[DEPRECATED] Use --target instead").requiredOption("--stage <stage>", "Deployment stage (e.g., production, staging)").option("--tag <tag>", "Image tag (default: stage-timestamp)").option("--skip-push", "Skip pushing image to registry").option("--skip-build", "Skip build step (use existing build)").option("--json", "Write events as JSON lines instead of progress; never prompts").option("--dry-run", "Show what would be created or reused; change, build and push nothing").action(async (options) => {
|
|
12918
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-D3jofJ6j.cjs"));
|
|
13054
12919
|
const globalOptions = program.opts();
|
|
13055
12920
|
const code = await deployCli({
|
|
13056
12921
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -13083,7 +12948,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
13083
12948
|
try {
|
|
13084
12949
|
const globalOptions = program.opts();
|
|
13085
12950
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
13086
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
12951
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-Dd3tMa1u.cjs"));
|
|
13087
12952
|
await deployGithubCommand(options);
|
|
13088
12953
|
} catch (error) {
|
|
13089
12954
|
console.error(formatError(error));
|