tsd
tsd copied to clipboard
Resolve dependencies for linked bundles
Linking from bundles (tsd link) is great feature, but there are little improvement needed - install typings dependencies from linked module. For example - my library uses expressjs, and re-exports some types from express (function that receives express.Request as param for example). Internally, this library uses express.d.ts typings from tsd, but it can't export this typings up to application, coz it can use express too, and there will be conflict (due to express.d.ts will placed in different directories in this case). So, library user must install deps (express) manually. It would be great, if "typescript" section of package.json (or bower) will have "dependencies" array (or something like) with names of deps, which can be installed to project during "tsd link" Thanks for you project and time
:+1:
This is a much needed feature, unless I am missing something the only way that I can import a bower/npm package that has it's own typing references is to not do tsd link
and just interact with the module without any typscript goodies.
@xiphiaz You can definitely import a module definition, but it gets messy when it's a sub-dependency. That's the goal for 0.7
, to fix this issue for good. For now, distributed packages will need sub-dependencies to be referenced manually and not referenced in the definition.
@blakeembrey ok I'm confused how I can get this to work for me as I am loading https://github.com/spira/angular-rest-adapter/blob/master/dist/ngRestAdapter.d.ts in as a bower dependency, linked via tsd link
however it references the typings file relative to that repository.
My parent application is trying to load the dependencies from both ngRestAdapter.d.tsd
and it's own local tsd.d.ts
file but there is a conflict between a lot of modules.
Can I suppress this error in any way as it doesn't strike me as a being fatal error?
@xiphiaz For now, you'd have to ask them to remove https://github.com/spira/angular-rest-adapter/blob/master/dist/ngRestAdapter.d.ts#L1 as it's referencing all their own typings which conflict with yours.
Edit: This is where current definition management gets messy. We want to make it easier, but it'll take some time.