Skip to content

refactor: replace npm glob with fs/promises glob.#110

Merged
knightedcodemonkey merged 3 commits intomainfrom
bananas
Mar 7, 2026
Merged

refactor: replace npm glob with fs/promises glob.#110
knightedcodemonkey merged 3 commits intomainfrom
bananas

Conversation

@knightedcodemonkey
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 7, 2026 18:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors filesystem globbing to rely on Node’s built-in node:fs/promises glob() instead of the external glob package, and updates the repository metadata accordingly.

Changes:

  • Replace glob package usage with node:fs/promises glob() across source and scripts (async-iterable collection).
  • Remove the direct glob dependency from package.json / package-lock.json.
  • Adjust exports-generation type-path assignment logic to avoid overwriting previously-set types entries.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/util.js Switch exports scanning to fs/promises glob and tweak types entry assignment behavior.
src/duel.js Replace glob package usage with fs/promises glob for transform/rewrite file collection.
scripts/clean-fixtures.js Use fs/promises glob for fixture cleanup target discovery.
package.json Remove glob dependency and bump version.
package-lock.json Remove glob from top-level dependencies and update lockfile version metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.57%. Comparing base (f125466) to head (09d28ea).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
+ Coverage   93.54%   93.57%   +0.02%     
==========================================
  Files           4        4              
  Lines        2199     2209      +10     
==========================================
+ Hits         2057     2067      +10     
  Misses        142      142              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 7, 2026 19:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/util.js:361

  • recordPath() only adds subEntry.types when baseToSubpath already has a mapping for the same baseKey. If a declaration file (e.g. index.d.ts) is encountered before its corresponding JS/CJS file, mappedSubpath will be missing and the function returns early, so the subpath export ends up without a types condition. With the switch to fs/promises glob (async iterable where ordering may differ), this ordering dependency can surface. Consider making the logic order-independent (e.g., a two-pass walk: first record import/require and subpaths, then attach types; or store pending types by baseKey and apply once the subpath mapping exists).
    if (kind === 'types') {
      const mappedSubpath = baseToSubpath.get(baseKey)

      if (mappedSubpath) {
        const subEntry = subpathMap.get(mappedSubpath) ?? {}
        const nextType = useWildcard ? toWildcardValue(withDot) : withDot

        subEntry.types = subEntry.types ?? nextType
        subpathMap.set(mappedSubpath, subEntry)
      }

      return

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@knightedcodemonkey knightedcodemonkey merged commit 2cead37 into main Mar 7, 2026
6 checks passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch March 7, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants