(pkgName: string, newVersion: string)
| 255 | } |
| 256 | |
| 257 | export async function checkExistingNpmVersion(pkgName: string, newVersion: string) { |
| 258 | if (newVersion !== '0.0.1') { |
| 259 | const npmVersionsCall = await execa('npm', ['view', pkgName, 'versions', '--json']); |
| 260 | const publishedVersions: string[] = JSON.parse(npmVersionsCall.stdout); |
| 261 | if (publishedVersions.includes(newVersion)) { |
| 262 | panic(`Version "${newVersion}" of ${pkgName} is already published to npm`); |
| 263 | } else { |
| 264 | console.log(`✅ Version "${newVersion}" of ${pkgName} is not already published to npm`); |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | export async function releaseVersionPrompt(pkgName: string, currentVersion: string) { |
| 270 | const answers = await prompts({ |
no test coverage detected
searching dependent graphs…