@samitouri / QOS-React / commits / 9e158c091b

Updated release script documentation and command names (#17929)

* Updated release script documentation and command names * Update scripts/release/README.md Co-Authored-By: Sunil Pai <threepointone@oculus.com> * Updated README Co-authored-by: Sunil Pai <threepointone@oculus.com>

Brian Vaughn committed Feb 5, 2020 at 08:52 UTC 9e158c091bb2bd795b734437bf5cead514039531
21 files changed +86 -81
scripts/release/README.md
+44 -39
@@ -4,12 +4,12 @@ The release process consists of several phases, each one represented by one of t
4
5 A typical release goes like this:
6 1. When a commit is pushed to the React repo, [Circle CI](https://circleci.com/gh/facebook/react/) will build all release bundles and run unit tests against both the source code and the built bundles.
7 -2. Next the release is [**published as a canary**](#publishing-a-canary) using the [`prepare-canary`](#prepare-canary) and [`publish`](#publish) scripts. (Currently this process is manual but might be automated in the future using [GitHub "actions"](https://github.com/features/actions).)
8 -3. Finally, a canary releases can be [**promoted to stable**](#publishing-a-stable-release)<sup>1</sup> using the [`prepare-stable`](#prepare-stable) and [`publish`](#publish) scripts. (This process is always manual.)
7 +2. The release is then [**published to the `next` channel**](#publishing-next) using the [`prepare-next`](#prepare-next) and [`publish`](#publish) scripts. (Currently this process is manual but might be automated in the future using [GitHub "actions"](https://github.com/features/actions).)
8 +3. Finally, a "next" release can be [**promoted to stable**](#publishing-a-stable-release)<sup>1</sup> using the [`prepare-stable`](#prepare-stable) and [`publish`](#publish) scripts. (This process is always manual.)
9
10 The high level process of creating releases is [documented below](#process). Individual scripts are documented as well:
11 -* [`create-canary`](#create-canary)
12 -* [`prepare-canary`](#prepare-canary)
11 +* [`create-next`](#create-next)
12 +* [`prepare-next`](#prepare-next)
13 * [`prepare-stable`](#prepare-stable)
14 * [`publish`](#publish)
15
@@ -19,36 +19,39 @@ The high level process of creating releases is [documented below](#process). Ind
19
20 If this is your first time running the release scripts, go to the `scripts/release` directory and run `yarn` to install the dependencies.
21
22 -## Publishing a Canary
22 +## Publishing Next
23
24 -Canaries are meant to be lightweight and published often. In most cases, canaries can be published using artifacts built by Circle CI.
24 +"Next" builds are meant to be lightweight and published often. In most cases, they can be published using artifacts built by Circle CI.
25
26 -To prepare a canary for a particular commit:
26 +To prepare a build for a particular commit:
27 1. Choose a commit from [the commit log](https://github.com/facebook/react/commits/master).
28 2. Click the "“✓" icon and click the Circle CI "Details" link.
29 -3. Select the `build` job (**not** the `build_experimental` job; see the next section). If it's still pending, you'll need to wait for it to finish. (Note: This is the most awkward part of cutting a release right now. We have plans to improve it.)
30 -4. Copy the build ID from the URL (e.g. the build ID for [circleci.com/gh/facebook/react/13471](https://circleci.com/gh/facebook/react/13471) is **13471**).
31 -5. Run the [`prepare-canary`](#prepare-canary) script with the build ID you found <sup>1</sup>:
29 +3. Select the `build` job (**not** the `build_experimental` job; see the next section).
30 + * If it's still pending, you'll need to wait for it to finish. <sup>1</sup>
31 +4. Copy the build ID from the URL
32 + * e.g. the build ID for commit [241c4467](https://github.com/facebook/react/commit/241c4467eef7c2a8858c96d5dfe4e8ef84c47bad) is [**80592**](https://circleci.com/gh/facebook/react/80592)
33 +5. Run the [`prepare-next`](#prepare-next) script with the build ID <sup>2</sup> you found:
34 ```sh
33 -scripts/release/prepare-canary.js --build=13471
35 +scripts/release/prepare-next.js --build=80592
36 ```
37
36 -Once the canary has been checked out and tested locally, you're ready to publish it:
38 +Once the build has been checked out and tested locally, you're ready to publish it:
39 ```sh
40 scripts/release/publish.js --tags next
41 ```
42
43 If the OTP code expires while publishing, re-run this command and answer "y" to the questions about whether it was expected for already published packages.
44
43 -<sup>1: You can omit the `build` param if you just want to release the latest commit as a canary.</sup>
45 +<sup>1: This is the most awkward part of cutting a release right now. We have plans to improve it.</sup><br/>
46 +<sup>2: You can omit the `build` param if you just want to release the latest commit as to "next".</sup>
47
45 -## Publishing an Experimental Canary
48 +## Publishing an Experimental Release
49
47 -Experimental canaries are special releases with additional features turned on.
50 +Experimental releases are special because they have additional features turned on.
51
49 -The steps for publishing an experimental canary are almost the same as for publishing a normal canary, except in step 3 you should choose the `build_experimental` job instead of `build`. (I know this is awkward; we have plans to make it less so. Ideally these canaries would get published by a cron job.)
52 +The steps for publishing an experimental release are almost the same as for publishing a "next" release, except in step 3 you should choose the `build_experimental` job instead of `build` <sup>1</sup> For example, the experimental build ID for commit [241c4467](https://github.com/facebook/react/commit/241c4467eef7c2a8858c96d5dfe4e8ef84c47bad) is [**80590**](https://circleci.com/gh/facebook/react/80590):
53
51 -When publishing an experimental canary, use the `experimental` tag:
54 +When publishing an experimental release, use the `experimental` tag:
55
56 ```sh
57 scripts/release/publish.js --tags experimental
@@ -56,14 +59,16 @@ scripts/release/publish.js --tags experimental
59
60 If the OTP code expires while publishing, re-run this command and answer "y" to the questions about whether it was expected for already published packages.
61
62 +<sup>1: We have plans to make this less awkward. Ideally these releases will be published by a cron job.</sup>
63 +
64 ## Publishing a Stable Release
65
61 -Stable releases should always be created from a previously-released canary. This encourages better testing of the actual release artifacts and reduces the chance of unintended changes accidentally being included in a stable release.
66 +Stable releases should always be created from the "next" channel. This encourages better testing of the actual release artifacts and reduces the chance of unintended changes accidentally being included in a stable release.
67
63 -To prepare a stable release, choose a canary version and run the [`prepare-stable`](#prepare-stable) script <sup>1</sup>:
68 +To prepare a stable release, choose a "next" version and run the [`prepare-stable`](#prepare-stable) script <sup>1</sup>:
69
70 ```sh
66 -scripts/release/prepare-stable.js --version=0.0.0-5bf84d292
71 +scripts/release/prepare-stable.js --version=0.0.0-241c4467e
72 ```
73
74 This script will prompt you to select stable version numbers for each of the packages. It will update the package JSON versions (and dependencies) based on the numbers you select.
@@ -71,14 +76,14 @@ This script will prompt you to select stable version numbers for each of the pac
76 Once this step is complete, you're ready to publish the release:
77
78 ```sh
74 -scripts/release/publish.js --tags next latest
79 +scripts/release/publish.js --tags latest
80 ```
81
82 If the OTP code expires while publishing, re-run this command and answer "y" to the questions about whether it was expected for already published packages.
83
84 After successfully publishing the release, follow the on-screen instructions to ensure that all of the appropriate post-release steps are executed.
85
81 -<sup>1: You can omit the `version` param if you just want to promote the latest canary to stable.</sup>
86 +<sup>1: You can omit the `version` param if you just want to promote the latest "next" candidate to stable.</sup>
87
88 ## Creating a Patch Release
89
@@ -96,53 +101,53 @@ Next cherry pick any changes from master that you want to include in the release
101 git cherry-pick <commit-hash>
102 ```
103
99 -Once you have cherry picked all of the commits you want to include in the release, push your feature branch and create a Pull Request (so that Circle CI will create a canary):
104 +Once you have cherry picked all of the commits you want to include in the release, push your feature branch and create a Pull Request (so that Circle CI will create a build):
105
106 ```sh
107 git push origin 16.8.3
108 ```
109
105 -Once CI is complete, follow the regular [**canary**](#publishing-a-canary) and [**promote to stable**](#publishing-a-stable-release) processes.
110 +Once CI is complete, follow the regular [**next**](#publishing-next) and [**promote to stable**](#publishing-a-stable-release) processes.
111
112 <sup>1: The `build-info.json` artifact can also be used to identify the appropriate commit (e.g. [unpkg.com/react@16.8.3/build-info.json](https://unpkg.com/react@16.8.3/build-info.json) shows us that react version 16.8.3 was created from commit [`29b7b775f`](https://github.com/facebook/react/commit/29b7b775f)).</sup>
113
114 # Scripts
115
111 -## `create-canary`
112 -Creates a canary build from the current (local) Git revision.
116 +## `create-next`
117 +Creates a "next" build from the current (local) Git revision.
118
114 -**This script is an escape hatch.** It allows a canary release to be created without pushing a commit to be verified by Circle CI. **It does not run any automated unit tests.** Testing is solely the responsibility of the release engineer.
119 +**This script is an escape hatch.** It allows a release to be created without pushing a commit to be verified by Circle CI. **It does not run any automated unit tests.** Testing is solely the responsibility of the release engineer.
120
121 Note that this script git-archives the React repo (at the current revision) to a temporary directory before building, so **uncommitted changes are not included in the build**.
122
123 #### Example usage
119 -To create a canary from the current branch and revision:
124 +To create a build from the current branch and revision:
125 ```sh
121 -scripts/release/create-canary.js
126 +scripts/release/create-next.js
127 ```
128
124 -## `prepare-canary`
125 -Downloads build artifacts from Circle CI in preparation to be published to NPM as a canary release.
129 +## `prepare-next`
130 +Downloads build artifacts from Circle CI in preparation to be published to NPM as a "next" release.
131
127 -All artifacts built by Circle CI have already been unit-tested (both source and bundles) but canaries should **always be manually tested** before being published. Upon completion, this script prints manual testing instructions.
132 +All artifacts built by Circle CI have already been unit-tested (both source and bundles) but these candidates should **always be manually tested** before being published. Upon completion, this script prints manual testing instructions.
133
134 #### Example usage
130 -To prepare the artifacts created by [Circle CI build 12677](https://circleci.com/gh/facebook/react/12677#artifacts/containers/0) you would run:
135 +To prepare the artifacts created by [Circle CI build 80592](https://circleci.com/gh/facebook/react/80592#artifacts/containers/0) you would run:
136 ```sh
132 -scripts/release/prepare-canary.js --build=12677
137 +scripts/release/prepare-next.js --build=80592
138 ```
139
140 ## `prepare-stable`
136 -Checks out a canary release from NPM and prepares it to be published as a stable release.
141 +Checks out a "next" release from NPM and prepares it to be published as a stable release.
142
143 This script prompts for new (stable) release versions for each public package and updates the package contents (both `package.json` and inline version numbers) to match. It also updates inter-package dependencies to account for the new versions.
144
140 -Canary release have already been tested but it is still a good idea to **manually test and verify a release** before publishing to ensure that e.g. version numbers are correct. Upon completion, this script prints manual testing instructions.
145 +"Next" releases have already been tested but it is still a good idea to **manually test and verify a release** before publishing to ensure that e.g. version numbers are correct. Upon completion, this script prints manual testing instructions.
146
147 #### Example usage
143 -To promote the canary release `0.0.0-5bf84d292` (aka commit [5bf84d292](https://github.com/facebook/react/commit/5bf84d292)) to stable:
148 +To promote the "next" release `0.0.0-241c4467e` (aka commit [241c4467e](https://github.com/facebook/react/commit/241c4467e)) to stable:
149 ```sh
145 -scripts/release/prepare-stable.js --version=0.0.0-5bf84d292
150 +scripts/release/prepare-stable.js --version=0.0.0-241c4467e
151 ```
152
153 ## `publish`
@@ -157,5 +162,5 @@ Upon completion, this script provides instructions for tagging the Git commit th
162 #### Example usage
163 To publish a release to NPM as both `next` and `latest`:
164 ```sh
160 -scripts/release/publish.js --tags next latest
165 +scripts/release/publish.js --tags latest
166 ```
scripts/release/ci-add-build-info-json.js
+1 -1
@@ -7,7 +7,7 @@
7 // It exists to share code between the Node release scripts and CI bash scripts.
8
9 // IMPORTANT:
10 -// Changes below should be mirrored in ./create-canary-commands/add-build-info-json.js
10 +// Changes below should be mirrored in ./create-next-commands/add-build-info-json.js
11
12 const {exec} = require('child_process');
13 const {existsSync} = require('fs');
scripts/release/ci-update-package-versions.js
+2 -2
@@ -10,13 +10,13 @@ const {exec} = require('child_process');
10 const {join} = require('path');
11
12 const run = async () => {
13 - const {getBuildInfo, updateVersionsForCanary} = require('./utils');
13 + const {getBuildInfo, updateVersionsForNext} = require('./utils');
14
15 const cwd = join(__dirname, '..', '..');
16
17 const {reactVersion, version} = await getBuildInfo();
18
19 - await updateVersionsForCanary(cwd, reactVersion, version);
19 + await updateVersionsForNext(cwd, reactVersion, version);
20 };
21
22 // Install (or update) release script dependencies before proceeding.
scripts/release/create-next-commands/add-build-info-json.js renamed
scripts/release/create-next-commands/build-artifacts.js renamed
scripts/release/create-next-commands/confirm-automated-testing.js renamed
+1 -1
@@ -12,7 +12,7 @@ const run = async () => {
12 console.log(
13 theme.caution(
14 'This script does not run any automated tests.' +
15 - 'You should run them manually before creating a canary release.'
15 + 'You should run them manually before creating a "next" release.'
16 )
17 );
18
scripts/release/create-next-commands/copy-repo-to-temp-directory.js renamed
scripts/release/create-next-commands/npm-pack-and-unpack.js renamed
scripts/release/create-next-commands/update-version-numbers.js renamed
+2 -2
@@ -2,12 +2,12 @@
2
3 'use strict';
4
5 -const {logPromise, updateVersionsForCanary} = require('../utils');
5 +const {logPromise, updateVersionsForNext} = require('../utils');
6 const theme = require('../theme');
7
8 module.exports = async ({reactVersion, tempDirectory, version}) => {
9 return logPromise(
10 - updateVersionsForCanary(tempDirectory, reactVersion, version),
10 + updateVersionsForNext(tempDirectory, reactVersion, version),
11 theme`Updating version numbers ({version ${version}})`
12 );
13 };
scripts/release/create-next.js renamed
+7 -7
@@ -8,18 +8,18 @@ const {getBuildInfo, handleError} = require('./utils');
8
9 // This script is an escape hatch!
10 // It exists for special case manual builds.
11 -// The typical suggested release process is to create a canary from a CI artifact.
11 +// The typical suggested release process is to create a "next" build from a CI artifact.
12 // This build script is optimized for speed and simplicity.
13 // It doesn't run all of the tests that the CI environment runs.
14 // You're expected to run those manually before publishing a release.
15
16 -const addBuildInfoJSON = require('./create-canary-commands/add-build-info-json');
17 -const buildArtifacts = require('./create-canary-commands/build-artifacts');
18 -const confirmAutomatedTesting = require('./create-canary-commands/confirm-automated-testing');
19 -const copyRepoToTempDirectory = require('./create-canary-commands/copy-repo-to-temp-directory');
20 -const npmPackAndUnpack = require('./create-canary-commands/npm-pack-and-unpack');
16 +const addBuildInfoJSON = require('./create-next-commands/add-build-info-json');
17 +const buildArtifacts = require('./create-next-commands/build-artifacts');
18 +const confirmAutomatedTesting = require('./create-next-commands/confirm-automated-testing');
19 +const copyRepoToTempDirectory = require('./create-next-commands/copy-repo-to-temp-directory');
20 +const npmPackAndUnpack = require('./create-next-commands/npm-pack-and-unpack');
21 const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
22 -const updateVersionNumbers = require('./create-canary-commands/update-version-numbers');
22 +const updateVersionNumbers = require('./create-next-commands/update-version-numbers');
23
24 const run = async () => {
25 try {
scripts/release/prepare-next.js renamed
scripts/release/prepare-stable-commands/check-out-packages.js
+2 -2
@@ -28,7 +28,7 @@ const run = async ({cwd, local, packages, version}) => {
28
29 const nodeModulesPath = join(cwd, 'build/node_modules');
30
31 - // Checkout canary release from NPM for all local packages
31 + // Checkout "next" release from NPM for all local packages
32 for (let i = 0; i < packages.length; i++) {
33 const packageName = packages[i];
34
@@ -55,6 +55,6 @@ const run = async ({cwd, local, packages, version}) => {
55 module.exports = async params => {
56 return logPromise(
57 run(params),
58 - theme`Checking out canary from NPM {version ${params.version}}`
58 + theme`Checking out "next" from NPM {version ${params.version}}`
59 );
60 };
scripts/release/prepare-stable-commands/get-latest-next-version.js renamed
+2 -2
@@ -5,11 +5,11 @@
5 const {execRead, logPromise} = require('../utils');
6
7 const run = async () => {
8 - const version = await execRead('npm info react@canary version');
8 + const version = await execRead('npm info react@next version');
9
10 return version;
11 };
12
13 module.exports = async params => {
14 - return logPromise(run(params), 'Determining latest canary release version');
14 + return logPromise(run(params), 'Determining latest "next" release version');
15 };
scripts/release/prepare-stable-commands/parse-params.js
+1 -1
@@ -29,7 +29,7 @@ const paramDefinitions = [
29 {
30 name: 'version',
31 type: String,
32 - description: 'Version of published canary release (e.g. 0.0.0-ddaf2b07c)',
32 + description: 'Version of published "next" release (e.g. 0.0.0-ddaf2b07c)',
33 },
34 ];
35
scripts/release/prepare-stable-commands/update-stable-version-numbers.js
+5 -5
@@ -47,7 +47,7 @@ const run = async ({cwd, packages, version}, versionsMap) => {
47 // (e.g. scheduler@^0.11.0 becomes scheduler@^0.12.0 when we release scheduler 0.12.0).
48 // Otherwise we leave the constraint alone (e.g. react@^16.0.0 doesn't change between releases).
49 // Note that in both cases, we must update the target package JSON,
50 - // since canary releases are all locked to the canary version (e.g. 0.0.0-ddaf2b07c).
50 + // since "next" releases are all locked to the version (e.g. 0.0.0-ddaf2b07c).
51 if (
52 sourceDependencyVersion ===
53 sourceDependencyConstraint.replace(/^[\^\~]/, '')
@@ -69,7 +69,7 @@ const run = async ({cwd, packages, version}, versionsMap) => {
69 // Update all package JSON versions and their dependencies/peerDependencies.
70 // This must be done in a way that respects semver constraints (e.g. 16.7.0, ^16.7.0, ^16.0.0).
71 // To do this, we use the dependencies defined in the source package JSONs,
72 - // because the canary dependencies have already been flattened to an exact match (e.g. 0.0.0-ddaf2b07c).
72 + // because the "next" dependencies have already been flattened to an exact match (e.g. 0.0.0-ddaf2b07c).
73 for (let i = 0; i < packages.length; i++) {
74 const packageName = packages[i];
75 const packageJSONPath = join(nodeModulesPath, packageName, 'package.json');
@@ -114,14 +114,14 @@ const run = async ({cwd, packages, version}, versionsMap) => {
114
115 // A separate "React version" is used for the embedded renderer version to support DevTools,
116 // since it needs to distinguish between different version ranges of React.
117 - // We need to replace it as well as the canary version number.
117 + // We need to replace it as well as the "next" version number.
118 const buildInfoPath = join(nodeModulesPath, 'react', 'build-info.json');
119 const {reactVersion} = await readJson(buildInfoPath);
120
121 if (!reactVersion) {
122 console.error(
123 theme`{error Unsupported or invalid build metadata in} {path build/node_modules/react/build-info.json}` +
124 - theme`{error . This could indicate that you have specified an outdated canary version.}`
124 + theme`{error . This could indicate that you have specified an outdated "next" version.}`
125 );
126 process.exit(1);
127 }
@@ -146,7 +146,7 @@ const run = async ({cwd, packages, version}, versionsMap) => {
146 const newStableVersion = versionsMap.get(packageName);
147 const beforeContents = readFileSync(path, 'utf8', {cwd});
148 let afterContents = beforeContents;
149 - // Replace all canary version numbers (e.g. header @license).
149 + // Replace all "next" version numbers (e.g. header @license).
150 while (afterContents.indexOf(version) >= 0) {
151 afterContents = afterContents.replace(version, newStableVersion);
152 }
scripts/release/prepare-stable.js
+2 -2
@@ -7,7 +7,7 @@ const {getPublicPackages, handleError} = require('./utils');
7
8 const checkOutPackages = require('./prepare-stable-commands/check-out-packages');
9 const confirmStableVersionNumbers = require('./prepare-stable-commands/confirm-stable-version-numbers');
10 -const getLatestCanaryVersion = require('./prepare-stable-commands/get-latest-canary-version');
10 +const getLatestNextVersion = require('./prepare-stable-commands/get-latest-next-version');
11 const guessStableVersionNumbers = require('./prepare-stable-commands/guess-stable-version-numbers');
12 const parseParams = require('./prepare-stable-commands/parse-params');
13 const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
@@ -28,7 +28,7 @@ const run = async () => {
28 const versionsMap = new Map();
29
30 if (!params.version) {
31 - params.version = await getLatestCanaryVersion();
31 + params.version = await getLatestNextVersion();
32 }
33
34 if (params.version.includes('experimental')) {
scripts/release/publish-commands/print-follow-up-instructions.js
+2 -2
@@ -28,9 +28,9 @@ const run = async ({cwd, packages, tags}) => {
28
29 clear();
30
31 - if (tags.length === 1 && tags[0] === 'canary') {
31 + if (tags.length === 1 && tags[0] === 'next') {
32 console.log(
33 - theme`{header A canary release} {version ${version}} {header has been published!}`
33 + theme`{header A "next" release} {version ${version}} {header has been published!}`
34 );
35 } else {
36 const nodeModulesPath = join(cwd, 'build/node_modules');
scripts/release/publish-commands/validate-tags.js
+4 -4
@@ -7,7 +7,7 @@ const {join} = require('path');
7 const theme = require('../theme');
8
9 const run = async ({cwd, packages, tags}) => {
10 - // Prevent a canary release from ever being published as @latest
10 + // Prevent a "next" release from ever being published as @latest
11 // All canaries share a version number, so it's okay to check any of them.
12 const arbitraryPackageName = packages[0];
13 const packageJSONPath = join(
@@ -21,14 +21,14 @@ const run = async ({cwd, packages, tags}) => {
21 if (version.indexOf('0.0.0') === 0) {
22 if (tags.includes('latest')) {
23 console.log(
24 - theme`{error Canary release} {version ${version}} {error cannot be tagged as} {tag latest}`
24 + theme`{error Next release} {version ${version}} {error cannot be tagged as} {tag latest}`
25 );
26 process.exit(1);
27 }
28 } else {
29 - if (tags.includes('canary')) {
29 + if (tags.includes('next')) {
30 console.log(
31 - theme`{error Stable release} {version ${version}} {error cannot be tagged as} {tag canary}`
31 + theme`{error Stable release} {version ${version}} {error cannot be tagged as} {tag next}`
32 );
33 process.exit(1);
34 }
scripts/release/shared-commands/print-prerelease-summary.js
+1 -1
@@ -28,7 +28,7 @@ module.exports = ({cwd}, isStableRelease) => {
28 `;
29 } else {
30 message = theme`
31 - {caution A canary release candidate has been prepared!}
31 + {caution A "next" release candidate has been prepared!}
32
33 You can review the contents of this release in {path build/node_modules/}
34
scripts/release/snapshot-test.js
+3 -3
@@ -25,18 +25,18 @@ const run = async () => {
25 // https://circleci.com/gh/facebook/react/12707
26 let promise = spawn(
27 'node',
28 - ['./scripts/release/prepare-canary.js', `--build=${CIRCLE_CI_BUILD}`],
28 + ['./scripts/release/prepare-next.js', `--build=${CIRCLE_CI_BUILD}`],
29 defaultOptions
30 );
31 logPromise(
32 promise,
33 - theme`Checking out canary build {version ${CIRCLE_CI_BUILD}}`
33 + theme`Checking out "next" build {version ${CIRCLE_CI_BUILD}}`
34 );
35 await promise;
36
37 // Upgrade the above build top a known React version.
38 // Note that using the --local flag skips NPM checkout.
39 - // This isn't totally necessary but is useful if we want to test an unpublished canary.
39 + // This isn't totally necessary but is useful if we want to test an unpublished "next" build.
40 promise = spawn(
41 'node',
42 [
scripts/release/utils.js
+7 -7
@@ -92,7 +92,7 @@ const getBuildInfo = async () => {
92 const buildNumber = process.env.CIRCLE_BUILD_NUM;
93
94 // React version is stored explicitly, separately for DevTools support.
95 - // See updateVersionsForCanary() below for more info.
95 + // See updateVersionsForNext() below for more info.
96 const packageJSON = await readJson(
97 join(cwd, 'packages', 'react', 'package.json')
98 );
@@ -193,12 +193,12 @@ const splitCommaParams = array => {
193 // This method is used by both local Node release scripts and Circle CI bash scripts.
194 // It updates version numbers in package JSONs (both the version field and dependencies),
195 // As well as the embedded renderer version in "packages/shared/ReactVersion".
196 -// Canaries version numbers use the format of 0.0.0-<sha> to be easily recognized (e.g. 0.0.0-57239eac8).
196 +// Canaries version numbers use the format of 0.0.0-<sha> to be easily recognized (e.g. 0.0.0-01974a867).
197 // A separate "React version" is used for the embedded renderer version to support DevTools,
198 // since it needs to distinguish between different version ranges of React.
199 -// It is based on the version of React in the local package.json (e.g. 16.6.1-canary-57239eac8).
200 -// Both numbers will be replaced if the canary is promoted to a stable release.
201 -const updateVersionsForCanary = async (cwd, reactVersion, version) => {
199 +// It is based on the version of React in the local package.json (e.g. 16.12.0-01974a867).
200 +// Both numbers will be replaced if the "next" release is promoted to a stable release.
201 +const updateVersionsForNext = async (cwd, reactVersion, version) => {
202 const packages = getPublicPackages(join(cwd, 'packages'));
203 const packagesDir = join(cwd, 'packages');
204
@@ -234,7 +234,7 @@ const updateVersionsForCanary = async (cwd, reactVersion, version) => {
234 packageJSON.version = version;
235
236 // Also update inter-package dependencies.
237 - // Canary releases always have exact version matches.
237 + // Next releases always have exact version matches.
238 // The promote script may later relax these (e.g. "^x.x.x") based on source package JSONs.
239 const {dependencies, peerDependencies} = packageJSON;
240 for (let j = 0; j < packages.length; j++) {
@@ -263,5 +263,5 @@ module.exports = {
263 printDiff,
264 splitCommaParams,
265 theme,
266 - updateVersionsForCanary,
266 + updateVersionsForNext,
267 };