(res)
| 231 | } |
| 232 | |
| 233 | serveChangedPackages(res) { |
| 234 | res.setHeader('Content-Type', 'text/html'); |
| 235 | res.end(` |
| 236 | <!doctype html> |
| 237 | <html style="color-scheme: dark light"> |
| 238 | <body> |
| 239 | <form method="post"> |
| 240 | <h1>Changed packages</h1> |
| 241 | <table> |
| 242 | ${[...this.changedPackages] |
| 243 | .filter(pkg => !excludedPackages.has(pkg) && !this.existingPackages.has(pkg)) |
| 244 | .map( |
| 245 | pkg => ` |
| 246 | <tr> |
| 247 | <td><code>${pkg}</code></td> |
| 248 | <td> |
| 249 | <select name="${pkg}"> |
| 250 | <option>unreleased</option> |
| 251 | <option>alpha</option> |
| 252 | <option>beta</option> |
| 253 | <option>rc</option> |
| 254 | <option>released</option> |
| 255 | </select> |
| 256 | </td> |
| 257 | </tr> |
| 258 | ` |
| 259 | ) |
| 260 | .join('\n')} |
| 261 | ${[...this.changedPackages] |
| 262 | .filter(pkg => !excludedPackages.has(pkg) && this.existingPackages.has(pkg)) |
| 263 | .map(pkg => { |
| 264 | let json = JSON.parse( |
| 265 | fs.readFileSync(this.workspacePackages[pkg].location + '/package.json', 'utf8') |
| 266 | ); |
| 267 | let version = semver.parse(json.version); |
| 268 | return ` |
| 269 | <tr> |
| 270 | <td><code>${pkg}</code></td> |
| 271 | <td> |
| 272 | <select name="${pkg}"> |
| 273 | <option>unchanged</option> |
| 274 | <option ${version.prerelease[0] === 'alpha' ? 'selected' : ''}>alpha</option> |
| 275 | <option ${version.prerelease[0] === 'beta' ? 'selected' : ''}>beta</option> |
| 276 | <option ${version.prerelease[0] === 'rc' ? 'selected' : ''}>rc</option> |
| 277 | <option>patch</option> |
| 278 | <option ${version.prerelease.length === 0 ? 'selected' : ''}>minor</option> |
| 279 | <option>major</option> |
| 280 | </select> |
| 281 | </td> |
| 282 | </tr> |
| 283 | `; |
| 284 | }) |
| 285 | .join('\n')} |
| 286 | </table> |
| 287 | <input type="submit" /> |
| 288 | </form> |
| 289 | </body> |
| 290 | </html> |
no test coverage detected