MCPcopy Create free account
hub / github.com/formkit/formkit / promptForMasterVersion

Function promptForMasterVersion

scripts/publish.mjs:382–411  ·  view source on GitHub ↗

* Prompt for a release version on main branch. * Asks once for version type and version, applies to all packages.

()

Source from the content-addressed store, hash-verified

380 * Asks once for version type and version, applies to all packages.
381 */
382async function promptForMasterVersion() {
383 const packageJSON = getPackageJSON('core')
384 const currentVersion = packageJSON.version
385
386 // Ask for version type
387 const { versionType } = await prompts({
388 type: 'select',
389 name: 'versionType',
390 message: `Current version is ${chalk.cyan(currentVersion)}. What type of release?`,
391 choices: [
392 { title: 'patch', description: 'Bug fixes (e.g., 1.7.0 → 1.7.1)', value: 'patch' },
393 { title: 'minor', description: 'New features (e.g., 1.7.0 → 1.8.0)', value: 'minor' },
394 { title: 'major', description: 'Breaking changes (e.g., 1.7.0 → 2.0.0)', value: 'major' },
395 ],
396 })
397
398 if (!versionType) {
399 return false
400 }
401
402 const guessVersion = suggestVersionIncrement(currentVersion, versionType)
403 const { version } = await prompts({
404 type: 'text',
405 name: 'version',
406 message: `What should the new version be?`,
407 initial: guessVersion,
408 })
409
410 return version
411}
412
413/**
414 * Loops through prePublish changes and writes new package.json files

Callers 1

publishPackagesFunction · 0.85

Calls 2

getPackageJSONFunction · 0.90
suggestVersionIncrementFunction · 0.70

Tested by

no test coverage detected