dts-generator
dts-generator copied to clipboard
Resolve relative paths
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
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';
...
}
+1 ... Any update on this?
@scniro unfortunately no, but we'd like to get to it. We'd of course review and accept a PR.
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.
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