diff options
| author | ST-DDT <[email protected]> | 2022-04-07 16:08:09 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-07 16:08:09 +0200 |
| commit | 5aa8eeb3649955bf03239e93c4b87b1bc874cb2e (patch) | |
| tree | a2c33ddc66ff7a313e7ae40ff6d175e2fcc0644b /scripts/apidoc.ts | |
| parent | 81171c9f9f2e548f9a86eaae3683ead7e28dbd72 (diff) | |
| download | faker-5aa8eeb3649955bf03239e93c4b87b1bc874cb2e.tar.xz faker-5aa8eeb3649955bf03239e93c4b87b1bc874cb2e.zip | |
test: add parameter defaults to our signature generation test (#793)
Diffstat (limited to 'scripts/apidoc.ts')
| -rw-r--r-- | scripts/apidoc.ts | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts index 4ac4fbf9..d519a320 100644 --- a/scripts/apidoc.ts +++ b/scripts/apidoc.ts @@ -1,32 +1,14 @@ import { resolve } from 'path'; -import * as TypeDoc from 'typedoc'; import { writeApiPagesIndex } from './apidoc/apiDocsWriter'; import { processDirectMethods } from './apidoc/directMethods'; import { processModuleMethods } from './apidoc/moduleMethods'; -import { - DefaultParameterAwareSerializer, - parameterDefaultReader, - patchProjectParameterDefaults, -} from './apidoc/parameterDefaults'; import type { PageIndex } from './apidoc/utils'; -import { pathOutputDir } from './apidoc/utils'; +import { newTypeDocApp, patchProject, pathOutputDir } from './apidoc/utils'; const pathOutputJson = resolve(pathOutputDir, 'typedoc.json'); async function build(): Promise<void> { - const app = new TypeDoc.Application(); - - app.options.addReader(new TypeDoc.TSConfigReader()); - // If you want TypeDoc to load typedoc.json files - //app.options.addReader(new TypeDoc.TypeDocReader()); - - // Read parameter defaults - app.converter.on( - TypeDoc.Converter.EVENT_CREATE_DECLARATION, - parameterDefaultReader - ); - // Add to debug json output - app.serializer.addSerializer(new DefaultParameterAwareSerializer(undefined)); + const app = newTypeDocApp(); app.bootstrap({ entryPoints: ['src/index.ts'], @@ -36,15 +18,10 @@ async function build(): Promise<void> { const project = app.convert(); - if (!project) { - // Project may not have converted correctly - return; - } // Useful for manually analyzing the content await app.generateJson(project, pathOutputJson); - console.log(pathOutputDir); - patchProjectParameterDefaults(project); + patchProject(project); const modulesPages: PageIndex = []; modulesPages.push({ text: 'Localization', link: '/api/localization.html' }); |
