-
Notifications
You must be signed in to change notification settings - Fork 262
npm typings with no runtime dependency #550
Comments
How do you do step 2? |
In {
"globalDependencies": {
"dojo-compose": "npm:dojo-compose"
}
} We plan to migrate to "UMD" |
The current implementation expects that modules listed in NPM dependencies have typings either in |
@blakeembrey thanks. For clarity Also for clarity, I think we are asking for a feature versus a bug fix. Currently there appears to be no way to acquire types for a npm package unless that package is installed. The problem we have is that some packages we are only dependent upon them for their typings with no run-time need for their code, therefore in the There may not be an easy solution to acquire just the typings from an npm package without having npm install the whole package, but ideally that is the feature being requested. |
Thanks, yes. I think someone has requested this before. It would require being able to grab data from the NPM registry instead of the local filesystem. I think the easiest fix for this, for now, would be to reference the file/commit via GitHub. |
Thanks. The only challenge is that many packages only generate their typings in their distributions and are not checked into GitHub (such as RxJS). So the only option would to be to extract the typings and host elsewhere on GitHub. |
Prerequisites
0.x
to1.0
Description
A typing dependency, but not a run-time dependency.
Trying to figure out the right way of modelling a situation in
typings
. We are using RxJS 5 (and ES Observables) where some of our modules can consume an Observable. Because we are only consuming Observables, there isn't an actual run-time dependency on the code. Therefore we have@reactivex/rxjs
as a development dependency in ourpackage.json
and we are able to build our package successfully.If someone though tries to consume the package, they would have to require in the whole npm module to be able to successfully. This means we could "promote" the dependency to a
peerDependency
in thepackage.json
but all we really want/need/etc is a way to acquire the typings without the package being installed and for us to express that dependency properly in thetypings.json
of the distributable package.(Ref: dojo/compose#32)
Steps to Reproduce
npm install dojo-compose --save
"dojo-compose": "npm:dojo-compose"
totypings.json
Cannot find module 'node_modules/@reactivex/rxjs/dist/cjs/Rx'.
Expected behavior: [What did you expect to happen?]
Work awesome like the rest of
typings
.Actual behavior: [What actually happened?]
Confusion and frustration, likely self-inflicted.
Versions
1.0.4
The text was updated successfully, but these errors were encountered: