File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,4 +139,4 @@ BOT_SETUP.md
139139** /* -token.txt
140140
141141# typescript
142- ** /tsconfig.tsbuildinfo
142+ ** /tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change 11import fs from 'fs' ;
22import path from 'path' ;
3- import { exec } from 'child_process' ;
43import * as url from 'url' ;
54
65import dir from 'node-dir' ;
76import { parse , utils } from 'react-docgen' ;
7+ import * as documentation from 'documentation' ;
88
99import JSDocNodeTree from './JSDocNodeTree.js' ;
1010import { pascelCase } from './globals.mjs' ;
@@ -420,15 +420,8 @@ class DocJSONBuilder {
420420
421421 generateModulesTask ( results , filePath ) {
422422 return new Promise ( ( resolve , reject ) => {
423- exec (
424- `npx documentation build ${ MODULES_PATH } -f json` ,
425- ( err , stdout , stderr ) => {
426- if ( err || stderr ) {
427- reject ( err || stderr ) ;
428- return ;
429- }
430-
431- const modules = JSON . parse ( stdout ) ;
423+ documentation . build ( [ filePath ] , { } )
424+ . then ( modules => {
432425 for ( const module of modules ) {
433426 const node = new JSDocNodeTree ( module ) ;
434427 const name = `${ module . name
@@ -450,8 +443,11 @@ class DocJSONBuilder {
450443 }
451444
452445 resolve ( ) ;
453- } ,
454- ) ;
446+ } )
447+ . catch ( err => {
448+ console . log ( `documentation.build failed for ${ filePath } ` ) ;
449+ reject ( err ) ;
450+ } ) ;
455451 } ) ;
456452 }
457453
You can’t perform that action at this time.
0 commit comments