Skip to content

brace-expansion override forces one major onto three consumers, breaking test:coverage #1950

Closed

Description

@malibio

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 function

The 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

  1. Per-consumer, major-correct overrides (preferred) — scoped keys pinning 1.1.18 / 2.1.4 / 5.0.9 on their respective branches. Every consumer gets a patched version in its own major: clears the advisory on all lines and fixes coverage.
  2. Bump the consumers so they carry patched brace-expansion themselves, then drop the override.
  3. Drop the pin once every branch floats above its floor — simplest end state, viable only when that holds.

Acceptance criteria

  • bun run test:coverage completes on a clean install
  • bun run audit stays clean
  • Every resolved brace-expansion copy is at or above its major's patched floor (1.1.18 / 2.1.4 / 3.0.6 / 5.0.9)
  • Decide whether test:coverage should join the pre-push gate, given a broken command sat unnoticed

Activity

  1. added
    bug
    on Aug 3, 2026
  2. malibio commented on Aug 3, 2026

    @malibio
    CollaboratorAuthor

    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-expansion override 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:coverage completes on a clean install — 172 files / 4112 tests, 88.43% lines
    • bun run audit stays clean
    • Every resolved copy at or above its major's floor — verified in clean-room clones
    • Whether test:coverage belongs in the pre-push gate — left open deliberately, see below

    On that last one: test:coverage currently 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.

  3. added 2 commits that reference this issue on Aug 3, 2026
    703b2af
    fdc4909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions