Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWhy --save instead of --save-dev? #81
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
blakeembrey
commented
Jul 20, 2016
•
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. |
This comment has been minimized.
This comment has been minimized.
Using Given that breaking consumers is a worse problem than slightly-larger packages, we've made |
This comment has been minimized.
This comment has been minimized.
unional
commented
Jul 20, 2016
•
If the types are exposed as dependencies, then it should be registered as |
antmdvs
referenced this issue
Sep 26, 2016
Closed
Consider moving @types packages from devDependencies to dependencies #713
This comment has been minimized.
This comment has been minimized.
aluanhaddad
commented
Oct 19, 2016
I've been basically taking the same road as @unional. Like I'll do |
Oct 22, 2016
This was referenced
This comment has been minimized.
This comment has been minimized.
demurgos
commented
Oct 24, 2016
•
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 |
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
demurgos
commented
Oct 24, 2016
•
Thank you. So you mean that Typescript never Basically, I am having trouble to know if I should install environmental types like |
This comment has been minimized.
This comment has been minimized.
My thought is |
This comment has been minimized.
This comment has been minimized.
ivogabe
commented
Oct 25, 2016
Wouldn't that cause trouble when two dependencies depend on different version of |
This comment has been minimized.
This comment has been minimized.
You could use a semver such as |
This comment has been minimized.
This comment has been minimized.
JKillian
commented
Jan 12, 2017
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 |
This comment has been minimized.
This comment has been minimized.
unional
commented
Jan 12, 2017
Add to that the even harder part is about module augmentation. Which version of |
This comment has been minimized.
This comment has been minimized.
blakeembrey
commented
Jan 12, 2017
@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 |
This comment has been minimized.
This comment has been minimized.
unional
commented
Jan 12, 2017
For But what if there is such a dependency? i.e.: - app
- package-a
- package-b@2.0
- package-c
- package-b@1.0
- package-b@?? And |
added a commit
to DSI-HUG/dejajs-components
that referenced
this issue
Mar 1, 2017
added a commit
to DSI-HUG/dejajs-components
that referenced
this issue
Mar 1, 2017
DJWassink
referenced this issue
Apr 11, 2017
Merged
Fixed a bug in the typescript definition and updated readme. #17
jgravois
referenced this issue
Apr 26, 2017
Closed
is @types/geojson better off as a devDependency? #305
added a commit
to orangain/kifu-notebook
that referenced
this issue
May 1, 2017
added a commit
to orangain/kifu-notebook
that referenced
this issue
May 1, 2017
dolanmiu
referenced this issue
Jan 8, 2018
Closed
Dependencies prefixed with @types should be in devDependencies #59
shepmaster
referenced this issue
Jan 9, 2018
Closed
Move @types/node from runtime deps to dev deps #226
bingenito
referenced this issue
Feb 1, 2018
Closed
Move public @types from devDependencies to dependencies #113
DominicKramer
referenced this issue
Mar 13, 2018
Merged
fix: fix a failure in the installation tests #74
aoberoi
referenced this issue
Mar 21, 2018
Closed
Move @types/node from devDependencies to dependencies #514
OliverJAsh
referenced this issue
Apr 15, 2018
Open
Suggestion: document requirement for TypeScript @types packages #549
sheldonkwok
referenced this issue
Apr 20, 2018
Merged
Move @types to package.json dependencies for definitions and add missing @types #39
sardell
referenced this issue
May 15, 2018
Closed
METRON-1478 Move type definitions to dev-dependencies #954
aoberoi
referenced this issue
Aug 9, 2018
Closed
@slack/client incompatible with @types/bluebird@2.x #612
jonaskello
referenced this issue
Aug 17, 2018
Closed
The graphql package is only a devDependency #12
Sep 21, 2018
This was referenced
itrew
referenced this issue
Oct 3, 2018
Closed
Address #343. Add GeoJSON types to feature service package. #346
wschella
referenced this issue
Oct 11, 2018
Closed
Save @types/* as dependency instead of devDependency #8
schickling
referenced this issue
Nov 29, 2018
Open
Make Prisma TS client work in strict mode without needing to explicitly add `@types/graphql`. #3619
added a commit
to ream/ream
that referenced
this issue
Dec 3, 2018
This comment has been minimized.
This comment has been minimized.
demurgos
commented
Jan 31, 2019
•
@DanielRosenwasser @RyanCavanaugh Hi, When I asked this question a few years ago, I got this reply (#81 (comment)):
Despite this recommendation, there is still a lot of confusion around handling In my experience, adding My understanding is that type definitions declaring globals (e.g. DefinitelyTyped adds
In 2019, how should a standalone Typescript library depend on environment/global declarations such as
|
dalgard commentedJul 20, 2016
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.