-
Notifications
You must be signed in to change notification settings - Fork 162
Do not publish .ts files on npmjs.org #162
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
Comments
Hi @victornoel Sorry for responding so late. Initially the src folder was excluded from the library but I got a lot of complaints about it. |
#111 explains why it breaks things. Unless something has changed it still holds true. |
Yes, but can't you exclude node_modules from your tsconfig and tslint? |
Do you know of any other TS libraries that ship |
I agree with @flauc that it is not a good enough reason: @xealot I initially reported this issue because I understood from angular people that it was a bad practice (as you say @xealot, there is almost no npm module shipping their ts files). But I'm not exactly sure WHY it is a bad practice, I asked @filipesilva (angular/angular-cli#4675 (comment)) about it and I'm waiting for an answer. Personally, I like the fact that ts files are present because I can browse the code of the dependencies I use, but it still seems it is not a practice usually followed… |
Copied from angular/angular-cli#4675 (comment) @victornoel generally it's discouraged to ship TypeScript with third party libraries because it would require the consumer to replicate the complete build environment of the library. Not only typings, but potentially a specific version of Publishing plain JavaScript with typings and meta data allows the consuming application to remain agnostic of the library's build environment. |
The point still remains that if you use the "rootDir" option in your code and it's pointed to something like Which means your library isn't compatible with a subset of projects that use this TS feature. Additionally, if I exclude |
@xealot you are right that there may be strange behaviour with respect to tslint typechecking if you remove Thanks @filipesilva for the explanation. |
I'll remove the src folder from the published repo, with everything you pointed out I think there really isn't any point in having it in there. Thank you for joining in and helping out 👍 |
It looks like this actually breaks my build. Reverting back to having it in there for now. |
Hi @flauc, I'm back on this. I really think you should take this issue into account, here is another reason: microsoft/TypeScript#15363 Basically, when shipping ts files with your package, they get taken into account by tsc and can create problems .
|
The latest version no longer publishes .ts files |
Hi,
Apparently,
angular2-notifications
is published on npmjs.org with itsts
files.This is a bad practice according to (at least) angular-cli people (see angular/angular-cli#4675 (comment)).
It would be great if the
ts
files were removed in future releases and optionally for the latest release too :)Thanks!
The text was updated successfully, but these errors were encountered: