Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Path of existing <reference> breaks when adding more references to tsd.d.ts #96

Closed
cspotcode opened this issue Sep 5, 2014 · 6 comments

Comments

@cspotcode
Copy link

With the following tsd.json:

{
  "version": "v4",
  "repo": "borisyankov/DefinitelyTyped",
  "ref": "master",
  "path": "typings/from-tsd",
  "bundle": "typings/tsd.d.ts"
}

I run the following commands:

> tsd query lodash --save --bundle --action install
> tsd query knockout jquery node --save --bundle --action install

After the first command, my tsd.d.ts file is:

/// <reference path="from-tsd/lodash/lodash.d.ts" />

After the second command, however, my tsd.d.ts file is:

/// <reference path="from-tsd/from-tsd/lodash/lodash.d.ts" />
/// <reference path="from-tsd/knockout/knockout.d.ts" />
/// <reference path="from-tsd/node/node.d.ts" />
/// <reference path="from-tsd/jquery/jquery.d.ts" />

The reference path to lodash has been changed and is now incorrect.

EDIT: using tsd 0.5.7.

@Bartvds
Copy link
Collaborator

Bartvds commented Sep 12, 2014

This is weird.

Not sure what is going on in your case, but I'm moving to release a new version soon that included a some fixes and revisions on this bundle feature, I'll keep you posted when you can try this update, I'm pretty sure that has a fix for this.

@aymericbeaumet
Copy link

Any news on this?

@brian428
Copy link

Just FYI, I'm seeing the exact same thing, using the latest tsd (0.5.7). Regenerating/updating the tsd.d.ts using tsd update -so will add the correct paths, but any existing (duplicate) entries are incorrectly modified. It looks like the initial directory in the path is always duplicated, e.g. /// <reference path="../ts_definitions/libs/angularjs/angular.d.ts" /> becomes /// <reference path="../ts_definitions/ts_definitions/libs/angularjs/angular.d.ts" />. Further, this keeps happening every time you run it, so you'll end up with an ever-expanding set of invalid duplicate references in the file.

If it helps, I'm seeing this on Windows 7 x64 and Win 8.1 x64.

@Bartvds
Copy link
Collaborator

Bartvds commented Oct 22, 2014

Sorry for late response.

I finally pushed a prerelease of 0.6.0 to npm. Many parts of it are refactored for these kind of problems: It is tagged:

npm install tsd@next -g

Then try:

$ tsd install knockout jquery node --save

Note you don't need --bundle (it is for additional custom bundles), instead if you have a "bundle" in tsd.json then TSD will bundle there automatically (with --save).

Let me know if this works for you.

@Bartvds
Copy link
Collaborator

Bartvds commented Oct 26, 2014

I tested this some more and I'm pretty sure this is fixed so I'll close this for now.

@Bartvds Bartvds closed this as completed Oct 26, 2014
@zsoltgyongyosi
Copy link

The problem is still present in 0.6.0-beta.5. $ tsd update -so clones already present paths with the first component of the path duplicated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants