@@ -13,42 +13,36 @@ const typedocJson = require('./typedoc');
13
13
* @param {string } options.outDir
14
14
* @param {Partial<import('typedoc').TypeDocOptions> } [typeDocOptions]
15
15
*/
16
- const createTypeScriptApiDocs = exports . createTypeScriptApiDocs = async ( { entryPoint, outDir } , typeDocOptions ) => {
17
- const app = new td . Application ( ) ;
18
- app . options . addReader ( new td . TSConfigReader ( ) ) ;
16
+ const createTypeScriptApiDocs = ( exports . createTypeScriptApiDocs = async ( { entryPoint, outDir } , typeDocOptions ) => {
17
+ const app = new td . Application ( ) ;
18
+ app . options . addReader ( new td . TSConfigReader ( ) ) ;
19
19
console . log ( 'createTypeScriptApiDocs' , typeDocOptions ) ;
20
- let files = await globby ( [ 'src/**/*.d.ts' , 'src/**/index.ts' , '!**/references.d.ts' , '!**/appbar' , '!**/page' , '!**/typings' , '!**/angular' , '!**/vue' , '!**/react' ] , {
20
+ const files = await globby ( [ 'src/**/*.d.ts' , 'src/**/index.ts' , '!**/references.d.ts' , '!**/appbar' , '!**/page' , '!**/typings' , '!**/angular' , '!**/vue' , '!**/react' ] , {
21
21
absolute : true ,
22
22
cwd : path . join ( process . cwd ( ) )
23
- } )
24
- console . log ( 'files' , files ) ;
25
- app . bootstrap ( {
26
- tsconfig : 'tsconfig.json' ,
27
- ...typedocJson ,
28
- ...typeDocOptions ,
29
- entryPoints : files
30
- } ) ;
31
- //@ts -ignore
32
- app . options . setCompilerOptions ( files , {
33
- esModuleInterop : true
34
- } )
35
- const program = ts . createProgram (
36
- app . options . getFileNames ( ) ,
37
- app . options . getCompilerOptions ( )
38
- ) ;
23
+ } ) ;
24
+ console . log ( 'files' , files ) ;
25
+ app . bootstrap ( {
26
+ tsconfig : 'tsconfig.json' ,
27
+ ...typedocJson ,
28
+ ...typeDocOptions ,
29
+ entryPoints : files
30
+ } ) ;
31
+ //@ts -ignore
32
+ app . options . setCompilerOptions ( files , {
33
+ esModuleInterop : true
34
+ } ) ;
35
+ const program = ts . createProgram ( app . options . getFileNames ( ) , app . options . getCompilerOptions ( ) ) ;
39
36
40
- const project = app . converter . convert (
41
- app . expandInputFiles ( app . options . getValue ( 'entryPoints' ) ) ,
42
- program
43
- ) ;
37
+ const project = app . converter . convert ( app . expandInputFiles ( app . options . getValue ( 'entryPoints' ) ) , program ) ;
44
38
45
- if ( project ) {
46
- await app . generateDocs ( project , outDir ) ;
47
- } else {
48
- throw new Error ( `Error creating the TypeScript API docs for ${ entryPoint } .` ) ;
49
- }
50
- } ;
39
+ if ( project ) {
40
+ await app . generateDocs ( project , outDir ) ;
41
+ } else {
42
+ throw new Error ( `Error creating the TypeScript API docs for ${ entryPoint } .` ) ;
43
+ }
44
+ } ) ;
51
45
// app.generateDocs(project, "./docs");
52
46
// app.generateJson(project, "./docs.json");
53
47
54
- createTypeScriptApiDocs ( { outDir :" ./docs" } ) ;
48
+ createTypeScriptApiDocs ( { outDir : ' ./docs' } ) ;
0 commit comments