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

Publish-html-plugin template not working with standard-plugin #68

Open
Lenophie opened this issue Jul 20, 2018 · 0 comments
Open

Publish-html-plugin template not working with standard-plugin #68

Lenophie opened this issue Jul 20, 2018 · 0 comments

Comments

@Lenophie
Copy link

Hello !
esdoc-standard-plugin isn't taking the template option into account the way the stand-alone esdoc-publish-html-plugin does.
In fact, we can see in plugin.js that no option is passed to the plugin when using esdoc-standard-plugin :

class Plugin {
  onHandlePlugins(ev) {
    const option = ev.data.option || {};
    const plugins = [
      {name: 'esdoc-lint-plugin', option: option.lint},
      {name: 'esdoc-coverage-plugin', option: option.coverage},
      {name: 'esdoc-accessor-plugin', option: option.accessor},
      {name: 'esdoc-type-inference-plugin', option: option.typeInference},
      {name: 'esdoc-external-ecmascript-plugin'},
      {name: 'esdoc-brand-plugin', option: option.brand},
      {name: 'esdoc-undocumented-identifier-plugin', option: option.undocumentIdentifier},
      {name: 'esdoc-unexported-identifier-plugin', option: option.unexportedIdentifier},
      {name: 'esdoc-integrate-manual-plugin', option: option.manual},
      {name: 'esdoc-integrate-test-plugin', option: option.test},
      {name: 'esdoc-publish-html-plugin'}
    ];

    const existPluginNames = ev.data.plugins.map(plugin => plugin.name);
    for (const plugin of plugins) {
      if (existPluginNames.includes(plugin.name)) continue;
      if (plugin.option === undefined) delete plugin.option;
      ev.data.plugins.push(plugin);
    }
  }
}

module.exports = new Plugin();

I tried replacing the faulty line with {name: 'esdoc-publish-html-plugin', option: option.template} as a potential trivial fix that it didn't do the trick. (template isn't used)

Currently, I have to import the esdoc-publish-html-plugin separately but this implies minor incompatibility issues between the plugins (coverage rates not showing up in the Source page when using a template).

Thanks for helping !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant