@geekmidas/cli 10.0.0-alpha.33 → 10.0.0-alpha.34

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.cjs CHANGED
@@ -5,7 +5,7 @@ const require_discover = require("./discover-CroTIm0K.cjs");
5
5
  const require_config = require("./config-DMpzmsQL.cjs");
6
6
  const require_workspace = require("./workspace-CAJk6UmC.cjs");
7
7
  const require_storage = require("./storage-C2JC31V9.cjs");
8
- const require_workspace$1 = require("./workspace-C8TbIWxO.cjs");
8
+ const require_workspace$1 = require("./workspace-LKFnEBX8.cjs");
9
9
  const require_OpenApiTsGenerator = require("./OpenApiTsGenerator-D1nhN98m.cjs");
10
10
  const require_openapi = require("./openapi.cjs");
11
11
  const require_ready = require("./ready-CXhoutix.cjs");
@@ -42,7 +42,7 @@ let _geekmidas_constructs_subscribers = require("@geekmidas/constructs/subscribe
42
42
  let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
43
43
  let node_dns_promises = require("node:dns/promises");
44
44
  //#region package.json
45
- var version = "10.0.0-alpha.33";
45
+ var version = "10.0.0-alpha.34";
46
46
  //#endregion
47
47
  //#region src/auth/credentials.ts
48
48
  /**
@@ -1092,9 +1092,9 @@ async function workspaceDevCommand(workspace, options) {
1092
1092
  ...reconciled.env
1093
1093
  };
1094
1094
  if (options.migrate || options.seed) {
1095
- const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs"));
1095
+ const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
1096
1096
  await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
1097
- } else await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1097
+ } else await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
1098
1098
  logger$10.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
1099
1099
  });
1100
1100
  const appUrls = {};
@@ -3107,6 +3107,7 @@ const PROVISIONERS = {
3107
3107
  context.deferred.push(...statementsFor({
3108
3108
  id: declaration.id,
3109
3109
  database: postgres.databaseName,
3110
+ ownsDatabase: true,
3110
3111
  runtime,
3111
3112
  owner,
3112
3113
  ...reads ? { reader: (0, _geekmidas_db_pg_roles.readerRole)(runtime) } : {},
@@ -3342,6 +3343,7 @@ function statementsFor(options) {
3342
3343
  owner,
3343
3344
  ...reader ? { reader } : {},
3344
3345
  schema,
3346
+ ...options.ownsDatabase ? { database } : {},
3345
3347
  passwords: {
3346
3348
  runtime: derivedPassword(context, runtime),
3347
3349
  owner: derivedPassword(context, owner),
@@ -8794,26 +8796,26 @@ function loadPackageJson() {
8794
8796
  * Run: pnpm --filter @geekmidas/cli sync-versions
8795
8797
  */
8796
8798
  const GEEKMIDAS_VERSIONS = {
8797
- "@geekmidas/audit": "~10.0.0-alpha.33",
8798
- "@geekmidas/auth": "~10.0.0-alpha.33",
8799
- "@geekmidas/cache": "~10.0.0-alpha.33",
8800
- "@geekmidas/client": "~10.0.0-alpha.33",
8801
- "@geekmidas/cloud": "~10.0.0-alpha.33",
8802
- "@geekmidas/constructs": "~10.0.0-alpha.33",
8803
- "@geekmidas/db": "~10.0.0-alpha.33",
8804
- "@geekmidas/emailkit": "~10.0.0-alpha.33",
8805
- "@geekmidas/envkit": "~10.0.0-alpha.33",
8806
- "@geekmidas/errors": "~10.0.0-alpha.33",
8807
- "@geekmidas/events": "~10.0.0-alpha.33",
8808
- "@geekmidas/logger": "~10.0.0-alpha.33",
8809
- "@geekmidas/manifest": "~10.0.0-alpha.33",
8810
- "@geekmidas/rate-limit": "~10.0.0-alpha.33",
8811
- "@geekmidas/schema": "~10.0.0-alpha.33",
8812
- "@geekmidas/services": "~10.0.0-alpha.33",
8813
- "@geekmidas/storage": "~10.0.0-alpha.33",
8814
- "@geekmidas/studio": "~10.0.0-alpha.33",
8815
- "@geekmidas/telescope": "~10.0.0-alpha.33",
8816
- "@geekmidas/testkit": "~10.0.0-alpha.33",
8799
+ "@geekmidas/audit": "~10.0.0-alpha.34",
8800
+ "@geekmidas/auth": "~10.0.0-alpha.34",
8801
+ "@geekmidas/cache": "~10.0.0-alpha.34",
8802
+ "@geekmidas/client": "~10.0.0-alpha.34",
8803
+ "@geekmidas/cloud": "~10.0.0-alpha.34",
8804
+ "@geekmidas/constructs": "~10.0.0-alpha.34",
8805
+ "@geekmidas/db": "~10.0.0-alpha.34",
8806
+ "@geekmidas/emailkit": "~10.0.0-alpha.34",
8807
+ "@geekmidas/envkit": "~10.0.0-alpha.34",
8808
+ "@geekmidas/errors": "~10.0.0-alpha.34",
8809
+ "@geekmidas/events": "~10.0.0-alpha.34",
8810
+ "@geekmidas/logger": "~10.0.0-alpha.34",
8811
+ "@geekmidas/manifest": "~10.0.0-alpha.34",
8812
+ "@geekmidas/rate-limit": "~10.0.0-alpha.34",
8813
+ "@geekmidas/schema": "~10.0.0-alpha.34",
8814
+ "@geekmidas/services": "~10.0.0-alpha.34",
8815
+ "@geekmidas/storage": "~10.0.0-alpha.34",
8816
+ "@geekmidas/studio": "~10.0.0-alpha.34",
8817
+ "@geekmidas/telescope": "~10.0.0-alpha.34",
8818
+ "@geekmidas/testkit": "~10.0.0-alpha.34",
8817
8819
  "@geekmidas/cli": `~${loadPackageJson().version}`
8818
8820
  };
8819
8821
  //#endregion
@@ -10389,6 +10391,18 @@ function rootConstructDependencies(options) {
10389
10391
  };
10390
10392
  }
