@geekmidas/cli 10.0.0-alpha.38 → 10.0.0-alpha.39

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.
Files changed (48) hide show
  1. package/README.md +27 -26
  2. package/dist/{OpenApiTsGenerator-D1nhN98m.cjs → OpenApiTsGenerator-CeEI4ll9.cjs} +3 -3
  3. package/dist/OpenApiTsGenerator-CeEI4ll9.cjs.map +1 -0
  4. package/dist/{OpenApiTsGenerator-hDINScnz.mjs → OpenApiTsGenerator-DQqOuSW8.mjs} +3 -3
  5. package/dist/OpenApiTsGenerator-DQqOuSW8.mjs.map +1 -0
  6. package/dist/{config-D1S2r0JN.mjs → config-5watB1D0.mjs} +12 -11
  7. package/dist/{config-D1S2r0JN.mjs.map → config-5watB1D0.mjs.map} +1 -1
  8. package/dist/{config-j4krJZVq.cjs → config-CJ-PAb7M.cjs} +12 -11
  9. package/dist/{config-j4krJZVq.cjs.map → config-CJ-PAb7M.cjs.map} +1 -1
  10. package/dist/config.cjs +1 -1
  11. package/dist/config.d.cts +3 -3
  12. package/dist/config.d.cts.map +1 -1
  13. package/dist/config.d.mts +3 -3
  14. package/dist/config.d.mts.map +1 -1
  15. package/dist/config.mjs +1 -1
  16. package/dist/{discover-CroTIm0K.cjs → discover-B0f_kuNN.cjs} +2 -1
  17. package/dist/{discover-CroTIm0K.cjs.map → discover-B0f_kuNN.cjs.map} +1 -1
  18. package/dist/{discover-CMxesskG.mjs → discover-BLhf7V_J.mjs} +2 -1
  19. package/dist/{discover-CMxesskG.mjs.map → discover-BLhf7V_J.mjs.map} +1 -1
  20. package/dist/{github-BvK076ph.cjs → github-BAr8WGkR.cjs} +2 -2
  21. package/dist/{github-BvK076ph.cjs.map → github-BAr8WGkR.cjs.map} +1 -1
  22. package/dist/{github-BPfmXtqk.mjs → github-D5MthUlR.mjs} +2 -2
  23. package/dist/{github-BPfmXtqk.mjs.map → github-D5MthUlR.mjs.map} +1 -1
  24. package/dist/index.cjs +51 -49
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.mjs +51 -49
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/{migrate-C2aYSZTn.mjs → migrate-BJR912RE.mjs} +4 -4
  29. package/dist/{migrate-C2aYSZTn.mjs.map → migrate-BJR912RE.mjs.map} +1 -1
  30. package/dist/{migrate-DKn83skp.cjs → migrate-Bu8POqsR.cjs} +4 -4
  31. package/dist/{migrate-DKn83skp.cjs.map → migrate-Bu8POqsR.cjs.map} +1 -1
  32. package/dist/openapi.cjs +2 -2
  33. package/dist/openapi.mjs +2 -2
  34. package/dist/{ready-DxC0Z3No.cjs → ready-B0WVtkjR.cjs} +3 -3
  35. package/dist/{ready-DxC0Z3No.cjs.map → ready-B0WVtkjR.cjs.map} +1 -1
  36. package/dist/{ready-BTm_sMNU.mjs → ready-BXmLS4VB.mjs} +3 -3
  37. package/dist/{ready-BTm_sMNU.mjs.map → ready-BXmLS4VB.mjs.map} +1 -1
  38. package/dist/reconcile/public.cjs +1 -1
  39. package/dist/reconcile/public.mjs +1 -1
  40. package/dist/vitest.cjs +1 -1
  41. package/dist/vitest.mjs +1 -1
  42. package/dist/{workspace-Lm6dv2nz.mjs → workspace-CrFbItPz.mjs} +4 -4
  43. package/dist/{workspace-Lm6dv2nz.mjs.map → workspace-CrFbItPz.mjs.map} +1 -1
  44. package/dist/{workspace-gfIrSEUp.cjs → workspace-DZ1G4zow.cjs} +4 -4
  45. package/dist/{workspace-gfIrSEUp.cjs.map → workspace-DZ1G4zow.cjs.map} +1 -1
  46. package/package.json +14 -14
  47. package/dist/OpenApiTsGenerator-D1nhN98m.cjs.map +0 -1
  48. package/dist/OpenApiTsGenerator-hDINScnz.mjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  import { n as __require, t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
3
- import { c as isPartitionedRoutes, i as ConstructGenerator, t as discover } from "./discover-CMxesskG.mjs";
4
- import { d as parseModuleConfig, f as appKey, l as loadWorkspaceConfig, n as NotABackendApp, o as loadAppConfig, p as derivedApps, r as NotInAnApp, s as loadConfig, t as ConfigNotFound, u as loadWorkspaceSettings } from "./config-D1S2r0JN.mjs";
3
+ import { c as isPartitionedRoutes, i as ConstructGenerator, t as discover } from "./discover-BLhf7V_J.mjs";
4
+ import { d as parseModuleConfig, f as appKey, l as loadWorkspaceConfig, n as NotABackendApp, o as loadAppConfig, p as derivedApps, r as NotInAnApp, s as loadConfig, t as ConfigNotFound, u as loadWorkspaceSettings } from "./config-5watB1D0.mjs";
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-DOmIhiau.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 findAvailablePort, D as prepareEntryCredentials, E as loadSecretsForApp, S as createEntryWrapper, T as loadEnvFiles, _ as cacheBackendFor, a as reconcileWorkspace, b as storageBackendFor, c as LOCAL_CA_PATH, d as quoteIdentifier, f as pgClient, g as primaryPortKey, h as fakeKey, i as derivedContainers, l as forgetState, m as rootSite, n as backendsOf, p as resourceName, r as constructGlobs, s as COMPOSE_PATH, t as FAKE_ENV, u as applyPostgres, v as eventsBackendFor, w as isPortAvailable, x as createCredentialsPreload, y as providerOf } from "./workspace-Lm6dv2nz.mjs";
9
- import { n as EndpointGenerator, r as runtimeFor } from "./OpenApiTsGenerator-hDINScnz.mjs";
8
+ import { C as findAvailablePort, D as prepareEntryCredentials, E as loadSecretsForApp, S as createEntryWrapper, T as loadEnvFiles, _ as cacheBackendFor, a as reconcileWorkspace, b as storageBackendFor, c as LOCAL_CA_PATH, d as quoteIdentifier, f as pgClient, g as primaryPortKey, h as fakeKey, i as derivedContainers, l as forgetState, m as rootSite, n as backendsOf, p as resourceName, r as constructGlobs, s as COMPOSE_PATH, t as FAKE_ENV, u as applyPostgres, v as eventsBackendFor, w as isPortAvailable, x as createCredentialsPreload, y as providerOf } from "./workspace-CrFbItPz.mjs";
9
+ import { n as EndpointGenerator, r as runtimeFor } from "./OpenApiTsGenerator-DQqOuSW8.mjs";
10
10
  import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
11
- import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, o as cacheBackendsIn, s as driversFor, t as TEST_READY_ENV } from "./ready-BTm_sMNU.mjs";
11
+ import { a as writeTestHarness, i as TEST_MANIFEST_ENV, n as TEST_READY_FILE, o as cacheBackendsIn, s as driversFor, t as TEST_READY_ENV } from "./ready-BXmLS4VB.mjs";
12
12
  import { i as withRoutes, r as withCompute } from "./emit-Bzq7JsMP.mjs";
13
13
  import { createRequire } from "node:module";
14
14
  import { Command } from "commander";
@@ -41,7 +41,7 @@ import { Subscriber } from "@geekmidas/constructs/subscribers";
41
41
  import { Topic } from "@geekmidas/constructs/topic";
42
42
  import { lookup } from "node:dns/promises";
43
43
  //#region package.json
44
- var version = "10.0.0-alpha.38";
44
+ var version = "10.0.0-alpha.39";
45
45
  //#endregion
46
46
  //#region src/auth/credentials.ts
47
47
  /**
@@ -1563,9 +1563,9 @@ async function workspaceDevCommand(workspace, options) {
1563
1563
  const fakes = options.fake ? await serveFakes(reconciled.fakes, reconciled.ports) : [];
1564
1564
  for (const { id, port } of fakes) logger$10.log(`🎭 ${id} fake: http://localhost:${port}`);
1565
1565
  if (options.migrate || options.seed) {
1566
- const { prepareDevDatabases } = await import("./migrate-C2aYSZTn.mjs");
1566
+ const { prepareDevDatabases } = await import("./migrate-BJR912RE.mjs");
1567
1567
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
1568
- } else await import("./migrate-C2aYSZTn.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1568
+ } else await import("./migrate-BJR912RE.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1569
1569
  logger$10.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
1570
1570
  });
1571
1571
  const appUrls = {};
@@ -2722,10 +2722,10 @@ export async function setupSubscribers(
2722
2722
  //#endregion
2723
2723
  //#region src/generators/TopicGenerator.ts
2724
2724
  /**
2725
- * Discovers `t` topics into `manifest.topics`. A topic is a *resource*, not a
2726
- * function — it has no handler to generate. Producers reach it via its derived
2727
- * publisher (`topic.publisher`, whose connection string is sniffed onto the
2728
- * producing construct) and subscribers bind via `s.topic(topic)`; this generator
2725
+ * Discovers topics (`new Topic(…)`) into `manifest.topics`. A topic is a
2726
+ * *resource*, not a function — it has no handler to generate. Producers name it
2727
+ * with `.event(topic, …)` or `.dependsOn([topic])`, and subscribers bind with
2728
+ * `worker.topic(topic)`; this generator
2729
2729
  * only records the topic + its event contract so infra can provision the SNS
2730
2730
  * topic. Identical output for every provider (locally pg-boss routes by event
2731
2731
  * name, so there's nothing to run).
@@ -9543,26 +9543,26 @@ function loadPackageJson() {
9543
9543
  * Run: pnpm --filter @geekmidas/cli sync-versions
9544
9544
  */
