ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).
https://docs.superstructjs.org
MIT License
6.95k stars 224 forks source link

add tsc-alias for nodenext compatibility #1232

Closed Jakeii closed 1 month ago

Jakeii commented 3 months ago

Use tsc-alias to add file extensions to type definitions for compatibility with NodeNext

arturmuller commented 2 months ago

Hi @Jakeii — thank you so much for your PR!

I tested this locally, and unfortunately it doesn't seem to actually fix our issue.

Our core problem is with types declarations, not actual source code (since that's bundled and therefore there are no imports) and I am not sure if tsc-alias actually hooks into that.

Please lmk if you're still interested in trying to get this up and running.

@yeoffrey managed to unblock us by moving over to Vitest so the road to NodeNext compat has been cleared and this is not blocking for the release (any more).

Either way — thank you so much for the contrib! 🙌

arturmuller commented 1 month ago

@Jakeii I am going to close this for now, but if you feel like taking another crack at removing the .js extensions from our import paths in typedefs a PR is very welcome!

Jakeii commented 1 month ago

Hi @arturmuller, the tsc-alias plugin removes the need to add js extensions in ts source files, it adds them for you in both the generated js and d.ts files.

I did test locally and in worked for me?