@geekmidas/cli 10.0.0-alpha.73 → 10.0.0-alpha.75
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/{LegacyStateStore-D_78eaHM.cjs → LegacyStateStore-BFnXUFlx.cjs} +2 -2
- package/dist/{LegacyStateStore-D_78eaHM.cjs.map → LegacyStateStore-BFnXUFlx.cjs.map} +1 -1
- package/dist/{LegacyStateStore-DTo7z924.mjs → LegacyStateStore-cpt3K1vx.mjs} +2 -2
- package/dist/{LegacyStateStore-DTo7z924.mjs.map → LegacyStateStore-cpt3K1vx.mjs.map} +1 -1
- package/dist/{LocalStateStore-CNjgkRk4.mjs → LocalStateStore-RH9F2ZEy.mjs} +2 -2
- package/dist/{LocalStateStore-CNjgkRk4.mjs.map → LocalStateStore-RH9F2ZEy.mjs.map} +1 -1
- package/dist/{LocalStateStore-BhrlQIXD.cjs → LocalStateStore-zQGZ9b4J.cjs} +2 -2
- package/dist/{LocalStateStore-BhrlQIXD.cjs.map → LocalStateStore-zQGZ9b4J.cjs.map} +1 -1
- package/dist/{S3StateStore-oCxRs6HM.cjs → S3StateStore-CT-ZMlQY.cjs} +2 -2
- package/dist/{S3StateStore-oCxRs6HM.cjs.map → S3StateStore-CT-ZMlQY.cjs.map} +1 -1
- package/dist/{S3StateStore-g2P7T_Mo.mjs → S3StateStore-DBeBc0c0.mjs} +2 -2
- package/dist/{S3StateStore-g2P7T_Mo.mjs.map → S3StateStore-DBeBc0c0.mjs.map} +1 -1
- package/dist/{SSMStateStore-DXp0m7XI.cjs → SSMStateStore-HmsH3c4v.cjs} +2 -2
- package/dist/{SSMStateStore-DXp0m7XI.cjs.map → SSMStateStore-HmsH3c4v.cjs.map} +1 -1
- package/dist/{SSMStateStore-CYenunmK.mjs → SSMStateStore-rnzNfOaV.mjs} +2 -2
- package/dist/{SSMStateStore-CYenunmK.mjs.map → SSMStateStore-rnzNfOaV.mjs.map} +1 -1
- package/dist/{SubscriberGenerator-DZk_pKDh.mjs → SubscriberGenerator-5looQ3gB.mjs} +18 -2
- package/dist/SubscriberGenerator-5looQ3gB.mjs.map +1 -0
- package/dist/{SubscriberGenerator-Bixm28fN.cjs → SubscriberGenerator-CajwOa5W.cjs} +29 -1
- package/dist/SubscriberGenerator-CajwOa5W.cjs.map +1 -0
- package/dist/{add-C1ojB2Yy.cjs → add-CHBin8TF.cjs} +2 -2
- package/dist/{add-C1ojB2Yy.cjs.map → add-CHBin8TF.cjs.map} +1 -1
- package/dist/{add-BiPlBUq3.mjs → add-Cvzdw8cf.mjs} +2 -2
- package/dist/{add-BiPlBUq3.mjs.map → add-Cvzdw8cf.mjs.map} +1 -1
- package/dist/{bundler-C35h0WKt.cjs → bundler-_8AEZhrs.cjs} +5 -5
- package/dist/{bundler-C35h0WKt.cjs.map → bundler-_8AEZhrs.cjs.map} +1 -1
- package/dist/{bundler-C2LZoLdP.mjs → bundler-xjp5RwRS.mjs} +5 -5
- package/dist/{bundler-C2LZoLdP.mjs.map → bundler-xjp5RwRS.mjs.map} +1 -1
- package/dist/{cli-DJVL2sL9.cjs → cli-B4ktxAsM.cjs} +3 -3
- package/dist/{cli-DJVL2sL9.cjs.map → cli-B4ktxAsM.cjs.map} +1 -1
- package/dist/{cli-BfdfyTF6.mjs → cli-BTGfA0B7.mjs} +3 -3
- package/dist/{cli-BfdfyTF6.mjs.map → cli-BTGfA0B7.mjs.map} +1 -1
- package/dist/{compose-9II-0IsK.mjs → compose-DdH2JQJD.mjs} +418 -159
- package/dist/compose-DdH2JQJD.mjs.map +1 -0
- package/dist/{compose-CNnw8meq.cjs → compose-UKyv_1yU.cjs} +440 -157
- package/dist/compose-UKyv_1yU.cjs.map +1 -0
- package/dist/{config-RLuR2o9A.d.cts → config-B38YWicj.d.cts} +3 -3
- package/dist/{config-B8OR_TrO.d.mts.map → config-B38YWicj.d.cts.map} +1 -1
- package/dist/{config-B8OR_TrO.d.mts → config-DA0kRTQe.d.mts} +3 -3
- package/dist/{config-RLuR2o9A.d.cts.map → config-DA0kRTQe.d.mts.map} +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/deploy/public.cjs +7 -6
- package/dist/deploy/public.d.cts +14 -3
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +14 -3
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +7 -7
- package/dist/{deploy-nmov4j0B.mjs → deploy-CuSsiFIc.mjs} +21 -5
- package/dist/deploy-CuSsiFIc.mjs.map +1 -0
- package/dist/{deploy-BitZLdnY.cjs → deploy-XUZoA1us.cjs} +26 -4
- package/dist/deploy-XUZoA1us.cjs.map +1 -0
- package/dist/{dokploy-Ce_VTytN.cjs → dokploy-Cvgg_pID.cjs} +2 -2
- package/dist/{dokploy-Ce_VTytN.cjs.map → dokploy-Cvgg_pID.cjs.map} +1 -1
- package/dist/{dokploy-CZ1vZt21.mjs → dokploy-DZXTQX10.mjs} +2 -2
- package/dist/{dokploy-CZ1vZt21.mjs.map → dokploy-DZXTQX10.mjs.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-CmfPICSN.mjs → encryption-JkeMPugf.mjs} +2 -2
- package/dist/{encryption-CmfPICSN.mjs.map → encryption-JkeMPugf.mjs.map} +1 -1
- package/dist/{encryption-CDGRdcMr.cjs → encryption-w-Ehh9DW.cjs} +2 -2
- package/dist/{encryption-CDGRdcMr.cjs.map → encryption-w-Ehh9DW.cjs.map} +1 -1
- package/dist/{engine-B37qBO5W.mjs → engine-CmozkHxq.mjs} +192 -4
- package/dist/engine-CmozkHxq.mjs.map +1 -0
- package/dist/{engine-DL2-PW6m.cjs → engine-zpWBMsQq.cjs} +195 -7
- package/dist/engine-zpWBMsQq.cjs.map +1 -0
- package/dist/{github-C6qF8kHg.cjs → github-BGdJ-Lnm.cjs} +2 -2
- package/dist/{github-C6qF8kHg.cjs.map → github-BGdJ-Lnm.cjs.map} +1 -1
- package/dist/{github-hjHHm7jM.mjs → github-BNngHoId.mjs} +2 -2
- package/dist/{github-hjHHm7jM.mjs.map → github-BNngHoId.mjs.map} +1 -1
- package/dist/{index-DHyTqGG3.d.mts → index-B-1lLGzy.d.mts} +2 -2
- package/dist/{index-DHyTqGG3.d.mts.map → index-B-1lLGzy.d.mts.map} +1 -1
- package/dist/{index-Dg-UZ4Hm.d.cts → index-vMidfqhU.d.cts} +2 -2
- package/dist/{index-Dg-UZ4Hm.d.cts.map → index-vMidfqhU.d.cts.map} +1 -1
- package/dist/index.cjs +89 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +86 -49
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-CFFC3esE.mjs → migrate-BLL1RTAj.mjs} +2 -2
- package/dist/{migrate-CFFC3esE.mjs.map → migrate-BLL1RTAj.mjs.map} +1 -1
- package/dist/{migrate-kA_j1TPK.cjs → migrate-CgjlYeun.cjs} +2 -2
- package/dist/{migrate-kA_j1TPK.cjs.map → migrate-CgjlYeun.cjs.map} +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/{ready-BIuMw6wH.cjs → ready-BB9xS4S9.cjs} +6 -188
- package/dist/ready-BB9xS4S9.cjs.map +1 -0
- package/dist/{ready-C0U0NYfB.mjs → ready-ZZoNskrr.mjs} +5 -169
- package/dist/ready-ZZoNskrr.mjs.map +1 -0
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-CV4eQkDa.mjs → resolve-DZNx7rLy.mjs} +3 -3
- package/dist/{resolve-CV4eQkDa.mjs.map → resolve-DZNx7rLy.mjs.map} +1 -1
- package/dist/{resolve-E5RfY0bm.cjs → resolve-fevXn-wZ.cjs} +3 -3
- package/dist/{resolve-E5RfY0bm.cjs.map → resolve-fevXn-wZ.cjs.map} +1 -1
- package/dist/{rollback-C-V-Rf4a.mjs → rollback-CLi5Pln_.mjs} +4 -4
- package/dist/{rollback-C-V-Rf4a.mjs.map → rollback-CLi5Pln_.mjs.map} +1 -1
- package/dist/{rollback-QGwomD64.cjs → rollback-Dw-FW3X2.cjs} +4 -4
- package/dist/{rollback-QGwomD64.cjs.map → rollback-Dw-FW3X2.cjs.map} +1 -1
- package/dist/{runtime-CWYLIeCU.d.mts → runtime-BzZD5HHi.d.cts} +2 -2
- package/dist/{runtime-CWYLIeCU.d.mts.map → runtime-BzZD5HHi.d.cts.map} +1 -1
- package/dist/{runtime-CmuQOT6A.d.cts → runtime-Cm6J6L7n.d.mts} +2 -2
- package/dist/{runtime-CmuQOT6A.d.cts.map → runtime-Cm6J6L7n.d.mts.map} +1 -1
- package/dist/{sniffer-BFmdZpZ2.mjs → sniffer-BmCvVyhq.mjs} +59 -7
- package/dist/sniffer-BmCvVyhq.mjs.map +1 -0
- package/dist/{sniffer-C-T7dSMN.cjs → sniffer-bMzrX4cO.cjs} +75 -5
- package/dist/{sniffer-C-T7dSMN.cjs.map → sniffer-bMzrX4cO.cjs.map} +1 -1
- package/dist/{state-DtS2HEfi.mjs → state-BrWIOce_.mjs} +60 -293
- package/dist/state-BrWIOce_.mjs.map +1 -0
- package/dist/{state-DMjFPOhf.cjs → state-kA4Fkufx.cjs} +70 -321
- package/dist/state-kA4Fkufx.cjs.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/{types-BLdCL4fB.d.mts → types-Dp9lgx_S.d.mts} +6 -2
- package/dist/{types-BLdCL4fB.d.mts.map → types-Dp9lgx_S.d.mts.map} +1 -1
- package/dist/{types-DwCQCkC-.d.cts → types-TzCChNrA.d.cts} +6 -2
- package/dist/{types-DwCQCkC-.d.cts.map → types-TzCChNrA.d.cts.map} +1 -1
- 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/package.json +17 -17
- package/dist/SubscriberGenerator-Bixm28fN.cjs.map +0 -1
- package/dist/SubscriberGenerator-DZk_pKDh.mjs.map +0 -1
- package/dist/compose-9II-0IsK.mjs.map +0 -1
- package/dist/compose-CNnw8meq.cjs.map +0 -1
- package/dist/deploy-BitZLdnY.cjs.map +0 -1
- package/dist/deploy-nmov4j0B.mjs.map +0 -1
- package/dist/engine-B37qBO5W.mjs.map +0 -1
- package/dist/engine-DL2-PW6m.cjs.map +0 -1
- package/dist/ready-BIuMw6wH.cjs.map +0 -1
- package/dist/ready-C0U0NYfB.mjs.map +0 -1
- package/dist/sniffer-BFmdZpZ2.mjs.map +0 -1
- package/dist/state-DMjFPOhf.cjs.map +0 -1
- package/dist/state-DtS2HEfi.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -6,22 +6,23 @@ import { l as withOwningTsconfigJsx, r as discover, u as ConstructGenerator } fr
|
|
|
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 { $ as
|
|
9
|
+
import { $ as LOCAL_CA_PATH, Bt as loadSecretsForApp, Dt as eventsBackendFor, Et as cacheBackendFor, Ft as createCredentialsPreload, G as QueueGenerator, Gt as FileSecretsStore, H as WorkerGenerator, It as createEntryWrapper, J as backendsOf$1, Jt as projectKey, K as CronGenerator, Kt as getKeyPath, L as parseDevServices, Lt as findAvailablePort, Mt as fakeKey, Ot as providerOf, Pt as primaryPortKey, Rt as isPortAvailable, U as workerBundleName, Ut as secretsStoreFor, V as workerUnits, Vt as prepareEntryCredentials, W as workerEntryDir, X as derivedContainers, Y as constructGlobs, Z as reconcileWorkspace, Zt as deployIdentity, an as maskPassword, at as postgresDatabaseNames, cn as withCustomSecret, et as forgetState, jt as describeServices, q as FAKE_ENV, sn as toEmbeddableSecrets, st as quoteIdentifier, ut as pgClient, v as dockerCommand, zt as loadEnvFiles } from "./state-BrWIOce_.mjs";
|
|
10
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-
|
|
11
|
+
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi, x as keyFingerprint } from "./sniffer-BmCvVyhq.mjs";
|
|
12
12
|
import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
|
|
13
|
-
import { t as SubscriberGenerator } from "./SubscriberGenerator-
|
|
13
|
+
import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-5looQ3gB.mjs";
|
|
14
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";
|
|
15
|
-
import {
|
|
15
|
+
import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-Ch1rJitn.mjs";
|
|
16
16
|
import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
|
|
17
|
-
import { t as deploy$1 } from "./deploy-
|
|
18
|
-
import { a as
|
|
17
|
+
import { t as deploy$1 } from "./deploy-CuSsiFIc.mjs";
|
|
18
|
+
import { a as stackOverrideFile, c as parseDigests, i as ComposePushNeedsBuild, l as pinnedRef, o as composeProject, r as ComposePinNeedsPull, s as stackDir, t as composeTarget, u as dockerCompose } from "./compose-DdH2JQJD.mjs";
|
|
19
19
|
import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
20
|
-
import { t as LocalStateStore } from "./LocalStateStore-
|
|
20
|
+
import { t as LocalStateStore } from "./LocalStateStore-RH9F2ZEy.mjs";
|
|
21
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";
|
|
22
23
|
import { createRequire } from "node:module";
|
|
23
24
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
24
|
-
import { Command } from "commander";
|
|
25
|
+
import { Command, Option } from "commander";
|
|
25
26
|
import { stdin, stdout } from "node:process";
|
|
26
27
|
import * as readline from "node:readline/promises";
|
|
27
28
|
import { existsSync, linkSync, mkdirSync, readFileSync, readdirSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -46,7 +47,7 @@ import crypto from "crypto";
|
|
|
46
47
|
import { Function } from "@geekmidas/constructs/functions";
|
|
47
48
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
48
49
|
//#region package.json
|
|
49
|
-
var version = "10.0.0-alpha.
|
|
50
|
+
var version = "10.0.0-alpha.75";
|
|
50
51
|
//#endregion
|
|
51
52
|
//#region src/prompt.ts
|
|
52
53
|
/**
|
|
@@ -129,7 +130,7 @@ const logger$8 = console;
|
|
|
129
130
|
* Validate Dokploy token by making a test API call
|
|
130
131
|
*/
|
|
131
132
|
async function validateDokployToken(endpoint, token) {
|
|
132
|
-
const { DokployApi } = await import("./sniffer-
|
|
133
|
+
const { DokployApi } = await import("./sniffer-BmCvVyhq.mjs").then((n) => n.c);
|
|
133
134
|
return new DokployApi({
|
|
134
135
|
baseUrl: endpoint,
|
|
135
136
|
token
|
|
@@ -2035,9 +2036,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2035
2036
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2036
2037
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2037
2038
|
if (options.migrate || options.seed) {
|
|
2038
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
2039
|
+
const { prepareDevDatabases } = await import("./migrate-BLL1RTAj.mjs");
|
|
2039
2040
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2040
|
-
} else await import("./migrate-
|
|
2041
|
+
} else await import("./migrate-BLL1RTAj.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2041
2042
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2042
2043
|
});
|
|
2043
2044
|
const appUrls = {};
|
|
@@ -2897,6 +2898,15 @@ var UnknownBuildProvider = class extends Error {
|
|
|
2897
2898
|
this.name = "UnknownBuildProvider";
|
|
2898
2899
|
}
|
|
2899
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
|
+
};
|
|
2900
2910
|
async function buildCommand(options) {
|
|
2901
2911
|
const loadedConfig = await loadWorkspaceConfig();
|
|
2902
2912
|
if (loadedConfig.type === "workspace") {
|
|
@@ -2949,7 +2959,7 @@ function backendsOf(workspace) {
|
|
|
2949
2959
|
/** One app's build, from its config and the command's options. */
|
|
2950
2960
|
async function buildOneApp(input) {
|
|
2951
2961
|
const { config, options, workspace, appRoot, target } = input;
|
|
2952
|
-
const cacheBackend = cacheBackendFor(providerOf(workspace));
|
|
2962
|
+
const cacheBackend = options.cache ?? cacheBackendFor(providerOf(workspace));
|
|
2953
2963
|
const eventsBackend = eventsBackendFor(providerOf(workspace));
|
|
2954
2964
|
const production = normalizeProductionConfig(options.production ?? false);
|
|
2955
2965
|
if (production) logger$4.log(`🏭 Building for PRODUCTION`);
|
|
@@ -3036,7 +3046,7 @@ async function buildApp(input) {
|
|
|
3036
3046
|
if (production?.bundle && !input.skipBundle) {
|
|
3037
3047
|
const outputDir = join(appRoot, ".gkm", "server");
|
|
3038
3048
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3039
|
-
const { bundleServer } = await import("./bundler-
|
|
3049
|
+
const { bundleServer } = await import("./bundler-xjp5RwRS.mjs");
|
|
3040
3050
|
await bundleServer({
|
|
3041
3051
|
entryPoint,
|
|
3042
3052
|
outputDir: join(outputDir, "dist"),
|
|
@@ -3160,7 +3170,7 @@ async function buildWorkers(input) {
|
|
|
3160
3170
|
});
|
|
3161
3171
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3162
3172
|
if (!input.bundle) continue;
|
|
3163
|
-
const { bundleServer } = await import("./bundler-
|
|
3173
|
+
const { bundleServer } = await import("./bundler-xjp5RwRS.mjs");
|
|
3164
3174
|
const outfile = workerBundleName(worker.id);
|
|
3165
3175
|
await bundleServer({
|
|
3166
3176
|
entryPoint,
|
|
@@ -3230,7 +3240,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3230
3240
|
let masterKey;
|
|
3231
3241
|
if (context.production?.bundle && !skipBundle) {
|
|
3232
3242
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3233
|
-
const { bundleServer } = await import("./bundler-
|
|
3243
|
+
const { bundleServer } = await import("./bundler-xjp5RwRS.mjs");
|
|
3234
3244
|
const allConstructs = [
|
|
3235
3245
|
...endpoints.map((e) => e.construct),
|
|
3236
3246
|
...functions.map((f) => f.construct),
|
|
@@ -3474,9 +3484,16 @@ var ComposeModeConflict = class extends Error {
|
|
|
3474
3484
|
this.name = "ComposeModeConflict";
|
|
3475
3485
|
}
|
|
3476
3486
|
};
|
|
3487
|
+
/** Each pushed image as `<ref>@sha256:…`, by app. */
|
|
3488
|
+
function pushedDigests(run) {
|
|
3489
|
+
return Object.fromEntries(Object.entries(run.images).filter(([, image]) => image.digest).sort(([a], [b]) => a.localeCompare(b)).map(([app, image]) => [app, pinnedRef(image.ref, image.digest)]));
|
|
3490
|
+
}
|
|
3477
3491
|
/** `gkm compose`. */
|
|
3478
3492
|
async function composeCommand(options, deps = {}) {
|
|
3479
3493
|
if (options.build && options.pull) throw new ComposeModeConflict();
|
|
3494
|
+
if (options.push && !options.build) throw new ComposePushNeedsBuild();
|
|
3495
|
+
const pulls = !options.build && (options.pull || options.tag !== void 0);
|
|
3496
|
+
if (options.digestsFile && !options.push && !pulls) throw new ComposePinNeedsPull();
|
|
3480
3497
|
const allowDevServices = parseDevServices(options.allowDevServices);
|
|
3481
3498
|
const cwd = resolve(options.cwd ?? process.cwd());
|
|
3482
3499
|
const { workspace } = await loadWorkspaceConfig(cwd);
|
|
@@ -3496,6 +3513,10 @@ async function composeCommand(options, deps = {}) {
|
|
|
3496
3513
|
let finished;
|
|
3497
3514
|
const mode = options.build ? "build" : options.pull ? "pull" : void 0;
|
|
3498
3515
|
const tag = options.tag ?? (options.pull ? "latest" : void 0);
|
|
3516
|
+
const pin = options.digestsFile && pulls ? {
|
|
3517
|
+
file: options.digestsFile,
|
|
3518
|
+
digests: parseDigests(options.digestsFile, await readFile(resolve(cwd, options.digestsFile), "utf-8"))
|
|
3519
|
+
} : void 0;
|
|
3499
3520
|
const result = await deploy$1({
|
|
3500
3521
|
cwd,
|
|
3501
3522
|
stage,
|
|
@@ -3503,12 +3524,15 @@ async function composeCommand(options, deps = {}) {
|
|
|
3503
3524
|
targets: { compose: composeTarget({
|
|
3504
3525
|
...deps,
|
|
3505
3526
|
...mode ? { mode } : {},
|
|
3527
|
+
...options.push ? { push: true } : {},
|
|
3528
|
+
...pin ? { pin } : {},
|
|
3506
3529
|
report: (done) => {
|
|
3507
3530
|
finished = done;
|
|
3508
3531
|
}
|
|
3509
3532
|
}) },
|
|
3510
3533
|
...tag ? { tag } : {},
|
|
3511
3534
|
...options.dryRun ? { dryRun: true } : {},
|
|
3535
|
+
...options.push ? { buildOnly: true } : {},
|
|
3512
3536
|
...allowDevServices.length > 0 ? { allowDevServices } : {},
|
|
3513
3537
|
logger: {
|
|
3514
3538
|
info: (message) => console.log(message),
|
|
@@ -3517,6 +3541,17 @@ async function composeCommand(options, deps = {}) {
|
|
|
3517
3541
|
}
|
|
3518
3542
|
}).result;
|
|
3519
3543
|
if (!finished) return void 0;
|
|
3544
|
+
if (options.push && !options.dryRun) {
|
|
3545
|
+
const digests = pushedDigests(finished);
|
|
3546
|
+
console.log(`\n✅ Pushed ${Object.keys(digests).length} image(s):`);
|
|
3547
|
+
for (const [app, ref] of Object.entries(digests)) console.log(` ${app.padEnd(12)} ${ref}`);
|
|
3548
|
+
if (options.digestsFile) {
|
|
3549
|
+
const file = resolve(cwd, options.digestsFile);
|
|
3550
|
+
await mkdir(dirname(file), { recursive: true });
|
|
3551
|
+
await writeFile(file, `${JSON.stringify(digests, null, 2)}\n`);
|
|
3552
|
+
console.log(`\n📝 Wrote the digests to ${options.digestsFile}`);
|
|
3553
|
+
}
|
|
3554
|
+
}
|
|
3520
3555
|
return {
|
|
3521
3556
|
stack: finished.stack,
|
|
3522
3557
|
files: finished.files,
|
|
@@ -4929,25 +4964,25 @@ function loadPackageJson() {
|
|
|
4929
4964
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
4930
4965
|
*/
|
|
4931
4966
|
const GEEKMIDAS_VERSIONS = {
|
|
4932
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
4933
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
4934
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
4935
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
4936
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
4937
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
4938
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
4939
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
4940
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
4941
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
4942
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
4943
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
4944
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
4945
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
4946
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
4947
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
4948
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
4949
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
4950
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
4967
|
+
"@geekmidas/audit": "~10.0.0-alpha.75",
|
|
4968
|
+
"@geekmidas/auth": "~10.0.0-alpha.75",
|
|
4969
|
+
"@geekmidas/cache": "~10.0.0-alpha.75",
|
|
4970
|
+
"@geekmidas/client": "~10.0.0-alpha.75",
|
|
4971
|
+
"@geekmidas/cloud": "~10.0.0-alpha.75",
|
|
4972
|
+
"@geekmidas/constructs": "~10.0.0-alpha.75",
|
|
4973
|
+
"@geekmidas/db": "~10.0.0-alpha.75",
|
|
4974
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.75",
|
|
4975
|
+
"@geekmidas/envkit": "~10.0.0-alpha.75",
|
|
4976
|
+
"@geekmidas/errors": "~10.0.0-alpha.75",
|
|
4977
|
+
"@geekmidas/events": "~10.0.0-alpha.75",
|
|
4978
|
+
"@geekmidas/logger": "~10.0.0-alpha.75",
|
|
4979
|
+
"@geekmidas/manifest": "~10.0.0-alpha.75",
|
|
4980
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.75",
|
|
4981
|
+
"@geekmidas/schema": "~10.0.0-alpha.75",
|
|
4982
|
+
"@geekmidas/services": "~10.0.0-alpha.75",
|
|
4983
|
+
"@geekmidas/storage": "~10.0.0-alpha.75",
|
|
4984
|
+
"@geekmidas/telescope": "~10.0.0-alpha.75",
|
|
4985
|
+
"@geekmidas/testkit": "~10.0.0-alpha.75",
|
|
4951
4986
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
4952
4987
|
};
|
|
4953
4988
|
//#endregion
|
|
@@ -10738,7 +10773,7 @@ function testDatabases(reconciled) {
|
|
|
10738
10773
|
* starts without the reference data the app needs.
|
|
10739
10774
|
*/
|
|
10740
10775
|
async function migrateTestStage(workspace, env) {
|
|
10741
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
10776
|
+
const { migrateAndSeed } = await import("./migrate-BLL1RTAj.mjs");
|
|
10742
10777
|
const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
|
|
10743
10778
|
const sources = {};
|
|
10744
10779
|
const manifest = await discover({
|
|
@@ -11104,13 +11139,15 @@ program.command("setup").description("Reconcile declared constructs — containe
|
|
|
11104
11139
|
process.exit(1);
|
|
11105
11140
|
}
|
|
11106
11141
|
});
|
|
11107
|
-
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) => {
|
|
11142
|
+
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) => {
|
|
11108
11143
|
try {
|
|
11109
11144
|
const globalOptions = program.opts();
|
|
11110
11145
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11111
11146
|
if (options.provider !== void 0 && !isMainProvider(options.provider)) throw new UnknownBuildProvider(options.provider);
|
|
11147
|
+
if (options.cache !== void 0 && !isCacheBackend(options.cache)) throw new UnknownCacheBackend(options.cache);
|
|
11112
11148
|
await buildCommand({
|
|
11113
11149
|
...options.provider ? { provider: options.provider } : {},
|
|
11150
|
+
...options.cache ? { cache: options.cache } : {},
|
|
11114
11151
|
enableOpenApi: options.enableOpenapi || false,
|
|
11115
11152
|
production: options.production || false,
|
|
11116
11153
|
skipBundle: options.skipBundle || false,
|
|
@@ -11169,7 +11206,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11169
11206
|
try {
|
|
11170
11207
|
const globalOptions = program.opts();
|
|
11171
11208
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11172
|
-
const { migrateCommand } = await import("./migrate-
|
|
11209
|
+
const { migrateCommand } = await import("./migrate-BLL1RTAj.mjs");
|
|
11173
11210
|
await migrateCommand({
|
|
11174
11211
|
...options,
|
|
11175
11212
|
...construct ? { construct } : {}
|
|
@@ -11183,7 +11220,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11183
11220
|
try {
|
|
11184
11221
|
const globalOptions = program.opts();
|
|
11185
11222
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11186
|
-
const { seedCommand } = await import("./migrate-
|
|
11223
|
+
const { seedCommand } = await import("./migrate-BLL1RTAj.mjs");
|
|
11187
11224
|
await seedCommand({
|
|
11188
11225
|
...options,
|
|
11189
11226
|
...construct ? { construct } : {}
|
|
@@ -11197,7 +11234,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11197
11234
|
try {
|
|
11198
11235
|
const globalOptions = program.opts();
|
|
11199
11236
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11200
|
-
const { migrationCommand } = await import("./migrate-
|
|
11237
|
+
const { migrationCommand } = await import("./migrate-BLL1RTAj.mjs");
|
|
11201
11238
|
await migrationCommand({
|
|
11202
11239
|
construct,
|
|
11203
11240
|
...name ? { name } : {}
|
|
@@ -11242,7 +11279,7 @@ program.command("docker").description("Generate Docker deployment files").option
|
|
|
11242
11279
|
process.exit(1);
|
|
11243
11280
|
}
|
|
11244
11281
|
});
|
|
11245
|
-
program.command("compose").description("Run the workspace's APIs and sites for a stage as one Docker Compose stack behind Caddy").requiredOption("--stage <stage>", "Stage to run — always named, so a stack is never a deployed stage by accident").option("--tag <tag>", "Run the images CI pushed at this tag (sites: <tag>-<stage>); nothing is built").option("--build", "Build images from this checkout, tagged with the commit").option("--pull", "Pull images (at --tag, or latest) rather than build them").option("--dry-run", "Write the files and print the plan; start nothing").option("--down", "Stop the stage's stack (its volumes are kept)").option("--allow-dev-services <list>", "Deployed stage: run MinIO and/or Mailpit (minio,mailpit) for mail and buckets the stage's secrets don't configure. Not production-grade").action(async (options) => {
|
|
11282
|
+
program.command("compose").description("Run the workspace's APIs and sites for a stage as one Docker Compose stack behind Caddy").requiredOption("--stage <stage>", "Stage to run — always named, so a stack is never a deployed stage by accident").option("--tag <tag>", "Run the images CI pushed at this tag (sites: <tag>-<stage>); nothing is built").option("--build", "Build images from this checkout, tagged with the commit").option("--pull", "Pull images (at --tag, or latest) rather than build them").option("--push", "With --build: push every image to deploy.registry and start nothing (for CI)").option("--digests-file <path>", "With --push: write each image as <ref>@sha256:… (JSON). With --tag: run the images at those digests").option("--dry-run", "Write the files and print the plan; start nothing").option("--down", "Stop the stage's stack (its volumes are kept)").option("--allow-dev-services <list>", "Deployed stage: run MinIO and/or Mailpit (minio,mailpit) for mail and buckets the stage's secrets don't configure. Not production-grade").action(async (options) => {
|
|
11246
11283
|
try {
|
|
11247
11284
|
const globalOptions = program.opts();
|
|
11248
11285
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
@@ -11291,7 +11328,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11291
11328
|
try {
|
|
11292
11329
|
const globalOptions = program.opts();
|
|
11293
11330
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11294
|
-
const { secretsAddCommand } = await import("./add-
|
|
11331
|
+
const { secretsAddCommand } = await import("./add-Cvzdw8cf.mjs");
|
|
11295
11332
|
await secretsAddCommand(options);
|
|
11296
11333
|
} catch (error) {
|
|
11297
11334
|
console.error(formatError(error));
|
|
@@ -11302,7 +11339,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11302
11339
|
try {
|
|
11303
11340
|
const globalOptions = program.opts();
|
|
11304
11341
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11305
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
11342
|
+
const { encryptionRotateCommand } = await import("./encryption-JkeMPugf.mjs");
|
|
11306
11343
|
await encryptionRotateCommand(construct, options);
|
|
11307
11344
|
} catch (error) {
|
|
11308
11345
|
console.error(formatError(error));
|
|
@@ -11313,7 +11350,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11313
11350
|
try {
|
|
11314
11351
|
const globalOptions = program.opts();
|
|
11315
11352
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11316
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
11353
|
+
const { encryptionRetireCommand } = await import("./encryption-JkeMPugf.mjs");
|
|
11317
11354
|
await encryptionRetireCommand(construct, key, options);
|
|
11318
11355
|
} catch (error) {
|
|
11319
11356
|
console.error(formatError(error));
|
|
@@ -11356,7 +11393,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11356
11393
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11357
11394
|
const { loadWorkspaceConfig } = await import("./config.mjs");
|
|
11358
11395
|
const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
|
|
11359
|
-
const { secretsStoreFor } = await import("./state-
|
|
11396
|
+
const { secretsStoreFor } = await import("./state-BrWIOce_.mjs").then((n) => n.Wt);
|
|
11360
11397
|
const { workspace } = await loadWorkspaceConfig();
|
|
11361
11398
|
const stage = options.stage ?? workspace.stages.local;
|
|
11362
11399
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11365,7 +11402,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11365
11402
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11366
11403
|
process.exit(1);
|
|
11367
11404
|
}
|
|
11368
|
-
const { derivedContainers } = await import("./state-
|
|
11405
|
+
const { derivedContainers } = await import("./state-BrWIOce_.mjs").then((n) => n.Q);
|
|
11369
11406
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11370
11407
|
if (!result) {
|
|
11371
11408
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11380,7 +11417,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11380
11417
|
}
|
|
11381
11418
|
});
|
|
11382
11419
|
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) => {
|
|
11383
|
-
const { deployCli } = await import("./cli-
|
|
11420
|
+
const { deployCli } = await import("./cli-BTGfA0B7.mjs");
|
|
11384
11421
|
const globalOptions = program.opts();
|
|
11385
11422
|
const code = await deployCli({
|
|
11386
11423
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11397,7 +11434,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11397
11434
|
});
|
|
11398
11435
|
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) => {
|
|
11399
11436
|
try {
|
|
11400
|
-
const { rollbackStage } = await import("./rollback-
|
|
11437
|
+
const { rollbackStage } = await import("./rollback-CLi5Pln_.mjs").then((n) => n.a);
|
|
11401
11438
|
const { terminalCredentials } = await import("./terminal-BdvrmkaC.mjs");
|
|
11402
11439
|
const globalOptions = program.opts();
|
|
11403
11440
|
await rollbackStage({
|
|
@@ -11433,7 +11470,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11433
11470
|
try {
|
|
11434
11471
|
const globalOptions = program.opts();
|
|
11435
11472
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11436
|
-
const { deployGithubCommand } = await import("./github-
|
|
11473
|
+
const { deployGithubCommand } = await import("./github-BNngHoId.mjs");
|
|
11437
11474
|
await deployGithubCommand(options);
|
|
11438
11475
|
} catch (error) {
|
|
11439
11476
|
console.error(formatError(error));
|