Repository navigation
Description
Summary
The root package.json overrides entry for brace-expansion forces a single 1.x version onto three consumers that declare incompatible majors. One of them, [email protected], cannot work with 1.x at all — so bun run test:coverage is currently broken on main.
Pre-existing, introduced when the pin was first added. Split out of #1949 (which bumps the pin 1.1.17 → 1.1.18 to clear GHSA-rgw5-rvv9-x895) because that change is a strict improvement and fixes nothing here either way.
Reproduce
On main, clean git clone + bun install:
$ bun run test:coverage
TypeError: (0 , brace_expansion_1.expand) is not a function
❯ braceExpand node_modules/.bun/[email protected]/.../dist/commonjs/index.js:157:41
❯ Minimatch.braceExpand ...index.js:898:40
error: script "test:coverage" exited with code 1
Reduced, via the same path vitest coverage takes:
new TestExclude({ include: ['src/tests/**/*.{test,spec}.{js,ts}'] })
.shouldInstrument('src/tests/a.test.ts')
// TypeError: (0 , brace_expansion_1.expand) is not a functionThe ESM entry fails differently: SyntaxError: Named export 'expand' not found.
Cause
Three consumers, three incompatible ranges, one forced resolution:
| consumer | declares | gets |
|---|---|---|
[email protected] |
^1.1.7 |
1.1.x ✅ |
[email protected] |
^2.0.2 |
1.1.x ❌ |
[email protected] |
^5.0.5 |
1.1.x ❌ |
[email protected] is CommonJS with module.exports = expandTop and no named expand. The 5.x line exports export function expand(str, options = {}). Different API shapes, not just different versions — and 1.x also lacks the {max, maxLength} bounds that are the actual DoS mitigation in 5.x.
Why it went unnoticed
test:all runs test, test:scripts, test:skill and rust:test — not test:coverage — so the pre-push gate never exercises it. minimatch@10 also only throws on a brace pattern ({a,b}); brace-free globs work fine.
@typescript-eslint/[email protected] reaches minimatch only under allowDefaultProject, which this repo doesn't configure — dormant rather than broken.
Options
- Per-consumer, major-correct overrides (preferred) — scoped keys pinning
1.1.18/2.1.4/5.0.9on their respective branches. Every consumer gets a patched version in its own major: clears the advisory on all lines and fixes coverage. - Bump the consumers so they carry patched
brace-expansionthemselves, then drop the override. - Drop the pin once every branch floats above its floor — simplest end state, viable only when that holds.
Acceptance criteria
-
bun run test:coveragecompletes on a clean install -
bun run auditstays clean - Every resolved
brace-expansioncopy is at or above its major's patched floor (1.1.18 / 2.1.4 / 3.0.6 / 5.0.9) - Decide whether
test:coverageshould join the pre-push gate, given a broken command sat unnoticed
Activity
malibio commentedon Aug 3, 2026
Fixed directly in #1949 rather than separately — the fix turned out to be a one-line deletion, so splitting it was unwarranted.
The fix is option 3, not option 1. Deleting the
brace-expansionoverride entirely. Upstream has caught up since #1869, so natural resolution now puts every consumer on its own major, each at or above its patched floor:1.1.18/2.1.4/5.0.9. That is what resolution did before the pin existed — the override was solving a problem that has since solved itself.Option 1 (per-consumer scoped keys) does not work. I tried it first: Bun 1.3.11 silently ignores keys like
test-exclude/minimatch/brace-expansion— they are accepted into the lockfile and have zero effect on resolution, still yielding one flattened copy. Recorded in the PR so nobody retries it.Acceptance criteria:
bun run test:coveragecompletes on a clean install — 172 files / 4112 tests, 88.43% linesbun run auditstays cleantest:coveragebelongs in the pre-push gate — left open deliberately, see belowOn that last one:
test:coveragecurrently exits 1 on the 90% global threshold (88.43% lines / 87.08% functions). That is pre-existing and unrelated to this fix, but it means the command cannot join the gate as-is without either raising coverage or lowering the threshold. That is a project decision, not a dependency one, so I have not folded it in here. Worth its own issue if you want it pursued.Drop the brace-expansion override: clears GHSA-rgw5-rvv9-x895 and unb…
Close the frontend coverage gap and wire test:coverage into the pre-p…