diff options
| author | ST-DDT <[email protected]> | 2023-01-29 16:35:03 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-29 15:35:03 +0000 |
| commit | ac1a3de17c8840e80fe1609b44e26d287eec952c (patch) | |
| tree | ede991078fd15f25132d806d8b0e1e267e6f95c3 /test/scripts | |
| parent | 0bc6c2fbe65de9a9f706aa6f78f3b07940038461 (diff) | |
| download | faker-ac1a3de17c8840e80fe1609b44e26d287eec952c.tar.xz faker-ac1a3de17c8840e80fe1609b44e26d287eec952c.zip | |
refactor(docs): split generate:api-docs execution from import (#1779)
Diffstat (limited to 'test/scripts')
| -rw-r--r-- | test/scripts/apidoc/utils.ts | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/test/scripts/apidoc/utils.ts b/test/scripts/apidoc/utils.ts index 61f3b848..809240c8 100644 --- a/test/scripts/apidoc/utils.ts +++ b/test/scripts/apidoc/utils.ts @@ -1,7 +1,6 @@ import type { SignatureReflection, TypeDocOptions } from 'typedoc'; import { - newTypeDocApp, - patchProject, + loadProject, selectApiMethodSignatures, selectApiModules, } from '../../../scripts/apidoc/typedoc'; @@ -11,22 +10,10 @@ import { mapByName } from '../../../scripts/apidoc/utils'; * Returns a record with the (Module-Name -> (Method-Name -> Method-Signature)) for the project. */ export function loadProjectModules( - options: Partial<TypeDocOptions> = { - entryPoints: ['src/index.ts'], - }, + options?: Partial<TypeDocOptions>, includeTestModules = false ): Record<string, Record<string, SignatureReflection>> { - const app = newTypeDocApp(); - - app.bootstrap(options); - - const project = app.convert(); - - if (project == null) { - throw new Error('Failed to convert project'); - } - - patchProject(project); + const [, project] = loadProject(options); const modules = selectApiModules(project, includeTestModules); |
