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

Mix of import and require and module.exports #1

Closed
oliverfoster opened this issue May 31, 2018 · 0 comments
Closed

Mix of import and require and module.exports #1

oliverfoster opened this issue May 31, 2018 · 0 comments

Comments

@oliverfoster
Copy link

oliverfoster commented May 31, 2018

Which version of node are you using? I can't get the import directives to work in node 8.11.1 without a transpiler.

Suggest using https://www.npmjs.com/package/esdoc-node to convert require + module.exports directives.

.esdoc.json includes don't work on windows cos the regexps are set with / but windows needs \\ to parse correctly.

probably need to switch to .esdoc.js and normalize the paths:

const os = require('os');
const norm = (rex)=>{
  switch (os.platform()) {
    case "win32":
      return rex.replace(/\//g, "\\\\");
  }
  return rex;
};

module.exports = {
  "source": "./",
  "destination": "./docs",
  "index": "./DOCS.md",
  "plugins": [
    {
     "name": "esdoc-standard-plugin",
      "option": {
        "brand": {
          "title": "Adapt authoring tool",
          "author": "Adapt",
          "site": "https://www.adaptlearning.org/",
          "image": "https://www.adaptlearning.org/wp-content/uploads/2015/11/home-hero-logo.png"
        }
      }
    },
    {
     "name": "esdoc-node"
    }
  ],
  "includes": [
    norm("node_modules/adapt-authoring-core/lib"),
    norm("node_modules/adapt-authoring-server/lib"),
    norm("node_modules/adapt-authoring-helloworld/lib"),
    norm("node_modules/adapt-authoring-logger/lib")
  ]
};

Would also give the option to automatically generate includes value from package jsons.

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