Skip to content

Commit cf54802

Browse files
devversionmmalerba
authored andcommitted
chore: less warnings for docs generation (#9864)
* Hides the warnings about unresolved TypeScript symbols for the mixin base classes. Those warnings are not fixable and are polluting the Dgeni output. * Adds missing `@deprecated` tags to entries that already have the `@deletion-target` set. * Updates to the latest version of dgeni-packages because angular/dgeni-packages@3a4e568 landed.
1 parent ca37a7f commit cf54802

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"axe-webdriverjs": "^1.1.1",
6565
"chalk": "^1.1.3",
6666
"dgeni": "^0.4.9",
67-
"dgeni-packages": "^0.22.0",
67+
"dgeni-packages": "^0.24.1",
6868
"firebase": "^4.0.0",
6969
"firebase-admin": "^5.0.0",
7070
"firebase-tools": "^3.11.0",

src/lib/datepicker/datepicker-input.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ export class MatDatepickerInput<D> implements AfterContentInit, ControlValueAcce
280280
return this._validator ? this._validator(c) : null;
281281
}
282282

283-
/** @deletion-target 7.0.0 Use `getConnectedOverlayOrigin` instead */
283+
/**
284+
* @deprecated
285+
* @deletion-target 7.0.0 Use `getConnectedOverlayOrigin` instead
286+
*/
284287
getPopupConnectionElementRef(): ElementRef {
285288
return this.getConnectedOverlayOrigin();
286289
}

src/lib/form-field/form-field.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ export class MatFormField extends _MatFormFieldMixinBase
200200

201201
_outlineGapStart = 0;
202202

203-
/** @deletion-target 7.0.0 */
203+
/**
204+
* @deprecated
205+
* @deletion-target 7.0.0
206+
*/
204207
@ViewChild('underline') underlineRef: ElementRef;
205208

206209
@ViewChild('connectionContainer') _connectionContainerRef: ElementRef;

tools/dgeni/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Package} from 'dgeni';
2+
import {patchLogService} from './patch-log-service';
23
import {DocsPrivateFilter} from './processors/docs-private-filter';
34
import {Categorizer} from './processors/categorizer';
45
import {FilterDuplicateExports} from './processors/filter-duplicate-exports';
@@ -79,6 +80,9 @@ apiDocsPackage.config((readFilesProcessor: any, writeFilesProcessor: any) => {
7980
writeFilesProcessor.outputFolder = outputDir;
8081
});
8182

83+
// Patches Dgeni's log service to not print warnings about unresolved mixin base symbols.
84+
apiDocsPackage.config((log: any) => patchLogService(log));
85+
8286
// Configure the output path for written files (i.e., file names).
8387
apiDocsPackage.config((computePathsProcessor: any) => {
8488
computePathsProcessor.pathTemplates = [{

tools/dgeni/patch-log-service.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
/**
3+
* Function that patches Dgeni's instantiated log service. The patch will hide warnings about
4+
* unresolved TypeScript symbols for the mixin base classes.
5+
*
6+
* ```
7+
* warn: Unresolved TypeScript symbol(s): _MatToolbarMixinBase - doc "lib/toolbar/MatToolbar"
8+
* (class) - from file "lib/toolbar/toolbar.ts" - starting at line 37, ending at line 98
9+
* ```
10+
*
11+
* Those warnings are valid, but are not fixable because the base class is created dynamically
12+
* through mixin functions and will be stored as a constant.
13+
*/
14+
export function patchLogService(log: any) {
15+
const _warnFn = log.warn;
16+
17+
log.warn = function(message: string) {
18+
if (message.includes('Unresolved TypeScript symbol') && message.includes('MixinBase')) {
19+
return;
20+
}
21+
22+
_warnFn.apply(this, [message]);
23+
};
24+
}

0 commit comments

Comments
 (0)