@tinymce/beehive-flow
Version:
A CLI tool implementing the beehive flow git branching process
45 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.advanceMinor = exports.advancePatch = exports.updateToStable = exports.updateToNextMinor = exports.updateToNextPatch = void 0;
const tslib_1 = require("tslib");
const PackageJson = tslib_1.__importStar(require("./PackageJson"));
const PreRelease = tslib_1.__importStar(require("./PreRelease"));
const Version_1 = require("./Version");
const updateToNextPatch = (version) => ({
major: version.major,
minor: version.minor,
patch: version.patch + 1,
preRelease: PreRelease.releaseCandidate
});
exports.updateToNextPatch = updateToNextPatch;
const updateToNextMinor = (version) => ({
major: version.major,
minor: version.minor + 1,
patch: 0,
preRelease: PreRelease.releaseCandidate
});
exports.updateToNextMinor = updateToNextMinor;
const updateToStable = (version) => ({
major: version.major,
minor: version.minor,
patch: version.patch
});
exports.updateToStable = updateToStable;
const advance = async (version, pj, pjFile, advanceVersion) => {
const newVersion = advanceVersion(version);
console.log(`Updating version from ${(0, Version_1.versionToString)(version)} to ${(0, Version_1.versionToString)(newVersion)}`);
await PackageJson.writePackageJsonFileWithNewVersion(pj, newVersion, pjFile);
};
const advancePatch = async (version, pj, pjFile, git) => {
await advance(version, pj, pjFile, exports.updateToNextPatch);
await git.add(pjFile);
await git.commit('Update version for next patch release');
};
exports.advancePatch = advancePatch;
const advanceMinor = async (version, pj, pjFile, git) => {
await advance(version, pj, pjFile, exports.updateToNextMinor);
await git.add(pjFile);
await git.commit(`Update version for next minor release`);
};
exports.advanceMinor = advanceMinor;
//# sourceMappingURL=AdvanceVersion.js.map