build(docs): fix description comments sometimes empty (#12885)

Follow-up commit for 4879dc4720.

---

Disables concatenation of multiple leading comments for a TypeScript node. Since all shipped source files have a license banner at top, the license banner comment would be incorrectly considered as "comment" for the first TypeScript node of a given file. Since there are various files in the Material project where the first node of a source file is exported and should only use the first leading comment, we need to disable comment concatenation.

See for example: https://github.com/angular/material2/blob/master/src/cdk/coercion/boolean-property.ts
This commit is contained in:
Paul Gschwendtner
2018-08-30 00:43:52 +02:00
committed by Jeremy Elbourn
parent 8087ccb0b2
commit 53b4af6d2a
3 changed files with 19 additions and 8 deletions
+11
View File
@@ -1,4 +1,5 @@
import {Package} from 'dgeni';
import {Host} from 'dgeni-packages/typescript/services/ts-host/host';
import {patchLogService} from './patch-log-service';
import {DocsPrivateFilter} from './processors/docs-private-filter';
import {Categorizer} from './processors/categorizer';
@@ -124,6 +125,16 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
];
});
apiDocsPackage.config((tsHost: Host) => {
// Disable concatenation of multiple leading comments for a TypeScript node. Since all shipped
// source files have a license banner at top, the license banner comment would be incorrectly
// considered as "comment" for the first TypeScript node of a given file. Since there are
// various files in the Material project where the first node of a source file is exported and
// should only use the first leading comment, we need to disable comment concatenation.
// See for example: src/cdk/coercion/boolean-property.ts
tsHost.concatMultipleLeadingComments = false;
});
// Configure processor for finding nunjucks templates.
apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
// Where to find the templates for the doc rendering