@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.cjs CHANGED
@@ -57,7 +57,7 @@ crypto = require_rolldown_runtime.__toESM(crypto, 1);
57
57
  let _geekmidas_constructs_functions = require("@geekmidas/constructs/functions");
58
58
  let _geekmidas_constructs_topic = require("@geekmidas/constructs/topic");
59
59
  //#region package.json
60
- var version = "10.0.0-alpha.130";
60
+ var version = "10.0.0-alpha.131";
61
61
  //#endregion
62
62
  //#region src/prompt.ts
63
63
  /**
@@ -2753,9 +2753,9 @@ async function workspaceDevCommand(configured, options) {
2753
2753
  for (const { id, port } of fakes) logger$5.log(`🎭 ${id} fake: http://localhost:${port}`);
2754
2754
  logger$5.log(options.migrate || options.seed ? "🗄️ Migrating the databases" : "🗄️ Checking for pending migrations");
2755
2755
  if (options.migrate || options.seed) {
2756
- const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs"));
2757
- await prepareDevDatabases(workspace, reconciled.env, { seed: !!options.seed });
2758
- } else await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2756
+ const { prepareDevDatabases } = await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs"));
2757
+ await prepareDevDatabases(workspace, secretsEnv, { seed: !!options.seed });
2758
+ } else await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs")).then(({ reportPendingMigrations }) => reportPendingMigrations(workspace, reconciled.env)).catch((error) => {
2759
2759
  logger$5.log(`⚠️ Could not check for pending migrations: ${error instanceof Error ? error.message : String(error)}`);
2760
2760
  });
2761
2761
  const appUrls = {};
@@ -2772,11 +2772,11 @@ async function workspaceDevCommand(configured, options) {
2772
2772
  const appNames = Object.keys(workspace.apps).join(", ");
2773
2773
  throw new Error(`App "${options.app}" not found. Available apps: ${appNames}`);
2774
2774
  }
2775
- turboFilter = ["--filter", appPackageName(workspace, options.app) ?? options.app];
2776
- } else if (options.filter) turboFilter = ["--filter", options.filter];
2775
+ turboFilter = [appPackageName(workspace, options.app) ?? options.app];
2776
+ } else if (options.filter) turboFilter = [options.filter];
2777
2777
  else {
2778
2778
  const { filters, unpackaged } = turboFilters(workspace);
2779
- turboFilter = filters.flatMap((name) => ["--filter", name]);
2779
+ turboFilter = filters;
2780
2780
  if (unpackaged.length > 0) logger$5.warn(`⚠️ No package.json with a name for: ${unpackaged.join(", ")} — turbo cannot run ${unpackaged.length === 1 ? "it" : "them"}.`);
2781
2781
  }
2782
2782
  const buildOrder = require_workspace.getAppBuildOrder(workspace);
@@ -2847,12 +2847,8 @@ async function workspaceDevCommand(configured, options) {
2847
2847
  [DISCOVERY_QUIET_ENV]: "1"
2848
2848
  };
2849
2849
  logger$5.log(`🚀 Starting ${appCount} app(s) — each builds before it answers, and says so when it is ready`);
2850
- const turboProcess = (0, node_child_process.spawn)("pnpm", [
2851
- "turbo",
2852
- "run",
2853
- "dev",
2854
- ...turboFilter
2855
- ], {
2850
+ const [turboBin, turboArgs] = getTurboArgs(detectPackageManager(workspace.root), turboFilter, { task: "dev" });
2851
+ const turboProcess = (0, node_child_process.spawn)(turboBin, turboArgs, {
2856
2852
  cwd: workspace.root,
2857
2853
  stdio: "inherit",
2858
2854
  env: turboEnv,
@@ -4267,16 +4263,17 @@ async function buildForTarget(target, context, appRoot, workspaceRoot, endpointG
4267
4263
  } };
4268
4264
  }
4269
4265
  /**
4270
- * Detect available package manager.
4266
+ * The package manager a workspace uses, by the lockfile at its root.
4271
4267
  * @internal Exported for testing
4272
4268
  */
