-
Notifications
You must be signed in to change notification settings - Fork 702
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
Monorepo - Cross reference to other package not resolved #2416
Comments
The code for inherited links predates all of the work for packages mode, and it looks like I missed it when implementing that feature... I'm not seeing an immediately obvious reason why I can't switch it to use symbol references now and just see it work. Method parameters, property types, etc. should all just work. |
Thank you for your reply. I do not quite understand your wording. Do you mean you will investigate and try to switch to symboil references for my use cases? Or can/should I do that locally? For method parameters, that also does not work. I have updated the example. So it appears that (at least for me) they do not 'just work'. By the way -- compliments for the many improvements of TypeDoc over the last year or so. It is really looking much better, and monorepo also works very nice. It's just these little things I observe now :D |
Duplicate of / closely related to new issue #2420 |
For me, cross-project links work if packages have |
I'm currently working around this with a custom |
Short story: You can get the behavior you want by turning on the Looking at all three of #2428, #2420, #2416 when not on antihistamine makes me really concerned with anything I did last week... TypeDoc already correctly creates inheritance links with cross-references as it should, so my previous statement was just flat wrong. To determine how to link files between packages, TypeDoc needs to be able to determine what file they'll be defined in. In 0.25.2, this is completely reliant on the existence of declaration maps, which seems to only be documented in a passing mention in the beta release issue for v0.24... However, when running in packages mode, there's really no reason that TypeDoc shouldn't be able to tell where files come from for the converted packages, since we have the compiler options and the file names which will be compiled. I'm making an update to TypeDoc which will use this to derive source file names. I was hopeful that doing this would remove the requirement to build all the packages before running TypeDoc on them, but unfortunately this isn't quite enough since TypeScript (at least with a references based monorepo) requires that sub-projects be built. If
I am surprised that works at all, TypeDoc was supposed to handle escaping, but it looks like I mistakenly assumed that |
Hi @Gerrit0 , For me it still does not work.
In fact, I do not mind enabling this setting as this also has benefits for VSCode. But it is not in line with your remarks. This aside, the "forward links" still do not work:
|
Update: A "forward link" can be generated like {@link mypackage!MyClass} but then it is also displayed as "myPackage!MyClass" which is simply ugly. Despite the setting for preserveLinkText, this does not seem like something someone would like to see. |
I suspect the declarationMap issue not working is because I forgot to test on Windows, and paths are annoying... The inheritance hierarchy is interesting, the way that's built today has always felt fragile to me... I'm going to look at improving it in a way which should also solve the cross-package inheritance issue. |
Smarter hierarchy detection isn't going to happen today... but at least I got to the windows path fix! |
I've decided to pull smarter hierarchy detection out into #2467 to avoid having to read through this issue every month or so when I forget what the actual remaining work for it is. I believe this is the only open problem still. |
Search terms
Cross reference other package not resolved
Expected Behavior
When I have a monorepo with multpple packages, and I create typedoc via "packages", I expect that types defined in one package but used in another package are properly linked from the other package to the one package.
Actual Behavior
These types do not become links, but they are plain text.
Steps to reproduce the bug
See TypeStrong/typedoc-repros#32
The readme contains repro steps + some additional observations.
Environment
The text was updated successfully, but these errors were encountered: