@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.
- package/dependencies-matrix.json +100 -50
- package/dist/bin/commands/agent-setup.js +245 -12
- package/dist/bin/commands/build.js +3339 -208
- package/dist/bin/commands/bump.js +245 -12
- package/dist/bin/commands/cacheout.js +245 -12
- package/dist/bin/commands/coach.js +361 -60
- package/dist/bin/commands/create-app.js +245 -12
- package/dist/bin/commands/create-project.js +253 -12
- package/dist/bin/commands/db.js +9114 -2327
- package/dist/bin/commands/deploy.js +4074 -694
- package/dist/bin/commands/dev.js +347 -33
- package/dist/bin/commands/doctor.js +408 -107
- package/dist/bin/commands/emu.js +386 -52
- package/dist/bin/commands/format.js +245 -12
- package/dist/bin/commands/get-demo.js +245 -12
- package/dist/bin/commands/make-admin.js +8356 -1516
- package/dist/bin/commands/preview.js +347 -33
- package/dist/bin/commands/seed.js +9114 -2327
- package/dist/bin/commands/setup-cicd.js +452 -132
- package/dist/bin/commands/setup.js +407 -107
- package/dist/bin/commands/staging.js +4074 -694
- package/dist/bin/commands/sync-secrets.js +246 -13
- package/dist/bin/commands/type-check.js +245 -12
- package/dist/bin/commands/wai.js +245 -12
- package/dist/bin/dndev.js +13 -4
- package/dist/bin/donotdev.js +13 -4
- package/dist/index.js +4169 -812
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +2 -1
- package/templates/app-demo/src/themes.css.example +21 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/themes.css.example +21 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/themes.css.example +21 -0
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/src/themes.css.example +21 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
- package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
- package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
- package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
- package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
- package/templates/root-consumer/.claude/rules/git.md.example +14 -0
- package/templates/root-consumer/.claude/rules/security.md.example +13 -0
- package/templates/root-consumer/.claude/settings.json.example +123 -1
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/AI.md.example +2 -2
- package/templates/root-consumer/CLAUDE.md.example +33 -1
- package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +10 -5
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
- package/templates/app-demo/public/manifest.json.example +0 -10
- package/templates/app-dndev/public/manifest.json.example +0 -10
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -184
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
- package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
- package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
|
@@ -2006,14 +2006,15 @@ var require_braces = __commonJS({
|
|
|
2006
2006
|
}
|
|
2007
2007
|
});
|
|
2008
2008
|
|
|
2009
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2009
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
|
|
2010
2010
|
var require_constants2 = __commonJS({
|
|
2011
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2011
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
2012
2012
|
"use strict";
|
|
2013
2013
|
init_utils();
|
|
2014
2014
|
var path = __require("path");
|
|
2015
2015
|
var WIN_SLASH = "\\\\/";
|
|
2016
2016
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
2017
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
2017
2018
|
var DOT_LITERAL = "\\.";
|
|
2018
2019
|
var PLUS_LITERAL = "\\+";
|
|
2019
2020
|
var QMARK_LITERAL = "\\?";
|
|
@@ -2061,6 +2062,7 @@ var require_constants2 = __commonJS({
|
|
|
2061
2062
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
2062
2063
|
};
|
|
2063
2064
|
var POSIX_REGEX_SOURCE = {
|
|
2065
|
+
__proto__: null,
|
|
2064
2066
|
alnum: "a-zA-Z0-9",
|
|
2065
2067
|
alpha: "a-zA-Z",
|
|
2066
2068
|
ascii: "\\x00-\\x7F",
|
|
@@ -2077,6 +2079,7 @@ var require_constants2 = __commonJS({
|
|
|
2077
2079
|
xdigit: "A-Fa-f0-9"
|
|
2078
2080
|
};
|
|
2079
2081
|
module.exports = {
|
|
2082
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
2080
2083
|
MAX_LENGTH: 1024 * 64,
|
|
2081
2084
|
POSIX_REGEX_SOURCE,
|
|
2082
2085
|
// regular expressions
|
|
@@ -2088,6 +2091,7 @@ var require_constants2 = __commonJS({
|
|
|
2088
2091
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
2089
2092
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
2090
2093
|
REPLACEMENTS: {
|
|
2094
|
+
__proto__: null,
|
|
2091
2095
|
"***": "*",
|
|
2092
2096
|
"**/**": "**",
|
|
2093
2097
|
"**/**/**": "**"
|
|
@@ -2204,9 +2208,9 @@ var require_constants2 = __commonJS({
|
|
|
2204
2208
|
}
|
|
2205
2209
|
});
|
|
2206
2210
|
|
|
2207
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2211
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
|
|
2208
2212
|
var require_utils2 = __commonJS({
|
|
2209
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2213
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
|
|
2210
2214
|
"use strict";
|
|
2211
2215
|
init_utils();
|
|
2212
2216
|
var path = __require("path");
|
|
@@ -2266,9 +2270,9 @@ var require_utils2 = __commonJS({
|
|
|
2266
2270
|
}
|
|
2267
2271
|
});
|
|
2268
2272
|
|
|
2269
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2273
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
|
|
2270
2274
|
var require_scan = __commonJS({
|
|
2271
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2275
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
2272
2276
|
"use strict";
|
|
2273
2277
|
init_utils();
|
|
2274
2278
|
var utils = require_utils2();
|
|
@@ -2597,9 +2601,9 @@ var require_scan = __commonJS({
|
|
|
2597
2601
|
}
|
|
2598
2602
|
});
|
|
2599
2603
|
|
|
2600
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2604
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
|
|
2601
2605
|
var require_parse2 = __commonJS({
|
|
2602
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2606
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
2603
2607
|
"use strict";
|
|
2604
2608
|
init_utils();
|
|
2605
2609
|
var constants2 = require_constants2();
|
|
@@ -2627,6 +2631,213 @@ var require_parse2 = __commonJS({
|
|
|
2627
2631
|
var syntaxError = (type, char) => {
|
|
2628
2632
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
2629
2633
|
};
|
|
2634
|
+
var splitTopLevel = (input) => {
|
|
2635
|
+
const parts = [];
|
|
2636
|
+
let bracket = 0;
|
|
2637
|
+
let paren = 0;
|
|
2638
|
+
let quote = 0;
|
|
2639
|
+
let value = "";
|
|
2640
|
+
let escaped = false;
|
|
2641
|
+
for (const ch of input) {
|
|
2642
|
+
if (escaped === true) {
|
|
2643
|
+
value += ch;
|
|
2644
|
+
escaped = false;
|
|
2645
|
+
continue;
|
|
2646
|
+
}
|
|
2647
|
+
if (ch === "\\") {
|
|
2648
|
+
value += ch;
|
|
2649
|
+
escaped = true;
|
|
2650
|
+
continue;
|
|
2651
|
+
}
|
|
2652
|
+
if (ch === '"') {
|
|
2653
|
+
quote = quote === 1 ? 0 : 1;
|
|
2654
|
+
value += ch;
|
|
2655
|
+
continue;
|
|
2656
|
+
}
|
|
2657
|
+
if (quote === 0) {
|
|
2658
|
+
if (ch === "[") {
|
|
2659
|
+
bracket++;
|
|
2660
|
+
} else if (ch === "]" && bracket > 0) {
|
|
2661
|
+
bracket--;
|
|
2662
|
+
} else if (bracket === 0) {
|
|
2663
|
+
if (ch === "(") {
|
|
2664
|
+
paren++;
|
|
2665
|
+
} else if (ch === ")" && paren > 0) {
|
|
2666
|
+
paren--;
|
|
2667
|
+
} else if (ch === "|" && paren === 0) {
|
|
2668
|
+
parts.push(value);
|
|
2669
|
+
value = "";
|
|
2670
|
+
continue;
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
value += ch;
|
|
2675
|
+
}
|
|
2676
|
+
parts.push(value);
|
|
2677
|
+
return parts;
|
|
2678
|
+
};
|
|
2679
|
+
var isPlainBranch = (branch) => {
|
|
2680
|
+
let escaped = false;
|
|
2681
|
+
for (const ch of branch) {
|
|
2682
|
+
if (escaped === true) {
|
|
2683
|
+
escaped = false;
|
|
2684
|
+
continue;
|
|
2685
|
+
}
|
|
2686
|
+
if (ch === "\\") {
|
|
2687
|
+
escaped = true;
|
|
2688
|
+
continue;
|
|
2689
|
+
}
|
|
2690
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
2691
|
+
return false;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
return true;
|
|
2695
|
+
};
|
|
2696
|
+
var normalizeSimpleBranch = (branch) => {
|
|
2697
|
+
let value = branch.trim();
|
|
2698
|
+
let changed = true;
|
|
2699
|
+
while (changed === true) {
|
|
2700
|
+
changed = false;
|
|
2701
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
2702
|
+
value = value.slice(2, -1);
|
|
2703
|
+
changed = true;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
if (!isPlainBranch(value)) {
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
return value.replace(/\\(.)/g, "$1");
|
|
2710
|
+
};
|
|
2711
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2712
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2713
|
+
for (let i = 0; i < values.length; i++) {
|
|
2714
|
+
for (let j2 = i + 1; j2 < values.length; j2++) {
|
|
2715
|
+
const a = values[i];
|
|
2716
|
+
const b2 = values[j2];
|
|
2717
|
+
const char = a[0];
|
|
2718
|
+
if (!char || a !== char.repeat(a.length) || b2 !== char.repeat(b2.length)) {
|
|
2719
|
+
continue;
|
|
2720
|
+
}
|
|
2721
|
+
if (a === b2 || a.startsWith(b2) || b2.startsWith(a)) {
|
|
2722
|
+
return true;
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
return false;
|
|
2727
|
+
};
|
|
2728
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
2729
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
let bracket = 0;
|
|
2733
|
+
let paren = 0;
|
|
2734
|
+
let quote = 0;
|
|
2735
|
+
let escaped = false;
|
|
2736
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
2737
|
+
const ch = pattern[i];
|
|
2738
|
+
if (escaped === true) {
|
|
2739
|
+
escaped = false;
|
|
2740
|
+
continue;
|
|
2741
|
+
}
|
|
2742
|
+
if (ch === "\\") {
|
|
2743
|
+
escaped = true;
|
|
2744
|
+
continue;
|
|
2745
|
+
}
|
|
2746
|
+
if (ch === '"') {
|
|
2747
|
+
quote = quote === 1 ? 0 : 1;
|
|
2748
|
+
continue;
|
|
2749
|
+
}
|
|
2750
|
+
if (quote === 1) {
|
|
2751
|
+
continue;
|
|
2752
|
+
}
|
|
2753
|
+
if (ch === "[") {
|
|
2754
|
+
bracket++;
|
|
2755
|
+
continue;
|
|
2756
|
+
}
|
|
2757
|
+
if (ch === "]" && bracket > 0) {
|
|
2758
|
+
bracket--;
|
|
2759
|
+
continue;
|
|
2760
|
+
}
|
|
2761
|
+
if (bracket > 0) {
|
|
2762
|
+
continue;
|
|
2763
|
+
}
|
|
2764
|
+
if (ch === "(") {
|
|
2765
|
+
paren++;
|
|
2766
|
+
continue;
|
|
2767
|
+
}
|
|
2768
|
+
if (ch === ")") {
|
|
2769
|
+
paren--;
|
|
2770
|
+
if (paren === 0) {
|
|
2771
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
2772
|
+
return;
|
|
2773
|
+
}
|
|
2774
|
+
return {
|
|
2775
|
+
type: pattern[0],
|
|
2776
|
+
body: pattern.slice(2, i),
|
|
2777
|
+
end: i
|
|
2778
|
+
};
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
2784
|
+
let index = 0;
|
|
2785
|
+
const chars = [];
|
|
2786
|
+
while (index < pattern.length) {
|
|
2787
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
2788
|
+
if (!match || match.type !== "*") {
|
|
2789
|
+
return;
|
|
2790
|
+
}
|
|
2791
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
2792
|
+
if (branches.length !== 1) {
|
|
2793
|
+
return;
|
|
2794
|
+
}
|
|
2795
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
2796
|
+
if (!branch || branch.length !== 1) {
|
|
2797
|
+
return;
|
|
2798
|
+
}
|
|
2799
|
+
chars.push(branch);
|
|
2800
|
+
index += match.end + 1;
|
|
2801
|
+
}
|
|
2802
|
+
if (chars.length < 1) {
|
|
2803
|
+
return;
|
|
2804
|
+
}
|
|
2805
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
2806
|
+
return `${source}*`;
|
|
2807
|
+
};
|
|
2808
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
2809
|
+
let depth = 0;
|
|
2810
|
+
let value = pattern.trim();
|
|
2811
|
+
let match = parseRepeatedExtglob(value);
|
|
2812
|
+
while (match) {
|
|
2813
|
+
depth++;
|
|
2814
|
+
value = match.body.trim();
|
|
2815
|
+
match = parseRepeatedExtglob(value);
|
|
2816
|
+
}
|
|
2817
|
+
return depth;
|
|
2818
|
+
};
|
|
2819
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
2820
|
+
if (options.maxExtglobRecursion === false) {
|
|
2821
|
+
return { risky: false };
|
|
2822
|
+
}
|
|
2823
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
2824
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
2825
|
+
if (branches.length > 1) {
|
|
2826
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
2827
|
+
return { risky: true };
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
for (const branch of branches) {
|
|
2831
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
2832
|
+
if (safeOutput) {
|
|
2833
|
+
return { risky: true, safeOutput };
|
|
2834
|
+
}
|
|
2835
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
2836
|
+
return { risky: true };
|
|
2837
|
+
}
|
|
2838
|
+
}
|
|
2839
|
+
return { risky: false };
|
|
2840
|
+
};
|
|
2630
2841
|
var parse2 = (input, options) => {
|
|
2631
2842
|
if (typeof input !== "string") {
|
|
2632
2843
|
throw new TypeError("Expected a string");
|
|
@@ -2758,6 +2969,8 @@ var require_parse2 = __commonJS({
|
|
|
2758
2969
|
token.prev = prev;
|
|
2759
2970
|
token.parens = state.parens;
|
|
2760
2971
|
token.output = state.output;
|
|
2972
|
+
token.startIndex = state.index;
|
|
2973
|
+
token.tokensIndex = tokens.length;
|
|
2761
2974
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
2762
2975
|
increment("parens");
|
|
2763
2976
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -2765,6 +2978,26 @@ var require_parse2 = __commonJS({
|
|
|
2765
2978
|
extglobs.push(token);
|
|
2766
2979
|
};
|
|
2767
2980
|
const extglobClose = (token) => {
|
|
2981
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
2982
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
2983
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
2984
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
2985
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
2986
|
+
const open = tokens[token.tokensIndex];
|
|
2987
|
+
open.type = "text";
|
|
2988
|
+
open.value = literal;
|
|
2989
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
2990
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
2991
|
+
tokens[i].value = "";
|
|
2992
|
+
tokens[i].output = "";
|
|
2993
|
+
delete tokens[i].suffix;
|
|
2994
|
+
}
|
|
2995
|
+
state.output = token.output + open.output;
|
|
2996
|
+
state.backtrack = true;
|
|
2997
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
2998
|
+
decrement("parens");
|
|
2999
|
+
return;
|
|
3000
|
+
}
|
|
2768
3001
|
let output = token.close + (opts.capture ? ")" : "");
|
|
2769
3002
|
let rest;
|
|
2770
3003
|
if (token.type === "negate") {
|
|
@@ -3371,9 +3604,9 @@ var require_parse2 = __commonJS({
|
|
|
3371
3604
|
}
|
|
3372
3605
|
});
|
|
3373
3606
|
|
|
3374
|
-
// node_modules/.bun/picomatch@2.3.
|
|
3607
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
|
|
3375
3608
|
var require_picomatch = __commonJS({
|
|
3376
|
-
"node_modules/.bun/picomatch@2.3.
|
|
3609
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
3377
3610
|
"use strict";
|
|
3378
3611
|
init_utils();
|
|
3379
3612
|
var path = __require("path");
|
|
@@ -3513,9 +3746,9 @@ var require_picomatch = __commonJS({
|
|
|
3513
3746
|
}
|
|
3514
3747
|
});
|
|
3515
3748
|
|
|
3516
|
-
// node_modules/.bun/picomatch@2.3.
|
|
3749
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
|
|
3517
3750
|
var require_picomatch2 = __commonJS({
|
|
3518
|
-
"node_modules/.bun/picomatch@2.3.
|
|
3751
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
|
|
3519
3752
|
"use strict";
|
|
3520
3753
|
init_utils();
|
|
3521
3754
|
module.exports = require_picomatch();
|
|
@@ -2247,14 +2247,15 @@ var require_braces = __commonJS({
|
|
|
2247
2247
|
}
|
|
2248
2248
|
});
|
|
2249
2249
|
|
|
2250
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2250
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
|
|
2251
2251
|
var require_constants2 = __commonJS({
|
|
2252
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2252
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
2253
2253
|
"use strict";
|
|
2254
2254
|
init_utils();
|
|
2255
2255
|
var path = __require("path");
|
|
2256
2256
|
var WIN_SLASH = "\\\\/";
|
|
2257
2257
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
2258
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
2258
2259
|
var DOT_LITERAL = "\\.";
|
|
2259
2260
|
var PLUS_LITERAL = "\\+";
|
|
2260
2261
|
var QMARK_LITERAL = "\\?";
|
|
@@ -2302,6 +2303,7 @@ var require_constants2 = __commonJS({
|
|
|
2302
2303
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
2303
2304
|
};
|
|
2304
2305
|
var POSIX_REGEX_SOURCE = {
|
|
2306
|
+
__proto__: null,
|
|
2305
2307
|
alnum: "a-zA-Z0-9",
|
|
2306
2308
|
alpha: "a-zA-Z",
|
|
2307
2309
|
ascii: "\\x00-\\x7F",
|
|
@@ -2318,6 +2320,7 @@ var require_constants2 = __commonJS({
|
|
|
2318
2320
|
xdigit: "A-Fa-f0-9"
|
|
2319
2321
|
};
|
|
2320
2322
|
module.exports = {
|
|
2323
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
2321
2324
|
MAX_LENGTH: 1024 * 64,
|
|
2322
2325
|
POSIX_REGEX_SOURCE,
|
|
2323
2326
|
// regular expressions
|
|
@@ -2329,6 +2332,7 @@ var require_constants2 = __commonJS({
|
|
|
2329
2332
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
2330
2333
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
2331
2334
|
REPLACEMENTS: {
|
|
2335
|
+
__proto__: null,
|
|
2332
2336
|
"***": "*",
|
|
2333
2337
|
"**/**": "**",
|
|
2334
2338
|
"**/**/**": "**"
|
|
@@ -2445,9 +2449,9 @@ var require_constants2 = __commonJS({
|
|
|
2445
2449
|
}
|
|
2446
2450
|
});
|
|
2447
2451
|
|
|
2448
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2452
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
|
|
2449
2453
|
var require_utils2 = __commonJS({
|
|
2450
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2454
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
|
|
2451
2455
|
"use strict";
|
|
2452
2456
|
init_utils();
|
|
2453
2457
|
var path = __require("path");
|
|
@@ -2507,9 +2511,9 @@ var require_utils2 = __commonJS({
|
|
|
2507
2511
|
}
|
|
2508
2512
|
});
|
|
2509
2513
|
|
|
2510
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2514
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
|
|
2511
2515
|
var require_scan = __commonJS({
|
|
2512
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2516
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
2513
2517
|
"use strict";
|
|
2514
2518
|
init_utils();
|
|
2515
2519
|
var utils = require_utils2();
|
|
@@ -2838,9 +2842,9 @@ var require_scan = __commonJS({
|
|
|
2838
2842
|
}
|
|
2839
2843
|
});
|
|
2840
2844
|
|
|
2841
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2845
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
|
|
2842
2846
|
var require_parse2 = __commonJS({
|
|
2843
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2847
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
2844
2848
|
"use strict";
|
|
2845
2849
|
init_utils();
|
|
2846
2850
|
var constants2 = require_constants2();
|
|
@@ -2868,6 +2872,213 @@ var require_parse2 = __commonJS({
|
|
|
2868
2872
|
var syntaxError = (type, char) => {
|
|
2869
2873
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
2870
2874
|
};
|
|
2875
|
+
var splitTopLevel = (input) => {
|
|
2876
|
+
const parts = [];
|
|
2877
|
+
let bracket = 0;
|
|
2878
|
+
let paren = 0;
|
|
2879
|
+
let quote = 0;
|
|
2880
|
+
let value = "";
|
|
2881
|
+
let escaped = false;
|
|
2882
|
+
for (const ch of input) {
|
|
2883
|
+
if (escaped === true) {
|
|
2884
|
+
value += ch;
|
|
2885
|
+
escaped = false;
|
|
2886
|
+
continue;
|
|
2887
|
+
}
|
|
2888
|
+
if (ch === "\\") {
|
|
2889
|
+
value += ch;
|
|
2890
|
+
escaped = true;
|
|
2891
|
+
continue;
|
|
2892
|
+
}
|
|
2893
|
+
if (ch === '"') {
|
|
2894
|
+
quote = quote === 1 ? 0 : 1;
|
|
2895
|
+
value += ch;
|
|
2896
|
+
continue;
|
|
2897
|
+
}
|
|
2898
|
+
if (quote === 0) {
|
|
2899
|
+
if (ch === "[") {
|
|
2900
|
+
bracket++;
|
|
2901
|
+
} else if (ch === "]" && bracket > 0) {
|
|
2902
|
+
bracket--;
|
|
2903
|
+
} else if (bracket === 0) {
|
|
2904
|
+
if (ch === "(") {
|
|
2905
|
+
paren++;
|
|
2906
|
+
} else if (ch === ")" && paren > 0) {
|
|
2907
|
+
paren--;
|
|
2908
|
+
} else if (ch === "|" && paren === 0) {
|
|
2909
|
+
parts.push(value);
|
|
2910
|
+
value = "";
|
|
2911
|
+
continue;
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
value += ch;
|
|
2916
|
+
}
|
|
2917
|
+
parts.push(value);
|
|
2918
|
+
return parts;
|
|
2919
|
+
};
|
|
2920
|
+
var isPlainBranch = (branch) => {
|
|
2921
|
+
let escaped = false;
|
|
2922
|
+
for (const ch of branch) {
|
|
2923
|
+
if (escaped === true) {
|
|
2924
|
+
escaped = false;
|
|
2925
|
+
continue;
|
|
2926
|
+
}
|
|
2927
|
+
if (ch === "\\") {
|
|
2928
|
+
escaped = true;
|
|
2929
|
+
continue;
|
|
2930
|
+
}
|
|
2931
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
2932
|
+
return false;
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
return true;
|
|
2936
|
+
};
|
|
2937
|
+
var normalizeSimpleBranch = (branch) => {
|
|
2938
|
+
let value = branch.trim();
|
|
2939
|
+
let changed = true;
|
|
2940
|
+
while (changed === true) {
|
|
2941
|
+
changed = false;
|
|
2942
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
2943
|
+
value = value.slice(2, -1);
|
|
2944
|
+
changed = true;
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
if (!isPlainBranch(value)) {
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
return value.replace(/\\(.)/g, "$1");
|
|
2951
|
+
};
|
|
2952
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2953
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2954
|
+
for (let i = 0; i < values.length; i++) {
|
|
2955
|
+
for (let j2 = i + 1; j2 < values.length; j2++) {
|
|
2956
|
+
const a = values[i];
|
|
2957
|
+
const b3 = values[j2];
|
|
2958
|
+
const char = a[0];
|
|
2959
|
+
if (!char || a !== char.repeat(a.length) || b3 !== char.repeat(b3.length)) {
|
|
2960
|
+
continue;
|
|
2961
|
+
}
|
|
2962
|
+
if (a === b3 || a.startsWith(b3) || b3.startsWith(a)) {
|
|
2963
|
+
return true;
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
return false;
|
|
2968
|
+
};
|
|
2969
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
2970
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
let bracket = 0;
|
|
2974
|
+
let paren = 0;
|
|
2975
|
+
let quote = 0;
|
|
2976
|
+
let escaped = false;
|
|
2977
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
2978
|
+
const ch = pattern[i];
|
|
2979
|
+
if (escaped === true) {
|
|
2980
|
+
escaped = false;
|
|
2981
|
+
continue;
|
|
2982
|
+
}
|
|
2983
|
+
if (ch === "\\") {
|
|
2984
|
+
escaped = true;
|
|
2985
|
+
continue;
|
|
2986
|
+
}
|
|
2987
|
+
if (ch === '"') {
|
|
2988
|
+
quote = quote === 1 ? 0 : 1;
|
|
2989
|
+
continue;
|
|
2990
|
+
}
|
|
2991
|
+
if (quote === 1) {
|
|
2992
|
+
continue;
|
|
2993
|
+
}
|
|
2994
|
+
if (ch === "[") {
|
|
2995
|
+
bracket++;
|
|
2996
|
+
continue;
|
|
2997
|
+
}
|
|
2998
|
+
if (ch === "]" && bracket > 0) {
|
|
2999
|
+
bracket--;
|
|
3000
|
+
continue;
|
|
3001
|
+
}
|
|
3002
|
+
if (bracket > 0) {
|
|
3003
|
+
continue;
|
|
3004
|
+
}
|
|
3005
|
+
if (ch === "(") {
|
|
3006
|
+
paren++;
|
|
3007
|
+
continue;
|
|
3008
|
+
}
|
|
3009
|
+
if (ch === ")") {
|
|
3010
|
+
paren--;
|
|
3011
|
+
if (paren === 0) {
|
|
3012
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
3013
|
+
return;
|
|
3014
|
+
}
|
|
3015
|
+
return {
|
|
3016
|
+
type: pattern[0],
|
|
3017
|
+
body: pattern.slice(2, i),
|
|
3018
|
+
end: i
|
|
3019
|
+
};
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
};
|
|
3024
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
3025
|
+
let index = 0;
|
|
3026
|
+
const chars = [];
|
|
3027
|
+
while (index < pattern.length) {
|
|
3028
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
3029
|
+
if (!match || match.type !== "*") {
|
|
3030
|
+
return;
|
|
3031
|
+
}
|
|
3032
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
3033
|
+
if (branches.length !== 1) {
|
|
3034
|
+
return;
|
|
3035
|
+
}
|
|
3036
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
3037
|
+
if (!branch || branch.length !== 1) {
|
|
3038
|
+
return;
|
|
3039
|
+
}
|
|
3040
|
+
chars.push(branch);
|
|
3041
|
+
index += match.end + 1;
|
|
3042
|
+
}
|
|
3043
|
+
if (chars.length < 1) {
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
3047
|
+
return `${source}*`;
|
|
3048
|
+
};
|
|
3049
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
3050
|
+
let depth = 0;
|
|
3051
|
+
let value = pattern.trim();
|
|
3052
|
+
let match = parseRepeatedExtglob(value);
|
|
3053
|
+
while (match) {
|
|
3054
|
+
depth++;
|
|
3055
|
+
value = match.body.trim();
|
|
3056
|
+
match = parseRepeatedExtglob(value);
|
|
3057
|
+
}
|
|
3058
|
+
return depth;
|
|
3059
|
+
};
|
|
3060
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
3061
|
+
if (options.maxExtglobRecursion === false) {
|
|
3062
|
+
return { risky: false };
|
|
3063
|
+
}
|
|
3064
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
3065
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
3066
|
+
if (branches.length > 1) {
|
|
3067
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
3068
|
+
return { risky: true };
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
for (const branch of branches) {
|
|
3072
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
3073
|
+
if (safeOutput) {
|
|
3074
|
+
return { risky: true, safeOutput };
|
|
3075
|
+
}
|
|
3076
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
3077
|
+
return { risky: true };
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
return { risky: false };
|
|
3081
|
+
};
|
|
2871
3082
|
var parse2 = (input, options) => {
|
|
2872
3083
|
if (typeof input !== "string") {
|
|
2873
3084
|
throw new TypeError("Expected a string");
|
|
@@ -2999,6 +3210,8 @@ var require_parse2 = __commonJS({
|
|
|
2999
3210
|
token.prev = prev;
|
|
3000
3211
|
token.parens = state.parens;
|
|
3001
3212
|
token.output = state.output;
|
|
3213
|
+
token.startIndex = state.index;
|
|
3214
|
+
token.tokensIndex = tokens.length;
|
|
3002
3215
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
3003
3216
|
increment("parens");
|
|
3004
3217
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -3006,6 +3219,26 @@ var require_parse2 = __commonJS({
|
|
|
3006
3219
|
extglobs.push(token);
|
|
3007
3220
|
};
|
|
3008
3221
|
const extglobClose = (token) => {
|
|
3222
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
3223
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
3224
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
3225
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
3226
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
3227
|
+
const open = tokens[token.tokensIndex];
|
|
3228
|
+
open.type = "text";
|
|
3229
|
+
open.value = literal;
|
|
3230
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3231
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
3232
|
+
tokens[i].value = "";
|
|
3233
|
+
tokens[i].output = "";
|
|
3234
|
+
delete tokens[i].suffix;
|
|
3235
|
+
}
|
|
3236
|
+
state.output = token.output + open.output;
|
|
3237
|
+
state.backtrack = true;
|
|
3238
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
3239
|
+
decrement("parens");
|
|
3240
|
+
return;
|
|
3241
|
+
}
|
|
3009
3242
|
let output = token.close + (opts.capture ? ")" : "");
|
|
3010
3243
|
let rest;
|
|
3011
3244
|
if (token.type === "negate") {
|
|
@@ -3612,9 +3845,9 @@ var require_parse2 = __commonJS({
|
|
|
3612
3845
|
}
|
|
3613
3846
|
});
|
|
3614
3847
|
|
|
3615
|
-
// node_modules/.bun/picomatch@2.3.
|
|
3848
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
|
|
3616
3849
|
var require_picomatch = __commonJS({
|
|
3617
|
-
"node_modules/.bun/picomatch@2.3.
|
|
3850
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
3618
3851
|
"use strict";
|
|
3619
3852
|
init_utils();
|
|
3620
3853
|
var path = __require("path");
|
|
@@ -3754,9 +3987,9 @@ var require_picomatch = __commonJS({
|
|
|
3754
3987
|
}
|
|
3755
3988
|
});
|
|
3756
3989
|
|
|
3757
|
-
// node_modules/.bun/picomatch@2.3.
|
|
3990
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
|
|
3758
3991
|
var require_picomatch2 = __commonJS({
|
|
3759
|
-
"node_modules/.bun/picomatch@2.3.
|
|
3992
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
|
|
3760
3993
|
"use strict";
|
|
3761
3994
|
init_utils();
|
|
3762
3995
|
module.exports = require_picomatch();
|