From 1c744328eb03dc8019fe6dc3a309f68260210146 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Wed, 6 Feb 2019 17:03:51 +0100 Subject: [PATCH] feat: ensure correct path for input files --- src/common.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/common.ts b/src/common.ts index bfcca2a2..8b7b5947 100644 --- a/src/common.ts +++ b/src/common.ts @@ -118,16 +118,23 @@ export interface ExpectableValidationErrors { export function getProjectReflection(srcPath: PathLike): ProjectReflection { logger.info(`Generating project reflection for ${srcPath.toString()}.`); + const tsconfigPath = getTsconfigPath(srcPath.toString()); + // initialize new Typedoc application const app = new Application({ excludeExternals: true, includeDeclarations: true, module: 'commonjs', - tsconfig: join(getTsconfigPath(srcPath.toString()), 'tsconfig.json'), + tsconfig: join(tsconfigPath, 'tsconfig.json'), }); + let inputFilePath = srcPath; + if (inputFilePath === tsconfigPath) { + inputFilePath = join(tsconfigPath, 'src'); + } + // get input files - const inputFiles = app.expandInputFiles([srcPath.toString()]); + const inputFiles = app.expandInputFiles([inputFilePath.toString()]); // get project reflection from input files const result = app.convert(inputFiles);