@donotdev/cli 0.1.0 → 0.1.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 (93) hide show
  1. package/dependencies-matrix.json +100 -50
  2. package/dist/bin/commands/agent-setup.js +245 -12
  3. package/dist/bin/commands/build.js +3339 -208
  4. package/dist/bin/commands/bump.js +245 -12
  5. package/dist/bin/commands/cacheout.js +245 -12
  6. package/dist/bin/commands/coach.js +361 -60
  7. package/dist/bin/commands/create-app.js +245 -12
  8. package/dist/bin/commands/create-project.js +253 -12
  9. package/dist/bin/commands/db.js +9114 -2327
  10. package/dist/bin/commands/deploy.js +4074 -694
  11. package/dist/bin/commands/dev.js +347 -33
  12. package/dist/bin/commands/doctor.js +408 -107
  13. package/dist/bin/commands/emu.js +386 -52
  14. package/dist/bin/commands/format.js +245 -12
  15. package/dist/bin/commands/get-demo.js +245 -12
  16. package/dist/bin/commands/make-admin.js +8356 -1516
  17. package/dist/bin/commands/preview.js +347 -33
  18. package/dist/bin/commands/seed.js +9114 -2327
  19. package/dist/bin/commands/setup-cicd.js +452 -132
  20. package/dist/bin/commands/setup.js +407 -107
  21. package/dist/bin/commands/staging.js +4074 -694
  22. package/dist/bin/commands/sync-secrets.js +246 -13
  23. package/dist/bin/commands/type-check.js +245 -12
  24. package/dist/bin/commands/wai.js +245 -12
  25. package/dist/bin/dndev.js +13 -4
  26. package/dist/bin/donotdev.js +13 -4
  27. package/dist/index.js +4169 -812
  28. package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
  29. package/package.json +2 -1
  30. package/templates/app-demo/src/themes.css.example +21 -0
  31. package/templates/app-dndev/index.html.example +0 -3
  32. package/templates/app-dndev/src/themes.css.example +21 -0
  33. package/templates/app-next/src/app/layout.tsx.example +13 -4
  34. package/templates/app-next/src/themes.css.example +21 -0
  35. package/templates/app-vite/csp.example.json +44 -0
  36. package/templates/app-vite/index.html.example +0 -3
  37. package/templates/app-vite/src/themes.css.example +21 -0
  38. package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
  39. package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
  40. package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
  41. package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
  42. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
  43. package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
  44. package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
  45. package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
  46. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
  47. package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
  48. package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
  49. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
  50. package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
  51. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
  52. package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
  53. package/templates/root-consumer/.claude/rules/git.md.example +14 -0
  54. package/templates/root-consumer/.claude/rules/security.md.example +13 -0
  55. package/templates/root-consumer/.claude/settings.json.example +123 -1
  56. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
  57. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
  58. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
  59. package/templates/root-consumer/AI.md.example +2 -2
  60. package/templates/root-consumer/CLAUDE.md.example +33 -1
  61. package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
  62. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
  63. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +10 -5
  64. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
  65. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
  66. package/templates/app-demo/public/manifest.json.example +0 -10
  67. package/templates/app-dndev/public/manifest.json.example +0 -10
  68. package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
  69. package/templates/root-consumer/.claude/commands/build.md.example +0 -131
  70. package/templates/root-consumer/.claude/commands/design.md.example +0 -184
  71. package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
  72. package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
  73. package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
  74. package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
  75. package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
  76. package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
  77. package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
  78. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
  79. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
  80. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
  81. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
  82. package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
  83. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
  84. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
  85. package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
  86. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
  87. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
  88. package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
  89. package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
  90. package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
  91. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
  92. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
  93. package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
@@ -2549,14 +2549,15 @@ var require_braces = __commonJS({
2549
2549
  }
2550
2550
  });
2551
2551
 
