-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use the typings
section of package.json
instead of a path
#8
Comments
I think I can try to get array of modules and generate
And after that I can put this file in typescript program, and typescript will resolve all files using its own mechanics |
I wasn't aware of the But if I understood correctly, this field doesn't relate to types. It seems it's only there to provide the correct javascript (not ts) entrypoint when importing the library via different module systems. So it's irrelevant for karakum, right? Or did I miss something and karakum can actually process pure JavaScript as well in addition to typescript? |
Ah wait I read a bit more and indeed each entry in the I don't see a problem with multiple |
There is no problems with multiple TS files as input so far. I see two problems here:
|
NPM modules have a
typings
(ortypes
) property in theirpackage.json
to define a path to the.d.ts
file describing the types for the module:https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package
It would be nice if Karakum could figure out the path on its own based on that, so the config could just be the name of a package instead of the users having to inspect the
package.json
of each module on their own and update the path to the typings file in case it changes in the original package.For instance, a basic Karakum config could simply be:
And both the
input
path and thelibraryName
could be derived from theinputModule
.Of course, we could offer optional configuration to override the path to the
node_modules
, or override the input path to the declarations if need be. But as a default that would be great.The text was updated successfully, but these errors were encountered: