()
| 134 | } |
| 135 | |
| 136 | async listWorkspaces () { |
| 137 | const results = {} |
| 138 | await this.setWorkspaces() |
| 139 | for (const path of this.workspacePaths) { |
| 140 | const pj = resolve(path, 'package.json') |
| 141 | // setWorkspaces has already parsed package.json so we know it won't error |
| 142 | const pkg = await readFile(pj, 'utf8').then(data => JSON.parse(data)) |
| 143 | |
| 144 | if (pkg.name && pkg.version) { |
| 145 | results[pkg.name] = pkg.version |
| 146 | } |
| 147 | } |
| 148 | return this.list(results) |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | module.exports = Version |
no test coverage detected