@donotdev/cli 0.3.0 → 0.3.2

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 (104) hide show
  1. package/dependencies-matrix.json +51 -27
  2. package/dist/bin/commands/agent-setup.js +28 -18
  3. package/dist/bin/commands/build.js +1086 -58
  4. package/dist/bin/commands/bump.js +337 -53
  5. package/dist/bin/commands/cacheout.js +28 -18
  6. package/dist/bin/commands/coach.js +33 -25
  7. package/dist/bin/commands/create-app.js +597 -244
  8. package/dist/bin/commands/create-project.js +607 -254
  9. package/dist/bin/commands/db-check.js +37 -28
  10. package/dist/bin/commands/db.js +37 -28
  11. package/dist/bin/commands/deploy.js +13758 -11807
  12. package/dist/bin/commands/dev.js +50 -34
  13. package/dist/bin/commands/doctor.js +33 -25
  14. package/dist/bin/commands/emu.js +65 -43
  15. package/dist/bin/commands/format.js +28 -18
  16. package/dist/bin/commands/get-demo.js +81 -46
  17. package/dist/bin/commands/make-admin.js +966 -896
  18. package/dist/bin/commands/preview.js +50 -34
  19. package/dist/bin/commands/seed.js +37 -28
  20. package/dist/bin/commands/setup-cicd.js +1286 -87
  21. package/dist/bin/commands/setup.js +152 -138
  22. package/dist/bin/commands/staging.js +13758 -11807
  23. package/dist/bin/commands/sync-secrets.js +152 -132
  24. package/dist/bin/commands/type-check.js +1086 -39
  25. package/dist/bin/commands/wai.js +28 -18
  26. package/dist/bin/dndev.js +513 -30
  27. package/dist/bin/donotdev.js +33 -8
  28. package/dist/index.js +14568 -12497
  29. package/package.json +1 -1
  30. package/templates/app-demo/index.html.example +0 -1
  31. package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +2 -2
  32. package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +1 -0
  33. package/templates/app-demo/tsconfig.json.example +1 -1
  34. package/templates/app-dndev/index.html.example +1 -3
  35. package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +1 -0
  36. package/templates/app-expo/app/_layout.tsx.example +1 -1
  37. package/templates/app-expo/app/form.tsx.example +10 -3
  38. package/templates/app-expo/app/index.tsx.example +3 -3
  39. package/templates/app-expo/app/list.tsx.example +2 -2
  40. package/templates/app-expo/app/profile.tsx.example +4 -3
  41. package/templates/app-expo/app/signin.tsx.example +2 -2
  42. package/templates/app-expo/babel.config.js.example +23 -6
  43. package/templates/app-expo/metro.config.js.example +7 -17
  44. package/templates/app-expo/tsconfig.json.example +2 -1
  45. package/templates/app-next/src/app/AppDocument.tsx.example +2 -3
  46. package/templates/app-vite/index.html.example +1 -3
  47. package/templates/app-vite/src/locales/home_en.json.example +6 -6
  48. package/templates/app-vite/src/pages/FormPageExample.tsx.example +1 -1
  49. package/templates/app-vite/src/pages/HomePage.tsx.example +3 -3
  50. package/templates/app-vite/src/pages/NotFoundPage.tsx.example +1 -0
  51. package/templates/deploy-config/firebase.json.example +6 -5
  52. package/templates/deploy-config/tsconfig.functions.json.example +2 -7
  53. package/templates/deploy-config/vercel.json.example +6 -420
  54. package/templates/functions-firebase/README.md.example +8 -8
  55. package/templates/functions-firebase/functions.config.js.example +2 -1
  56. package/templates/functions-firebase/src/index.ts.example +4 -3
  57. package/templates/functions-firebase/src/oauth/exchangeToken.ts.example +8 -6
  58. package/templates/functions-firebase/src/oauth/refreshToken.ts.example +8 -6
  59. package/templates/functions-firebase/tsconfig.json.example +3 -5
  60. package/templates/functions-supabase/supabase/config.toml.example +2 -1
  61. package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +2 -3
  62. package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +2 -3
  63. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +2 -3
  64. package/templates/functions-vercel/README.md.example +15 -25
  65. package/templates/functions-vercel/build.mjs.example +4 -46
  66. package/templates/functions-vercel/src/api/auth/setCustomClaims.ts.example +6 -11
  67. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +2 -3
  68. package/templates/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +5 -11
  69. package/templates/functions-vercel/src/api/oauth/exchangeToken.ts.example +5 -11
  70. package/templates/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +5 -11
  71. package/templates/functions-vercel/tsconfig.json.example +5 -6
  72. package/templates/github/workflows/firebase-deploy.yml.example +1 -1
  73. package/templates/preset-admin/src/pages/DashboardPage.tsx.example +3 -2
  74. package/templates/preset-admin/src/pages/ReportsPage.tsx.example +13 -12
  75. package/templates/preset-admin/src/pages/SettingsPage.tsx.example +5 -5
  76. package/templates/preset-admin/src/pages/UsersPage.tsx.example +13 -12
  77. package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +5 -5
  78. package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +1 -4
  79. package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +10 -12
  80. package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +7 -4
  81. package/templates/preset-landing/src/pages/AboutPage.tsx.example +11 -9
  82. package/templates/preset-landing/src/pages/ContactPage.tsx.example +13 -7
  83. package/templates/preset-landing/src/pages/HomePage.tsx.example +50 -32
  84. package/templates/preset-saas/src/pages/DashboardPage.tsx.example +1 -1
  85. package/templates/preset-saas/src/pages/HomePage.tsx.example +3 -2
  86. package/templates/preset-saas/src/pages/PricingPage.tsx.example +4 -3
  87. package/templates/preset-saas/src/pages/ProfilePage.tsx.example +7 -7
  88. package/templates/preset-saas/src/pages/SettingsPage.tsx.example +3 -3
  89. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +101 -10
  90. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
  91. package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
  92. package/templates/root-consumer/.claude/settings.json.example +0 -11
  93. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
  94. package/templates/root-consumer/.dndev/args.json.example +2 -2
  95. package/templates/root-consumer/.env.example +1 -1
  96. package/templates/root-consumer/.gitignore.example +2 -0
  97. package/templates/root-consumer/AGENTS.md.example +3 -3
  98. package/templates/root-consumer/README.md.example +1 -1
  99. package/templates/app-vite/csp.example.json +0 -44
  100. package/templates/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
  101. package/templates/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
  102. package/templates/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
  103. package/templates/functions-vercel/vercel.json.example +0 -14
  104. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +0 -18