9545
9545
  const GEEKMIDAS_VERSIONS = {
9546
- "@geekmidas/audit": "~10.0.0-alpha.38",
9547
- "@geekmidas/auth": "~10.0.0-alpha.38",
9548
- "@geekmidas/cache": "~10.0.0-alpha.38",
9549
- "@geekmidas/client": "~10.0.0-alpha.38",
9550
- "@geekmidas/cloud": "~10.0.0-alpha.38",
9551
- "@geekmidas/constructs": "~10.0.0-alpha.38",
9552
- "@geekmidas/db": "~10.0.0-alpha.38",
9553
- "@geekmidas/emailkit": "~10.0.0-alpha.38",
9554
- "@geekmidas/envkit": "~10.0.0-alpha.38",
9555
- "@geekmidas/errors": "~10.0.0-alpha.38",
9556
- "@geekmidas/events": "~10.0.0-alpha.38",
9557
- "@geekmidas/logger": "~10.0.0-alpha.38",
9558
- "@geekmidas/manifest": "~10.0.0-alpha.38",
9559
- "@geekmidas/rate-limit": "~10.0.0-alpha.38",
9560
- "@geekmidas/schema": "~10.0.0-alpha.38",
9561
- "@geekmidas/services": "~10.0.0-alpha.38",
9562
- "@geekmidas/storage": "~10.0.0-alpha.38",
9563
- "@geekmidas/studio": "~10.0.0-alpha.38",
9564
- "@geekmidas/telescope": "~10.0.0-alpha.38",
9565
- "@geekmidas/testkit": "~10.0.0-alpha.38",
9546
+ "@geekmidas/audit": "~10.0.0-alpha.39",
9547
+ "@geekmidas/auth": "~10.0.0-alpha.39",
9548
+ "@geekmidas/cache": "~10.0.0-alpha.39",
9549
+ "@geekmidas/client": "~10.0.0-alpha.39",
9550
+ "@geekmidas/cloud": "~10.0.0-alpha.39",
9551
+ "@geekmidas/constructs": "~10.0.0-alpha.39",
9552
+ "@geekmidas/db": "~10.0.0-alpha.39",
9553
+ "@geekmidas/emailkit": "~10.0.0-alpha.39",
9554
+ "@geekmidas/envkit": "~10.0.0-alpha.39",
9555
+ "@geekmidas/errors": "~10.0.0-alpha.39",
9556
+ "@geekmidas/events": "~10.0.0-alpha.39",
9557
+ "@geekmidas/logger": "~10.0.0-alpha.39",
9558
+ "@geekmidas/manifest": "~10.0.0-alpha.39",
9559
+ "@geekmidas/rate-limit": "~10.0.0-alpha.39",
9560
+ "@geekmidas/schema": "~10.0.0-alpha.39",
9561
+ "@geekmidas/services": "~10.0.0-alpha.39",
9562
+ "@geekmidas/storage": "~10.0.0-alpha.39",
9563
+ "@geekmidas/studio": "~10.0.0-alpha.39",
9564
+ "@geekmidas/telescope": "~10.0.0-alpha.39",
9565
+ "@geekmidas/testkit": "~10.0.0-alpha.39",
9566
9566
  "@geekmidas/cli": `~${loadPackageJson().version}`
9567
9567
  };
9568
9568
  //#endregion
@@ -12545,22 +12545,24 @@ export const config = envParser
12545
12545
  },
12546
12546
  {
12547
12547
  path: "src/constructs/topics.ts",
12548
- content: `import { t } from '@geekmidas/constructs/topic';
12548
+ content: `import { Topic } from '@geekmidas/constructs/topic';
12549
12549
  import { z } from 'zod';
12550
12550
 
12551
12551
  /**
12552
12552
  * The \`users\` topic: pub/sub fan-out, any number of subscribers.
12553
12553
  *
12554
- * The event map is the contract. It types \`users.publisher\` and every
12555
- * subscriber that binds with \`.topic(users)\`, so an event cannot be published
12556
- * in one shape and read in another.
12554
+ * The event map is the contract. It types every \`.event(users, …)\` that
12555
+ * publishes to it and every subscriber that binds with \`worker.topic(users)\`,
12556
+ * so an event cannot be published in one shape and read in another.
12557
12557
  */
12558
- export const users = t.topic('users').events({
12559
- 'user.created': z.object({ userId: z.string(), email: z.email() }),
12560
- 'user.updated': z.object({
12561
- userId: z.string(),
12562
- changes: z.record(z.string(), z.unknown()),
12563
- }),
12558
+ export const users = new Topic('users', {
12559
+ events: {
12560
+ 'user.created': z.object({ userId: z.string(), email: z.email() }),
12561
+ 'user.updated': z.object({
12562
+ userId: z.string(),
12563
+ changes: z.record(z.string(), z.unknown()),
12564
+ }),
12565
+ },
12564
12566
  });
12565
12567
  `
12566
12568
  },
@@ -16309,8 +16311,8 @@ function testDatabases(reconciled) {
16309
16311
  * starts without the reference data the app needs.
16310
16312
  */
16311
16313
  async function migrateTestStage(workspace, env) {
16312
- const { migrateAndSeed } = await import("./migrate-C2aYSZTn.mjs");
16313
- const { discover } = await import("./discover-CMxesskG.mjs").then((n) => n.n);
16314
+ const { migrateAndSeed } = await import("./migrate-BJR912RE.mjs");
16315
+ const { discover } = await import("./discover-BLhf7V_J.mjs").then((n) => n.n);
16314
16316
  const sources = {};
16315
16317
  const manifest = await discover({
16316
16318
  patterns: constructGlobs(workspace),
@@ -16755,7 +16757,7 @@ program.command("migrate").description("Apply each database construct's migratio
16755
16757
  try {
16756
16758
  const globalOptions = program.opts();
16757
16759
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16758
- const { migrateCommand } = await import("./migrate-C2aYSZTn.mjs");
16760
+ const { migrateCommand } = await import("./migrate-BJR912RE.mjs");
16759
16761
  await migrateCommand({
16760
16762
  ...options,
16761
16763
  ...construct ? { construct } : {}
@@ -16769,7 +16771,7 @@ program.command("seed").description("Migrate, then run each database construct's
16769
16771
  try {
16770
16772
  const globalOptions = program.opts();
16771
16773
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16772
- const { seedCommand } = await import("./migrate-C2aYSZTn.mjs");
16774
+ const { seedCommand } = await import("./migrate-BJR912RE.mjs");
16773
16775
  await seedCommand({
16774
16776
  ...options,
16775
16777
  ...construct ? { construct } : {}
@@ -16783,7 +16785,7 @@ program.command("migration").description("Write a construct's next migration: an
16783
16785
  try {
16784
16786
  const globalOptions = program.opts();
16785
16787
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16786
- const { migrationCommand } = await import("./migrate-C2aYSZTn.mjs");
16788
+ const { migrationCommand } = await import("./migrate-BJR912RE.mjs");
16787
16789
  await migrationCommand({
16788
16790
  construct,
16789
16791
  ...name ? { name } : {}
@@ -16922,7 +16924,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
16922
16924
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
16923
16925
  process.exit(1);
16924
16926
  }
16925
- const { derivedContainers } = await import("./workspace-Lm6dv2nz.mjs").then((n) => n.o);
16927
+ const { derivedContainers } = await import("./workspace-CrFbItPz.mjs").then((n) => n.o);
16926
16928
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
16927
16929
  if (!result) {
16928
16930
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);
@@ -16981,7 +16983,7 @@ program.command("deploy:github").description("Let GitHub Actions deploy a stage:
16981
16983
  try {
16982
16984
  const globalOptions = program.opts();
16983
16985
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16984
- const { deployGithubCommand } = await import("./github-BPfmXtqk.mjs");
16986
+ const { deployGithubCommand } = await import("./github-D5MthUlR.mjs");
16985
16987
  await deployGithubCommand(options);
16986
16988
  } catch (error) {
16987
16989
  console.error(formatError(error));