`--entrypointStrategy Packages` problem with project references
See original GitHub issueSearch terms
project reference, entrypointStrategy, monorepo, packages
Expected Behavior
If I use --entrypointStrategy Packages
and if my sub-project has a slightly complicated setup (see how in pkg1
, the tsconfig
file refers to tsconfig.package.json
, typedoc
won’t be able to handle it. Strangely, with the same TS setup, if I use Resolve
mode, things went fine.
Actual Behavior
Typescript fails with the following log
Using TypeScript 4.7.4 from ./node_modules/typescript/lib
Converting with 2 programs 2 entry points
packages/pkg1/src/index.ts:1:25 - error TS6059: File '/Users/sample/Developer/js/issue-repo/packages/pkg1/package.json' is not under 'rootDir' '/Users/sample/Developer/js/issue-repo/packages/pkg1/src'. 'rootDir' is expected to contain all source files.
1 import packageJson from "../package.json";
~~~~~~~~~~~~~~~~~
packages/pkg1/src/index.ts:1:25 - error TS6307: File '/Users/sample/Developer/js/issue-repo/packages/pkg1/package.json' is not listed within the file list of project '/Users/sample/Developer/js/issue-repo/packages/pkg1/tsconfig.json'. Projects must list all files or use an 'include' pattern.
1 import packageJson from "../package.json";
~~~~~~~~~~~~~~~~~
Steps to reproduce the bug
Please checkout
https://github.com/akphi/issue-repo/tree/typedoc
To reproduce:
yarn && yarn repro
Additional Context
However, I could totally be okay with using --entrypointStrategy Resolve
strategy, but I don’t like the way modules
are being shown as folders, I wonder if we could do something about that (like being able to specify module name), otherwise if it’s intended, I would like to use --entrypointStrategy Packages
instead
yarn && yarn repro:resolve

Environment
- Typedoc version: 0.23.3
- TypeScript version: 4.7.4
- Node.js version: 16.15.0
- OS: Mac 12.4
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Have you run a
npm install
? That’s a pretty new dev dependency, might not be installed if you installed a while ago.I bet this is the fix:
I’ll find time to try it with my main project https://github.com/finos/legend-studio later. Due to https://github.com/TypeStrong/typedoc/issues/1959 I need to put a dummy
typedocMain
in all of my packages 😆Thanks for such a quick turnaround!