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

build: fix djs/builder type error #159

Closed
wants to merge 2 commits into from
Closed

build: fix djs/builder type error #159

wants to merge 2 commits into from

Conversation

imranbarbhuiya
Copy link
Contributor

@imranbarbhuiya imranbarbhuiya commented Jul 13, 2022

similar to #153
this pr tried to fix the djs/builder error.
djs/builder was compiled with an older version of shapeshift when ArrayValidator was accepting any type as the first generic type. But after #140, it expects unknown[] type. That's why users are getting type errors.

Note
type makeArray<T> = T extends any[] ? T : T[]; can be removed by making P 2nd generic type instead of 3rd. But then it'll throw the same error for packages that were compiled with a new version of shapeshift which's 2nd param is not an array type.
So in the future, when we'll release v4, we can remove it

@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2022

Codecov Report

Merging #159 (844b7fc) into main (31b762e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #159   +/-   ##
=======================================
  Coverage   99.34%   99.34%           
=======================================
  Files          56       56           
  Lines        3355     3358    +3     
  Branches      801      801           
=======================================
+ Hits         3333     3336    +3     
  Misses         13       13           
  Partials        9        9           
Impacted Files Coverage Δ
src/validators/ArrayValidator.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31b762e...844b7fc. Read the comment docs.

@imranbarbhuiya
Copy link
Contributor Author

imranbarbhuiya commented Jul 14, 2022

I just noticed that if anyone has ArrayValidator<string[]> then
without this pr, return type of .parse will be string[]
with this pr, it'll be string.

So we are again breaking. So I'm closing this pr and let's wait for a new builder release.
Anyone who has the issue they either need to add a resolution of ^3.4.0 or skipLibCheck before /builder releases a new version.

@imranbarbhuiya imranbarbhuiya deleted the build/fix-djs-builder-type-error branch July 14, 2022 08:22
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.

3 participants