angular / dgeni

Flexible JavaScript documentation generator used by AngularJS, Protractor and other JS projects
MIT License
769 stars 68 forks source link

feat(gen-docs): Add support for TypeScript #171

Closed BrunnerLivio closed 4 years ago

BrunnerLivio commented 5 years ago

This PR adds the following features to the dgeni-CLI tool:

Open points:

petebacondarwin commented 5 years ago

Thanks for this PR @BrunnerLivio - I will take a look and have a think about it this week.

BrunnerLivio commented 5 years ago

@petebacondarwin any further thoughts on this?

Note; this PR is not crucial from my side: To workaround this, I just created my custom dgeni-cli.ts directly written in TypeScript and just call it with ts-node directly.

ts-node -P tools/tsconfig.json tools/dgeni-cli.ts tools/transforms/nestjs-package/index

This is sustainable for our project, but off course for us and other projects, it would be a nice plus if dgeni provides it out of the box :)

petebacondarwin commented 5 years ago

Hi @BrunnerLivio - I am sorry I have not got round to this. I am up to my eyes in Angular i18n. I am just slightly worried about landing this PR as it is, since I feel that it requires dgeni to be more aware than I had hoped of the external compiler... At the moment I think that your workaround where you wrap dgeni should be the right way to do this. I will revisit later but not in the next few weeks.

tommck commented 5 years ago

@petebacondarwin I'm very curious about what you're doing to i18n on the Angular side.. is there a roadmap or anything to tell me what you're changing?

petebacondarwin commented 5 years ago

@tommck - here is the high-level design doc https://hackmd.io/@X3ECPVy-RCuVfba-pnvIpw/rJDy4uG-r You can follow along with the code at https://github.com/angular/angular/tree/master/packages/localize and related PRs, such as https://github.com/angular/angular/pull/32867 and https://github.com/angular/angular/pull/32105

damienwebdev commented 4 years ago

@petebacondarwin @tommck I'm pretty sure this PR isn't necessary. We use Dgeni (written in Typescript) to doc packages written in typescript. But, maybe I'm misunderstanding the intent of this PR.

petebacondarwin commented 4 years ago

The aim of this PR is to allow the compilation of the TS files to happen at "run-time" when they are being imported into Dgeni. I agree that this is not actually the best approach. As you have done, it is better to setup your TS files to be compiled before running them in Dgeni.

@BrunnerLivio - thanks for the PR but I think we should close this as something we will not implement.