Skip to content

Breaking changes in v3.3.0 #405

@jaydenseric

Description

@jaydenseric

With v3.2.12 the glob **/{!(*.d).mts,!(*.d).cts,*.{mjs,cjs,js}} used to select these files:

[
  ".cjs",
  ".cts",
  ".js",
  ".mjs",
  ".mts",
  "a.mjs",
  "ad.cts",
  "ad.mts",
  "a/.cjs",
  "a/.cts",
  "a/.js",
  "a/.mjs",
  "a/.mts",
  "a/a.mjs",
  "a/ad.cts",
  "a/ad.mts",
]

But now with v3.3.0 it only selects these files:

[
  ".cts",
  ".mts",
  "a.mjs",
  "ad.cts",
  "ad.mts",
  "a/.cts",
  "a/.mts",
  "a/a.mjs",
  "a/ad.cts",
  "a/ad.mts",
]

This is breaking this test assertion in find-unused-exports, which uses fast-glob indirectly as a dependency of a dependency (globby):

https://github.com/jaydenseric/find-unused-exports/blob/dd74e679e819c84e606d683f79d9ada1181a20b9/MODULE_GLOB.test.mjs#L15-L41

When using a package.json field overrides I was able to determine that the specific cause for the changed behavior of the glob was the fast-glob update from v3.2.12 to v3.3.0:

  {
    "overrides": {
-     "fast-glob": "3.2.12"
+     "fast-glob": "3.3.0"
    }
  }

It took me a lot of work to figure out the glob originally, and I'm not really sure what I can do in find-unused-exports to workaround this unexpected issue. I can't pin a particular version of fast-glob that still works because it's a dependency of a dependency (globby). It would be fantastic if this could be resolved in a speedy fast-glob patch release, assuming I'm not doing something blatantly incorrect with in my glob I could update to a more correct version.

Environment

  • OS Version: macOS v13.4
  • Node.js Version: v20.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions