( config: BuildConfig, apiJsonInputDir: string, names: string[] )
| 39 | } |
| 40 | |
| 41 | async function generateApiMarkdownSubPackageDocs( |
| 42 | config: BuildConfig, |
| 43 | apiJsonInputDir: string, |
| 44 | names: string[] |
| 45 | ) { |
| 46 | const subPkgInputDir = join(apiJsonInputDir, ...names); |
| 47 | const docsApiJsonPath = join(subPkgInputDir, 'docs.api.json'); |
| 48 | if (!existsSync(docsApiJsonPath)) { |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | const subPkgName = ['@builder.io', ...names].filter((n) => n !== 'core').join('/'); |
| 53 | console.log('📚', `Generate API ${subPkgName} markdown docs`); |
| 54 | |
| 55 | const apiOuputDir = join( |
| 56 | config.rootDir, |
| 57 | 'dist-dev', |
| 58 | 'api-docs', |
| 59 | names.filter((n) => n !== 'core').join('-') |
| 60 | ); |
| 61 | mkdirSync(apiOuputDir, { recursive: true }); |
| 62 | console.log(apiOuputDir); |
| 63 | |
| 64 | await execa( |
| 65 | 'api-documenter', |
| 66 | ['markdown', '--input-folder', subPkgInputDir, '--output-folder', apiOuputDir], |
| 67 | { |
| 68 | stdio: 'inherit', |
| 69 | cwd: join(config.rootDir, 'node_modules', '.bin'), |
| 70 | } |
| 71 | ); |
| 72 | |
| 73 | await createApiData(config, docsApiJsonPath, apiOuputDir, subPkgName); |
| 74 | } |
| 75 | |
| 76 | async function createApiData( |
| 77 | config: BuildConfig, |
no test coverage detected
searching dependent graphs…