@@ -7195,11 +7195,12 @@ function getPatternsFor(type, repoRoot = null) {
7195
7195
  function getGlobOptionsFor(type) {
7196
7196
  return GLOB_OPTIONS[type] || GLOB_OPTIONS.base;
7197
7197
  }
7198
- var I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
7198
+ var DEFAULT_OG_IMAGE, I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
7199
7199
  var init_constants = __esm({
7200
7200
  "packages/core/config/constants.js"() {
7201
7201
  "use strict";
7202
7202
  init_utils2();
7203
+ DEFAULT_OG_IMAGE = "/og-image.png";
7203
7204
  I18N_PATHS = {
7204
7205
  // Monorepo source structure (locales at root, not in src/)
7205
7206
  SOURCE_ROOT: "packages/core/i18n",
@@ -7210,7 +7211,9 @@ var init_constants = __esm({
7210
7211
  PUBLISHED_ROOT: "i18n",
7211
7212
  PUBLISHED_LOCALES: "i18n/locales",
7212
7213
  PUBLISHED_EAGER: "i18n/locales/eager",
7213
- PUBLISHED_LAZY: "i18n/locales/lazy"
7214
+ PUBLISHED_LAZY: "i18n/locales/lazy",
7215
+ // Flag artwork: one SVG per flag code (flagFileName), copied to public/flags/ (AssetDiscovery)
7216
+ PUBLISHED_FLAGS: "i18n/flags"
7214
7217
  };
7215
7218
  SCAN_PATTERNS = {
7216
7219
  routes: {
@@ -7272,7 +7275,12 @@ var init_constants = __esm({
7272
7275
  "logo.avif",
7273
7276
  "apple-touch-icon*.png",
7274
7277
  "android-chrome-*.png",
7275
- "manifest.json"
7278
+ // Generated from logo.svg (AssetDiscovery._generateMissingAssets) or the app's own
7279
+ "icon-*x*.png",
7280
+ DEFAULT_OG_IMAGE.slice(1)
7281
+ // Not manifest.json: the web app manifest is a build output on Next (the PWA step
7282
+ // rewrites it after this scan), so its scanned size would differ between a clean
7283
+ // build and a rebuild. The asset manifest's `manifest` reads it from disk instead.
7276
7284
  ],
7277
7285
  fonts: ["fonts/**/*.woff2", "fonts/**/*.woff", "fonts/**/*.ttf"],
7278
7286
  framework: ["packages/ui/assets/**/*"]
@@ -7349,7 +7357,6 @@ import {
7349
7357
  sep,
7350
7358
  extname
7351
7359
  } from "node:path";
7352
- import { fileURLToPath } from "node:url";
7353
7360
  function isEexistError(error2) {
7354
7361
  return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7355
7362
  }
@@ -8171,7 +8178,10 @@ var init_PathResolver = __esm({
8171
8178
  return resolvedPath;
8172
8179
  }
8173
8180
  /**
8174
- * Execute fast-glob with normalized results
8181
+ * Execute fast-glob with normalized results, sorted. fast-glob returns files in
8182
+ * filesystem completion order, which varies between runs: every discovery (routes,
8183
+ * themes, i18n, assets) and what it generates (route manifest, sitemap, llms.txt,
8184
+ * proxy) must list the same sources in the same order on every build.
8175
8185
  * @private
8176
8186
  */
8177
8187
  async _globWithNormalization(patterns, options) {
@@ -8179,7 +8189,7 @@ var init_PathResolver = __esm({
8179
8189
  return results.map((path) => {
8180
8190
  const pathStr = typeof path === "string" ? path : path.path;
8181
8191
  return this.normalizePath(pathStr);
8182
- });
8192
+ }).sort();
8183
8193
  }
8184
8194
  /**
8185
8195
  * Resolve files using patterns with cross-platform support
@@ -8334,15 +8344,6 @@ var init_PathResolver = __esm({
8334
8344
  const cjsPath = this.getEmptyCjsModulePath();
8335
8345
  return cjsPath.replace(/\.cjs$/, ".js");
8336
8346
  }
8337
- /**
8338
- * Get absolute path to empty flag component module.
8339
- * Returns `export default () => null;` — used by flag filtering plugins
8340
- * to replace unused flag files at build time.
8341
- */
8342
- getEmptyFlagModulePath() {
8343
- const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8344
- return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8345
- }
8346
8347
  /**
8347
8348
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8348
8349
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8415,7 +8416,7 @@ import {
8415
8416
  parse,
8416
8417
  isAbsolute as pathIsAbsolute
8417
8418
  } from "node:path";
8418
- import { fileURLToPath as fileURLToPath2 } from "node:url";
8419
+ import { fileURLToPath } from "node:url";
8419
8420
  function readdirSync3(dirPath, options) {
8420
8421
  if (options !== null && typeof options === "object" && options.withFileTypes === true) {
8421
8422
  return pathResolverInstance.readdirSync(dirPath, options);
@@ -8495,13 +8496,13 @@ import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFile
8495
8496
  import { createRequire as createRequire3 } from "node:module";
8496
8497
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
8497
8498
  import process from "node:process";
8498
- import { fileURLToPath as fileURLToPath3 } from "node:url";
8499
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
8499
8500
  var require2, __filename, __dirname;
8500
8501
  var init_utils2 = __esm({
8501
8502
  "packages/tooling/src/bundler/utils.ts"() {
8502
8503
  "use strict";
8503
8504
  require2 = createRequire3(import.meta.url);
8504
- __filename = fileURLToPath3(import.meta.url);
8505
+ __filename = fileURLToPath2(import.meta.url);
8505
8506
  __dirname = dirname4(__filename);
8506
8507
  if (typeof globalThis !== "undefined") {
8507
8508
  globalThis.require = require2;
@@ -8517,6 +8518,9 @@ var init_utils2 = __esm({
8517
8518
  });
8518
8519
 
8519
8520
  // packages/tooling/src/utils/app-detection.ts
8521
+ function isVercelFunctionsDir(functionsDir) {
8522
+ return statSync2(joinPath(functionsDir, "src", "api"))?.isDirectory() ?? false;
8523
+ }
8520
8524
  function detectApps(projectRoot) {
8521
8525
  const apps = [];
8522
8526
  const appsDir = joinPath(projectRoot, "apps");
@@ -8657,13 +8661,8 @@ function analyzeApp(appPath, appName) {
8657
8661
  functions = "supabase";
8658
8662
  }
8659
8663
  }
8660
- if (!functions) {
8661
- const vercelJsonPath = joinPath(appPath, "vercel.json");
8662
- const apiDir = joinPath(appPath, "api");
8663
- const apiDirStat = statSync2(apiDir);
8664
- if (pathExists(vercelJsonPath) && pathExists(apiDir) && (apiDirStat?.isDirectory() ?? false)) {
8665
- functions = "vercel";
8666
- }
8664
+ if (!functions && isVercelFunctionsDir(joinPath(appPath, "functions"))) {
8665
+ functions = "vercel";
8667
8666
  }
8668
8667
  let hosting;
8669
8668
  if (hasFirebase && firebaseConfig?.hasHosting) {
@@ -8740,17 +8739,15 @@ var init_app_selector = __esm({
8740
8739
  }
8741
8740
  });
8742
8741
 
8743
- // packages/cli/src/bin/commands/preview.ts
8744
- init_utils2();
8745
-
8746
- // packages/tooling/src/index.ts
8747
- init_utils2();
8748
-
8749
- // packages/tooling/src/cli/index.ts
8750
- init_utils2();
8742
+ // packages/tooling/src/utils/create-utils.ts
8743
+ var init_create_utils = __esm({
8744
+ "packages/tooling/src/utils/create-utils.ts"() {
8745
+ "use strict";
8746
+ init_utils2();
8747
+ }
8748
+ });
8751
8749
 
8752
8750
  // packages/tooling/src/utils/spawn-utils.ts
8753
- init_utils2();
8754
8751
  import {
8755
8752
  spawn,
8756
8753
  spawnSync,
@@ -8772,6 +8769,21 @@ function spawnCrossPlatform(command, args, options) {
8772
8769
  }
8773
8770
  return spawn(command, args, rest);
8774
8771
  }
8772
+ var init_spawn_utils = __esm({
8773
+ "packages/tooling/src/utils/spawn-utils.ts"() {
8774
+ "use strict";
8775
+ init_utils2();
8776
+ }
8777
+ });
8778
+
8779
+ // packages/cli/src/bin/commands/preview.ts
8780
+ init_utils2();
8781
+
8782
+ // packages/tooling/src/index.ts
8783
+ init_utils2();
8784
+
8785
+ // packages/tooling/src/cli/index.ts
8786
+ init_utils2();
8775
8787
 
8776
8788
  // packages/tooling/src/apps/preview.ts
8777
8789
  init_utils2();
@@ -8779,6 +8791,7 @@ init_app_selector();
8779
8791
  init_cli_output();
8780
8792
  init_errors();
8781
8793
  init_pathResolver();
8794
+ init_spawn_utils();
8782
8795
  import {
8783
8796
  spawnSync as spawnSync2,
8784
8797
  execSync as execSync2
@@ -8892,6 +8905,9 @@ async function main(options = {}) {
8892
8905
  });
8893
8906
  });
8894
8907
  }
8908
+
8909
+ // packages/tooling/src/cli/index.ts
8910
+ init_create_utils();
8895
8911
  export {
8896
8912
  main
8897
8913
  };
@@ -7452,11 +7452,12 @@ function getPatternsFor(type, repoRoot = null) {
7452
7452
  function getGlobOptionsFor(type) {
7453
7453
  return GLOB_OPTIONS[type] || GLOB_OPTIONS.base;
7454
7454
  }
7455
- var I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
7455
+ var DEFAULT_OG_IMAGE, I18N_PATHS, SCAN_PATTERNS, GLOB_OPTIONS;
7456
7456
  var init_constants = __esm({
7457
7457
  "packages/core/config/constants.js"() {
7458
7458
  "use strict";
7459
7459
  init_utils2();
7460
+ DEFAULT_OG_IMAGE = "/og-image.png";
7460
7461
  I18N_PATHS = {
7461
7462
  // Monorepo source structure (locales at root, not in src/)
7462
7463
  SOURCE_ROOT: "packages/core/i18n",
@@ -7467,7 +7468,9 @@ var init_constants = __esm({
7467
7468
  PUBLISHED_ROOT: "i18n",
7468
7469
  PUBLISHED_LOCALES: "i18n/locales",
7469
7470
  PUBLISHED_EAGER: "i18n/locales/eager",
7470
- PUBLISHED_LAZY: "i18n/locales/lazy"
7471
+ PUBLISHED_LAZY: "i18n/locales/lazy",
7472
+ // Flag artwork: one SVG per flag code (flagFileName), copied to public/flags/ (AssetDiscovery)
7473
+ PUBLISHED_FLAGS: "i18n/flags"
7471
7474
  };
7472
7475
  SCAN_PATTERNS = {
7473
7476
  routes: {
@@ -7529,7 +7532,12 @@ var init_constants = __esm({
7529
7532
  "logo.avif",
7530
7533
  "apple-touch-icon*.png",
7531
7534
  "android-chrome-*.png",
7532
- "manifest.json"
7535
+ // Generated from logo.svg (AssetDiscovery._generateMissingAssets) or the app's own
7536
+ "icon-*x*.png",
7537
+ DEFAULT_OG_IMAGE.slice(1)
7538
+ // Not manifest.json: the web app manifest is a build output on Next (the PWA step
7539
+ // rewrites it after this scan), so its scanned size would differ between a clean
7540
+ // build and a rebuild. The asset manifest's `manifest` reads it from disk instead.
7533
7541
  ],
7534
7542
  fonts: ["fonts/**/*.woff2", "fonts/**/*.woff", "fonts/**/*.ttf"],
7535
7543
  framework: ["packages/ui/assets/**/*"]
@@ -7606,7 +7614,6 @@ import {
7606
7614
  sep,
7607
7615
  extname
7608
7616
  } from "node:path";
7609
- import { fileURLToPath } from "node:url";
7610
7617
  function isEexistError(error2) {
7611
7618
  return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7612
7619
  }
@@ -8428,7 +8435,10 @@ var init_PathResolver = __esm({
8428
8435
  return resolvedPath;
8429
8436
  }
8430
8437
  /**
8431
- * Execute fast-glob with normalized results
8438
+ * Execute fast-glob with normalized results, sorted. fast-glob returns files in
8439
+ * filesystem completion order, which varies between runs: every discovery (routes,
8440
+ * themes, i18n, assets) and what it generates (route manifest, sitemap, llms.txt,
8441
+ * proxy) must list the same sources in the same order on every build.
8432
8442
  * @private
8433
8443
  */
8434
8444
  async _globWithNormalization(patterns, options) {
@@ -8436,7 +8446,7 @@ var init_PathResolver = __esm({
8436
8446
  return results.map((path) => {
8437
8447
  const pathStr = typeof path === "string" ? path : path.path;
8438
8448
  return this.normalizePath(pathStr);
8439
- });
8449
+ }).sort();
8440
8450
  }
8441
8451
  /**
8442
8452
  * Resolve files using patterns with cross-platform support
@@ -8591,15 +8601,6 @@ var init_PathResolver = __esm({
8591
8601
  const cjsPath = this.getEmptyCjsModulePath();
8592
8602
  return cjsPath.replace(/\.cjs$/, ".js");
8593
8603
  }
8594
- /**
8595
- * Get absolute path to empty flag component module.
8596
- * Returns `export default () => null;` — used by flag filtering plugins
8597
- * to replace unused flag files at build time.
8598
- */
8599
- getEmptyFlagModulePath() {
8600
- const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8601
- return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8602
- }
8603
8604
  /**
8604
8605
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8605
8606
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8732,7 +8733,7 @@ import {
8732
8733
  parse,
8733
8734
  isAbsolute as pathIsAbsolute
8734
8735
  } from "node:path";
8735
- import { fileURLToPath as fileURLToPath2 } from "node:url";
8736
+ import { fileURLToPath } from "node:url";
8736
8737
  function readdirSync3(dirPath, options) {
8737
8738
  if (options !== null && typeof options === "object" && options.withFileTypes === true) {
8738
8739
  return pathResolverInstance.readdirSync(dirPath, options);
@@ -8740,7 +8741,7 @@ function readdirSync3(dirPath, options) {
8740
8741
  return pathResolverInstance.readdirSync(dirPath, options);
8741
8742
  }
8742
8743
  function getDirnameFromUrl(importMetaUrl) {
8743
- return dirname3(fileURLToPath2(importMetaUrl));
8744
+ return dirname3(fileURLToPath(importMetaUrl));
8744
8745
  }
8745
8746
  function findNodeModulesDir(startDir) {
8746
8747
  let currentDir = normalizePath(startDir);
@@ -8790,7 +8791,7 @@ function getBinPath(binaryName) {
8790
8791
  return binaryName;
8791
8792
  }
8792
8793
  function detectExecutionMode() {
8793
- const fileUrlPath = fileURLToPath2(import.meta.url);
8794
+ const fileUrlPath = fileURLToPath(import.meta.url);
8794
8795
  if (fileUrlPath.includes("node_modules")) {
8795
8796
  return "published";
8796
8797
  }
@@ -8802,7 +8803,7 @@ function detectExecutionMode() {
8802
8803
  function getTemplatesRoot() {
8803
8804
  const mode = detectExecutionMode();
8804
8805
  if (mode === "development") {
8805
- const fileUrlPath = fileURLToPath2(import.meta.url);
8806
+ const fileUrlPath = fileURLToPath(import.meta.url);
8806
8807
  const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
8807
8808
  return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
8808
8809
  } else {
@@ -9117,13 +9118,13 @@ import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFile
9117
9118
  import { createRequire as createRequire3 } from "node:module";
9118
9119
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
9119
9120
  import process from "node:process";
9120
- import { fileURLToPath as fileURLToPath3 } from "node:url";
9121
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
9121
9122
  var require2, __filename, __dirname;
9122
9123
  var init_utils2 = __esm({
9123
9124
  "packages/tooling/src/bundler/utils.ts"() {
9124
9125
  "use strict";
9125
9126
  require2 = createRequire3(import.meta.url);
9126
- __filename = fileURLToPath3(import.meta.url);
9127
+ __filename = fileURLToPath2(import.meta.url);
9127
9128
  __dirname = dirname4(__filename);
9128
9129
  if (typeof globalThis !== "undefined") {
9129
9130
  globalThis.require = require2;
@@ -9139,6 +9140,9 @@ var init_utils2 = __esm({
9139
9140
  });
9140
9141
 
9141
9142
  // packages/tooling/src/utils/app-detection.ts
9143
+ function isVercelFunctionsDir(functionsDir) {
9144
+ return statSync2(joinPath(functionsDir, "src", "api"))?.isDirectory() ?? false;
9145
+ }
9142
9146
  function detectApps(projectRoot) {
9143
9147
  const apps = [];
9144
9148
  const appsDir = joinPath(projectRoot, "apps");
@@ -9279,13 +9283,8 @@ function analyzeApp(appPath, appName) {
9279
9283
  functions = "supabase";
9280
9284
  }
9281
9285
  }
9282
- if (!functions) {
9283
- const vercelJsonPath = joinPath(appPath, "vercel.json");
9284
- const apiDir = joinPath(appPath, "api");
9285
- const apiDirStat = statSync2(apiDir);
9286
- if (pathExists(vercelJsonPath) && pathExists(apiDir) && (apiDirStat?.isDirectory() ?? false)) {
9287
- functions = "vercel";
9288
- }
9286
+ if (!functions && isVercelFunctionsDir(joinPath(appPath, "functions"))) {
9287
+ functions = "vercel";
9289
9288
  }
9290
9289
  let hosting;
9291
9290
  if (hasFirebase && firebaseConfig?.hasHosting) {
@@ -9362,6 +9361,14 @@ var init_app_selector = __esm({
9362
9361
  }
9363
9362
  });
9364
9363
 
9364
+ // packages/tooling/src/utils/create-utils.ts
9365
+ var init_create_utils = __esm({
9366
+ "packages/tooling/src/utils/create-utils.ts"() {
9367
+ "use strict";
9368
+ init_utils2();
9369
+ }
9370
+ });
9371
+
9365
9372
  // packages/tooling/src/utils/secrets-resolver.ts
9366
9373
  function parseEnvFile(filePath) {
9367
9374
  if (!pathExists(filePath)) return {};
@@ -51166,6 +51173,7 @@ var init_app = __esm({
51166
51173
  // packages/tooling/src/utils/supabase-management.ts
51167
51174
  var supabase_management_exports = {};
51168
51175
  __export(supabase_management_exports, {
51176
+ MGMT_API_BASE: () => MGMT_API_BASE,
51169
51177
  cleanupOldEntityMigrations: () => cleanupOldEntityMigrations,
51170
51178
  deployEdgeFunction: () => deployEdgeFunction,
51171
51179
  executeMigration: () => executeMigration,
@@ -191743,6 +191751,7 @@ init_utils2();
191743
191751
 
191744
191752
  // packages/tooling/src/cli/index.ts
191745
191753
  init_utils2();
191754
+ init_create_utils();
191746
191755
 
191747
191756
  // packages/tooling/src/cli/seed/seed.ts
191748
191757
  init_utils2();