Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release script #11223

Merged
merged 16 commits into from
Oct 16, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bump pre-release package versions differently
  • Loading branch information
bvaughn committed Oct 16, 2017
commit c6af68f87a12c74c3c9bcbeaa5eb4e65b0ca3822
12 changes: 11 additions & 1 deletion scripts/release/build-commands/update-package-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {exec} = require('child-process-promise');
const {readFileSync, writeFileSync} = require('fs');
const {readJson, writeJson} = require('fs-extra');
const {join} = require('path');
const semver = require('semver');
const {projects} = require('../config');
const {execUnlessDry, logPromise} = require('../utils');

Expand All @@ -30,7 +31,16 @@ const update = async ({cwd, dry, version}) => {
const updateProjectPackage = async project => {
const path = join(cwd, 'packages', project, 'package.json');
const json = await readJson(path);
json.version = version;

// Unstable packages (eg version < 1.0) are treated differently.
// In order to simplify DX for the release engineer,
// These packages are auto-incremented by a minor version number.
if (semver.lt(json.version, '1.0.0')) {
json.version = `0.${semver.minor(json.version) + 1}.0`;
} else {
json.version = version;
}

if (project !== 'react') {
json.peerDependencies.react = `^${version}`;
}
Expand Down