2552
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
2552
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
2553
2553
  var require_constants2 = __commonJS({
2554
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module) {
2554
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
2555
2555
  "use strict";
2556
2556
  init_utils();
2557
2557
  var path = __require("path");
2558
2558
  var WIN_SLASH = "\\\\/";
2559
2559
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
2560
+ var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
2560
2561
  var DOT_LITERAL = "\\.";
2561
2562
  var PLUS_LITERAL = "\\+";
2562
2563
  var QMARK_LITERAL = "\\?";
@@ -2604,6 +2605,7 @@ var require_constants2 = __commonJS({
2604
2605
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
2605
2606
  };
2606
2607
  var POSIX_REGEX_SOURCE = {
2608
+ __proto__: null,
2607
2609
  alnum: "a-zA-Z0-9",
2608
2610
  alpha: "a-zA-Z",
2609
2611
  ascii: "\\x00-\\x7F",
@@ -2620,6 +2622,7 @@ var require_constants2 = __commonJS({
2620
2622
  xdigit: "A-Fa-f0-9"
2621
2623
  };
2622
2624
  module.exports = {
2625
+ DEFAULT_MAX_EXTGLOB_RECURSION,
2623
2626
  MAX_LENGTH: 1024 * 64,
2624
2627
  POSIX_REGEX_SOURCE,
2625
2628
  // regular expressions
@@ -2631,6 +2634,7 @@ var require_constants2 = __commonJS({
2631
2634
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
2632
2635
  // Replace globs with equivalent patterns to reduce parsing time.
2633
2636
  REPLACEMENTS: {
2637
+ __proto__: null,
2634
2638
  "***": "*",
2635
2639
  "**/**": "**",
2636
2640
  "**/**/**": "**"
@@ -2747,9 +2751,9 @@ var require_constants2 = __commonJS({
2747
2751
  }
2748
2752
  });
2749
2753
 
2750
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
2754
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
2751
2755
  var require_utils2 = __commonJS({
2752
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
2756
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
2753
2757
  "use strict";
2754
2758
  init_utils();
2755
2759
  var path = __require("path");
@@ -2809,9 +2813,9 @@ var require_utils2 = __commonJS({
2809
2813
  }
2810
2814
  });
2811
2815
 
2812
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
2816
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
2813
2817
  var require_scan = __commonJS({
2814
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports, module) {
2818
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
2815
2819
  "use strict";
2816
2820
  init_utils();
2817
2821
  var utils = require_utils2();
@@ -3140,9 +3144,9 @@ var require_scan = __commonJS({
3140
3144
  }
3141
3145
  });
3142
3146
 
3143
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
3147
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
3144
3148
  var require_parse2 = __commonJS({
3145
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports, module) {
3149
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
3146
3150
  "use strict";
3147
3151
  init_utils();
3148
3152
  var constants2 = require_constants2();
@@ -3170,6 +3174,213 @@ var require_parse2 = __commonJS({
3170
3174
  var syntaxError = (type, char) => {
3171
3175
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
3172
3176
  };
3177
+ var splitTopLevel = (input) => {
3178
+ const parts = [];
3179
+ let bracket = 0;
3180
+ let paren = 0;
3181
+ let quote = 0;
3182
+ let value = "";
3183
+ let escaped = false;
3184
+ for (const ch of input) {
3185
+ if (escaped === true) {
3186
+ value += ch;
3187
+ escaped = false;
3188
+ continue;
3189
+ }
3190
+ if (ch === "\\") {
3191
+ value += ch;
3192
+ escaped = true;
3193
+ continue;
3194
+ }
3195
+ if (ch === '"') {
3196
+ quote = quote === 1 ? 0 : 1;
3197
+ value += ch;
3198
+ continue;
3199
+ }
3200
+ if (quote === 0) {
3201
+ if (ch === "[") {
3202
+ bracket++;
3203
+ } else if (ch === "]" && bracket > 0) {
3204
+ bracket--;
3205
+ } else if (bracket === 0) {
3206
+ if (ch === "(") {
3207
+ paren++;
3208
+ } else if (ch === ")" && paren > 0) {
3209
+ paren--;
3210
+ } else if (ch === "|" && paren === 0) {
3211
+ parts.push(value);
3212
+ value = "";
3213
+ continue;
3214
+ }
3215
+ }
3216
+ }
3217
+ value += ch;
3218
+ }
3219
+ parts.push(value);
3220
+ return parts;
3221
+ };
3222
+ var isPlainBranch = (branch) => {
3223
+ let escaped = false;
3224
+ for (const ch of branch) {
3225
+ if (escaped === true) {
3226
+ escaped = false;
3227
+ continue;
3228
+ }
3229
+ if (ch === "\\") {
3230
+ escaped = true;
3231
+ continue;
3232
+ }
3233
+ if (/[?*+@!()[\]{}]/.test(ch)) {
3234
+ return false;
3235
+ }
3236
+ }
3237
+ return true;
3238
+ };
3239
+ var normalizeSimpleBranch = (branch) => {
3240
+ let value = branch.trim();
3241
+ let changed = true;
3242
+ while (changed === true) {
3243
+ changed = false;
3244
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
3245
+ value = value.slice(2, -1);
3246
+ changed = true;
3247
+ }
3248
+ }
3249
+ if (!isPlainBranch(value)) {
3250
+ return;
3251
+ }
3252
+ return value.replace(/\\(.)/g, "$1");
3253
+ };
3254
+ var hasRepeatedCharPrefixOverlap = (branches) => {
3255
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
3256
+ for (let i = 0; i < values.length; i++) {
3257
+ for (let j2 = i + 1; j2 < values.length; j2++) {
3258
+ const a = values[i];
3259
+ const b3 = values[j2];
3260
+ const char = a[0];
3261
+ if (!char || a !== char.repeat(a.length) || b3 !== char.repeat(b3.length)) {
3262
+ continue;
3263
+ }
3264
+ if (a === b3 || a.startsWith(b3) || b3.startsWith(a)) {
3265
+ return true;
3266
+ }
3267
+ }
3268
+ }
3269
+ return false;
3270
+ };
3271
+ var parseRepeatedExtglob = (pattern, requireEnd = true) => {
3272
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
3273
+ return;
3274
+ }
3275
+ let bracket = 0;
3276
+ let paren = 0;
3277
+ let quote = 0;
3278
+ let escaped = false;
3279
+ for (let i = 1; i < pattern.length; i++) {
3280
+ const ch = pattern[i];
3281
+ if (escaped === true) {
3282
+ escaped = false;
3283
+ continue;
3284
+ }
3285
+ if (ch === "\\") {
3286
+ escaped = true;
3287
+ continue;
3288
+ }
3289
+ if (ch === '"') {
3290
+ quote = quote === 1 ? 0 : 1;
3291
+ continue;
3292
+ }
3293
+ if (quote === 1) {
3294
+ continue;
3295
+ }
3296
+ if (ch === "[") {
3297
+ bracket++;
3298
+ continue;
3299
+ }
3300
+ if (ch === "]" && bracket > 0) {
3301
+ bracket--;
3302
+ continue;
3303
+ }
3304
+ if (bracket > 0) {
3305
+ continue;
3306
+ }
3307
+ if (ch === "(") {
3308
+ paren++;
3309
+ continue;
3310
+ }
3311
+ if (ch === ")") {
3312
+ paren--;
3313
+ if (paren === 0) {
3314
+ if (requireEnd === true && i !== pattern.length - 1) {
3315
+ return;
3316
+ }
3317
+ return {
3318
+ type: pattern[0],
3319
+ body: pattern.slice(2, i),
3320
+ end: i
3321
+ };
3322
+ }
3323
+ }
3324
+ }
3325
+ };
3326
+ var getStarExtglobSequenceOutput = (pattern) => {
3327
+ let index = 0;
3328
+ const chars = [];
3329
+ while (index < pattern.length) {
3330
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
3331
+ if (!match || match.type !== "*") {
3332
+ return;
3333
+ }
3334
+ const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
3335
+ if (branches.length !== 1) {
3336
+ return;
3337
+ }
3338
+ const branch = normalizeSimpleBranch(branches[0]);
3339
+ if (!branch || branch.length !== 1) {
3340
+ return;
3341
+ }
3342
+ chars.push(branch);
3343
+ index += match.end + 1;
3344
+ }
3345
+ if (chars.length < 1) {
3346
+ return;
3347
+ }
3348
+ const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
3349
+ return `${source}*`;
3350
+ };
3351
+ var repeatedExtglobRecursion = (pattern) => {
3352
+ let depth = 0;
3353
+ let value = pattern.trim();
3354
+ let match = parseRepeatedExtglob(value);
3355
+ while (match) {
3356
+ depth++;
3357
+ value = match.body.trim();
3358
+ match = parseRepeatedExtglob(value);
3359
+ }
3360
+ return depth;
3361
+ };
3362
+ var analyzeRepeatedExtglob = (body, options) => {
3363
+ if (options.maxExtglobRecursion === false) {
3364
+ return { risky: false };
3365
+ }
3366
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
3367
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
3368
+ if (branches.length > 1) {
3369
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
3370
+ return { risky: true };
3371
+ }
3372
+ }
3373
+ for (const branch of branches) {
3374
+ const safeOutput = getStarExtglobSequenceOutput(branch);
3375
+ if (safeOutput) {
3376
+ return { risky: true, safeOutput };
3377
+ }
3378
+ if (repeatedExtglobRecursion(branch) > max) {
3379
+ return { risky: true };
3380
+ }
3381
+ }
3382
+ return { risky: false };
3383
+ };
3173
3384
  var parse2 = (input, options) => {
3174
3385
  if (typeof input !== "string") {
3175
3386
  throw new TypeError("Expected a string");
@@ -3301,6 +3512,8 @@ var require_parse2 = __commonJS({
3301
3512
  token.prev = prev;
3302
3513
  token.parens = state.parens;
3303
3514
  token.output = state.output;
3515
+ token.startIndex = state.index;
3516
+ token.tokensIndex = tokens.length;
3304
3517
  const output = (opts.capture ? "(" : "") + token.open;
3305
3518
  increment("parens");
3306
3519
  push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
@@ -3308,6 +3521,26 @@ var require_parse2 = __commonJS({
3308
3521
  extglobs.push(token);
3309
3522
  };
3310
3523
  const extglobClose = (token) => {
3524
+ const literal = input.slice(token.startIndex, state.index + 1);
3525
+ const body = input.slice(token.startIndex + 2, state.index);
3526
+ const analysis = analyzeRepeatedExtglob(body, opts);
3527
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
3528
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
3529
+ const open = tokens[token.tokensIndex];
3530
+ open.type = "text";
3531
+ open.value = literal;
3532
+ open.output = safeOutput || utils.escapeRegex(literal);
3533
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3534
+ tokens[i].value = "";
3535
+ tokens[i].output = "";
3536
+ delete tokens[i].suffix;
3537
+ }
3538
+ state.output = token.output + open.output;
3539
+ state.backtrack = true;
3540
+ push({ type: "paren", extglob: true, value, output: "" });
3541
+ decrement("parens");
3542
+ return;
3543
+ }
3311
3544
  let output = token.close + (opts.capture ? ")" : "");
3312
3545
  let rest;
3313
3546
  if (token.type === "negate") {
@@ -3914,9 +4147,9 @@ var require_parse2 = __commonJS({
3914
4147
  }
3915
4148
  });
3916
4149
 
3917
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
4150
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
3918
4151
  var require_picomatch = __commonJS({
3919
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports, module) {
4152
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
3920
4153
  "use strict";
3921
4154
  init_utils();
3922
4155
  var path = __require("path");
@@ -4056,9 +4289,9 @@ var require_picomatch = __commonJS({
4056
4289
  }
4057
4290
  });
4058
4291
 
4059
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js
4292
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
4060
4293
  var require_picomatch2 = __commonJS({
4061
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js"(exports, module) {
4294
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
4062
4295
  "use strict";
4063
4296
  init_utils();
4064
4297
  module.exports = require_picomatch();
@@ -9927,6 +10160,14 @@ async function main(_options, name) {
9927
10160
  await replacePlaceholders(destPath, rootReplacements);
9928
10161
  }
9929
10162
  }
10163
+ const hooksDir = joinPath(projectDirNormalized, ".claude", "hooks");
10164
+ if (pathExists(hooksDir)) {
10165
+ const { chmodSync } = await import("node:fs");
10166
+ const hookFiles = await glob("*.sh", { cwd: hooksDir, onlyFiles: true });
10167
+ for (const hook of hookFiles) {
10168
+ chmodSync(joinPath(hooksDir, hook), 493);
10169
+ }
10170
+ }
9930
10171
  const dndevSecretsPath = joinPath(projectDirNormalized, ".dndev.secrets");
9931
10172
  if (pathExists(dndevSecretsPath)) {
9932
10173
  await copy(