Skip to content

Commit d3cc38f

Browse files
committed
build(docs): fix description comments sometimes empty
Follow-up commit for 4879dc4. --- 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
1 parent f7b130c commit d3cc38f

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"chalk": "^1.1.3",
7373
"codelyzer": "^4.3.0",
7474
"dgeni": "^0.4.10",
75-
"dgeni-packages": "^0.26.2",
75+
"dgeni-packages": "^0.26.7",
7676
"firebase": "^4.0.0",
7777
"firebase-admin": "^5.0.0",
7878
"firebase-tools": "^4.1.0",

tools/dgeni/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Package} from 'dgeni';
2+
import {Host} from 'dgeni-packages/typescript/services/ts-host/host';
23
import {patchLogService} from './patch-log-service';
34
import {DocsPrivateFilter} from './processors/docs-private-filter';
45
import {Categorizer} from './processors/categorizer';
@@ -124,6 +125,16 @@ apiDocsPackage.config((readTypeScriptModules: ReadTypeScriptModules, tsParser: T
124125
];
125126
});
126127

128+
apiDocsPackage.config((tsHost: Host) => {
129+
// Disable concatenation of multiple leading comments for a TypeScript node. Since all shipped
130+
// source files have a license banner at top, the license banner comment would be incorrectly
131+
// considered as "comment" for the first TypeScript node of a given file. Since there are
132+
// various files in the Material project where the first node of a source file is exported and
133+
// should only use the first leading comment, we need to disable comment concatenation.
134+
// See for example: src/cdk/coercion/boolean-property.ts
135+
tsHost.concatMultipleLeadingComments = false;
136+
});
137+
127138
// Configure processor for finding nunjucks templates.
128139
apiDocsPackage.config((templateFinder: any, templateEngine: any) => {
129140
// Where to find the templates for the doc rendering

0 commit comments

Comments
 (0)