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

TS4 support #80

Merged
merged 5 commits into from
Feb 15, 2024
Merged

TS4 support #80

merged 5 commits into from
Feb 15, 2024

Conversation

Harris-Miller
Copy link
Collaborator

@Harris-Miller Harris-Miller commented Nov 19, 2023

This MR adds TS4 support for ramda types to address #64, #77, and DefinitelyTyped/DefinitelyTyped#67446

The current culprit is pick and omit which use the const type parameter, introduced in typescript@5

What this MR does is define separate declarations for those functions that is ts4 compatible and updates the build process to build a ts4 version of this package to include those function definition over the base ones.

As explained in the DefinitelyTyped repo, we should be able to use either @types/ramda's package.json or this repo's package.json to give typescript's resolver direction to the correct build folders so typescript <5 is supported.

@Harris-Miller
Copy link
Collaborator Author

Harris-Miller commented Feb 15, 2024

I was able to get this to fully work in a test repo locally. Steps to reproduce

  • Pull down this repo: https://github.com/Harris-Miller/ramda-ts4-test
    • npm install
    • npm run build to see the errors around pick and omit
  • Separately, pull down and build this branch
    • run npx -y yalc publish
  • Go back to ramda-ts4-test
    • run npx -y yalc link types-ramda
    • run npm run build and see no more errors!

The additions in this repo makes typescript look at a built versions of ramda types that are compatible with ts4! And it works automatically for because ramda-ts4-test has ts4

@Harris-Miller Harris-Miller changed the title Draft: TS4 support TS4 support Feb 15, 2024
@Harris-Miller Harris-Miller merged commit 1089dc5 into develop Feb 15, 2024
3 checks passed
@Harris-Miller Harris-Miller deleted the ts4-support branch February 15, 2024 22:41
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.

1 participant