@geekmidas/cli 10.0.0-alpha.35 → 10.0.0-alpha.36

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/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { c as isPartitionedRoutes, i as ConstructGenerator, t as discover } from
4
4
  import { a as loadConfig, c as parseModuleConfig, i as loadAppConfig, l as appKey, r as getAppNameFromCwd, s as loadWorkspaceConfig, u as derivedApps } from "./config-Dss1WwtH.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-CsL76tpc.mjs";
6
6
  import { c as getKeyPath, i as setCustomSecret, n as readStageSecrets, o as toEmbeddableSecrets, r as secretsExist, s as writeStageSecrets, t as maskPassword } from "./storage-BjTLjDDp.mjs";
7
- import { _ as findAvailablePort, b as loadSecretsForApp, c as applyPostgres, d as cacheBackendFor, f as eventsBackendFor, g as createEntryWrapper, h as createCredentialsPreload, i as reconcileWorkspace, l as resourceName, m as storageBackendFor, n as constructGlobs, o as COMPOSE_PATH, p as providerOf, r as derivedContainers, s as LOCAL_CA_PATH, t as backendsOf, u as rootSite, v as isPortAvailable, x as prepareEntryCredentials, y as loadEnvFiles } from "./workspace-CIiGijNi.mjs";
7
+ import { _ as findAvailablePort, b as loadSecretsForApp, c as applyPostgres, d as cacheBackendFor, f as eventsBackendFor, g as createEntryWrapper, h as createCredentialsPreload, i as reconcileWorkspace, l as resourceName, m as storageBackendFor, n as constructGlobs, o as COMPOSE_PATH, p as providerOf, r as derivedContainers, s as LOCAL_CA_PATH, t as backendsOf, u as rootSite, v as isPortAvailable, x as prepareEntryCredentials, y as loadEnvFiles } from "./workspace-EmXwO2qM.mjs";
8
8
  import { n as EndpointGenerator, r as runtimeFor } from "./OpenApiTsGenerator-hDINScnz.mjs";
9
9
  import { generateOpenApi, openapiCommand, resolveOpenApiConfig } from "./openapi.mjs";
10
10
  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-D1BCiaYU.mjs";
@@ -37,7 +37,7 @@ import { Subscriber } from "@geekmidas/constructs/subscribers";
37
37
  import { Topic } from "@geekmidas/constructs/topic";
38
38
  import { lookup } from "node:dns/promises";
39
39
  //#region package.json
40
- var version = "10.0.0-alpha.35";
40
+ var version = "10.0.0-alpha.36";
41
41
  //#endregion
42
42
  //#region src/auth/credentials.ts
43
43
  /**
@@ -1087,9 +1087,9 @@ async function workspaceDevCommand(workspace, options) {
1087
1087
  ...reconciled.env
1088
1088
  };
1089
1089
  if (options.migrate || options.seed) {
1090
- const { prepareDevDatabases } = await import("./migrate-C-D9xIbb.mjs");
1090
+ const { prepareDevDatabases } = await import("./migrate-CT8b3nt_.mjs");
1091
1091
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
1092
- } else await import("./migrate-C-D9xIbb.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1092
+ } else await import("./migrate-CT8b3nt_.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1093
1093
  logger$10.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
1094
1094
  });
1095
1095
  const appUrls = {};
@@ -8798,26 +8798,26 @@ function loadPackageJson() {
8798
8798
  * Run: pnpm --filter @geekmidas/cli sync-versions
8799
8799
  */
