Skip to content
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

[Bug]: root sources aren't added with incremental --watch #526

Open
pjeby opened this issue Dec 26, 2023 · 1 comment
Open

[Bug]: root sources aren't added with incremental --watch #526

pjeby opened this issue Dec 26, 2023 · 1 comment
Labels
bug Something isn't working triage

Comments

@pjeby
Copy link

pjeby commented Dec 26, 2023

Plugin

@knodes/typedoc-pluginutils

Typedoc plugin(s) version(s)

@knodes/typedoc-pluginutils@0.23.4, @knodes/typedoc-plugin-pages@0.23.4

Typedoc version

0.25.4

Describe the problem

ABasePlugin._addSourceToProject() is only called once for the lifetime of a typedoc run, but this means that when you run typedoc --watch, the added sources aren't present in the project when later calls to findModuleRoot are made. This causes the pages plugin to crash with errors when trying to process pages for a subsequent build.

What did you expected ?

The extra sources should be added on each resolve begin event, so that they're present in all builds, not just the first one. Removing the once() wrapper fixes the issue for me.

@pjeby pjeby added bug Something isn't working triage labels Dec 26, 2023
@pjeby
Copy link
Author

pjeby commented Dec 26, 2023

A similar issue exists with DefaultPagesRenderer in the pages plugin: the constructor is only run once, and there is code in it that should be run on every RendererEvent.BEGIN. (The bits from const modulesPages to event.urls =.) Without them, the pages are not actually rendered on the second or following watch runs.

As far as I can tell, these two issues are the only things stopping --watch from working with the pages plugin on Typedoc 0.25. I've written a script that monkeypatches fixes for them (and patches the default theme to add in the menus) and it seems to work fine now for me (combined with the "options" workaround from #525), but of course others may have different results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant