Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c17ed57

Browse files
authored
misc(release): add script for updating critical dependencies (#16359)
1 parent 9586374 commit c17ed57

File tree

3 files changed

+58
-3
lines changed

3 files changed

+58
-3
lines changed

core/scripts/upgrade-deps.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
##
4+
# @license Copyright 2025 Google LLC
5+
# SPDX-License-Identifier: Apache-2.0
6+
##
7+
8+
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
LH_ROOT="$DIRNAME/../.."
10+
cd $LH_ROOT
11+
12+
set -ex
13+
14+
yarn upgrade --latest \
15+
axe-core \
16+
chrome-devtools-frontend \
17+
chrome-launcher \
18+
csp_evaluator \
19+
devtools-protocol \
20+
js-library-detector \
21+
lighthouse-logger \
22+
lighthouse-stack-packs \
23+
puppeteer \
24+
puppeteer-core \
25+
speedline-core \
26+
third-party-web \
27+
28+
node -e "
29+
const pkg = require('$LH_ROOT/package.json');
30+
const ver = pkg.dependencies['devtools-protocol'].replace('^', '');
31+
pkg.resolutions['puppeteer/**/devtools-protocol'] = ver;
32+
pkg.resolutions['puppeteer-core/**/devtools-protocol'] = ver;
33+
require('fs').writeFileSync('$LH_ROOT/package.json', JSON.stringify(pkg, null, 2) + '\n');
34+
"
35+
36+
# Do some stuff that may update checked-in files.
37+
yarn build-all
38+
yarn update:sample-json
39+
yarn type-check
40+
yarn lint --fix
41+
42+
# Just print something nice to copy/paste as a PR description.
43+
44+
set +x
45+
46+
echo '```diff'
47+
git diff -U0 package.json | grep -E '^[-] ' | sort
48+
echo
49+
git diff -U0 package.json | grep -E '^[+] ' | sort
50+
echo '```'

docs/releasing.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ We follow [semver](https://semver.org/) versioning semantics (`vMajor.Minor.Patc
3636

3737
### Update various dependencies
3838

39-
In general, Lighthouse should be using the latest version of all of these dependencies:
39+
In general, Lighthouse should be using the latest version of its critical dependencies. These are listed in the following script. It's ok to not be on the very latest, use your judgement.
40+
41+
```sh
42+
bash core/scripts/upgrade-deps.sh
43+
```
4044

4145
1. https://github.com/GoogleChrome/lighthouse-stack-packs
4246
1. `puppeteer` and `puppeteer-core`

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"prepack": "yarn build-report --standalone --flow --esm && yarn build-types",
1717
"postpack": "yarn clean-types",
1818
"build-all": "npm-run-posix-or-windows build-all:task",
19-
"build-all:task": "yarn build-report && yarn build-cdt-lib && yarn build-devtools && concurrently 'yarn build-extension' 'yarn build-lr' 'yarn build-viewer' 'yarn build-treemap' 'yarn build-smokehouse-bundle' && yarn build-pack",
20-
"build-all:task:windows": "yarn build-report && yarn build-cdt-lib && yarn build-extension && yarn build-devtools && yarn build-lr && yarn build-viewer && yarn build-treemap && yarn build-smokehouse-bundle",
19+
"build-all:task": "yarn build-report && yarn build-cdt-strings && yarn build-devtools && concurrently 'yarn build-extension' 'yarn build-lr' 'yarn build-viewer' 'yarn build-treemap' 'yarn build-smokehouse-bundle' && yarn build-pack",
20+
"build-all:task:windows": "yarn build-report && yarn build-cdt-strings && yarn build-extension && yarn build-devtools && yarn build-lr && yarn build-viewer && yarn build-treemap && yarn build-smokehouse-bundle",
2121
"build-cdt-lib": "node ./build/build-cdt-lib.js",
22+
"build-cdt-strings": "node ./build/build-cdt-strings.js",
2223
"build-extension": "yarn build-extension-chrome && yarn build-extension-firefox",
2324
"build-extension-chrome": "node ./build/build-extension.js chrome",
2425
"build-extension-firefox": "node ./build/build-extension.js firefox",

0 commit comments

Comments
 (0)