4273
- function detectPackageManager() {
4274
- if ((0, node_fs.existsSync)("pnpm-lock.yaml")) return "pnpm";
4275
- if ((0, node_fs.existsSync)("yarn.lock")) return "yarn";
4269
+ function detectPackageManager(root = process.cwd()) {
4270
+ if ((0, node_fs.existsSync)((0, node_path.join)(root, "pnpm-lock.yaml"))) return "pnpm";
4271
+ if ((0, node_fs.existsSync)((0, node_path.join)(root, "yarn.lock"))) return "yarn";
4276
4272
  return "npm";
4277
4273
  }
4278
4274
  /**
4279
- * The program and argv that run turbo's build.
4275
+ * The program and argv that run a turbo task — `build` unless another is
4276
+ * named — through the workspace's own package manager.
4280
4277
  *
4281
4278
  * `filters` names the packages to build. Passing none lets turbo infer its own
4282
4279
  * scope from the working directory, which for a workspace root means the
@@ -4290,11 +4287,11 @@ function detectPackageManager() {
4290
4287
  *
4291
4288
  * @internal Exported for testing
4292
4289
  */
4293
- function getTurboArgs(pm, filters = [], { only = false } = {}) {
4290
+ function getTurboArgs(pm, filters = [], { only = false, task = "build" } = {}) {
4294
4291
  const turbo = [
4295
4292
  "turbo",
4296
4293
  "run",
4297
- "build",
4294
+ task,
4298
4295
  ...(typeof filters === "string" ? [filters] : filters).map((f) => `--filter=${f}`),
4299
4296
  ...only ? ["--only"] : []
4300
4297
  ];
@@ -6064,25 +6061,25 @@ function loadPackageJson() {
6064
6061
  * Run: pnpm --filter @geekmidas/cli sync-versions
6065
6062
  */
6066
6063
  const GEEKMIDAS_VERSIONS = {
6067
- "@geekmidas/audit": "~10.0.0-alpha.130",
6068
- "@geekmidas/auth": "~10.0.0-alpha.130",
6069
- "@geekmidas/cache": "~10.0.0-alpha.130",
6070
- "@geekmidas/client": "~10.0.0-alpha.130",
6071
- "@geekmidas/cloud": "~10.0.0-alpha.130",
6072
- "@geekmidas/constructs": "~10.0.0-alpha.130",
6073
- "@geekmidas/db": "~10.0.0-alpha.130",
6074
- "@geekmidas/emailkit": "~10.0.0-alpha.130",
6075
- "@geekmidas/envkit": "~10.0.0-alpha.130",
6076
- "@geekmidas/errors": "~10.0.0-alpha.130",
6077
- "@geekmidas/events": "~10.0.0-alpha.130",
6078
- "@geekmidas/logger": "~10.0.0-alpha.130",
6079
- "@geekmidas/manifest": "~10.0.0-alpha.130",
6080
- "@geekmidas/rate-limit": "~10.0.0-alpha.130",
6081
- "@geekmidas/schema": "~10.0.0-alpha.130",
6082
- "@geekmidas/services": "~10.0.0-alpha.130",
6083
- "@geekmidas/storage": "~10.0.0-alpha.130",
6084
- "@geekmidas/telescope": "~10.0.0-alpha.130",
6085
- "@geekmidas/testkit": "~10.0.0-alpha.130",
6064
+ "@geekmidas/audit": "~10.0.0-alpha.131",
6065
+ "@geekmidas/auth": "~10.0.0-alpha.131",
6066
+ "@geekmidas/cache": "~10.0.0-alpha.131",
6067
+ "@geekmidas/client": "~10.0.0-alpha.131",
6068
+ "@geekmidas/cloud": "~10.0.0-alpha.131",
6069
+ "@geekmidas/constructs": "~10.0.0-alpha.131",
6070
+ "@geekmidas/db": "~10.0.0-alpha.131",
6071
+ "@geekmidas/emailkit": "~10.0.0-alpha.131",
6072
+ "@geekmidas/envkit": "~10.0.0-alpha.131",
6073
+ "@geekmidas/errors": "~10.0.0-alpha.131",
6074
+ "@geekmidas/events": "~10.0.0-alpha.131",
6075
+ "@geekmidas/logger": "~10.0.0-alpha.131",
6076
+ "@geekmidas/manifest": "~10.0.0-alpha.131",
6077
+ "@geekmidas/rate-limit": "~10.0.0-alpha.131",
6078
+ "@geekmidas/schema": "~10.0.0-alpha.131",
6079
+ "@geekmidas/services": "~10.0.0-alpha.131",
6080
+ "@geekmidas/storage": "~10.0.0-alpha.131",
6081
+ "@geekmidas/telescope": "~10.0.0-alpha.131",
6082
+ "@geekmidas/testkit": "~10.0.0-alpha.131",
6086
6083
  "@geekmidas/cli": `~${loadPackageJson().version}`
6087
6084
  };
6088
6085
  //#endregion
@@ -7275,7 +7272,7 @@ const COMMIT = /^[0-9a-f]{40}$/;
7275
7272
  * The `uses:` value for the stages action, with a comment saying which CLI
7276
7273
  * release the pinned commit is.
7277
7274
  */
7278
- function stagesActionUses(commit = "864318f7e3daa92234c7f5312df8ab7161103e53", version = cliVersion()) {
7275
+ function stagesActionUses(commit = "bad5a94de0ed1d62394ff0b38432fdf5d69b6a25", version = cliVersion()) {
7279
7276
  return commit && COMMIT.test(commit) ? `${STAGES_ACTION}@${commit} # @geekmidas/cli ${version}` : `${STAGES_ACTION}@main # pin to a commit SHA: see the action's README`;
7280
7277
  }
7281
7278
  //#endregion
@@ -16247,7 +16244,7 @@ function testDatabases(reconciled) {
16247
16244
  * starts without the reference data the app needs.
16248
16245
  */
16249
16246
  async function migrateTestStage(workspace, env) {
16250
- const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs"));
16247
+ const { migrateAndSeed } = await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs"));
16251
16248
  const { discover } = await Promise.resolve().then(() => require("./discover-DEOspD9M.cjs")).then((n) => n.discover_exports);
16252
16249
  const sources = {};
16253
16250
  const manifest = await discover({
@@ -16720,7 +16717,7 @@ program.command("migrate").description("Apply each database construct's migratio
16720
16717
  try {
16721
16718
  const globalOptions = program.opts();
16722
16719
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16723
- const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs"));
16720
+ const { migrateCommand } = await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs"));
16724
16721
  await migrateCommand({
16725
16722
  ...options,
16726
16723
  ...construct ? { construct } : {}
@@ -16733,7 +16730,7 @@ program.command("seed").description("Migrate, then run each database construct's
16733
16730
  try {
16734
16731
  const globalOptions = program.opts();
16735
16732
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16736
- const { seedCommand } = await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs"));
16733
+ const { seedCommand } = await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs"));
16737
16734
  await seedCommand({
16738
16735
  ...options,
16739
16736
  ...construct ? { construct } : {}
@@ -16746,7 +16743,7 @@ program.command("migration").description("Write a construct's next migration: an
16746
16743
  try {
16747
16744
  const globalOptions = program.opts();
16748
16745
  if (globalOptions.cwd) process.chdir(globalOptions.cwd);
16749
- const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-Co3UnkrE.cjs"));
16746
+ const { migrationCommand } = await Promise.resolve().then(() => require("./migrate-BB9fibbQ.cjs"));
16750
16747
  await migrationCommand({
16751
16748
  construct,
16752
16749
  ...name ? { name } : {}