New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--entrypointStrategy Packages
problem with project references
#1976
Comments
sh yarn && yarn repro
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. 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 sh yarn && yarn repro:resolve
<img width="1704" alt="Screen Shot 2022-07-01 at 8 18 30 PM" src="https://user-images.githubusercontent.com/13574879/176979519-d28b9043-374e-40c4-8a71-045359e8042f.png">--entrypointStrategy Packages
problem with project references
@Gerrit0 the strange thing I don't get is this works fine with Also, thank you for your great work, really admire the amount of time and effort you put into this project 🙏 |
Wow, that's... very weird. If I point TypeDoc at just one of the packages, it's able to handle it, so this truly is specific to Packages mode...
So, like the diff --git a/packages/pkg2/src/index.ts b/packages/pkg2/src/index.ts
index 093ace5..127cd92 100644
--- a/packages/pkg2/src/index.ts
+++ b/packages/pkg2/src/index.ts
@@ -1,3 +1,7 @@
+/**
+ * @module pkg2
+ */
+
/**
* Another version
*/ Thanks for the awesome repro! Very helpful when tracking down issues |
Yeah, I'm trying to debug the issue myself, I bumped into a problem when locally trying to build ❯ npm run build:tsc
> typedoc@0.23.3 build:tsc
> tsc --project .
src/test/packages.test.ts:10:32 - error TS2307: Cannot find module '@typestrong/fs-fixture-builder' or its corresponding type declarations.
10 import { tempdirProject } from "@typestrong/fs-fixture-builder";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/test/slow/entry-point.test.ts:1:32 - error TS2307: Cannot find module '@typestrong/fs-fixture-builder' or its corresponding type declarations.
1 import { tempdirProject } from "@typestrong/fs-fixture-builder";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/test/utils/options/readers/tsconfig.test.ts:7:41 - error TS2307: Cannot find module '@typestrong/fs-fixture-builder' or its corresponding type declarations.
7 import { tempdirProject, Project } from "@typestrong/fs-fixture-builder";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/test/utils/options/readers/typedoc.test.ts:2:38 - error TS2307: Cannot find module '@typestrong/fs-fixture-builder' or its corresponding type declarations.
2 import { project as fsProject } from "@typestrong/fs-fixture-builder";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 4 errors in 4 files.
Errors Files
1 src/test/packages.test.ts:10
1 src/test/slow/entry-point.test.ts:1
1 src/test/utils/options/readers/tsconfig.test.ts:7
1 src/test/utils/options/readers/typedoc.test.ts:2 Followed the |
Have you run a I bet this is the fix: diff --git a/src/lib/utils/entry-point.ts b/src/lib/utils/entry-point.ts
index e5bbb300..3e331a8c 100644
--- a/src/lib/utils/entry-point.ts
+++ b/src/lib/utils/entry-point.ts
@@ -367,6 +367,7 @@ function getEntryPointsForPackages(
const program = ts.createProgram({
rootNames: parsedCommandLine.fileNames,
options: options.fixCompilerOptions(parsedCommandLine.options),
+ projectReferences: parsedCommandLine.projectReferences,
});
const sourceFile = program.getSourceFile(packageEntryPoint);
if (sourceFile === undefined) { |
That dependency also requires pre-install scripts in order to work, so if you have the |
@Gerrit0 what's your |
I'm on 8.11.0, though I think even some 6.x version ought to work... |
I think you caught the issue! |
I'll find time to try it with my main project https://github.com/finos/legend-studio later. Due to #1959 I need to put a dummy Thanks for such a quick turnaround! |
Search 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 inpkg1
, thetsconfig
file refers totsconfig.package.json
,typedoc
won't be able to handle it. Strangely, with the same TS setup, if I useResolve
mode, things went fine.Actual Behavior
Typescript fails with the following log
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 waymodules
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
insteadyarn && yarn repro:resolve
Environment
The text was updated successfully, but these errors were encountered: