Skip to content

bundle-size dist_paths: ./-prefixed patterns never match, and root globs walk node_modules; AGENT-SCAFFOLDING omits two v4 files #327

Closed

Description

@Shinrai

Found while fixing #325 (PR #326).

1. ./-prefixed dist_paths never match

.github/actions/npm/jobs/bundle-size/action.mjs normalizes walked paths to dist/x, so a pattern such as ./dist/** or ./index.mjs never matches. Nothing warns you either, apart from the zero-match warning added in #326. Fix: strip a leading ./ from each pattern, and add a test for it.

2. Root-level globs walk node_modules and .git

A top-level pattern such as *.mjs walks from the repo root, which includes node_modules/ and .git/. The results are correct, because the regex is anchored, but the walk is slow on large installs. Fix: skip node_modules, .git, and any directory that no pattern can reach. Check the result against the existing tests.

3. AGENT-SCAFFOLDING.md omits feature-pr.yml and release-merge.yml

The "Always (v4 release flow)" table in examples/guides/AGENT-SCAFFOLDING.md doesn't list feature-pr.yml or release-merge.yml, although both are part of every v4 repo. Add them, and check the other checklists (WORKFLOW-SETUP-GUIDE.md, docs/migration/v3-to-v4.md) against the full release-flow-v4/ folder.

Activity

  1. added
    type: bug
    priority: low
    status: confirmed
    on Sep 28, 2026
  2. added theissue type on Sep 28, 2026
  3. Shinrai commented on Sep 28, 2026

    @Shinrai
    ContributorAuthor

    Checked against the measure action on #326's branch (4db8fec). All three parts hold, with one refinement to part 1.

    1. ./dist/** measures nothing, as described. ./index.mjs does match, though: a wildcard-free pattern's root is yielded as written, so it's recorded as ./index.mjs. compare then treats it as a different file from index.mjs. The fix should strip a leading ./ from both the patterns and the walked paths, so every entry is recorded under one canonical form.
    2. *.mjs resolves its walk root to . and descends into node_modules/ and .git/. The results are right because the regex is anchored; the cost is the walk.
    3. The "Always (v4 release flow)" table in AGENT-SCAFFOLDING.md lists six of the eight release-flow-v4/ files and omits feature-pr.yml and release-merge.yml. WORKFLOW-SETUP-GUIDE.md and v3-to-v4.md both reference both files.

    This touches files #326 changes (action.mjs, the new action.test.mjs, AGENT-SCAFFOLDING.md), so the fix should branch off next once #326 merges rather than stack on it.

  4. Shinrai commented on Sep 28, 2026

    @Shinrai
    ContributorAuthor

    4. Duplicate counting when globs share a walked directory

    action.mjs walks each distinct path prefix separately and doesn't de-duplicate. A leading * walks the whole repo, so a mix like *index.mjs,*index.cjs,dist/** counts every dist/ file twice. Measured with the v4.29.2 action:

    Repo Entries Unique files
    holdmytask 8 6
    droidsock 108 57
    jsonv-vscode 7 4
    slothlet +70 —

    For now, consumers are working around it by starting every glob with *.

    Fix: de-duplicate matched files by path before measuring, and add a test for overlapping patterns. Once #326's plain-file-path support and this fix ship, consumers can use natural globs such as index.mjs,index.cjs,dist/**, and the * workaround can be dropped from consumer bundle-size.yml files in a later sync.

  5. added
    status: in progress
    and removed
    status: confirmed
    on Sep 28, 2026
  6. cldmv-bot commented on Sep 28, 2026

    @cldmv-bot
    Contributor

    Closed in v4.29.3 — resolved by #328.

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

    priority: lowstatus: in progresstype: bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions