citkane / typedoc-plugin-versions

Semantic versioning with select dropdown for Typedoc documentation sets
https://citkane.github.io/typedoc-plugin-versions/
MIT License
4 stars 7 forks source link

Plugin fails if `out` is not defined in typedoc config #2

Closed toebeann closed 2 years ago

toebeann commented 2 years ago

When out is not defined in typedoc config (either via CLI or typedoc.json), the following error occurs when attempting to generate docs:

> npx typedoc      
Loaded plugin typedoc-plugin-versions
TypeDoc exiting with unexpected error:
Error: ENOENT: no such file or directory, scandir
    at Object.readdirSync (node:fs:1405:3)
    at Object.getPackageDirectories (D:\repos\@toebean\signals\node_modules\typedoc-plugin-versions\src\etc\utils.js:72:31)
...

It does seem to work up to a point: it creates one single directory for docs named after the current package.json version (i.e. v2.3.3) in the package root directory before erroring out.

To me, this would indicate that the plugin is not inheriting the default out definition from typedoc (out defaults to docs when not defined).

As this plugin appears to still be in development (0.0.x) I would say this is a low priority issue (especially as typedoc themselves don't list that out has a default of docs), but it's worth considering whether to support this in the future.

If you would rather not support the default out definition, it is probably worth gracefully throwing a descriptive error message before typedoc begins generating output files.

citkane commented 2 years ago

Yes, Tyedoc sets it's default out location here: https://github.com/TypeStrong/typedoc/blob/c8028d1639eb9eb5cd6c0ded7717c4caa65713ea/bin/typedoc#L119

This is well after plugins are loaded here: https://github.com/TypeStrong/typedoc/blob/c8028d1639eb9eb5cd6c0ded7717c4caa65713ea/bin/typedoc#L26

This is all workable roundable. ATM I am on my pone, in the hospital, recovering from hand surgery, so all thumb(s)😀

I will engage in solutions hopefully tomorrow

toebeann commented 2 years ago

Wishing you a speedy recovery! 💜

citkane commented 2 years ago

Thanks @toebeann , That should be good in v0.0.5, which is now published and released.