@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 l__default from "node:readline";
@@ -517,7 +526,7 @@ function runValidation(e, a2) {
517
526
  }
518
527
  var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
519
528
  var init_dist3 = __esm({
520
- "node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
529
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
521
530
  init_utils2();
522
531
  init_main();
523
532
  import_sisteransi = __toESM(require_src(), 1);
@@ -776,7 +785,7 @@ var init_dist3 = __esm({
776
785
  }
777
786
  });
778
787
 
779
- // node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
788
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
780
789
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
781
790
  import process$1 from "node:process";
782
791
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -793,7 +802,7 @@ function formatInstructionFooter(o, e) {
793
802
  }
794
803
  var import_sisteransi2, 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, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, u2, SELECT_INSTRUCTIONS, c, select, i;
795
804
  var init_dist4 = __esm({
796
- "node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
805
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
797
806
  init_utils2();
798
807
  init_dist3();
799
808
  init_dist3();
@@ -1035,19 +1044,19 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1035
1044
  }
1036
1045
  default: {
1037
1046
  const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1038
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
1039
- `), f = p.length + 1;
1047
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1048
+ `), b = p.length + 1;
1040
1049
  return `${u3}${r2}${limitOptions({
1041
1050
  output: t2.output,
1042
1051
  cursor: this.cursor,
1043
1052
  options: this.options,
1044
1053
  maxItems: t2.maxItems,
1045
1054
  columnPadding: r2.length,
1046
- rowPadding: a2 + f,
1055
+ rowPadding: a2 + b,
1047
1056
  style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1048
1057
  }).join(`
1049
1058
  ${r2}`)}
1050
- ${b}
1059
+ ${f}
1051
1060
  `;
1052
1061
  }
1053
1062
  }
@@ -5683,9 +5692,9 @@ var require_reusify = __commonJS({
5683
5692
  }
5684
5693
  });
5685
5694
 
5686
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5695
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5687
5696
  var require_queue = __commonJS({
5688
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5697
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5689
5698
  "use strict";
5690
5699
  init_utils2();
5691
5700
  var reusify = require_reusify();
@@ -5865,11 +5874,12 @@ var require_queue = __commonJS({
5865
5874
  current.value = null;
5866
5875
  current.callback = noop;
5867
5876
  current.errorHandler = null;
5877
+ current.next = null;
5868
5878
  if (errorHandler2) {
5869
5879
  errorHandler2(new Error("abort"), val);
5870
5880
  }
5871
5881
  callback.call(context2, new Error("abort"));
5872
- current.release(current);
5882
+ cache.release(current);
5873
5883
  current = next;
5874
5884
  }
5875
5885
  self.drain = noop;
@@ -7335,7 +7345,7 @@ import {
7335
7345
  sep,
7336
7346
  extname
7337
7347
  } from "node:path";
7338
- import "node:url";
7348
+ import { fileURLToPath } from "node:url";
7339
7349
  function safeExecuteAsync(fn, message) {
7340
7350
  return fn().catch((error2) => {
7341
7351
  throw new Error(
@@ -7392,6 +7402,7 @@ var init_PathResolver = __esm({
7392
7402
  options;
7393
7403
  _repoRoot;
7394
7404
  _appRoot = null;
7405
+ _writtenPaths = null;
7395
7406
  /**
7396
7407
  * Get or create singleton instance
7397
7408
  * @param options - Configuration options
@@ -7710,16 +7721,17 @@ var init_PathResolver = __esm({
7710
7721
  }
7711
7722
  const detectedFormat = this._detectFormat(filePath, format);
7712
7723
  let writeContent;
7713
- if (Buffer.isBuffer(content)) {
7724
+ if (Buffer2.isBuffer(content)) {
7714
7725
  writeContent = content;
7715
7726
  } else if (detectedFormat === "json" && typeof content === "object") {
7716
- writeContent = JSON.stringify(content, null, 2);
7727
+ writeContent = `${JSON.stringify(content, null, 2)}
7728
+ `;
7717
7729
  } else {
7718
7730
  writeContent = String(content);
7719
7731
  }
7720
7732
  try {
7721
7733
  return await safeExecuteAsync(async () => {
7722
- if (Buffer.isBuffer(writeContent)) {
7734
+ if (Buffer2.isBuffer(writeContent)) {
7723
7735
  await fs.promises.writeFile(normalizedPath, writeContent);
7724
7736
  } else {
7725
7737
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
@@ -7771,19 +7783,21 @@ var init_PathResolver = __esm({
7771
7783
  }
7772
7784
  const detectedFormat = this._detectFormat(filePath, format);
7773
7785
  let writeContent;
7774
- if (Buffer.isBuffer(content)) {
7786
+ if (Buffer2.isBuffer(content)) {
7775
7787
  writeContent = content;
7776
7788
  } else if (detectedFormat === "json" && typeof content === "object") {
7777
- writeContent = JSON.stringify(content, null, 2);
7789
+ writeContent = `${JSON.stringify(content, null, 2)}
7790
+ `;
7778
7791
  } else {
7779
7792
  writeContent = String(content);
7780
7793
  }
7781
7794
  try {
7782
- if (Buffer.isBuffer(writeContent)) {
7795
+ if (Buffer2.isBuffer(writeContent)) {
7783
7796
  fs.writeFileSync(normalizedPath, writeContent);
7784
7797
  } else {
7785
7798
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7786
7799
  }
7800
+ this._writtenPaths?.add(normalizedPath);
7787
7801
  if (verbose) {
7788
7802
  log3.info(
7789
7803
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
@@ -7868,6 +7882,7 @@ var init_PathResolver = __esm({
7868
7882
  }
7869
7883
  try {
7870
7884
  fs.copyFileSync(srcPath, normalizedDestPath);
7885
+ this._writtenPaths?.add(normalizedDestPath);
7871
7886
  if (verbose) {
7872
7887
  log3.info(
7873
7888
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
@@ -7935,6 +7950,24 @@ var init_PathResolver = __esm({
7935
7950
  return null;
7936
7951
  }
7937
7952
  }
7953
+ /**
7954
+ * Resolve the real path of a file, following symlinks
7955
+ * @param filePath - Path to resolve
7956
+ * @returns Resolved real path
7957
+ */
7958
+ realpathSync(filePath) {
7959
+ return fs.realpathSync(filePath);
7960
+ }
7961
+ /**
7962
+ * Watch a directory for changes
7963
+ * @param dirPath - Directory to watch
7964
+ * @param options - fs.watch options
7965
+ * @param callback - Callback for change events
7966
+ * @returns FSWatcher instance
7967
+ */
7968
+ watch(dirPath, options, callback) {
7969
+ return fs.watch(dirPath, options, callback);
7970
+ }
7938
7971
  /**
7939
7972
  * Get file stats synchronously (follows symlinks)
7940
7973
  * Returns null if file doesn't exist (graceful degradation)
@@ -8014,6 +8047,28 @@ var init_PathResolver = __esm({
8014
8047
  * Get app root (where vite.config.ts is, Vite's config.root)
8015
8048
  * Falls back to repoRoot if not set
8016
8049
  */
8050
+ /**
8051
+ * Start recording every path written by writeSync/copySync.
8052
+ * Lets a generator know exactly which files the current run produced,
8053
+ * without comparing file timestamps to a clock.
8054
+ */
8055
+ startWriteRecording() {
8056
+ this._writtenPaths = /* @__PURE__ */ new Set();
8057
+ }
8058
+ /**
8059
+ * Stop recording and return the normalized paths written since
8060
+ * startWriteRecording().
8061
+ */
8062
+ stopWriteRecording() {
8063
+ if (!this._writtenPaths) {
8064
+ throw new Error(
8065
+ "stopWriteRecording() called without startWriteRecording()"
8066
+ );
8067
+ }
8068
+ const written = this._writtenPaths;
8069
+ this._writtenPaths = null;
8070
+ return written;
8071
+ }
8017
8072
  getAppRoot() {
8018
8073
  if (!this._appRoot) {
8019
8074
  return this._repoRoot;
@@ -8271,6 +8326,15 @@ var init_PathResolver = __esm({
8271
8326
  const cjsPath = this.getEmptyCjsModulePath();
8272
8327
  return cjsPath.replace(/\.cjs$/, ".js");
8273
8328
  }
8329
+ /**
8330
+ * Get absolute path to empty flag component module.
8331
+ * Returns `export default () => null;` — used by flag filtering plugins
8332
+ * to replace unused flag files at build time.
8333
+ */
8334
+ getEmptyFlagModulePath() {
8335
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8336
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8337
+ }
8274
8338
  /**
8275
8339
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8276
8340
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8396,7 +8460,7 @@ var init_typed_file_operations = __esm({
8396
8460
  });
8397
8461
 
8398
8462
  // packages/tooling/src/bundler/utils.ts
8399
- import { Buffer } from "node:buffer";
8463
+ import { Buffer as Buffer2 } from "node:buffer";
8400
8464
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8401
8465
  import { createRequire as createRequire3 } from "node:module";
8402
8466
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
@@ -8413,7 +8477,7 @@ var init_utils2 = __esm({
8413
8477
  globalThis.require = require2;
8414
8478
  globalThis.__filename = __filename;
8415
8479
  globalThis.__dirname = __dirname;
8416
- globalThis.Buffer = Buffer;
8480
+ globalThis.Buffer = Buffer2;
8417
8481
  globalThis.process = process;
8418
8482
  if (typeof global === "undefined") {
8419
8483
  globalThis.global = globalThis;