@donotdev/cli 0.1.46 → 0.2.1

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 (48) hide show
  1. package/dependencies-matrix.json +189 -149
  2. package/dist/bin/commands/agent-setup.js +83 -19
  3. package/dist/bin/commands/build.js +207 -62
  4. package/dist/bin/commands/bump.js +108 -44
  5. package/dist/bin/commands/cacheout.js +83 -19
  6. package/dist/bin/commands/coach.js +83 -19
  7. package/dist/bin/commands/create-app.js +111 -43
  8. package/dist/bin/commands/create-project.js +111 -43
  9. package/dist/bin/commands/db.js +134098 -72027
  10. package/dist/bin/commands/deploy.js +524 -323
  11. package/dist/bin/commands/dev.js +87 -23
  12. package/dist/bin/commands/doctor.js +83 -19
  13. package/dist/bin/commands/emu.js +93 -29
  14. package/dist/bin/commands/format.js +83 -19
  15. package/dist/bin/commands/get-demo.js +87 -23
  16. package/dist/bin/commands/make-admin.js +7466 -8217
  17. package/dist/bin/commands/preview.js +87 -23
  18. package/dist/bin/commands/seed.js +134098 -72027
  19. package/dist/bin/commands/setup-cicd.js +107 -43
  20. package/dist/bin/commands/setup.js +110 -43
  21. package/dist/bin/commands/staging.js +524 -323
  22. package/dist/bin/commands/sync-secrets.js +88 -24
  23. package/dist/bin/commands/type-check.js +83 -19
  24. package/dist/bin/commands/wai.js +83 -19
  25. package/dist/bin/dndev.js +8 -3
  26. package/dist/index.js +534 -331
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/deploy-config/vercel.json.example +13 -13
  31. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  32. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  33. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  34. package/templates/functions-firebase/src/index.ts.example +0 -1
  35. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  36. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  37. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  38. package/templates/functions-vercel/.env.example +9 -0
  39. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  40. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  41. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  42. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  43. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  44. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  45. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  46. package/templates/root-consumer/.claude/settings.json.example +11 -1
  47. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  48. package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
@@ -10,11 +10,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __commonJS = (cb, mod) => function __require2() {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
22
+ try {
23
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ } catch (e) {
25
+ throw mod = 0, e;
26
+ }
18
27
  };
19
28
  var __copyProps = (to, from, except, desc) => {
20
29
  if (from && typeof from === "object" || typeof from === "function") {
@@ -453,7 +462,7 @@ var require_src = __commonJS({
453
462
  }
454
463
  });
455
464
 
456
- // node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
465
+ // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
457
466
  import { styleText } from "node:util";
458
467
  import { stdout, stdin } from "node:process";
459
468
  import * as l from "node:readline";
@@ -552,7 +561,7 @@ function runValidation(e, a2) {
552
561
  }
553
562
  var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
554
563
  var init_dist3 = __esm({
555
- "node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
564
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
556
565
  init_utils2();
557
566
  init_main();
558
567
  import_sisteransi = __toESM(require_src(), 1);
@@ -811,7 +820,7 @@ var init_dist3 = __esm({
811
820
  }
812
821
  });
813
822
 
814
- // node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
823
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
815
824
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
816
825
  import process$1 from "node:process";
817
826
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -828,7 +837,7 @@ function formatInstructionFooter(o, e) {
828
837
  }
829
838
  var import_sisteransi2, unicode, isCI, 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, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
830
839
  var init_dist4 = __esm({
831
- "node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
840
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
832
841
  init_utils2();
833
842
  init_dist3();
834
843
  init_dist3();
@@ -1169,19 +1178,19 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1169
1178
  }
1170
1179
  default: {
1171
1180
  const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1172
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
1173
- `), f = p.length + 1;
1181
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1182
+ `), b = p.length + 1;
1174
1183
  return `${u3}${r2}${limitOptions({
1175
1184
  output: t2.output,
1176
1185
  cursor: this.cursor,
1177
1186
  options: this.options,
1178
1187
  maxItems: t2.maxItems,
1179
1188
  columnPadding: r2.length,
1180
- rowPadding: a2 + f,
1189
+ rowPadding: a2 + b,
1181
1190
  style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1182
1191
  }).join(`
1183
1192
  ${r2}`)}
1184
- ${b}
1193
+ ${f}
1185
1194
  `;
1186
1195
  }
1187
1196
  }
@@ -5675,9 +5684,9 @@ var require_reusify = __commonJS({
5675
5684
  }
5676
5685
  });
5677
5686
 
5678
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5687
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5679
5688
  var require_queue = __commonJS({
5680
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5689
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5681
5690
  "use strict";
5682
5691
  init_utils2();
5683
5692
  var reusify = require_reusify();
@@ -5857,11 +5866,12 @@ var require_queue = __commonJS({
5857
5866
  current.value = null;
5858
5867
  current.callback = noop;
5859
5868
  current.errorHandler = null;
5869
+ current.next = null;
5860
5870
  if (errorHandler2) {
5861
5871
  errorHandler2(new Error("abort"), val);
5862
5872
  }
5863
5873
  callback.call(context2, new Error("abort"));
5864
- current.release(current);
5874
+ cache.release(current);
5865
5875
  current = next;
5866
5876
  }
5867
5877
  self.drain = noop;
@@ -7327,7 +7337,7 @@ import {
7327
7337
  sep,
7328
7338
  extname
7329
7339
  } from "node:path";
7330
- import "node:url";
7340
+ import { fileURLToPath } from "node:url";
7331
7341
  function safeExecuteAsync(fn, message) {
7332
7342
  return fn().catch((error2) => {
7333
7343
  throw new Error(
@@ -7384,6 +7394,7 @@ var init_PathResolver = __esm({
7384
7394
  options;
7385
7395
  _repoRoot;
7386
7396
  _appRoot = null;
7397
+ _writtenPaths = null;
7387
7398
  /**
7388
7399
  * Get or create singleton instance
7389
7400
  * @param options - Configuration options
@@ -7702,16 +7713,17 @@ var init_PathResolver = __esm({
7702
7713
  }
7703
7714
  const detectedFormat = this._detectFormat(filePath, format);
7704
7715
  let writeContent;
7705
- if (Buffer.isBuffer(content)) {
7716
+ if (Buffer2.isBuffer(content)) {
7706
7717
  writeContent = content;
7707
7718
  } else if (detectedFormat === "json" && typeof content === "object") {
7708
- writeContent = JSON.stringify(content, null, 2);
7719
+ writeContent = `${JSON.stringify(content, null, 2)}
7720
+ `;
7709
7721
  } else {
7710
7722
  writeContent = String(content);
7711
7723
  }
7712
7724
  try {
7713
7725
  return await safeExecuteAsync(async () => {
7714
- if (Buffer.isBuffer(writeContent)) {
7726
+ if (Buffer2.isBuffer(writeContent)) {
7715
7727
  await fs.promises.writeFile(normalizedPath, writeContent);
7716
7728
  } else {
7717
7729
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
@@ -7763,19 +7775,21 @@ var init_PathResolver = __esm({
7763
7775
  }
7764
7776
  const detectedFormat = this._detectFormat(filePath, format);
7765
7777
  let writeContent;
7766
- if (Buffer.isBuffer(content)) {
7778
+ if (Buffer2.isBuffer(content)) {
7767
7779
  writeContent = content;
7768
7780
  } else if (detectedFormat === "json" && typeof content === "object") {
7769
- writeContent = JSON.stringify(content, null, 2);
7781
+ writeContent = `${JSON.stringify(content, null, 2)}
7782
+ `;
7770
7783
  } else {
7771
7784
  writeContent = String(content);
7772
7785
  }
7773
7786
  try {
7774
- if (Buffer.isBuffer(writeContent)) {
7787
+ if (Buffer2.isBuffer(writeContent)) {
7775
7788
  fs.writeFileSync(normalizedPath, writeContent);
7776
7789
  } else {
7777
7790
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7778
7791
  }
7792
+ this._writtenPaths?.add(normalizedPath);
7779
7793
  if (verbose) {
7780
7794
  log3.info(
7781
7795
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
@@ -7860,6 +7874,7 @@ var init_PathResolver = __esm({
7860
7874
  }
7861
7875
  try {
7862
7876
  fs.copyFileSync(srcPath, normalizedDestPath);
7877
+ this._writtenPaths?.add(normalizedDestPath);
7863
7878
  if (verbose) {
7864
7879
  log3.info(
7865
7880
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
@@ -7927,6 +7942,24 @@ var init_PathResolver = __esm({
7927
7942
  return null;
7928
7943
  }
7929
7944
  }
7945
+ /**
7946
+ * Resolve the real path of a file, following symlinks
7947
+ * @param filePath - Path to resolve
7948
+ * @returns Resolved real path
7949
+ */
7950
+ realpathSync(filePath) {
7951
+ return fs.realpathSync(filePath);
7952
+ }
7953
+ /**
7954
+ * Watch a directory for changes
7955
+ * @param dirPath - Directory to watch
7956
+ * @param options - fs.watch options
7957
+ * @param callback - Callback for change events
7958
+ * @returns FSWatcher instance
7959
+ */
7960
+ watch(dirPath, options, callback) {
7961
+ return fs.watch(dirPath, options, callback);
7962
+ }
7930
7963
  /**
7931
7964
  * Get file stats synchronously (follows symlinks)
7932
7965
  * Returns null if file doesn't exist (graceful degradation)
@@ -8006,6 +8039,28 @@ var init_PathResolver = __esm({
8006
8039
  * Get app root (where vite.config.ts is, Vite's config.root)
8007
8040
  * Falls back to repoRoot if not set
8008
8041
  */
8042
+ /**
8043
+ * Start recording every path written by writeSync/copySync.
8044
+ * Lets a generator know exactly which files the current run produced,
8045
+ * without comparing file timestamps to a clock.
8046
+ */
8047
+ startWriteRecording() {
8048
+ this._writtenPaths = /* @__PURE__ */ new Set();
8049
+ }
8050
+ /**
8051
+ * Stop recording and return the normalized paths written since
8052
+ * startWriteRecording().
8053
+ */
8054
+ stopWriteRecording() {
8055
+ if (!this._writtenPaths) {
8056
+ throw new Error(
8057
+ "stopWriteRecording() called without startWriteRecording()"
8058
+ );
8059
+ }
8060
+ const written = this._writtenPaths;
8061
+ this._writtenPaths = null;
8062
+ return written;
8063
+ }
8009
8064
  getAppRoot() {
8010
8065
  if (!this._appRoot) {
8011
8066
  return this._repoRoot;
@@ -8263,6 +8318,15 @@ var init_PathResolver = __esm({
8263
8318
  const cjsPath = this.getEmptyCjsModulePath();
8264
8319
  return cjsPath.replace(/\.cjs$/, ".js");
8265
8320
  }
8321
+ /**
8322
+ * Get absolute path to empty flag component module.
8323
+ * Returns `export default () => null;` — used by flag filtering plugins
8324
+ * to replace unused flag files at build time.
8325
+ */
8326
+ getEmptyFlagModulePath() {
8327
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8328
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8329
+ }
8266
8330
  /**
8267
8331
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8268
8332
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8475,7 +8539,7 @@ var init_pathResolver = __esm({
8475
8539
  });
8476
8540
 
8477
8541
  // packages/tooling/src/bundler/utils.ts
8478
- import { Buffer } from "node:buffer";
8542
+ import { Buffer as Buffer2 } from "node:buffer";
8479
8543
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8480
8544
  import { createRequire as createRequire3 } from "node:module";
8481
8545
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
@@ -8492,7 +8556,7 @@ var init_utils2 = __esm({
8492
8556
  globalThis.require = require2;
8493
8557
  globalThis.__filename = __filename;
8494
8558
  globalThis.__dirname = __dirname;
8495
- globalThis.Buffer = Buffer;
8559
+ globalThis.Buffer = Buffer2;
8496
8560
  globalThis.process = process;
8497
8561
  if (typeof global === "undefined") {
8498
8562
  globalThis.global = globalThis;