10391
10393
  /**
10394
+ * What `test/factories/` imports at the root: the factory and faker, and
10395
+ * Kysely's types where the root does not already install it for the
10396
+ * constructs.
10397
+ */
10398
+ function rootFactoryDependencies(options) {
10399
+ return {
10400
+ "@geekmidas/testkit": GEEKMIDAS_VERSIONS["@geekmidas/testkit"],
10401
+ "@faker-js/faker": DEPENDENCY_VERSIONS["@faker-js/faker"],
10402
+ ...options.template === "fullstack" ? {} : { kysely: DEPENDENCY_VERSIONS.kysely }
10403
+ };
10404
+ }
10405
+ /**
10392
10406
  * Generate monorepo root files (pnpm-workspace.yaml, root package.json, etc.)
10393
10407
  */
10394
10408
  function generateMonorepoFiles(options, _template) {
@@ -10427,6 +10441,7 @@ function generateMonorepoFiles(options, _template) {
10427
10441
  turbo: DEPENDENCY_VERSIONS["turbo"],
10428
10442
  typescript: TOOLCHAIN_VERSIONS["typescript"],
10429
10443
  vitest: TOOLCHAIN_VERSIONS["vitest"],
10444
+ ...options.constructs.database ? rootFactoryDependencies(options) : {},
10430
10445
  ...deploy.devDependencies
10431
10446
  }
10432
10447
  };
@@ -12055,7 +12070,7 @@ describe('example', () => {
12055
12070
  function generateTestFactoryFiles(options) {
12056
12071
  if (!options.constructs.database) return [];
12057
12072
  const db = databaseFor();
12058
- const schema = options.monorepo ? `@${options.name}/constructs/database.ts` : "../../src/constructs/database.ts";
12073
+ const schema = options.monorepo && options.template === "fullstack" ? `@${options.name}/constructs/database.ts` : options.monorepo ? `../../${options.apiPath}/src/constructs/database.ts` : "../../src/constructs/database.ts";
12059
12074
  return [{
12060
12075
  path: `test/factories/${(0, _geekmidas_manifest.kebabCase)(db.id)}.ts`,
12061
12076
  content: `import type { Kysely } from 'kysely';
@@ -15023,7 +15038,7 @@ var NoStoredSecrets = class extends Error {
15023
15038
  }
15024
15039
  };
15025
15040
  async function reconcile(secrets, workspace, stage) {
15026
- const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-C8TbIWxO.cjs")).then((n) => n.workspace_exports);
15041
+ const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-LKFnEBX8.cjs")).then((n) => n.workspace_exports);
15027
15042
  const result = require_reconcile.reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
15028
15043
  return result ? {
15029
15044
  secrets: result.secrets,
@@ -15422,7 +15437,7 @@ async function testCommand(options = {}) {
15422
15437
  * starts without the reference data the app needs.
15423
15438
  */
15424
15439
  async function migrateTestStage(workspace, env) {
15425
- const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs"));
15440
+ const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
15426
15441
  const { discover } = await Promise.resolve().then(() => require("./discover-CroTIm0K.cjs")).then((n) => n.discover_exports);
15427
15442
  const sources = {};
15428
15443
  const manifest = await discover({
@@ -15867,7 +15882,7 @@ program.command("migrate").description("Apply each database construct's migratio
15867
15882
  try {
15868
15883
  const globalOptions = program.opts();
15869
15884
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
15870
- const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs"));
15885
+ const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
15871
15886
  await migrateCommand({
15872
15887
  ...options,
15873
15888
  ...construct ? { construct } : {}
@@ -15881,7 +15896,7 @@ program.command("seed").description("Migrate, then run each database construct's
15881
15896
  try {
15882
15897
  const globalOptions = program.opts();
15883
15898
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
15884
- const { seedCommand } = await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs"));
15899
+ const { seedCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
15885
15900
  await seedCommand({
15886
15901
  ...options,
15887
15902
  ...construct ? { construct } : {}
@@ -15895,7 +15910,7 @@ program.command("migration").description("Write a construct's next migration: an
15895
15910
  try {
15896
15911
  const globalOptions = program.opts();
15897
15912
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
15898
- const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-BkytlJlU.cjs"));
15913
+ const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-u1oRHz6K.cjs"));
15899
15914
  await migrationCommand({
15900
15915
  construct,
15901
15916
  ...name ? { name } : {}
@@ -16063,7 +16078,7 @@ program.command("secrets:reconcile").description("Backfill missing custom secret
16063
16078
  console.error(`No secrets found for stage "${stage}". Run "gkm secrets:init --stage ${stage}" first.`);
16064
16079
  process.exit(1);
16065
16080
  }
16066
- const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-C8TbIWxO.cjs")).then((n) => n.workspace_exports);
16081
+ const { derivedContainers } = await Promise.resolve().then(() => require("./workspace-LKFnEBX8.cjs")).then((n) => n.workspace_exports);
16067
16082
  const result = reconcileMissingSecrets(secrets, workspace, await derivedContainers(workspace, stage));
16068
16083
  if (!result) {
16069
16084
  console.log(`\n✓ Secrets for stage "${stage}" are up-to-date`);