@geekmidas/cli 10.0.0-alpha.80 → 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-CIxT-Iq6.mjs → add-Bn1bqt0c.mjs} +2 -2
- package/dist/{add-CIxT-Iq6.mjs.map → add-Bn1bqt0c.mjs.map} +1 -1
- package/dist/{add-DJ0VE-y-.cjs → add-DF9IHQov.cjs} +2 -2
- package/dist/{add-DJ0VE-y-.cjs.map → add-DF9IHQov.cjs.map} +1 -1
- package/dist/{bundler-D4pl87A5.mjs → bundler-Ba_LoFXI.mjs} +3 -3
- package/dist/{bundler-D4pl87A5.mjs.map → bundler-Ba_LoFXI.mjs.map} +1 -1
- package/dist/{bundler-BlbSLFLn.cjs → bundler-DeIVbloM.cjs} +3 -3
- package/dist/{bundler-BlbSLFLn.cjs.map → bundler-DeIVbloM.cjs.map} +1 -1
- package/dist/{cli-BkNZBe_-.cjs → cli-BB1KOkfo.cjs} +3 -3
- package/dist/{cli-BkNZBe_-.cjs.map → cli-BB1KOkfo.cjs.map} +1 -1
- package/dist/{cli-7aLfgIGt.mjs → cli-CznHL-4-.mjs} +3 -3
- package/dist/{cli-7aLfgIGt.mjs.map → cli-CznHL-4-.mjs.map} +1 -1
- package/dist/{compose-Bn4OJONR.cjs → compose-76ho0pUg.cjs} +99 -367
- package/dist/compose-76ho0pUg.cjs.map +1 -0
- package/dist/{compose-n7K8H5j8.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-DK4Y6ev4.mjs → deploy-BRUx9hiA.mjs} +3 -3
- package/dist/{deploy-DK4Y6ev4.mjs.map → deploy-BRUx9hiA.mjs.map} +1 -1
- package/dist/{deploy-Ppnh8MHS.cjs → deploy-DuHRWNeJ.cjs} +3 -3
- package/dist/{deploy-Ppnh8MHS.cjs.map → deploy-DuHRWNeJ.cjs.map} +1 -1
- package/dist/{dokploy-Bjq05wkw.mjs → dokploy-BTO37Co8.mjs} +2 -2
- package/dist/{dokploy-Bjq05wkw.mjs.map → dokploy-BTO37Co8.mjs.map} +1 -1
- package/dist/{dokploy-CJvdoNc3.cjs → dokploy-Q4iYDmls.cjs} +2 -2
- package/dist/{dokploy-CJvdoNc3.cjs.map → dokploy-Q4iYDmls.cjs.map} +1 -1
- package/dist/{encryption-CAyR6D7B.cjs → encryption-9YA5ThNl.cjs} +2 -2
- package/dist/{encryption-CAyR6D7B.cjs.map → encryption-9YA5ThNl.cjs.map} +1 -1
- package/dist/{encryption-BrsOJFFz.mjs → encryption-BESGvjHD.mjs} +2 -2
- package/dist/{encryption-BrsOJFFz.mjs.map → encryption-BESGvjHD.mjs.map} +1 -1
- package/dist/{engine-ba9CvjTo.mjs → engine-CHij99aX.mjs} +2 -2
- package/dist/{engine-ba9CvjTo.mjs.map → engine-CHij99aX.mjs.map} +1 -1
- package/dist/{engine-DzBZR5D0.cjs → engine-U0xzB5i4.cjs} +2 -2
- package/dist/{engine-DzBZR5D0.cjs.map → engine-U0xzB5i4.cjs.map} +1 -1
- package/dist/{github-CVdbVlT5.mjs → github-2OSRBf9G.mjs} +2 -2
- package/dist/{github-CVdbVlT5.mjs.map → github-2OSRBf9G.mjs.map} +1 -1
- package/dist/{github-BLjU59Ye.cjs → github-BM-Y9M2G.cjs} +2 -2
- package/dist/{github-BLjU59Ye.cjs.map → github-BM-Y9M2G.cjs.map} +1 -1
- 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-pfu4aYzX.mjs → migrate-3oLefufw.mjs} +2 -2
- package/dist/{migrate-pfu4aYzX.mjs.map → migrate-3oLefufw.mjs.map} +1 -1
- package/dist/{migrate-DkB833Jj.cjs → migrate-BlYiMA23.cjs} +2 -2
- package/dist/{migrate-DkB833Jj.cjs.map → migrate-BlYiMA23.cjs.map} +1 -1
- package/dist/{migrate-iEdyEx4S.cjs → migrate-C440QQvZ.cjs} +2 -2
- package/dist/{migrate-iEdyEx4S.cjs.map → migrate-C440QQvZ.cjs.map} +1 -1
- package/dist/{migrate-DlBgATa-.mjs → migrate-KwZsJFce.mjs} +2 -2
- package/dist/{migrate-DlBgATa-.mjs.map → migrate-KwZsJFce.mjs.map} +1 -1
- package/dist/{resolve-CQPn66jr.mjs → resolve-BPIDcuQ3.mjs} +3 -3
- package/dist/{resolve-CQPn66jr.mjs.map → resolve-BPIDcuQ3.mjs.map} +1 -1
- package/dist/{resolve-4_5N67Fk.cjs → resolve-CBrJTyDO.cjs} +3 -3
- package/dist/{resolve-4_5N67Fk.cjs.map → resolve-CBrJTyDO.cjs.map} +1 -1
- package/dist/{rollback-C0cbdsM-.mjs → rollback-B7uQKHEk.mjs} +3 -3
- package/dist/{rollback-C0cbdsM-.mjs.map → rollback-B7uQKHEk.mjs.map} +1 -1
- package/dist/{rollback-CgYUPLbq.cjs → rollback-P09wRaW4.cjs} +3 -3
- package/dist/{rollback-CgYUPLbq.cjs.map → rollback-P09wRaW4.cjs.map} +1 -1
- package/dist/{seeds-BdkFpW0P.mjs → seeds-B4PiO_48.mjs} +2332 -1525
- package/dist/seeds-B4PiO_48.mjs.map +1 -0
- package/dist/{seeds-ZljwYV_p.cjs → seeds-BjHiy9tW.cjs} +3877 -2950
- 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-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,7 +7,7 @@ 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-
|
|
10
|
+
const require_seeds = require("./seeds-BjHiy9tW.cjs");
|
|
11
11
|
const require_EndpointGenerator = require("./EndpointGenerator-CP6sBvQV.cjs");
|
|
12
12
|
const require_openapi = require("./openapi.cjs");
|
|
13
13
|
const require_SubscriberGenerator = require("./SubscriberGenerator-CajwOa5W.cjs");
|
|
@@ -15,8 +15,8 @@ const require_appPorts = require("./appPorts-Cu79hJF6.cjs");
|
|
|
15
15
|
const require_drivers = require("./drivers-BdvtCKc7.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-DuHRWNeJ.cjs");
|
|
19
|
+
const require_compose = require("./compose-76ho0pUg.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");
|
|
@@ -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.81";
|
|
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-BlYiMA23.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-BlYiMA23.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-DeIVbloM.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-DeIVbloM.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-DeIVbloM.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.81",
|
|
5127
|
+
"@geekmidas/auth": "~10.0.0-alpha.81",
|
|
5128
|
+
"@geekmidas/cache": "~10.0.0-alpha.81",
|
|
5129
|
+
"@geekmidas/client": "~10.0.0-alpha.81",
|
|
5130
|
+
"@geekmidas/cloud": "~10.0.0-alpha.81",
|
|
5131
|
+
"@geekmidas/constructs": "~10.0.0-alpha.81",
|
|
5132
|
+
"@geekmidas/db": "~10.0.0-alpha.81",
|
|
5133
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.81",
|
|
5134
|
+
"@geekmidas/envkit": "~10.0.0-alpha.81",
|
|
5135
|
+
"@geekmidas/errors": "~10.0.0-alpha.81",
|
|
5136
|
+
"@geekmidas/events": "~10.0.0-alpha.81",
|
|
5137
|
+
"@geekmidas/logger": "~10.0.0-alpha.81",
|
|
5138
|
+
"@geekmidas/manifest": "~10.0.0-alpha.81",
|
|
5139
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.81",
|
|
5140
|
+
"@geekmidas/schema": "~10.0.0-alpha.81",
|
|
5141
|
+
"@geekmidas/services": "~10.0.0-alpha.81",
|
|
5142
|
+
"@geekmidas/storage": "~10.0.0-alpha.81",
|
|
5143
|
+
"@geekmidas/telescope": "~10.0.0-alpha.81",
|
|
5144
|
+
"@geekmidas/testkit": "~10.0.0-alpha.81",
|
|
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-BlYiMA23.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-BlYiMA23.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-BlYiMA23.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-BlYiMA23.cjs"));
|
|
11213
11385
|
await migrationCommand({
|
|
11214
11386
|
construct,
|
|
11215
11387
|
...name ? { name } : {}
|
|
@@ -11313,7 +11485,7 @@ program.command("secrets:add").description("Build the keys a stage must be given
|
|
|
11313
11485
|
try {
|
|
11314
11486
|
const globalOptions = program.opts();
|
|
11315
11487
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11316
|
-
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-
|
|
11488
|
+
const { secretsAddCommand } = await Promise.resolve().then(() => require("./add-DF9IHQov.cjs"));
|
|
11317
11489
|
await secretsAddCommand(options);
|
|
11318
11490
|
} catch (error) {
|
|
11319
11491
|
console.error(formatError(error));
|
|
@@ -11324,7 +11496,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
11324
11496
|
try {
|
|
11325
11497
|
const globalOptions = program.opts();
|
|
11326
11498
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11327
|
-
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11499
|
+
const { encryptionRotateCommand } = await Promise.resolve().then(() => require("./encryption-9YA5ThNl.cjs"));
|
|
11328
11500
|
await encryptionRotateCommand(construct, options);
|
|
11329
11501
|
} catch (error) {
|
|
11330
11502
|
console.error(formatError(error));
|
|
@@ -11335,7 +11507,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
11335
11507
|
try {
|
|
11336
11508
|
const globalOptions = program.opts();
|
|
11337
11509
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11338
|
-
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-
|
|
11510
|
+
const { encryptionRetireCommand } = await Promise.resolve().then(() => require("./encryption-9YA5ThNl.cjs"));
|
|
11339
11511
|
await encryptionRetireCommand(construct, key, options);
|
|
11340
11512
|
} catch (error) {
|
|
11341
11513
|
console.error(formatError(error));
|
|
@@ -11378,7 +11550,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11378
11550
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11379
11551
|
const { loadWorkspaceConfig } = await Promise.resolve().then(() => require("./config.cjs"));
|
|
11380
11552
|
const { reconcileMissingSecrets } = await Promise.resolve().then(() => require("./reconcile-CuCQBa5-.cjs"));
|
|
11381
|
-
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-
|
|
11553
|
+
const { secretsStoreFor } = await Promise.resolve().then(() => require("./seeds-BjHiy9tW.cjs")).then((n) => n.store_exports);
|
|
11382
11554
|
const { workspace } = await loadWorkspaceConfig();
|
|
11383
11555
|
const stage = options.stage ?? workspace.stages.local;
|
|
11384
11556
|
const store = await secretsStoreFor(workspace, stage);
|
|
@@ -11387,7 +11559,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
11387
11559
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
11388
11560
|
process.exit(1);
|
|
11389
11561
|
}
|
|
11390
|
-
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-
|
|
11562
|
+
const { derivedContainers } = await Promise.resolve().then(() => require("./seeds-BjHiy9tW.cjs")).then((n) => n.workspace_exports);
|
|
11391
11563
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
11392
11564
|
if (!result) {
|
|
11393
11565
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|
|
@@ -11405,7 +11577,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11405
11577
|
try {
|
|
11406
11578
|
const globalOptions = program.opts();
|
|
11407
11579
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11408
|
-
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-
|
|
11580
|
+
const { secretsMigrateCommand } = await Promise.resolve().then(() => require("./migrate-C440QQvZ.cjs"));
|
|
11409
11581
|
await secretsMigrateCommand(options);
|
|
11410
11582
|
} catch (error) {
|
|
11411
11583
|
console.error(formatError(error));
|
|
@@ -11413,7 +11585,7 @@ program.command("secrets:migrate").description("Copy a deployed stage's secrets
|
|
|
11413
11585
|
}
|
|
11414
11586
|
});
|
|
11415
11587
|
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-
|
|
11588
|
+
const { deployCli } = await Promise.resolve().then(() => require("./cli-BB1KOkfo.cjs"));
|
|
11417
11589
|
const globalOptions = program.opts();
|
|
11418
11590
|
const code = await deployCli({
|
|
11419
11591
|
cwd: (0, node_path.resolve)(globalOptions.cwd ?? process.cwd()),
|
|
@@ -11430,7 +11602,7 @@ program.command("deploy").description("Deploy a stage through its target").optio
|
|
|
11430
11602
|
});
|
|
11431
11603
|
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
11604
|
try {
|
|
11433
|
-
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-
|
|
11605
|
+
const { rollbackStage } = await Promise.resolve().then(() => require("./rollback-P09wRaW4.cjs")).then((n) => n.rollback_exports);
|
|
11434
11606
|
const { terminalCredentials } = await Promise.resolve().then(() => require("./terminal-BL5E0xbR.cjs"));
|
|
11435
11607
|
const globalOptions = program.opts();
|
|
11436
11608
|
await rollbackStage({
|
|
@@ -11466,7 +11638,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
|
|
|
11466
11638
|
try {
|
|
11467
11639
|
const globalOptions = program.opts();
|
|
11468
11640
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
11469
|
-
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-
|
|
11641
|
+
const { deployGithubCommand } = await Promise.resolve().then(() => require("./github-BM-Y9M2G.cjs"));
|
|
11470
11642
|
await deployGithubCommand(options);
|
|
11471
11643
|
} catch (error) {
|
|
11472
11644
|
console.error(formatError(error));
|