fix(types): fix 388 type errors and fully type src/lib/functions/#7130
Merged
fix(types): fix 388 type errors and fully type src/lib/functions/#7130
src/lib/functions/#7130Conversation
serhalp
commented
Mar 25, 2025
cd97ce2 to
f0f36a6
Compare
src/lib/functions/src/lib/functions/
489d51d to
d350f09
Compare
src/lib/functions/src/lib/functions/
7b2f737 to
fd95e71
Compare
serhalp
commented
Apr 3, 2025
serhalp
commented
Apr 3, 2025
serhalp
commented
Apr 3, 2025
Comment on lines
-27
to
-29
| if (!siteData) { | ||
| error(`Unable to process site`) | ||
| } |
Member
Author
There was a problem hiding this comment.
This was just compensating for incorrectly refined types
serhalp
commented
Apr 3, 2025
Comment on lines
-40
to
+43
| Name: user?.full_name, | ||
| Email: user?.email, | ||
| Name: user.full_name, | ||
| Email: user.email, |
Member
Author
There was a problem hiding this comment.
This was compensating for incorrectly refined types
I technically changed these behaviours when I pulled in `read-package-up` in these code paths. This switches to `read-pkg` to keep the previous behaviour.
serhalp
commented
Apr 7, 2025
serhalp
commented
Apr 7, 2025
| } | ||
|
|
||
| public get(key: string): T[typeof key] { | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-return |
Member
Author
There was a problem hiding this comment.
This is due to an indirect merge conflict from the rebase on #7165. I had removed a bunch of file-wide eslint suppressions for this file, but that PR reintroduced some. I didn't want to bother digging too much here (T[type of key] is any by design...).
This was referenced Apr 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This started as a bump of https://github.com/netlify/local-functions-proxy/pull/137 to pull in the now-typed version of
@netlify/functions-proxybut devolved into fixing hundreds of types.This fully types
src/lib/functions/and fixes a number of core types used across the codebase.These types revealed various minor runtime errors / bugs that I also fixed, but in a separate PR that I'll open stacked on this one. I tried to mostly keep behavioural changes for that follow-up PR, but I did include a few here, which I'll call out in inline comments.
Reviewing
Sorry this is big and sorry I didn't break this down into smaller commits much. I'd recommend reviewing the smaller commits first and finishing with
fix(types): fix functions types and much morethenfix: fix functions regression and fully type lib/functions/.To do
tests/integration/commands/dev/dev-miscellaneous.test.tsHost machine does not support local functions proxy serverfailure on ubuntu-latest node 18.17.0netlify/buildfixes and bump here to fix a few more errors (or just do as a follow-up)