@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
package/dist/bin/dndev.js CHANGED
@@ -14,6 +14,416 @@ var __export = (target, all) => {
14
14
  __defProp(target, name, { get: all[name], enumerable: true });
15
15
  };
16
16
 
17
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
18
+ var init_utils = __esm({
19
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
20
+ init_utils2();
21
+ }
22
+ });
23
+
24
+ // node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
25
+ var EMOJI_RE, MODIFIER_RE;
26
+ var init_dist = __esm({
27
+ "node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
28
+ init_utils2();
29
+ init_utils();
30
+ EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
31
+ MODIFIER_RE = new RegExp("\\p{M}+", "gu");
32
+ }
33
+ });
34
+
35
+ // node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
36
+ var init_dist2 = __esm({
37
+ "node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
38
+ init_utils2();
39
+ init_dist();
40
+ }
41
+ });
42
+
43
+ // node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
44
+ var ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_ESCAPE_LINK, GROUP_REGEX;
45
+ var init_main = __esm({
46
+ "node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
47
+ init_utils2();
48
+ init_dist2();
49
+ ANSI_ESCAPE_BELL = "\x07";
50
+ ANSI_CSI = "[";
51
+ ANSI_OSC = "]";
52
+ ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
53
+ GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
54
+ }
55
+ });
56
+
57
+ // node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
58
+ var ESC, CSI, cursor, erase, clear;
59
+ var init_dist3 = __esm({
60
+ "node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js"() {
61
+ init_utils2();
62
+ ESC = "\x1B";
63
+ CSI = `${ESC}[`;
64
+ cursor = {
65
+ to(x, y) {
66
+ if (!y)
67
+ return `${CSI}${x + 1}G`;
68
+ return `${CSI}${y + 1};${x + 1}H`;
69
+ },
70
+ move(x, y) {
71
+ let ret = "";
72
+ if (x < 0)
73
+ ret += `${CSI}${-x}D`;
74
+ else if (x > 0)
75
+ ret += `${CSI}${x}C`;
76
+ if (y < 0)
77
+ ret += `${CSI}${-y}A`;
78
+ else if (y > 0)
79
+ ret += `${CSI}${y}B`;
80
+ return ret;
81
+ },
82
+ up: (count = 1) => `${CSI}${count}A`,
83
+ down: (count = 1) => `${CSI}${count}B`,
84
+ forward: (count = 1) => `${CSI}${count}C`,
85
+ backward: (count = 1) => `${CSI}${count}D`,
86
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
87
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
88
+ left: `${CSI}G`,
89
+ hide: `${CSI}?25l`,
90
+ show: `${CSI}?25h`,
91
+ save: `${ESC}7`,
92
+ restore: `${ESC}8`
93
+ };
94
+ erase = {
95
+ screen: `${CSI}2J`,
96
+ up: (count = 1) => `${CSI}1J`.repeat(count),
97
+ down: (count = 1) => `${CSI}J`.repeat(count),
98
+ line: `${CSI}2K`,
99
+ lineEnd: `${CSI}K`,
100
+ lineStart: `${CSI}1K`,
101
+ lines(count) {
102
+ let clear2 = "";
103
+ for (let i2 = 0; i2 < count; i2++)
104
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
105
+ if (count)
106
+ clear2 += cursor.left;
107
+ return clear2;
108
+ }
109
+ };
110
+ clear = {
111
+ screen: `${ESC}c`
112
+ };
113
+ }
114
+ });
115
+
116
+ // node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
117
+ var a$1, t, settings, R;
118
+ var init_dist4 = __esm({
119
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
120
+ init_utils2();
121
+ init_main();
122
+ init_dist3();
123
+ init_dist2();
124
+ a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
125
+ t = [
126
+ "January",
127
+ "February",
128
+ "March",
129
+ "April",
130
+ "May",
131
+ "June",
132
+ "July",
133
+ "August",
134
+ "September",
135
+ "October",
136
+ "November",
137
+ "December"
138
+ ];
139
+ settings = {
140
+ actions: new Set(a$1),
141
+ aliases: /* @__PURE__ */ new Map([
142
+ // vim support
143
+ ["k", "up"],
144
+ ["j", "down"],
145
+ ["h", "left"],
146
+ ["l", "right"],
147
+ ["", "cancel"],
148
+ // opinionated defaults!
149
+ ["escape", "cancel"]
150
+ ]),
151
+ messages: {
152
+ cancel: "Canceled",
153
+ error: "Something went wrong"
154
+ },
155
+ withGuide: true,
156
+ accessible: void 0,
157
+ date: {
158
+ monthNames: [...t],
159
+ messages: {
160
+ required: "Please enter a valid date",
161
+ invalidMonth: "There are only 12 months in a year",
162
+ invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
163
+ afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
164
+ beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
165
+ }
166
+ }
167
+ };
168
+ R = globalThis.process.platform.startsWith("win");
169
+ }
170
+ });
171
+
172
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
173
+ import { styleText, stripVTControlCharacters } from "node:util";
174
+ import process$1 from "node:process";
175
+ function isUnicodeSupported() {
176
+ if (process$1.platform !== "win32") {
177
+ return process$1.env.TERM !== "linux";
178
+ }
179
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
180
+ }
181
+ var unicode, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, u2, SELECT_INSTRUCTIONS, i;
182
+ var init_dist5 = __esm({
183
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
184
+ init_utils2();
185
+ init_dist4();
186
+ init_dist4();
187
+ init_main();
188
+ init_dist2();
189
+ init_dist3();
190
+ unicode = isUnicodeSupported();
191
+ unicodeOr = (e, o) => unicode ? e : o;
192
+ S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
193
+ S_STEP_CANCEL = unicodeOr("\u25A0", "x");
194
+ S_STEP_ERROR = unicodeOr("\u25B2", "x");
195
+ S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
196
+ S_BAR_START = unicodeOr("\u250C", "T");
197
+ S_BAR = unicodeOr("\u2502", "|");
198
+ S_BAR_END = unicodeOr("\u2514", "\u2014");
199
+ S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
200
+ S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
201
+ S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
202
+ S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
203
+ S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
204
+ S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
205
+ S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
206
+ S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
207
+ S_BAR_H = unicodeOr("\u2500", "-");
208
+ S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
209
+ S_CONNECT_LEFT = unicodeOr("\u251C", "+");
210
+ S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
211
+ S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
212
+ S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
213
+ S_INFO = unicodeOr("\u25CF", "\u2022");
214
+ S_SUCCESS = unicodeOr("\u25C6", "*");
215
+ S_WARN = unicodeOr("\u25B2", "!");
216
+ S_ERROR = unicodeOr("\u25A0", "x");
217
+ MULTISELECT_INSTRUCTIONS = [
218
+ `${styleText("dim", "\u2191/\u2193")} to navigate`,
219
+ `${styleText("dim", "Space:")} select`,
220
+ `${styleText("dim", "Enter:")} confirm`
221
+ ];
222
+ log = {
223
+ message: (s = [], {
224
+ symbol: e = styleText("gray", S_BAR),
225
+ secondarySymbol: r2 = styleText("gray", S_BAR),
226
+ output: m = process.stdout,
227
+ spacing: l = 1,
228
+ withGuide: c2
229
+ } = {}) => {
230
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
231
+ for (let i2 = 0; i2 < l; i2++)
232
+ t2.push(f);
233
+ const g = Array.isArray(s) ? s : s.split(`
234
+ `);
235
+ if (g.length > 0) {
236
+ const [i2, ...y] = g;
237
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
238
+ for (const p of y)
239
+ p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
240
+ }
241
+ m.write(`${t2.join(`
242
+ `)}
243
+ `);
244
+ },
245
+ info: (s, e) => {
246
+ log.message(s, { ...e, symbol: styleText("blue", S_INFO) });
247
+ },
248
+ success: (s, e) => {
249
+ log.message(s, { ...e, symbol: styleText("green", S_SUCCESS) });
250
+ },
251
+ step: (s, e) => {
252
+ log.message(s, { ...e, symbol: styleText("green", S_STEP_SUBMIT) });
253
+ },
254
+ warn: (s, e) => {
255
+ log.message(s, { ...e, symbol: styleText("yellow", S_WARN) });
256
+ },
257
+ /** alias for `log.warn()`. */
258
+ warning: (s, e) => {
259
+ log.warn(s, e);
260
+ },
261
+ error: (s, e) => {
262
+ log.message(s, { ...e, symbol: styleText("red", S_ERROR) });
263
+ }
264
+ };
265
+ u2 = {
266
+ light: unicodeOr("\u2500", "-"),
267
+ heavy: unicodeOr("\u2501", "="),
268
+ block: unicodeOr("\u2588", "#")
269
+ };
270
+ SELECT_INSTRUCTIONS = [
271
+ `${styleText("dim", "\u2191/\u2193")} to navigate`,
272
+ `${styleText("dim", "Enter:")} confirm`
273
+ ];
274
+ i = `${styleText("gray", S_BAR)} `;
275
+ }
276
+ });
277
+
278
+ // packages/tooling/src/utils/cli-output.ts
279
+ function supportsColor() {
280
+ if (process.env.NO_COLOR) return false;
281
+ if (process.platform === "win32") {
282
+ return true;
283
+ }
284
+ return process.stdout.isTTY === true;
285
+ }
286
+ function colorize(text, color) {
287
+ if (!supportsColor()) return text;
288
+ return `${color}${text}${colors.reset}`;
289
+ }
290
+ function setLogLevel(level) {
291
+ currentLogLevel = level;
292
+ }
293
+ function stringify(value) {
294
+ if (typeof value === "string") return value;
295
+ if (value instanceof Error) return value.stack || value.message;
296
+ try {
297
+ if (typeof value === "object" && value !== null) {
298
+ const seen = /* @__PURE__ */ new WeakSet();
299
+ return JSON.stringify(
300
+ value,
301
+ (key, val) => {
302
+ if (typeof val === "object" && val !== null) {
303
+ if (seen.has(val)) {
304
+ return "[Circular]";
305
+ }
306
+ seen.add(val);
307
+ }
308
+ return val;
309
+ },
310
+ 2
311
+ );
312
+ }
313
+ return JSON.stringify(value, null, 2);
314
+ } catch (err) {
315
+ return `[Unstringifiable value: ${typeof value}]`;
316
+ }
317
+ }
318
+ function formatMessage(...args2) {
319
+ return args2.map(stringify).join(" ");
320
+ }
321
+ var colors, currentLogLevel, log2, error, warn, info, success;
322
+ var init_cli_output = __esm({
323
+ "packages/tooling/src/utils/cli-output.ts"() {
324
+ "use strict";
325
+ init_utils2();
326
+ init_dist5();
327
+ init_dist5();
328
+ colors = {
329
+ reset: "\x1B[0m",
330
+ // Success (green)
331
+ green: "\x1B[32m",
332
+ brightGreen: "\x1B[92m",
333
+ // Error (red)
334
+ red: "\x1B[31m",
335
+ brightRed: "\x1B[91m",
336
+ // Warning (yellow)
337
+ yellow: "\x1B[33m",
338
+ brightYellow: "\x1B[93m",
339
+ // Info (blue/cyan)
340
+ blue: "\x1B[34m",
341
+ cyan: "\x1B[36m",
342
+ brightCyan: "\x1B[96m",
343
+ // Other
344
+ gray: "\x1B[90m",
345
+ white: "\x1B[37m"
346
+ };
347
+ currentLogLevel = 1 /* Normal */;
348
+ if (process.env.DNDEV_LOG_LEVEL) {
349
+ const envLevel = parseInt(process.env.DNDEV_LOG_LEVEL, 10);
350
+ if (!isNaN(envLevel) && envLevel >= 0 && envLevel <= 3) {
351
+ currentLogLevel = envLevel;
352
+ }
353
+ }
354
+ log2 = {
355
+ /**
356
+ * Logs an error message (always shows unless Quiet level)
357
+ * Uses clack's log.error + explicit red color
358
+ */
359
+ error(...args2) {
360
+ if (currentLogLevel < 0 /* Quiet */) return;
361
+ const message = formatMessage(...args2);
362
+ log.error(colorize(message, colors.brightRed));
363
+ },
364
+ /**
365
+ * Logs a warning message (shows at Normal level and above)
366
+ * Uses clack's log.warn + explicit yellow color
367
+ */
368
+ warn(...args2) {
369
+ if (currentLogLevel < 1 /* Normal */) return;
370
+ const message = formatMessage(...args2);
371
+ log.warn(colorize(message, colors.brightYellow));
372
+ },
373
+ /**
374
+ * Logs an info message (shows at Normal level and above)
375
+ * Uses clack's log.info + explicit cyan color
376
+ */
377
+ info(...args2) {
378
+ if (currentLogLevel < 1 /* Normal */) return;
379
+ const message = formatMessage(...args2);
380
+ log.info(colorize(message, colors.brightCyan));
381
+ },
382
+ /**
383
+ * Logs a success message (shows at Normal level and above)
384
+ * Uses clack's log.success + explicit green color
385
+ */
386
+ success(...args2) {
387
+ if (currentLogLevel < 1 /* Normal */) return;
388
+ const message = formatMessage(...args2);
389
+ log.success(colorize(message, colors.brightGreen));
390
+ },
391
+ /**
392
+ * Logs a debug message (only shows at Verbose level and above)
393
+ * Uses clack.log.message for consistent output
394
+ */
395
+ debug(...args2) {
396
+ if (currentLogLevel < 2 /* Verbose */) return;
397
+ const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
398
+ log.message(
399
+ colorize(
400
+ `[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args2)}`,
401
+ colors.gray
402
+ )
403
+ );
404
+ },
405
+ /**
406
+ * Logs a trace message (only shows at Debug level)
407
+ * Uses clack.log.message for consistent output
408
+ */
409
+ trace(...args2) {
410
+ if (currentLogLevel < 3 /* Debug */) return;
411
+ const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
412
+ log.message(
413
+ colorize(
414
+ `[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args2)}`,
415
+ colors.gray
416
+ )
417
+ );
418
+ }
419
+ };
420
+ error = log2.error.bind(log2);
421
+ warn = log2.warn.bind(log2);
422
+ info = log2.info.bind(log2);
423
+ success = log2.success.bind(log2);
424
+ }
425
+ });
426
+
17
427
  // packages/tooling/src/bundler/utils.ts
18
428
  import { Buffer as Buffer2 } from "node:buffer";
19
429
  import { createRequire } from "node:module";
@@ -21,7 +431,7 @@ import { dirname, resolve } from "node:path";
21
431
  import process from "node:process";
22
432
  import { fileURLToPath } from "node:url";
23
433
  var require2, __filename, __dirname;
24
- var init_utils = __esm({
434
+ var init_utils2 = __esm({
25
435
  "packages/tooling/src/bundler/utils.ts"() {
26
436
  "use strict";
27
437
  require2 = createRequire(import.meta.url);
@@ -120,6 +530,7 @@ Examples:
120
530
  ${cliName} create-app my-app Create 'my-app' with defaults (vite, frontend-only)
121
531
  ${cliName} create-app my-app --builder next --host vercel Next.js + Vercel hosting
122
532
  ${cliName} create-app my-app --functions firebase --backend firebase Full Firebase stack
533
+ ${cliName} create-app my-app --functions firebase --backend firebase --billing + Stripe billing functions
123
534
  ${cliName} bundle Build all packages
124
535
  ${cliName} lint --fix Lint and auto-fix issues
125
536
  ${cliName} wai Output WAI-WAY activation prompt
@@ -134,6 +545,7 @@ Examples:
134
545
  ${cliName} create-app my-app Create 'my-app' with defaults (vite, frontend-only)
135
546
  ${cliName} create-app my-app --builder next --host vercel Next.js + Vercel hosting
136
547
  ${cliName} create-app my-app --functions firebase --backend firebase Full Firebase stack
548
+ ${cliName} create-app my-app --functions firebase --backend firebase --billing + Stripe billing functions
137
549
  ${cliName} create-app my-app --backend supabase --project my-fb-id Supabase + custom project
138
550
  ${cliName} dev Start dev server
139
551
  ${cliName} dev:web Start dev server for 'web' app
@@ -151,7 +563,7 @@ ${footer}
151
563
  var COMMAND_REGISTRY;
152
564
  var init_command_registry = __esm({
153
565
  "packages/tooling/src/cli/command-registry.ts"() {
154
- init_utils();
566
+ init_utils2();
155
567
  COMMAND_REGISTRY = [
156
568
  // ---------------------------------------------------------------------------
157
569
  // Project
@@ -188,6 +600,14 @@ var init_command_registry = __esm({
188
600
  {
189
601
  flags: "--backend <backend>",
190
602
  description: "BaaS: none, firebase, or supabase (default: none)"
603
+ },
604
+ {
605
+ flags: "--billing",
606
+ description: "Billing (Stripe): scaffold the billing functions (default: off; needs --functions or --backend)"
607
+ },
608
+ {
609
+ flags: "--oauth",
610
+ description: "OAuth API connections (third-party APIs via @donotdev/oauth, not social sign-in): scaffold the OAuth functions (default: off; needs --functions or --backend)"
191
611
  }
192
612
  ],
193
613
  loader: "../scaffolding/create-app.ts",
@@ -536,19 +956,33 @@ var init_command_registry = __esm({
536
956
  appCommand: true,
537
957
  options: [
538
958
  { flags: "-p, --project <project>", description: "Project ID" },
539
- { flags: "--skip-build", description: "skip build step" },
959
+ {
960
+ flags: "--skip-build",
961
+ description: "Reuse existing builds (dist/, out/, .vercel/output, functions, edge .build/). Default: build"
962
+ },
540
963
  {
541
964
  flags: "--from-git",
542
965
  description: "Next.js on Vercel: let Vercel build from linked Git (default: local vercel build + upload)"
543
966
  },
544
- { flags: "--force", description: "Force deployment / cleanup policy" },
967
+ {
968
+ flags: "--force",
969
+ description: "Delete deployed Firebase functions missing from the local source (default: off; the deploy aborts and names them)"
970
+ },
545
971
  {
546
972
  flags: "--staging",
547
973
  description: "Deploy to staging (uses .env.staging and staging credentials)"
548
974
  },
549
975
  {
550
976
  flags: "--scope <scope>",
551
- description: "Deploy scope: functions, frontend, or both. Skips interactive menu (headless)"
977
+ description: "What to deploy: frontend, functions, rules, both or all. Implies --yes"
978
+ },
979
+ {
980
+ flags: "-y, --yes",
981
+ description: "Non-interactive: never prompt; a missing required value fails, naming its flag (also when stdin is not a TTY)"
982
+ },
983
+ {
984
+ flags: "--no-sync-secrets",
985
+ description: "Skip pushing the secrets functions.yaml binds to Firebase Secret Manager (default: push changed values)"
552
986
  }
553
987
  ],
554
988
  loader: "../apps/deploy.ts",
@@ -566,15 +1000,29 @@ var init_command_registry = __esm({
566
1000
  flags: "-p, --project <project>",
567
1001
  description: "Project ID (overrides default)"
568
1002
  },
569
- { flags: "--skip-build", description: "skip build step" },
1003
+ {
1004
+ flags: "--skip-build",
1005
+ description: "Reuse existing builds (dist/, out/, .vercel/output, functions, edge .build/). Default: build"
1006
+ },
570
1007
  {
571
1008
  flags: "--from-git",
572
1009
  description: "Next.js on Vercel: let Vercel build from linked Git (default: local vercel build + upload)"
573
1010
  },
574
- { flags: "--force", description: "Force deployment / cleanup policy" },
1011
+ {
1012
+ flags: "--force",
1013
+ description: "Delete deployed Firebase functions missing from the local source (default: off; the deploy aborts and names them)"
1014
+ },
575
1015
  {
576
1016
  flags: "--scope <scope>",
577
- description: "Deploy scope: functions, frontend, or both. Skips interactive menu (headless)"
1017
+ description: "What to deploy: frontend, functions, rules, both or all. Implies --yes"
1018
+ },
1019
+ {
1020
+ flags: "-y, --yes",
1021
+ description: "Non-interactive: never prompt; a missing required value fails, naming its flag (also when stdin is not a TTY)"
1022
+ },
1023
+ {
1024
+ flags: "--no-sync-secrets",
1025
+ description: "Skip pushing the secrets functions.yaml binds to Firebase Secret Manager (default: push changed values)"
578
1026
  }
579
1027
  ],
580
1028
  loader: "../apps/deploy.ts"
@@ -902,16 +1350,25 @@ var init_command_registry = __esm({
902
1350
  loader: "../quality/test-e2e.ts"
903
1351
  },
904
1352
  {
905
- name: "test:uat [app]",
906
- description: "Run an app's Playwright e2e suite on a throwaway Supabase stack (own project_id, ports and volumes; torn down afterwards). Works in consumer projects and the monorepo; reads e2e/uat.json",
1353
+ name: "test:uat [apps...]",
1354
+ description: "Run apps' Playwright e2e suites on one throwaway Supabase stack (own project_id, ports and volumes; torn down afterwards), from migrations or a read-only copy of live. Works in consumer projects and the monorepo; reads e2e/uat.json",
907
1355
  category: "other",
908
1356
  appCommand: true,
909
1357
  options: [
910
- { flags: "-a, --app <app>", description: "app to test (same as the positional)" },
1358
+ { flags: "-a, --app <app>", description: "app to test (same as one positional)" },
911
1359
  {
912
1360
  flags: "--keep",
913
1361
  description: "keep the throwaway stack and workdir after the run"
914
1362
  },
1363
+ {
1364
+ flags: "--from <source>",
1365
+ description: "database start: migrations (empty database + every migration) or live (read-only copy of database.projectRef + the migrations live has not applied); default: database.from in e2e/uat.json, else migrations"
1366
+ },
1367
+ {
1368
+ flags: "--serve",
1369
+ description: "after the tests, keep the stack and app servers up for manual testing until Ctrl-C / SIGTERM"
1370
+ },
1371
+ { flags: "--skip-tests", description: "do not run Playwright (with --serve or --keep)" },
915
1372
  { flags: "--headed", description: "run tests in headed browser" },
916
1373
  { flags: "--ui", description: "open Playwright UI mode" },
917
1374
  { flags: "--grep <pattern>", description: "only run tests matching the pattern" }
@@ -977,22 +1434,48 @@ var init_command_registry = __esm({
977
1434
  });
978
1435
 
979
1436
  // packages/cli/src/bin/dndev.mjs
980
- init_utils();
1437
+ init_utils2();
981
1438
  init_command_registry();
982
1439
  import { Command } from "commander";
983
1440
 
984
1441
  // packages/tooling/src/cli/entry-helpers.ts
985
- init_utils();
986
- function baseName2(commanderName) {
987
- return commanderName.split(" ")[0] ?? commanderName;
1442
+ init_utils2();
1443
+
1444
+ // packages/tooling/src/utils/cli-args.ts
1445
+ init_utils2();
1446
+ init_cli_output();
1447
+ init_command_registry();
1448
+ var APP_COMMANDS = getAppCommandNames();
1449
+ function isDryRun() {
1450
+ return Boolean(
1451
+ process.env.DRY_RUN === "true" || process.env.DRY_RUN === "1" || process.argv.includes("--dry-run") || process.argv.includes("--dry")
1452
+ );
1453
+ }
1454
+ function applyLogLevel(flags) {
1455
+ if (flags.quiet) {
1456
+ setLogLevel(0 /* Quiet */);
1457
+ } else if (flags.debug) {
1458
+ setLogLevel(3 /* Debug */);
1459
+ } else if (flags.verbose) {
1460
+ setLogLevel(2 /* Verbose */);
1461
+ } else {
1462
+ setLogLevel(1 /* Normal */);
1463
+ }
988
1464
  }
989
1465
  function extractCommonOptions(commanderOptions) {
990
- const quiet = process.env.QUIET === "true" || process.env.QUIET === "1" || commanderOptions.quiet || false;
991
- const debug = process.env.DEBUG === "true" || process.env.DEBUG === "1" || commanderOptions.debug || false;
992
- const verbose = !debug && (process.env.VERBOSE === "true" || process.env.VERBOSE === "1" || commanderOptions.verbose || false);
993
- const dryRun = process.env.DRY_RUN === "true" || process.env.DRY_RUN === "1" || commanderOptions.dryRun || commanderOptions.dry || false;
1466
+ const fromEnv = (name) => process.env[name] === "true" || process.env[name] === "1";
1467
+ const quiet = fromEnv("QUIET") || Boolean(commanderOptions.quiet);
1468
+ const debug = fromEnv("DEBUG") || Boolean(commanderOptions.debug);
1469
+ const verbose = !debug && (fromEnv("VERBOSE") || Boolean(commanderOptions.verbose));
1470
+ const dryRun = Boolean(commanderOptions.dryRun) || Boolean(commanderOptions.dry) || isDryRun();
1471
+ applyLogLevel({ quiet, debug, verbose });
994
1472
  return { dryRun, quiet, verbose, debug };
995
1473
  }
1474
+
1475
+ // packages/tooling/src/cli/entry-helpers.ts
1476
+ function baseName2(commanderName) {
1477
+ return commanderName.split(" ")[0] ?? commanderName;
1478
+ }
996
1479
  function addCommonOptions(cmd) {
997
1480
  cmd.option("--dry, --dry-run", "Preview changes without applying").option("--verbose", "Verbose output").option("--debug", "Debug output").option("-q, --quiet", "Quiet output (errors only)");
998
1481
  }
@@ -1000,7 +1483,7 @@ function registerCommand(program2, def, action) {
1000
1483
  const cmd = program2.command(def.name);
1001
1484
  if (def.alias) {
1002
1485
  const aliases = Array.isArray(def.alias) ? def.alias : [def.alias];
1003
- for (const a of aliases) cmd.alias(a);
1486
+ for (const a2 of aliases) cmd.alias(a2);
1004
1487
  }
1005
1488
  cmd.description(def.description);
1006
1489
  if (def.options) {
@@ -1019,7 +1502,7 @@ function registerCommand(program2, def, action) {
1019
1502
  }
1020
1503
 
1021
1504
  // packages/cli/src/bin/dndev.mjs
1022
- var CLI_VERSION = true ? "0.3.0" : "0.0.0";
1505
+ var CLI_VERSION = true ? "0.3.2" : "0.0.0";
1023
1506
  var args = process.argv.slice(2);
1024
1507
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-v")) {
1025
1508
  console.log(CLI_VERSION);
@@ -1040,9 +1523,9 @@ async function runAppCommand(commandPath, app, commonOptions) {
1040
1523
  try {
1041
1524
  const { main } = await import(commandPath);
1042
1525
  process.exitCode = await main(commonOptions);
1043
- } catch (error) {
1044
- console.error(`Command failed: ${error.message}`);
1045
- process.exitCode = error.context?.exitCode || 1;
1526
+ } catch (error2) {
1527
+ console.error(`Command failed: ${error2.message}`);
1528
+ process.exitCode = error2.context?.exitCode || 1;
1046
1529
  } finally {
1047
1530
  process.argv = savedArgv;
1048
1531
  }
@@ -1052,9 +1535,9 @@ function makeStandardAction(commandPath) {
1052
1535
  try {
1053
1536
  const { main } = await import(commandPath);
1054
1537
  await main(options, ...positionalArgs);
1055
- } catch (error) {
1056
- console.error(`Command failed: ${error.message}`);
1057
- process.exitCode = error.context?.exitCode || 1;
1538
+ } catch (error2) {
1539
+ console.error(`Command failed: ${error2.message}`);
1540
+ process.exitCode = error2.context?.exitCode || 1;
1058
1541
  }
1059
1542
  };
1060
1543
  }
@@ -1111,9 +1594,9 @@ var ACTION_OVERRIDES = {
1111
1594
  try {
1112
1595
  const { main } = await import("./commands/make-admin.js");
1113
1596
  await main(args2);
1114
- } catch (error) {
1115
- console.error(`make-admin failed: ${error.message}`);
1116
- process.exitCode = error.context?.exitCode || 1;
1597
+ } catch (error2) {
1598
+ console.error(`make-admin failed: ${error2.message}`);
1599
+ process.exitCode = error2.context?.exitCode || 1;
1117
1600
  }
1118
1601
  },
1119
1602
  "setup": async (options, provider) => {