Closed GerkinDev closed 4 years ago
Thank you for the detailed report! It informed my solution to the problem.
So, maybe options should be parsed once before plugins load, stored somewhere as raw options, then use those raw options when a plugin declares them.
This doesn't quite work, because we'd have to guess what type the options should be stored as. What does work though is parsing options, loading plugins, throwing away the parsed options, and re-parsing options :)
Fixed in v0.16.0.
I'm using a configuration file to store my TypeDoc settings. This configuration file contains the list of plugins to use, but they are not called at all. I don't want to rely on NPM auto-discovery.
This issue may be somehow related to #875.
Expected Behavior
Typedoc should use
plugin
array provided in the configuration file, and eventually merge it with the one provided by CLI argumentsActual Behavior
Typedoc does not use the
plugin
option from the config file, and uses only NPM auto-discovery or the--plugin
CLI argumentSteps to reproduce the bug
Install any typedoc plugin. From the installed plugin, remove the keyword
typedocplugin
from the keywords of the installedpackage.json
, thus disabling npm auto-discovery.Create a
typedoc.json
fileRun typedoc:
Environment
What I've tried
As far as I've seen and experimented, the problem is here: https://github.com/TypeStrong/typedoc/blob/9a76bec7cbc9fc7be7e00dd22f58f715bb4cebed/src/lib/application.ts#L124-L125
If I replace those lines with the following, the plugin is called correctly, but I didn't checked for side effects:
So is it intentional that options are parsed after plugins load ?
Edit : after further checks, I saw that options declared by the plugin are not provided to it if I apply the solution mentioned above. So, maybe options should be parsed once before plugins load, stored somewhere as raw options, then use those raw options when a plugin declares them.