chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
+6
-26
@@ -3,11 +3,7 @@ import semver from 'semver';
|
||||
import fs from 'fs/promises';
|
||||
|
||||
async function run() {
|
||||
const { stdout: branchName } = await execa('git', [
|
||||
'rev-parse',
|
||||
'--abbrev-ref',
|
||||
'HEAD',
|
||||
]);
|
||||
const { stdout: branchName } = await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
|
||||
console.log('Current branch:', branchName);
|
||||
|
||||
// read the current version from lerna.json
|
||||
@@ -16,18 +12,10 @@ async function run() {
|
||||
|
||||
console.log('Current version:', currentVersion);
|
||||
|
||||
const { stdout: currentCommitHash } = await execa('git', [
|
||||
'rev-parse',
|
||||
'HEAD',
|
||||
]);
|
||||
const { stdout: currentCommitHash } = await execa('git', ['rev-parse', 'HEAD']);
|
||||
console.log('Current commit hash:', currentCommitHash);
|
||||
|
||||
const { stdout: lastCommitMessage } = await execa('git', [
|
||||
'log',
|
||||
'--format=%B',
|
||||
'-n',
|
||||
'1',
|
||||
]);
|
||||
const { stdout: lastCommitMessage } = await execa('git', ['log', '--format=%B', '-n', '1']);
|
||||
|
||||
let nextVersion;
|
||||
|
||||
@@ -40,23 +28,15 @@ async function run() {
|
||||
const isBumpBeta = lastCommitMessage.trim().endsWith('[BUMP BETA]');
|
||||
console.log('isBumpBeta', isBumpBeta);
|
||||
|
||||
if (
|
||||
prereleaseComponents &&
|
||||
prereleaseComponents.includes('beta') &&
|
||||
!isBumpBeta
|
||||
) {
|
||||
if (prereleaseComponents && prereleaseComponents.includes('beta') && !isBumpBeta) {
|
||||
nextVersion = semver.inc(currentVersion, 'prerelease', 'beta');
|
||||
} else if (isBumpBeta && prereleaseComponents.includes('beta')) {
|
||||
console.log('Bumping beta version to be fresh beta');
|
||||
nextVersion = `${semver.major(currentVersion)}.${semver.minor(
|
||||
currentVersion
|
||||
) + 1}.0-beta.0`;
|
||||
nextVersion = `${semver.major(currentVersion)}.${semver.minor(currentVersion) + 1}.0-beta.0`;
|
||||
} else {
|
||||
console.log('Bumping minor version for beta release');
|
||||
const nextMinorVersion = semver.inc(currentVersion, 'minor');
|
||||
nextVersion = `${semver.major(nextMinorVersion)}.${semver.minor(
|
||||
nextMinorVersion
|
||||
)}.0-beta.0`;
|
||||
nextVersion = `${semver.major(nextMinorVersion)}.${semver.minor(nextMinorVersion)}.0-beta.0`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user