@geekmidas/cli 10.0.0-alpha.80 → 10.0.0-alpha.82
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/{EndpointGenerator-DftalLYg.mjs → EndpointGenerator-DtnIGafh.mjs} +71 -8
- package/dist/EndpointGenerator-DtnIGafh.mjs.map +1 -0
- package/dist/{EndpointGenerator-CP6sBvQV.cjs → EndpointGenerator-cKlnllIu.cjs} +88 -7
- package/dist/EndpointGenerator-cKlnllIu.cjs.map +1 -0
- package/dist/{OpenApiTsGenerator-nu1r1NgB.mjs → OpenApiTsGenerator-ByRPMbBN.mjs} +34 -7
- package/dist/OpenApiTsGenerator-ByRPMbBN.mjs.map +1 -0
- package/dist/{OpenApiTsGenerator-CKBCckKz.cjs → OpenApiTsGenerator-CdUM6Hvv.cjs} +34 -7
- package/dist/OpenApiTsGenerator-CdUM6Hvv.cjs.map +1 -0
- package/dist/{SubscriberGenerator-CajwOa5W.cjs → SubscriberGenerator-CYriX5BV.cjs} +2 -2
- package/dist/{SubscriberGenerator-CajwOa5W.cjs.map → SubscriberGenerator-CYriX5BV.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-5looQ3gB.mjs → SubscriberGenerator-DQZeGkDW.mjs} +2 -2
- package/dist/{SubscriberGenerator-5looQ3gB.mjs.map → SubscriberGenerator-DQZeGkDW.mjs.map} +1 -1
- package/dist/{add-DJ0VE-y-.cjs → add-1T3y6E4M.cjs} +2 -2
- package/dist/{add-DJ0VE-y-.cjs.map → add-1T3y6E4M.cjs.map} +1 -1
- package/dist/{add-CIxT-Iq6.mjs → add-DnYHJOap.mjs} +2 -2
- package/dist/{add-CIxT-Iq6.mjs.map → add-DnYHJOap.mjs.map} +1 -1
- package/dist/{bundler-D4pl87A5.mjs → bundler-DlKdxCGh.mjs} +3 -3
- package/dist/{bundler-D4pl87A5.mjs.map → bundler-DlKdxCGh.mjs.map} +1 -1
- package/dist/{bundler-BlbSLFLn.cjs → bundler-YNvLdvlh.cjs} +3 -3
- package/dist/{bundler-BlbSLFLn.cjs.map → bundler-YNvLdvlh.cjs.map} +1 -1
- package/dist/{cli-BkNZBe_-.cjs → cli-CWee1-wU.cjs} +3 -3
- package/dist/{cli-BkNZBe_-.cjs.map → cli-CWee1-wU.cjs.map} +1 -1
- package/dist/{cli-7aLfgIGt.mjs → cli-qMszGvDu.mjs} +3 -3
- package/dist/{cli-7aLfgIGt.mjs.map → cli-qMszGvDu.mjs.map} +1 -1
- package/dist/{compose-n7K8H5j8.mjs → compose-D4sD4Lgr.mjs} +83 -351
- package/dist/compose-D4sD4Lgr.mjs.map +1 -0
- package/dist/{compose-Bn4OJONR.cjs → compose-qnDyPJNp.cjs} +101 -369
- package/dist/compose-qnDyPJNp.cjs.map +1 -0
- package/dist/deploy/public.cjs +5 -5
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +5 -5
- package/dist/{deploy-DK4Y6ev4.mjs → deploy-C00DAKOt.mjs} +3 -3
- package/dist/{deploy-DK4Y6ev4.mjs.map → deploy-C00DAKOt.mjs.map} +1 -1
- package/dist/{deploy-Ppnh8MHS.cjs → deploy-CXP2fXvK.cjs} +3 -3
- package/dist/{deploy-Ppnh8MHS.cjs.map → deploy-CXP2fXvK.cjs.map} +1 -1
- package/dist/{dokploy-Bjq05wkw.mjs → dokploy-B3zoCmJb.mjs} +2 -2
- package/dist/{dokploy-Bjq05wkw.mjs.map → dokploy-B3zoCmJb.mjs.map} +1 -1
- package/dist/{dokploy-CJvdoNc3.cjs → dokploy-BHcSmghb.cjs} +2 -2
- package/dist/{dokploy-CJvdoNc3.cjs.map → dokploy-BHcSmghb.cjs.map} +1 -1
- package/dist/{drivers-Ch1rJitn.mjs → drivers-B4RP2B2O.mjs} +2 -2
- package/dist/{drivers-Ch1rJitn.mjs.map → drivers-B4RP2B2O.mjs.map} +1 -1
- package/dist/{drivers-BdvtCKc7.cjs → drivers-CJx76mcb.cjs} +2 -2
- package/dist/{drivers-BdvtCKc7.cjs.map → drivers-CJx76mcb.cjs.map} +1 -1
- package/dist/{encryption-CAyR6D7B.cjs → encryption-DLin89I_.cjs} +2 -2
- package/dist/{encryption-CAyR6D7B.cjs.map → encryption-DLin89I_.cjs.map} +1 -1
- package/dist/{encryption-BrsOJFFz.mjs → encryption-DPFljXtM.mjs} +2 -2
- package/dist/{encryption-BrsOJFFz.mjs.map → encryption-DPFljXtM.mjs.map} +1 -1
- package/dist/{engine-DzBZR5D0.cjs → engine-BS3iX9Mu.cjs} +2 -2
- package/dist/{engine-DzBZR5D0.cjs.map → engine-BS3iX9Mu.cjs.map} +1 -1
- package/dist/{engine-ba9CvjTo.mjs → engine-CgzgIg-_.mjs} +2 -2
- package/dist/{engine-ba9CvjTo.mjs.map → engine-CgzgIg-_.mjs.map} +1 -1
- package/dist/{github-BLjU59Ye.cjs → github-D8KVmNRg.cjs} +2 -2
- package/dist/{github-BLjU59Ye.cjs.map → github-D8KVmNRg.cjs.map} +1 -1
- package/dist/{github-CVdbVlT5.mjs → github-DL4zwJsR.mjs} +2 -2
- package/dist/{github-CVdbVlT5.mjs.map → github-DL4zwJsR.mjs.map} +1 -1
- package/dist/index.cjs +225 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +226 -50
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-iEdyEx4S.cjs → migrate-BdKhIJgT.cjs} +2 -2
- package/dist/{migrate-iEdyEx4S.cjs.map → migrate-BdKhIJgT.cjs.map} +1 -1
- package/dist/{migrate-DlBgATa-.mjs → migrate-CCejlgU0.mjs} +2 -2
- package/dist/{migrate-DlBgATa-.mjs.map → migrate-CCejlgU0.mjs.map} +1 -1
- package/dist/{migrate-pfu4aYzX.mjs → migrate-Cd3kcI7o.mjs} +2 -2
- package/dist/{migrate-pfu4aYzX.mjs.map → migrate-Cd3kcI7o.mjs.map} +1 -1
- package/dist/{migrate-DkB833Jj.cjs → migrate-DIjG8-QR.cjs} +2 -2
- package/dist/{migrate-DkB833Jj.cjs.map → migrate-DIjG8-QR.cjs.map} +1 -1
- package/dist/openapi.cjs +16 -11
- package/dist/openapi.cjs.map +1 -1
- package/dist/openapi.d.cts +28 -0
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +28 -0
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +16 -12
- package/dist/openapi.mjs.map +1 -1
- package/dist/{ready-BB9xS4S9.cjs → ready-4kx2pAhm.cjs} +5 -5
- package/dist/{ready-BB9xS4S9.cjs.map → ready-4kx2pAhm.cjs.map} +1 -1
- package/dist/{ready-ZZoNskrr.mjs → ready-DhZbZtFw.mjs} +5 -5
- package/dist/{ready-ZZoNskrr.mjs.map → ready-DhZbZtFw.mjs.map} +1 -1
- package/dist/{resolve-4_5N67Fk.cjs → resolve-ApSUK_HB.cjs} +3 -3
- package/dist/{resolve-4_5N67Fk.cjs.map → resolve-ApSUK_HB.cjs.map} +1 -1
- package/dist/{resolve-CQPn66jr.mjs → resolve-DY9TaVeV.mjs} +3 -3
- package/dist/{resolve-CQPn66jr.mjs.map → resolve-DY9TaVeV.mjs.map} +1 -1
- package/dist/{rollback-CgYUPLbq.cjs → rollback-CdGhCk1d.cjs} +3 -3
- package/dist/{rollback-CgYUPLbq.cjs.map → rollback-CdGhCk1d.cjs.map} +1 -1
- package/dist/{rollback-C0cbdsM-.mjs → rollback-DXU6cr7q.mjs} +3 -3
- package/dist/{rollback-C0cbdsM-.mjs.map → rollback-DXU6cr7q.mjs.map} +1 -1
- package/dist/{seeds-ZljwYV_p.cjs → seeds-BLzrSwEr.cjs} +3889 -2953
- package/dist/seeds-BLzrSwEr.cjs.map +1 -0
- package/dist/{seeds-BdkFpW0P.mjs → seeds-DbyqaXW4.mjs} +2344 -1528
- package/dist/seeds-DbyqaXW4.mjs.map +1 -0
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/package.json +15 -15
- package/dist/EndpointGenerator-CP6sBvQV.cjs.map +0 -1
- package/dist/EndpointGenerator-DftalLYg.mjs.map +0 -1
- package/dist/OpenApiTsGenerator-CKBCckKz.cjs.map +0 -1
- package/dist/OpenApiTsGenerator-nu1r1NgB.mjs.map +0 -1
- package/dist/compose-Bn4OJONR.cjs.map +0 -1
- package/dist/compose-n7K8H5j8.mjs.map +0 -1
- package/dist/seeds-BdkFpW0P.mjs.map +0 -1
- package/dist/seeds-ZljwYV_p.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -7,20 +7,20 @@ const require_discover = require("./discover-D1It5r_h.cjs");
|
|
|
7
7
|
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
8
8
|
const require_workspace = require("./workspace-Bp8FEkF-.cjs");
|
|
9
9
|
const require_config = require("./config.cjs");
|
|
10
|
-
const require_seeds = require("./seeds-
|
|
11
|
-
const require_EndpointGenerator = require("./EndpointGenerator-
|
|
10
|
+
const require_seeds = require("./seeds-BLzrSwEr.cjs");
|
|
11
|
+
const require_EndpointGenerator = require("./EndpointGenerator-cKlnllIu.cjs");
|
|
12
12
|
const require_openapi = require("./openapi.cjs");
|
|
13
|
-
const require_SubscriberGenerator = require("./SubscriberGenerator-
|
|
13
|
+
const require_SubscriberGenerator = require("./SubscriberGenerator-CYriX5BV.cjs");
|
|
14
14
|
const require_appPorts = require("./appPorts-Cu79hJF6.cjs");
|
|
15
|
-
const require_drivers = require("./drivers-
|
|
15
|
+
const require_drivers = require("./drivers-CJx76mcb.cjs");
|
|
16
16
|
const require_emit = require("./emit-Dmc1nvdS.cjs");
|
|
17
17
|
const require_sniffer = require("./sniffer-BjG-1mlD.cjs");
|
|
18
|
-
const require_deploy = require("./deploy-
|
|
19
|
-
const require_compose = require("./compose-
|
|
18
|
+
const require_deploy = require("./deploy-CXP2fXvK.cjs");
|
|
19
|
+
const require_compose = require("./compose-qnDyPJNp.cjs");
|
|
20
20
|
const require_credentialSchemas = require("./credentialSchemas-DCR4Wd1W.cjs");
|
|
21
21
|
const require_LocalStateStore = require("./LocalStateStore-Bocb8dmZ.cjs");
|
|
22
22
|
const require_utils = require("./utils-D2Nk1Nv2.cjs");
|
|
23
|
-
const require_ready = require("./ready-
|
|
23
|
+
const require_ready = require("./ready-4kx2pAhm.cjs");
|
|
24
24
|
let node_path = require("node:path");
|
|
25
25
|
let commander = require("commander");
|
|
26
26
|
let node_process = require("node:process");
|
|
@@ -53,7 +53,7 @@ crypto = require_rolldown_runtime.__toESM(crypto, 1);
|
|
|
53
53
|
let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
|
|
54
54
|
let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
|
|
55
55
|
//#region package.json
|
|
56
|
-
var version = "10.0.0-alpha.
|
|
56
|
+
var version = "10.0.0-alpha.82";
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/prompt.ts
|
|
59
59
|
/**
|
|
@@ -240,6 +240,91 @@ function maskToken(token) {
|
|
|
240
240
|
return `${token.slice(0, 4)}...${token.slice(-4)}`;
|
|
241
241
|
}
|
|
242
242
|
//#endregion
|
|
243
|
+
//#region src/reconcile/serviceLogins.ts
|
|
244
|
+
/**
|
|
245
|
+
* Where to sign in to each local service, and as whom — what `gkm dev`
|
|
246
|
+
* prints with its other addresses and `gkm dev:credentials` prints alone.
|
|
247
|
+
*
|
|
248
|
+
* Only the services a person opens or connects a client to: Postgres, the
|
|
249
|
+
* MinIO console, Mailpit's inbox, Redis and its HTTP proxy, RabbitMQ's
|
|
250
|
+
* console, the AWS emulator — and OpenObserve, where `gkm compose` runs it
|
|
251
|
+
* for the local stage.
|
|
252
|
+
*/
|
|
253
|
+
/** Each running service's address and login, in a stable order. */
|
|
254
|
+
function serviceLogins(options) {
|
|
255
|
+
const { containers, ports, credentials } = options;
|
|
256
|
+
const has = (container, key) => containers.includes(container) && ports[key] !== void 0;
|
|
257
|
+
const logins = [];
|
|
258
|
+
if (has("postgres", "postgres")) {
|
|
259
|
+
const { user, password } = credentials.postgres;
|
|
260
|
+
logins.push({
|
|
261
|
+
service: "postgres",
|
|
262
|
+
label: "Postgres",
|
|
263
|
+
url: `postgres://${user}:${encodeURIComponent(password)}@localhost:${ports.postgres}/${require_seeds.CLUSTER_DATABASE}`,
|
|
264
|
+
user,
|
|
265
|
+
password
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
if (has("minio", "minio-console")) logins.push({
|
|
269
|
+
service: "minio",
|
|
270
|
+
label: "MinIO console",
|
|
271
|
+
url: `http://localhost:${ports["minio-console"]}`,
|
|
272
|
+
...credentials.minio,
|
|
273
|
+
...ports.minio !== void 0 ? { note: `S3 API on http://localhost:${ports.minio}` } : {}
|
|
274
|
+
});
|
|
275
|
+
if (has("mailpit", "mailpit-web")) logins.push({
|
|
276
|
+
service: "mailpit",
|
|
277
|
+
label: "Mailpit inbox",
|
|
278
|
+
url: `http://localhost:${ports["mailpit-web"]}`,
|
|
279
|
+
note: "no login"
|
|
280
|
+
});
|
|
281
|
+
if (has("redis", "redis")) logins.push({
|
|
282
|
+
service: "redis",
|
|
283
|
+
label: "Redis",
|
|
284
|
+
url: `redis://:${encodeURIComponent(credentials.redis.password)}@localhost:${ports.redis}`,
|
|
285
|
+
password: credentials.redis.password
|
|
286
|
+
});
|
|
287
|
+
if (has("redis-http", "redis-http")) logins.push({
|
|
288
|
+
service: "redis-http",
|
|
289
|
+
label: "Cache (HTTP)",
|
|
290
|
+
url: `http://localhost:${ports["redis-http"]}`,
|
|
291
|
+
password: credentials.cacheToken,
|
|
292
|
+
note: "the password is its bearer token"
|
|
293
|
+
});
|
|
294
|
+
if (has("rabbitmq", "rabbitmq-management")) logins.push({
|
|
295
|
+
service: "rabbitmq",
|
|
296
|
+
label: "RabbitMQ console",
|
|
297
|
+
url: `http://localhost:${ports["rabbitmq-management"]}`,
|
|
298
|
+
...credentials.rabbitmq
|
|
299
|
+
});
|
|
300
|
+
if (has("localstack", "localstack")) logins.push({
|
|
301
|
+
service: "localstack",
|
|
302
|
+
label: "AWS emulator",
|
|
303
|
+
url: `http://localhost:${ports.localstack}`,
|
|
304
|
+
user: credentials.emulator.accessKeyId,
|
|
305
|
+
password: credentials.emulator.secretAccessKey,
|
|
306
|
+
note: "access key id / secret access key"
|
|
307
|
+
});
|
|
308
|
+
if (options.logs) logins.push({
|
|
309
|
+
service: "openobserve",
|
|
310
|
+
label: "OpenObserve",
|
|
311
|
+
url: options.logs.url,
|
|
312
|
+
user: credentials.logs.email,
|
|
313
|
+
password: credentials.logs.password,
|
|
314
|
+
note: `when running: ${options.logs.via}`
|
|
315
|
+
});
|
|
316
|
+
return logins;
|
|
317
|
+
}
|
|
318
|
+
/** The lines `gkm dev` and `gkm dev:credentials` print, one per service. */
|
|
319
|
+
function describeLogins(logins) {
|
|
320
|
+
const width = Math.max(0, ...logins.map(({ label }) => label.length));
|
|
321
|
+
return logins.flatMap((login) => {
|
|
322
|
+
const head = ` ${login.label.padEnd(width)} ${login.url}`;
|
|
323
|
+
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(" — ");
|
|
324
|
+
return detail ? [head, ` ${" ".repeat(width)} ${detail}`] : [head];
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
243
328
|
//#region src/trust/index.ts
|
|
244
329
|
/**
|
|
245
330
|
* Installing the local edge's certificate authority into the OS trust store.
|
|
@@ -413,6 +498,74 @@ var UnsupportedPlatform = class extends Error {
|
|
|
413
498
|
this.name = "UnsupportedPlatform";
|
|
414
499
|
}
|
|
415
500
|
};
|
|
501
|
+
//#endregion
|
|
502
|
+
//#region src/dev/credentials.ts
|
|
503
|
+
/**
|
|
504
|
+
* `gkm dev:credentials` — where to sign in to each local service, and as
|
|
505
|
+
* whom, without starting anything.
|
|
506
|
+
*
|
|
507
|
+
* Reads the workspace's generated local logins (see
|
|
508
|
+
* `reconcile/localCredentials.ts`) and the ports the last `gkm dev` or
|
|
509
|
+
* `gkm test` published them on (`.gkm/ports.json`). `--json` prints the same
|
|
510
|
+
* for a script.
|
|
511
|
+
*/
|
|
512
|
+
var credentials_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
513
|
+
NoLocalCredentials: () => NoLocalCredentials,
|
|
514
|
+
devCredentials: () => devCredentials,
|
|
515
|
+
devCredentialsCommand: () => devCredentialsCommand
|
|
516
|
+
});
|
|
517
|
+
/** The containers a person may sign in to, in the order they print. */
|
|
518
|
+
const SIGNED_IN = [
|
|
519
|
+
"postgres",
|
|
520
|
+
"minio",
|
|
521
|
+
"mailpit",
|
|
522
|
+
"redis",
|
|
523
|
+
"redis-http",
|
|
524
|
+
"rabbitmq",
|
|
525
|
+
"localstack"
|
|
526
|
+
];
|
|
527
|
+
/** Nothing has generated this workspace's local logins yet. */
|
|
528
|
+
var NoLocalCredentials = class extends Error {
|
|
529
|
+
workspace;
|
|
530
|
+
constructor(workspace) {
|
|
531
|
+
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.`);
|
|
532
|
+
this.workspace = workspace;
|
|
533
|
+
this.name = "NoLocalCredentials";
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
/** The logins of every service the workspace last published. */
|
|
537
|
+
function devCredentials(workspace, credentials, ports) {
|
|
538
|
+
const containers = SIGNED_IN.filter((container) => require_seeds.portsOf(container).some((port) => ports[port.key] !== void 0));
|
|
539
|
+
const logs = require_workspace.resolveLogs(workspace.deploy?.compose?.logs);
|
|
540
|
+
const local = logs ? {
|
|
541
|
+
url: logs.public ? `https://logs.${workspace.name}.localhost` : `http://localhost:${logs.port}`,
|
|
542
|
+
via: `gkm compose --stage ${workspace.stages.local}`
|
|
543
|
+
} : void 0;
|
|
544
|
+
return {
|
|
545
|
+
workspace: workspace.name,
|
|
546
|
+
stage: workspace.stages.local,
|
|
547
|
+
services: serviceLogins({
|
|
548
|
+
containers,
|
|
549
|
+
ports,
|
|
550
|
+
credentials,
|
|
551
|
+
...local ? { logs: local } : {}
|
|
552
|
+
})
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
async function devCredentialsCommand(options = {}, print = (line) => console.log(line)) {
|
|
556
|
+
const { workspace } = await require_config.loadWorkspaceConfig(process.cwd());
|
|
557
|
+
const credentials = await require_seeds.readLocalCredentials(workspace);
|
|
558
|
+
if (!credentials) throw new NoLocalCredentials(workspace.name);
|
|
559
|
+
const output = devCredentials(workspace, credentials, await require_seeds.loadPortState(workspace.root));
|
|
560
|
+
if (options.json) {
|
|
561
|
+
print(JSON.stringify(output, null, 2));
|
|
562
|
+
return output;
|
|
563
|
+
}
|
|
564
|
+
print(`🔑 Local logins for ${output.workspace} (${output.stage})`);
|
|
565
|
+
if (output.services.length === 0) print(" No service has been published yet — start them with gkm dev, then run this again.");
|
|
566
|
+
for (const line of describeLogins(output.services)) print(line);
|
|
567
|
+
return output;
|
|
568
|
+
}
|
|
416
569
|
/** Overrides `dev.discoveryPort` — `0` serves on a port of its own. */
|
|
417
570
|
const DISCOVERY_PORT_ENV = "GKM_DISCOVERY_PORT";
|
|
418
571
|
/**
|
|
@@ -2051,6 +2204,11 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2051
2204
|
logger$5.log("🐳 Services");
|
|
2052
2205
|
for (const line of require_seeds.describeServices(reconciled.services)) logger$5.log(line);
|
|
2053
2206
|
}
|
|
2207
|
+
const { services: logins } = devCredentials(workspace, reconciled.credentials, reconciled.ports);
|
|
2208
|
+
if (logins.length > 0) {
|
|
2209
|
+
logger$5.log("🔑 Logins (again any time: gkm dev:credentials)");
|
|
2210
|
+
for (const line of describeLogins(logins)) logger$5.log(line);
|
|
2211
|
+
}
|
|
2054
2212
|
const secretsEnv = {
|
|
2055
2213
|
...rawSecrets,
|
|
2056
2214
|
...reconciled.env
|
|
@@ -2059,9 +2217,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
2059
2217
|
for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
2060
2218
|
logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
2061
2219
|
if (options.migrate || options.seed) {
|
|
2062
|
-
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-
|
|
2220
|
+
const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs"));
|
|
2063
2221
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
2064
|
-
} else await Promise.resolve().then(() => require("./migrate-
|
|
2222
|
+
} else await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
2065
2223
|
logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
2066
2224
|
});
|
|
2067
2225
|
const appUrls = {};
|
|
@@ -3069,7 +3227,7 @@ async function buildApp(input) {
|
|
|
3069
3227
|
if (production?.bundle && !input.skipBundle) {
|
|
3070
3228
|
const outputDir = (0, node_path.join)(appRoot, ".gkm", "server");
|
|
3071
3229
|
const entryPoint = await writeSurfaceServer(outputDir, production);
|
|
3072
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3230
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-YNvLdvlh.cjs"));
|
|
3073
3231
|
await bundleServer({
|
|
3074
3232
|
entryPoint,
|
|
3075
3233
|
outputDir: (0, node_path.join)(outputDir, "dist"),
|
|
@@ -3193,7 +3351,7 @@ async function buildWorkers(input) {
|
|
|
3193
3351
|
});
|
|
3194
3352
|
logger$4.log(`Generated worker ${worker.id}: ${crons.length} crons, ${queues.length} queues, ${subscribers.length} subscribers`);
|
|
3195
3353
|
if (!input.bundle) continue;
|
|
3196
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3354
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-YNvLdvlh.cjs"));
|
|
3197
3355
|
const outfile = require_seeds.workerBundleName(worker.id);
|
|
3198
3356
|
await bundleServer({
|
|
3199
3357
|
entryPoint,
|
|
@@ -3263,7 +3421,7 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
|
|
|
3263
3421
|
let masterKey;
|
|
3264
3422
|
if (context.production?.bundle && !skipBundle) {
|
|
3265
3423
|
logger$4.log(`\n📦 Bundling production server...`);
|
|
3266
|
-
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-
|
|
3424
|
+
const { bundleServer } = await Promise.resolve().then(() => require("./bundler-YNvLdvlh.cjs"));
|
|
3267
3425
|
const allConstructs = [
|
|
3268
3426
|
...endpoints.map((e) => e.construct),
|
|
3269
3427
|
...functions.map((f) => f.construct),
|
|
@@ -4965,25 +5123,25 @@ function loadPackageJson() {
|
|
|
4965
5123
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
4966
5124
|
*/
|
|
4967
5125
|
const GEEKMIDAS_VERSIONS = {
|
|
4968
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
4969
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
4970
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
4971
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
4972
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
4973
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
4974
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
4975
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
4976
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
4977
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
4978
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
4979
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
4980
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
4981
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
4982
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
4983
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
4984
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
4985
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
4986
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
5126
|
+
"@geekmidas/audit": "~10.0.0-alpha.82",
|
|
5127
|
+
"@geekmidas/auth": "~10.0.0-alpha.82",
|
|
5128
|
+
"@geekmidas/cache": "~10.0.0-alpha.82",
|
|
5129
|
+
"@geekmidas/client": "~10.0.0-alpha.82",
|
|
5130
|
+
"@geekmidas/cloud": "~10.0.0-alpha.82",
|
|
5131
|
+
"@geekmidas/constructs": "~10.0.0-alpha.82",
|
|
5132
|
+
"@geekmidas/db": "~10.0.0-alpha.82",
|
|
5133
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.82",
|
|
5134
|
+
"@geekmidas/envkit": "~10.0.0-alpha.82",
|
|
5135
|
+
"@geekmidas/errors": "~10.0.0-alpha.82",
|
|
5136
|
+
"@geekmidas/events": "~10.0.0-alpha.82",
|
|
5137
|
+
"@geekmidas/logger": "~10.0.0-alpha.82",
|
|
5138
|
+
"@geekmidas/manifest": "~10.0.0-alpha.82",
|
|
5139
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.82",
|
|
5140
|
+
"@geekmidas/schema": "~10.0.0-alpha.82",
|
|
5141
|
+
"@geekmidas/services": "~10.0.0-alpha.82",
|
|
5142
|
+
"@geekmidas/storage": "~10.0.0-alpha.82",
|
|
5143
|
+
"@geekmidas/telescope": "~10.0.0-alpha.82",
|
|
5144
|
+
"@geekmidas/testkit": "~10.0.0-alpha.82",
|
|
4987
5145
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
4988
5146
|
};
|
|
4989
5147
|
//#endregion
|
|
@@ -10592,7 +10750,7 @@ function printSummary(workspace, stage) {
|
|
|
10592
10750
|
* A no-op when nothing is recorded — no run yet, or one already torn down —
|
|
10593
10751
|
* so running it twice, or before a setup, is harmless.
|
|
10594
10752
|
*/
|
|
10595
|
-
async function dropTestDatabases(cwd, root, sql
|
|
10753
|
+
async function dropTestDatabases(cwd, root, sql) {
|
|
10596
10754
|
const readyPath = (0, node_path.join)(cwd, require_ready.TEST_READY_FILE);
|
|
10597
10755
|
const ready = await readReady(readyPath);
|
|
10598
10756
|
const recorded = ready?.databases;
|
|
@@ -10728,7 +10886,10 @@ async function testCommand(options = {}) {
|
|
|
10728
10886
|
}
|
|
10729
10887
|
/** Drop what the last setup created — see `dropTestDatabases`. */
|
|
10730
10888
|
async function teardown(cwd) {
|
|
10731
|
-
const
|
|
10889
|
+
const workspace = await require_config.loadWorkspaceConfig(cwd).then((loaded) => loaded.workspace).catch(() => void 0);
|
|
10890
|
+
const credentials = workspace ? await require_seeds.readLocalCredentials(workspace) : null;
|
|
10891
|
+
if (!workspace || !credentials) return;
|
|
10892
|
+
const dropped = await dropTestDatabases(cwd, workspace.root, (port) => require_seeds.pgClient(port, credentials.postgres));
|
|
10732
10893
|
if (dropped.length > 0) console.log(` 🧹 Dropped ${dropped.join(", ")}`);
|
|
10733
10894
|
}
|
|
10734
10895
|
/**
|
|
@@ -10748,7 +10909,7 @@ function testDatabases(reconciled) {
|
|
|
10748
10909
|
* starts without the reference data the app needs.
|
|
10749
10910
|
*/
|
|
10750
10911
|
async function migrateTestStage(workspace, env) {
|
|
10751
|
-
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-
|
|
10912
|
+
const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs"));
|
|
10752
10913
|
const { discover } = await Promise.resolve().then(() => require("./discover-D1It5r_h.cjs")).then((n) => n.discover_exports);
|
|
10753
10914
|
const sources = {};
|
|
10754
10915
|
const manifest = await discover({
|
|
@@ -11154,6 +11315,17 @@ program.command("dev").description("Reconcile constructs and start the dev serve
|
|
|
11154
11315
|
process.exit(1);
|
|
11155
11316
|
}
|
|
11156
11317
|
});
|
|
11318
|
+
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) => {
|
|
11319
|
+
try {
|
|
11320
|
+
const globalOptions = program.opts();
|
|
11321
|
+
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11322
|
+
const { devCredentialsCommand } = await Promise.resolve().then(() => credentials_exports);
|
|
11323
|
+
await devCredentialsCommand(options);
|
|
11324
|
+
} catch (error) {
|
|
11325
|
+
console.error(formatError(error));
|
|
11326
|
+
process.exit(1);
|
|
11327
|
+
}
|
|
11328
|
+
});
|
|
11157
11329
|
program.command("exec").description("Run a command with secrets injected into Credentials").argument("<command...>", "Command to run (use -- before command)").action(async (commandArgs) => {
|
|
11158
11330
|
try {
|
|
11159
11331
|
const globalOptions = program.opts();
|
|
@@ -11181,7 +11353,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
11181
11353
|
try {
|
|
11182
11354
|
const globalOptions = program.opts();
|
|
11183
11355
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11184
|
-
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11356
|
+
const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs"));
|
|
11185
11357
|
await migrateCommand({
|
|
11186
11358
|
...options,
|
|
11187
11359
|
...construct ? { construct } : {}
|
|
@@ -11195,7 +11367,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
11195
11367
|
try {
|
|
11196
11368
|
const globalOptions = program.opts();
|
|
11197
11369
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11198
|
-
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11370
|
+
const { seedCommand } = await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs"));
|
|
11199
11371
|
await seedCommand({
|
|
11200
11372
|
...options,
|
|
11201
11373
|
...construct ? { construct } : {}
|
|
@@ -11209,7 +11381,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
11209
11381
|
try {
|
|
11210
11382
|
const globalOptions = program.opts();
|
|
11211
11383
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11212
|
-
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11384
|
+
const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-DIjG8-QR.cjs"));
|
|
11213
11385
|
await migrationCommand({
|
|
11214
11386
|
construct,
|
|
11215
11387
|
...name ? { name } : {}
|
|
@@ -11234,11 +11406,15 @@ program.command("api").description("Manage REST API endpoints").action(() => {
|
|
|
11234
11406
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11235
11407
|
process.stdout.write("REST API management - coming soon\n");
|
|
11236
11408
|
});
|
|
11237
|
-
program.command("openapi").description("Generate OpenAPI specification from endpoints").option("--app <name>", "Workspace mode: generate for a single named backend app").action(async (options) => {
|
|
11409
|
+
program.command("openapi").description("Generate OpenAPI specification from endpoints").option("--app <name>", "Workspace mode: generate for a single named backend app").option("--telemetry [sampleRate]", "Generated clients send W3C trace context to their API by default, at the stage's sample rate (0-1, default 1)").action(async (options) => {
|
|
11238
11410
|
try {
|
|
11239
11411
|
const globalOptions = program.opts();
|
|
11240
11412
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11241
|
-
|
|
11413
|
+
const telemetry = require_EndpointGenerator.parseTelemetryFlag(options.telemetry);
|
|
11414
|
+
await require_openapi.openapiCommand({
|
|
11415
|
+
app: options.app,
|
|
11416
|
+
...telemetry !== void 0 ? { telemetry } : {}
|
|
11417
|
+
});
|
|
11242
11418
|
} catch (error) {
|
|
11243
11419
|
console.error(formatError(error));
|
|
11244
11420
|
process.exit(1);
|
|
@@ -11313,7 +11489,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11313
11489
|
try {
|
|
11314
11490
|
const globalOptions = program.opts();
|
|
11315
11491
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11316
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
11492
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-1T3y6E4M.cjs"));
|
|
11317
11493
|
await secretsAddCommand(options);
|
|
11318
11494
|
} catch (error) {
|
|
11319
11495
|
console.error(formatError(error));
|
|
@@ -11324,7 +11500,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11324
11500
|
try {
|
|
11325
11501
|
const globalOptions = program.opts();
|
|
11326
11502
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11327
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11503
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-DLin89I_.cjs"));
|
|
11328
11504
|
await encryptionRotateCommand(construct, options);
|
|
11329
11505
|
} catch (error) {
|
|
11330
11506
|
console.error(formatError(error));
|
|
@@ -11335,7 +11511,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11335
11511
|
try {
|
|
11336
11512
|
const globalOptions = program.opts();
|
|
11337
11513
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11338
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11514
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-DLin89I_.cjs"));
|
|
11339
11515
|
await encryptionRetireCommand(construct, key, options);
|
|
11340
11516
|
} catch (error) {
|
|
11341
11517
|
console.error(formatError(error));
|
|
@@ -11378,7 +11554,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11378
11554
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11379
11555
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
11380
11556
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
11381
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-
|
|
11557
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-BLzrSwEr.cjs")).then((n) => n.store_exports);
|
|
11382
11558
|
const { workspace } = await loadWorkspaceConfig();
|
|
11383
11559
|
const stage = options.stage ?? workspace.stages.local;
|
|
11384
11560
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11387,7 +11563,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11387
11563
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11388
11564
|
process.exit(1);
|
|
11389
11565
|
}
|
|
11390
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-
|
|
11566
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-BLzrSwEr.cjs")).then((n) => n.workspace_exports);
|
|
11391
11567
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11392
11568
|
if (!result) {
|
|
11393
11569
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11405,7 +11581,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11405
11581
|
try {
|
|
11406
11582
|
const globalOptions = program.opts();
|
|
11407
11583
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11408
|
-
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11584
|
+
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-BdKhIJgT.cjs"));
|
|
11409
11585
|
await secretsMigrateCommand(options);
|
|
11410
11586
|
} catch (error) {
|
|
11411
11587
|
console.error(formatError(error));
|
|
@@ -11413,7 +11589,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11413
11589
|
}
|
|
11414
11590
|
});
|
|
11415
11591
|
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) => {
|
|
11416
|
-
const { deployCli } = await Promise.resolve().then(() => require("./cli-
|
|
11592
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-CWee1-wU.cjs"));
|
|
11417
11593
|
const globalOptions = program.opts();
|
|
11418
11594
|
const code = await deployCli({
|
|
11419
11595
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11430,7 +11606,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11430
11606
|
});
|
|
11431
11607
|
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) => {
|
|
11432
11608
|
try {
|
|
11433
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
11609
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-CdGhCk1d.cjs")).then((n) => n.rollback_exports);
|
|
11434
11610
|
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-BL5E0xbR.cjs"));
|
|
11435
11611
|
const globalOptions = program.opts();
|
|
11436
11612
|
await rollbackStage({
|
|
@@ -11466,7 +11642,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11466
11642
|
try {
|
|
11467
11643
|
const globalOptions = program.opts();
|
|
11468
11644
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11469
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
11645
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-D8KVmNRg.cjs"));
|
|
11470
11646
|
await deployGithubCommand(options);
|
|
11471
11647
|
} catch (error) {
|
|
11472
11648
|
console.error(formatError(error));
|