-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add TypeScript types #41
Comments
Hello @jankapunkt , First of all, nice template to start an NPM package. I am considering this template to use on a project related to the framework I built on top of |
Normally I do not install any dependencies to add types and simply have an |
Yes you could easily add an |
I tried to publish a package with this yesterday and I used the same technique you mentioned in the description of this issue (adding tsc as a dev dependency and using it in build command). When I added JS docs to all my code, the resulting |
Great 🚀 if you want you can open a PR for this 🙏
Yeah I am still unsure which one is better. For now I mostly sticked with the single files because you can map them for each system as main entry point or for CDN to use, however I currently think minification is even of more importance here. So until I have a definitive idea how to move on with rollup config I would keep it as it is, please. |
Sure, I will raise a PR later today. About the UMD, yes, you do lose minification here. But the main reason I did this is because my projects were ultimately compiled into CJS (which I think most projects do) though written in ES6 TypeScript. I was having a lot of import problems. The |
Hm I think we should have another issue for this one 🤔 |
@jankapunkt I opened a PR implementing what we discussed. Also, any reason why you commit the |
@jankapunkt do not review that PR. I just realized that there are problems with auto generated stuff. Especially when you use classes. I think it is better to write the types on your own and simply copy them to dist on
Where copyfiles package can work with both windows and linux without throwing errors for a missing cp command. |
We need to add TypeScript types, if possible as part of the build chain.
An example would be
with the following tsconfig.json
However, I'm still undecided whether to add
tsc
as devDependency or require it globally (which then would imply updating our CI workflows to maketsc
available for the build step)The text was updated successfully, but these errors were encountered: