diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 344b75fb..9ad00970 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -282,7 +282,7 @@ The following steps are needed to update the Chromium version. Not all revisions have builds for all platforms, so we need to find one that does. To do so, run `utils/check_availability.js -rd` to find the latest suitable `dev` Chromium revision (see `utils/check_availability.js -help` for more options). 1. Update `src/revisions.ts` with the found revision number. -1. Update `versions.js` with the new Chromium-to-Puppeteer version mapping. +1. Update `versions.js` with the new Chromium-to-Puppeteer version mapping and update `lastMaintainedChromiumVersion` with the latest stable Chrome version. 1. Run `npm run ensure-correct-devtools-protocol-revision`. If it fails, update `package.json` with the expected `devtools-protocol` version. 1. Run `npm run tsc` and `npm install`. diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js index e2de3a81..9d0df795 100755 --- a/utils/doclint/cli.js +++ b/utils/doclint/cli.js @@ -38,7 +38,7 @@ async function run() { let changedFiles = false; if (IS_RELEASE) { - const versions = await Source.readFile( + const { versionsPerRelease: versions } = await Source.readFile( path.join(PROJECT_DIR, 'versions.js') ); versions.setText( diff --git a/utils/doclint/preprocessor/index.js b/utils/doclint/preprocessor/index.js index 68967d86..d026873d 100644 --- a/utils/doclint/preprocessor/index.js +++ b/utils/doclint/preprocessor/index.js @@ -151,7 +151,7 @@ function generateTableOfContents(mdText) { } const generateVersionsPerRelease = () => { - const versionsPerRelease = require('../../../versions.js'); + const { versionsPerRelease } = require('../../../versions.js'); const buffer = ['- Releases per Chromium version:']; for (const [chromiumVersion, puppeteerVersion] of versionsPerRelease) { if (puppeteerVersion === 'NEXT') continue; diff --git a/utils/get_deprecated_version_range.js b/utils/get_deprecated_version_range.js new file mode 100644 index 00000000..a0603c3d --- /dev/null +++ b/utils/get_deprecated_version_range.js @@ -0,0 +1,27 @@ +/** + * Copyright 2022 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { + versionsPerRelease, + lastMaintainedChromiumVersion, +} = require('../versions.js'); +const version = versionsPerRelease.get(lastMaintainedChromiumVersion); +if (version.toLowerCase() === 'next') { + console.error('Unexpected NEXT Puppeteer version in versions.js'); + process.exit(1); +} +console.log('< ' + version); +process.exit(0); diff --git a/versions.js b/versions.js index d5bc5633..cbfb6942 100644 --- a/versions.js +++ b/versions.js @@ -42,4 +42,16 @@ const versionsPerRelease = new Map([ ['73.0.3679.0', 'v1.12.2'], ]); -module.exports = versionsPerRelease; +// The same major version as the current Chrome Stable per https://chromestatus.com/roadmap. +const lastMaintainedChromiumVersion = '97.0.4692.0'; + +if (!versionsPerRelease.has(lastMaintainedChromiumVersion)) { + throw new Error( + 'lastMaintainedChromiumVersion is missing from versionsPerRelease' + ); +} + +module.exports = { + versionsPerRelease, + lastMaintainedChromiumVersion, +};