Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve typescript defs #357

Merged
merged 2 commits into from
Apr 28, 2023
Merged

fix: improve typescript defs #357

merged 2 commits into from
Apr 28, 2023

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Oct 15, 2022

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 15, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: 43081j / name: James Garbutt (6552700)

);
};

/** @typedef {Omit<ResolveOptions, "fileSystem"> & Partial<Pick<ResolveOptions, "fileSystem">>} ResolveOptionsOptionalFS */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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)

@43081j
Copy link
Contributor Author

43081j commented Oct 17, 2022

@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
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Base: 95.18% // Head: 95.18% // No change to project coverage 👍

Coverage data is based on head (e9496a7) compared to base (651e578).
Patch coverage: 100.00% of modified lines in pull request are covered.

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           
Impacted Files Coverage Δ
lib/Resolver.js 88.00% <ø> (ø)
lib/index.js 98.03% <100.00%> (ø)

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@43081j
Copy link
Contributor Author

43081j commented Nov 10, 2022

@sokra any chance you can take a look at this? or any other maintainer

Copy link
Member

@TheLarkInn TheLarkInn left a comment

Choose a reason for hiding this comment

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

These are a significant improvement to enhanced-resolve. Thank you so much @43081j

@TheLarkInn TheLarkInn merged commit de23c0e into webpack:main Apr 28, 2023
@43081j 43081j deleted the improve-types branch April 28, 2023 17:28
renovate bot referenced this pull request in Unleash/unleash May 20, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](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)
|
[![age](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.14.0/compatibility-slim/5.13.0)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/enhanced-resolve/5.14.0/confidence-slim/5.13.0)](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
[@&#8203;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
[@&#8203;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 [@&#8203;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
[@&#8203;snitin315](https://togithub.com/snitin315) in
[https://github.com/webpack/enhanced-resolve/pull/378](https://togithub.com/webpack/enhanced-resolve/pull/378)

#### New Contributors

- [@&#8203;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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the typescript definitions
4 participants