Running typedoc on my project with npx typedoc --json docs/apidoc.json should generate a JSON file.
Actual Behavior
Typedoc fails with an error:
Using TypeScript 3.9.5 from /Users/jason/Temp/intern/intern/node_modules/.pnpm/typescript@3.9.5/node_modules/typescript/lib
Error: /Users/jason/Temp/intern/intern/packages/digdug/src/SeleniumTunnel.ts(11)
File '/Users/jason/Temp/intern/intern/packages/digdug/src/webdrivers.json' is not listed within the file list of project '/Users/jason/Temp/intern/intern/packages/digdug/tsconfig.json'. Projects must list all files or use an 'include' pattern.
The tsconfig.json file did incluede the file in question:
The issue is that the include list isn't being passed directly to the TS compiler. The set of input files is processed by Application.expandInputFiles before being sent to the TS compiler, and expandInputFiles doesn't include JSON files in its expansion. In a composite project, the TS compiler will fail if if the set of input files doesn't include every file that's part of the build (including JSON files). Manually adding the JSON file to the result of expandInputFiles in CliApplication.bootstrap causes the doc build to run successfully.
Steps to reproduce the bug
Create a composite TS project in which one module imports a JSON file
Try to build with typedoc (e.g., typedoc --json docs/apidoc.json)
Search terms
composite, json, resolveJsonModule
Expected Behavior
Running typedoc on my project with
npx typedoc --json docs/apidoc.json
should generate a JSON file.Actual Behavior
Typedoc fails with an error:
The
tsconfig.json
file did incluede the file in question:The issue is that the
include
list isn't being passed directly to the TS compiler. The set of input files is processed byApplication.expandInputFiles
before being sent to the TS compiler, andexpandInputFiles
doesn't include JSON files in its expansion. In a composite project, the TS compiler will fail if if the set of input files doesn't include every file that's part of the build (including JSON files). Manually adding the JSON file to the result ofexpandInputFiles
inCliApplication.bootstrap
causes the doc build to run successfully.Steps to reproduce the bug
typedoc --json docs/apidoc.json
)Environment