refactor: replace npm glob with fs/promises glob.#110
refactor: replace npm glob with fs/promises glob.#110knightedcodemonkey merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
globpackage usage withnode:fs/promisesglob()across source and scripts (async-iterable collection). - Remove the direct
globdependency frompackage.json/package-lock.json. - Adjust exports-generation type-path assignment logic to avoid overwriting previously-set
typesentries.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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 addssubEntry.typeswhenbaseToSubpathalready has a mapping for the samebaseKey. If a declaration file (e.g.index.d.ts) is encountered before its corresponding JS/CJS file,mappedSubpathwill be missing and the function returns early, so the subpath export ends up without atypescondition. With the switch tofs/promisesglob(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 bybaseKeyand 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.
No description provided.