@@ -8,31 +8,13 @@ import {FilterDuplicateExports} from './processors/filter-duplicate-exports';
8
8
import { MergeInheritedProperties } from './processors/merge-inherited-properties' ;
9
9
import { EntryPointGrouper } from './processors/entry-point-grouper' ;
10
10
import { ReadTypeScriptModules } from 'dgeni-packages/typescript/processors/readTypeScriptModules' ;
11
- import { TsParser } from 'dgeni-packages/typescript/services/TsParser' ;
12
11
import { TypeFormatFlags } from 'dgeni-packages/node_modules/typescript' ;
13
- import { sync as globSync } from 'glob' ;
14
- import * as path from 'path' ;
15
12
16
13
// Dgeni packages that the Material docs package depends on.
17
14
const jsdocPackage = require ( 'dgeni-packages/jsdoc' ) ;
18
15
const nunjucksPackage = require ( 'dgeni-packages/nunjucks' ) ;
19
16
const typescriptPackage = require ( 'dgeni-packages/typescript' ) ;
20
17
21
- // Project configuration.
22
- const projectRootDir = path . resolve ( __dirname , '../..' ) ;
23
- const sourceDir = path . resolve ( projectRootDir , 'src' ) ;
24
- const outputDir = path . resolve ( projectRootDir , 'dist/docs/api' ) ;
25
- const templateDir = path . resolve ( __dirname , './templates' ) ;
26
-
27
- /** List of CDK packages that need to be documented. */
28
- const cdkPackages = globSync ( path . join ( sourceDir , 'cdk' , '*/' ) )
29
- . filter ( packagePath => ! packagePath . endsWith ( 'testing/' ) )
30
- . map ( packagePath => path . basename ( packagePath ) ) ;
31
-
32
- /** List of Material packages that need to be documented. */
33
- const materialPackages = globSync ( path . join ( sourceDir , 'lib' , '*/' ) )
34
- . map ( packagePath => path . basename ( packagePath ) ) ;
35
-
36
18
/**
37
19
* Dgeni package for the Angular Material docs. This just defines the package, but doesn't
38
20
* generate the docs yet.
@@ -71,11 +53,9 @@ apiDocsPackage.processor(new EntryPointGrouper());
71
53
apiDocsPackage . config ( ( log : any ) => log . level = 'info' ) ;
72
54
73
55
// Configure the processor for reading files from the file system.
74
- apiDocsPackage . config ( ( readFilesProcessor : any , writeFilesProcessor : any ) => {
75
- readFilesProcessor . basePath = sourceDir ;
76
- readFilesProcessor . $enabled = false ; // disable for now as we are using readTypeScriptModules
77
-
78
- writeFilesProcessor . outputFolder = outputDir ;
56
+ apiDocsPackage . config ( ( readFilesProcessor : any ) => {
57
+ // Disable we currently only use the "readTypeScriptModules" processor
58
+ readFilesProcessor . $enabled = false ;
79
59
} ) ;
80
60
81
61
// Patches Dgeni's log service to not print warnings about unresolved mixin base symbols.
@@ -104,32 +84,9 @@ apiDocsPackage.config((checkAnchorLinksProcessor: any) => {
104
84
} ) ;
105
85
106
86
// Configure the processor for understanding TypeScript.
107
- apiDocsPackage . config ( ( readTypeScriptModules : ReadTypeScriptModules , tsParser : TsParser ) => {
108
- readTypeScriptModules . basePath = sourceDir ;
87
+ apiDocsPackage . config ( ( readTypeScriptModules : ReadTypeScriptModules ) => {
109
88
readTypeScriptModules . ignoreExportsMatching = [ / ^ _ / ] ;
110
89
readTypeScriptModules . hidePrivateMembers = true ;
111
-
112
- const typescriptPathMap : any = { } ;
113
-
114
- cdkPackages . forEach ( packageName => {
115
- typescriptPathMap [ `@angular/cdk/${ packageName } ` ] = [ `./cdk/${ packageName } /index.ts` ] ;
116
- } ) ;
117
-
118
- materialPackages . forEach ( packageName => {
119
- typescriptPathMap [ `@angular/material/${ packageName } ` ] = [ `./lib/${ packageName } /index.ts` ] ;
120
- } ) ;
121
-
122
- // Add proper path mappings to the TSParser service of Dgeni. This ensures that properties
123
- // from mixins (e.g. color, disabled) are showing up properly in the docs.
124
- tsParser . options . paths = typescriptPathMap ;
125
- tsParser . options . baseUrl = sourceDir ;
126
-
127
- // Entry points for docs generation. All publicly exported symbols found through these
128
- // files will have docs generated.
129
- readTypeScriptModules . sourceFiles = [
130
- ...cdkPackages . map ( packageName => `./cdk/${ packageName } /index.ts` ) ,
131
- ...materialPackages . map ( packageName => `./lib/${ packageName } /index.ts` )
132
- ] ;
133
90
} ) ;
134
91
135
92
apiDocsPackage . config ( ( tsHost : Host ) => {
@@ -148,9 +105,6 @@ apiDocsPackage.config((tsHost: Host) => {
148
105
149
106
// Configure processor for finding nunjucks templates.
150
107
apiDocsPackage . config ( ( templateFinder : any , templateEngine : any ) => {
151
- // Where to find the templates for the doc rendering
152
- templateFinder . templateFolders = [ templateDir ] ;
153
-
154
108
// Standard patterns for matching docs to templates
155
109
templateFinder . templatePatterns = [
156
110
'${ doc.template }' ,
0 commit comments