@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
|
@@ -2457,14 +2457,15 @@ var require_braces = __commonJS({
|
|
|
2457
2457
|
}
|
|
2458
2458
|
});
|
|
2459
2459
|
|
|
2460
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2460
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js
|
|
2461
2461
|
var require_constants2 = __commonJS({
|
|
2462
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2462
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
2463
2463
|
"use strict";
|
|
2464
2464
|
init_utils();
|
|
2465
2465
|
var path = __require("path");
|
|
2466
2466
|
var WIN_SLASH = "\\\\/";
|
|
2467
2467
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
2468
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
2468
2469
|
var DOT_LITERAL = "\\.";
|
|
2469
2470
|
var PLUS_LITERAL = "\\+";
|
|
2470
2471
|
var QMARK_LITERAL = "\\?";
|
|
@@ -2512,6 +2513,7 @@ var require_constants2 = __commonJS({
|
|
|
2512
2513
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
2513
2514
|
};
|
|
2514
2515
|
var POSIX_REGEX_SOURCE = {
|
|
2516
|
+
__proto__: null,
|
|
2515
2517
|
alnum: "a-zA-Z0-9",
|
|
2516
2518
|
alpha: "a-zA-Z",
|
|
2517
2519
|
ascii: "\\x00-\\x7F",
|
|
@@ -2528,6 +2530,7 @@ var require_constants2 = __commonJS({
|
|
|
2528
2530
|
xdigit: "A-Fa-f0-9"
|
|
2529
2531
|
};
|
|
2530
2532
|
module.exports = {
|
|
2533
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
2531
2534
|
MAX_LENGTH: 1024 * 64,
|
|
2532
2535
|
POSIX_REGEX_SOURCE,
|
|
2533
2536
|
// regular expressions
|
|
@@ -2539,6 +2542,7 @@ var require_constants2 = __commonJS({
|
|
|
2539
2542
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
2540
2543
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
2541
2544
|
REPLACEMENTS: {
|
|
2545
|
+
__proto__: null,
|
|
2542
2546
|
"***": "*",
|
|
2543
2547
|
"**/**": "**",
|
|
2544
2548
|
"**/**/**": "**"
|
|
@@ -2655,9 +2659,9 @@ var require_constants2 = __commonJS({
|
|
|
2655
2659
|
}
|
|
2656
2660
|
});
|
|
2657
2661
|
|
|
2658
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2662
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js
|
|
2659
2663
|
var require_utils2 = __commonJS({
|
|
2660
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2664
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports) {
|
|
2661
2665
|
"use strict";
|
|
2662
2666
|
init_utils();
|
|
2663
2667
|
var path = __require("path");
|
|
@@ -2717,9 +2721,9 @@ var require_utils2 = __commonJS({
|
|
|
2717
2721
|
}
|
|
2718
2722
|
});
|
|
2719
2723
|
|
|
2720
|
-
// node_modules/.bun/picomatch@2.3.
|
|
2724
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js
|
|
2721
2725
|
var require_scan = __commonJS({
|
|
2722
|
-
"node_modules/.bun/picomatch@2.3.
|
|
2726
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
2723
2727
|
"use strict";
|
|
2724
2728
|
init_utils();
|
|
2725
2729
|
var utils = require_utils2();
|
|
@@ -3048,9 +3052,9 @@ var require_scan = __commonJS({
|
|
|
3048
3052
|
}
|
|
3049
3053
|
});
|
|
3050
3054
|
|
|
3051
|
-
// node_modules/.bun/picomatch@2.3.
|
|
3055
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js
|
|
3052
3056
|
var require_parse2 = __commonJS({
|
|
3053
|
-
"node_modules/.bun/picomatch@2.3.
|
|
3057
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
3054
3058
|
"use strict";
|
|
3055
3059
|
init_utils();
|
|
3056
3060
|
var constants2 = require_constants2();
|
|
@@ -3078,6 +3082,213 @@ var require_parse2 = __commonJS({
|
|
|
3078
3082
|
var syntaxError = (type, char) => {
|
|
3079
3083
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
3080
3084
|
};
|
|
3085
|
+
var splitTopLevel = (input) => {
|
|
3086
|
+
const parts = [];
|
|
3087
|
+
let bracket = 0;
|
|
3088
|
+
let paren = 0;
|
|
3089
|
+
let quote = 0;
|
|
3090
|
+
let value = "";
|
|
3091
|
+
let escaped = false;
|
|
3092
|
+
for (const ch of input) {
|
|
3093
|
+
if (escaped === true) {
|
|
3094
|
+
value += ch;
|
|
3095
|
+
escaped = false;
|
|
3096
|
+
continue;
|
|
3097
|
+
}
|
|
3098
|
+
if (ch === "\\") {
|
|
3099
|
+
value += ch;
|
|
3100
|
+
escaped = true;
|
|
3101
|
+
continue;
|
|
3102
|
+
}
|
|
3103
|
+
if (ch === '"') {
|
|
3104
|
+
quote = quote === 1 ? 0 : 1;
|
|
3105
|
+
value += ch;
|
|
3106
|
+
continue;
|
|
3107
|
+
}
|
|
3108
|
+
if (quote === 0) {
|
|
3109
|
+
if (ch === "[") {
|
|
3110
|
+
bracket++;
|
|
3111
|
+
} else if (ch === "]" && bracket > 0) {
|
|
3112
|
+
bracket--;
|
|
3113
|
+
} else if (bracket === 0) {
|
|
3114
|
+
if (ch === "(") {
|
|
3115
|
+
paren++;
|
|
3116
|
+
} else if (ch === ")" && paren > 0) {
|
|
3117
|
+
paren--;
|
|
3118
|
+
} else if (ch === "|" && paren === 0) {
|
|
3119
|
+
parts.push(value);
|
|
3120
|
+
value = "";
|
|
3121
|
+
continue;
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3125
|
+
value += ch;
|
|
3126
|
+
}
|
|
3127
|
+
parts.push(value);
|
|
3128
|
+
return parts;
|
|
3129
|
+
};
|
|
3130
|
+
var isPlainBranch = (branch) => {
|
|
3131
|
+
let escaped = false;
|
|
3132
|
+
for (const ch of branch) {
|
|
3133
|
+
if (escaped === true) {
|
|
3134
|
+
escaped = false;
|
|
3135
|
+
continue;
|
|
3136
|
+
}
|
|
3137
|
+
if (ch === "\\") {
|
|
3138
|
+
escaped = true;
|
|
3139
|
+
continue;
|
|
3140
|
+
}
|
|
3141
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
3142
|
+
return false;
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
return true;
|
|
3146
|
+
};
|
|
3147
|
+
var normalizeSimpleBranch = (branch) => {
|
|
3148
|
+
let value = branch.trim();
|
|
3149
|
+
let changed = true;
|
|
3150
|
+
while (changed === true) {
|
|
3151
|
+
changed = false;
|
|
3152
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
3153
|
+
value = value.slice(2, -1);
|
|
3154
|
+
changed = true;
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
if (!isPlainBranch(value)) {
|
|
3158
|
+
return;
|
|
3159
|
+
}
|
|
3160
|
+
return value.replace(/\\(.)/g, "$1");
|
|
3161
|
+
};
|
|
3162
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3163
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3164
|
+
for (let i = 0; i < values.length; i++) {
|
|
3165
|
+
for (let j2 = i + 1; j2 < values.length; j2++) {
|
|
3166
|
+
const a = values[i];
|
|
3167
|
+
const b3 = values[j2];
|
|
3168
|
+
const char = a[0];
|
|
3169
|
+
if (!char || a !== char.repeat(a.length) || b3 !== char.repeat(b3.length)) {
|
|
3170
|
+
continue;
|
|
3171
|
+
}
|
|
3172
|
+
if (a === b3 || a.startsWith(b3) || b3.startsWith(a)) {
|
|
3173
|
+
return true;
|
|
3174
|
+
}
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
return false;
|
|
3178
|
+
};
|
|
3179
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
3180
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
3181
|
+
return;
|
|
3182
|
+
}
|
|
3183
|
+
let bracket = 0;
|
|
3184
|
+
let paren = 0;
|
|
3185
|
+
let quote = 0;
|
|
3186
|
+
let escaped = false;
|
|
3187
|
+
for (let i = 1; i < pattern.length; i++) {
|
|
3188
|
+
const ch = pattern[i];
|
|
3189
|
+
if (escaped === true) {
|
|
3190
|
+
escaped = false;
|
|
3191
|
+
continue;
|
|
3192
|
+
}
|
|
3193
|
+
if (ch === "\\") {
|
|
3194
|
+
escaped = true;
|
|
3195
|
+
continue;
|
|
3196
|
+
}
|
|
3197
|
+
if (ch === '"') {
|
|
3198
|
+
quote = quote === 1 ? 0 : 1;
|
|
3199
|
+
continue;
|
|
3200
|
+
}
|
|
3201
|
+
if (quote === 1) {
|
|
3202
|
+
continue;
|
|
3203
|
+
}
|
|
3204
|
+
if (ch === "[") {
|
|
3205
|
+
bracket++;
|
|
3206
|
+
continue;
|
|
3207
|
+
}
|
|
3208
|
+
if (ch === "]" && bracket > 0) {
|
|
3209
|
+
bracket--;
|
|
3210
|
+
continue;
|
|
3211
|
+
}
|
|
3212
|
+
if (bracket > 0) {
|
|
3213
|
+
continue;
|
|
3214
|
+
}
|
|
3215
|
+
if (ch === "(") {
|
|
3216
|
+
paren++;
|
|
3217
|
+
continue;
|
|
3218
|
+
}
|
|
3219
|
+
if (ch === ")") {
|
|
3220
|
+
paren--;
|
|
3221
|
+
if (paren === 0) {
|
|
3222
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
3223
|
+
return;
|
|
3224
|
+
}
|
|
3225
|
+
return {
|
|
3226
|
+
type: pattern[0],
|
|
3227
|
+
body: pattern.slice(2, i),
|
|
3228
|
+
end: i
|
|
3229
|
+
};
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3234
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
3235
|
+
let index = 0;
|
|
3236
|
+
const chars = [];
|
|
3237
|
+
while (index < pattern.length) {
|
|
3238
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
3239
|
+
if (!match || match.type !== "*") {
|
|
3240
|
+
return;
|
|
3241
|
+
}
|
|
3242
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
3243
|
+
if (branches.length !== 1) {
|
|
3244
|
+
return;
|
|
3245
|
+
}
|
|
3246
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
3247
|
+
if (!branch || branch.length !== 1) {
|
|
3248
|
+
return;
|
|
3249
|
+
}
|
|
3250
|
+
chars.push(branch);
|
|
3251
|
+
index += match.end + 1;
|
|
3252
|
+
}
|
|
3253
|
+
if (chars.length < 1) {
|
|
3254
|
+
return;
|
|
3255
|
+
}
|
|
3256
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
3257
|
+
return `${source}*`;
|
|
3258
|
+
};
|
|
3259
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
3260
|
+
let depth = 0;
|
|
3261
|
+
let value = pattern.trim();
|
|
3262
|
+
let match = parseRepeatedExtglob(value);
|
|
3263
|
+
while (match) {
|
|
3264
|
+
depth++;
|
|
3265
|
+
value = match.body.trim();
|
|
3266
|
+
match = parseRepeatedExtglob(value);
|
|
3267
|
+
}
|
|
3268
|
+
return depth;
|
|
3269
|
+
};
|
|
3270
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
3271
|
+
if (options.maxExtglobRecursion === false) {
|
|
3272
|
+
return { risky: false };
|
|
3273
|
+
}
|
|
3274
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
3275
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
3276
|
+
if (branches.length > 1) {
|
|
3277
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
3278
|
+
return { risky: true };
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
for (const branch of branches) {
|
|
3282
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
3283
|
+
if (safeOutput) {
|
|
3284
|
+
return { risky: true, safeOutput };
|
|
3285
|
+
}
|
|
3286
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
3287
|
+
return { risky: true };
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
return { risky: false };
|
|
3291
|
+
};
|
|
3081
3292
|
var parse2 = (input, options) => {
|
|
3082
3293
|
if (typeof input !== "string") {
|
|
3083
3294
|
throw new TypeError("Expected a string");
|
|
@@ -3209,6 +3420,8 @@ var require_parse2 = __commonJS({
|
|
|
3209
3420
|
token.prev = prev;
|
|
3210
3421
|
token.parens = state.parens;
|
|
3211
3422
|
token.output = state.output;
|
|
3423
|
+
token.startIndex = state.index;
|
|
3424
|
+
token.tokensIndex = tokens.length;
|
|
3212
3425
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
3213
3426
|
increment("parens");
|
|
3214
3427
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -3216,6 +3429,26 @@ var require_parse2 = __commonJS({
|
|
|
3216
3429
|
extglobs.push(token);
|
|
3217
3430
|
};
|
|
3218
3431
|
const extglobClose = (token) => {
|
|
3432
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
3433
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
3434
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
3435
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
3436
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
3437
|
+
const open = tokens[token.tokensIndex];
|
|
3438
|
+
open.type = "text";
|
|
3439
|
+
open.value = literal;
|
|
3440
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3441
|
+
for (let i = token.tokensIndex + 1; i < tokens.length; i++) {
|
|
3442
|
+
tokens[i].value = "";
|
|
3443
|
+
tokens[i].output = "";
|
|
3444
|
+
delete tokens[i].suffix;
|
|
3445
|
+
}
|
|
3446
|
+
state.output = token.output + open.output;
|
|
3447
|
+
state.backtrack = true;
|
|
3448
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
3449
|
+
decrement("parens");
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3219
3452
|
let output = token.close + (opts.capture ? ")" : "");
|
|
3220
3453
|
let rest;
|
|
3221
3454
|
if (token.type === "negate") {
|
|
@@ -3822,9 +4055,9 @@ var require_parse2 = __commonJS({
|
|
|
3822
4055
|
}
|
|
3823
4056
|
});
|
|
3824
4057
|
|
|
3825
|
-
// node_modules/.bun/picomatch@2.3.
|
|
4058
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js
|
|
3826
4059
|
var require_picomatch = __commonJS({
|
|
3827
|
-
"node_modules/.bun/picomatch@2.3.
|
|
4060
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
|
3828
4061
|
"use strict";
|
|
3829
4062
|
init_utils();
|
|
3830
4063
|
var path = __require("path");
|
|
@@ -3964,9 +4197,9 @@ var require_picomatch = __commonJS({
|
|
|
3964
4197
|
}
|
|
3965
4198
|
});
|
|
3966
4199
|
|
|
3967
|
-
// node_modules/.bun/picomatch@2.3.
|
|
4200
|
+
// node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js
|
|
3968
4201
|
var require_picomatch2 = __commonJS({
|
|
3969
|
-
"node_modules/.bun/picomatch@2.3.
|
|
4202
|
+
"node_modules/.bun/picomatch@2.3.2/node_modules/picomatch/index.js"(exports, module) {
|
|
3970
4203
|
"use strict";
|
|
3971
4204
|
init_utils();
|
|
3972
4205
|
module.exports = require_picomatch();
|
|
@@ -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();
|