@geekmidas/cli 10.0.0-alpha.71 → 10.0.0-alpha.73
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-DZZwHdDC.cjs → EndpointGenerator-CP6sBvQV.cjs} +7 -513
- package/dist/EndpointGenerator-CP6sBvQV.cjs.map +1 -0
- package/dist/{OpenApiTsGenerator-Bhr_XWWN.mjs → EndpointGenerator-DftalLYg.mjs} +6 -512
- 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-Bixm28fN.cjs +461 -0
- package/dist/SubscriberGenerator-Bixm28fN.cjs.map +1 -0
- package/dist/SubscriberGenerator-DZk_pKDh.mjs +432 -0
- package/dist/SubscriberGenerator-DZk_pKDh.mjs.map +1 -0
- package/dist/{add-XTLU19_E.mjs → add-BiPlBUq3.mjs} +4 -4
- package/dist/{add-XTLU19_E.mjs.map → add-BiPlBUq3.mjs.map} +1 -1
- package/dist/{add-DeC2Kyyv.cjs → add-C1ojB2Yy.cjs} +4 -4
- package/dist/{add-DeC2Kyyv.cjs.map → add-C1ojB2Yy.cjs.map} +1 -1
- package/dist/{bundler-CNTVLCCA.mjs → bundler-C2LZoLdP.mjs} +6 -6
- package/dist/bundler-C2LZoLdP.mjs.map +1 -0
- package/dist/{bundler-CEaR6Dpb.cjs → bundler-C35h0WKt.cjs} +6 -6
- package/dist/bundler-C35h0WKt.cjs.map +1 -0
- package/dist/{cli-D1arS0p1.mjs → cli-BfdfyTF6.mjs} +4 -4
- package/dist/{cli-D1arS0p1.mjs.map → cli-BfdfyTF6.mjs.map} +1 -1
- package/dist/{cli-MMgBrHx7.cjs → cli-DJVL2sL9.cjs} +4 -4
- package/dist/{cli-MMgBrHx7.cjs.map → cli-DJVL2sL9.cjs.map} +1 -1
- package/dist/{compose-T3hnnjKZ.mjs → compose-9II-0IsK.mjs} +221 -64
- package/dist/compose-9II-0IsK.mjs.map +1 -0
- package/dist/{compose-B-MME-4C.cjs → compose-CNnw8meq.cjs} +223 -66
- package/dist/compose-CNnw8meq.cjs.map +1 -0
- package/dist/{config-BN6iXvyR.d.mts → config-B8OR_TrO.d.mts} +3 -3
- package/dist/{config-BN6iXvyR.d.mts.map → config-B8OR_TrO.d.mts.map} +1 -1
- package/dist/{config-j9zBKaEG.d.cts → config-RLuR2o9A.d.cts} +3 -3
- package/dist/{config-j9zBKaEG.d.cts.map → config-RLuR2o9A.d.cts.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-CZE0m6jd.cjs → deploy-BitZLdnY.cjs} +12 -6
- package/dist/deploy-BitZLdnY.cjs.map +1 -0
- package/dist/{deploy-ClC53rc6.mjs → deploy-nmov4j0B.mjs} +12 -6
- package/dist/deploy-nmov4j0B.mjs.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-CZ1vZt21.mjs} +2 -2
- package/dist/{dokploy-D1UwQKm3.mjs.map → dokploy-CZ1vZt21.mjs.map} +1 -1
- package/dist/{dokploy-lwmH05zr.cjs → dokploy-Ce_VTytN.cjs} +2 -2
- package/dist/{dokploy-lwmH05zr.cjs.map → dokploy-Ce_VTytN.cjs.map} +1 -1
- package/dist/{encryption-D05sNwED.cjs → encryption-CDGRdcMr.cjs} +2 -2
- package/dist/{encryption-D05sNwED.cjs.map → encryption-CDGRdcMr.cjs.map} +1 -1
- package/dist/{encryption-DcrxWl1s.mjs → encryption-CmfPICSN.mjs} +2 -2
- package/dist/{encryption-DcrxWl1s.mjs.map → encryption-CmfPICSN.mjs.map} +1 -1
- package/dist/{engine-DmQS3XHX.mjs → engine-B37qBO5W.mjs} +117 -17
- package/dist/engine-B37qBO5W.mjs.map +1 -0
- package/dist/{engine-Cry1vwMz.cjs → engine-DL2-PW6m.cjs} +117 -17
- package/dist/engine-DL2-PW6m.cjs.map +1 -0
- package/dist/{github-BchWoiVx.cjs → github-C6qF8kHg.cjs} +2 -2
- package/dist/{github-BchWoiVx.cjs.map → github-C6qF8kHg.cjs.map} +1 -1
- package/dist/{github-CqYOP8cI.mjs → github-hjHHm7jM.mjs} +2 -2
- package/dist/{github-CqYOP8cI.mjs.map → github-hjHHm7jM.mjs.map} +1 -1
- package/dist/{index-DvoxuTqR.d.mts → index-DHyTqGG3.d.mts} +2 -2
- package/dist/{index-Bk3NY6DN.d.cts.map → index-DHyTqGG3.d.mts.map} +1 -1
- package/dist/{index-Bk3NY6DN.d.cts → index-Dg-UZ4Hm.d.cts} +2 -2
- package/dist/{index-DvoxuTqR.d.mts.map → index-Dg-UZ4Hm.d.cts.map} +1 -1
- package/dist/index.cjs +124 -448
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +118 -442
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-guck0NJK.mjs → migrate-CFFC3esE.mjs} +3 -3
- package/dist/{migrate-guck0NJK.mjs.map → migrate-CFFC3esE.mjs.map} +1 -1
- package/dist/{migrate-qKeGYq21.cjs → migrate-kA_j1TPK.cjs} +3 -3
- package/dist/{migrate-qKeGYq21.cjs.map → migrate-kA_j1TPK.cjs.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-Dp6arkI4.cjs → ready-BIuMw6wH.cjs} +66 -289
- package/dist/ready-BIuMw6wH.cjs.map +1 -0
- package/dist/{ready-xpoX11uu.mjs → ready-C0U0NYfB.mjs} +58 -281
- package/dist/ready-C0U0NYfB.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-CV4eQkDa.mjs} +3 -3
- package/dist/{resolve-BsXEXAUz.mjs.map → resolve-CV4eQkDa.mjs.map} +1 -1
- package/dist/{resolve-wEjEvbJ5.cjs → resolve-E5RfY0bm.cjs} +3 -3
- package/dist/{resolve-wEjEvbJ5.cjs.map → resolve-E5RfY0bm.cjs.map} +1 -1
- package/dist/{rollback-Bk91csFg.mjs → rollback-C-V-Rf4a.mjs} +4 -4
- package/dist/{rollback-Bk91csFg.mjs.map → rollback-C-V-Rf4a.mjs.map} +1 -1
- package/dist/{rollback-DmcU-efZ.cjs → rollback-QGwomD64.cjs} +4 -4
- package/dist/{rollback-DmcU-efZ.cjs.map → rollback-QGwomD64.cjs.map} +1 -1
- package/dist/{runtime-DHJhe4QI.d.mts → runtime-CWYLIeCU.d.mts} +2 -2
- package/dist/{runtime-CYAO4iZG.d.cts.map → runtime-CWYLIeCU.d.mts.map} +1 -1
- package/dist/{runtime-CYAO4iZG.d.cts → runtime-CmuQOT6A.d.cts} +2 -2
- package/dist/{runtime-DHJhe4QI.d.mts.map → runtime-CmuQOT6A.d.cts.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-DMjFPOhf.cjs} +942 -22
- package/dist/state-DMjFPOhf.cjs.map +1 -0
- package/dist/{state-BJFherj1.mjs → state-DtS2HEfi.mjs} +877 -17
- package/dist/state-DtS2HEfi.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-BLdCL4fB.d.mts} +17 -1
- package/dist/types-BLdCL4fB.d.mts.map +1 -0
- package/dist/{types-BD1jgA85.d.cts → types-DwCQCkC-.d.cts} +17 -1
- package/dist/types-DwCQCkC-.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-Bhr_XWWN.mjs.map +0 -1
- package/dist/OpenApiTsGenerator-DZZwHdDC.cjs.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-Dp6arkI4.cjs.map +0 -1
- package/dist/ready-xpoX11uu.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,21 +2,22 @@
|
|
|
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
|
|
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-DtS2HEfi.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 { t as SubscriberGenerator } from "./SubscriberGenerator-DZk_pKDh.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 { a as writeTestHarness, c as
|
|
15
|
+
import { a as writeTestHarness, c as eventsBackendsIn, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, o as cacheBackendsIn, s as driversFor, t as TEST_READY_ENV } from "./ready-C0U0NYfB.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-nmov4j0B.mjs";
|
|
18
|
+
import { a as stackDir, i as composeProject, o as dockerCompose, r as stackOverrideFile, t as composeTarget } from "./compose-9II-0IsK.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";
|
|
21
22
|
import { createRequire } from "node:module";
|
|
22
23
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
@@ -42,12 +43,10 @@ import { createServer as createServer$2 } from "http";
|
|
|
42
43
|
import { Http2ServerRequest } from "http2";
|
|
43
44
|
import { Readable as Readable$1 } from "stream";
|
|
44
45
|
import crypto from "crypto";
|
|
45
|
-
import { Cron } from "@geekmidas/constructs/crons";
|
|
46
46
|
import { Function } from "@geekmidas/constructs/functions";
|
|
47
|
-
import { Queue } from "@geekmidas/constructs/queue";
|
|
48
47
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
49
48
|
//#region package.json
|
|
50
|
-
var version = "10.0.0-alpha.
|
|
49
|
+
var version = "10.0.0-alpha.73";
|
|
51
50
|
//#endregion
|
|
52
51
|
//#region src/prompt.ts
|
|
53
52
|
/**
|
|
@@ -130,7 +129,7 @@ const logger$8 = console;
|
|
|
130
129
|
* Validate Dokploy token by making a test API call
|
|
131
130
|
*/
|
|
132
131
|
async function validateDokployToken(endpoint, token) {
|
|
133
|
-
const { DokployApi } = await import("./sniffer-
|
|
132
|
+
const { DokployApi } = await import("./sniffer-BFmdZpZ2.mjs").then((n) => n.c);
|
|
134
133
|
return new DokployApi({
|
|
135
134
|
baseUrl: endpoint,
|
|
136
135
|
token
|
|
@@ -1674,6 +1673,7 @@ async function devCommand(options) {
|
|
|
1674
1673
|
target: "server",
|
|
1675
1674
|
enableOpenApi,
|
|
1676
1675
|
cacheBackend: cacheBackendFor(providerOf(workspace ?? config)),
|
|
1676
|
+
eventsBackend: eventsBackendFor(providerOf(workspace ?? config)),
|
|
1677
1677
|
telescope,
|
|
1678
1678
|
databaseApi: true,
|
|
1679
1679
|
hooks,
|
|
@@ -2035,9 +2035,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2035
2035
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2036
2036
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2037
2037
|
if (options.migrate || options.seed) {
|
|
2038
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
2038
|
+
const { prepareDevDatabases } = await import("./migrate-CFFC3esE.mjs");
|
|
2039
2039
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2040
|
-
} else await import("./migrate-
|
|
2040
|
+
} else await import("./migrate-CFFC3esE.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2041
2041
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2042
2042
|
});
|
|
2043
2043
|
const appUrls = {};
|
|
@@ -2596,222 +2596,6 @@ var DevServer = class {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
};
|
|
2598
2598
|
//#endregion
|
|
2599
|
-
//#region src/generators/CronGenerator.ts
|
|
2600
|
-
var CronGenerator = class extends ConstructGenerator {
|
|
2601
|
-
async build(context, constructs, outputDir, options) {
|
|
2602
|
-
const target = options?.target ?? "aws";
|
|
2603
|
-
const logger = console;
|
|
2604
|
-
const cronInfos = [];
|
|
2605
|
-
if (target === "server") {
|
|
2606
|
-
await this.generateServerCronsFile(outputDir, constructs);
|
|
2607
|
-
logger.log(`Generated server crons file with ${constructs.length} crons`);
|
|
2608
|
-
return cronInfos;
|
|
2609
|
-
}
|
|
2610
|
-
if (constructs.length === 0) return cronInfos;
|
|
2611
|
-
const cronsDir = join(outputDir, "crons");
|
|
2612
|
-
await mkdir(cronsDir, { recursive: true });
|
|
2613
|
-
for (const { key, construct, path } of constructs) {
|
|
2614
|
-
const handlerFile = await this.generateCronHandler(cronsDir, path.relative, key, context, construct.owner);
|
|
2615
|
-
cronInfos.push({
|
|
2616
|
-
name: key,
|
|
2617
|
-
handler: relative(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2618
|
-
schedule: construct.schedule || "rate(1 hour)",
|
|
2619
|
-
timeout: construct.timeout,
|
|
2620
|
-
memorySize: construct.memorySize,
|
|
2621
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2622
|
-
dependencies: construct.constructs
|
|
2623
|
-
});
|
|
2624
|
-
logger.log(`Generated cron handler: ${key}`);
|
|
2625
|
-
}
|
|
2626
|
-
return cronInfos;
|
|
2627
|
-
}
|
|
2628
|
-
isConstruct(value) {
|
|
2629
|
-
return Cron.isCron(value);
|
|
2630
|
-
}
|
|
2631
|
-
/**
|
|
2632
|
-
* The crons file a server entry imports.
|
|
2633
|
-
*
|
|
2634
|
-
* Shaped after `generateServerSubscribersFile`: one module, every cron, a
|
|
2635
|
-
* `setupCrons` the generated entry calls beside `setupSubscribers`.
|
|
2636
|
-
*
|
|
2637
|
-
* It picks its scheduler from what the process can reach. With a Postgres it
|
|
2638
|
-
* uses pg-boss, whose schedules live in the database — so a deployment
|
|
2639
|
-
* running four replicas fires each job once, which is the thing a timer in
|
|
2640
|
-
* every process gets wrong and does not report. With no database it falls
|
|
2641
|
-
* back to timers and says plainly that it is doing so.
|
|
2642
|
-
*/
|
|
2643
|
-
async generateServerCronsFile(outputDir, crons) {
|
|
2644
|
-
await mkdir(outputDir, { recursive: true });
|
|
2645
|
-
const cronsPath = join(outputDir, "crons.ts");
|
|
2646
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2647
|
-
for (const { path, key } of crons) {
|
|
2648
|
-
const importPath = relative(dirname(cronsPath), path.relative).replace(/\.ts$/, ".js");
|
|
2649
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2650
|
-
importsByFile.get(importPath)?.push(key);
|
|
2651
|
-
}
|
|
2652
|
-
const content = `/**
|
|
2653
|
-
* Generated cron setup.
|
|
2654
|
-
*
|
|
2655
|
-
* Schedules every cron this app declares, in the process that serves it.
|
|
2656
|
-
*
|
|
2657
|
-
* The schedule lives in Postgres, through pg-boss, in the database the worker
|
|
2658
|
-
* named with \`.database(db)\`. That is what makes running several replicas
|
|
2659
|
-
* safe: each job fires once, where a timer in every process fires it once per
|
|
2660
|
-
* replica and reports nothing.
|
|
2661
|
-
*
|
|
2662
|
-
* No connection string appears here. The construct that owns the database is
|
|
2663
|
-
* the only thing that knows its key, and it is resolved through service
|
|
2664
|
-
* discovery like any other dependency.
|
|
2665
|
-
*/
|
|
2666
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2667
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2668
|
-
import { runCron, scheduleInProcess, toCronExpression } from '@geekmidas/constructs/crons';
|
|
2669
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2670
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2671
|
-
|
|
2672
|
-
const crons = [
|
|
2673
|
-
${crons.map(({ key }) => ` { name: '${key}', cron: ${key} }`).join(",\n")}
|
|
2674
|
-
];
|
|
2675
|
-
|
|
2676
|
-
type Stoppable = { stop: () => Promise<void> | void };
|
|
2677
|
-
const running: Stoppable[] = [];
|
|
2678
|
-
|
|
2679
|
-
export async function setupCrons(
|
|
2680
|
-
envParser: EnvironmentParser<any>,
|
|
2681
|
-
logger: Logger,
|
|
2682
|
-
): Promise<void> {
|
|
2683
|
-
if (crons.length === 0) {
|
|
2684
|
-
return;
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2688
|
-
|
|
2689
|
-
// Resolved once per cron rather than per firing: registering services on
|
|
2690
|
-
// every tick would reconnect a database every minute.
|
|
2691
|
-
const prepared = [];
|
|
2692
|
-
for (const { name, cron } of crons) {
|
|
2693
|
-
try {
|
|
2694
|
-
const schedule = toCronExpression(cron.schedule);
|
|
2695
|
-
const services = cron.services.length > 0
|
|
2696
|
-
? await serviceDiscovery.register(cron.services)
|
|
2697
|
-
: {};
|
|
2698
|
-
|
|
2699
|
-
prepared.push({ name, cron, schedule, services });
|
|
2700
|
-
} catch (error) {
|
|
2701
|
-
// An unrepresentable schedule is a build-time mistake, and failing the
|
|
2702
|
-
// process for it would take the HTTP server down with it.
|
|
2703
|
-
logger.error({ err: error, cron: name }, 'Cron has no runnable schedule, skipping');
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
|
-
const run = async (entry: (typeof prepared)[number]) => {
|
|
2708
|
-
try {
|
|
2709
|
-
// The cron's own function, the way its Lambda would run it — services,
|
|
2710
|
-
// the worker's database as \`db\`, its events. It used to call a
|
|
2711
|
-
// \`handler\` a Cron does not have, so every firing logged a failure.
|
|
2712
|
-
await runCron(entry.cron, serviceDiscovery);
|
|
2713
|
-
} catch (error) {
|
|
2714
|
-
logger.error({ err: error, cron: entry.name }, 'Cron failed');
|
|
2715
|
-
}
|
|
2716
|
-
};
|
|
2717
|
-
|
|
2718
|
-
// The app's one pg-boss: the events broker's, as the broker's role, in the
|
|
2719
|
-
// broker's schema. A server fires its own crons, and a process scheduling in
|
|
2720
|
-
// memory fires each job once per replica — so the schedule lives in
|
|
2721
|
-
// Postgres. It used to be a second pg-boss on the worker's database, as the
|
|
2722
|
-
// runtime role, which can neither create a schema nor use the broker's.
|
|
2723
|
-
const { url, devPid } = envParser
|
|
2724
|
-
.create((get) => ({
|
|
2725
|
-
url: get('EVENT_PUBLISHER_CONNECTION_STRING').string().optional(),
|
|
2726
|
-
// Set by \`gkm dev\` on the server it starts, and by nothing deployed.
|
|
2727
|
-
devPid: get('GKM_DEV_PID').string().optional(),
|
|
2728
|
-
}))
|
|
2729
|
-
.parse();
|
|
2730
|
-
|
|
2731
|
-
if (!url?.startsWith('pgboss://')) {
|
|
2732
|
-
// \`gkm dev\` on a target whose crons are infrastructure once deployed —
|
|
2733
|
-
// EventBridge rules on AWS — has no broker to keep a schedule in. It is one
|
|
2734
|
-
// process, so a timer fires each job once, which is all pg-boss is for
|
|
2735
|
-
// here. Only there: a deployed server firing by timer fires once per
|
|
2736
|
-
// replica, so outside dev this stays the error below.
|
|
2737
|
-
if (devPid) {
|
|
2738
|
-
for (const entry of prepared) {
|
|
2739
|
-
running.push(scheduleInProcess(entry.schedule, () => run(entry)));
|
|
2740
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled in this process');
|
|
2741
|
-
}
|
|
2742
|
-
return;
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2745
|
-
logger.error(
|
|
2746
|
-
{ crons: prepared.map(({ name }) => name) },
|
|
2747
|
-
'These crons have nowhere to keep their schedule. On a server they are ' +
|
|
2748
|
-
'scheduled through the pg-boss events broker ' +
|
|
2749
|
-
'(EVENT_PUBLISHER_CONNECTION_STRING), and ' +
|
|
2750
|
-
(url ? 'the broker configured is not pg-boss.' : 'none is configured.'),
|
|
2751
|
-
);
|
|
2752
|
-
return;
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
const { PgBossConnection } = await import('@geekmidas/events/pgboss');
|
|
2756
|
-
const connection = await PgBossConnection.fromConnectionString(url);
|
|
2757
|
-
const boss = connection.instance!;
|
|
2758
|
-
|
|
2759
|
-
// What this app declares now. Anything else under the prefix belonged to a
|
|
2760
|
-
// cron since renamed or deleted, and would keep firing at a handler that has
|
|
2761
|
-
// gone.
|
|
2762
|
-
//
|
|
2763
|
-
// The prefix is \`cron.\` rather than \`cron:\`: pg-boss accepts
|
|
2764
|
-
// alphanumerics, underscores, hyphens, periods and slashes in a queue name,
|
|
2765
|
-
// and rejects a colon outright.
|
|
2766
|
-
const declared = new Set(prepared.map(({ name }) => \`cron.\${name}\`));
|
|
2767
|
-
for (const existing of await boss.getSchedules()) {
|
|
2768
|
-
if (existing.name.startsWith('cron.') && !declared.has(existing.name)) {
|
|
2769
|
-
await boss.unschedule(existing.name);
|
|
2770
|
-
logger.info({ cron: existing.name }, 'Removed a schedule nothing declares');
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
|
-
for (const entry of prepared) {
|
|
2775
|
-
const queue = \`cron.\${entry.name}\`;
|
|
2776
|
-
await boss.createQueue(queue);
|
|
2777
|
-
// UTC, so this agrees with the schedule a deploy target would have made.
|
|
2778
|
-
await boss.schedule(queue, entry.schedule, undefined, { tz: 'UTC' });
|
|
2779
|
-
await boss.work(queue, () => run(entry));
|
|
2780
|
-
|
|
2781
|
-
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled');
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
running.push({ stop: () => connection.close() });
|
|
2785
|
-
logger.info({ count: prepared.length }, 'Crons scheduled');
|
|
2786
|
-
}
|
|
2787
|
-
|
|
2788
|
-
export async function stopCrons(): Promise<void> {
|
|
2789
|
-
await Promise.all(running.map((r) => r.stop()));
|
|
2790
|
-
running.length = 0;
|
|
2791
|
-
}
|
|
2792
|
-
`;
|
|
2793
|
-
await writeFile(cronsPath, content);
|
|
2794
|
-
return cronsPath;
|
|
2795
|
-
}
|
|
2796
|
-
async generateCronHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2797
|
-
const handlerFileName = `${exportName}.ts`;
|
|
2798
|
-
const handlerPath = join(outputDir, handlerFileName);
|
|
2799
|
-
const importPath = relative(dirname(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2800
|
-
const runtime = runtimeFor(context, dirname(handlerPath), owner);
|
|
2801
|
-
const content = `import { AWSScheduledFunction } from '@geekmidas/constructs/aws';
|
|
2802
|
-
import { ${exportName} } from '${importPath}';
|
|
2803
|
-
${runtime.imports}
|
|
2804
|
-
${runtime.bindings}
|
|
2805
|
-
|
|
2806
|
-
const adapter = new AWSScheduledFunction(envParser, ${exportName});
|
|
2807
|
-
|
|
2808
|
-
export const handler = adapter.handler;
|
|
2809
|
-
`;
|
|
2810
|
-
await writeFile(handlerPath, content);
|
|
2811
|
-
return handlerPath;
|
|
2812
|
-
}
|
|
2813
|
-
};
|
|
2814
|
-
//#endregion
|
|
2815
2599
|
//#region src/generators/FunctionGenerator.ts
|
|
2816
2600
|
var FunctionGenerator = class extends ConstructGenerator {
|
|
2817
2601
|
isConstruct(value) {
|
|
@@ -2846,8 +2630,9 @@ var FunctionGenerator = class extends ConstructGenerator {
|
|
|
2846
2630
|
const content = `import { AWSLambdaFunction } from '@geekmidas/constructs/aws';
|
|
2847
2631
|
import { ${exportName} } from '${importPath}';
|
|
2848
2632
|
${runtime.imports}
|
|
2633
|
+
${context.storageDrivers?.imports ?? ""}
|
|
2849
2634
|
${runtime.bindings}
|
|
2850
|
-
|
|
2635
|
+
${context.storageDrivers?.setup ? `\n// The handler registers the drivers its target needs.\n${context.storageDrivers.setup}\n` : ""}
|
|
2851
2636
|
const adapter = new AWSLambdaFunction(envParser, ${exportName});
|
|
2852
2637
|
|
|
2853
2638
|
export const handler = adapter.handler;
|
|
@@ -2857,177 +2642,6 @@ export const handler = adapter.handler;
|
|
|
2857
2642
|
}
|
|
2858
2643
|
};
|
|
2859
2644
|
//#endregion
|
|
2860
|
-
//#region src/generators/QueueGenerator.ts
|
|
2861
|
-
/**
|
|
2862
|
-
* Generates the runtime for queue consumers (`worker.queue(…)`).
|
|
2863
|
-
*
|
|
2864
|
-
* - **server** (`gkm dev`): a single `queues.ts` exposing `setupQueues()` that
|
|
2865
|
-
* polls each queue in-process, alongside the Hono server, through the queue's
|
|
2866
|
-
* own connection string — pg-boss by default, SQS on the AWS emulator.
|
|
2867
|
-
* - **aws-lambda**: one handler file per queue wrapping `AWSLambdaQueue`, backed
|
|
2868
|
-
* by an SQS event-source mapping.
|
|
2869
|
-
*/
|
|
2870
|
-
var QueueGenerator = class extends ConstructGenerator {
|
|
2871
|
-
isConstruct(value) {
|
|
2872
|
-
return Queue.isQueue(value);
|
|
2873
|
-
}
|
|
2874
|
-
async build(context, constructs, outputDir, options) {
|
|
2875
|
-
const target = options?.target ?? "aws";
|
|
2876
|
-
const logger = console;
|
|
2877
|
-
const queueInfos = [];
|
|
2878
|
-
if (target === "server") {
|
|
2879
|
-
await this.generateServerQueuesFile(outputDir, constructs);
|
|
2880
|
-
logger.log(`Generated server queues file with ${constructs.length} queues (polling mode)`);
|
|
2881
|
-
return queueInfos;
|
|
2882
|
-
}
|
|
2883
|
-
if (constructs.length === 0) return queueInfos;
|
|
2884
|
-
const queuesDir = join(outputDir, "queues");
|
|
2885
|
-
await mkdir(queuesDir, { recursive: true });
|
|
2886
|
-
for (const { key, construct, path } of constructs) {
|
|
2887
|
-
const handlerFile = await this.generateQueueHandler(queuesDir, path.relative, key, context, construct.owner);
|
|
2888
|
-
queueInfos.push({
|
|
2889
|
-
name: construct.name,
|
|
2890
|
-
handler: relative(options?.root ?? process.cwd(), handlerFile).replace(/\.ts$/, ".handler"),
|
|
2891
|
-
batchSize: construct.batchSize,
|
|
2892
|
-
fifo: construct.fifo,
|
|
2893
|
-
timeout: construct.timeout,
|
|
2894
|
-
environment: await construct.getEnvironment({ markOptional: context.markOptional }),
|
|
2895
|
-
dependencies: construct.constructs
|
|
2896
|
-
});
|
|
2897
|
-
logger.log(`Generated queue handler: ${key}`);
|
|
2898
|
-
}
|
|
2899
|
-
return queueInfos;
|
|
2900
|
-
}
|
|
2901
|
-
async generateQueueHandler(outputDir, sourceFile, exportName, context, owner) {
|
|
2902
|
-
const handlerPath = join(outputDir, `${exportName}.ts`);
|
|
2903
|
-
const importPath = relative(dirname(handlerPath), sourceFile).replace(/\.ts$/, ".js");
|
|
2904
|
-
const runtime = runtimeFor(context, dirname(handlerPath), owner);
|
|
2905
|
-
const content = `import { AWSLambdaQueue } from '@geekmidas/constructs/aws';
|
|
2906
|
-
import { ${exportName} } from '${importPath}';
|
|
2907
|
-
${runtime.imports}
|
|
2908
|
-
${runtime.bindings}
|
|
2909
|
-
|
|
2910
|
-
const adapter = new AWSLambdaQueue(envParser, ${exportName});
|
|
2911
|
-
|
|
2912
|
-
export const handler = adapter.handler;
|
|
2913
|
-
`;
|
|
2914
|
-
await writeFile(handlerPath, content);
|
|
2915
|
-
return handlerPath;
|
|
2916
|
-
}
|
|
2917
|
-
async generateServerQueuesFile(outputDir, queues) {
|
|
2918
|
-
await mkdir(outputDir, { recursive: true });
|
|
2919
|
-
const queuesPath = join(outputDir, "queues.ts");
|
|
2920
|
-
if (queues.length === 0) {
|
|
2921
|
-
await writeFile(queuesPath, `/**
|
|
2922
|
-
* Generated queues setup — this app declares none.
|
|
2923
|
-
*/
|
|
2924
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2925
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2926
|
-
|
|
2927
|
-
export async function setupQueues(
|
|
2928
|
-
_envParser: EnvironmentParser<any>,
|
|
2929
|
-
_logger: Logger,
|
|
2930
|
-
): Promise<void> {}
|
|
2931
|
-
`);
|
|
2932
|
-
return queuesPath;
|
|
2933
|
-
}
|
|
2934
|
-
const importsByFile = /* @__PURE__ */ new Map();
|
|
2935
|
-
for (const { path, key } of queues) {
|
|
2936
|
-
const importPath = relative(dirname(queuesPath), path.relative).replace(/\.ts$/, ".js");
|
|
2937
|
-
if (!importsByFile.has(importPath)) importsByFile.set(importPath, []);
|
|
2938
|
-
importsByFile.get(importPath)?.push(key);
|
|
2939
|
-
}
|
|
2940
|
-
const content = `/**
|
|
2941
|
-
* Generated queue consumers setup.
|
|
2942
|
-
*
|
|
2943
|
-
* Each queue's one consumer polls its own queue, through the queue's own
|
|
2944
|
-
* connection string — the one its producers publish on. SQS cannot push, so
|
|
2945
|
-
* this is a poller on every transport: pg-boss locally by default, the SQS
|
|
2946
|
-
* queue on the AWS emulator.
|
|
2947
|
-
*
|
|
2948
|
-
* Deployed on Lambda, a queue's consumer is an SQS event source instead.
|
|
2949
|
-
*/
|
|
2950
|
-
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2951
|
-
import type { Logger } from '@geekmidas/logger';
|
|
2952
|
-
import { EventConnectionFactory, Subscriber } from '@geekmidas/events';
|
|
2953
|
-
import type { EventConnection } from '@geekmidas/events';
|
|
2954
|
-
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2955
|
-
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2956
|
-
|
|
2957
|
-
const queues = [
|
|
2958
|
-
${queues.map(({ key, construct }) => ` { queue: ${key}, connectionKey: '${provideKey(construct.id, "publisherConnectionString")}' },`).join("\n")}
|
|
2959
|
-
];
|
|
2960
|
-
|
|
2961
|
-
export async function setupQueues(
|
|
2962
|
-
envParser: EnvironmentParser<any>,
|
|
2963
|
-
logger: Logger,
|
|
2964
|
-
): Promise<void> {
|
|
2965
|
-
const serviceDiscovery = ServiceDiscovery.getInstance(envParser);
|
|
2966
|
-
const connections = new Map<string, EventConnection>();
|
|
2967
|
-
|
|
2968
|
-
for (const { queue, connectionKey } of queues) {
|
|
2969
|
-
const connectionString = process.env[connectionKey];
|
|
2970
|
-
if (!connectionString) {
|
|
2971
|
-
logger.error({ queue: queue.name, connectionKey }, 'No connection string for this queue');
|
|
2972
|
-
continue;
|
|
2973
|
-
}
|
|
2974
|
-
|
|
2975
|
-
try {
|
|
2976
|
-
let connection = connections.get(connectionString);
|
|
2977
|
-
if (!connection) {
|
|
2978
|
-
connection = await EventConnectionFactory.fromConnectionString(connectionString);
|
|
2979
|
-
connections.set(connectionString, connection);
|
|
2980
|
-
}
|
|
2981
|
-
const eventSubscriber = await Subscriber.fromConnection(connection);
|
|
2982
|
-
const services = queue.services.length > 0
|
|
2983
|
-
? await serviceDiscovery.register(queue.services)
|
|
2984
|
-
: {};
|
|
2985
|
-
// The queue's database — the worker's, or its own — handed over as \`db\`.
|
|
2986
|
-
const db = queue.databaseService
|
|
2987
|
-
? (await serviceDiscovery.register([queue.databaseService]))[
|
|
2988
|
-
queue.databaseService.serviceName
|
|
2989
|
-
]
|
|
2990
|
-
: undefined;
|
|
2991
|
-
|
|
2992
|
-
// A queue's messages carry one type — its own name.
|
|
2993
|
-
await eventSubscriber.subscribe([queue.name], async (message) => {
|
|
2994
|
-
try {
|
|
2995
|
-
const validation = await queue.messageSchema['~standard'].validate(message.payload);
|
|
2996
|
-
if (validation.issues) {
|
|
2997
|
-
logger.error({ issues: validation.issues, queue: queue.name }, 'Queue message failed validation');
|
|
2998
|
-
return;
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
await queue.handler({
|
|
3002
|
-
messages: [validation.value],
|
|
3003
|
-
services: services,
|
|
3004
|
-
logger: queue.logger,
|
|
3005
|
-
db,
|
|
3006
|
-
} as any);
|
|
3007
|
-
} catch (error) {
|
|
3008
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to process queue message');
|
|
3009
|
-
// Rethrown so the transport keeps the message for a retry.
|
|
3010
|
-
throw error;
|
|
3011
|
-
}
|
|
3012
|
-
});
|
|
3013
|
-
logger.info({ queue: queue.name }, 'Queue consumer started polling');
|
|
3014
|
-
} catch (error) {
|
|
3015
|
-
logger.error({ err: error, queue: queue.name }, 'Failed to set up queue consumer');
|
|
3016
|
-
}
|
|
3017
|
-
}
|
|
3018
|
-
|
|
3019
|
-
const shutdown = () => {
|
|
3020
|
-
for (const connection of connections.values()) void connection.close();
|
|
3021
|
-
};
|
|
3022
|
-
process.once('SIGTERM', shutdown);
|
|
3023
|
-
process.once('SIGINT', shutdown);
|
|
3024
|
-
}
|
|
3025
|
-
`;
|
|
3026
|
-
await writeFile(queuesPath, content);
|
|
3027
|
-
return queuesPath;
|
|
3028
|
-
}
|
|
3029
|
-
};
|
|
3030
|
-
//#endregion
|
|
3031
2645
|
//#region src/generators/TopicGenerator.ts
|
|
3032
2646
|
/**
|
|
3033
2647
|
* Discovers topics (`new Topic(…)`) into `manifest.topics`. A topic is a
|
|
@@ -3336,6 +2950,7 @@ function backendsOf(workspace) {
|
|
|
3336
2950
|
async function buildOneApp(input) {
|
|
3337
2951
|
const { config, options, workspace, appRoot, target } = input;
|
|
3338
2952
|
const cacheBackend = cacheBackendFor(providerOf(workspace));
|
|
2953
|
+
const eventsBackend = eventsBackendFor(providerOf(workspace));
|
|
3339
2954
|
const production = normalizeProductionConfig(options.production ?? false);
|
|
3340
2955
|
if (production) logger$4.log(`🏭 Building for PRODUCTION`);
|
|
3341
2956
|
logger$4.log(`Building for ${target}`);
|
|
@@ -3351,13 +2966,15 @@ async function buildOneApp(input) {
|
|
|
3351
2966
|
target,
|
|
3352
2967
|
enableOpenApi: options.enableOpenApi ?? false,
|
|
3353
2968
|
cacheBackend,
|
|
2969
|
+
eventsBackend,
|
|
3354
2970
|
production,
|
|
3355
2971
|
telescope,
|
|
3356
2972
|
hooks,
|
|
3357
2973
|
markOptional: options.markOptional ?? false,
|
|
3358
2974
|
skipBundle: options.skipBundle ?? false,
|
|
3359
2975
|
stage: options.stage,
|
|
3360
|
-
workspaceName: workspace.name
|
|
2976
|
+
workspaceName: workspace.name,
|
|
2977
|
+
workspace
|
|
3361
2978
|
});
|
|
3362
2979
|
}
|
|
3363
2980
|
/**
|
|
@@ -3396,14 +3013,16 @@ async function writeManifest(input) {
|
|
|
3396
3013
|
* dev did not, and failed on exactly the apps the build had learned to handle.
|
|
3397
3014
|
*/
|
|
3398
3015
|
async function buildApp(input) {
|
|
3399
|
-
const { config, workspaceRoot, appRoot, target, enableOpenApi, cacheBackend, production, telescope, databaseApi, hooks, bustCache = false } = input;
|
|
3016
|
+
const { config, workspaceRoot, appRoot, target, enableOpenApi, cacheBackend, eventsBackend, production, telescope, databaseApi, hooks, bustCache = false } = input;
|
|
3400
3017
|
const constructGlobs = config.constructs;
|
|
3401
3018
|
const constructSources = {};
|
|
3019
|
+
const background = {};
|
|
3402
3020
|
const declared = constructGlobs ? await discover({
|
|
3403
3021
|
patterns: constructGlobs,
|
|
3404
3022
|
cwd: appRoot,
|
|
3405
3023
|
bustCache,
|
|
3406
|
-
sources: constructSources
|
|
3024
|
+
sources: constructSources,
|
|
3025
|
+
background
|
|
3407
3026
|
}) : {};
|
|
3408
3027
|
const selfServing = selfServingSurface({
|
|
3409
3028
|
declared,
|
|
@@ -3417,7 +3036,7 @@ async function buildApp(input) {
|
|
|
3417
3036
|
if (production?.bundle && !input.skipBundle) {
|
|
3418
3037
|
const outputDir = join(appRoot, ".gkm", "server");
|
|
3419
3038
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3420
|
-
const { bundleServer } = await import("./bundler-
|
|
3039
|
+
const { bundleServer } = await import("./bundler-C2LZoLdP.mjs");
|
|
3421
3040
|
await bundleServer({
|
|
3422
3041
|
entryPoint,
|
|
3423
3042
|
outputDir: join(outputDir, "dist"),
|
|
@@ -3437,6 +3056,7 @@ async function buildApp(input) {
|
|
|
3437
3056
|
appRoot,
|
|
3438
3057
|
databaseApi
|
|
3439
3058
|
});
|
|
3059
|
+
const eventsBackends = eventsBackendsIn(declared, eventsBackend);
|
|
3440
3060
|
const buildContext = {
|
|
3441
3061
|
...derived,
|
|
3442
3062
|
telescope,
|
|
@@ -3447,8 +3067,10 @@ async function buildApp(input) {
|
|
|
3447
3067
|
emailBackend: "ses",
|
|
3448
3068
|
storageDrivers: driversFor({
|
|
3449
3069
|
appRoot,
|
|
3450
|
-
cache: cacheBackendsIn(declared, cacheBackend)
|
|
3070
|
+
cache: cacheBackendsIn(declared, cacheBackend),
|
|
3071
|
+
events: eventsBackends
|
|
3451
3072
|
}),
|
|
3073
|
+
eventsBackends,
|
|
3452
3074
|
markOptional: input.markOptional ?? false,
|
|
3453
3075
|
...production && { telemetry: telemetryFor({
|
|
3454
3076
|
appRoot,
|
|
@@ -3495,6 +3117,19 @@ async function buildApp(input) {
|
|
|
3495
3117
|
if (left.length > 0) logger$4.log(`Serving ${derived.surface.id} only: leaving out ${left.join(", ")} — they run in a Worker's image`);
|
|
3496
3118
|
}
|
|
3497
3119
|
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);
|
|
3120
|
+
if (target === "server" && production?.enabled && input.workspace) {
|
|
3121
|
+
const appName = Object.entries(input.workspace.apps).find(([, app]) => resolve(input.workspace.root, app.path) === resolve(appRoot))?.[0];
|
|
3122
|
+
await buildWorkers({
|
|
3123
|
+
context: buildContext,
|
|
3124
|
+
workers: workerUnits(input.workspace, declared, background).filter((unit) => unit.app === appName),
|
|
3125
|
+
serverDir: join(appRoot, ".gkm", "server"),
|
|
3126
|
+
crons: allCrons,
|
|
3127
|
+
queues: allQueues,
|
|
3128
|
+
subscribers: allSubscribers,
|
|
3129
|
+
bundle: Boolean(production.bundle && !input.skipBundle),
|
|
3130
|
+
...input.stage ? { stage: input.stage } : {}
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3498
3133
|
await generateOpenApi(allEndpoints.map(({ construct }) => construct), {
|
|
3499
3134
|
openapi: config.openapi,
|
|
3500
3135
|
root: workspaceRoot
|
|
@@ -3504,6 +3139,46 @@ async function buildApp(input) {
|
|
|
3504
3139
|
...buildContext.databaseApi ? { databaseApi: buildContext.databaseApi.path } : {}
|
|
3505
3140
|
};
|
|
3506
3141
|
}
|
|
3142
|
+
/**
|
|
3143
|
+
* Write each worker's entry — and, for an image, bundle it — from the
|
|
3144
|
+
* runnables built from that worker, and nothing built from another.
|
|
3145
|
+
*/
|
|
3146
|
+
async function buildWorkers(input) {
|
|
3147
|
+
const generator = new WorkerGenerator();
|
|
3148
|
+
for (const worker of input.workers) {
|
|
3149
|
+
const owned = (list) => list.filter(({ construct }) => construct.owner === worker.id);
|
|
3150
|
+
const crons = owned(input.crons);
|
|
3151
|
+
const queues = owned(input.queues);
|
|
3152
|
+
const subscribers = owned(input.subscribers);
|
|
3153
|
+
const entryPoint = await generator.build({
|
|
3154
|
+
context: input.context,
|
|
3155
|
+
workerId: worker.id,
|
|
3156
|
+
outputDir: workerEntryDir(input.serverDir, worker.id),
|
|
3157
|
+
crons,
|
|
3158
|
+
queues,
|
|
3159
|
+
subscribers
|
|
3160
|
+
});
|
|
3161
|
+
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3162
|
+
if (!input.bundle) continue;
|
|
3163
|
+
const { bundleServer } = await import("./bundler-C2LZoLdP.mjs");
|
|
3164
|
+
const outfile = workerBundleName(worker.id);
|
|
3165
|
+
await bundleServer({
|
|
3166
|
+
entryPoint,
|
|
3167
|
+
outputDir: join(input.serverDir, "dist"),
|
|
3168
|
+
outfile,
|
|
3169
|
+
minify: input.context.production?.minify ?? false,
|
|
3170
|
+
sourcemap: false,
|
|
3171
|
+
external: input.context.production?.external ?? [],
|
|
3172
|
+
...input.stage ? { stage: input.stage } : {},
|
|
3173
|
+
constructs: [
|
|
3174
|
+
...crons,
|
|
3175
|
+
...queues,
|
|
3176
|
+
...subscribers
|
|
3177
|
+
].map((c) => c.construct)
|
|
3178
|
+
});
|
|
3179
|
+
logger$4.log(`✅ Bundle complete: .gkm/server/dist/${outfile}`);
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3507
3182
|
async function buildForTarget(target, context, appRoot, workspaceRoot, endpointGenerator, functionGenerator, cronGenerator, subscriberGenerator, queueGenerator, topicGenerator, endpoints, functions, crons, subscribers, queues, topics, enableOpenApi, skipBundle, stage) {
|
|
3508
3183
|
const outputDir = join(appRoot, ".gkm", target);
|
|
3509
3184
|
await Promise.all([...SUPERSEDED_OUTPUT.map((dir) => join(appRoot, ".gkm", dir)), ...appRoot === workspaceRoot ? [] : [join(appRoot, ".gkm", "manifest")]].map((dir) => rm(dir, {
|
|
@@ -3555,7 +3230,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3555
3230
|
let masterKey;
|
|
3556
3231
|
if (context.production?.bundle && !skipBundle) {
|
|
3557
3232
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3558
|
-
const { bundleServer } = await import("./bundler-
|
|
3233
|
+
const { bundleServer } = await import("./bundler-C2LZoLdP.mjs");
|
|
3559
3234
|
const allConstructs = [
|
|
3560
3235
|
...endpoints.map((e) => e.construct),
|
|
3561
3236
|
...functions.map((f) => f.construct),
|
|
@@ -5254,25 +4929,25 @@ function loadPackageJson() {
|
|
|
5254
4929
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
5255
4930
|
*/
|
|
5256
4931
|
const GEEKMIDAS_VERSIONS = {
|
|
5257
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
5258
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
5259
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
5260
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
5261
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
5262
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
5263
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
5264
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
5265
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
5266
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
5267
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
5268
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
5269
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
5270
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
5271
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
5272
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
5273
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
5274
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
5275
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
4932
|
+
"@geekmidas/audit": "~10.0.0-alpha.73",
|
|
4933
|
+
"@geekmidas/auth": "~10.0.0-alpha.73",
|
|
4934
|
+
"@geekmidas/cache": "~10.0.0-alpha.73",
|
|
4935
|
+
"@geekmidas/client": "~10.0.0-alpha.73",
|
|
4936
|
+
"@geekmidas/cloud": "~10.0.0-alpha.73",
|
|
4937
|
+
"@geekmidas/constructs": "~10.0.0-alpha.73",
|
|
4938
|
+
"@geekmidas/db": "~10.0.0-alpha.73",
|
|
4939
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.73",
|
|
4940
|
+
"@geekmidas/envkit": "~10.0.0-alpha.73",
|
|
4941
|
+
"@geekmidas/errors": "~10.0.0-alpha.73",
|
|
4942
|
+
"@geekmidas/events": "~10.0.0-alpha.73",
|
|
4943
|
+
"@geekmidas/logger": "~10.0.0-alpha.73",
|
|
4944
|
+
"@geekmidas/manifest": "~10.0.0-alpha.73",
|
|
4945
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.73",
|
|
4946
|
+
"@geekmidas/schema": "~10.0.0-alpha.73",
|
|
4947
|
+
"@geekmidas/services": "~10.0.0-alpha.73",
|
|
4948
|
+
"@geekmidas/storage": "~10.0.0-alpha.73",
|
|
4949
|
+
"@geekmidas/telescope": "~10.0.0-alpha.73",
|
|
4950
|
+
"@geekmidas/testkit": "~10.0.0-alpha.73",
|
|
5276
4951
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
5277
4952
|
};
|
|
5278
4953
|
//#endregion
|
|
@@ -10988,6 +10663,7 @@ async function testCommand(options = {}) {
|
|
|
10988
10663
|
targets: [workspace.root, ...Object.values(workspace.apps).map((app) => isAbsolute(app.path) ? app.path : join(workspace.root, app.path))],
|
|
10989
10664
|
patterns: constructGlobs(workspace),
|
|
10990
10665
|
cacheBackend: backendsOf$1(workspace).cache,
|
|
10666
|
+
eventsBackend: backendsOf$1(workspace).events,
|
|
10991
10667
|
stage: TEST_STAGE,
|
|
10992
10668
|
env: finalCredentials,
|
|
10993
10669
|
factories: join(workspace.root, workspace.test.factories ?? "test/factories")
|
|
@@ -11062,8 +10738,8 @@ function testDatabases(reconciled) {
|
|
|
11062
10738
|
* starts without the reference data the app needs.
|
|
11063
10739
|
*/
|
|
11064
10740
|
async function migrateTestStage(workspace, env) {
|
|
11065
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
11066
|
-
const { discover } = await import("./discover-
|
|
10741
|
+
const { migrateAndSeed } = await import("./migrate-CFFC3esE.mjs");
|
|
10742
|
+
const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
|
|
11067
10743
|
const sources = {};
|
|
11068
10744
|
const manifest = await discover({
|
|
11069
10745
|
patterns: constructGlobs(workspace),
|
|
@@ -11493,7 +11169,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11493
11169
|
try {
|
|
11494
11170
|
const globalOptions = program.opts();
|
|
11495
11171
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11496
|
-
const { migrateCommand } = await import("./migrate-
|
|
11172
|
+
const { migrateCommand } = await import("./migrate-CFFC3esE.mjs");
|
|
11497
11173
|
await migrateCommand({
|
|
11498
11174
|
...options,
|
|
11499
11175
|
...construct ? { construct } : {}
|
|
@@ -11507,7 +11183,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11507
11183
|
try {
|
|
11508
11184
|
const globalOptions = program.opts();
|
|
11509
11185
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11510
|
-
const { seedCommand } = await import("./migrate-
|
|
11186
|
+
const { seedCommand } = await import("./migrate-CFFC3esE.mjs");
|
|
11511
11187
|
await seedCommand({
|
|
11512
11188
|
...options,
|
|
11513
11189
|
...construct ? { construct } : {}
|
|
@@ -11521,7 +11197,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11521
11197
|
try {
|
|
11522
11198
|
const globalOptions = program.opts();
|
|
11523
11199
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11524
|
-
const { migrationCommand } = await import("./migrate-
|
|
11200
|
+
const { migrationCommand } = await import("./migrate-CFFC3esE.mjs");
|
|
11525
11201
|
await migrationCommand({
|
|
11526
11202
|
construct,
|
|
11527
11203
|
...name ? { name } : {}
|
|
@@ -11615,7 +11291,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11615
11291
|
try {
|
|
11616
11292
|
const globalOptions = program.opts();
|
|
11617
11293
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11618
|
-
const { secretsAddCommand } = await import("./add-
|
|
11294
|
+
const { secretsAddCommand } = await import("./add-BiPlBUq3.mjs");
|
|
11619
11295
|
await secretsAddCommand(options);
|
|
11620
11296
|
} catch (error) {
|
|
11621
11297
|
console.error(formatError(error));
|
|
@@ -11626,7 +11302,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11626
11302
|
try {
|
|
11627
11303
|
const globalOptions = program.opts();
|
|
11628
11304
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11629
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
11305
|
+
const { encryptionRotateCommand } = await import("./encryption-CmfPICSN.mjs");
|
|
11630
11306
|
await encryptionRotateCommand(construct, options);
|
|
11631
11307
|
} catch (error) {
|
|
11632
11308
|
console.error(formatError(error));
|
|
@@ -11637,7 +11313,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11637
11313
|
try {
|
|
11638
11314
|
const globalOptions = program.opts();
|
|
11639
11315
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11640
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
11316
|
+
const { encryptionRetireCommand } = await import("./encryption-CmfPICSN.mjs");
|
|
11641
11317
|
await encryptionRetireCommand(construct, key, options);
|
|
11642
11318
|
} catch (error) {
|
|
11643
11319
|
console.error(formatError(error));
|
|
@@ -11680,7 +11356,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11680
11356
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11681
11357
|
const { loadWorkspaceConfig } = await import("./config.mjs");
|
|
11682
11358
|
const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
|
|
11683
|
-
const { secretsStoreFor } = await import("./state-
|
|
11359
|
+
const { secretsStoreFor } = await import("./state-DtS2HEfi.mjs").then((n) => n.qt);
|
|
11684
11360
|
const { workspace } = await loadWorkspaceConfig();
|
|
11685
11361
|
const stage = options.stage ?? workspace.stages.local;
|
|
11686
11362
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11689,7 +11365,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11689
11365
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11690
11366
|
process.exit(1);
|
|
11691
11367
|
}
|
|
11692
|
-
const { derivedContainers } = await import("./state-
|
|
11368
|
+
const { derivedContainers } = await import("./state-DtS2HEfi.mjs").then((n) => n.nt);
|
|
11693
11369
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11694
11370
|
if (!result) {
|
|
11695
11371
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11704,7 +11380,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11704
11380
|
}
|
|
11705
11381
|
});
|
|
11706
11382
|
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) => {
|
|
11707
|
-
const { deployCli } = await import("./cli-
|
|
11383
|
+
const { deployCli } = await import("./cli-BfdfyTF6.mjs");
|
|
11708
11384
|
const globalOptions = program.opts();
|
|
11709
11385
|
const code = await deployCli({
|
|
11710
11386
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11721,8 +11397,8 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11721
11397
|
});
|
|
11722
11398
|
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) => {
|
|
11723
11399
|
try {
|
|
11724
|
-
const { rollbackStage } = await import("./rollback-
|
|
11725
|
-
const { terminalCredentials } = await import("./terminal-
|
|
11400
|
+
const { rollbackStage } = await import("./rollback-C-V-Rf4a.mjs").then((n) => n.a);
|
|
11401
|
+
const { terminalCredentials } = await import("./terminal-BdvrmkaC.mjs");
|
|
11726
11402
|
const globalOptions = program.opts();
|
|
11727
11403
|
await rollbackStage({
|
|
11728
11404
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11757,7 +11433,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11757
11433
|
try {
|
|
11758
11434
|
const globalOptions = program.opts();
|
|
11759
11435
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11760
|
-
const { deployGithubCommand } = await import("./github-
|
|
11436
|
+
const { deployGithubCommand } = await import("./github-hjHHm7jM.mjs");
|
|
11761
11437
|
await deployGithubCommand(options);
|
|
11762
11438
|
} catch (error) {
|
|
11763
11439
|
console.error(formatError(error));
|