MCPcopy Create free account
hub / github.com/adobe/react-spectrum / promptVersions

Method promptVersions

scripts/bumpVersions.js:414–463  ·  view source on GitHub ↗
(versions)

Source from the content-addressed store, hash-verified

412 }
413
414 async promptVersions(versions) {
415 console.log('');
416 for (let [name, [oldVersion, newVersion, isPrivate]] of versions) {
417 if (newVersion !== oldVersion || isPrivate) {
418 console.log(
419 `${name}: ${chalk.blue(oldVersion)}${isPrivate ? chalk.red(' (private)') : ''} => ${chalk.green(newVersion)}`
420 );
421 }
422 }
423
424 let loggedSpace = false;
425 for (let name in this.workspacePackages) {
426 if (
427 !this.releasedPackages.has(name) &&
428 !excludedPackages.has(name) &&
429 !this.existingPackages.has(name)
430 ) {
431 let filePath = this.workspacePackages[name].location + '/package.json';
432 let pkg = JSON.parse(fs.readFileSync(filePath, 'utf8'));
433 if (!pkg.private) {
434 if (!loggedSpace) {
435 console.log('');
436 loggedSpace = true;
437 }
438
439 console.warn(chalk.red(`${name} will change from public to private`));
440 }
441 }
442 }
443
444 console.log('');
445
446 let rl = readline.createInterface({
447 input: process.stdin,
448 output: process.stdout
449 });
450
451 return new Promise((resolve, reject) => {
452 rl.question('Do you want to continue? (y/n) ', function (c) {
453 rl.close();
454 if (c === 'n') {
455 reject('Not continuing');
456 } else if (c === 'y') {
457 resolve();
458 } else {
459 reject('Invalid answer');
460 }
461 });
462 });
463 }
464
465 bumpVersions(versions) {
466 for (let [name, {location}] of this.releasedPackages) {

Callers 1

runMethod · 0.95

Calls 4

hasMethod · 0.65
closeMethod · 0.65
resolveFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected