MCPcopy
hub / github.com/QwikDev/qwik / checkExistingNpmVersion

Function checkExistingNpmVersion

scripts/release.ts:257–267  ·  view source on GitHub ↗
(pkgName: string, newVersion: string)

Source from the content-addressed store, hash-verified

255}
256
257export 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
269export async function releaseVersionPrompt(pkgName: string, currentVersion: string) {
270 const answers = await prompts({

Callers 2

setReleaseVersionFunction · 0.85
releaseVersionPromptFunction · 0.85

Calls 2

panicFunction · 0.90
parseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…