dts-generator icon indicating copy to clipboard operation
dts-generator copied to clipboard

Resolve relative paths

Open dougludlow opened this issue 8 years ago • 5 comments

I have a project where I'm creating a .d.ts file for angular2. Using dts-generator, I'm able to create one, but with one issue: all relative paths are not resolved. I had to manually resolve the 394 relative paths by hand. Is there a way to make dts-generator resolve the paths to dependent imports?

Here's my project: https://github.com/dougludlow/angular2-typings

dougludlow avatar Mar 30 '16 19:03 dougludlow

Here's an example of a relative path: https://github.com/dougludlow/angular2-typings/blob/e507fa38a31ec4a4c42cb465a2a33a540718f469/typings/angular2/angular2.d.ts#L1008

declare module 'angular2/src/core/change_detection/directive_record' {
    import { ChangeDetectionStrategy } from './constants';
    ...
}

Should be:

declare module 'angular2/src/core/change_detection/directive_record' {
    import { ChangeDetectionStrategy } from 'angular2/src/core/change_detection/constants';
    ...
}

dougludlow avatar Mar 30 '16 19:03 dougludlow

+1 ... Any update on this?

scniro avatar Oct 27 '16 19:10 scniro

@scniro unfortunately no, but we'd like to get to it. We'd of course review and accept a PR.

dylans avatar Oct 27 '16 19:10 dylans

Hi all,

This PR will resolve the problem: #124

Solution is similar to @vtrifonov solution but a little simpler. It also respect the indentation ^^ If you can approve it it will be great as this problem is still open since one year.

paztis avatar Apr 10 '19 23:04 paztis

For info tthe unit tests are not working at all for the module due to tslint / typescript version problems. My commits are not responsible of the travis problems: they are present also without them

paztis avatar Apr 10 '19 23:04 paztis