@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
@@ -2117,14 +2117,15 @@ var require_braces = __commonJS({
2117
2117
  }
2118
2118
  });
2119
2119
 
2120
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
2120
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
2121
2121
  var require_constants2 = __commonJS({
2122
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module) {
2122
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
2123
2123
  "use strict";
2124
2124
  init_utils();
2125
2125
  var path = __require("path");
2126
2126
  var WIN_SLASH = "\\\\/";
2127
2127
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
2128
+ var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
2128
2129
  var DOT_LITERAL = "\\.";
2129
2130
  var PLUS_LITERAL = "\\+";
2130
2131
  var QMARK_LITERAL = "\\?";
@@ -2172,6 +2173,7 @@ var require_constants2 = __commonJS({
2172
2173
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
2173
2174
  };
2174
2175
  var POSIX_REGEX_SOURCE = {
2176
+ __proto__: null,
2175
2177
  alnum: "a-zA-Z0-9",
2176
2178
  alpha: "a-zA-Z",
2177
2179
  ascii: "\\x00-\\x7F",
@@ -2188,6 +2190,7 @@ var require_constants2 = __commonJS({
2188
2190
  xdigit: "A-Fa-f0-9"
2189
2191
  };
2190
2192
  module.exports = {
2193
+ DEFAULT_MAX_EXTGLOB_RECURSION,
2191
2194
  MAX_LENGTH: 1024 * 64,
2192
2195
  POSIX_REGEX_SOURCE,
2193
2196
  // regular expressions
@@ -2199,6 +2202,7 @@ var require_constants2 = __commonJS({
2199
2202
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
2200
2203
  // Replace globs with equivalent patterns to reduce parsing time.
2201
2204
  REPLACEMENTS: {
2205
+ __proto__: null,
2202
2206
  "***": "*",
2203
2207
  "**/**": "**",
2204
2208
  "**/**/**": "**"
@@ -2315,9 +2319,9 @@ var require_constants2 = __commonJS({
2315
2319
  }
2316
2320
  });
2317
2321
 
2318
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
2322
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
2319
2323
  var require_utils2 = __commonJS({
2320
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
2324
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
2321
2325
  "use strict";
2322
2326
  init_utils();
2323
2327
  var path = __require("path");
@@ -2377,9 +2381,9 @@ var require_utils2 = __commonJS({
2377
2381
  }
2378
2382
  });
2379
2383
 
2380
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
2384
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
2381
2385
  var require_scan = __commonJS({
2382
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports, module) {
2386
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
2383
2387
  "use strict";
2384
2388
  init_utils();
2385
2389
  var utils = require_utils2();
@@ -2708,9 +2712,9 @@ var require_scan = __commonJS({
2708
2712
  }
2709
2713
  });
2710
2714
 
2711
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
2715
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
2712
2716
  var require_parse2 = __commonJS({
2713
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports, module) {
2717
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
2714
2718
  "use strict";
2715
2719
  init_utils();
2716
2720
  var constants2 = require_constants2();
@@ -2738,6 +2742,213 @@ var require_parse2 = __commonJS({
2738
2742
  var syntaxError = (type, char) => {
2739
2743
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
2740
2744
  };
2745
+ var splitTopLevel = (input) => {
2746
+ const parts = [];
2747
+ let bracket = 0;
2748
+ let paren = 0;
2749
+ let quote = 0;
2750
+ let value = "";
2751
+ let escaped = false;
2752
+ for (const ch of input) {
2753
+ if (escaped === true) {
2754
+ value += ch;
2755
+ escaped = false;
2756
+ continue;
2757
+ }
2758
+ if (ch === "\\") {
2759
+ value += ch;
2760
+ escaped = true;
2761
+ continue;
2762
+ }
2763
+ if (ch === '"') {
2764
+ quote = quote === 1 ? 0 : 1;
2765
+ value += ch;
2766
+ continue;
2767
+ }
2768
+ if (quote === 0) {
2769
+ if (ch === "[") {
2770
+ bracket++;
2771
+ } else if (ch === "]" && bracket > 0) {
2772
+ bracket--;
2773
+ } else if (bracket === 0) {
2774
+ if (ch === "(") {
2775
+ paren++;
2776
+ } else if (ch === ")" && paren > 0) {
2777
+ paren--;
2778
+ } else if (ch === "|" && paren === 0) {
2779
+ parts.push(value);
2780
+ value = "";
2781
+ continue;
2782
+ }
2783
+ }
2784
+ }
2785
+ value += ch;
2786
+ }
2787
+ parts.push(value);
2788
+ return parts;
2789
+ };
2790
+ var isPlainBranch = (branch) => {
2791
+ let escaped = false;
2792
+ for (const ch of branch) {
2793
+ if (escaped === true) {
2794
+ escaped = false;
2795
+ continue;
2796
+ }
2797
+ if (ch === "\\") {
2798
+ escaped = true;
2799
+ continue;
2800
+ }
2801
+ if (/[?*+@!()[\]{}]/.test(ch)) {
2802
+ return false;
2803
+ }
2804
+ }
2805
+ return true;
2806
+ };
2807
+ var normalizeSimpleBranch = (branch) => {
2808
+ let value = branch.trim();
2809
+ let changed = true;
2810
+ while (changed === true) {
2811
+ changed = false;
2812
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
2813
+ value = value.slice(2, -1);
2814
+ changed = true;
2815
+ }
2816
+ }
2817
+ if (!isPlainBranch(value)) {
2818
+ return;
2819
+ }
2820
+ return value.replace(/\\(.)/g, "$1");
2821
+ };
2822
+ var hasRepeatedCharPrefixOverlap = (branches) => {
2823
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
2824
+ for (let i = 0; i < values.length; i++) {
2825
+ for (let j2 = i + 1; j2 < values.length; j2++) {
2826
+ const a = values[i];
2827
+ const b2 = values[j2];
2828
+ const char = a[0];
2829
+ if (!char || a !== char.repeat(a.length) || b2 !== char.repeat(b2.length)) {
2830
+ continue;
2831
+ }
2832
+ if (a === b2 || a.startsWith(b2) || b2.startsWith(a)) {
2833
+ return true;
2834
+ }
2835
+ }
2836
+ }
2837
+ return false;
2838
+ };
2839
+ var parseRepeatedExtglob = (pattern, requireEnd = true) => {
2840
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
2841
+ return;
2842
+ }
2843
+ let bracket = 0;
2844
+ let paren = 0;
2845
+ let quote = 0;
2846
+ let escaped = false;
2847
+ for (let i = 1; i < pattern.length; i++) {
2848
+ const ch = pattern[i];
2849
+ if (escaped === true) {
2850
+ escaped = false;
2851
+ continue;
2852
+ }
2853
+ if (ch === "\\") {
2854
+ escaped = true;
2855
+ continue;
2856
+ }
2857
+ if (ch === '"') {
2858
+ quote = quote === 1 ? 0 : 1;
2859
+ continue;
2860
+ }
2861
+ if (quote === 1) {
2862
+ continue;
2863
+ }
2864
+ if (ch === "[") {
2865
+ bracket++;
2866
+ continue;
2867
+ }
2868
+ if (ch === "]" && bracket > 0) {
2869
+ bracket--;
2870
+ continue;
2871
+ }
2872
+ if (bracket > 0) {
2873
+ continue;
2874
+ }
2875
+ if (ch === "(") {
2876
+ paren++;
2877
+ continue;
2878
+ }
2879
+ if (ch === ")") {
2880
+ paren--;
2881
+ if (paren === 0) {
2882
+ if (requireEnd === true && i !== pattern.length - 1) {
2883
+ return;
2884
+ }
2885
+ return {
2886
+ type: pattern[0],
2887
+ body: pattern.slice(2, i),
2888
+ end: i
2889
+ };
2890
+ }
2891
+ }
2892
+ }
2893
+ };
2894
+ var getStarExtglobSequenceOutput = (pattern) => {
2895
+ let index = 0;
2896
+ const chars = [];
2897
+ while (index < pattern.length) {
2898
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
2899
+ if (!match || match.type !== "*") {
2900
+ return;
2901
+ }
2902
+ const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
2903
+ if (branches.length !== 1) {
2904
+ return;
2905
+ }
2906
+ const branch = normalizeSimpleBranch(branches[0]);
2907
+ if (!branch || branch.length !== 1) {
2908
+ return;
2909
+ }
2910
+ chars.push(branch);
2911
+ index += match.end + 1;
2912
+ }
2913
+ if (chars.length < 1) {
2914
+ return;
2915
+ }
2916
+ const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
2917
+ return `${source}*`;
2918
+ };
2919
+ var repeatedExtglobRecursion = (pattern) => {
2920
+ let depth = 0;
2921
+ let value = pattern.trim();
2922
+ let match = parseRepeatedExtglob(value);
2923
+ while (match) {
2924
+ depth++;
2925
+ value = match.body.trim();
2926
+ match = parseRepeatedExtglob(value);
2927
+ }
2928
+ return depth;
2929
+ };
2930
+ var analyzeRepeatedExtglob = (body, options) => {
2931
+ if (options.maxExtglobRecursion === false) {
2932
+ return { risky: false };
2933
+ }
2934
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
2935
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
2936
+ if (branches.length > 1) {
2937
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
2938
+ return { risky: true };
2939
+ }
2940
+ }
2941
+ for (const branch of branches) {
2942
+ const safeOutput = getStarExtglobSequenceOutput(branch);
2943
+ if (safeOutput) {
2944
+ return { risky: true, safeOutput };
2945
+ }
2946
+ if (repeatedExtglobRecursion(branch) > max) {
2947
+ return { risky: true };
2948
+ }
2949
+ }
2950
+ return { risky: false };
2951
+ };
2741
2952
  var parse2 = (input, options) => {
2742
2953
  if (typeof input !== "string") {
2743
2954
  throw new TypeError("Expected a string");
@@ -2869,6 +3080,8 @@ var require_parse2 = __commonJS({
2869
3080
  token.prev = prev;
2870
3081
  token.parens = state.parens;
2871
3082
  token.output = state.output;
3083
+ token.startIndex = state.index;
3084
+ token.tokensIndex = tokens.length;
2872
3085
  const output = (opts.capture ? "(" : "") + token.open;
2873
3086
  increment("parens");
2874
3087
  push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
@@ -2876,6 +3089,26 @@ var require_parse2 = __commonJS({
2876
3089
  extglobs.push(token);
2877
3090
  };
2878
3091
  const extglobClose = (token) => {
3092
+ const literal = input.slice(token.startIndex, state.index + 1);
3093
+ const body = input.slice(token.startIndex + 2, state.index);
3094
+ const analysis = analyzeRepeatedExtglob(body, opts);
3095
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
3096
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
3097
+ const open = tokens[token.tokensIndex];
3098
+ open.type = "text";
3099
+ open.value = literal;
3100
+ open.output = safeOutput || utils.escapeRegex(literal);
3101
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
3102
+ tokens[i].value = "";
3103
+ tokens[i].output = "";
3104
+ delete tokens[i].suffix;
3105
+ }
3106
+ state.output = token.output + open.output;
3107
+ state.backtrack = true;
3108
+ push({ type: "paren", extglob: true, value, output: "" });
3109
+ decrement("parens");
3110
+ return;
3111
+ }
2879
3112
  let output = token.close + (opts.capture ? ")" : "");
2880
3113
  let rest;
2881
3114
  if (token.type === "negate") {
@@ -3482,9 +3715,9 @@ var require_parse2 = __commonJS({
3482
3715
  }
3483
3716
  });
3484
3717
 
3485
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
3718
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
3486
3719
  var require_picomatch = __commonJS({
3487
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports, module) {
3720
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
3488
3721
  "use strict";
3489
3722
  init_utils();
3490
3723
  var path = __require("path");
@@ -3624,9 +3857,9 @@ var require_picomatch = __commonJS({
3624
3857
  }
3625
3858
  });
3626
3859
 
3627
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js
3860
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
3628
3861
  var require_picomatch2 = __commonJS({
3629
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js"(exports, module) {
3862
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
3630
3863
  "use strict";
3631
3864
  init_utils();
3632
3865
  module.exports = require_picomatch();
@@ -1864,14 +1864,15 @@ var require_braces = __commonJS({
1864
1864
  }
1865
1865
  });
1866
1866
 
1867
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
1867
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
1868
1868
  var require_constants2 = __commonJS({
1869
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module) {
1869
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
1870
1870
  "use strict";
1871
1871
  init_utils();
1872
1872
  var path = __require("path");
1873
1873
  var WIN_SLASH = "\\\\/";
1874
1874
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1875
+ var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
1875
1876
  var DOT_LITERAL = "\\.";
1876
1877
  var PLUS_LITERAL = "\\+";
1877
1878
  var QMARK_LITERAL = "\\?";
@@ -1919,6 +1920,7 @@ var require_constants2 = __commonJS({
1919
1920
  END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
1920
1921
  };
1921
1922
  var POSIX_REGEX_SOURCE = {
1923
+ __proto__: null,
1922
1924
  alnum: "a-zA-Z0-9",
1923
1925
  alpha: "a-zA-Z",
1924
1926
  ascii: "\\x00-\\x7F",
@@ -1935,6 +1937,7 @@ var require_constants2 = __commonJS({
1935
1937
  xdigit: "A-Fa-f0-9"
1936
1938
  };
1937
1939
  module.exports = {
1940
+ DEFAULT_MAX_EXTGLOB_RECURSION,
1938
1941
  MAX_LENGTH: 1024 * 64,
1939
1942
  POSIX_REGEX_SOURCE,
1940
1943
  // regular expressions
@@ -1946,6 +1949,7 @@ var require_constants2 = __commonJS({
1946
1949
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
1947
1950
  // Replace globs with equivalent patterns to reduce parsing time.
1948
1951
  REPLACEMENTS: {
1952
+ __proto__: null,
1949
1953
  "***": "*",
1950
1954
  "**/**": "**",
1951
1955
  "**/**/**": "**"
@@ -2062,9 +2066,9 @@ var require_constants2 = __commonJS({
2062
2066
  }
2063
2067
  });
2064
2068
 
2065
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
2069
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
2066
2070
  var require_utils2 = __commonJS({
2067
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/utils.js"(exports) {
2071
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
2068
2072
  "use strict";
2069
2073
  init_utils();
2070
2074
  var path = __require("path");
@@ -2124,9 +2128,9 @@ var require_utils2 = __commonJS({
2124
2128
  }
2125
2129
  });
2126
2130
 
2127
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js
2131
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
2128
2132
  var require_scan = __commonJS({
2129
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/scan.js"(exports, module) {
2133
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
2130
2134
  "use strict";
2131
2135
  init_utils();
2132
2136
  var utils = require_utils2();
@@ -2455,9 +2459,9 @@ var require_scan = __commonJS({
2455
2459
  }
2456
2460
  });
2457
2461
 
2458
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
2462
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
2459
2463
  var require_parse2 = __commonJS({
2460
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/parse.js"(exports, module) {
2464
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
2461
2465
  "use strict";
2462
2466
  init_utils();
2463
2467
  var constants2 = require_constants2();
@@ -2485,6 +2489,213 @@ var require_parse2 = __commonJS({
2485
2489
  var syntaxError = (type, char) => {
2486
2490
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
2487
2491
  };
2492
+ var splitTopLevel = (input) => {
2493
+ const parts = [];
2494
+ let bracket = 0;
2495
+ let paren = 0;
2496
+ let quote = 0;
2497
+ let value = "";
2498
+ let escaped = false;
2499
+ for (const ch of input) {
2500
+ if (escaped === true) {
2501
+ value += ch;
2502
+ escaped = false;
2503
+ continue;
2504
+ }
2505
+ if (ch === "\\") {
2506
+ value += ch;
2507
+ escaped = true;
2508
+ continue;
2509
+ }
2510
+ if (ch === '"') {
2511
+ quote = quote === 1 ? 0 : 1;
2512
+ value += ch;
2513
+ continue;
2514
+ }
2515
+ if (quote === 0) {
2516
+ if (ch === "[") {
2517
+ bracket++;
2518
+ } else if (ch === "]" && bracket > 0) {
2519
+ bracket--;
2520
+ } else if (bracket === 0) {
2521
+ if (ch === "(") {
2522
+ paren++;
2523
+ } else if (ch === ")" && paren > 0) {
2524
+ paren--;
2525
+ } else if (ch === "|" && paren === 0) {
2526
+ parts.push(value);
2527
+ value = "";
2528
+ continue;
2529
+ }
2530
+ }
2531
+ }
2532
+ value += ch;
2533
+ }
2534
+ parts.push(value);
2535
+ return parts;
2536
+ };
2537
+ var isPlainBranch = (branch) => {
2538
+ let escaped = false;
2539
+ for (const ch of branch) {
2540
+ if (escaped === true) {
2541
+ escaped = false;
2542
+ continue;
2543
+ }
2544
+ if (ch === "\\") {
2545
+ escaped = true;
2546
+ continue;
2547
+ }
2548
+ if (/[?*+@!()[\]{}]/.test(ch)) {
2549
+ return false;
2550
+ }
2551
+ }
2552
+ return true;
2553
+ };
2554
+ var normalizeSimpleBranch = (branch) => {
2555
+ let value = branch.trim();
2556
+ let changed = true;
2557
+ while (changed === true) {
2558
+ changed = false;
2559
+ if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
2560
+ value = value.slice(2, -1);
2561
+ changed = true;
2562
+ }
2563
+ }
2564
+ if (!isPlainBranch(value)) {
2565
+ return;
2566
+ }
2567
+ return value.replace(/\\(.)/g, "$1");
2568
+ };
2569
+ var hasRepeatedCharPrefixOverlap = (branches) => {
2570
+ const values = branches.map(normalizeSimpleBranch).filter(Boolean);
2571
+ for (let i = 0; i < values.length; i++) {
2572
+ for (let j2 = i + 1; j2 < values.length; j2++) {
2573
+ const a = values[i];
2574
+ const b2 = values[j2];
2575
+ const char = a[0];
2576
+ if (!char || a !== char.repeat(a.length) || b2 !== char.repeat(b2.length)) {
2577
+ continue;
2578
+ }
2579
+ if (a === b2 || a.startsWith(b2) || b2.startsWith(a)) {
2580
+ return true;
2581
+ }
2582
+ }
2583
+ }
2584
+ return false;
2585
+ };
2586
+ var parseRepeatedExtglob = (pattern, requireEnd = true) => {
2587
+ if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
2588
+ return;
2589
+ }
2590
+ let bracket = 0;
2591
+ let paren = 0;
2592
+ let quote = 0;
2593
+ let escaped = false;
2594
+ for (let i = 1; i < pattern.length; i++) {
2595
+ const ch = pattern[i];
2596
+ if (escaped === true) {
2597
+ escaped = false;
2598
+ continue;
2599
+ }
2600
+ if (ch === "\\") {
2601
+ escaped = true;
2602
+ continue;
2603
+ }
2604
+ if (ch === '"') {
2605
+ quote = quote === 1 ? 0 : 1;
2606
+ continue;
2607
+ }
2608
+ if (quote === 1) {
2609
+ continue;
2610
+ }
2611
+ if (ch === "[") {
2612
+ bracket++;
2613
+ continue;
2614
+ }
2615
+ if (ch === "]" && bracket > 0) {
2616
+ bracket--;
2617
+ continue;
2618
+ }
2619
+ if (bracket > 0) {
2620
+ continue;
2621
+ }
2622
+ if (ch === "(") {
2623
+ paren++;
2624
+ continue;
2625
+ }
2626
+ if (ch === ")") {
2627
+ paren--;
2628
+ if (paren === 0) {
2629
+ if (requireEnd === true && i !== pattern.length - 1) {
2630
+ return;
2631
+ }
2632
+ return {
2633
+ type: pattern[0],
2634
+ body: pattern.slice(2, i),
2635
+ end: i
2636
+ };
2637
+ }
2638
+ }
2639
+ }
2640
+ };
2641
+ var getStarExtglobSequenceOutput = (pattern) => {
2642
+ let index = 0;
2643
+ const chars = [];
2644
+ while (index < pattern.length) {
2645
+ const match = parseRepeatedExtglob(pattern.slice(index), false);
2646
+ if (!match || match.type !== "*") {
2647
+ return;
2648
+ }
2649
+ const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
2650
+ if (branches.length !== 1) {
2651
+ return;
2652
+ }
2653
+ const branch = normalizeSimpleBranch(branches[0]);
2654
+ if (!branch || branch.length !== 1) {
2655
+ return;
2656
+ }
2657
+ chars.push(branch);
2658
+ index += match.end + 1;
2659
+ }
2660
+ if (chars.length < 1) {
2661
+ return;
2662
+ }
2663
+ const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
2664
+ return `${source}*`;
2665
+ };
2666
+ var repeatedExtglobRecursion = (pattern) => {
2667
+ let depth = 0;
2668
+ let value = pattern.trim();
2669
+ let match = parseRepeatedExtglob(value);
2670
+ while (match) {
2671
+ depth++;
2672
+ value = match.body.trim();
2673
+ match = parseRepeatedExtglob(value);
2674
+ }
2675
+ return depth;
2676
+ };
2677
+ var analyzeRepeatedExtglob = (body, options) => {
2678
+ if (options.maxExtglobRecursion === false) {
2679
+ return { risky: false };
2680
+ }
2681
+ const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
2682
+ const branches = splitTopLevel(body).map((branch) => branch.trim());
2683
+ if (branches.length > 1) {
2684
+ if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
2685
+ return { risky: true };
2686
+ }
2687
+ }
2688
+ for (const branch of branches) {
2689
+ const safeOutput = getStarExtglobSequenceOutput(branch);
2690
+ if (safeOutput) {
2691
+ return { risky: true, safeOutput };
2692
+ }
2693
+ if (repeatedExtglobRecursion(branch) > max) {
2694
+ return { risky: true };
2695
+ }
2696
+ }
2697
+ return { risky: false };
2698
+ };
2488
2699
  var parse2 = (input, options) => {
2489
2700
  if (typeof input !== "string") {
2490
2701
  throw new TypeError("Expected a string");
@@ -2616,6 +2827,8 @@ var require_parse2 = __commonJS({
2616
2827
  token.prev = prev;
2617
2828
  token.parens = state.parens;
2618
2829
  token.output = state.output;
2830
+ token.startIndex = state.index;
2831
+ token.tokensIndex = tokens.length;
2619
2832
  const output = (opts.capture ? "(" : "") + token.open;
2620
2833
  increment("parens");
2621
2834
  push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
@@ -2623,6 +2836,26 @@ var require_parse2 = __commonJS({
2623
2836
  extglobs.push(token);
2624
2837
  };
2625
2838
  const extglobClose = (token) => {
2839
+ const literal = input.slice(token.startIndex, state.index + 1);
2840
+ const body = input.slice(token.startIndex + 2, state.index);
2841
+ const analysis = analyzeRepeatedExtglob(body, opts);
2842
+ if ((token.type === "plus" || token.type === "star") && analysis.risky) {
2843
+ const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
2844
+ const open = tokens[token.tokensIndex];
2845
+ open.type = "text";
2846
+ open.value = literal;
2847
+ open.output = safeOutput || utils.escapeRegex(literal);
2848
+ for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
2849
+ tokens[i].value = "";
2850
+ tokens[i].output = "";
2851
+ delete tokens[i].suffix;
2852
+ }
2853
+ state.output = token.output + open.output;
2854
+ state.backtrack = true;
2855
+ push({ type: "paren", extglob: true, value, output: "" });
2856
+ decrement("parens");
2857
+ return;
2858
+ }
2626
2859
  let output = token.close + (opts.capture ? ")" : "");
2627
2860
  let rest;
2628
2861
  if (token.type === "negate") {
@@ -3229,9 +3462,9 @@ var require_parse2 = __commonJS({
3229
3462
  }
3230
3463
  });
3231
3464
 
3232
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
3465
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
3233
3466
  var require_picomatch = __commonJS({
3234
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js"(exports, module) {
3467
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
3235
3468
  "use strict";
3236
3469
  init_utils();
3237
3470
  var path = __require("path");
@@ -3371,9 +3604,9 @@ var require_picomatch = __commonJS({
3371
3604
  }
3372
3605
  });
3373
3606
 
3374
- // node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js
3607
+ // node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
3375
3608
  var require_picomatch2 = __commonJS({
3376
- "node_modules/.bun/picomatch@2.3.1/node_modules/picomatch/index.js"(exports, module) {
3609
+ "node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
3377
3610
  "use strict";
3378
3611
  init_utils();
3379
3612
  module.exports = require_picomatch();