Replies: 1 comment
-
Take a look here https://github.com/AugustinMauroy/typescript-package-template |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm so tired of those
slow types
errors while 90% of my code relies on the power of dynamic inference.Here's an example:
And many times it's just impossible to provide those typings because I use
Effect.ts
, which LOVES to dynamically build superclasses as function calls. It's just absolutely almost every single thing in this framework is intended to be used this way.And typescript is able to generate dts files for NPM package perfectly. No problems.
Is there just somewhere a preprocessing build step or a tool, that allows to inline those locally built type declarations into a package before publishing it to JSR, while keeping the main codebase of my library clean so I can just happily enjoy the benefits of type inference?
For example I want to write code like this:
And before publishing, it will be transformed to something like this:
It's so frustrating, that I'm forced to create 2 identifiers instead of 1 and simply using
as
also doesn't work. What's so complex aboutas
???The absurdity of it is that this code even compiles successfully with
isolatedDeclarations
enabled, but that's still not enough to publish it to JSR:Beta Was this translation helpful? Give feedback.
All reactions