8800
8800
  const GEEKMIDAS_VERSIONS = {
8801
- "@geekmidas/audit": "~10.0.0-alpha.35",
8802
- "@geekmidas/auth": "~10.0.0-alpha.35",
8803
- "@geekmidas/cache": "~10.0.0-alpha.35",
8804
- "@geekmidas/client": "~10.0.0-alpha.35",
8805
- "@geekmidas/cloud": "~10.0.0-alpha.35",
8806
- "@geekmidas/constructs": "~10.0.0-alpha.35",
8807
- "@geekmidas/db": "~10.0.0-alpha.35",
8808
- "@geekmidas/emailkit": "~10.0.0-alpha.35",
8809
- "@geekmidas/envkit": "~10.0.0-alpha.35",
8810
- "@geekmidas/errors": "~10.0.0-alpha.35",
8811
- "@geekmidas/events": "~10.0.0-alpha.35",
8812
- "@geekmidas/logger": "~10.0.0-alpha.35",
8813
- "@geekmidas/manifest": "~10.0.0-alpha.35",
8814
- "@geekmidas/rate-limit": "~10.0.0-alpha.35",
8815
- "@geekmidas/schema": "~10.0.0-alpha.35",
8816
- "@geekmidas/services": "~10.0.0-alpha.35",
8817
- "@geekmidas/storage": "~10.0.0-alpha.35",
8818
- "@geekmidas/studio": "~10.0.0-alpha.35",
8819
- "@geekmidas/telescope": "~10.0.0-alpha.35",
8820
- "@geekmidas/testkit": "~10.0.0-alpha.35",
8801
+ "@geekmidas/audit": "~10.0.0-alpha.36",
8802
+ "@geekmidas/auth": "~10.0.0-alpha.36",
8803
+ "@geekmidas/cache": "~10.0.0-alpha.36",
8804
+ "@geekmidas/client": "~10.0.0-alpha.36",
8805
+ "@geekmidas/cloud": "~10.0.0-alpha.36",
8806
+ "@geekmidas/constructs": "~10.0.0-alpha.36",
8807
+ "@geekmidas/db": "~10.0.0-alpha.36",
8808
+ "@geekmidas/emailkit": "~10.0.0-alpha.36",
8809
+ "@geekmidas/envkit": "~10.0.0-alpha.36",
8810
+ "@geekmidas/errors": "~10.0.0-alpha.36",
8811
+ "@geekmidas/events": "~10.0.0-alpha.36",
8812
+ "@geekmidas/logger": "~10.0.0-alpha.36",
8813
+ "@geekmidas/manifest": "~10.0.0-alpha.36",
8814
+ "@geekmidas/rate-limit": "~10.0.0-alpha.36",
8815
+ "@geekmidas/schema": "~10.0.0-alpha.36",
8816
+ "@geekmidas/services": "~10.0.0-alpha.36",
8817
+ "@geekmidas/storage": "~10.0.0-alpha.36",
8818
+ "@geekmidas/studio": "~10.0.0-alpha.36",
8819
+ "@geekmidas/telescope": "~10.0.0-alpha.36",
8820
+ "@geekmidas/testkit": "~10.0.0-alpha.36",
8821
8821
  "@geekmidas/cli": `~${loadPackageJson().version}`
8822
8822
  };
8823
8823
  //#endregion
@@ -9596,9 +9596,7 @@ import { EnvironmentParser } from '@geekmidas/envkit';
9596
9596
  * \`MobileApp\` construct's \`.dependsOn([api, auth])\` is where every value
9597
9597
  * here comes from, so none of it is written down.
9598
9598
  *
9599
- * - \`APP_SCHEME\`: the URL scheme for this stage — \`${scheme}\` deployed,
9600
- * \`${scheme}-dev\` locally, so a development build and the store build on
9601
- * one phone never answer each other's links.
9599
+ * - \`APP_SCHEME\`: the URL scheme — \`${scheme}\`, the same on every stage.
9602
9600
  * - \`EXPO_PUBLIC_API_URL\` / \`EXPO_PUBLIC_AUTH_URL\`: where the servers
9603
9601
  * answer. Locally that is their own port on \`localhost\`, which
9604
9602
  * \`config.ts\` points at the machine Metro was served from.
@@ -10909,7 +10907,7 @@ export const authDb = database.schema<Record<string, never>, 'AuthDb'>('AuthDb')
10909
10907
  files.push(usersMigration());
10910
10908
  files.push({
10911
10909
  path: "constructs/auth.ts",
10912
- content: `import { BetterAuth } from '@geekmidas/constructs/auth';
10910
+ content: `${frontendFramework === "expo" ? "import { expo } from '@better-auth/expo';\n" : ""}import { BetterAuth } from '@geekmidas/constructs/auth';
10913
10911
  import { authDb } from './database.ts';
10914
10912
 
10915
10913
  /**
@@ -10924,7 +10922,11 @@ import { authDb } from './database.ts';
10924
10922
  export const auth = new BetterAuth('Auth', {
10925
10923
  path: 'apps/auth',
10926
10924
  database: authDb,
10927
- basePath: '/api/auth',
10925
+ basePath: '/api/auth',${frontendFramework === "expo" ? `
10926
+ // The mobile app signs in through Better Auth's Expo plugin: it sends its
10927
+ // scheme as the origin, and this is what reads it. The construct refuses to
10928
+ // start without it once a MobileApp depends on this server.
10929
+ options: { plugins: [expo()] },` : ""}
10928
10930
  });
10929
10931
  `
10930
10932
  });
@@ -10963,7 +10965,7 @@ import { auth } from './auth.ts';
10963
10965
  * The mobile app — a construct like a site, which is what makes it an app.
10964
10966
  *
10965
10967
  * \`.dependsOn()\` is the single fact behind what a mobile app otherwise has
10966
- * written down by hand: its API and auth URLs, its URL scheme per stage, the
10968
+ * written down by hand: its API and auth URLs, its URL scheme, the
10967
10969
  * scheme in the auth server's trusted origins, Better Auth's Expo plugin, and
10968
10970
  * sign-in links a phone can open.
10969
10971
  */
@@ -15147,7 +15149,7 @@ var NoStoredSecrets = class extends Error {
15147
15149
  }
15148
15150
  };
15149
15151
  async function reconcile(secrets, workspace, stage) {
15150
- const { derivedContainers } = await import("./workspace-CIiGijNi.mjs").then((n) => n.a);
15152
+ const { derivedContainers } = await import("./workspace-EmXwO2qM.mjs").then((n) => n.a);
15151
15153
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
15152
15154
  return result ? {
15153
15155
  secrets: result.secrets,
@@ -15546,7 +15548,7 @@ async function testCommand(options = {}) {
15546
15548
  * starts without the reference data the app needs.
15547
15549
  */
15548
15550
  async function migrateTestStage(workspace, env) {
15549
- const { migrateAndSeed } = await import("./migrate-C-D9xIbb.mjs");
15551
+ const { migrateAndSeed } = await import("./migrate-CT8b3nt_.mjs");
15550
15552
  const { discover } = await import("./discover-CMxesskG.mjs").then((n) => n.n);
15551
15553
  const sources = {};
15552
15554
  const manifest = await discover({
@@ -15991,7 +15993,7 @@ program.command("migrate").description("Apply each database construct's migratio
15991
15993
  try {
15992
15994
  const globalOptions = program.opts();
15993
15995
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
15994
- const { migrateCommand } = await import("./migrate-C-D9xIbb.mjs");
15996
+ const { migrateCommand } = await import("./migrate-CT8b3nt_.mjs");
15995
15997
  await migrateCommand({
15996
15998
  ...options,
15997
15999
  ...construct ? { construct } : {}
@@ -16005,7 +16007,7 @@ program.command("seed").description("Migrate, then run each database construct's
16005
16007
  try {
16006
16008
  const globalOptions = program.opts();
16007
16009
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16008
- const { seedCommand } = await import("./migrate-C-D9xIbb.mjs");
16010
+ const { seedCommand } = await import("./migrate-CT8b3nt_.mjs");
16009
16011
  await seedCommand({
16010
16012
  ...options,
16011
16013
  ...construct ? { construct } : {}
@@ -16019,7 +16021,7 @@ program.command("migration").description("Write a construct's next migration: an
16019
16021
  try {
16020
16022
  const globalOptions = program.opts();
16021
16023
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16022
- const { migrationCommand } = await import("./migrate-C-D9xIbb.mjs");
16024
+ const { migrationCommand } = await import("./migrate-CT8b3nt_.mjs");
16023
16025
  await migrationCommand({
16024
16026
  construct,
16025
16027
  ...name ? { name } : {}
@@ -16187,7 +16189,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
16187
16189
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
16188
16190
  process.exit(1);
16189
16191
  }
16190
- const { derivedContainers } = await import("./workspace-CIiGijNi.mjs").then((n) => n.a);
16192
+ const { derivedContainers } = await import("./workspace-EmXwO2qM.mjs").then((n) => n.a);
16191
16193
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
16192
16194
  if (!result) {
16193
16195
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);