(pkg: PackageReferenceDocsConfig)
| 100 | } |
| 101 | |
| 102 | async function generatePackageReferenceDocs(pkg: PackageReferenceDocsConfig) { |
| 103 | const outputDir = pkg.outputDir |
| 104 | await rm(outputDir, { recursive: true, force: true }) |
| 105 | await mkdir(outputDir, { recursive: true }) |
| 106 | |
| 107 | const app = await TypeDoc.Application.bootstrapWithPlugins({ |
| 108 | plugin: [ |
| 109 | 'typedoc-plugin-markdown', |
| 110 | 'typedoc-plugin-frontmatter', |
| 111 | resolve(typedocConfigDir, './src/typedoc-custom-settings.js'), |
| 112 | ], |
| 113 | hideGenerator: true, |
| 114 | readme: 'none', |
| 115 | entryFileName: 'index', |
| 116 | hideBreadcrumbs: true, |
| 117 | hidePageHeader: true, |
| 118 | useCodeBlocks: true, |
| 119 | excludePrivate: true, |
| 120 | excludeInternal: true, |
| 121 | excludeExternals: pkg.excludeExternals, |
| 122 | sourceLinkTemplate: |
| 123 | 'https://github.com/TanStack/query/blob/{gitRevision}/{path}#L{line}', |
| 124 | gitRevision: 'main', |
| 125 | entryPoints: pkg.entryPoints, |
| 126 | tsconfig: pkg.tsconfig, |
| 127 | exclude: pkg.exclude, |
| 128 | out: outputDir, |
| 129 | }) |
| 130 | |
| 131 | const project = await app.convert() |
| 132 | |
| 133 | if (project) { |
| 134 | if (pkg.simplifyLitQueriesControllerTypes) { |
| 135 | simplifyLitQueriesControllerTypes(project) |
| 136 | } |
| 137 | |
| 138 | await app.generateOutputs(project) |
| 139 | |
| 140 | if (pkg.trimGeneratedMarkdown) { |
| 141 | await trimTrailingWhitespaceInMarkdown(outputDir) |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | for (const pkg of [ |
| 147 | { |
no test coverage detected