fix: improve typescript defs#357
Conversation
|
|
| ); | ||
| }; | ||
|
|
||
| /** @typedef {Omit<ResolveOptions, "fileSystem"> & Partial<Pick<ResolveOptions, "fileSystem">>} ResolveOptionsOptionalFS */ |
There was a problem hiding this comment.
this thing bothers me. any suggestions welcome...
basically the create functions need to accept ResolveOptions with an optional filesystem, but everything else that takes options requires a filesystem (the resolver factory etc)
|
@alexander-akait have updated with the types we talked about, mind taking another look? would be good if someone can trigger the CI too (first-time contributor 😬 ) |
Codecov ReportBase: 95.18% // Head: 95.18% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
=======================================
Coverage 95.18% 95.18%
=======================================
Files 40 40
Lines 1661 1661
=======================================
Hits 1581 1581
Misses 80 80
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
@sokra any chance you can take a look at this? or any other maintainer |
TheLarkInn
left a comment
There was a problem hiding this comment.
These are a significant improvement to enhanced-resolve. Thank you so much @43081j
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [enhanced-resolve](https://togithub.com/webpack/enhanced-resolve) | [`5.13.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/enhanced-resolve/5.13.0/5.14.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>webpack/enhanced-resolve</summary> ### [`v5.14.0`](https://togithub.com/webpack/enhanced-resolve/releases/tag/v5.14.0) [Compare Source](https://togithub.com/webpack/enhanced-resolve/compare/v5.13.0...v5.14.0) #### Features - Replace deprecated String.prototype.substr() by [@​CommanderRoot](https://togithub.com/CommanderRoot) in [https://github.com/webpack/enhanced-resolve/pull/336](https://togithub.com/webpack/enhanced-resolve/pull/336) #### Bugfixes - Significantly improve type coverage & definitions for `resolve` by [@​43081j](https://togithub.com/43081j) in [https://github.com/webpack/enhanced-resolve/pull/357](https://togithub.com/webpack/enhanced-resolve/pull/357) - Fix bug where `aliasFields` was not being applied to package `exports` field by [@​alexander-akait](https://togithub.com/alexander-akait) in [https://github.com/webpack/enhanced-resolve/pull/380](https://togithub.com/webpack/enhanced-resolve/pull/380) #### Dependencies & Maintenance - Update `checkout`, `setup-node`, and `codecov` github actions by [@​snitin315](https://togithub.com/snitin315) in [https://github.com/webpack/enhanced-resolve/pull/378](https://togithub.com/webpack/enhanced-resolve/pull/378) #### New Contributors - [@​CommanderRoot](https://togithub.com/CommanderRoot) made their first contribution in [https://github.com/webpack/enhanced-resolve/pull/336](https://togithub.com/webpack/enhanced-resolve/pull/336) **Full Changelog**: webpack/enhanced-resolve@v5.13.0...v5.14.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45Ni4zIiwidXBkYXRlZEluVmVyIjoiMzUuOTYuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
fixes #356
i need some help with the overloads here i think.
you can see the strong types now mean a bunch of tests need to cast things too... im not sure there's a clean way to type the callback function strongly and not have to do those casts. the compiler is right: the result could be undefined if there's an error.