(content, options)
| 33 | transforms: { |
| 34 | // https://github.com/moleculerjs/moleculer-addons/blob/master/readme-generator.js#L11 |
| 35 | PACKAGES(content, options) { |
| 36 | const base = path.resolve('packages') |
| 37 | const packages = fs.readdirSync(path.resolve('packages')) |
| 38 | .filter(pkg => !/^\./.test(pkg)) |
| 39 | .map(pkg => ([pkg, fs.readFileSync(path.join(base, pkg, 'package.json'), 'utf8')])) |
| 40 | .filter(([pkg, json]) => { |
| 41 | const parsed = JSON.parse(json) |
| 42 | return parsed.private !== true |
| 43 | }) |
| 44 | .map(([pkg, json]) => { |
| 45 | const { name, description } = JSON.parse(json) |
| 46 | return `- [${name}](./packages/${pkg}) ${description} [npm link](https://www.npmjs.com/package/${name}).` |
| 47 | }) |
| 48 | .join('\n') |
| 49 | return packages |
| 50 | }, |
| 51 | pkgSize: async (content, options, context) => { |
| 52 | const dir = path.dirname(context.originalPath) |
| 53 | let fileToCheck |
nothing calls this directly
no outgoing calls
no test coverage detected