-
Notifications
You must be signed in to change notification settings - Fork 135
TS6053 File not found when import tsd.d.ts from bower distributed package #105
Comments
Additionally if I opt for include the vendor typings I end with duplicated definitions because the bower package and the parent project both use JQuery
|
Vendor definitions are a bit of a complicated problem. Most of it has to do with the current way the At this point there is only one 'type namespace': so if different definition files are referenced which all define modules with the same name ('jquery') then the compiler will throw this 'Duplicate identifier'. (contrast this to how node.js resolves modules, where every package can have its isolated sub dependencies) This gets very messy if packages start to bundle their definition files, because like you experience many web modules would use the JQuery definitions (and maybe even re-export types), which means the compiler sees all the bundled jquery definitions. This (and similar issues) is on the map of the TypeScript team, for example:
At this point TSD can't do much about it, but part of the experimental nature of |
At this moment I see two issues One related to vendor files distribution and another one about duplicate definitions loading. The first one should be fixed from the side doing recursive installation of vendors looking for the presence of tsd.json The second one is a issue of tsc and it's out of the tsd scope |
Could you expand on this? If we would scan all linked types and recognize vendor files, what then? If we'd unifiy references then I see a possible issue of compatibility between versions of vendored defs. Also note currently bundled typings we |
I was expecting this actually. When I release my module, I included the Edit Nevermind, user error. This seems to work properly. |
@mtraynham what was your user error? I'm getting I can't find a good way to handle these duplicates without just using my bower packages without their definition files like I would in javascript, which sucks. |
@xiphiaz Well looking back, it's not entirely user error as by "working properly", yeah you can't include The work around, at the moment, is don't put DefinitelyTyped typings in the bower file. Only put your own generated d.ts file if the module created one. So if you are passing your own Easiest way to do that, is take the dependent module's In the past, it was sort of convention to bundle or checkin your definition files... I just run |
Thanks @mtraynham, I had two bootstrap dependency in bower.json and package.json. |
I'm having a issue while trying to
tsd link
(tsd@next) a bower package andtsd.d.ts
First I've a package built with
grunt-ts
andgrunt-tsd
So
FormManager.d.ts
has the following content (made bygrunt-ts
):each of these *.ts files have this line at the begin.
/// <reference path="../../../typings/tsd.d.ts" />
After distribute this package and execute
tsd link
I've the folliowing./typings/tsd.d.ts
/// <reference path="../bower_components/form-manager/dist/ts/FormManager.d.ts" />
Finally when I execute
tsc
I've the following errors.Any suggestion about how to proper distribute definitions without to have distribute vendor definitions as well?
The text was updated successfully, but these errors were encountered: