From a227bcd4f4754b0a3f44f84e1e63a79d0ae130d3 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Wed, 19 Apr 2023 10:05:16 +0100 Subject: [PATCH] =?UTF-8?q?chore[devtools/release-scripts]:=20update=20mes?= =?UTF-8?q?sages=20/=20fixed=20npm=20view=20com=E2=80=A6=20(#26660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some minor changes, observed while working on 24.7.5 release: - Updated numeration of text instructions - `reactjs.org` -> `react.dev` - Fixed using `npm view` command for node 16+, `publish-release` script currently fails if used with node 16+ --- packages/react-devtools-extensions/chrome/test.js | 2 +- packages/react-devtools-extensions/edge/test.js | 2 +- packages/react-devtools-extensions/firefox/test.js | 2 +- scripts/devtools/prepare-release.js | 6 +++--- scripts/devtools/publish-release.js | 12 +++++++++++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/react-devtools-extensions/chrome/test.js b/packages/react-devtools-extensions/chrome/test.js index 833990525e..868f1c90c9 100644 --- a/packages/react-devtools-extensions/chrome/test.js +++ b/packages/react-devtools-extensions/chrome/test.js @@ -7,7 +7,7 @@ const {resolve} = require('path'); const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./chrome/build/unpacked'); -const START_URL = argv.url || 'https://reactjs.org/'; +const START_URL = argv.url || 'https://react.dev/'; chromeLaunch(START_URL, { args: [ diff --git a/packages/react-devtools-extensions/edge/test.js b/packages/react-devtools-extensions/edge/test.js index f24b403da6..5d9c416c27 100644 --- a/packages/react-devtools-extensions/edge/test.js +++ b/packages/react-devtools-extensions/edge/test.js @@ -9,7 +9,7 @@ const {resolve} = require('path'); const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./edge/build/unpacked'); -const START_URL = argv.url || 'https://reactjs.org/'; +const START_URL = argv.url || 'https://react.dev/'; const extargs = `--load-extension=${EXTENSION_PATH}`; diff --git a/packages/react-devtools-extensions/firefox/test.js b/packages/react-devtools-extensions/firefox/test.js index b2e9e86e6e..30328b16d1 100644 --- a/packages/react-devtools-extensions/firefox/test.js +++ b/packages/react-devtools-extensions/firefox/test.js @@ -8,7 +8,7 @@ const {resolve} = require('path'); const {argv} = require('yargs'); const EXTENSION_PATH = resolve('./firefox/build/unpacked'); -const START_URL = argv.url || 'https://reactjs.org/'; +const START_URL = argv.url || 'https://react.dev/'; const firefoxVersion = process.env.WEB_EXT_FIREFOX; diff --git a/scripts/devtools/prepare-release.js b/scripts/devtools/prepare-release.js index 6b1f67f533..6ea4e60741 100755 --- a/scripts/devtools/prepare-release.js +++ b/scripts/devtools/prepare-release.js @@ -209,11 +209,11 @@ async function reviewChangelogPrompt() { console.log(` ${chalk.bold(CHANGELOG_PATH)}`); console.log(''); console.log('Please review the new changelog text for the following:'); - console.log(' 1. Organize the list into Features vs Bugfixes'); console.log(' 1. Filter out any non-user-visible changes (e.g. typo fixes)'); - console.log(' 1. Combine related PRs into a single bullet list.'); + console.log(' 2. Organize the list into Features vs Bugfixes'); + console.log(' 3. Combine related PRs into a single bullet list'); console.log( - ' 1. Replacing the "USERNAME" placeholder text with the GitHub username(s)' + ' 4. Replacing the "USERNAME" placeholder text with the GitHub username(s)' ); console.log(''); console.log(` ${chalk.bold.green(`open ${CHANGELOG_PATH}`)}`); diff --git a/scripts/devtools/publish-release.js b/scripts/devtools/publish-release.js index 3e44e74d9a..01ace5fc1b 100755 --- a/scripts/devtools/publish-release.js +++ b/scripts/devtools/publish-release.js @@ -82,7 +82,17 @@ async function publishToNPM() { // If so we might be resuming from a previous run. // We could infer this by comparing the build-info.json, // But for now the easiest way is just to ask if this is expected. - const info = await execRead(`npm view ${npmPackage}@${version}`); + const info = await execRead(`npm view ${npmPackage}@${version}`) + // Early versions of npm view gives empty response, but newer versions give 404 error. + // Catch the error to keep it consistent. + .catch(childProcessError => { + if (childProcessError.stderr.startsWith('npm ERR! code E404')) { + return null; + } + + throw childProcessError; + }); + if (info) { console.log(''); console.log(