MCPcopy Create free account
hub / github.com/eva-engine/eva.js / main

Function main

scripts/release.js:44–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42const step = msg => console.log(chalk.cyan(msg));
43
44async function main() {
45 let targetVersion = args._[0];
46
47 if (!targetVersion) {
48 // no explicit version, offer suggestions
49 const { release } = await prompt({
50 type: 'select',
51 name: 'release',
52 message: 'Select release type',
53 choices: versionIncrements.map(i => `${i} (${inc(i)})`).concat(['custom']),
54 });
55
56 if (release === 'custom') {
57 targetVersion = (
58 await prompt({
59 type: 'input',
60 name: 'version',
61 message: 'Input custom version',
62 initial: currentVersion,
63 })
64 ).version;
65 } else {
66 targetVersion = release.match(/\((.*)\)/)[1];
67 }
68 }
69
70 if (!semver.valid(targetVersion)) {
71 throw new Error(`invalid target version: ${targetVersion}`);
72 }
73
74 const { yes } = await prompt({
75 type: 'confirm',
76 name: 'yes',
77 message: `Releasing v${targetVersion}. Confirm?`,
78 });
79
80 if (!yes) {
81 return;
82 }
83
84 // run tests before release
85 step('\nRunning tests...');
86 if (!skipTests && !isDryRun) {
87 await run(bin('jest'), ['--clearCache']);
88 await run('npm', ['test']);
89 } else {
90 console.log('(skipped)');
91 }
92
93 // update all package versions and inter-dependencies
94 step('\nUpdating cross dependencies...');
95 updateVersions(targetVersion);
96
97 // build all packages with types
98 step('\nBuilding all packages...');
99 if (!skipBuild && !isDryRun) {
100 await run('npm', ['run', 'build', '--', '--release']);
101 } else {

Callers 1

release.jsFile · 0.70

Calls 6

incFunction · 0.85
binFunction · 0.85
updateVersionsFunction · 0.85
publishPackageFunction · 0.85
stepFunction · 0.70
runFunction · 0.70

Tested by

no test coverage detected