From 866f72021c8bbbe94dea3c2e1853dd0182d61c7a Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Tue, 25 Jun 2024 09:18:03 +0200 Subject: [PATCH] build(deps): relax dependency versions for non-puppeteer dependencies (#12649) --- package-lock.json | 22 ++++++------ package.json | 3 +- packages/browsers/package.json | 16 ++++----- packages/puppeteer-core/package.json | 4 +-- packages/puppeteer/package.json | 2 +- tools/ensure-pinned-deps.ts | 52 ---------------------------- 6 files changed, 23 insertions(+), 76 deletions(-) delete mode 100644 tools/ensure-pinned-deps.ts diff --git a/package-lock.json b/package-lock.json index d22e11e11e1c1..01283b4e28320 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9608,14 +9608,14 @@ "version": "2.2.3", "license": "Apache-2.0", "dependencies": { - "debug": "4.3.5", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.4.0", - "semver": "7.6.2", - "tar-fs": "3.0.6", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2" + "debug": "^4.3.5", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.2", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" @@ -12102,7 +12102,7 @@ "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.2.3", - "cosmiconfig": "9.0.0", + "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1299070", "puppeteer-core": "22.12.0" }, @@ -12122,9 +12122,9 @@ "dependencies": { "@puppeteer/browsers": "2.2.3", "chromium-bidi": "0.5.24", - "debug": "4.3.5", + "debug": "^4.3.5", "devtools-protocol": "0.0.1299070", - "ws": "8.17.1" + "ws": "^8.17.1" }, "devDependencies": { "@types/chrome": "0.0.268", diff --git a/package.json b/package.json index 05f9522290fe9..6c7e687d32998 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "scripts": { "build": "wireit", "build:tools": "wireit", - "check": "npm run check --workspaces --if-present && run-p check:*", - "check:pinned-deps": "tsx tools/ensure-pinned-deps", + "check": "npm run check --workspaces --if-present", "clean": "npm run clean --workspaces --if-present", "debug": "mocha --inspect-brk", "docs": "wireit", diff --git a/packages/browsers/package.json b/packages/browsers/package.json index 113f552d848a6..cf7659cece30a 100644 --- a/packages/browsers/package.json +++ b/packages/browsers/package.json @@ -95,14 +95,14 @@ "!*.tsbuildinfo" ], "dependencies": { - "debug": "4.3.5", - "extract-zip": "2.0.1", - "progress": "2.0.3", - "proxy-agent": "6.4.0", - "tar-fs": "3.0.6", - "unbzip2-stream": "1.4.3", - "yargs": "17.7.2", - "semver": "7.6.2" + "debug": "^4.3.5", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2", + "semver": "^7.6.2" }, "devDependencies": { "@types/debug": "4.1.12", diff --git a/packages/puppeteer-core/package.json b/packages/puppeteer-core/package.json index f61f6d5954a42..ce16b30b95297 100644 --- a/packages/puppeteer-core/package.json +++ b/packages/puppeteer-core/package.json @@ -121,9 +121,9 @@ "dependencies": { "@puppeteer/browsers": "2.2.3", "chromium-bidi": "0.5.24", - "debug": "4.3.5", + "debug": "^4.3.5", "devtools-protocol": "0.0.1299070", - "ws": "8.17.1" + "ws": "^8.17.1" }, "devDependencies": { "@types/debug": "4.1.12", diff --git a/packages/puppeteer/package.json b/packages/puppeteer/package.json index 85834f3e04259..f4a9a22b8fa4c 100644 --- a/packages/puppeteer/package.json +++ b/packages/puppeteer/package.json @@ -123,7 +123,7 @@ "author": "The Chromium Authors", "license": "Apache-2.0", "dependencies": { - "cosmiconfig": "9.0.0", + "cosmiconfig": "^9.0.0", "puppeteer-core": "22.12.0", "@puppeteer/browsers": "2.2.3", "devtools-protocol": "0.0.1299070" diff --git a/tools/ensure-pinned-deps.ts b/tools/ensure-pinned-deps.ts deleted file mode 100644 index eb21fc647b606..0000000000000 --- a/tools/ensure-pinned-deps.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2021 Google Inc. - * SPDX-License-Identifier: Apache-2.0 - */ - -import {readdirSync, readFileSync} from 'fs'; -import {join} from 'path'; - -import {devDependencies} from '../package.json'; - -const LOCAL_PACKAGE_NAMES: string[] = []; - -const packagesDir = join(__dirname, '..', 'packages'); -for (const packageName of readdirSync(packagesDir)) { - const {name} = JSON.parse( - readFileSync(join(packagesDir, packageName, 'package.json'), 'utf8') - ); - LOCAL_PACKAGE_NAMES.push(name); -} - -const allDeps = {...devDependencies}; - -const invalidDeps = new Map(); - -for (const [depKey, depValue] of Object.entries(allDeps)) { - if (depValue.startsWith('file:')) { - continue; - } - if (LOCAL_PACKAGE_NAMES.includes(depKey)) { - continue; - } - if (/[0-9]/.test(depValue[0]!)) { - continue; - } - - invalidDeps.set(depKey, depValue); -} - -if (invalidDeps.size > 0) { - console.error('Found non-pinned dependencies in package.json:'); - console.log( - [...invalidDeps.keys()] - .map(k => { - return ` ${k}`; - }) - .join('\n') - ); - process.exit(1); -} - -process.exit(0);