@geekmidas/cli 10.0.0-alpha.72 → 10.0.0-alpha.74
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/{OpenApiTsGenerator-BlP53kf2.cjs → EndpointGenerator-CP6sBvQV.cjs} +4 -510
- package/dist/EndpointGenerator-CP6sBvQV.cjs.map +1 -0
- package/dist/{OpenApiTsGenerator-Dv0gT2DL.mjs → EndpointGenerator-DftalLYg.mjs} +3 -509
- package/dist/EndpointGenerator-DftalLYg.mjs.map +1 -0
- package/dist/{LegacyStateStore-NSHEinQi.mjs → LegacyStateStore-DTo7z924.mjs} +2 -2
- package/dist/{LegacyStateStore-NSHEinQi.mjs.map → LegacyStateStore-DTo7z924.mjs.map} +1 -1
- package/dist/{LegacyStateStore-Dd5IwiyC.cjs → LegacyStateStore-D_78eaHM.cjs} +2 -2
- package/dist/{LegacyStateStore-Dd5IwiyC.cjs.map → LegacyStateStore-D_78eaHM.cjs.map} +1 -1
- package/dist/{LocalStateStore-DTylG4T4.cjs → LocalStateStore-BhrlQIXD.cjs} +2 -2
- package/dist/{LocalStateStore-DTylG4T4.cjs.map → LocalStateStore-BhrlQIXD.cjs.map} +1 -1
- package/dist/{LocalStateStore-DUoG2wA_.mjs → LocalStateStore-CNjgkRk4.mjs} +2 -2
- package/dist/{LocalStateStore-DUoG2wA_.mjs.map → LocalStateStore-CNjgkRk4.mjs.map} +1 -1
- package/dist/OpenApiTsGenerator-CKBCckKz.cjs +514 -0
- package/dist/OpenApiTsGenerator-CKBCckKz.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-nu1r1NgB.mjs +509 -0
- package/dist/OpenApiTsGenerator-nu1r1NgB.mjs.map +1 -0
- package/dist/{S3StateStore-Dxob3PNA.mjs → S3StateStore-g2P7T_Mo.mjs} +2 -2
- package/dist/{S3StateStore-Dxob3PNA.mjs.map → S3StateStore-g2P7T_Mo.mjs.map} +1 -1
- package/dist/{S3StateStore-D7hrU-sy.cjs → S3StateStore-oCxRs6HM.cjs} +2 -2
- package/dist/{S3StateStore-D7hrU-sy.cjs.map → S3StateStore-oCxRs6HM.cjs.map} +1 -1
- package/dist/{SSMStateStore-Dvl4A8Up.mjs → SSMStateStore-CYenunmK.mjs} +2 -2
- package/dist/{SSMStateStore-Dvl4A8Up.mjs.map → SSMStateStore-CYenunmK.mjs.map} +1 -1
- package/dist/{SSMStateStore-DGIKJ4NN.cjs → SSMStateStore-DXp0m7XI.cjs} +2 -2
- package/dist/{SSMStateStore-DGIKJ4NN.cjs.map → SSMStateStore-DXp0m7XI.cjs.map} +1 -1
- package/dist/SubscriberGenerator-5looQ3gB.mjs +448 -0
- package/dist/SubscriberGenerator-5looQ3gB.mjs.map +1 -0
- package/dist/SubscriberGenerator-CajwOa5W.cjs +489 -0
- package/dist/SubscriberGenerator-CajwOa5W.cjs.map +1 -0
- package/dist/{add-XTLU19_E.mjs → add-BTH7WaH3.mjs} +4 -4
- package/dist/{add-XTLU19_E.mjs.map → add-BTH7WaH3.mjs.map} +1 -1
- package/dist/{add-DeC2Kyyv.cjs → add-Djrr12Xc.cjs} +4 -4
- package/dist/{add-DeC2Kyyv.cjs.map → add-Djrr12Xc.cjs.map} +1 -1
- package/dist/{bundler-CNTVLCCA.mjs → bundler-BUojOkof.mjs} +6 -6
- package/dist/bundler-BUojOkof.mjs.map +1 -0
- package/dist/{bundler-CEaR6Dpb.cjs → bundler-utHuESvL.cjs} +6 -6
- package/dist/bundler-utHuESvL.cjs.map +1 -0
- package/dist/{cli-MMgBrHx7.cjs → cli-Bx0sUzxH.cjs} +4 -4
- package/dist/{cli-MMgBrHx7.cjs.map → cli-Bx0sUzxH.cjs.map} +1 -1
- package/dist/{cli-D1arS0p1.mjs → cli-CyYceKTS.mjs} +4 -4
- package/dist/{cli-D1arS0p1.mjs.map → cli-CyYceKTS.mjs.map} +1 -1
- package/dist/{compose-T3hnnjKZ.mjs → compose-DZp8DJ0A.mjs} +419 -70
- package/dist/compose-DZp8DJ0A.mjs.map +1 -0
- package/dist/{compose-B-MME-4C.cjs → compose-iuw8wfHk.cjs} +420 -71
- package/dist/compose-iuw8wfHk.cjs.map +1 -0
- package/dist/{config-j9zBKaEG.d.cts → config-B38YWicj.d.cts} +3 -3
- package/dist/{config-BN6iXvyR.d.mts.map → config-B38YWicj.d.cts.map} +1 -1
- package/dist/{config-BN6iXvyR.d.mts → config-DA0kRTQe.d.mts} +3 -3
- package/dist/{config-j9zBKaEG.d.cts.map → config-DA0kRTQe.d.mts.map} +1 -1
- package/dist/config.cjs +4 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +4 -1
- package/dist/config.mjs.map +1 -1
- package/dist/{credentialSchemas-BmYxnEz_.mjs → credentialSchemas-BJqRJNK4.mjs} +2 -2
- package/dist/{credentialSchemas-BmYxnEz_.mjs.map → credentialSchemas-BJqRJNK4.mjs.map} +1 -1
- package/dist/{credentialSchemas-BcNL1N5R.cjs → credentialSchemas-DCR4Wd1W.cjs} +2 -2
- package/dist/{credentialSchemas-BcNL1N5R.cjs.map → credentialSchemas-DCR4Wd1W.cjs.map} +1 -1
- package/dist/deploy/public.cjs +7 -7
- package/dist/deploy/public.d.cts +4 -4
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +4 -4
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +7 -7
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +2 -2
- package/dist/{deploy-ClC53rc6.mjs → deploy-C17K7Imy.mjs} +12 -6
- package/dist/deploy-C17K7Imy.mjs.map +1 -0
- package/dist/{deploy-CZE0m6jd.cjs → deploy-eWorhvQp.cjs} +12 -6
- package/dist/deploy-eWorhvQp.cjs.map +1 -0
- package/dist/{discover-Buwf1z4P.mjs → discover-BPelzeGW.mjs} +21 -2
- package/dist/discover-BPelzeGW.mjs.map +1 -0
- package/dist/{discover-B_IkPukx.d.cts → discover-CU0paUyH.d.cts} +10 -1
- package/dist/discover-CU0paUyH.d.cts.map +1 -0
- package/dist/{discover-B4VjaFJk.cjs → discover-D1It5r_h.cjs} +21 -2
- package/dist/discover-D1It5r_h.cjs.map +1 -0
- package/dist/{discover-B6yPpvRV.d.mts → discover-DFiJxwfv.d.mts} +10 -1
- package/dist/discover-DFiJxwfv.d.mts.map +1 -0
- package/dist/{dokploy-D1UwQKm3.mjs → dokploy-DKa49Nqm.mjs} +2 -2
- package/dist/{dokploy-D1UwQKm3.mjs.map → dokploy-DKa49Nqm.mjs.map} +1 -1
- package/dist/{dokploy-lwmH05zr.cjs → dokploy-DKzcI-RL.cjs} +2 -2
- package/dist/{dokploy-lwmH05zr.cjs.map → dokploy-DKzcI-RL.cjs.map} +1 -1
- package/dist/drivers-BdvtCKc7.cjs +200 -0
- package/dist/drivers-BdvtCKc7.cjs.map +1 -0
- package/dist/drivers-Ch1rJitn.mjs +177 -0
- package/dist/drivers-Ch1rJitn.mjs.map +1 -0
- package/dist/{encryption-D05sNwED.cjs → encryption-DSkJdoyk.cjs} +2 -2
- package/dist/{encryption-D05sNwED.cjs.map → encryption-DSkJdoyk.cjs.map} +1 -1
- package/dist/{encryption-DcrxWl1s.mjs → encryption-sTMz3aWi.mjs} +2 -2
- package/dist/{encryption-DcrxWl1s.mjs.map → encryption-sTMz3aWi.mjs.map} +1 -1
- package/dist/{engine-DmQS3XHX.mjs → engine-B1b4I34Z.mjs} +117 -17
- package/dist/engine-B1b4I34Z.mjs.map +1 -0
- package/dist/{engine-Cry1vwMz.cjs → engine-Bh76sAHy.cjs} +117 -17
- package/dist/engine-Bh76sAHy.cjs.map +1 -0
- package/dist/{github-BchWoiVx.cjs → github-BvN3CfxM.cjs} +2 -2
- package/dist/{github-BchWoiVx.cjs.map → github-BvN3CfxM.cjs.map} +1 -1
- package/dist/{github-CqYOP8cI.mjs → github-C9ODoyZU.mjs} +2 -2
- package/dist/{github-CqYOP8cI.mjs.map → github-C9ODoyZU.mjs.map} +1 -1
- package/dist/{index-DvoxuTqR.d.mts → index-B-1lLGzy.d.mts} +2 -2
- package/dist/{index-Bk3NY6DN.d.cts.map → index-B-1lLGzy.d.mts.map} +1 -1
- package/dist/{index-Bk3NY6DN.d.cts → index-vMidfqhU.d.cts} +2 -2
- package/dist/{index-DvoxuTqR.d.mts.map → index-vMidfqhU.d.cts.map} +1 -1
- package/dist/index.cjs +130 -473
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +122 -465
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-qKeGYq21.cjs → migrate-B0FCZNkp.cjs} +3 -3
- package/dist/{migrate-qKeGYq21.cjs.map → migrate-B0FCZNkp.cjs.map} +1 -1
- package/dist/{migrate-guck0NJK.mjs → migrate-CTtJhGV9.mjs} +3 -3
- package/dist/{migrate-guck0NJK.mjs.map → migrate-CTtJhGV9.mjs.map} +1 -1
- package/dist/openapi.cjs +3 -2
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +2 -1
- package/dist/openapi.mjs.map +1 -1
- package/dist/ready-BB9xS4S9.cjs +402 -0
- package/dist/ready-BB9xS4S9.cjs.map +1 -0
- package/dist/ready-ZZoNskrr.mjs +373 -0
- package/dist/ready-ZZoNskrr.mjs.map +1 -0
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +2 -2
- package/dist/reconcile/public.d.mts +2 -2
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-BsXEXAUz.mjs → resolve-DSAXj_47.mjs} +3 -3
- package/dist/{resolve-BsXEXAUz.mjs.map → resolve-DSAXj_47.mjs.map} +1 -1
- package/dist/{resolve-wEjEvbJ5.cjs → resolve-D_BU-wKA.cjs} +3 -3
- package/dist/{resolve-wEjEvbJ5.cjs.map → resolve-D_BU-wKA.cjs.map} +1 -1
- package/dist/{rollback-Bk91csFg.mjs → rollback-CWYTUhfW.mjs} +4 -4
- package/dist/{rollback-Bk91csFg.mjs.map → rollback-CWYTUhfW.mjs.map} +1 -1
- package/dist/{rollback-DmcU-efZ.cjs → rollback-DJy3t696.cjs} +4 -4
- package/dist/{rollback-DmcU-efZ.cjs.map → rollback-DJy3t696.cjs.map} +1 -1
- package/dist/{runtime-DHJhe4QI.d.mts → runtime-BzZD5HHi.d.cts} +2 -2
- package/dist/{runtime-CYAO4iZG.d.cts.map → runtime-BzZD5HHi.d.cts.map} +1 -1
- package/dist/{runtime-CYAO4iZG.d.cts → runtime-Cm6J6L7n.d.mts} +2 -2
- package/dist/{runtime-DHJhe4QI.d.mts.map → runtime-Cm6J6L7n.d.mts.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +2 -2
- package/dist/sandbox/credentials-worker.mjs +2 -2
- package/dist/sandbox/discover-worker.cjs +6 -3
- package/dist/sandbox/discover-worker.cjs.map +1 -1
- package/dist/sandbox/discover-worker.mjs +6 -3
- package/dist/sandbox/discover-worker.mjs.map +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{sniffer-vAXsU_4G.mjs → sniffer-BFmdZpZ2.mjs} +6 -6
- package/dist/{sniffer-vAXsU_4G.mjs.map → sniffer-BFmdZpZ2.mjs.map} +1 -1
- package/dist/{sniffer-DpHpFZBD.cjs → sniffer-C-T7dSMN.cjs} +6 -6
- package/dist/{sniffer-DpHpFZBD.cjs.map → sniffer-C-T7dSMN.cjs.map} +1 -1
- package/dist/{state-CCuTJNRH.cjs → state-DCwRWyh-.cjs} +954 -29
- package/dist/state-DCwRWyh-.cjs.map +1 -0
- package/dist/{state-BJFherj1.mjs → state-DpkxSwzI.mjs} +889 -24
- package/dist/state-DpkxSwzI.mjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-CFO3xWoF.cjs → terminal-BL5E0xbR.cjs} +2 -2
- package/dist/{terminal-CFO3xWoF.cjs.map → terminal-BL5E0xbR.cjs.map} +1 -1
- package/dist/{terminal-C6TBo_SA.mjs → terminal-BdvrmkaC.mjs} +2 -2
- package/dist/{terminal-C6TBo_SA.mjs.map → terminal-BdvrmkaC.mjs.map} +1 -1
- package/dist/{types-DkG5WW8l.d.mts → types-Dp9lgx_S.d.mts} +22 -2
- package/dist/types-Dp9lgx_S.d.mts.map +1 -0
- package/dist/{types-BD1jgA85.d.cts → types-TzCChNrA.d.cts} +22 -2
- package/dist/types-TzCChNrA.d.cts.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/dist/workspace-C7NqCsQF.mjs.map +1 -1
- package/dist/workspace-vdrcRI-m.cjs.map +1 -1
- package/package.json +15 -15
- package/dist/OpenApiTsGenerator-BlP53kf2.cjs.map +0 -1
- package/dist/OpenApiTsGenerator-Dv0gT2DL.mjs.map +0 -1
- package/dist/bundler-CEaR6Dpb.cjs.map +0 -1
- package/dist/bundler-CNTVLCCA.mjs.map +0 -1
- package/dist/compose-B-MME-4C.cjs.map +0 -1
- package/dist/compose-T3hnnjKZ.mjs.map +0 -1
- package/dist/deploy-CZE0m6jd.cjs.map +0 -1
- package/dist/deploy-ClC53rc6.mjs.map +0 -1
- package/dist/discover-B4VjaFJk.cjs.map +0 -1
- package/dist/discover-B6yPpvRV.d.mts.map +0 -1
- package/dist/discover-B_IkPukx.d.cts.map +0 -1
- package/dist/discover-Buwf1z4P.mjs.map +0 -1
- package/dist/engine-Cry1vwMz.cjs.map +0 -1
- package/dist/engine-DmQS3XHX.mjs.map +0 -1
- package/dist/fakes-C9RiT6XG.mjs +0 -125
- package/dist/fakes-C9RiT6XG.mjs.map +0 -1
- package/dist/fakes-zW-jNAbQ.cjs +0 -148
- package/dist/fakes-zW-jNAbQ.cjs.map +0 -1
- package/dist/ready-B-7LayMF.cjs +0 -872
- package/dist/ready-B-7LayMF.cjs.map +0 -1
- package/dist/ready-ULc5BTOb.mjs +0 -819
- package/dist/ready-ULc5BTOb.mjs.map +0 -1
- package/dist/state-BJFherj1.mjs.map +0 -1
- package/dist/state-CCuTJNRH.cjs.map +0 -1
- package/dist/types-BD1jgA85.d.cts.map +0 -1
- package/dist/types-DkG5WW8l.d.mts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
import { n as __require, t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
3
3
|
import { r as DEFAULT_TIMEOUT_MS, t as CommandFailed } from "./run-BJLIerMM.mjs";
|
|
4
4
|
import { c as getDokployCredentials, f as removeDokployCredentials, i as LocalSandbox, l as getDokployRegistryId, m as storeHostingerToken, p as storeDokployCredentials, s as getCredentialsPath, u as getDokployToken } from "./credentials-pAtB70k3.mjs";
|
|
5
|
-
import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-
|
|
5
|
+
import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } from "./discover-BPelzeGW.mjs";
|
|
6
6
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
7
7
|
import { A as deployedProblems, D as InvalidStages, O as TEST_STAGE, c as getAppGkmConfig, j as stageProblems, n as allConstructGlobs, s as getAppBuildOrder } from "./workspace-C7NqCsQF.mjs";
|
|
8
8
|
import { ConfigNotFound, NotABackendApp, NotInAnApp, loadAppConfig, loadConfig, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig } from "./config.mjs";
|
|
9
|
-
import { At as findAvailablePort,
|
|
10
|
-
import { i as telemetryFor, n as
|
|
11
|
-
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi } from "./sniffer-
|
|
9
|
+
import { $ as constructGlobs, At as eventsBackendFor, Bt as findAvailablePort, Ft as fakeKey, G as keyFingerprint, H as workerUnits, Ht as loadEnvFiles, J as workerEntryDir, Jt as FileSecretsStore, K as WorkerGenerator, Kt as secretsStoreFor, Lt as primaryPortKey, Pt as describeServices, Q as backendsOf$1, R as parseDevServices, Rt as createCredentialsPreload, Ut as loadSecretsForApp, Vt as isPortAvailable, Wt as prepareEntryCredentials, X as CronGenerator, Y as QueueGenerator, Yt as getKeyPath, Z as FAKE_ENV, Zt as projectKey, cn as maskPassword, dn as withCustomSecret, dt as quoteIdentifier, en as deployIdentity, et as derivedContainers, it as forgetState, jt as providerOf, kt as cacheBackendFor, lt as postgresDatabaseNames, mt as pgClient, q as workerBundleName, rt as LOCAL_CA_PATH, tt as reconcileWorkspace, un as toEmbeddableSecrets, y as dockerCommand, zt as createEntryWrapper } from "./state-DpkxSwzI.mjs";
|
|
10
|
+
import { i as telemetryFor, n as runtimeFor, t as EndpointGenerator } from "./EndpointGenerator-DftalLYg.mjs";
|
|
11
|
+
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi } from "./sniffer-BFmdZpZ2.mjs";
|
|
12
12
|
import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
|
|
13
|
+
import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-5looQ3gB.mjs";
|
|
13
14
|
import { a as describeHolder, i as assignAppPorts, o as holderOf, r as appTag, s as withAppPorts, t as APP_TAG_ENV } from "./appPorts-C9z9Pzn9.mjs";
|
|
14
|
-
import {
|
|
15
|
+
import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-Ch1rJitn.mjs";
|
|
15
16
|
import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
|
|
16
|
-
import { t as deploy$1 } from "./deploy-
|
|
17
|
-
import { a as stackDir, i as composeProject, o as dockerCompose, r as stackOverrideFile, t as composeTarget } from "./compose-
|
|
18
|
-
import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-
|
|
19
|
-
import { t as LocalStateStore } from "./LocalStateStore-
|
|
17
|
+
import { t as deploy$1 } from "./deploy-C17K7Imy.mjs";
|
|
18
|
+
import { a as stackDir, i as composeProject, o as dockerCompose, r as stackOverrideFile, t as composeTarget } from "./compose-DZp8DJ0A.mjs";
|
|
19
|
+
import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
20
|
+
import { t as LocalStateStore } from "./LocalStateStore-CNjgkRk4.mjs";
|
|
20
21
|
import { a as getExecCommand, c as validateProjectName, i as findWorkspaceRoot, n as detectPackageManager$1, o as getInstallCommand, r as findWorkspacePackages, s as getRunCommand, t as checkDirectoryExists } from "./utils-D_fxUqvU.mjs";
|
|
22
|
+
import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, t as TEST_READY_ENV } from "./ready-ZZoNskrr.mjs";
|
|
21
23
|
import { createRequire } from "node:module";
|
|
22
24
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
23
|
-
import { Command } from "commander";
|
|
25
|
+
import { Command, Option } from "commander";
|
|
24
26
|
import { stdin, stdout } from "node:process";
|
|
25
27
|
import * as readline from "node:readline/promises";
|
|
26
28
|
import { existsSync, linkSync, mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -42,12 +44,10 @@ import { createServer as createServer$2 } from "http";
|
|
|
42
44
|
import { Http2ServerRequest } from "http2";
|
|
43
45
|
import { Readable as Readable$1 } from "stream";
|
|
44
46
|
import crypto from "crypto";
|
|
45
|
-
import { Cron } from "@geekmidas/constructs/crons";
|
|
46
47
|
import { Function } from "@geekmidas/constructs/functions";
|
|
47
|
-
import { Queue } from "@geekmidas/constructs/queue";
|
|
48
48
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
49
49
|
//#region package.json
|
|
50
|
-
var version = "10.0.0-alpha.
|
|
50
|
+
var version = "10.0.0-alpha.74";
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/prompt.ts
|
|
53
53
|
/**
|
|
@@ -130,7 +130,7 @@ const logger$8 = console;
|
|
|
130
130
|
* Validate Dokploy token by making a test API call
|
|
131
131
|
*/
|
|
132
132
|
async function validateDokployToken(endpoint, token) {
|
|
133
|
-
const { DokployApi } = await import("./sniffer-
|
|
133
|
+
const { DokployApi } = await import("./sniffer-BFmdZpZ2.mjs").then((n) => n.c);
|
|
134
134
|
return new DokployApi({
|
|
135
135
|
baseUrl: endpoint,
|
|
136
136
|
token
|
|
@@ -2036,9 +2036,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2036
2036
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2037
2037
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2038
2038
|
if (options.migrate || options.seed) {
|
|
2039
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
2039
|
+
const { prepareDevDatabases } = await import("./migrate-CTtJhGV9.mjs");
|
|
2040
2040
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2041
|
-
} else await import("./migrate-
|
|
2041
|
+
} else await import("./migrate-CTtJhGV9.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2042
2042
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2043
2043
|
});
|
|
2044
2044
|
const appUrls = {};
|
|
@@ -2597,244 +2597,6 @@ var DevServer = class {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
};
|
|
2599
2599
|
//#endregion
|
|
2600
|
-
//#region src/generators/CronGenerator.ts
|
|
2601
|
-
var CronGenerator = class extends ConstructGenerator {
|
|
2602
|
-
async build(context, constructs, outputDir, options) {
|
|
2603
|
-
const target = options?.target ?? "aws";
|
|
2604
|
-
const logger = console;
|
|
2605
|
-
const cronInfos = [];
|
|
2606
|
-
if (target === "server") {
|
|
2607
|
-
await this.generateServerCronsFile(outputDir, constructs);
|
|
2608
|
-
logger.log(`Generated server crons file with ${constructs.length} crons`);
|
|
2609
|
-
return cronInfos;
|
|
2610
|
-
}
|
|
2611
|
-
if (constructs.length === 0) return cronInfos;
|
|
2612
|
-
const cronsDir = join(outputDir, "crons");
|
|
2613
|
-
await mkdir(cronsDir, { recursive: true });
|
|
2614
|
-
for (const { key, construct, path } of constructs) {
|
|
2615
|
-
const handlerFile = await this.generateCronHandler(cronsDir, path.relative, key, context, construct.owner);
|
|
2616
|
-
cronInfos.push({
|
|
2617
|
-
name: key,
|
|
2618
|
-
handler: relative(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2619
|
-
schedule: construct.schedule || "rate(1 hour)",
|
|
2620
|
-
timeout: construct.timeout,
|
|
2621
|
-
memorySize: construct.memorySize,
|
|
2622
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2623
|
-
dependencies: construct.constructs
|
|
2624
|
-
});
|
|
2625
|
-
logger.log(`Generated cron handler: ${key}`);
|
|
2626
|
-
}
|
|
2627
|
-
return cronInfos;
|
|
2628
|
-
}
|
|
2629
|
-
isConstruct(value) {
|
|
2630
|
-
return Cron.isCron(value);
|
|
2631
|
-
}
|
|
2632
|
-
/**
|
|
2633
|
-
* The crons file a server entry imports.
|
|
2634
|
-
*
|
|
2635
|
-
* Shaped after `generateServerSubscribersFile`: one module, every cron, a
|
|
2636
|
-
* `setupCrons` the generated entry calls beside `setupSubscribers`.
|
|
2637
|
-
*
|
|
2638
|
-
* It picks its scheduler from what the process can reach. With a Postgres it
|
|
2639
|
-
* uses pg-boss, whose schedules live in the database — so a deployment
|
|
2640
|
-
* running four replicas fires each job once, which is the thing a timer in
|
|
2641
|
-
* every process gets wrong and does not report. With no database it falls
|
|
2642
|
-
* back to timers and says plainly that it is doing so.
|
|
2643
|
-
*/
|
|
2644
|
-
async generateServerCronsFile(outputDir, crons) {
|
|
2645
|
-
await mkdir(outputDir, { recursive: true });
|
|
2646
|
-
const cronsPath = join(outputDir, "crons.ts");
|
|
2647
|
-
if (crons.length === 0) {
|
|
2648
|
-
await writeFile(cronsPath, `/**
|
|
2649
|
-
* Generated cron setup — this app declares none.
|
|
2650
|
-
*/
|
|
2651
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2652
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2653
|
-
|
|
2654
|
-
export async function setupCrons(
|
|
2655
|
-
_envParser: EnvironmentParser<any>,
|
|
2656
|
-
_logger: Logger,
|
|
2657
|
-
): Promise<void> {}
|
|
2658
|
-
|
|
2659
|
-
export async function stopCrons(): Promise<void> {}
|
|
2660
|
-
`);
|
|
2661
|
-
return cronsPath;
|
|
2662
|
-
}
|
|
2663
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2664
|
-
for (const { path, key } of crons) {
|
|
2665
|
-
const importPath = relative(dirname(cronsPath), path.relative).replace(/\.ts$/, ".js");
|
|
2666
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2667
|
-
importsByFile.get(importPath)?.push(key);
|
|
2668
|
-
}
|
|
2669
|
-
const content = `/**
|
|
2670
|
-
* Generated cron setup.
|
|
2671
|
-
*
|
|
2672
|
-
* Schedules every cron this app declares, in the process that serves it.
|
|
2673
|
-
*
|
|
2674
|
-
* The schedule lives in Postgres, through pg-boss, in the database the worker
|
|
2675
|
-
* named with \`.database(db)\`. That is what makes running several replicas
|
|
2676
|
-
* safe: each job fires once, where a timer in every process fires it once per
|
|
2677
|
-
* replica and reports nothing.
|
|
2678
|
-
*
|
|
2679
|
-
* No connection string appears here. The construct that owns the database is
|
|
2680
|
-
* the only thing that knows its key, and it is resolved through service
|
|
2681
|
-
* discovery like any other dependency.
|
|
2682
|
-
*/
|
|
2683
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2684
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2685
|
-
import { runCron, scheduleInProcess, toCronExpression } from '@geekmidas/constructs/crons';
|
|
2686
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2687
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2688
|
-
|
|
2689
|
-
const crons = [
|
|
2690
|
-
${crons.map(({ key }) => ` { name: '${key}', cron: ${key} }`).join(",\n")}
|
|
2691
|
-
];
|
|
2692
|
-
|
|
2693
|
-
type Stoppable = { stop: () => Promise<void> | void };
|
|
2694
|
-
const running: Stoppable[] = [];
|
|
2695
|
-
|
|
2696
|
-
export async function setupCrons(
|
|
2697
|
-
envParser: EnvironmentParser<any>,
|
|
2698
|
-
logger: Logger,
|
|
2699
|
-
): Promise<void> {
|
|
2700
|
-
if (crons.length === 0) {
|
|
2701
|
-
return;
|
|
2702
|
-
}
|
|
2703
|
-
|
|
2704
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2705
|
-
|
|
2706
|
-
// Resolved once per cron rather than per firing: registering services on
|
|
2707
|
-
// every tick would reconnect a database every minute.
|
|
2708
|
-
const prepared = [];
|
|
2709
|
-
for (const { name, cron } of crons) {
|
|
2710
|
-
try {
|
|
2711
|
-
const schedule = toCronExpression(cron.schedule);
|
|
2712
|
-
const services = cron.services.length > 0
|
|
2713
|
-
? await serviceDiscovery.register(cron.services)
|
|
2714
|
-
: {};
|
|
2715
|
-
|
|
2716
|
-
prepared.push({ name, cron, schedule, services });
|
|
2717
|
-
} catch (error) {
|
|
2718
|
-
// An unrepresentable schedule is a build-time mistake, and failing the
|
|
2719
|
-
// process for it would take the HTTP server down with it.
|
|
2720
|
-
logger.error({ err: error, cron: name }, 'Cron has no runnable schedule, skipping');
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
const run = async (entry: (typeof prepared)[number]) => {
|
|
2725
|
-
try {
|
|
2726
|
-
// The cron's own function, the way its Lambda would run it — services,
|
|
2727
|
-
// the worker's database as \`db\`, its events. It used to call a
|
|
2728
|
-
// \`handler\` a Cron does not have, so every firing logged a failure.
|
|
2729
|
-
await runCron(entry.cron, serviceDiscovery);
|
|
2730
|
-
} catch (error) {
|
|
2731
|
-
logger.error({ err: error, cron: entry.name }, 'Cron failed');
|
|
2732
|
-
}
|
|
2733
|
-
};
|
|
2734
|
-
|
|
2735
|
-
// The app's one pg-boss: the events broker's, as the broker's role, in the
|
|
2736
|
-
// broker's schema. A server fires its own crons, and a process scheduling in
|
|
2737
|
-
// memory fires each job once per replica — so the schedule lives in
|
|
2738
|
-
// Postgres. It used to be a second pg-boss on the worker's database, as the
|
|
2739
|
-
// runtime role, which can neither create a schema nor use the broker's.
|
|
2740
|
-
const { url, devPid } = envParser
|
|
2741
|
-
.create((get) => ({
|
|
2742
|
-
url: get('EVENT_PUBLISHER_CONNECTION_STRING').string().optional(),
|
|
2743
|
-
// Set by \`gkm dev\` on the server it starts, and by nothing deployed.
|
|
2744
|
-
devPid: get('GKM_DEV_PID').string().optional(),
|
|
2745
|
-
}))
|
|
2746
|
-
.parse();
|
|
2747
|
-
|
|
2748
|
-
if (!url?.startsWith('pgboss://')) {
|
|
2749
|
-
// \`gkm dev\` on a target whose crons are infrastructure once deployed —
|
|
2750
|
-
// EventBridge rules on AWS — has no broker to keep a schedule in. It is one
|
|
2751
|
-
// process, so a timer fires each job once, which is all pg-boss is for
|
|
2752
|
-
// here. Only there: a deployed server firing by timer fires once per
|
|
2753
|
-
// replica, so outside dev this stays the error below.
|
|
2754
|
-
if (devPid) {
|
|
2755
|
-
for (const entry of prepared) {
|
|
2756
|
-
running.push(scheduleInProcess(entry.schedule, () => run(entry)));
|
|
2757
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled in this process');
|
|
2758
|
-
}
|
|
2759
|
-
return;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
|
-
logger.error(
|
|
2763
|
-
{ crons: prepared.map(({ name }) => name) },
|
|
2764
|
-
'These crons have nowhere to keep their schedule. On a server they are ' +
|
|
2765
|
-
'scheduled through the pg-boss events broker ' +
|
|
2766
|
-
'(EVENT_PUBLISHER_CONNECTION_STRING), and ' +
|
|
2767
|
-
(url ? 'the broker configured is not pg-boss.' : 'none is configured.'),
|
|
2768
|
-
);
|
|
2769
|
-
return;
|
|
2770
|
-
}
|
|
2771
|
-
|
|
2772
|
-
// Through the registered pg-boss driver, which the entry registers for a
|
|
2773
|
-
// server whose broker is pg-boss. Naming \`@geekmidas/events/pgboss\` here
|
|
2774
|
-
// made every bundle with a cron resolve pg-boss, whatever its broker.
|
|
2775
|
-
const { EventConnectionFactory } = await import('@geekmidas/events');
|
|
2776
|
-
const connection = (await EventConnectionFactory.fromConnectionString(
|
|
2777
|
-
url,
|
|
2778
|
-
)) as import('@geekmidas/events').EventConnection & { instance?: any };
|
|
2779
|
-
const boss = connection.instance!;
|
|
2780
|
-
|
|
2781
|
-
// What this app declares now. Anything else under the prefix belonged to a
|
|
2782
|
-
// cron since renamed or deleted, and would keep firing at a handler that has
|
|
2783
|
-
// gone.
|
|
2784
|
-
//
|
|
2785
|
-
// The prefix is \`cron.\` rather than \`cron:\`: pg-boss accepts
|
|
2786
|
-
// alphanumerics, underscores, hyphens, periods and slashes in a queue name,
|
|
2787
|
-
// and rejects a colon outright.
|
|
2788
|
-
const declared = new Set(prepared.map(({ name }) => \`cron.\${name}\`));
|
|
2789
|
-
for (const existing of await boss.getSchedules()) {
|
|
2790
|
-
if (existing.name.startsWith('cron.') && !declared.has(existing.name)) {
|
|
2791
|
-
await boss.unschedule(existing.name);
|
|
2792
|
-
logger.info({ cron: existing.name }, 'Removed a schedule nothing declares');
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
|
|
2796
|
-
for (const entry of prepared) {
|
|
2797
|
-
const queue = \`cron.\${entry.name}\`;
|
|
2798
|
-
await boss.createQueue(queue);
|
|
2799
|
-
// UTC, so this agrees with the schedule a deploy target would have made.
|
|
2800
|
-
await boss.schedule(queue, entry.schedule, undefined, { tz: 'UTC' });
|
|
2801
|
-
await boss.work(queue, () => run(entry));
|
|
2802
|
-
|
|
2803
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled');
|
|
2804
|
-
}
|
|
2805
|
-
|
|
2806
|
-
running.push({ stop: () => connection.close() });
|
|
2807
|
-
logger.info({ count: prepared.length }, 'Crons scheduled');
|
|
2808
|
-
}
|
|
2809
|
-
|
|
2810
|
-
export async function stopCrons(): Promise<void> {
|
|
2811
|
-
await Promise.all(running.map((r) => r.stop()));
|
|
2812
|
-
running.length = 0;
|
|
2813
|
-
}
|
|
2814
|
-
`;
|
|
2815
|
-
await writeFile(cronsPath, content);
|
|
2816
|
-
return cronsPath;
|
|
2817
|
-
}
|
|
2818
|
-
async generateCronHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2819
|
-
const handlerFileName = `${exportName}.ts`;
|
|
2820
|
-
const handlerPath = join(outputDir, handlerFileName);
|
|
2821
|
-
const importPath = relative(dirname(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2822
|
-
const runtime = runtimeFor(context, dirname(handlerPath), owner);
|
|
2823
|
-
const content = `import { AWSScheduledFunction } from '@geekmidas/constructs/aws';
|
|
2824
|
-
import { ${exportName} } from '${importPath}';
|
|
2825
|
-
${runtime.imports}
|
|
2826
|
-
${context.storageDrivers?.imports ?? ""}
|
|
2827
|
-
${runtime.bindings}
|
|
2828
|
-
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
2829
|
-
const adapter = new AWSScheduledFunction(envParser, ${exportName});
|
|
2830
|
-
|
|
2831
|
-
export const handler = adapter.handler;
|
|
2832
|
-
`;
|
|
2833
|
-
await writeFile(handlerPath, content);
|
|
2834
|
-
return handlerPath;
|
|
2835
|
-
}
|
|
2836
|
-
};
|
|
2837
|
-
//#endregion
|
|
2838
2600
|
//#region src/generators/FunctionGenerator.ts
|
|
2839
2601
|
var FunctionGenerator = class extends ConstructGenerator {
|
|
2840
2602
|
isConstruct(value) {
|
|
@@ -2881,178 +2643,6 @@ export const handler = adapter.handler;
|
|
|
2881
2643
|
}
|
|
2882
2644
|
};
|
|
2883
2645
|
//#endregion
|
|
2884
|
-
//#region src/generators/QueueGenerator.ts
|
|
2885
|
-
/**
|
|
2886
|
-
* Generates the runtime for queue consumers (`worker.queue(…)`).
|
|
2887
|
-
*
|
|
2888
|
-
* - **server** (`gkm dev`): a single `queues.ts` exposing `setupQueues()` that
|
|
2889
|
-
* polls each queue in-process, alongside the Hono server, through the queue's
|
|
2890
|
-
* own connection string — pg-boss by default, SQS on the AWS emulator.
|
|
2891
|
-
* - **aws-lambda**: one handler file per queue wrapping `AWSLambdaQueue`, backed
|
|
2892
|
-
* by an SQS event-source mapping.
|
|
2893
|
-
*/
|
|
2894
|
-
var QueueGenerator = class extends ConstructGenerator {
|
|
2895
|
-
isConstruct(value) {
|
|
2896
|
-
return Queue.isQueue(value);
|
|
2897
|
-
}
|
|
2898
|
-
async build(context, constructs, outputDir, options) {
|
|
2899
|
-
const target = options?.target ?? "aws";
|
|
2900
|
-
const logger = console;
|
|
2901
|
-
const queueInfos = [];
|
|
2902
|
-
if (target === "server") {
|
|
2903
|
-
await this.generateServerQueuesFile(outputDir, constructs);
|
|
2904
|
-
logger.log(`Generated server queues file with ${constructs.length} queues (polling mode)`);
|
|
2905
|
-
return queueInfos;
|
|
2906
|
-
}
|
|
2907
|
-
if (constructs.length === 0) return queueInfos;
|
|
2908
|
-
const queuesDir = join(outputDir, "queues");
|
|
2909
|
-
await mkdir(queuesDir, { recursive: true });
|
|
2910
|
-
for (const { key, construct, path } of constructs) {
|
|
2911
|
-
const handlerFile = await this.generateQueueHandler(queuesDir, path.relative, key, context, construct.owner);
|
|
2912
|
-
queueInfos.push({
|
|
2913
|
-
name: construct.name,
|
|
2914
|
-
handler: relative(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2915
|
-
batchSize: construct.batchSize,
|
|
2916
|
-
fifo: construct.fifo,
|
|
2917
|
-
timeout: construct.timeout,
|
|
2918
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2919
|
-
dependencies: construct.constructs
|
|
2920
|
-
});
|
|
2921
|
-
logger.log(`Generated queue handler: ${key}`);
|
|
2922
|
-
}
|
|
2923
|
-
return queueInfos;
|
|
2924
|
-
}
|
|
2925
|
-
async generateQueueHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2926
|
-
const handlerPath = join(outputDir, `${exportName}.ts`);
|
|
2927
|
-
const importPath = relative(dirname(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2928
|
-
const runtime = runtimeFor(context, dirname(handlerPath), owner);
|
|
2929
|
-
const content = `import { AWSLambdaQueue } from '@geekmidas/constructs/aws';
|
|
2930
|
-
import { ${exportName} } from '${importPath}';
|
|
2931
|
-
${runtime.imports}
|
|
2932
|
-
${context.storageDrivers?.imports ?? ""}
|
|
2933
|
-
${runtime.bindings}
|
|
2934
|
-
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
2935
|
-
const adapter = new AWSLambdaQueue(envParser, ${exportName});
|
|
2936
|
-
|
|
2937
|
-
export const handler = adapter.handler;
|
|
2938
|
-
`;
|
|
2939
|
-
await writeFile(handlerPath, content);
|
|
2940
|
-
return handlerPath;
|
|
2941
|
-
}
|
|
2942
|
-
async generateServerQueuesFile(outputDir, queues) {
|
|
2943
|
-
await mkdir(outputDir, { recursive: true });
|
|
2944
|
-
const queuesPath = join(outputDir, "queues.ts");
|
|
2945
|
-
if (queues.length === 0) {
|
|
2946
|
-
await writeFile(queuesPath, `/**
|
|
2947
|
-
* Generated queues setup — this app declares none.
|
|
2948
|
-
*/
|
|
2949
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2950
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2951
|
-
|
|
2952
|
-
export async function setupQueues(
|
|
2953
|
-
_envParser: EnvironmentParser<any>,
|
|
2954
|
-
_logger: Logger,
|
|
2955
|
-
): Promise<void> {}
|
|
2956
|
-
`);
|
|
2957
|
-
return queuesPath;
|
|
2958
|
-
}
|
|
2959
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2960
|
-
for (const { path, key } of queues) {
|
|
2961
|
-
const importPath = relative(dirname(queuesPath), path.relative).replace(/\.ts$/, ".js");
|
|
2962
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2963
|
-
importsByFile.get(importPath)?.push(key);
|
|
2964
|
-
}
|
|
2965
|
-
const content = `/**
|
|
2966
|
-
* Generated queue consumers setup.
|
|
2967
|
-
*
|
|
2968
|
-
* Each queue's one consumer polls its own queue, through the queue's own
|
|
2969
|
-
* connection string — the one its producers publish on. SQS cannot push, so
|
|
2970
|
-
* this is a poller on every transport: pg-boss locally by default, the SQS
|
|
2971
|
-
* queue on the AWS emulator.
|
|
2972
|
-
*
|
|
2973
|
-
* Deployed on Lambda, a queue's consumer is an SQS event source instead.
|
|
2974
|
-
*/
|
|
2975
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2976
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2977
|
-
import { EventConnectionFactory, Subscriber } from '@geekmidas/events';
|
|
2978
|
-
import type { EventConnection } from '@geekmidas/events';
|
|
2979
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2980
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2981
|
-
|
|
2982
|
-
const queues = [
|
|
2983
|
-
${queues.map(({ key, construct }) => ` { queue: ${key}, connectionKey: '${provideKey(construct.id, "publisherConnectionString")}' },`).join("\n")}
|
|
2984
|
-
];
|
|
2985
|
-
|
|
2986
|
-
export async function setupQueues(
|
|
2987
|
-
envParser: EnvironmentParser<any>,
|
|
2988
|
-
logger: Logger,
|
|
2989
|
-
): Promise<void> {
|
|
2990
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2991
|
-
const connections = new Map<string, EventConnection>();
|
|
2992
|
-
|
|
2993
|
-
for (const { queue, connectionKey } of queues) {
|
|
2994
|
-
const connectionString = process.env[connectionKey];
|
|
2995
|
-
if (!connectionString) {
|
|
2996
|
-
logger.error({ queue: queue.name, connectionKey }, 'No connection string for this queue');
|
|
2997
|
-
continue;
|
|
2998
|
-
}
|
|
2999
|
-
|
|
3000
|
-
try {
|
|
3001
|
-
let connection = connections.get(connectionString);
|
|
3002
|
-
if (!connection) {
|
|
3003
|
-
connection = await EventConnectionFactory.fromConnectionString(connectionString);
|
|
3004
|
-
connections.set(connectionString, connection);
|
|
3005
|
-
}
|
|
3006
|
-
const eventSubscriber = await Subscriber.fromConnection(connection);
|
|
3007
|
-
const services = queue.services.length > 0
|
|
3008
|
-
? await serviceDiscovery.register(queue.services)
|
|
3009
|
-
: {};
|
|
3010
|
-
// The queue's database — the worker's, or its own — handed over as \`db\`.
|
|
3011
|
-
const db = queue.databaseService
|
|
3012
|
-
? (await serviceDiscovery.register([queue.databaseService]))[
|
|
3013
|
-
queue.databaseService.serviceName
|
|
3014
|
-
]
|
|
3015
|
-
: undefined;
|
|
3016
|
-
|
|
3017
|
-
// A queue's messages carry one type — its own name.
|
|
3018
|
-
await eventSubscriber.subscribe([queue.name], async (message) => {
|
|
3019
|
-
try {
|
|
3020
|
-
const validation = await queue.messageSchema['~standard'].validate(message.payload);
|
|
3021
|
-
if (validation.issues) {
|
|
3022
|
-
logger.error({ issues: validation.issues, queue: queue.name }, 'Queue message failed validation');
|
|
3023
|
-
return;
|
|
3024
|
-
}
|
|
3025
|
-
|
|
3026
|
-
await queue.handler({
|
|
3027
|
-
messages: [validation.value],
|
|
3028
|
-
services: services,
|
|
3029
|
-
logger: queue.logger,
|
|
3030
|
-
db,
|
|
3031
|
-
} as any);
|
|
3032
|
-
} catch (error) {
|
|
3033
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to process queue message');
|
|
3034
|
-
// Rethrown so the transport keeps the message for a retry.
|
|
3035
|
-
throw error;
|
|
3036
|
-
}
|
|
3037
|
-
});
|
|
3038
|
-
logger.info({ queue: queue.name }, 'Queue consumer started polling');
|
|
3039
|
-
} catch (error) {
|
|
3040
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to set up queue consumer');
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
|
|
3044
|
-
const shutdown = () => {
|
|
3045
|
-
for (const connection of connections.values()) void connection.close();
|
|
3046
|
-
};
|
|
3047
|
-
process.once('SIGTERM', shutdown);
|
|
3048
|
-
process.once('SIGINT', shutdown);
|
|
3049
|
-
}
|
|
3050
|
-
`;
|
|
3051
|
-
await writeFile(queuesPath, content);
|
|
3052
|
-
return queuesPath;
|
|
3053
|
-
}
|
|
3054
|
-
};
|
|
3055
|
-
//#endregion
|
|
3056
2646
|
//#region src/generators/TopicGenerator.ts
|
|
3057
2647
|
/**
|
|
3058
2648
|
* Discovers topics (`new Topic(…)`) into `manifest.topics`. A topic is a
|
|
@@ -3308,6 +2898,15 @@ var UnknownBuildProvider = class extends Error {
|
|
|
3308
2898
|
this.name = "UnknownBuildProvider";
|
|
3309
2899
|
}
|
|
3310
2900
|
};
|
|
2901
|
+
/** `--cache` named something that is not a cache backend. */
|
|
2902
|
+
var UnknownCacheBackend = class extends Error {
|
|
2903
|
+
backend;
|
|
2904
|
+
constructor(backend) {
|
|
2905
|
+
super(`'${backend}' is not a cache backend. Pass --cache upstash, elasticache, db or redis, or leave it out to register the deploy target's.`);
|
|
2906
|
+
this.backend = backend;
|
|
2907
|
+
this.name = "UnknownCacheBackend";
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
3311
2910
|
async function buildCommand(options) {
|
|
3312
2911
|
const loadedConfig = await loadWorkspaceConfig();
|
|
3313
2912
|
if (loadedConfig.type === "workspace") {
|
|
@@ -3360,7 +2959,7 @@ function backendsOf(workspace) {
|
|
|
3360
2959
|
/** One app's build, from its config and the command's options. */
|
|
3361
2960
|
async function buildOneApp(input) {
|
|
3362
2961
|
const { config, options, workspace, appRoot, target } = input;
|
|
3363
|
-
const cacheBackend = cacheBackendFor(providerOf(workspace));
|
|
2962
|
+
const cacheBackend = options.cache ?? cacheBackendFor(providerOf(workspace));
|
|
3364
2963
|
const eventsBackend = eventsBackendFor(providerOf(workspace));
|
|
3365
2964
|
const production = normalizeProductionConfig(options.production ?? false);
|
|
3366
2965
|
if (production) logger$4.log(`🏭 Building for PRODUCTION`);
|
|
@@ -3384,7 +2983,8 @@ async function buildOneApp(input) {
|
|
|
3384
2983
|
markOptional: options.markOptional ?? false,
|
|
3385
2984
|
skipBundle: options.skipBundle ?? false,
|
|
3386
2985
|
stage: options.stage,
|
|
3387
|
-
workspaceName: workspace.name
|
|
2986
|
+
workspaceName: workspace.name,
|
|
2987
|
+
workspace
|
|
3388
2988
|
});
|
|
3389
2989
|
}
|
|
3390
2990
|
/**
|
|
@@ -3426,11 +3026,13 @@ async function buildApp(input) {
|
|
|
3426
3026
|
const { config, workspaceRoot, appRoot, target, enableOpenApi, cacheBackend, eventsBackend, production, telescope, databaseApi, hooks, bustCache = false } = input;
|
|
3427
3027
|
const constructGlobs = config.constructs;
|
|
3428
3028
|
const constructSources = {};
|
|
3029
|
+
const background = {};
|
|
3429
3030
|
const declared = constructGlobs ? await discover({
|
|
3430
3031
|
patterns: constructGlobs,
|
|
3431
3032
|
cwd: appRoot,
|
|
3432
3033
|
bustCache,
|
|
3433
|
-
sources: constructSources
|
|
3034
|
+
sources: constructSources,
|
|
3035
|
+
background
|
|
3434
3036
|
}) : {};
|
|
3435
3037
|
const selfServing = selfServingSurface({
|
|
3436
3038
|
declared,
|
|
@@ -3444,7 +3046,7 @@ async function buildApp(input) {
|
|
|
3444
3046
|
if (production?.bundle && !input.skipBundle) {
|
|
3445
3047
|
const outputDir = join(appRoot, ".gkm", "server");
|
|
3446
3048
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3447
|
-
const { bundleServer } = await import("./bundler-
|
|
3049
|
+
const { bundleServer } = await import("./bundler-BUojOkof.mjs");
|
|
3448
3050
|
await bundleServer({
|
|
3449
3051
|
entryPoint,
|
|
3450
3052
|
outputDir: join(outputDir, "dist"),
|
|
@@ -3525,6 +3127,19 @@ async function buildApp(input) {
|
|
|
3525
3127
|
if (left.length > 0) logger$4.log(`Serving ${derived.surface.id} only: leaving out ${left.join(", ")} — they run in a Worker's image`);
|
|
3526
3128
|
}
|
|
3527
3129
|
const result = await buildForTarget(target, buildContext, appRoot, workspaceRoot, endpointGenerator, functionGenerator, cronGenerator, subscriberGenerator, queueGenerator, topicGenerator, allEndpoints, allFunctions, allCrons, allSubscribers, allQueues, allTopics, enableOpenApi, input.skipBundle ?? false, input.stage);
|
|
3130
|
+
if (target === "server" && production?.enabled && input.workspace) {
|
|
3131
|
+
const appName = Object.entries(input.workspace.apps).find(([, app]) => resolve(input.workspace.root, app.path) === resolve(appRoot))?.[0];
|
|
3132
|
+
await buildWorkers({
|
|
3133
|
+
context: buildContext,
|
|
3134
|
+
workers: workerUnits(input.workspace, declared, background).filter((unit) => unit.app === appName),
|
|
3135
|
+
serverDir: join(appRoot, ".gkm", "server"),
|
|
3136
|
+
crons: allCrons,
|
|
3137
|
+
queues: allQueues,
|
|
3138
|
+
subscribers: allSubscribers,
|
|
3139
|
+
bundle: Boolean(production.bundle && !input.skipBundle),
|
|
3140
|
+
...input.stage ? { stage: input.stage } : {}
|
|
3141
|
+
});
|
|
3142
|
+
}
|
|
3528
3143
|
await generateOpenApi(allEndpoints.map(({ construct }) => construct), {
|
|
3529
3144
|
openapi: config.openapi,
|
|
3530
3145
|
root: workspaceRoot
|
|
@@ -3534,6 +3149,46 @@ async function buildApp(input) {
|
|
|
3534
3149
|
...buildContext.databaseApi ? { databaseApi: buildContext.databaseApi.path } : {}
|
|
3535
3150
|
};
|
|
3536
3151
|
}
|
|
3152
|
+
/**
|
|
3153
|
+
* Write each worker's entry — and, for an image, bundle it — from the
|
|
3154
|
+
* runnables built from that worker, and nothing built from another.
|
|
3155
|
+
*/
|
|
3156
|
+
async function buildWorkers(input) {
|
|
3157
|
+
const generator = new WorkerGenerator();
|
|
3158
|
+
for (const worker of input.workers) {
|
|
3159
|
+
const owned = (list) => list.filter(({ construct }) => construct.owner === worker.id);
|
|
3160
|
+
const crons = owned(input.crons);
|
|
3161
|
+
const queues = owned(input.queues);
|
|
3162
|
+
const subscribers = owned(input.subscribers);
|
|
3163
|
+
const entryPoint = await generator.build({
|
|
3164
|
+
context: input.context,
|
|
3165
|
+
workerId: worker.id,
|
|
3166
|
+
outputDir: workerEntryDir(input.serverDir, worker.id),
|
|
3167
|
+
crons,
|
|
3168
|
+
queues,
|
|
3169
|
+
subscribers
|
|
3170
|
+
});
|
|
3171
|
+
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3172
|
+
if (!input.bundle) continue;
|
|
3173
|
+
const { bundleServer } = await import("./bundler-BUojOkof.mjs");
|
|
3174
|
+
const outfile = workerBundleName(worker.id);
|
|
3175
|
+
await bundleServer({
|
|
3176
|
+
entryPoint,
|
|
3177
|
+
outputDir: join(input.serverDir, "dist"),
|
|
3178
|
+
outfile,
|
|
3179
|
+
minify: input.context.production?.minify ?? false,
|
|
3180
|
+
sourcemap: false,
|
|
3181
|
+
external: input.context.production?.external ?? [],
|
|
3182
|
+
...input.stage ? { stage: input.stage } : {},
|
|
3183
|
+
constructs: [
|
|
3184
|
+
...crons,
|
|
3185
|
+
...queues,
|
|
3186
|
+
...subscribers
|
|
3187
|
+
].map((c) => c.construct)
|
|
3188
|
+
});
|
|
3189
|
+
logger$4.log(`✅ Bundle complete: .gkm/server/dist/${outfile}`);
|
|
3190
|
+
}
|
|
3191
|
+
}
|
|
3537
3192
|
async function buildForTarget(target, context, appRoot, workspaceRoot, endpointGenerator, functionGenerator, cronGenerator, subscriberGenerator, queueGenerator, topicGenerator, endpoints, functions, crons, subscribers, queues, topics, enableOpenApi, skipBundle, stage) {
|
|
3538
3193
|
const outputDir = join(appRoot, ".gkm", target);
|
|
3539
3194
|
await Promise.all([...SUPERSEDED_OUTPUT.map((dir) => join(appRoot, ".gkm", dir)), ...appRoot === workspaceRoot ? [] : [join(appRoot, ".gkm", "manifest")]].map((dir) => rm(dir, {
|
|
@@ -3585,7 +3240,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3585
3240
|
let masterKey;
|
|
3586
3241
|
if (context.production?.bundle && !skipBundle) {
|
|
3587
3242
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3588
|
-
const { bundleServer } = await import("./bundler-
|
|
3243
|
+
const { bundleServer } = await import("./bundler-BUojOkof.mjs");
|
|
3589
3244
|
const allConstructs = [
|
|
3590
3245
|
...endpoints.map((e) => e.construct),
|
|
3591
3246
|
...functions.map((f) => f.construct),
|
|
@@ -5284,25 +4939,25 @@ function loadPackageJson() {
|
|
|
5284
4939
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5285
4940
|
*/
|
|
5286
4941
|
const GEEKMIDAS_VERSIONS = {
|
|
5287
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5288
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5289
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5290
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5291
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5292
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5293
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5294
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5295
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5296
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5297
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5298
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5299
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5300
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5301
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5302
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5303
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5304
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5305
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
4942
|
+
"@geekmidas/audit": "~10.0.0-alpha.74",
|
|
4943
|
+
"@geekmidas/auth": "~10.0.0-alpha.74",
|
|
4944
|
+
"@geekmidas/cache": "~10.0.0-alpha.74",
|
|
4945
|
+
"@geekmidas/client": "~10.0.0-alpha.74",
|
|
4946
|
+
"@geekmidas/cloud": "~10.0.0-alpha.74",
|
|
4947
|
+
"@geekmidas/constructs": "~10.0.0-alpha.74",
|
|
4948
|
+
"@geekmidas/db": "~10.0.0-alpha.74",
|
|
4949
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.74",
|
|
4950
|
+
"@geekmidas/envkit": "~10.0.0-alpha.74",
|
|
4951
|
+
"@geekmidas/errors": "~10.0.0-alpha.74",
|
|
4952
|
+
"@geekmidas/events": "~10.0.0-alpha.74",
|
|
4953
|
+
"@geekmidas/logger": "~10.0.0-alpha.74",
|
|
4954
|
+
"@geekmidas/manifest": "~10.0.0-alpha.74",
|
|
4955
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.74",
|
|
4956
|
+
"@geekmidas/schema": "~10.0.0-alpha.74",
|
|
4957
|
+
"@geekmidas/services": "~10.0.0-alpha.74",
|
|
4958
|
+
"@geekmidas/storage": "~10.0.0-alpha.74",
|
|
4959
|
+
"@geekmidas/telescope": "~10.0.0-alpha.74",
|
|
4960
|
+
"@geekmidas/testkit": "~10.0.0-alpha.74",
|
|
5306
4961
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5307
4962
|
};
|
|
5308
4963
|
//#endregion
|
|
@@ -11093,8 +10748,8 @@ function testDatabases(reconciled) {
|
|
|
11093
10748
|
* starts without the reference data the app needs.
|
|
11094
10749
|
*/
|
|
11095
10750
|
async function migrateTestStage(workspace, env) {
|
|
11096
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
11097
|
-
const { discover } = await import("./discover-
|
|
10751
|
+
const { migrateAndSeed } = await import("./migrate-CTtJhGV9.mjs");
|
|
10752
|
+
const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
|
|
11098
10753
|
const sources = {};
|
|
11099
10754
|
const manifest = await discover({
|
|
11100
10755
|
patterns: constructGlobs(workspace),
|
|
@@ -11459,13 +11114,15 @@ program.command("setup").description("Reconcile declared constructs — containe
|
|
|
11459
11114
|
process.exit(1);
|
|
11460
11115
|
}
|
|
11461
11116
|
});
|
|
11462
|
-
program.command("build").description("Build handlers and the manifest from declared constructs").option("--provider <provider>", "Build for aws or server (default: where gkm.config.ts deploys)").option("--enable-openapi", "Enable OpenAPI documentation generation for server builds").option("--production", "Build for production (no dev tools, bundled output)").option("--skip-bundle", "Skip bundling step in production build").option("--stage <stage>", "Inject encrypted secrets for deployment stage").option("--mark-optional", "Suffix optional env vars with ? in manifest envVars field (e.g. PORT?)").action(async (options) => {
|
|
11117
|
+
program.command("build").description("Build handlers and the manifest from declared constructs").option("--provider <provider>", "Build for aws or server (default: where gkm.config.ts deploys)").option("--enable-openapi", "Enable OpenAPI documentation generation for server builds").option("--production", "Build for production (no dev tools, bundled output)").option("--skip-bundle", "Skip bundling step in production build").option("--stage <stage>", "Inject encrypted secrets for deployment stage").option("--mark-optional", "Suffix optional env vars with ? in manifest envVars field (e.g. PORT?)").addOption(new Option("--cache <backend>", "Register the drivers for this cache backend rather than the target default").hideHelp()).action(async (options) => {
|
|
11463
11118
|
try {
|
|
11464
11119
|
const globalOptions = program.opts();
|
|
11465
11120
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11466
11121
|
if (options.provider !== void 0 && !isMainProvider(options.provider)) throw new UnknownBuildProvider(options.provider);
|
|
11122
|
+
if (options.cache !== void 0 && !isCacheBackend(options.cache)) throw new UnknownCacheBackend(options.cache);
|
|
11467
11123
|
await buildCommand({
|
|
11468
11124
|
...options.provider ? { provider: options.provider } : {},
|
|
11125
|
+
...options.cache ? { cache: options.cache } : {},
|
|
11469
11126
|
enableOpenApi: options.enableOpenapi || false,
|
|
11470
11127
|
production: options.production || false,
|
|
11471
11128
|
skipBundle: options.skipBundle || false,
|
|
@@ -11524,7 +11181,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11524
11181
|
try {
|
|
11525
11182
|
const globalOptions = program.opts();
|
|
11526
11183
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11527
|
-
const { migrateCommand } = await import("./migrate-
|
|
11184
|
+
const { migrateCommand } = await import("./migrate-CTtJhGV9.mjs");
|
|
11528
11185
|
await migrateCommand({
|
|
11529
11186
|
...options,
|
|
11530
11187
|
...construct ? { construct } : {}
|
|
@@ -11538,7 +11195,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11538
11195
|
try {
|
|
11539
11196
|
const globalOptions = program.opts();
|
|
11540
11197
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11541
|
-
const { seedCommand } = await import("./migrate-
|
|
11198
|
+
const { seedCommand } = await import("./migrate-CTtJhGV9.mjs");
|
|
11542
11199
|
await seedCommand({
|
|
11543
11200
|
...options,
|
|
11544
11201
|
...construct ? { construct } : {}
|
|
@@ -11552,7 +11209,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11552
11209
|
try {
|
|
11553
11210
|
const globalOptions = program.opts();
|
|
11554
11211
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11555
|
-
const { migrationCommand } = await import("./migrate-
|
|
11212
|
+
const { migrationCommand } = await import("./migrate-CTtJhGV9.mjs");
|
|
11556
11213
|
await migrationCommand({
|
|
11557
11214
|
construct,
|
|
11558
11215
|
...name ? { name } : {}
|
|
@@ -11646,7 +11303,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11646
11303
|
try {
|
|
11647
11304
|
const globalOptions = program.opts();
|
|
11648
11305
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11649
|
-
const { secretsAddCommand } = await import("./add-
|
|
11306
|
+
const { secretsAddCommand } = await import("./add-BTH7WaH3.mjs");
|
|
11650
11307
|
await secretsAddCommand(options);
|
|
11651
11308
|
} catch (error) {
|
|
11652
11309
|
console.error(formatError(error));
|
|
@@ -11657,7 +11314,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11657
11314
|
try {
|
|
11658
11315
|
const globalOptions = program.opts();
|
|
11659
11316
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11660
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
11317
|
+
const { encryptionRotateCommand } = await import("./encryption-sTMz3aWi.mjs");
|
|
11661
11318
|
await encryptionRotateCommand(construct, options);
|
|
11662
11319
|
} catch (error) {
|
|
11663
11320
|
console.error(formatError(error));
|
|
@@ -11668,7 +11325,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11668
11325
|
try {
|
|
11669
11326
|
const globalOptions = program.opts();
|
|
11670
11327
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11671
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
11328
|
+
const { encryptionRetireCommand } = await import("./encryption-sTMz3aWi.mjs");
|
|
11672
11329
|
await encryptionRetireCommand(construct, key, options);
|
|
11673
11330
|
} catch (error) {
|
|
11674
11331
|
console.error(formatError(error));
|
|
@@ -11711,7 +11368,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11711
11368
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11712
11369
|
const { loadWorkspaceConfig } = await import("./config.mjs");
|
|
11713
11370
|
const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
|
|
11714
|
-
const { secretsStoreFor } = await import("./state-
|
|
11371
|
+
const { secretsStoreFor } = await import("./state-DpkxSwzI.mjs").then((n) => n.qt);
|
|
11715
11372
|
const { workspace } = await loadWorkspaceConfig();
|
|
11716
11373
|
const stage = options.stage ?? workspace.stages.local;
|
|
11717
11374
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11720,7 +11377,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11720
11377
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11721
11378
|
process.exit(1);
|
|
11722
11379
|
}
|
|
11723
|
-
const { derivedContainers } = await import("./state-
|
|
11380
|
+
const { derivedContainers } = await import("./state-DpkxSwzI.mjs").then((n) => n.nt);
|
|
11724
11381
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11725
11382
|
if (!result) {
|
|
11726
11383
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11735,7 +11392,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11735
11392
|
}
|
|
11736
11393
|
});
|
|
11737
11394
|
program.command("deploy").description("Deploy a stage through its target").option("--target <name>", "Deploy target: dokploy, compose, 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; compose: the commit). Compose pulls a given tag").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").option("--atomic", "If the release fails, roll back every app it released, not only the failed ones").option("--allow-dev-services <list>", "Server targets: run MinIO and/or Mailpit (minio,mailpit) for mail and buckets the stage's secrets don't configure. Not production-grade").action(async (options) => {
|
|
11738
|
-
const { deployCli } = await import("./cli-
|
|
11395
|
+
const { deployCli } = await import("./cli-CyYceKTS.mjs");
|
|
11739
11396
|
const globalOptions = program.opts();
|
|
11740
11397
|
const code = await deployCli({
|
|
11741
11398
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11752,8 +11409,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11752
11409
|
});
|
|
11753
11410
|
program.command("deploy:rollback").description("Put a stage's app back on its previous release (Dokploy): one app with --app, every app with --atomic").requiredOption("--stage <stage>", "A deployed stage").option("--app <app>", "The app to roll back").option("--atomic", "Roll back every app that has an earlier release").action(async (options) => {
|
|
11754
11411
|
try {
|
|
11755
|
-
const { rollbackStage } = await import("./rollback-
|
|
11756
|
-
const { terminalCredentials } = await import("./terminal-
|
|
11412
|
+
const { rollbackStage } = await import("./rollback-CWYTUhfW.mjs").then((n) => n.a);
|
|
11413
|
+
const { terminalCredentials } = await import("./terminal-BdvrmkaC.mjs");
|
|
11757
11414
|
const globalOptions = program.opts();
|
|
11758
11415
|
await rollbackStage({
|
|
11759
11416
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11788,7 +11445,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11788
11445
|
try {
|
|
11789
11446
|
const globalOptions = program.opts();
|
|
11790
11447
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11791
|
-
const { deployGithubCommand } = await import("./github-
|
|
11448
|
+
const { deployGithubCommand } = await import("./github-C9ODoyZU.mjs");
|
|
11792
11449
|
await deployGithubCommand(options);
|
|
11793
11450
|
} catch (error) {
|
|
11794
11451
|
console.error(formatError(error));
|