MCPcopy
hub / github.com/QwikDev/qwik / generateApiMarkdownSubPackageDocs

Function generateApiMarkdownSubPackageDocs

scripts/api-docs.ts:41–74  ·  view source on GitHub ↗
(
  config: BuildConfig,
  apiJsonInputDir: string,
  names: string[]
)

Source from the content-addressed store, hash-verified

39}
40
41async 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
76async function createApiData(
77 config: BuildConfig,

Callers 1

Calls 3

joinFunction · 0.85
createApiDataFunction · 0.85
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…