@geekmidas/cli 10.0.0-alpha.51 → 10.0.0-alpha.52
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/{backends-B9V2XD2M.cjs → backends-BXcwhb7p.cjs} +2 -2
- package/dist/{backends-B9V2XD2M.cjs.map → backends-BXcwhb7p.cjs.map} +1 -1
- package/dist/{backends-CSuLl0YP.mjs → backends-CLq1wlQf.mjs} +2 -2
- package/dist/{backends-CSuLl0YP.mjs.map → backends-CLq1wlQf.mjs.map} +1 -1
- package/dist/{encryption-DRCXp-U4.mjs → encryption-Cv-Ej9vR.mjs} +2 -2
- package/dist/{encryption-DRCXp-U4.mjs.map → encryption-Cv-Ej9vR.mjs.map} +1 -1
- package/dist/{encryption-Bt8SHRI6.cjs → encryption-DCsdx4Po.cjs} +2 -2
- package/dist/{encryption-Bt8SHRI6.cjs.map → encryption-DCsdx4Po.cjs.map} +1 -1
- package/dist/index.cjs +54 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +54 -40
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-dx4I0epp.cjs → migrate-DCxK1NRd.cjs} +2 -2
- package/dist/{migrate-dx4I0epp.cjs.map → migrate-DCxK1NRd.cjs.map} +1 -1
- package/dist/{migrate-soUQtku3.mjs → migrate-DmabhO_N.mjs} +2 -2
- package/dist/{migrate-soUQtku3.mjs.map → migrate-DmabhO_N.mjs.map} +1 -1
- package/dist/{ready-lr2Fm-ep.cjs → ready-ClUpTxoL.cjs} +14 -2
- package/dist/ready-ClUpTxoL.cjs.map +1 -0
- package/dist/{ready-WfT-eWlm.mjs → ready-tQLNHNya.mjs} +15 -3
- package/dist/ready-tQLNHNya.mjs.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/{workspace-GBzR_hID.cjs → workspace-BEGUDNwK.cjs} +3 -3
- package/dist/{workspace-GBzR_hID.cjs.map → workspace-BEGUDNwK.cjs.map} +1 -1
- package/dist/{workspace-Dp2zK_Nk.mjs → workspace-fa5H6l7D.mjs} +3 -3
- package/dist/{workspace-Dp2zK_Nk.mjs.map → workspace-fa5H6l7D.mjs.map} +1 -1
- package/package.json +14 -14
- package/dist/ready-WfT-eWlm.mjs.map +0 -1
- package/dist/ready-lr2Fm-ep.cjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import { d as parseModuleConfig, f as appKey, l as loadWorkspaceConfig, n as Not
|
|
|
5
5
|
import { D as assertDeployedStage, E as TEST_STAGE, O as deployedProblems, T as InvalidStages, a as getAppBuildOrder, b as getDeployTargetError, k as stageProblems, m as stripPublicPrefix, o as getAppGkmConfig, p as getPublicEnvPrefix, t as allConstructGlobs, x as isDeployTargetSupported } from "./workspace-bOsks1uk.mjs";
|
|
6
6
|
import { a as withCustomSecret, i as toEmbeddableSecrets, n as maskPassword, t as initStageSecrets } from "./storage-BzaUxmqe.mjs";
|
|
7
7
|
import { a as getKeyPath, i as FileSecretsStore, n as secretsStoreFor } from "./store-DeGATCS-.mjs";
|
|
8
|
-
import { C as loadEnvFiles, S as isPortAvailable, T as prepareEntryCredentials, _ as fakeKey, a as reconcileWorkspace, b as createEntryWrapper, c as LOCAL_CA_PATH, d as postgresDatabaseNames, f as quoteIdentifier, g as describeServices, h as rootSite, i as derivedContainers, l as forgetState, m as resourceName, n as backendsOf$1, p as pgClient, r as constructGlobs, s as COMPOSE_PATH, t as FAKE_ENV, u as applyPostgres, v as primaryPortKey, w as loadSecretsForApp, x as findAvailablePort, y as createCredentialsPreload } from "./workspace-
|
|
8
|
+
import { C as loadEnvFiles, S as isPortAvailable, T as prepareEntryCredentials, _ as fakeKey, a as reconcileWorkspace, b as createEntryWrapper, c as LOCAL_CA_PATH, d as postgresDatabaseNames, f as quoteIdentifier, g as describeServices, h as rootSite, i as derivedContainers, l as forgetState, m as resourceName, n as backendsOf$1, p as pgClient, r as constructGlobs, s as COMPOSE_PATH, t as FAKE_ENV, u as applyPostgres, v as primaryPortKey, w as loadSecretsForApp, x as findAvailablePort, y as createCredentialsPreload } from "./workspace-fa5H6l7D.mjs";
|
|
9
9
|
import { n as EndpointGenerator, r as runtimeFor } from "./OpenApiTsGenerator-BzIGy8KE.mjs";
|
|
10
10
|
import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
|
|
11
|
-
import { a as writeTestHarness, c as driversFor, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, o as SubscriberGenerator, s as cacheBackendsIn, t as TEST_READY_ENV } from "./ready-
|
|
12
|
-
import { i as storageBackendFor, n as eventsBackendFor, r as providerOf, t as cacheBackendFor } from "./backends-
|
|
11
|
+
import { a as writeTestHarness, c as driversFor, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, o as SubscriberGenerator, s as cacheBackendsIn, t as TEST_READY_ENV } from "./ready-tQLNHNya.mjs";
|
|
12
|
+
import { i as storageBackendFor, n as eventsBackendFor, r as providerOf, t as cacheBackendFor } from "./backends-CLq1wlQf.mjs";
|
|
13
13
|
import { n as withCompute, r as withRoutes, t as manifestModule } from "./emit-C1e8qD08.mjs";
|
|
14
14
|
import { createRequire } from "node:module";
|
|
15
15
|
import { Command } from "commander";
|
|
@@ -42,7 +42,7 @@ import { Queue } from "@geekmidas/constructs/queue";
|
|
|
42
42
|
import { Topic } from "@geekmidas/constructs/topic";
|
|
43
43
|
import { lookup } from "node:dns/promises";
|
|
44
44
|
//#region package.json
|
|
45
|
-
var version = "10.0.0-alpha.
|
|
45
|
+
var version = "10.0.0-alpha.52";
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/auth/credentials.ts
|
|
48
48
|
/**
|
|
@@ -1725,9 +1725,9 @@ async function workspaceDevCommand(configured, options) {
|
|
|
1725
1725
|
for (const { id, port } of fakes) logger$9.log(`🎭 ${id} fake: http://localhost:${port}`);
|
|
1726
1726
|
logger$9.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
|
|
1727
1727
|
if (options.migrate || options.seed) {
|
|
1728
|
-
const { prepareDevDatabases } = await import("./migrate-
|
|
1728
|
+
const { prepareDevDatabases } = await import("./migrate-DmabhO_N.mjs");
|
|
1729
1729
|
await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
|
|
1730
|
-
} else await import("./migrate-
|
|
1730
|
+
} else await import("./migrate-DmabhO_N.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
|
|
1731
1731
|
logger$9.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
|
|
1732
1732
|
});
|
|
1733
1733
|
const appUrls = {};
|
|
@@ -2310,7 +2310,7 @@ var CronGenerator = class extends ConstructGenerator {
|
|
|
2310
2310
|
*/
|
|
2311
2311
|
import type { EnvironmentParser } from '@geekmidas/envkit';
|
|
2312
2312
|
import type { Logger } from '@geekmidas/logger';
|
|
2313
|
-
import { toCronExpression } from '@geekmidas/constructs/crons';
|
|
2313
|
+
import { runCron, scheduleInProcess, toCronExpression } from '@geekmidas/constructs/crons';
|
|
2314
2314
|
import { ServiceDiscovery } from '@geekmidas/services';
|
|
2315
2315
|
${Array.from(importsByFile.entries()).map(([importPath, exports]) => `import { ${exports.join(", ")} } from '${importPath}';`).join("\n")}
|
|
2316
2316
|
|
|
@@ -2351,11 +2351,10 @@ export async function setupCrons(
|
|
|
2351
2351
|
|
|
2352
2352
|
const run = async (entry: (typeof prepared)[number]) => {
|
|
2353
2353
|
try {
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
});
|
|
2354
|
+
// The cron's own function, the way its Lambda would run it — services,
|
|
2355
|
+
// the worker's database as \`db\`, its events. It used to call a
|
|
2356
|
+
// \`handler\` a Cron does not have, so every firing logged a failure.
|
|
2357
|
+
await runCron(entry.cron, serviceDiscovery);
|
|
2359
2358
|
} catch (error) {
|
|
2360
2359
|
logger.error({ error, cron: entry.name }, 'Cron failed');
|
|
2361
2360
|
}
|
|
@@ -2366,13 +2365,28 @@ export async function setupCrons(
|
|
|
2366
2365
|
// memory fires each job once per replica — so the schedule lives in
|
|
2367
2366
|
// Postgres. It used to be a second pg-boss on the worker's database, as the
|
|
2368
2367
|
// runtime role, which can neither create a schema nor use the broker's.
|
|
2369
|
-
const { url } = envParser
|
|
2368
|
+
const { url, devPid } = envParser
|
|
2370
2369
|
.create((get) => ({
|
|
2371
2370
|
url: get('EVENT_PUBLISHER_CONNECTION_STRING').string().optional(),
|
|
2371
|
+
// Set by \`gkm dev\` on the server it starts, and by nothing deployed.
|
|
2372
|
+
devPid: get('GKM_DEV_PID').string().optional(),
|
|
2372
2373
|
}))
|
|
2373
2374
|
.parse();
|
|
2374
2375
|
|
|
2375
2376
|
if (!url?.startsWith('pgboss://')) {
|
|
2377
|
+
// \`gkm dev\` on a target whose crons are infrastructure once deployed —
|
|
2378
|
+
// EventBridge rules on AWS — has no broker to keep a schedule in. It is one
|
|
2379
|
+
// process, so a timer fires each job once, which is all pg-boss is for
|
|
2380
|
+
// here. Only there: a deployed server firing by timer fires once per
|
|
2381
|
+
// replica, so outside dev this stays the error below.
|
|
2382
|
+
if (devPid) {
|
|
2383
|
+
for (const entry of prepared) {
|
|
2384
|
+
running.push(scheduleInProcess(entry.schedule, () => run(entry)));
|
|
2385
|
+
logger.info({ cron: entry.name, schedule: entry.schedule }, 'Cron scheduled in this process');
|
|
2386
|
+
}
|
|
2387
|
+
return;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2376
2390
|
logger.error(
|
|
2377
2391
|
{ crons: prepared.map(({ name }) => name) },
|
|
2378
2392
|
'These crons have nowhere to keep their schedule. On a server they are ' +
|
|
@@ -9314,26 +9328,26 @@ function loadPackageJson() {
|
|
|
9314
9328
|
* Run: pnpm --filter @geekmidas/cli sync-versions
|
|
9315
9329
|
*/
|
|
9316
9330
|
const GEEKMIDAS_VERSIONS = {
|
|
9317
|
-
"@geekmidas/audit": "~10.0.0-alpha.
|
|
9318
|
-
"@geekmidas/auth": "~10.0.0-alpha.
|
|
9319
|
-
"@geekmidas/cache": "~10.0.0-alpha.
|
|
9320
|
-
"@geekmidas/client": "~10.0.0-alpha.
|
|
9321
|
-
"@geekmidas/cloud": "~10.0.0-alpha.
|
|
9322
|
-
"@geekmidas/constructs": "~10.0.0-alpha.
|
|
9323
|
-
"@geekmidas/db": "~10.0.0-alpha.
|
|
9324
|
-
"@geekmidas/emailkit": "~10.0.0-alpha.
|
|
9325
|
-
"@geekmidas/envkit": "~10.0.0-alpha.
|
|
9326
|
-
"@geekmidas/errors": "~10.0.0-alpha.
|
|
9327
|
-
"@geekmidas/events": "~10.0.0-alpha.
|
|
9328
|
-
"@geekmidas/logger": "~10.0.0-alpha.
|
|
9329
|
-
"@geekmidas/manifest": "~10.0.0-alpha.
|
|
9330
|
-
"@geekmidas/rate-limit": "~10.0.0-alpha.
|
|
9331
|
-
"@geekmidas/schema": "~10.0.0-alpha.
|
|
9332
|
-
"@geekmidas/services": "~10.0.0-alpha.
|
|
9333
|
-
"@geekmidas/storage": "~10.0.0-alpha.
|
|
9334
|
-
"@geekmidas/studio": "~10.0.0-alpha.
|
|
9335
|
-
"@geekmidas/telescope": "~10.0.0-alpha.
|
|
9336
|
-
"@geekmidas/testkit": "~10.0.0-alpha.
|
|
9331
|
+
"@geekmidas/audit": "~10.0.0-alpha.52",
|
|
9332
|
+
"@geekmidas/auth": "~10.0.0-alpha.52",
|
|
9333
|
+
"@geekmidas/cache": "~10.0.0-alpha.52",
|
|
9334
|
+
"@geekmidas/client": "~10.0.0-alpha.52",
|
|
9335
|
+
"@geekmidas/cloud": "~10.0.0-alpha.52",
|
|
9336
|
+
"@geekmidas/constructs": "~10.0.0-alpha.52",
|
|
9337
|
+
"@geekmidas/db": "~10.0.0-alpha.52",
|
|
9338
|
+
"@geekmidas/emailkit": "~10.0.0-alpha.52",
|
|
9339
|
+
"@geekmidas/envkit": "~10.0.0-alpha.52",
|
|
9340
|
+
"@geekmidas/errors": "~10.0.0-alpha.52",
|
|
9341
|
+
"@geekmidas/events": "~10.0.0-alpha.52",
|
|
9342
|
+
"@geekmidas/logger": "~10.0.0-alpha.52",
|
|
9343
|
+
"@geekmidas/manifest": "~10.0.0-alpha.52",
|
|
9344
|
+
"@geekmidas/rate-limit": "~10.0.0-alpha.52",
|
|
9345
|
+
"@geekmidas/schema": "~10.0.0-alpha.52",
|
|
9346
|
+
"@geekmidas/services": "~10.0.0-alpha.52",
|
|
9347
|
+
"@geekmidas/storage": "~10.0.0-alpha.52",
|
|
9348
|
+
"@geekmidas/studio": "~10.0.0-alpha.52",
|
|
9349
|
+
"@geekmidas/telescope": "~10.0.0-alpha.52",
|
|
9350
|
+
"@geekmidas/testkit": "~10.0.0-alpha.52",
|
|
9337
9351
|
"@geekmidas/cli": `~${loadPackageJson().version}`
|
|
9338
9352
|
};
|
|
9339
9353
|
//#endregion
|
|
@@ -16076,7 +16090,7 @@ function testDatabases(reconciled) {
|
|
|
16076
16090
|
* starts without the reference data the app needs.
|
|
16077
16091
|
*/
|
|
16078
16092
|
async function migrateTestStage(workspace, env) {
|
|
16079
|
-
const { migrateAndSeed } = await import("./migrate-
|
|
16093
|
+
const { migrateAndSeed } = await import("./migrate-DmabhO_N.mjs");
|
|
16080
16094
|
const { discover } = await import("./discover-Cf2jAcgF.mjs").then((n) => n.n);
|
|
16081
16095
|
const sources = {};
|
|
16082
16096
|
const manifest = await discover({
|
|
@@ -16507,7 +16521,7 @@ program.command("migrate").description("Apply each database construct's migratio
|
|
|
16507
16521
|
try {
|
|
16508
16522
|
const globalOptions = program.opts();
|
|
16509
16523
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16510
|
-
const { migrateCommand } = await import("./migrate-
|
|
16524
|
+
const { migrateCommand } = await import("./migrate-DmabhO_N.mjs");
|
|
16511
16525
|
await migrateCommand({
|
|
16512
16526
|
...options,
|
|
16513
16527
|
...construct ? { construct } : {}
|
|
@@ -16521,7 +16535,7 @@ program.command("seed").description("Migrate, then run each database construct's
|
|
|
16521
16535
|
try {
|
|
16522
16536
|
const globalOptions = program.opts();
|
|
16523
16537
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16524
|
-
const { seedCommand } = await import("./migrate-
|
|
16538
|
+
const { seedCommand } = await import("./migrate-DmabhO_N.mjs");
|
|
16525
16539
|
await seedCommand({
|
|
16526
16540
|
...options,
|
|
16527
16541
|
...construct ? { construct } : {}
|
|
@@ -16535,7 +16549,7 @@ program.command("migration").description("Write a construct's next migration: an
|
|
|
16535
16549
|
try {
|
|
16536
16550
|
const globalOptions = program.opts();
|
|
16537
16551
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16538
|
-
const { migrationCommand } = await import("./migrate-
|
|
16552
|
+
const { migrationCommand } = await import("./migrate-DmabhO_N.mjs");
|
|
16539
16553
|
await migrationCommand({
|
|
16540
16554
|
construct,
|
|
16541
16555
|
...name ? { name } : {}
|
|
@@ -16633,7 +16647,7 @@ program.command("encryption:rotate").description("Add a new current key to an En
|
|
|
16633
16647
|
try {
|
|
16634
16648
|
const globalOptions = program.opts();
|
|
16635
16649
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16636
|
-
const { encryptionRotateCommand } = await import("./encryption-
|
|
16650
|
+
const { encryptionRotateCommand } = await import("./encryption-Cv-Ej9vR.mjs");
|
|
16637
16651
|
await encryptionRotateCommand(construct, options);
|
|
16638
16652
|
} catch (error) {
|
|
16639
16653
|
console.error(formatError(error));
|
|
@@ -16644,7 +16658,7 @@ program.command("encryption:retire").description("Remove an old key from an Encr
|
|
|
16644
16658
|
try {
|
|
16645
16659
|
const globalOptions = program.opts();
|
|
16646
16660
|
if (globalOptions.cwd) process.chdir(globalOptions.cwd);
|
|
16647
|
-
const { encryptionRetireCommand } = await import("./encryption-
|
|
16661
|
+
const { encryptionRetireCommand } = await import("./encryption-Cv-Ej9vR.mjs");
|
|
16648
16662
|
await encryptionRetireCommand(construct, key, options);
|
|
16649
16663
|
} catch (error) {
|
|
16650
16664
|
console.error(formatError(error));
|
|
@@ -16696,7 +16710,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
|
|
|
16696
16710
|
console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
|
|
16697
16711
|
process.exit(1);
|
|
16698
16712
|
}
|
|
16699
|
-
const { derivedContainers } = await import("./workspace-
|
|
16713
|
+
const { derivedContainers } = await import("./workspace-fa5H6l7D.mjs").then((n) => n.o);
|
|
16700
16714
|
const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
|
|
16701
16715
|
if (!result) {
|
|
16702
16716
|
console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
|