-
Notifications
You must be signed in to change notification settings - Fork 4
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
Usage with monorepo doesn't seem to work #14
Comments
Hi. I must have missed these changes when I looked at the change log of TypeDoc 0.24. If you can provide an example repository I can look into this when I find the time. |
Hello! thank you for your quick response. In the main branch I have created the example using typedoc@0.24 and typedoc-plugin-merge-modules@4.1.0 I have also created a branch called 0.23 with typedoc@0.23 and typedoc-plugin-merge-modules@4.0.1 You can execute typedoc by running |
Thank you for the test repository. The problem should be fixed in version 5.0.0 that I just released on NPM. 🎉 The problem was that TypeDoc 0.24 creates a separate converter for every package when using the entry point strategies "merge" or "package" which resulted in the merge getting called too early. I had to change the TypeDoc events the plugin subscribes to in order to get it working. Unfortunately while doing this I also had to drop support for TypeDoc version 0.23 as that version doesn't include the new events. 😞 Please report back after you updated to and tested the new version so that we can close this issue. |
Thank you very much! Your plugin is amazing, to the point that it should be part of typedoc |
Thanks. I also think that this functionality should be part of TypeDoc. Maybe someday it will be. |
I confirm is working now, thank you! |
Hi @krisztianb I will update the repo with the example |
Hi. Ok. Please post the current behaviour and how you would like it to be. Then I can take a look. |
The good news: I can reproduce the problem and added an automated test to the plugin's repo that currently fails because of this issue: https://github.com/krisztianb/typedoc-plugin-merge-modules/blob/master/test/merge-module-monorepo/test.cy.ts#L32 The (somewhat) bad news: I'm not sure what the problem is. It seems to be unrelated to the plugin's code itself. Either it is a bug in TypeDoc or the plugin is executed too late after the index has already been generated by TypeDoc. I created an issue for this in the TypeDoc repo: TypeStrong/typedoc#2281 Hopefully Gerrit will be able to take a look at this and hint me into the right direction. |
Hi! Thank you very much, I hope typedoc devs can take a look at it. |
It looks like that this can't be solved 100% correctly for the time being. Since the problem is that the index is generated before the plugin merges the modules, what we could do is to "recreate" the index on our own after the merge. The only problem is as Gerrit pointed out, that the sort order of the index entries can be specified in the config and we don't have access to the sorting function that is used to do the sort. Are you using any kind of specific sort settings in your config? If not we could simply implement an alphabetical sorting. Even if it is not always "correct" it is better than having an incomplete index. |
Hi! No, I'm not using the sort config. Re-creating the index sounds good as a solution for now with the restriction of the sorting. |
Hi. I released version 5.0.1 which also merges categories and groups and sorts them alphabetically. Please give me feedback if it is working correctly for you. Thanks. |
Hi @krisztianb , |
Hi! |
Hi!
First of all thanks for your plugin :)
We are having issues working with typedoc@0.24 and typedoc-plugin-merge-modules in a monorepo.
In the typedoc@0.24 release, the author rebuilt the way typedoc works and how it builts the documentation for monorepos.
Currently, we are not able to make typedoc-plugin-merge-modules work in a monorepo with multiple packages
This worked with typedoc@0.23 and the previous version of the plugin
Expected Behavior
The documentation generated for all the packages properly merge the different packages with the same @module @mergeTarget tags
Current Behavior
Modules are not merged and are shown independently.
Steps to Reproduce
I will provide a repo with an example, we use Nx for the monorepo.
We have these projects in Nx
each one with his own package.json
Typedoc@0.24 requires to split the configurations, we created a typedoc.json in both of them
the index.ts (entry point configured for typedoc) has the comments
but the result is
and here the typedoc global config
I will provide an example repository this afternoon :)
The text was updated successfully, but these errors were encountered: