angular/dgeni-packages

Typescript file reader

SirDarquan opened this issue · 6 comments

So I noticed that in the angular/angular project, a Typescript parser was created to help the team create documentation from Typescript. Can you add that to this repo so we all can benefit?

@petebacondarwin so I took a look at this a couple of days ago, and noticed that currently the code is being read and then parsed directly from a string, whereas it does not appear the TypeScript parser is exposed publicly except via reading in the file through TS itself. I also noticed that the version of dgeni consumed by the Angular 2 repository is quite different from this one, and has support for TS baked in via a refactor of the parsing mechanism.

What are the thoughts on a proper solution for this situation? It would appear that a refactor here is necessary, but it may not match the state of dgeni from Angular 2, and I am unsure if the changes present in the Angular 2 repository will be backported here. I need some guidance here.

The version of dgeni is the same, I believe. The difference is that in Angular 2 we are not bothering to use a file reader to read in the code, since the typescript library does that for us.

This file - https://github.com/angular/angular/blob/master/docs/dgeni-package/processors/readTypeScriptModules.js - is reading the code files and generating new docs for each export.

@petebacondarwin Are there any plans for including the typescript package in dgeni-packages? Shall I submit a PR?

@davidreher - that would be great if you wanted to make a PR - we need to make sure that the version that goes into dgeni-packages is:

  • independent of the Angular 2 project - i.e. doesn't have any funny special features that are only suited for the Angular 2 doc generation
  • can still be used in the Angular 2 project, without modification. There is little point in pulling it out if we then have to maintain a separate version for that project.

We now have TypeScript support as of 3e07ade