@geekmidas/cli 10.0.0-alpha.130 → 10.0.0-alpha.131

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
@@ -51,7 +51,7 @@ import crypto from "crypto";
51
51
  import { Function } from "@geekmidas/constructs/functions";
52
52
  import { Topic } from "@geekmidas/constructs/topic";
53
53
  //#region package.json
54
- var version = "10.0.0-alpha.130";
54
+ var version = "10.0.0-alpha.131";
55
55
  //#endregion
56
56
  //#region src/prompt.ts
57
57
  /**
@@ -2747,9 +2747,9 @@ async function workspaceDevCommand(configured, options) {
2747
2747
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2748
2748
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2749
2749
  if (options.migrate || options.seed) {
2750
- const { prepareDevDatabases } = await import("./migrate-D71REG0N.mjs");
2751
- await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2752
- } else await import("./migrate-D71REG0N.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2750
+ const { prepareDevDatabases } = await import("./migrate-BKAh880g.mjs");
2751
+ await prepareDevDatabases(workspace, secretsEnv, { seed: !!options.seed });
2752
+ } else await import("./migrate-BKAh880g.mjs").then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2753
2753
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2754
2754
  });
2755
2755
  const appUrls = {};
@@ -2766,11 +2766,11 @@ async function workspaceDevCommand(configured, options) {
2766
2766
  const appNames = Object.keys(workspace.apps).join(", ");
2767
2767
  throw new Error(`App "${options.app}" not found. Available apps: ${appNames}`);
2768
2768
  }
2769
- turboFilter = ["--filter", appPackageName(workspace, options.app) ?? options.app];
2770
- } else if (options.filter) turboFilter = ["--filter", options.filter];
2769
+ turboFilter = [appPackageName(workspace, options.app) ?? options.app];
2770
+ } else if (options.filter) turboFilter = [options.filter];
2771
2771
  else {
2772
2772
  const { filters, unpackaged } = turboFilters(workspace);
2773
- turboFilter = filters.flatMap((name) => ["--filter", name]);
2773
+ turboFilter = filters;
2774
2774
  if (unpackaged.length > 0) logger$5.warn(`⚠️ No package.json with a name for: ${unpackaged.join(", ")} — turbo cannot run ${unpackaged.length === 1 ? "it" : "them"}.`);
2775
2775
  }
2776
2776
  const buildOrder = getAppBuildOrder(workspace);
@@ -2841,12 +2841,8 @@ async function workspaceDevCommand(configured, options) {
2841
2841
  [DISCOVERY_QUIET_ENV]: "1"
2842
2842
  };
2843
2843
  logger$5.log(`🚀 Starting ${appCount} app(s) — each builds before it answers, and says so when it is ready`);
2844
- const turboProcess = spawn("pnpm", [
2845
- "turbo",
2846
- "run",
2847
- "dev",
2848
- ...turboFilter
2849
- ], {
2844
+ const [turboBin, turboArgs] = getTurboArgs(detectPackageManager(workspace.root), turboFilter, { task: "dev" });
2845
+ const turboProcess = spawn(turboBin, turboArgs, {
2850
2846
  cwd: workspace.root,
2851
2847
  stdio: "inherit",
2852
2848
  env: turboEnv,
@@ -4261,16 +4257,17 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
4261
4257
  } };
4262
4258
  }
4263
4259
  /**
4264
- * Detect available package manager.
4260
+ * The package manager a workspace uses, by the lockfile at its root.
4265
4261
  * @internal Exported for testing
4266
4262
  */
