-
Notifications
You must be signed in to change notification settings - Fork 148
Why --save instead of --save-dev? #81
Comments
The short answer would be for module authors - if, as an author, you want to publish your TypeScript package to NPM and the dependencies are in the development section, no one will be able to install it and use it without having to manually install your types dev dependencies. By using dependencies, they will be installed along with the package and consumers can use your NPM package without additional configuration. The definitions should follow however you installed the module. |
Using Given that breaking consumers is a worse problem than slightly-larger packages, we've made |
If the types are exposed as dependencies, then it should be registered as |
I've been basically taking the same road as @unional. Like I'll do |
Hi, Is this because these projects are special ? Angular is more front-end oriented and types-publisher is a standalone project (I think), but Typescript can be imported as a library and consumed by others: why aren't some of its |
@demurgos With respect to TypeScript itself, it only uses declaration files for its build tools (like gulp utilities). It doesn't actually require those tools to run, so it doesn't need the declaration files for those tools either. Edit: For the others, like Types Publisher, it doesn't matter what it's distributed as since it's a simple executable package that isn't meant to be used as a library. |
Thank you. So you mean that Typescript never Basically, I am having trouble to know if I should install environmental types like |
My thought is |
Wouldn't that cause trouble when two dependencies depend on different version of |
You could use a semver such as |
Circling back to what @ivogabe asked - will TypeScript handle conflicting types in a way that works out okay? If I have packages depending on different versions of |
Add to that the even harder part is about module augmentation. Which version of |
@jkillian I believe global definitions can and will conflict, while external module definitions follow module resolution. This is a bit of a pain point, because there's no guarantee a module in @unional I think that one should be fine. You can kick in and use |
For But what if there is such a dependency? i.e.: - app
- package-a
- [email protected]
- package-c
- [email protected]
- package-b@?? And |
In instructions on how to use
@types
, type packages are installed with--save
and not--save-dev
.Why is this?
I wouldn't expect that I need the types outside of my development environment?
There should be a note about it in the various readmes.
The text was updated successfully, but these errors were encountered: