@donotdev/cli 0.0.17 → 0.0.19

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 (183) hide show
  1. package/dependencies-matrix.json +67 -60
  2. package/dist/bin/commands/coach.js +8177 -0
  3. package/dist/bin/commands/create-app.js +94 -145
  4. package/dist/bin/commands/create-project.js +98 -149
  5. package/dist/bin/commands/deploy.js +81 -59
  6. package/dist/bin/commands/doctor.js +243 -698
  7. package/dist/bin/commands/emu.js +2 -2
  8. package/dist/bin/commands/format.js +4 -1
  9. package/dist/bin/commands/get-demo.js +8351 -0
  10. package/dist/bin/commands/make-admin.js +773 -152
  11. package/dist/bin/commands/setup.js +519 -1711
  12. package/dist/bin/commands/staging.js +17852 -0
  13. package/dist/bin/commands/sync-secrets.js +2 -11
  14. package/dist/bin/commands/type-check.js +7733 -1713
  15. package/dist/bin/dndev.js +913 -182
  16. package/dist/bin/donotdev.js +913 -182
  17. package/dist/index.js +191 -211
  18. package/package.json +1 -1
  19. package/templates/app-demo/index.html.example +147 -10
  20. package/templates/app-demo/src/App.tsx.example +7 -13
  21. package/templates/app-demo/src/config/app.ts.example +12 -48
  22. package/templates/app-demo/src/entities/product.ts.example +38 -0
  23. package/templates/app-demo/src/globals.css.example +5 -1
  24. package/templates/app-demo/src/main.tsx.example +13 -7
  25. package/templates/app-demo/src/pages/ChangelogPage.tsx.example +14 -0
  26. package/templates/app-demo/src/pages/DashboardPage.tsx.example +15 -0
  27. package/templates/app-demo/src/pages/HomePage.tsx.example +3 -77
  28. package/templates/app-demo/src/pages/PricingPage.tsx.example +14 -0
  29. package/templates/app-demo/src/pages/ProductsPage.tsx.example +17 -0
  30. package/templates/app-demo/src/pages/ProfilePage.tsx.example +16 -0
  31. package/templates/app-demo/src/pages/SettingsPage.tsx.example +15 -0
  32. package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +112 -0
  33. package/templates/app-demo/src/pages/ShowcasePage.tsx.example +91 -0
  34. package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +14 -0
  35. package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +14 -0
  36. package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +14 -0
  37. package/templates/app-demo/tsconfig.json.example +1 -1
  38. package/templates/app-demo/vite.config.ts.example +23 -48
  39. package/templates/app-expo/README.md.example +1 -1
  40. package/templates/app-expo/app/index.tsx.example +1 -1
  41. package/templates/app-vite/src/pages/HomePage.tsx.example +8 -10
  42. package/templates/overlay-firebase/env.fragment.example +1 -1
  43. package/templates/overlay-firebase/env.fragment.expo.example +1 -1
  44. package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
  45. package/templates/overlay-supabase/env.fragment.example +1 -1
  46. package/templates/overlay-supabase/env.fragment.expo.example +1 -1
  47. package/templates/overlay-supabase/env.fragment.nextjs.example +1 -1
  48. package/templates/overlay-vercel/env.fragment.example +1 -1
  49. package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
  50. package/templates/root-consumer/.claude/commands/brainstorm.md.example +15 -1
  51. package/templates/root-consumer/.claude/commands/build.md.example +24 -2
  52. package/templates/root-consumer/.claude/commands/design.md.example +17 -0
  53. package/templates/root-consumer/.claude/commands/polish.md.example +17 -0
  54. package/templates/root-consumer/AI.md.example +54 -21
  55. package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +21 -6
  56. package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +16 -179
  57. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +19 -21
  58. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +14 -3
  59. package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
  60. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
  61. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +19 -2
  62. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +35 -1
  63. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +17 -12
  64. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +32 -0
  65. package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +1 -1
  66. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +74 -6
  67. package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +2 -2
  68. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +17 -12
  69. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +37 -16
  70. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +18 -18
  71. package/templates/root-consumer/guides/dndev/essences_reference.css.example +119 -2
  72. package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +1 -1
  73. package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +14 -0
  74. package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +6 -0
  75. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +14 -0
  76. package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +4 -5
  77. package/templates/root-consumer/guides/wai-way/page_patterns.md.example +2 -2
  78. package/dist/bin/commands/agent-setup.d.ts +0 -6
  79. package/dist/bin/commands/agent-setup.d.ts.map +0 -1
  80. package/dist/bin/commands/agent-setup.js.map +0 -1
  81. package/dist/bin/commands/build.d.ts +0 -11
  82. package/dist/bin/commands/build.d.ts.map +0 -1
  83. package/dist/bin/commands/build.js.map +0 -1
  84. package/dist/bin/commands/bump.d.ts +0 -11
  85. package/dist/bin/commands/bump.d.ts.map +0 -1
  86. package/dist/bin/commands/bump.js.map +0 -1
  87. package/dist/bin/commands/cacheout.d.ts +0 -11
  88. package/dist/bin/commands/cacheout.d.ts.map +0 -1
  89. package/dist/bin/commands/cacheout.js.map +0 -1
  90. package/dist/bin/commands/create-app.d.ts +0 -11
  91. package/dist/bin/commands/create-app.d.ts.map +0 -1
  92. package/dist/bin/commands/create-app.js.map +0 -1
  93. package/dist/bin/commands/create-project.d.ts +0 -11
  94. package/dist/bin/commands/create-project.d.ts.map +0 -1
  95. package/dist/bin/commands/create-project.js.map +0 -1
  96. package/dist/bin/commands/deploy.d.ts +0 -11
  97. package/dist/bin/commands/deploy.d.ts.map +0 -1
  98. package/dist/bin/commands/deploy.js.map +0 -1
  99. package/dist/bin/commands/dev.d.ts +0 -11
  100. package/dist/bin/commands/dev.d.ts.map +0 -1
  101. package/dist/bin/commands/dev.js.map +0 -1
  102. package/dist/bin/commands/doctor.d.ts +0 -6
  103. package/dist/bin/commands/doctor.d.ts.map +0 -1
  104. package/dist/bin/commands/doctor.js.map +0 -1
  105. package/dist/bin/commands/emu.d.ts +0 -11
  106. package/dist/bin/commands/emu.d.ts.map +0 -1
  107. package/dist/bin/commands/emu.js.map +0 -1
  108. package/dist/bin/commands/format.d.ts +0 -11
  109. package/dist/bin/commands/format.d.ts.map +0 -1
  110. package/dist/bin/commands/format.js.map +0 -1
  111. package/dist/bin/commands/make-admin.d.ts +0 -11
  112. package/dist/bin/commands/make-admin.d.ts.map +0 -1
  113. package/dist/bin/commands/make-admin.js.map +0 -1
  114. package/dist/bin/commands/preview.d.ts +0 -11
  115. package/dist/bin/commands/preview.d.ts.map +0 -1
  116. package/dist/bin/commands/preview.js.map +0 -1
  117. package/dist/bin/commands/setup.d.ts +0 -6
  118. package/dist/bin/commands/setup.d.ts.map +0 -1
  119. package/dist/bin/commands/setup.js.map +0 -1
  120. package/dist/bin/commands/sync-secrets.d.ts +0 -11
  121. package/dist/bin/commands/sync-secrets.d.ts.map +0 -1
  122. package/dist/bin/commands/sync-secrets.js.map +0 -1
  123. package/dist/bin/commands/type-check.d.ts +0 -14
  124. package/dist/bin/commands/type-check.d.ts.map +0 -1
  125. package/dist/bin/commands/type-check.js.map +0 -1
  126. package/dist/bin/commands/wai.d.ts +0 -11
  127. package/dist/bin/commands/wai.d.ts.map +0 -1
  128. package/dist/bin/commands/wai.js.map +0 -1
  129. package/dist/index.d.ts +0 -8
  130. package/dist/index.d.ts.map +0 -1
  131. package/dist/index.js.map +0 -1
  132. package/templates/app-demo/src/components/ThemeToggle.tsx.example +0 -48
  133. package/templates/app-demo/src/pages/DetailPage.tsx.example +0 -103
  134. package/templates/app-demo/src/pages/FullPage.tsx.example +0 -142
  135. package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +0 -266
  136. package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +0 -20
  137. package/templates/functions-firebase/functions-firebase/README.md.example +0 -123
  138. package/templates/functions-firebase/functions-firebase/build.mjs.example +0 -5
  139. package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +0 -19
  140. package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -21
  141. package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +0 -11
  142. package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -21
  143. package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +0 -21
  144. package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -24
  145. package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +0 -10
  146. package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  147. package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -14
  148. package/templates/functions-firebase/functions-firebase/src/index.ts.example +0 -39
  149. package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -14
  150. package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +0 -14
  151. package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +0 -14
  152. package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +0 -14
  153. package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -14
  154. package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +0 -17
  155. package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +0 -14
  156. package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -14
  157. package/templates/functions-firebase/functions-firebase/tsconfig.json.example +0 -21
  158. package/templates/functions-vercel/functions-vercel/README.md.example +0 -116
  159. package/templates/functions-vercel/functions-vercel/build.mjs.example +0 -52
  160. package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -20
  161. package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -20
  162. package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -20
  163. package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -20
  164. package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -20
  165. package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
  166. package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -20
  167. package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +0 -20
  168. package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -20
  169. package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +0 -20
  170. package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +0 -20
  171. package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +0 -20
  172. package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -20
  173. package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
  174. package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -20
  175. package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
  176. package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -20
  177. package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
  178. package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -20
  179. package/templates/functions-vercel/functions-vercel/tsconfig.json.example +0 -21
  180. package/templates/functions-vercel/functions-vercel/vercel.json.example +0 -14
  181. package/templates/github/github/workflows/firebase-deploy.yml.example +0 -79
  182. /package/templates/functions-firebase/{functions-firebase/.env.example.example → .env.example} +0 -0
  183. /package/templates/functions-vercel/{functions-vercel/.env.example.example → .env.example} +0 -0
@@ -8795,34 +8795,67 @@ var APP_QUESTIONNAIRE = [
8795
8795
  ]
8796
8796
  },
8797
8797
  {
8798
- id: "needsBackend",
8799
- question: "Include backend functions?",
8800
- type: "confirm",
8801
- defaultValue: false
8798
+ id: "host",
8799
+ question: "Where will you host?",
8800
+ type: "select",
8801
+ condition: (answers) => answers.framework !== "expo",
8802
+ defaultValue: (answers) => {
8803
+ return answers.framework === "nextjs" ? "vercel" : "none";
8804
+ },
8805
+ choices: [
8806
+ { title: "None \u2014 no hosting config", value: "none" },
8807
+ { title: "Vercel \u2014 edge CDN + serverless", value: "vercel" },
8808
+ { title: "Firebase Hosting \u2014 Google CDN", value: "firebase" }
8809
+ ]
8810
+ },
8811
+ {
8812
+ id: "functions",
8813
+ question: "Serverless functions?",
8814
+ type: "select",
8815
+ defaultValue: "none",
8816
+ // Choices filtered dynamically based on host
8817
+ choices: [
8818
+ { title: "None", value: "none" },
8819
+ { title: "Vercel Functions \u2014 edge + node.js", value: "vercel" },
8820
+ { title: "Firebase Functions \u2014 Google Cloud", value: "firebase" },
8821
+ { title: "Supabase Edge Functions \u2014 Deno", value: "supabase" }
8822
+ ],
8823
+ choicesFilter: (answers) => {
8824
+ const host = answers.host ?? "none";
8825
+ const framework = answers.framework;
8826
+ if (framework === "expo") return ["none", "firebase", "supabase"];
8827
+ if (host === "firebase") return ["none", "firebase"];
8828
+ if (host === "vercel") return ["none", "vercel", "supabase"];
8829
+ return ["none", "vercel", "firebase", "supabase"];
8830
+ }
8802
8831
  },
8803
8832
  {
8804
- id: "backendPlatform",
8805
- question: "Which backend platform?",
8833
+ id: "backend",
8834
+ question: "Backend / BaaS provider?",
8806
8835
  type: "select",
8807
- dependsOn: "needsBackend",
8808
- condition: (answers) => answers.needsBackend === true,
8809
8836
  defaultValue: (answers) => {
8810
- return answers.framework === "nextjs" ? "vercel" : "firebase";
8837
+ if (answers.functions === "firebase") return "firebase";
8838
+ if (answers.functions === "supabase") return "supabase";
8839
+ return "none";
8811
8840
  },
8812
8841
  choices: [
8842
+ { title: "None \u2014 frontend only", value: "none" },
8813
8843
  {
8814
- title: "Firebase \u2014 Full-stack platform (hosting + functions + auth + firestore)",
8844
+ title: "Firebase \u2014 Auth + Firestore + Storage",
8815
8845
  value: "firebase"
8816
8846
  },
8817
- {
8818
- title: "Vercel \u2014 Serverless functions (edge + node.js)",
8819
- value: "vercel"
8820
- },
8821
8847
  {
8822
8848
  title: "Supabase \u2014 Postgres + Auth + Storage",
8823
8849
  value: "supabase"
8824
8850
  }
8825
- ]
8851
+ ],
8852
+ choicesFilter: (answers) => {
8853
+ const functions = answers.functions ?? "none";
8854
+ if (functions === "firebase") return ["none", "firebase"];
8855
+ if (functions === "supabase") return ["none", "supabase"];
8856
+ if (functions === "vercel") return ["none"];
8857
+ return ["none", "firebase", "supabase"];
8858
+ }
8826
8859
  }
8827
8860
  ];
8828
8861
  var PROJECT_QUESTIONNAIRE = [
@@ -8840,12 +8873,13 @@ var PROJECT_QUESTIONNAIRE = [
8840
8873
  }
8841
8874
  ];
8842
8875
  function aggregateRequirements(answers) {
8876
+ const hasBackend = answers.backend && answers.backend !== "none" || answers.functions && answers.functions !== "none";
8843
8877
  const requirements = {
8844
8878
  entities: [],
8845
8879
  // Entities created in apps/<app>/entities/ (v1), root entities/ for v2
8846
8880
  billing: true,
8847
8881
  // Always on (useStripeBillingSafe handles missing package)
8848
- backend: answers.needsBackend || false,
8882
+ backend: hasBackend,
8849
8883
  features: [],
8850
8884
  template: "vite",
8851
8885
  // Only Vite for now
@@ -8869,6 +8903,10 @@ async function runQuestionnaire(questions, initialAnswers, showWIP, askFor) {
8869
8903
  if (!showWIP) {
8870
8904
  choices = choices.filter((choice) => !choice.wip);
8871
8905
  }
8906
+ if (question.choicesFilter) {
8907
+ const allowed = question.choicesFilter(answers);
8908
+ choices = choices.filter((c) => allowed.includes(c.value));
8909
+ }
8872
8910
  if (choices.length === 0) continue;
8873
8911
  answer = await askFor.selection(question.question, choices);
8874
8912
  break;
@@ -8931,10 +8969,10 @@ function generateScripts(templateName, options) {
8931
8969
  scripts.lint = "eslint .";
8932
8970
  scripts["type-check"] = "tsc --noEmit";
8933
8971
  } else if (templateName === "consumer-root") {
8934
- scripts.dev = "turbo run dev";
8972
+ scripts.dev = "dndev dev";
8935
8973
  scripts.build = "turbo run build";
8936
8974
  scripts.lint = "turbo run lint";
8937
- scripts["type-check"] = "turbo run type-check";
8975
+ scripts["type-check"] = "dndev tc";
8938
8976
  } else if (templateName.includes("functions")) {
8939
8977
  scripts.build = "node build.mjs";
8940
8978
  scripts["build:tsc"] = "tsc";
@@ -8945,9 +8983,9 @@ function generateScripts(templateName, options) {
8945
8983
  scripts.dev = "vercel dev";
8946
8984
  }
8947
8985
  } else if (templateName === "demo") {
8948
- scripts.dev = "bunx vite";
8949
- scripts.build = "tsc --noEmit && bunx vite build";
8950
- scripts.preview = "bunx vite preview";
8986
+ scripts.dev = "vite";
8987
+ scripts.build = "tsc --noEmit && vite build --mode production";
8988
+ scripts.preview = "vite preview";
8951
8989
  scripts["type-check"] = "tsc --noEmit";
8952
8990
  } else if (templateName === "entities") {
8953
8991
  }
@@ -9069,120 +9107,22 @@ init_pathResolver();
9069
9107
 
9070
9108
  // packages/tooling/src/scaffolding/scaffold-matrix.ts
9071
9109
  init_utils();
9072
- var MATRIX = [
9073
- {
9074
- builder: "vite",
9075
- backend: "none",
9076
- baseTemplate: "app-vite",
9077
- overlay: null,
9078
- deployConfig: null,
9079
- functionsTemplate: null
9080
- },
9081
- {
9082
- builder: "vite",
9083
- backend: "firebase",
9084
- baseTemplate: "app-vite",
9085
- overlay: "overlay-firebase",
9086
- deployConfig: "firebase",
9087
- functionsTemplate: "functions-firebase"
9088
- },
9089
- {
9090
- builder: "vite",
9091
- backend: "supabase",
9092
- baseTemplate: "app-vite",
9093
- overlay: "overlay-supabase",
9094
- deployConfig: "vercel-supabase",
9095
- functionsTemplate: "functions-supabase"
9096
- },
9097
- {
9098
- builder: "vite",
9099
- backend: "vercel",
9100
- baseTemplate: "app-vite",
9101
- overlay: "overlay-vercel",
9102
- deployConfig: "vercel-vercel",
9103
- functionsTemplate: "functions-vercel"
9104
- },
9105
- {
9106
- builder: "nextjs",
9107
- backend: "none",
9108
- baseTemplate: "app-next",
9109
- overlay: null,
9110
- deployConfig: null,
9111
- functionsTemplate: null
9112
- },
9113
- {
9114
- builder: "nextjs",
9115
- backend: "firebase",
9116
- baseTemplate: "app-next",
9117
- overlay: "overlay-firebase",
9118
- deployConfig: "firebase",
9119
- functionsTemplate: "functions-firebase"
9120
- },
9121
- {
9122
- builder: "nextjs",
9123
- backend: "supabase",
9124
- baseTemplate: "app-next",
9125
- overlay: "overlay-supabase",
9126
- deployConfig: "vercel-supabase",
9127
- functionsTemplate: "functions-supabase"
9128
- },
9129
- {
9130
- builder: "nextjs",
9131
- backend: "vercel",
9132
- baseTemplate: "app-next",
9133
- overlay: "overlay-vercel",
9134
- deployConfig: "vercel-vercel",
9135
- functionsTemplate: "functions-vercel"
9136
- },
9137
- {
9138
- builder: "expo",
9139
- backend: "none",
9140
- baseTemplate: "app-expo",
9141
- overlay: null,
9142
- deployConfig: null,
9143
- functionsTemplate: null
9144
- },
9145
- {
9146
- builder: "expo",
9147
- backend: "firebase",
9148
- baseTemplate: "app-expo",
9149
- overlay: "overlay-firebase",
9150
- deployConfig: null,
9151
- functionsTemplate: "functions-firebase"
9152
- },
9153
- {
9154
- builder: "expo",
9155
- backend: "supabase",
9156
- baseTemplate: "app-expo",
9157
- overlay: "overlay-supabase",
9158
- deployConfig: null,
9159
- functionsTemplate: "functions-supabase"
9160
- },
9161
- {
9162
- builder: "demo",
9163
- backend: "none",
9164
- baseTemplate: "app-demo",
9165
- overlay: null,
9166
- deployConfig: null,
9167
- functionsTemplate: null
9168
- }
9169
- ];
9170
- function comboKey(builder, backend) {
9171
- return `${builder}-${backend}`;
9110
+ function resolveDeployConfig(host, backend) {
9111
+ if (host === "none") return null;
9112
+ if (host === "firebase") return "firebase";
9113
+ if (backend === "supabase") return "vercel-supabase";
9114
+ return "vercel-vercel";
9172
9115
  }
9173
- var ROWS_BY_KEY = /* @__PURE__ */ new Map();
9174
- for (const row of MATRIX) {
9175
- ROWS_BY_KEY.set(comboKey(row.builder, row.backend), row);
9176
- }
9177
- function getScaffoldRow(builder, backend) {
9178
- const key = comboKey(builder, backend);
9179
- const row = ROWS_BY_KEY.get(key);
9180
- if (!row) {
9181
- throw new Error(
9182
- `Unsupported scaffold combo: ${key}. Supported: ${[...ROWS_BY_KEY.keys()].join(", ")}`
9183
- );
9184
- }
9185
- return row;
9116
+ function getScaffoldParts(builder, host, functions, backend) {
9117
+ const baseTemplate = builder === "nextjs" ? "app-next" : builder === "demo" ? "app-demo" : `app-${builder}`;
9118
+ return {
9119
+ builder,
9120
+ backend,
9121
+ baseTemplate,
9122
+ overlay: backend !== "none" ? `overlay-${backend}` : null,
9123
+ deployConfig: resolveDeployConfig(host, backend),
9124
+ functionsTemplate: functions !== "none" ? `functions-${functions}` : null
9125
+ };
9186
9126
  }
9187
9127
 
9188
9128
  // packages/tooling/src/scaffolding/create-app.ts
@@ -9222,11 +9162,15 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9222
9162
  input: askForInput
9223
9163
  });
9224
9164
  const requirements = aggregateRequirements(answers);
9225
- const defaultPlatform = answers.framework === "nextjs" ? "vercel" : "firebase";
9165
+ const framework = answers.framework || "vite";
9166
+ const host2 = answers.host || "none";
9167
+ const functions2 = answers.functions || "none";
9168
+ const backend2 = answers.backend || "none";
9226
9169
  appConfig = {
9227
- template: answers.framework || "vite",
9228
- needsBackend: answers.needsBackend || false,
9229
- backendPlatform: answers.needsBackend ? answers.backendPlatform || defaultPlatform : void 0,
9170
+ template: framework,
9171
+ host: host2,
9172
+ functions: functions2,
9173
+ backend: backend2,
9230
9174
  needsCRUD: true,
9231
9175
  // Always on
9232
9176
  selectedEntities: [],
@@ -9272,12 +9216,14 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
9272
9216
  s.start(`Creating app: ${appName}`);
9273
9217
  await ensureDir(appDir);
9274
9218
  const builder = appTemplate;
9275
- const backend = appConfig.needsBackend && appConfig.backendPlatform ? appConfig.backendPlatform : "none";
9276
- const row = getScaffoldRow(builder, backend);
9219
+ const host = appConfig.host ?? "none";
9220
+ const functions = appConfig.functions ?? "none";
9221
+ const backend = appConfig.backend ?? "none";
9222
+ const row = getScaffoldParts(builder, host, functions, backend);
9277
9223
  const templateDir = row.baseTemplate;
9278
9224
  const firebaseProjectId = (appConfig?.firebaseProjectId ?? "").trim() || appName.toLowerCase().replace(/\s+/g, "-");
9279
9225
  const firebaseRegion = appConfig?.firebaseRegion ?? "europe-west1";
9280
- const backendPlatform = appConfig.backendPlatform ?? "firebase";
9226
+ const backendPlatform = backend !== "none" ? backend : "firebase";
9281
9227
  const deployConfig = row.deployConfig;
9282
9228
  const replacements = {
9283
9229
  projectName: appName,
@@ -9627,12 +9573,11 @@ async function collectAppConfig(appName) {
9627
9573
  input: askForInput
9628
9574
  });
9629
9575
  const framework = answers.framework || "vite";
9630
- const needsBackend = answers.needsBackend || false;
9631
- const defaultPlatform = framework === "nextjs" ? "vercel" : "firebase";
9632
9576
  return {
9633
9577
  template: framework,
9634
- needsBackend,
9635
- backendPlatform: needsBackend ? answers.backendPlatform || defaultPlatform : void 0,
9578
+ host: answers.host || "none",
9579
+ functions: answers.functions || "none",
9580
+ backend: answers.backend || "none",
9636
9581
  needsCRUD: false,
9637
9582
  selectedEntities: [],
9638
9583
  userAuth: "none",
@@ -9779,7 +9724,8 @@ async function main(options) {
9779
9724
  Me(`Configuring "${trimmedName}"...`, "\u2699\uFE0F");
9780
9725
  const config = await collectAppConfig(trimmedName);
9781
9726
  appConfigs[trimmedName] = config;
9782
- if (config.needsBackend) anyAppNeedsBackend = true;
9727
+ if (config.backend !== "none" || config.functions !== "none")
9728
+ anyAppNeedsBackend = true;
9783
9729
  }
9784
9730
  let installDemoApp = await askForConfirmation(
9785
9731
  "Would you like to install the demo app? (component showcase)",
@@ -9855,8 +9801,9 @@ async function main(options) {
9855
9801
  log.warn(`Missing config for app "${appName}", using defaults`);
9856
9802
  appConfigs[appName] = {
9857
9803
  template: "vite",
9858
- needsBackend: false,
9859
- backendPlatform: void 0,
9804
+ host: "none",
9805
+ functions: "none",
9806
+ backend: "none",
9860
9807
  needsCRUD: false,
9861
9808
  selectedEntities: [],
9862
9809
  userAuth: "none",
@@ -9904,7 +9851,9 @@ async function main(options) {
9904
9851
  overwrite: true
9905
9852
  });
9906
9853
  const relativeMonorepoPath = executionMode === "development" ? calculateRelativePath(projectDirNormalized, monorepoRoot) : "";
9907
- const primaryPlatform = Object.values(appConfigs).find((c) => c.backendPlatform)?.backendPlatform ?? "firebase";
9854
+ const primaryPlatform = Object.values(appConfigs).find(
9855
+ (c) => c.backend !== "none"
9856
+ )?.backend ?? "firebase";
9908
9857
  const rootPackageJson = generatePackageJson(
9909
9858
  "consumer-root",
9910
9859
  executionMode,
@@ -7847,7 +7847,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
7847
7847
  function readdirSync2(dirPath, options) {
7848
7848
  return pathResolverInstance.readdirSync(dirPath, options);
7849
7849
  }
7850
- var pathResolverInstance, resolvePackage, normalizePath, pathExists, readSync, write, writeSync, remove, removeSync, statSync2, ensureDir, ensureDirSync, getRelativePathBetween, getDirname, joinPath;
7850
+ var pathResolverInstance, resolvePackage, normalizePath, pathExists, readSync, writeSync, removeSync, statSync2, ensureDirSync, getRelativePathBetween, getDirname, joinPath;
7851
7851
  var init_pathResolver = __esm({
7852
7852
  "packages/tooling/src/utils/pathResolver.ts"() {
7853
7853
  "use strict";
@@ -7860,12 +7860,9 @@ var init_pathResolver = __esm({
7860
7860
  };
7861
7861
  pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
7862
7862
  readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
7863
- write = async (filePath, content, options) => pathResolverInstance.write(filePath, content, options);
7864
7863
  writeSync = (filePath, content, options) => pathResolverInstance.writeSync(filePath, content, options);
7865
- remove = async (path) => pathResolverInstance.remove(path);
7866
7864
  removeSync = (path) => pathResolverInstance.removeSync(path);
7867
7865
  statSync2 = (filePath) => pathResolverInstance.statSync(filePath);
7868
- ensureDir = async (dirPath) => pathResolverInstance.ensureDir(dirPath);
7869
7866
  ensureDirSync = (dirPath) => pathResolverInstance.ensureDirSync(dirPath);
7870
7867
  getRelativePathBetween = (from, to) => {
7871
7868
  return normalizePath(relative2(from, to));
@@ -8181,21 +8178,21 @@ function getCLIInstallInstructions(tool) {
8181
8178
  ]
8182
8179
  },
8183
8180
  [CLI_TOOLS.YARN]: {
8184
- win32: ["npm install -g yarn", "Or: choco install yarn"],
8185
- darwin: ["npm install -g yarn", "Or: brew install yarn"],
8186
- linux: ["npm install -g yarn", "Or check your package manager"]
8181
+ win32: ["bun install -g yarn", "Or: choco install yarn"],
8182
+ darwin: ["bun install -g yarn", "Or: brew install yarn"],
8183
+ linux: ["bun install -g yarn", "Or check your package manager"]
8187
8184
  },
8188
8185
  [CLI_TOOLS.FIREBASE]: {
8189
8186
  win32: [
8190
- "npm install -g firebase-tools",
8187
+ "bun install -g firebase-tools",
8191
8188
  "Or download standalone binary: https://firebase.google.com/docs/cli#windows-standalone-binary"
8192
8189
  ],
8193
8190
  darwin: [
8194
- "npm install -g firebase-tools",
8191
+ "bun install -g firebase-tools",
8195
8192
  "Or: brew install firebase-cli"
8196
8193
  ],
8197
8194
  linux: [
8198
- "npm install -g firebase-tools",
8195
+ "bun install -g firebase-tools",
8199
8196
  "Or check your package manager (dnf, apt, pacman, etc.)"
8200
8197
  ]
8201
8198
  },
@@ -8212,25 +8209,25 @@ function getCLIInstallInstructions(tool) {
8212
8209
  ]
8213
8210
  },
8214
8211
  [CLI_TOOLS.VERCEL]: {
8215
- win32: ["npm install -g vercel", "Or: npx vercel (no install)"],
8212
+ win32: ["bun install -g vercel", "Or: bunx vercel (no install)"],
8216
8213
  darwin: [
8217
- "npm install -g vercel",
8214
+ "bun install -g vercel",
8218
8215
  "Or: brew install vercel",
8219
- "Or: npx vercel"
8216
+ "Or: bunx vercel"
8220
8217
  ],
8221
- linux: ["npm install -g vercel", "Or: npx vercel"]
8218
+ linux: ["bun install -g vercel", "Or: bunx vercel"]
8222
8219
  },
8223
8220
  [CLI_TOOLS.SENTRY_CLI]: {
8224
8221
  win32: [
8225
- "npm install -g @sentry/cli",
8222
+ "bun install -g @sentry/cli",
8226
8223
  "Or download from: https://github.com/getsentry/sentry-cli/releases"
8227
8224
  ],
8228
8225
  darwin: [
8229
- "npm install -g @sentry/cli",
8226
+ "bun install -g @sentry/cli",
8230
8227
  "Or: brew install getsentry/tools/sentry-cli"
8231
8228
  ],
8232
8229
  linux: [
8233
- "npm install -g @sentry/cli",
8230
+ "bun install -g @sentry/cli",
8234
8231
  "Or: curl -sL https://sentry.io/get-cli/ | bash"
8235
8232
  ]
8236
8233
  },
@@ -8259,9 +8256,9 @@ function getCLIInstallInstructions(tool) {
8259
8256
  ]
8260
8257
  },
8261
8258
  [CLI_TOOLS.TSX]: {
8262
- win32: ["npm install -g tsx"],
8263
- darwin: ["npm install -g tsx"],
8264
- linux: ["npm install -g tsx"]
8259
+ win32: ["bun install -g tsx"],
8260
+ darwin: ["bun install -g tsx"],
8261
+ linux: ["bun install -g tsx"]
8265
8262
  }
8266
8263
  };
8267
8264
  const platformInstructions = instructions[tool]?.[platform] || instructions[tool]?.linux || [];
@@ -8356,14 +8353,27 @@ function readEnvVar(filePath, varName) {
8356
8353
  }
8357
8354
  return null;
8358
8355
  }
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");
8356
+ function resolveVercelVar(appDir, varName) {
8357
+ if (process.env[varName]) return process.env[varName];
8358
+ const fromLocal = readEnvVar(joinPath(appDir, ".env.local"), varName);
8364
8359
  if (fromLocal) return fromLocal;
8360
+ const fromEnv = readEnvVar(joinPath(appDir, ".env"), varName);
8361
+ if (fromEnv) return fromEnv;
8365
8362
  return null;
8366
8363
  }
8364
+ function resolveVercelCredentials(appDir) {
8365
+ const token = resolveVercelVar(appDir, "VERCEL_TOKEN");
8366
+ const orgId = resolveVercelVar(appDir, "VERCEL_ORG_ID");
8367
+ const projectId = resolveVercelVar(appDir, "VERCEL_PROJECT_ID");
8368
+ const missing = [];
8369
+ if (!token) missing.push("VERCEL_TOKEN");
8370
+ if (!orgId) missing.push("VERCEL_ORG_ID");
8371
+ if (!projectId) missing.push("VERCEL_PROJECT_ID");
8372
+ if (missing.length > 0) return { missing };
8373
+ return {
8374
+ credentials: { token, orgId, projectId }
8375
+ };
8376
+ }
8367
8377
  var init_vercel_token = __esm({
8368
8378
  "packages/tooling/src/cli/setup/vercel-token.ts"() {
8369
8379
  "use strict";
@@ -15943,10 +15953,7 @@ async function setFirebaseSecret(key, value, projectId, dryRun = false, cwd) {
15943
15953
  }
15944
15954
  try {
15945
15955
  log.info(`Setting Firebase secret: ${key} (project: ${finalProjectId})`);
15946
- const tempDir = joinPath(process.cwd(), ".tmp");
15947
- await ensureDir(tempDir);
15948
- const tempFile = joinPath(tempDir, `secret-${key}-${Date.now()}.txt`);
15949
- await write(tempFile, value);
15956
+ const tempFile = "";
15950
15957
  try {
15951
15958
  const args = ["functions:secrets:set", key, "--project", finalProjectId];
15952
15959
  const firebaseCmd = process.platform === "win32" ? "firebase.cmd" : "firebase";
@@ -16021,9 +16028,6 @@ ${errorOutput}`
16021
16028
  }
16022
16029
  log.success(`Firebase secret ${key} set successfully`);
16023
16030
  } finally {
16024
- if (pathExists(tempFile)) {
16025
- await remove(tempFile);
16026
- }
16027
16031
  }
16028
16032
  } catch (err) {
16029
16033
  log.error(`Failed to set Firebase secret ${key}:`, err);
@@ -16601,33 +16605,39 @@ init_cli_output();
16601
16605
  init_vercel_token();
16602
16606
  import { spawnSync as spawnSync3 } from "node:child_process";
16603
16607
  async function deployVercelFrontend(appDir, _config) {
16604
- const s = Y2();
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);
16608
+ const result = resolveVercelCredentials(appDir);
16609
+ if (result.missing) {
16610
+ throw new Error(
16611
+ `Missing Vercel credentials in .env.local: ${result.missing.join(", ")}
16612
+ Add them to apps/<app>/.env.local \u2014 see guides/dndev/SETUP_VERCEL.md`
16613
+ );
16613
16614
  }
16614
- try {
16615
- const result = spawnSync3("bunx", args, {
16615
+ const { token, orgId, projectId } = result.credentials;
16616
+ log.debug("Using Vercel credentials from .env (token-based auth)");
16617
+ log.info("Deploying to Vercel...");
16618
+ const deployResult = spawnSync3(
16619
+ "bunx",
16620
+ ["vercel", "deploy", "--prod", "--yes", "--token", token],
16621
+ {
16616
16622
  cwd: appDir,
16617
- stdio: "pipe",
16618
- encoding: "utf-8"
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
- );
16623
+ // stdout piped to capture deployment URL, stderr inherits for progress
16624
+ stdio: ["inherit", "pipe", "inherit"],
16625
+ encoding: "utf-8",
16626
+ env: {
16627
+ ...process.env,
16628
+ VERCEL_ORG_ID: orgId,
16629
+ VERCEL_PROJECT_ID: projectId
16630
+ }
16626
16631
  }
16627
- s.stop("Frontend deployed to Vercel");
16628
- } catch (err) {
16629
- s.stop("Vercel deployment failed");
16630
- throw err;
16632
+ );
16633
+ if (deployResult.status !== 0) {
16634
+ throw new Error(`vercel deploy exited with code ${deployResult.status}`);
16635
+ }
16636
+ const deployUrl = deployResult.stdout?.trim();
16637
+ if (deployUrl) {
16638
+ log.success(`Production: ${deployUrl}`);
16639
+ } else {
16640
+ log.success("Frontend deployed to Vercel");
16631
16641
  }
16632
16642
  }
16633
16643
 
@@ -16989,7 +16999,7 @@ async function deployFunctions(appDir, serviceAccountPath, projectId, config) {
16989
16999
 
16990
17000
  To fix this, run:
16991
17001
  cd ${functionsDir}
16992
- npm install --production`,
17002
+ bun install --production`,
16993
17003
  "file-not-found",
16994
17004
  { context: { missingPackages, functionsDir } }
16995
17005
  );
@@ -17354,7 +17364,19 @@ function detectProvider(appDir) {
17354
17364
  const supabaseFunctionsDir = joinPath(supabaseDir, "functions");
17355
17365
  const supabaseMigrationsDir = joinPath(supabaseDir, "migrations");
17356
17366
  const hasFirebase = pathExists(firebaseJsonPath);
17357
- const hasSupabase = pathExists(supabaseDir) || pathExists(supabaseConfigPath);
17367
+ let hasSupabase = pathExists(supabaseDir) || pathExists(supabaseConfigPath);
17368
+ if (!hasSupabase) {
17369
+ try {
17370
+ const envPath = joinPath(appDir, ".env");
17371
+ if (pathExists(envPath)) {
17372
+ const envContent = readSync(envPath);
17373
+ if (envContent.match(/VITE_SUPABASE_URL=.+/)) {
17374
+ hasSupabase = true;
17375
+ }
17376
+ }
17377
+ } catch {
17378
+ }
17379
+ }
17358
17380
  let provider = "unknown";
17359
17381
  if (hasFirebase && hasSupabase) {
17360
17382
  provider = "both";
@@ -17718,7 +17740,7 @@ async function main2(options = {}) {
17718
17740
  if (shouldDeployVercelFrontend) {
17719
17741
  requireCLI(
17720
17742
  CLI_TOOLS.VERCEL,
17721
- "Vercel CLI is required to deploy the frontend.\nInstall: npm i -g vercel or use npx vercel"
17743
+ "Vercel CLI is required to deploy the frontend.\nInstall: bun install -g vercel"
17722
17744
  );
17723
17745
  }
17724
17746
  if (shouldDeployFirebaseFrontend && serviceAccountPath && config.project) {