4267
- function detectPackageManager() {
4268
- if (existsSync("pnpm-lock.yaml")) return "pnpm";
4269
- if (existsSync("yarn.lock")) return "yarn";
4263
+ function detectPackageManager(root = process.cwd()) {
4264
+ if (existsSync(join(root, "pnpm-lock.yaml"))) return "pnpm";
4265
+ if (existsSync(join(root, "yarn.lock"))) return "yarn";
4270
4266
  return "npm";
4271
4267
  }
4272
4268
  /**
4273
- * The program and argv that run turbo's build.
4269
+ * The program and argv that run a turbo task — `build` unless another is
4270
+ * named — through the workspace's own package manager.
4274
4271
  *
4275
4272
  * `filters` names the packages to build. Passing none lets turbo infer its own
4276
4273
  * scope from the working directory, which for a workspace root means the
@@ -4284,11 +4281,11 @@ function detectPackageManager() {
4284
4281
  *
4285
4282
  * @internal Exported for testing
4286
4283
  */
4287
- function getTurboArgs(pm, filters = [], { only = false } = {}) {
4284
+ function getTurboArgs(pm, filters = [], { only = false, task = "build" } = {}) {
4288
4285
  const turbo = [
4289
4286
  "turbo",
4290
4287
  "run",
4291
- "build",
4288
+ task,
4292
4289
  ...(typeof filters === "string" ? [filters] : filters).map((f) => `--filter=${f}`),
4293
4290
  ...only ? ["--only"] : []
4294
4291
  ];
@@ -6058,25 +6055,25 @@ function loadPackageJson() {
6058
6055
  * Run: pnpm --filter @geekmidas/cli sync-versions
6059
6056
  */
6060
6057
  const GEEKMIDAS_VERSIONS = {
6061
- "@geekmidas/audit": "~10.0.0-alpha.130",
6062
- "@geekmidas/auth": "~10.0.0-alpha.130",
6063
- "@geekmidas/cache": "~10.0.0-alpha.130",
6064
- "@geekmidas/client": "~10.0.0-alpha.130",
6065
- "@geekmidas/cloud": "~10.0.0-alpha.130",
6066
- "@geekmidas/constructs": "~10.0.0-alpha.130",
6067
- "@geekmidas/db": "~10.0.0-alpha.130",
6068
- "@geekmidas/emailkit": "~10.0.0-alpha.130",
6069
- "@geekmidas/envkit": "~10.0.0-alpha.130",
6070
- "@geekmidas/errors": "~10.0.0-alpha.130",
6071
- "@geekmidas/events": "~10.0.0-alpha.130",
6072
- "@geekmidas/logger": "~10.0.0-alpha.130",
6073
- "@geekmidas/manifest": "~10.0.0-alpha.130",
6074
- "@geekmidas/rate-limit": "~10.0.0-alpha.130",
6075
- "@geekmidas/schema": "~10.0.0-alpha.130",
6076
- "@geekmidas/services": "~10.0.0-alpha.130",
6077
- "@geekmidas/storage": "~10.0.0-alpha.130",
6078
- "@geekmidas/telescope": "~10.0.0-alpha.130",
6079
- "@geekmidas/testkit": "~10.0.0-alpha.130",
6058
+ "@geekmidas/audit": "~10.0.0-alpha.131",
6059
+ "@geekmidas/auth": "~10.0.0-alpha.131",
6060
+ "@geekmidas/cache": "~10.0.0-alpha.131",
6061
+ "@geekmidas/client": "~10.0.0-alpha.131",
6062
+ "@geekmidas/cloud": "~10.0.0-alpha.131",
6063
+ "@geekmidas/constructs": "~10.0.0-alpha.131",
6064
+ "@geekmidas/db": "~10.0.0-alpha.131",
6065
+ "@geekmidas/emailkit": "~10.0.0-alpha.131",
6066
+ "@geekmidas/envkit": "~10.0.0-alpha.131",
6067
+ "@geekmidas/errors": "~10.0.0-alpha.131",
6068
+ "@geekmidas/events": "~10.0.0-alpha.131",
6069
+ "@geekmidas/logger": "~10.0.0-alpha.131",
6070
+ "@geekmidas/manifest": "~10.0.0-alpha.131",
6071
+ "@geekmidas/rate-limit": "~10.0.0-alpha.131",
6072
+ "@geekmidas/schema": "~10.0.0-alpha.131",
6073
+ "@geekmidas/services": "~10.0.0-alpha.131",
6074
+ "@geekmidas/storage": "~10.0.0-alpha.131",
6075
+ "@geekmidas/telescope": "~10.0.0-alpha.131",
6076
+ "@geekmidas/testkit": "~10.0.0-alpha.131",
6080
6077
  "@geekmidas/cli": `~${loadPackageJson().version}`
6081
6078
  };
6082
6079
  //#endregion
@@ -7269,7 +7266,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
7269
7266
  * The `uses:` value for the stages action, with a comment saying which CLI
7270
7267
  * release the pinned commit is.
7271
7268
  */
7272
- function stagesActionUses(commit = "864318f7e3daa92234c7f5312df8ab7161103e53", version = cliVersion()) {
7269
+ function stagesActionUses(commit = "bad5a94de0ed1d62394ff0b38432fdf5d69b6a25", version = cliVersion()) {
7273
7270
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
7274
7271
  }
7275
7272
  //#endregion
@@ -16241,7 +16238,7 @@ function testDatabases(reconciled) {
16241
16238
  * starts without the reference data the app needs.
16242
16239
  */
16243
16240
  async function migrateTestStage(workspace, env) {
16244
- const { migrateAndSeed } = await import("./migrate-D71REG0N.mjs");
16241
+ const { migrateAndSeed } = await import("./migrate-BKAh880g.mjs");
16245
16242
  const { discover } = await import("./discover-DOhYSKY_.mjs").then((n) => n.a);
16246
16243
  const sources = {};
16247
16244
  const manifest = await discover({
@@ -16714,7 +16711,7 @@ program.command("migrate").description("Apply each database construct's migratio
16714
16711
  try {
16715
16712
  const globalOptions = program.opts();
16716
16713
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16717
- const { migrateCommand } = await import("./migrate-D71REG0N.mjs");
16714
+ const { migrateCommand } = await import("./migrate-BKAh880g.mjs");
16718
16715
  await migrateCommand({
16719
16716
  ...options,
16720
16717
  ...construct ? { construct } : {}
@@ -16727,7 +16724,7 @@ program.command("seed").description("Migrate, then run each database construct's
16727
16724
  try {
16728
16725
  const globalOptions = program.opts();
16729
16726
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16730
- const { seedCommand } = await import("./migrate-D71REG0N.mjs");
16727
+ const { seedCommand } = await import("./migrate-BKAh880g.mjs");
16731
16728
  await seedCommand({
16732
16729
  ...options,
16733
16730
  ...construct ? { construct } : {}
@@ -16740,7 +16737,7 @@ program.command("migration").description("Write a construct's next migration: an
16740
16737
  try {
16741
16738
  const globalOptions = program.opts();
16742
16739
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16743
- const { migrationCommand } = await import("./migrate-D71REG0N.mjs");
16740
+ const { migrationCommand } = await import("./migrate-BKAh880g.mjs");
16744
16741
  await migrationCommand({
16745
16742
  construct,
16746
16743
  ...name ? { name } : {}