@geekmidas/cli 10.0.0-alpha.79 → 10.0.0-alpha.81
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/{add-UFiIrlTj.mjs → add-Bn1bqt0c.mjs} +2 -2
- package/dist/{add-UFiIrlTj.mjs.map → add-Bn1bqt0c.mjs.map} +1 -1
- package/dist/{add-HF9POevk.cjs → add-DF9IHQov.cjs} +2 -2
- package/dist/{add-HF9POevk.cjs.map → add-DF9IHQov.cjs.map} +1 -1
- package/dist/{aws-Bja4zGSs.mjs → aws-B-6uEhgP.mjs} +8 -2
- package/dist/{aws-Bja4zGSs.mjs.map → aws-B-6uEhgP.mjs.map} +1 -1
- package/dist/{aws-CQAuluiu.cjs → aws-BTawF0F-.cjs} +19 -2
- package/dist/{aws-CQAuluiu.cjs.map → aws-BTawF0F-.cjs.map} +1 -1
- package/dist/{bundler-C45BuRdY.mjs → bundler-Ba_LoFXI.mjs} +3 -3
- package/dist/{bundler-C45BuRdY.mjs.map → bundler-Ba_LoFXI.mjs.map} +1 -1
- package/dist/{bundler-RAoSRuvp.cjs → bundler-DeIVbloM.cjs} +3 -3
- package/dist/{bundler-RAoSRuvp.cjs.map → bundler-DeIVbloM.cjs.map} +1 -1
- package/dist/{cli-C3hsEwLK.cjs → cli-BB1KOkfo.cjs} +3 -3
- package/dist/{cli-C3hsEwLK.cjs.map → cli-BB1KOkfo.cjs.map} +1 -1
- package/dist/{cli-gvc3urUl.mjs → cli-CznHL-4-.mjs} +3 -3
- package/dist/{cli-gvc3urUl.mjs.map → cli-CznHL-4-.mjs.map} +1 -1
- package/dist/{compose-CtUP07r3.cjs → compose-76ho0pUg.cjs} +99 -367
- package/dist/compose-76ho0pUg.cjs.map +1 -0
- package/dist/{compose-C40Wk9m6.mjs → compose-BxIsChn5.mjs} +81 -349
- package/dist/compose-BxIsChn5.mjs.map +1 -0
- package/dist/deploy/public.cjs +5 -5
- package/dist/deploy/public.mjs +5 -5
- package/dist/{deploy-BjsZpUQ3.mjs → deploy-BRUx9hiA.mjs} +3 -3
- package/dist/{deploy-BjsZpUQ3.mjs.map → deploy-BRUx9hiA.mjs.map} +1 -1
- package/dist/{deploy-DPzauQsm.cjs → deploy-DuHRWNeJ.cjs} +3 -3
- package/dist/{deploy-DPzauQsm.cjs.map → deploy-DuHRWNeJ.cjs.map} +1 -1
- package/dist/{dokploy-BoH0DMyS.mjs → dokploy-BTO37Co8.mjs} +2 -2
- package/dist/{dokploy-BoH0DMyS.mjs.map → dokploy-BTO37Co8.mjs.map} +1 -1
- package/dist/{dokploy-Cj1EHd4Y.cjs → dokploy-Q4iYDmls.cjs} +2 -2
- package/dist/{dokploy-Cj1EHd4Y.cjs.map → dokploy-Q4iYDmls.cjs.map} +1 -1
- package/dist/{encryption-D2z16vsS.cjs → encryption-9YA5ThNl.cjs} +2 -2
- package/dist/{encryption-D2z16vsS.cjs.map → encryption-9YA5ThNl.cjs.map} +1 -1
- package/dist/{encryption-MeDrE-rZ.mjs → encryption-BESGvjHD.mjs} +2 -2
- package/dist/{encryption-MeDrE-rZ.mjs.map → encryption-BESGvjHD.mjs.map} +1 -1
- package/dist/{engine-B-Yq0yQu.mjs → engine-CHij99aX.mjs} +2 -2
- package/dist/{engine-B-Yq0yQu.mjs.map → engine-CHij99aX.mjs.map} +1 -1
- package/dist/{engine-C3T39eTO.cjs → engine-U0xzB5i4.cjs} +2 -2
- package/dist/{engine-C3T39eTO.cjs.map → engine-U0xzB5i4.cjs.map} +1 -1
- package/dist/github-2OSRBf9G.mjs +669 -0
- package/dist/github-2OSRBf9G.mjs.map +1 -0
- package/dist/github-BM-Y9M2G.cjs +669 -0
- package/dist/github-BM-Y9M2G.cjs.map +1 -0
- package/dist/index.cjs +215 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +216 -44
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-DWUbYY5r.mjs → migrate-3oLefufw.mjs} +2 -2
- package/dist/{migrate-DWUbYY5r.mjs.map → migrate-3oLefufw.mjs.map} +1 -1
- package/dist/{migrate-CTqICj1B.cjs → migrate-BlYiMA23.cjs} +2 -2
- package/dist/{migrate-CTqICj1B.cjs.map → migrate-BlYiMA23.cjs.map} +1 -1
- package/dist/{migrate-DvIAITiG.cjs → migrate-C440QQvZ.cjs} +2 -2
- package/dist/{migrate-DvIAITiG.cjs.map → migrate-C440QQvZ.cjs.map} +1 -1
- package/dist/{migrate-A2CLFl9G.mjs → migrate-KwZsJFce.mjs} +2 -2
- package/dist/{migrate-A2CLFl9G.mjs.map → migrate-KwZsJFce.mjs.map} +1 -1
- package/dist/{resolve-CHwetPdo.mjs → resolve-BPIDcuQ3.mjs} +3 -3
- package/dist/{resolve-CHwetPdo.mjs.map → resolve-BPIDcuQ3.mjs.map} +1 -1
- package/dist/{resolve-DOXcAOcn.cjs → resolve-CBrJTyDO.cjs} +3 -3
- package/dist/{resolve-DOXcAOcn.cjs.map → resolve-CBrJTyDO.cjs.map} +1 -1
- package/dist/{rollback-Cq5s3WnD.mjs → rollback-B7uQKHEk.mjs} +3 -3
- package/dist/{rollback-Cq5s3WnD.mjs.map → rollback-B7uQKHEk.mjs.map} +1 -1
- package/dist/{rollback-DUoOaws3.cjs → rollback-P09wRaW4.cjs} +3 -3
- package/dist/{rollback-DUoOaws3.cjs.map → rollback-P09wRaW4.cjs.map} +1 -1
- package/dist/{secretsManager-Ti0oZwsS.mjs → secretsManager-Chs9VV2r.mjs} +8 -2
- package/dist/{secretsManager-Ti0oZwsS.mjs.map → secretsManager-Chs9VV2r.mjs.map} +1 -1
- package/dist/{secretsManager-DUXW3fQt.cjs → secretsManager-DcMlHnRC.cjs} +19 -2
- package/dist/{secretsManager-DUXW3fQt.cjs.map → secretsManager-DcMlHnRC.cjs.map} +1 -1
- package/dist/{seeds-DiXON7R8.mjs → seeds-B4PiO_48.mjs} +2335 -1528
- package/dist/seeds-B4PiO_48.mjs.map +1 -0
- package/dist/{seeds-qX13ubmO.cjs → seeds-BjHiy9tW.cjs} +3880 -2953
- package/dist/seeds-BjHiy9tW.cjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/package.json +15 -15
- package/dist/compose-C40Wk9m6.mjs.map +0 -1
- package/dist/compose-CtUP07r3.cjs.map +0 -1
- package/dist/github-B8dDa8xf.cjs +0 -213
- package/dist/github-B8dDa8xf.cjs.map +0 -1
- package/dist/github-Dyrjo0xd.mjs +0 -213
- package/dist/github-Dyrjo0xd.mjs.map +0 -1
- package/dist/seeds-DiXON7R8.mjs.map +0 -1
- package/dist/seeds-qX13ubmO.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ 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
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
|
-
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-BBdqmkch.mjs";
|
|
7
|
+
import { A as deployedProblems, D as InvalidStages, I as resolveLogs, O as TEST_STAGE, c as getAppGkmConfig, j as stageProblems, n as allConstructGlobs, s as getAppBuildOrder } from "./workspace-BBdqmkch.mjs";
|
|
8
8
|
import { ConfigNotFound, NotABackendApp, NotInAnApp, loadAppConfig, loadConfig, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig } from "./config.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { B as WorkerGenerator, Ct as postgresDatabaseNames, F as parseDevServices, Fn as withCustomSecret, G as FAKE_ENV, Gt as imageBuildCredentials, H as workerEntryDir, J as derivedContainers, Jt as eventsBackendFor, K as backendsOf$1, Kt as isImageBuild, Mn as maskPassword, Pn as toEmbeddableSecrets, Tt as quoteIdentifier, U as QueueGenerator, V as workerBundleName, W as CronGenerator, Y as reconcileWorkspace, Yt as providerOf, Zt as CLUSTER_DATABASE, _t as LOCAL_CA_PATH, an as primaryPortKey, cn as findAvailablePort, dn as loadPortState, et as readLocalCredentials, fn as loadSecretsForApp, hn as secretsStoreFor, in as portsOf, kt as pgClient, ln as isPortAvailable, nn as fakeKey, on as createCredentialsPreload, pn as prepareEntryCredentials, q as constructGlobs, qt as cacheBackendFor, sn as createEntryWrapper, tn as describeServices, un as loadEnvFiles, vn as FileSecretsStore, vt as forgetState, wn as deployIdentity, x as dockerCommand, xn as projectKey, yn as getKeyPath, z as workerUnits } from "./seeds-B4PiO_48.mjs";
|
|
10
10
|
import { i as telemetryFor, n as runtimeFor, t as EndpointGenerator } from "./EndpointGenerator-DftalLYg.mjs";
|
|
11
11
|
import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
|
|
12
12
|
import { s as isCacheBackend, t as SubscriberGenerator } from "./SubscriberGenerator-5looQ3gB.mjs";
|
|
@@ -14,8 +14,8 @@ import { a as describeHolder, i as assignAppPorts, o as holderOf, r as appTag, s
|
|
|
14
14
|
import { n as driversFor, r as eventsBackendsIn, t as cacheBackendsIn } from "./drivers-Ch1rJitn.mjs";
|
|
15
15
|
import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
|
|
16
16
|
import { g as createStateStore, n as sniffAppEnvironment, o as DokployApi, x as keyFingerprint } from "./sniffer-ByWtH28i.mjs";
|
|
17
|
-
import { t as deploy$1 } from "./deploy-
|
|
18
|
-
import { a as stackOverrideFile, c as parseDigests, d as removeEdgeRoutes, f as EDGE_PROJECT, i as ComposePushNeedsBuild, l as pinnedRef, o as composeProject, p as dockerCompose, r as ComposePinNeedsPull, s as stackDir, t as composeTarget, u as edgeDir } from "./compose-
|
|
17
|
+
import { t as deploy$1 } from "./deploy-BRUx9hiA.mjs";
|
|
18
|
+
import { a as stackOverrideFile, c as parseDigests, d as removeEdgeRoutes, f as EDGE_PROJECT, i as ComposePushNeedsBuild, l as pinnedRef, o as composeProject, p as dockerCompose, r as ComposePinNeedsPull, s as stackDir, t as composeTarget, u as edgeDir } from "./compose-BxIsChn5.mjs";
|
|
19
19
|
import { o as loadCredentialSchemas, t as CredentialsInvalid } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
20
20
|
import { t as LocalStateStore } from "./LocalStateStore-C72bwpG2.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";
|
|
@@ -47,7 +47,7 @@ import crypto from "crypto";
|
|
|
47
47
|
import { Function } from "@geekmidas/constructs/functions";
|
|
48
48
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
49
49
|
//#region package.json
|
|
50
|
-
var version = "10.0.0-alpha.
|
|
50
|
+
var version = "10.0.0-alpha.81";
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/prompt.ts
|
|
53
53
|
/**
|
|
@@ -234,6 +234,91 @@ function maskToken(token) {
|
|
|
234
234
|
return `${token.slice(0, 4)}...${token.slice(-4)}`;
|
|
235
235
|
}
|
|
236
236
|
//#endregion
|
|
237
|
+
//#region src/reconcile/serviceLogins.ts
|
|
238
|
+
/**
|
|
239
|
+
* Where to sign in to each local service, and as whom — what `gkm dev`
|
|
240
|
+
* prints with its other addresses and `gkm dev:credentials` prints alone.
|
|
241
|
+
*
|
|
242
|
+
* Only the services a person opens or connects a client to: Postgres, the
|
|
243
|
+
* MinIO console, Mailpit's inbox, Redis and its HTTP proxy, RabbitMQ's
|
|
244
|
+
* console, the AWS emulator — and OpenObserve, where `gkm compose` runs it
|
|
245
|
+
* for the local stage.
|
|
246
|
+
*/
|
|
247
|
+
/** Each running service's address and login, in a stable order. */
|
|
248
|
+
function serviceLogins(options) {
|
|
249
|
+
const { containers, ports, credentials } = options;
|
|
250
|
+
const has = (container, key) => containers.includes(container) && ports[key] !== void 0;
|
|
251
|
+
const logins = [];
|
|
252
|
+
if (has("postgres", "postgres")) {
|
|
253
|
+
const { user, password } = credentials.postgres;
|
|
254
|
+
logins.push({
|
|
255
|
+
service: "postgres",
|
|
256
|
+
label: "Postgres",
|
|
257
|
+
url: `postgres://${user}:${encodeURIComponent(password)}@localhost:${ports.postgres}/${CLUSTER_DATABASE}`,
|
|
258
|
+
user,
|
|
259
|
+
password
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (has("minio", "minio-console")) logins.push({
|
|
263
|
+
service: "minio",
|
|
264
|
+
label: "MinIO console",
|
|
265
|
+
url: `http://localhost:${ports["minio-console"]}`,
|
|
266
|
+
...credentials.minio,
|
|
267
|
+
...ports.minio !== void 0 ? { note: `S3 API on http://localhost:${ports.minio}` } : {}
|
|
268
|
+
});
|
|
269
|
+
if (has("mailpit", "mailpit-web")) logins.push({
|
|
270
|
+
service: "mailpit",
|
|
271
|
+
label: "Mailpit inbox",
|
|
272
|
+
url: `http://localhost:${ports["mailpit-web"]}`,
|
|
273
|
+
note: "no login"
|
|
274
|
+
});
|
|
275
|
+
if (has("redis", "redis")) logins.push({
|
|
276
|
+
service: "redis",
|
|
277
|
+
label: "Redis",
|
|
278
|
+
url: `redis://:${encodeURIComponent(credentials.redis.password)}@localhost:${ports.redis}`,
|
|
279
|
+
password: credentials.redis.password
|
|
280
|
+
});
|
|
281
|
+
if (has("redis-http", "redis-http")) logins.push({
|
|
282
|
+
service: "redis-http",
|
|
283
|
+
label: "Cache (HTTP)",
|
|
284
|
+
url: `http://localhost:${ports["redis-http"]}`,
|
|
285
|
+
password: credentials.cacheToken,
|
|
286
|
+
note: "the password is its bearer token"
|
|
287
|
+
});
|
|
288
|
+
if (has("rabbitmq", "rabbitmq-management")) logins.push({
|
|
289
|
+
service: "rabbitmq",
|
|
290
|
+
label: "RabbitMQ console",
|
|
291
|
+
url: `http://localhost:${ports["rabbitmq-management"]}`,
|
|
292
|
+
...credentials.rabbitmq
|
|
293
|
+
});
|
|
294
|
+
if (has("localstack", "localstack")) logins.push({
|
|
295
|
+
service: "localstack",
|
|
296
|
+
label: "AWS emulator",
|
|
297
|
+
url: `http://localhost:${ports.localstack}`,
|
|
298
|
+
user: credentials.emulator.accessKeyId,
|
|
299
|
+
password: credentials.emulator.secretAccessKey,
|
|
300
|
+
note: "access key id / secret access key"
|
|
301
|
+
});
|
|
302
|
+
if (options.logs) logins.push({
|
|
303
|
+
service: "openobserve",
|
|
304
|
+
label: "OpenObserve",
|
|
305
|
+
url: options.logs.url,
|
|
306
|
+
user: credentials.logs.email,
|
|
307
|
+
password: credentials.logs.password,
|
|
308
|
+
note: `when running: ${options.logs.via}`
|
|
309
|
+
});
|
|
310
|
+
return logins;
|
|
311
|
+
}
|
|
312
|
+
/** The lines `gkm dev` and `gkm dev:credentials` print, one per service. */
|
|
313
|
+
function describeLogins(logins) {
|
|
314
|
+
const width = Math.max(0, ...logins.map(({ label }) => label.length));
|
|
315
|
+
return logins.flatMap((login) => {
|
|
316
|
+
const head = ` ${login.label.padEnd(width)} ${login.url}`;
|
|
317
|
+
const detail = [login.user !== void 0 && login.password !== void 0 ? `user ${login.user}, password ${login.password}` : login.password !== void 0 ? `password ${login.password}` : void 0, login.note].filter(Boolean).join(" — ");
|
|
318
|
+
return detail ? [head, ` ${" ".repeat(width)} ${detail}`] : [head];
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
237
322
|
//#region src/trust/index.ts
|
|
238
323
|
/**
|
|
239
324
|
* Installing the local edge's certificate authority into the OS trust store.
|
|
@@ -407,6 +492,74 @@ var UnsupportedPlatform = class extends Error {
|
|
|
407
492
|
this.name = "UnsupportedPlatform";
|
|
408
493
|
}
|
|
409
494
|
};
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/dev/credentials.ts
|
|
497
|
+
/**
|
|
498
|
+
* `gkm dev:credentials` — where to sign in to each local service, and as
|
|
499
|
+
* whom, without starting anything.
|
|
500
|
+
*
|
|
501
|
+
* Reads the workspace's generated local logins (see
|
|
502
|
+
* `reconcile/localCredentials.ts`) and the ports the last `gkm dev` or
|
|
503
|
+
* `gkm test` published them on (`.gkm/ports.json`). `--json` prints the same
|
|
504
|
+
* for a script.
|
|
505
|
+
*/
|
|
506
|
+
var credentials_exports = /* @__PURE__ */ __exportAll({
|
|
507
|
+
NoLocalCredentials: () => NoLocalCredentials,
|
|
508
|
+
devCredentials: () => devCredentials,
|
|
509
|
+
devCredentialsCommand: () => devCredentialsCommand
|
|
510
|
+
});
|
|
511
|
+
/** The containers a person may sign in to, in the order they print. */
|
|
512
|
+
const SIGNED_IN = [
|
|
513
|
+
"postgres",
|
|
514
|
+
"minio",
|
|
515
|
+
"mailpit",
|
|
516
|
+
"redis",
|
|
517
|
+
"redis-http",
|
|
518
|
+
"rabbitmq",
|
|
519
|
+
"localstack"
|
|
520
|
+
];
|
|
521
|
+
/** Nothing has generated this workspace's local logins yet. */
|
|
522
|
+
var NoLocalCredentials = class extends Error {
|
|
523
|
+
workspace;
|
|
524
|
+
constructor(workspace) {
|
|
525
|
+
super(`'${workspace}' has no local logins on this machine yet: they are generated the first time gkm dev, gkm test or gkm setup starts its services. Run one of them, then this again.`);
|
|
526
|
+
this.workspace = workspace;
|
|
527
|
+
this.name = "NoLocalCredentials";
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
/** The logins of every service the workspace last published. */
|
|
531
|
+
function devCredentials(workspace, credentials, ports) {
|
|
532
|
+
const containers = SIGNED_IN.filter((container) => portsOf(container).some((port) => ports[port.key] !== void 0));
|
|
533
|
+
const logs = resolveLogs(workspace.deploy?.compose?.logs);
|
|
534
|
+
const local = logs ? {
|
|
535
|
+
url: logs.public ? `https://logs.${workspace.name}.localhost` : `http://localhost:${logs.port}`,
|
|
536
|
+
via: `gkm compose --stage ${workspace.stages.local}`
|
|
537
|
+
} : void 0;
|
|
538
|
+
return {
|
|
539
|
+
workspace: workspace.name,
|
|
540
|
+
stage: workspace.stages.local,
|
|
541
|
+
services: serviceLogins({
|
|
542
|
+
containers,
|
|
543
|
+
ports,
|
|
544
|
+
credentials,
|
|
545
|
+
...local ? { logs: local } : {}
|
|
546
|
+
})
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
async function devCredentialsCommand(options = {}, print = (line) => console.log(line)) {
|
|
550
|
+
const { workspace } = await loadWorkspaceConfig(process.cwd());
|
|
551
|
+
const credentials = await readLocalCredentials(workspace);
|
|
552
|
+
if (!credentials) throw new NoLocalCredentials(workspace.name);
|
|
553
|
+
const output = devCredentials(workspace, credentials, await loadPortState(workspace.root));
|
|
554
|
+
if (options.json) {
|
|
555
|
+
print(JSON.stringify(output, null, 2));
|
|
556
|
+
return output;
|
|
557
|
+
}
|
|
558
|
+
print(`🔑 Local logins for ${output.workspace} (${output.stage})`);
|
|
559
|
+
if (output.services.length === 0) print(" No service has been published yet — start them with gkm dev, then run this again.");
|
|
560
|
+
for (const line of describeLogins(output.services)) print(line);
|
|
561
|
+
return output;
|
|
562
|
+
}
|
|
410
563
|
/** Overrides `dev.discoveryPort` — `0` serves on a port of its own. */
|
|
411
564
|
const DISCOVERY_PORT_ENV = "GKM_DISCOVERY_PORT";
|
|
412
565
|
/**
|
|
@@ -2045,6 +2198,11 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2045
2198
|
logger$5.log("🐳 Services");
|
|
2046
2199
|
for (const line of describeServices(reconciled.services)) logger$5.log(line);
|
|
2047
2200
|
}
|
|
2201
|
+
const { services: logins } = devCredentials(workspace, reconciled.credentials, reconciled.ports);
|
|
2202
|
+
if (logins.length > 0) {
|
|
2203
|
+
logger$5.log("🔑 Logins (again any time: gkm dev:credentials)");
|
|
2204
|
+
for (const line of describeLogins(logins)) logger$5.log(line);
|
|
2205
|
+
}
|
|
2048
2206
|
const secretsEnv = {
|
|
2049
2207
|
...rawSecrets,
|
|
2050
2208
|
...reconciled.env
|
|
@@ -2053,9 +2211,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2053
2211
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2054
2212
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2055
2213
|
if (options.migrate || options.seed) {
|
|
2056
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
2214
|
+
const { prepareDevDatabases } = await import("./migrate-KwZsJFce.mjs");
|
|
2057
2215
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2058
|
-
} else await import("./migrate-
|
|
2216
|
+
} else await import("./migrate-KwZsJFce.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2059
2217
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2060
2218
|
});
|
|
2061
2219
|
const appUrls = {};
|
|
@@ -3063,7 +3221,7 @@ async function buildApp(input) {
|
|
|
3063
3221
|
if (production?.bundle && !input.skipBundle) {
|
|
3064
3222
|
const outputDir = join(appRoot, ".gkm", "server");
|
|
3065
3223
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3066
|
-
const { bundleServer } = await import("./bundler-
|
|
3224
|
+
const { bundleServer } = await import("./bundler-Ba_LoFXI.mjs");
|
|
3067
3225
|
await bundleServer({
|
|
3068
3226
|
entryPoint,
|
|
3069
3227
|
outputDir: join(outputDir, "dist"),
|
|
@@ -3187,7 +3345,7 @@ async function buildWorkers(input) {
|
|
|
3187
3345
|
});
|
|
3188
3346
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3189
3347
|
if (!input.bundle) continue;
|
|
3190
|
-
const { bundleServer } = await import("./bundler-
|
|
3348
|
+
const { bundleServer } = await import("./bundler-Ba_LoFXI.mjs");
|
|
3191
3349
|
const outfile = workerBundleName(worker.id);
|
|
3192
3350
|
await bundleServer({
|
|
3193
3351
|
entryPoint,
|
|
@@ -3257,7 +3415,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3257
3415
|
let masterKey;
|
|
3258
3416
|
if (context.production?.bundle && !skipBundle) {
|
|
3259
3417
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3260
|
-
const { bundleServer } = await import("./bundler-
|
|
3418
|
+
const { bundleServer } = await import("./bundler-Ba_LoFXI.mjs");
|
|
3261
3419
|
const allConstructs = [
|
|
3262
3420
|
...endpoints.map((e) => e.construct),
|
|
3263
3421
|
...functions.map((f) => f.construct),
|
|
@@ -4959,25 +5117,25 @@ function loadPackageJson() {
|
|
|
4959
5117
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
4960
5118
|
*/
|
|
4961
5119
|
const GEEKMIDAS_VERSIONS = {
|
|
4962
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
4963
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
4964
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
4965
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
4966
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
4967
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
4968
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
4969
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
4970
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
4971
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
4972
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
4973
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
4974
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
4975
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
4976
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
4977
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
4978
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
4979
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
4980
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
5120
|
+
"@geekmidas/audit": "~10.0.0-alpha.81",
|
|
5121
|
+
"@geekmidas/auth": "~10.0.0-alpha.81",
|
|
5122
|
+
"@geekmidas/cache": "~10.0.0-alpha.81",
|
|
5123
|
+
"@geekmidas/client": "~10.0.0-alpha.81",
|
|
5124
|
+
"@geekmidas/cloud": "~10.0.0-alpha.81",
|
|
5125
|
+
"@geekmidas/constructs": "~10.0.0-alpha.81",
|
|
5126
|
+
"@geekmidas/db": "~10.0.0-alpha.81",
|
|
5127
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.81",
|
|
5128
|
+
"@geekmidas/envkit": "~10.0.0-alpha.81",
|
|
5129
|
+
"@geekmidas/errors": "~10.0.0-alpha.81",
|
|
5130
|
+
"@geekmidas/events": "~10.0.0-alpha.81",
|
|
5131
|
+
"@geekmidas/logger": "~10.0.0-alpha.81",
|
|
5132
|
+
"@geekmidas/manifest": "~10.0.0-alpha.81",
|
|
5133
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.81",
|
|
5134
|
+
"@geekmidas/schema": "~10.0.0-alpha.81",
|
|
5135
|
+
"@geekmidas/services": "~10.0.0-alpha.81",
|
|
5136
|
+
"@geekmidas/storage": "~10.0.0-alpha.81",
|
|
5137
|
+
"@geekmidas/telescope": "~10.0.0-alpha.81",
|
|
5138
|
+
"@geekmidas/testkit": "~10.0.0-alpha.81",
|
|
4981
5139
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
4982
5140
|
};
|
|
4983
5141
|
//#endregion
|
|
@@ -10586,7 +10744,7 @@ function printSummary(workspace, stage) {
|
|
|
10586
10744
|
* A no-op when nothing is recorded — no run yet, or one already torn down —
|
|
10587
10745
|
* so running it twice, or before a setup, is harmless.
|
|
10588
10746
|
*/
|
|
10589
|
-
async function dropTestDatabases(cwd, root, sql
|
|
10747
|
+
async function dropTestDatabases(cwd, root, sql) {
|
|
10590
10748
|
const readyPath = join(cwd, TEST_READY_FILE);
|
|
10591
10749
|
const ready = await readReady(readyPath);
|
|
10592
10750
|
const recorded = ready?.databases;
|
|
@@ -10722,7 +10880,10 @@ async function testCommand(options = {}) {
|
|
|
10722
10880
|
}
|
|
10723
10881
|
/** Drop what the last setup created — see `dropTestDatabases`. */
|
|
10724
10882
|
async function teardown(cwd) {
|
|
10725
|
-
const
|
|
10883
|
+
const workspace = await loadWorkspaceConfig(cwd).then((loaded) => loaded.workspace).catch(() => void 0);
|
|
10884
|
+
const credentials = workspace ? await readLocalCredentials(workspace) : null;
|
|
10885
|
+
if (!workspace || !credentials) return;
|
|
10886
|
+
const dropped = await dropTestDatabases(cwd, workspace.root, (port) => pgClient(port, credentials.postgres));
|
|
10726
10887
|
if (dropped.length > 0) console.log(` 🧹 Dropped ${dropped.join(", ")}`);
|
|
10727
10888
|
}
|
|
10728
10889
|
/**
|
|
@@ -10742,7 +10903,7 @@ function testDatabases(reconciled) {
|
|
|
10742
10903
|
* starts without the reference data the app needs.
|
|
10743
10904
|
*/
|
|
10744
10905
|
async function migrateTestStage(workspace, env) {
|
|
10745
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
10906
|
+
const { migrateAndSeed } = await import("./migrate-KwZsJFce.mjs");
|
|
10746
10907
|
const { discover } = await import("./discover-BPelzeGW.mjs").then((n) => n.i);
|
|
10747
10908
|
const sources = {};
|
|
10748
10909
|
const manifest = await discover({
|
|
@@ -11148,6 +11309,17 @@ program.command("dev").description("Reconcile constructs and start the dev serve
|
|
|
11148
11309
|
process.exit(1);
|
|
11149
11310
|
}
|
|
11150
11311
|
});
|
|
11312
|
+
program.command("dev:credentials").description("Print each local service's address and login — Postgres, MinIO, Mailpit, Redis, … — without starting anything").option("--json", "Print them as JSON, for a script").action(async (options) => {
|
|
11313
|
+
try {
|
|
11314
|
+
const globalOptions = program.opts();
|
|
11315
|
+
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11316
|
+
const { devCredentialsCommand } = await Promise.resolve().then(() => credentials_exports);
|
|
11317
|
+
await devCredentialsCommand(options);
|
|
11318
|
+
} catch (error) {
|
|
11319
|
+
console.error(formatError(error));
|
|
11320
|
+
process.exit(1);
|
|
11321
|
+
}
|
|
11322
|
+
});
|
|
11151
11323
|
program.command("exec").description("Run a command with secrets injected into Credentials").argument("<command...>", "Command to run (use -- before command)").action(async (commandArgs) => {
|
|
11152
11324
|
try {
|
|
11153
11325
|
const globalOptions = program.opts();
|
|
@@ -11175,7 +11347,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11175
11347
|
try {
|
|
11176
11348
|
const globalOptions = program.opts();
|
|
11177
11349
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11178
|
-
const { migrateCommand } = await import("./migrate-
|
|
11350
|
+
const { migrateCommand } = await import("./migrate-KwZsJFce.mjs");
|
|
11179
11351
|
await migrateCommand({
|
|
11180
11352
|
...options,
|
|
11181
11353
|
...construct ? { construct } : {}
|
|
@@ -11189,7 +11361,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11189
11361
|
try {
|
|
11190
11362
|
const globalOptions = program.opts();
|
|
11191
11363
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11192
|
-
const { seedCommand } = await import("./migrate-
|
|
11364
|
+
const { seedCommand } = await import("./migrate-KwZsJFce.mjs");
|
|
11193
11365
|
await seedCommand({
|
|
11194
11366
|
...options,
|
|
11195
11367
|
...construct ? { construct } : {}
|
|
@@ -11203,7 +11375,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11203
11375
|
try {
|
|
11204
11376
|
const globalOptions = program.opts();
|
|
11205
11377
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11206
|
-
const { migrationCommand } = await import("./migrate-
|
|
11378
|
+
const { migrationCommand } = await import("./migrate-KwZsJFce.mjs");
|
|
11207
11379
|
await migrationCommand({
|
|
11208
11380
|
construct,
|
|
11209
11381
|
...name ? { name } : {}
|
|
@@ -11307,7 +11479,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11307
11479
|
try {
|
|
11308
11480
|
const globalOptions = program.opts();
|
|
11309
11481
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11310
|
-
const { secretsAddCommand } = await import("./add-
|
|
11482
|
+
const { secretsAddCommand } = await import("./add-Bn1bqt0c.mjs");
|
|
11311
11483
|
await secretsAddCommand(options);
|
|
11312
11484
|
} catch (error) {
|
|
11313
11485
|
console.error(formatError(error));
|
|
@@ -11318,7 +11490,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11318
11490
|
try {
|
|
11319
11491
|
const globalOptions = program.opts();
|
|
11320
11492
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11321
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
11493
|
+
const { encryptionRotateCommand } = await import("./encryption-BESGvjHD.mjs");
|
|
11322
11494
|
await encryptionRotateCommand(construct, options);
|
|
11323
11495
|
} catch (error) {
|
|
11324
11496
|
console.error(formatError(error));
|
|
@@ -11329,7 +11501,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11329
11501
|
try {
|
|
11330
11502
|
const globalOptions = program.opts();
|
|
11331
11503
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11332
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
11504
|
+
const { encryptionRetireCommand } = await import("./encryption-BESGvjHD.mjs");
|
|
11333
11505
|
await encryptionRetireCommand(construct, key, options);
|
|
11334
11506
|
} catch (error) {
|
|
11335
11507
|
console.error(formatError(error));
|
|
@@ -11372,7 +11544,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11372
11544
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11373
11545
|
const { loadWorkspaceConfig } = await import("./config.mjs");
|
|
11374
11546
|
const { reconcileMissingSecrets } = await import("./reconcile--I7V4Klj.mjs");
|
|
11375
|
-
const { secretsStoreFor } = await import("./seeds-
|
|
11547
|
+
const { secretsStoreFor } = await import("./seeds-B4PiO_48.mjs").then((n) => n._n);
|
|
11376
11548
|
const { workspace } = await loadWorkspaceConfig();
|
|
11377
11549
|
const stage = options.stage ?? workspace.stages.local;
|
|
11378
11550
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11381,7 +11553,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11381
11553
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11382
11554
|
process.exit(1);
|
|
11383
11555
|
}
|
|
11384
|
-
const { derivedContainers } = await import("./seeds-
|
|
11556
|
+
const { derivedContainers } = await import("./seeds-B4PiO_48.mjs").then((n) => n.X);
|
|
11385
11557
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11386
11558
|
if (!result) {
|
|
11387
11559
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11399,7 +11571,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11399
11571
|
try {
|
|
11400
11572
|
const globalOptions = program.opts();
|
|
11401
11573
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11402
|
-
const { secretsMigrateCommand } = await import("./migrate-
|
|
11574
|
+
const { secretsMigrateCommand } = await import("./migrate-3oLefufw.mjs");
|
|
11403
11575
|
await secretsMigrateCommand(options);
|
|
11404
11576
|
} catch (error) {
|
|
11405
11577
|
console.error(formatError(error));
|
|
@@ -11407,7 +11579,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11407
11579
|
}
|
|
11408
11580
|
});
|
|
11409
11581
|
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) => {
|
|
11410
|
-
const { deployCli } = await import("./cli-
|
|
11582
|
+
const { deployCli } = await import("./cli-CznHL-4-.mjs");
|
|
11411
11583
|
const globalOptions = program.opts();
|
|
11412
11584
|
const code = await deployCli({
|
|
11413
11585
|
cwd: resolve(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11424,7 +11596,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11424
11596
|
});
|
|
11425
11597
|
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) => {
|
|
11426
11598
|
try {
|
|
11427
|
-
const { rollbackStage } = await import("./rollback-
|
|
11599
|
+
const { rollbackStage } = await import("./rollback-B7uQKHEk.mjs").then((n) => n.a);
|
|
11428
11600
|
const { terminalCredentials } = await import("./terminal-BdvrmkaC.mjs");
|
|
11429
11601
|
const globalOptions = program.opts();
|
|
11430
11602
|
await rollbackStage({
|
|
@@ -11460,7 +11632,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11460
11632
|
try {
|
|
11461
11633
|
const globalOptions = program.opts();
|
|
11462
11634
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11463
|
-
const { deployGithubCommand } = await import("./github-
|
|
11635
|
+
const { deployGithubCommand } = await import("./github-2OSRBf9G.mjs");
|
|
11464
11636
|
await deployGithubCommand(options);
|
|
11465
11637
|
} catch (error) {
|
|
11466
11638
|
console.error(formatError(error));
|