Gerrit0 / typedoc-plugin-missing-exports

MIT License
44 stars 4 forks source link

Setting the plugin options in tsconfig #24

Closed ccsenter closed 3 months ago

ccsenter commented 7 months ago

Hi, I'm trying to use the plugin and I was setting the placeInternalsInOwningModule option in my "typedocOptions" section of my tsconfig but I keep getting:

error] Tried to set an option (placeInternalsInOwningModule) that was not declared. You may have meant:
        excludeInternal
        cname
        tsconfig
        name
        version

How do I set plugin options?

Gerrit0 commented 7 months ago

It sounds to me like the plugin either isn't loaded (old versions of typedoc automatically loaded npm packages that looked like plugins, new ones require specifying the plugin option to say what should be) or you have an old version installed (that's a pretty recently introduced option)

ccsenter commented 7 months ago

Hm...the plugins seems to be loaded and everything is the latest (typedoc is 0.25.3 and the missing exports plugin is 2.2.0 which should support the typedoc version I'm using):

yarn typedoc
[info] Loaded plugin typedoc-plugin-markdown
[info] Loaded plugin typedoc-plugin-missing-exports
[error] Tried to set an option (placeInternalsInOwningModule) that was not declared. You may have meant:
        excludeInternal
        cname
        tsconfig
        name
        version

I'm not sure how the plugin options are consolidated with supported typedoc options but I can see in options that the code checks the plugin option placeInternalsInOwningModule in the existing declarations and for good reason, it will not find it there. Is there a syntax where plugin options are specified with the plugin itself in typedocOptions? Like with a babel plugins?

ccsenter commented 7 months ago

Never mind...I see now what's happening. I have a monorepo and it's is picking up the plugin from the workspace root node_modules (which is an older version) and not from my project (which has the latest version)

docmattman commented 7 months ago

I have a similar question. How do I set the options for this plugin inside my typedoc.json file? Right now I'm using this:

  "plugin": ["typedoc-plugin-missing-exports"],
  "placeInternalsInOwningModule": true

The plugin loads fine, but the placeInternalsInOwningModule: true seems to be ignored. Can someone point out the proper way to define the options for the plugin in the typedoc.json file?

Gerrit0 commented 7 months ago

Exactly like that. Keep in mind that with packages mode that option needs to be set down in the project, not in the root config.

docmattman commented 7 months ago

That was indeed the problem. I moved the config into the base JSON file that all of my packages extend from and it's working as intended. Thanks @Gerrit0 !