@donotdev/cli 0.0.15 → 0.0.17

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 (83) hide show
  1. package/dependencies-matrix.json +67 -147
  2. package/dist/bin/commands/build.js +69 -52
  3. package/dist/bin/commands/bump.js +15 -14
  4. package/dist/bin/commands/create-app.js +258 -55
  5. package/dist/bin/commands/create-project.js +290 -161
  6. package/dist/bin/commands/deploy.js +146 -63
  7. package/dist/bin/commands/dev.js +43 -24
  8. package/dist/bin/commands/doctor.d.ts +6 -0
  9. package/dist/bin/commands/doctor.d.ts.map +1 -0
  10. package/dist/bin/commands/{lint.js → doctor.js} +1370 -146
  11. package/dist/bin/commands/doctor.js.map +1 -0
  12. package/dist/bin/commands/emu.js +295 -107
  13. package/dist/bin/commands/make-admin.js +77519 -11
  14. package/dist/bin/commands/preview.js +44 -25
  15. package/dist/bin/commands/setup.d.ts +6 -0
  16. package/dist/bin/commands/setup.d.ts.map +1 -0
  17. package/dist/bin/commands/setup.js +12123 -0
  18. package/dist/bin/commands/setup.js.map +1 -0
  19. package/dist/bin/commands/type-check.d.ts.map +1 -1
  20. package/dist/bin/commands/type-check.js +2022 -283
  21. package/dist/bin/commands/type-check.js.map +1 -1
  22. package/dist/bin/dndev.js +54 -58
  23. package/dist/bin/donotdev.js +54 -58
  24. package/dist/index.js +860 -459
  25. package/package.json +2 -2
  26. package/templates/app-expo/.env.example +2 -22
  27. package/templates/app-expo/README.md.example +1 -1
  28. package/templates/app-expo/assets/adaptive-icon.png +0 -0
  29. package/templates/app-expo/assets/favicon.png +0 -0
  30. package/templates/app-expo/assets/icon.png +0 -0
  31. package/templates/app-expo/assets/splash.png +0 -0
  32. package/templates/app-expo/src/config/app.ts.example +46 -0
  33. package/templates/app-expo/src/config/providers.ts.example +7 -0
  34. package/templates/app-next/src/config/providers.ts.example +7 -0
  35. package/templates/app-vite/src/config/providers.ts.example +7 -0
  36. package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
  37. package/templates/functions-firebase/README.md.example +1 -1
  38. package/templates/functions-firebase/functions-firebase/.env.example.example +1 -1
  39. package/templates/functions-firebase/functions-firebase/README.md.example +1 -1
  40. package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
  41. package/templates/functions-firebase/functions.config.js.example +1 -1
  42. package/templates/functions-supabase/supabase/config.toml.example +59 -0
  43. package/templates/functions-supabase/supabase/functions/.env.example +13 -0
  44. package/templates/functions-supabase/supabase/functions/deno.json.example +8 -0
  45. package/templates/overlay-firebase/env.fragment.example +1 -1
  46. package/templates/overlay-firebase/env.fragment.expo.example +1 -1
  47. package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
  48. package/templates/overlay-supabase/env.fragment.example +8 -3
  49. package/templates/overlay-supabase/env.fragment.expo.example +8 -3
  50. package/templates/overlay-supabase/env.fragment.nextjs.example +8 -3
  51. package/templates/overlay-vercel/env.fragment.example +1 -1
  52. package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
  53. package/templates/root-consumer/AI.md.example +15 -0
  54. package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +2 -2
  55. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +12 -12
  56. package/templates/root-consumer/guides/dndev/INDEX.md.example +3 -3
  57. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
  58. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
  59. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -988
  60. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +72 -20
  61. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
  62. package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +60 -0
  63. package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +62 -0
  64. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -33
  65. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
  66. package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
  67. package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +7 -8
  68. package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +9 -5
  69. package/dist/bin/commands/firebase-setup.d.ts +0 -6
  70. package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
  71. package/dist/bin/commands/firebase-setup.js +0 -7
  72. package/dist/bin/commands/firebase-setup.js.map +0 -1
  73. package/dist/bin/commands/lint.d.ts +0 -11
  74. package/dist/bin/commands/lint.d.ts.map +0 -1
  75. package/dist/bin/commands/lint.js.map +0 -1
  76. package/dist/bin/commands/staging.d.ts +0 -11
  77. package/dist/bin/commands/staging.d.ts.map +0 -1
  78. package/dist/bin/commands/staging.js +0 -12
  79. package/dist/bin/commands/staging.js.map +0 -1
  80. package/dist/bin/commands/supabase-setup.d.ts +0 -6
  81. package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
  82. package/dist/bin/commands/supabase-setup.js +0 -7
  83. package/dist/bin/commands/supabase-setup.js.map +0 -1
@@ -7951,7 +7951,14 @@ function readServiceAccountKey(filePath) {
7951
7951
  throw new DoNotDevError(
7952
7952
  `Invalid service account key: missing required fields`,
7953
7953
  DO_NOT_DEV_ERROR_CODES.CONFIG_INVALID,
7954
- { context: { filePath, missingFields: ["project_id", "private_key", "client_email"].filter((f) => !key[f]) } }
7954
+ {
7955
+ context: {
7956
+ filePath,
7957
+ missingFields: ["project_id", "private_key", "client_email"].filter(
7958
+ (f) => !key[f]
7959
+ )
7960
+ }
7961
+ }
7955
7962
  );
7956
7963
  }
7957
7964
  return content;
@@ -8194,21 +8201,23 @@ function getCLIInstallInstructions(tool) {
8194
8201
  },
8195
8202
  [CLI_TOOLS.SUPABASE]: {
8196
8203
  win32: [
8197
- "npm install -g supabase",
8204
+ "scoop install supabase",
8205
+ "Or: winget install Supabase.CLI",
8198
8206
  "Or download from: https://github.com/supabase/cli/releases"
8199
8207
  ],
8200
- darwin: [
8201
- "brew install supabase/tap/supabase",
8202
- "Or: npm install -g supabase"
8203
- ],
8208
+ darwin: ["brew install supabase/tap/supabase"],
8204
8209
  linux: [
8205
- "npm install -g supabase",
8210
+ "brew install supabase/tap/supabase",
8206
8211
  "Or see: https://supabase.com/docs/guides/cli"
8207
8212
  ]
8208
8213
  },
8209
8214
  [CLI_TOOLS.VERCEL]: {
8210
8215
  win32: ["npm install -g vercel", "Or: npx vercel (no install)"],
8211
- darwin: ["npm install -g vercel", "Or: brew install vercel", "Or: npx vercel"],
8216
+ darwin: [
8217
+ "npm install -g vercel",
8218
+ "Or: brew install vercel",
8219
+ "Or: npx vercel"
8220
+ ],
8212
8221
  linux: ["npm install -g vercel", "Or: npx vercel"]
8213
8222
  },
8214
8223
  [CLI_TOOLS.SENTRY_CLI]: {
@@ -8329,6 +8338,40 @@ var init_cli_tools = __esm({
8329
8338
  }
8330
8339
  });
8331
8340
 
8341
+ // packages/tooling/src/cli/setup/vercel-token.ts
8342
+ function readEnvVar(filePath, varName) {
8343
+ if (!pathExists(filePath)) return null;
8344
+ const content = readSync(filePath, { format: "text" });
8345
+ if (typeof content !== "string") return null;
8346
+ for (const line of content.split(/\r?\n/)) {
8347
+ const trimmed = line.trim();
8348
+ if (!trimmed || trimmed.startsWith("#")) continue;
8349
+ if (trimmed.startsWith(`${varName}=`)) {
8350
+ const val = trimmed.substring(`${varName}=`.length).trim();
8351
+ if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) {
8352
+ return val.slice(1, -1);
8353
+ }
8354
+ return val || null;
8355
+ }
8356
+ }
8357
+ return null;
8358
+ }
8359
+ function resolveVercelToken(appDir) {
8360
+ if (process.env.VERCEL_TOKEN) return process.env.VERCEL_TOKEN;
8361
+ const fromEnv = readEnvVar(joinPath(appDir, ".env"), "VERCEL_TOKEN");
8362
+ if (fromEnv) return fromEnv;
8363
+ const fromLocal = readEnvVar(joinPath(appDir, ".env.local"), "VERCEL_TOKEN");
8364
+ if (fromLocal) return fromLocal;
8365
+ return null;
8366
+ }
8367
+ var init_vercel_token = __esm({
8368
+ "packages/tooling/src/cli/setup/vercel-token.ts"() {
8369
+ "use strict";
8370
+ init_utils();
8371
+ init_pathResolver();
8372
+ }
8373
+ });
8374
+
8332
8375
  // node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js
8333
8376
  var require_identity = __commonJS({
8334
8377
  "node_modules/.bun/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.js"(exports) {
@@ -15690,13 +15733,36 @@ var require_dist = __commonJS({
15690
15733
  }
15691
15734
  });
15692
15735
 
15736
+ // packages/tooling/src/utils/error-handling.ts
15737
+ function isError(error2) {
15738
+ return error2 instanceof Error;
15739
+ }
15740
+ function getErrorMessage(error2) {
15741
+ if (isError(error2)) {
15742
+ return error2.message;
15743
+ }
15744
+ if (typeof error2 === "string") {
15745
+ return error2;
15746
+ }
15747
+ if (error2 && typeof error2 === "object" && "message" in error2) {
15748
+ return String(error2.message);
15749
+ }
15750
+ return String(error2);
15751
+ }
15752
+ var init_error_handling = __esm({
15753
+ "packages/tooling/src/utils/error-handling.ts"() {
15754
+ "use strict";
15755
+ init_utils();
15756
+ }
15757
+ });
15758
+
15693
15759
  // packages/tooling/src/apps/sync-secrets.ts
15694
15760
  var sync_secrets_exports = {};
15695
15761
  __export(sync_secrets_exports, {
15696
15762
  default: () => sync_secrets_default,
15697
15763
  main: () => main
15698
15764
  });
15699
- import { spawnSync as spawnSync5 } from "node:child_process";
15765
+ import { spawnSync as spawnSync6 } from "node:child_process";
15700
15766
  function parseEnvFile(filePath) {
15701
15767
  if (!pathExists(filePath)) {
15702
15768
  throw new DoNotDevError(
@@ -15889,7 +15955,7 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
15889
15955
  NODE_OPTIONS: ""
15890
15956
  // Clear to avoid conflicts
15891
15957
  };
15892
- const result = spawnSync5(firebaseCmd, args, {
15958
+ const result = spawnSync6(firebaseCmd, args, {
15893
15959
  input: value,
15894
15960
  encoding: "utf8",
15895
15961
  stdio: ["pipe", "pipe", "pipe"],
@@ -15985,7 +16051,7 @@ function setVercelSecret(key, value, projectId, dryRun = false) {
15985
16051
  if (projectId) {
15986
16052
  args.push("--project", projectId);
15987
16053
  }
15988
- const result = spawnSync5("vercel", args, {
16054
+ const result = spawnSync6("vercel", args, {
15989
16055
  input: value,
15990
16056
  encoding: "utf8",
15991
16057
  stdio: ["pipe", "inherit", "inherit"]
@@ -16014,7 +16080,7 @@ function setVercelSecret(key, value, projectId, dryRun = false) {
16014
16080
  }
16015
16081
  function detectGitHubRepo() {
16016
16082
  try {
16017
- const result = spawnSync5("git", ["remote", "get-url", "origin"], {
16083
+ const result = spawnSync6("git", ["remote", "get-url", "origin"], {
16018
16084
  encoding: "utf8",
16019
16085
  stdio: ["pipe", "pipe", "pipe"]
16020
16086
  });
@@ -16042,7 +16108,7 @@ function setGitHubSecret(key, value, repo, dryRun = false) {
16042
16108
  if (repo) {
16043
16109
  args.push("--repo", repo);
16044
16110
  }
16045
- const result = spawnSync5("gh", args, {
16111
+ const result = spawnSync6("gh", args, {
16046
16112
  input: value,
16047
16113
  encoding: "utf8",
16048
16114
  stdio: ["pipe", "pipe", "pipe"]
@@ -16294,12 +16360,14 @@ var deploy_supabase_functions_exports = {};
16294
16360
  __export(deploy_supabase_functions_exports, {
16295
16361
  deploySupabaseFunctions: () => deploySupabaseFunctions
16296
16362
  });
16297
- import { execSync as execSync4 } from "node:child_process";
16363
+ import { execSync as execSync3 } from "node:child_process";
16298
16364
  async function deploySupabaseFunctions(appDir, config) {
16299
16365
  const supabaseDir = joinPath(appDir, "supabase");
16300
16366
  const functionsDir = joinPath(supabaseDir, "functions");
16301
16367
  if (!pathExists(functionsDir)) {
16302
- log.warn("No supabase/functions/ directory found. Skipping Supabase functions deployment.");
16368
+ log.warn(
16369
+ "No supabase/functions/ directory found. Skipping Supabase functions deployment."
16370
+ );
16303
16371
  return;
16304
16372
  }
16305
16373
  requireCLI(
@@ -16315,15 +16383,19 @@ async function deploySupabaseFunctions(appDir, config) {
16315
16383
  return pathExists(indexPath);
16316
16384
  });
16317
16385
  if (functionDirs.length === 0) {
16318
- log.warn("No Edge Functions found in supabase/functions/. Skipping deployment.");
16386
+ log.warn(
16387
+ "No Edge Functions found in supabase/functions/. Skipping deployment."
16388
+ );
16319
16389
  return;
16320
16390
  }
16321
- log.info(`Found ${functionDirs.length} Edge Function(s): ${functionDirs.join(", ")}`);
16391
+ log.info(
16392
+ `Found ${functionDirs.length} Edge Function(s): ${functionDirs.join(", ")}`
16393
+ );
16322
16394
  const s = Y2();
16323
16395
  for (const functionName of functionDirs) {
16324
16396
  s.start(`Deploying Edge Function: ${functionName}...`);
16325
16397
  try {
16326
- execSync4(`supabase functions deploy ${functionName}`, {
16398
+ execSync3(`supabase functions deploy ${functionName}`, {
16327
16399
  cwd: supabaseDir,
16328
16400
  stdio: config.verbose ? "inherit" : "pipe",
16329
16401
  env: {
@@ -16337,7 +16409,12 @@ async function deploySupabaseFunctions(appDir, config) {
16337
16409
  throw new DoNotDevError(
16338
16410
  `Failed to deploy Supabase Edge Function: ${functionName}`,
16339
16411
  "deployment-failed",
16340
- { context: { functionName, error: error2 instanceof Error ? error2.message : String(error2) } }
16412
+ {
16413
+ context: {
16414
+ functionName,
16415
+ error: error2 instanceof Error ? error2.message : String(error2)
16416
+ }
16417
+ }
16341
16418
  );
16342
16419
  }
16343
16420
  }
@@ -16484,14 +16561,19 @@ function safeRemove(path, options = {}) {
16484
16561
 
16485
16562
  // packages/tooling/src/apps/deploy.ts
16486
16563
  init_utils();
16487
- import { execSync as execSync5 } from "node:child_process";
16564
+ import { execSync as execSync4 } from "node:child_process";
16488
16565
 
16489
16566
  // packages/tooling/src/apps/deploy-frontend.ts
16490
16567
  init_utils();
16491
16568
  async function deployFrontend(appDir, serviceAccountPath, projectId, config) {
16492
16569
  const s = Y2();
16493
16570
  s.start("Deploying frontend to Firebase Hosting...");
16494
- const args = buildFirebaseDeployArgs("hosting", projectId, config.debug, config.force ?? true);
16571
+ const args = buildFirebaseDeployArgs(
16572
+ "hosting",
16573
+ projectId,
16574
+ config.debug,
16575
+ config.force ?? true
16576
+ );
16495
16577
  const result = executeFirebaseCommand(args, {
16496
16578
  cwd: appDir,
16497
16579
  serviceAccountPath,
@@ -16515,15 +16597,33 @@ async function deployFrontend(appDir, serviceAccountPath, projectId, config) {
16515
16597
 
16516
16598
  // packages/tooling/src/apps/deploy-vercel-frontend.ts
16517
16599
  init_utils();
16518
- import { execSync as execSync2 } from "node:child_process";
16600
+ init_cli_output();
16601
+ init_vercel_token();
16602
+ import { spawnSync as spawnSync3 } from "node:child_process";
16519
16603
  async function deployVercelFrontend(appDir, _config) {
16520
16604
  const s = Y2();
16521
16605
  s.start("Deploying frontend to Vercel...");
16606
+ const token = resolveVercelToken(appDir);
16607
+ if (token) {
16608
+ log.debug("Using VERCEL_TOKEN from .env (token-based auth)");
16609
+ }
16610
+ const args = ["vercel", "--prod", "--yes"];
16611
+ if (token) {
16612
+ args.push("--token", token);
16613
+ }
16522
16614
  try {
16523
- execSync2("npx vercel --prod --yes", {
16615
+ const result = spawnSync3("bunx", args, {
16524
16616
  cwd: appDir,
16525
- stdio: "inherit"
16617
+ stdio: "pipe",
16618
+ encoding: "utf-8"
16526
16619
  });
16620
+ if (result.status !== 0) {
16621
+ s.stop("Vercel deployment failed");
16622
+ const errOutput = result.stderr?.trim();
16623
+ throw new Error(
16624
+ errOutput || `Vercel deploy exited with code ${result.status}`
16625
+ );
16626
+ }
16527
16627
  s.stop("Frontend deployed to Vercel");
16528
16628
  } catch (err) {
16529
16629
  s.stop("Vercel deployment failed");
@@ -16534,7 +16634,7 @@ async function deployVercelFrontend(appDir, _config) {
16534
16634
  // packages/tooling/src/apps/deploy-functions.ts
16535
16635
  init_utils();
16536
16636
  var import_yaml = __toESM(require_dist(), 1);
16537
- import { execSync as execSync3, spawnSync as spawnSync3 } from "node:child_process";
16637
+ import { execSync as execSync2, spawnSync as spawnSync4 } from "node:child_process";
16538
16638
  init_pathResolver();
16539
16639
  init_cli_tools();
16540
16640
  init_typed_file_operations();
@@ -16703,7 +16803,7 @@ function updateCloudRunIAM(functionNames, projectId, region, serviceAccountPath,
16703
16803
  let failCount = 0;
16704
16804
  for (const funcName of functionNames) {
16705
16805
  try {
16706
- const result = spawnSync3(
16806
+ const result = spawnSync4(
16707
16807
  "gcloud",
16708
16808
  [
16709
16809
  "run",
@@ -16821,7 +16921,7 @@ async function autoSyncSecrets(functionsDir, projectId, config) {
16821
16921
  let failCount = 0;
16822
16922
  for (const { key, value } of secrets) {
16823
16923
  try {
16824
- const result = spawnSync3(
16924
+ const result = spawnSync4(
16825
16925
  firebaseCmd,
16826
16926
  ["functions:secrets:set", key, "--project", projectId],
16827
16927
  {
@@ -16903,7 +17003,7 @@ To fix this, run:
16903
17003
  const s2 = Y2();
16904
17004
  s2.start("Building functions...");
16905
17005
  try {
16906
- execSync3("bun run build", {
17006
+ execSync2("bun run build", {
16907
17007
  cwd: functionsDir,
16908
17008
  stdio: config.verbose ? "inherit" : "pipe"
16909
17009
  });
@@ -16979,7 +17079,12 @@ async function deployRules(appDir, serviceAccountPath, projectId, config, option
16979
17079
  const targetNames = targets.join(", ");
16980
17080
  const s = Y2();
16981
17081
  s.start(`Deploying ${targetNames}...`);
16982
- const args = buildFirebaseDeployArgs(targets, projectId, config.debug, config.force ?? true);
17082
+ const args = buildFirebaseDeployArgs(
17083
+ targets,
17084
+ projectId,
17085
+ config.debug,
17086
+ config.force ?? true
17087
+ );
16983
17088
  const result = executeFirebaseCommand(args, {
16984
17089
  cwd: appDir,
16985
17090
  serviceAccountPath,
@@ -17003,29 +17108,10 @@ async function deployRules(appDir, serviceAccountPath, projectId, config, option
17003
17108
 
17004
17109
  // packages/tooling/src/apps/deploy-utils.ts
17005
17110
  init_utils();
17006
- import { spawnSync as spawnSync4 } from "node:child_process";
17111
+ import { spawnSync as spawnSync5 } from "node:child_process";
17007
17112
  init_pathResolver();
17008
17113
  init_typed_file_operations();
17009
-
17010
- // packages/tooling/src/utils/error-handling.ts
17011
- init_utils();
17012
- function isError(error2) {
17013
- return error2 instanceof Error;
17014
- }
17015
- function getErrorMessage(error2) {
17016
- if (isError(error2)) {
17017
- return error2.message;
17018
- }
17019
- if (typeof error2 === "string") {
17020
- return error2;
17021
- }
17022
- if (error2 && typeof error2 === "object" && "message" in error2) {
17023
- return String(error2.message);
17024
- }
17025
- return String(error2);
17026
- }
17027
-
17028
- // packages/tooling/src/apps/deploy-utils.ts
17114
+ init_error_handling();
17029
17115
  function detectAvailableApps() {
17030
17116
  const currentDir = process.cwd();
17031
17117
  const appsDir = joinPath(currentDir, "apps");
@@ -17210,7 +17296,7 @@ How to fix:
17210
17296
  if (shouldOpen) {
17211
17297
  try {
17212
17298
  const openCommand = process.platform === "win32" ? "start" : process.platform === "darwin" ? "open" : "xdg-open";
17213
- spawnSync4(openCommand, [consoleUrl], { shell: true });
17299
+ spawnSync5(openCommand, [consoleUrl], { shell: true });
17214
17300
  log.success("Opening Firebase Console...");
17215
17301
  } catch {
17216
17302
  log.warn("Could not open browser. Please open the URL manually.");
@@ -17281,7 +17367,7 @@ function detectProvider(appDir) {
17281
17367
  if (hasFirebase) {
17282
17368
  try {
17283
17369
  const config = readSync(firebaseJsonPath, { format: "json" });
17284
- if (config && typeof config === "object" && "projectId" in config) {
17370
+ if (config && typeof config === "object") {
17285
17371
  const firebaseConfigObj = config;
17286
17372
  firebaseConfig = {
17287
17373
  projectId: firebaseConfigObj.projectId,
@@ -17290,8 +17376,6 @@ function detectProvider(appDir) {
17290
17376
  hasFirestoreRules: !!firebaseConfigObj.firestore?.rules,
17291
17377
  hasStorageRules: !!firebaseConfigObj.storage?.rules
17292
17378
  };
17293
- } else {
17294
- throw new Error("Invalid firebase.json structure");
17295
17379
  }
17296
17380
  } catch {
17297
17381
  firebaseConfig = {
@@ -17374,13 +17458,17 @@ async function main2(options = {}) {
17374
17458
  const availableApps = detectAvailableApps();
17375
17459
  if (availableApps.length === 0) {
17376
17460
  if (providerInfo.hasSupabase && !providerInfo.hasFirebase) {
17377
- log.info("Supabase project detected. Deploying Supabase resources...");
17461
+ log.info(
17462
+ "Supabase project detected. Deploying Supabase resources..."
17463
+ );
17378
17464
  } else {
17379
17465
  log.info("No apps with firebase.json or supabase/ directory found.");
17380
17466
  log.info(
17381
17467
  "To deploy, ensure your app has a firebase.json or supabase/ configuration."
17382
17468
  );
17383
- log.info("Run from a DoNotDev project, or create one with: dndev init");
17469
+ log.info(
17470
+ "Run from a DoNotDev project, or create one with: dndev init"
17471
+ );
17384
17472
  return;
17385
17473
  }
17386
17474
  }
@@ -17599,7 +17687,7 @@ async function main2(options = {}) {
17599
17687
  isStaging ? "Building (staging mode)..." : "Building application..."
17600
17688
  );
17601
17689
  try {
17602
- execSync5(buildCmd, {
17690
+ execSync4(buildCmd, {
17603
17691
  cwd: appDir,
17604
17692
  stdio: "inherit",
17605
17693
  env: {
@@ -17660,12 +17748,7 @@ async function main2(options = {}) {
17660
17748
  }
17661
17749
  }
17662
17750
  }
17663
- await deployFunctions(
17664
- appDir,
17665
- serviceAccountPath,
17666
- config.project,
17667
- config
17668
- );
17751
+ await deployFunctions(appDir, serviceAccountPath, config.project, config);
17669
17752
  }
17670
17753
  if (shouldDeployFirebaseRules && serviceAccountPath && config.project && appProviderInfo.firebaseConfig) {
17671
17754
  await deployRules(appDir, serviceAccountPath, config.project, config, {
@@ -7742,23 +7742,7 @@ var init_utils = __esm({
7742
7742
  }
7743
7743
  });
7744
7744
 
7745
- // packages/cli/src/bin/commands/dev.ts
7746
- init_utils();
7747
-
7748
- // packages/tooling/src/index.ts
7749
- init_utils();
7750
-
7751
- // packages/tooling/src/cli/index.ts
7752
- init_utils();
7753
-
7754
- // packages/tooling/src/utils/app-selector.ts
7755
- init_utils();
7756
- init_dist2();
7757
-
7758
7745
  // packages/tooling/src/utils/app-detection.ts
7759
- init_utils();
7760
- init_pathResolver();
7761
- init_typed_file_operations();
7762
7746
  function detectApps(projectRoot) {
7763
7747
  const apps = [];
7764
7748
  const appsDir = joinPath(projectRoot, "apps");
@@ -7818,12 +7802,21 @@ function analyzeApp(appPath, appName) {
7818
7802
  const functionsStat = statSync2(functionsPath);
7819
7803
  const hasFunctions = pathExists(functionsPath) && (functionsStat?.isDirectory() ?? false);
7820
7804
  let platform2;
7821
- if (hasFunctions) {
7822
- const firebaseJsonPath = joinPath(functionsPath, "firebase.json");
7805
+ const firebaseJsonInFunctions = hasFunctions && pathExists(joinPath(functionsPath, "firebase.json"));
7806
+ const firebaseJsonInApp = pathExists(joinPath(appPath, "firebase.json"));
7807
+ if (firebaseJsonInFunctions || firebaseJsonInApp) {
7808
+ platform2 = "firebase";
7809
+ }
7810
+ if (!platform2) {
7811
+ const supabaseConfigPath = joinPath(appPath, "supabase", "config.toml");
7812
+ const hasSupabaseDep = !!(packageJson.dependencies?.["@donotdev/supabase"] || packageJson.dependencies?.["@supabase/supabase-js"]);
7813
+ if (pathExists(supabaseConfigPath) || hasSupabaseDep) {
7814
+ platform2 = "supabase";
7815
+ }
7816
+ }
7817
+ if (!platform2) {
7823
7818
  const vercelJsonPath = joinPath(appPath, "vercel.json");
7824
- if (pathExists(firebaseJsonPath)) {
7825
- platform2 = "firebase";
7826
- } else if (pathExists(vercelJsonPath)) {
7819
+ if (pathExists(vercelJsonPath)) {
7827
7820
  platform2 = "vercel";
7828
7821
  }
7829
7822
  }
@@ -7838,9 +7831,16 @@ function analyzeApp(appPath, appName) {
7838
7831
  platform: platform2
7839
7832
  };
7840
7833
  }
7834
+ var init_app_detection = __esm({
7835
+ "packages/tooling/src/utils/app-detection.ts"() {
7836
+ "use strict";
7837
+ init_utils();
7838
+ init_pathResolver();
7839
+ init_typed_file_operations();
7840
+ }
7841
+ });
7841
7842
 
7842
7843
  // packages/tooling/src/utils/app-selector.ts
7843
- init_cli_output();
7844
7844
  async function selectApp(projectRoot, appName) {
7845
7845
  const apps = detectApps(projectRoot);
7846
7846
  if (apps.length === 0) {
@@ -7874,14 +7874,33 @@ async function selectApp(projectRoot, appName) {
7874
7874
  }
7875
7875
  return apps.find((a) => a.name === selected) || null;
7876
7876
  }
7877
+ var init_app_selector = __esm({
7878
+ "packages/tooling/src/utils/app-selector.ts"() {
7879
+ "use strict";
7880
+ init_utils();
7881
+ init_dist2();
7882
+ init_app_detection();
7883
+ init_cli_output();
7884
+ }
7885
+ });
7886
+
7887
+ // packages/cli/src/bin/commands/dev.ts
7888
+ init_utils();
7889
+
7890
+ // packages/tooling/src/index.ts
7891
+ init_utils();
7892
+
7893
+ // packages/tooling/src/cli/index.ts
7894
+ init_utils();
7877
7895
 
7878
7896
  // packages/tooling/src/apps/dev.ts
7879
7897
  init_utils();
7880
- import { spawn, execSync as execSync2 } from "node:child_process";
7881
- import { platform } from "node:os";
7898
+ init_app_selector();
7882
7899
  init_cli_output();
7883
7900
  init_errors();
7884
7901
  init_pathResolver();
7902
+ import { spawn, execSync as execSync2 } from "node:child_process";
7903
+ import { platform } from "node:os";
7885
7904
 
7886
7905
  // packages/tooling/src/utils/spawn-utils.ts
7887
7906
  init_utils();
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @fileoverview Doctor Command Wrapper
3
+ * @description Re-exports doctor from tooling for CLI bundling.
4
+ */
5
+ export { doctor as main } from '@donotdev/tooling';
6
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/bin/commands/doctor.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC"}