diff --git a/.gitignore b/.gitignore index de3ad9a9154d..1dfc1cf16330 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ yarn-error.log* .husky/_ .bazelrc.user .eslintcache +.cache/ # Mac OSX Finder files. **/.DS_Store diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs new file mode 100644 index 000000000000..176c2de6581b --- /dev/null +++ b/.puppeteerrc.cjs @@ -0,0 +1,9 @@ +const { join } = require('path'); + +/** + * @type {import("puppeteer").Configuration} + */ +module.exports = { + // Changes the cache location for Puppeteer. + cacheDirectory: join(__dirname, '.cache', 'puppeteer'), +}; diff --git a/BUILD.bazel b/BUILD.bazel index 3b7064d60060..c96a7062f532 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -27,6 +27,11 @@ copy_to_bin( ], ) +copy_to_bin( + name = "puppeteer_browsers", + srcs = [".puppeteerrc.cjs"] + glob([".cache/puppeteer/**"]), +) + # Detect if the build is running under --stamp config_setting( name = "stamp", diff --git a/WORKSPACE b/WORKSPACE index e3e05fa63fec..97d6a52080f3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -111,6 +111,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", data = [ + "//:.puppeteerrc.cjs", "//:.yarn/patches/@angular-bazel-https-9848736cf4.patch", "//:.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch", "//:.yarn/patches/@bazel-jasmine-npm-5.8.1-3370fee155.patch", diff --git a/package.json b/package.json index a53f7a98c308..09e0a895f8b0 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "postcss-loader": "8.1.1", "prettier": "^3.0.0", "protractor": "~7.0.0", - "puppeteer": "18.2.1", + "puppeteer": "23.1.0", "quicktype-core": "23.0.170", "resolve-url-loader": "5.0.0", "rollup": "4.20.0", diff --git a/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts b/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts index bea7278f8e9e..029c9f26072d 100644 --- a/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts +++ b/packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts @@ -162,7 +162,7 @@ describeServeBuilder( // See: https://github.com/angular/angular-cli/pull/17624 // eslint-disable-next-line max-len // executablePath: '/Users//git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium', - ignoreHTTPSErrors: true, + acceptInsecureCerts: true, args: ['--no-sandbox', '--disable-gpu'], }); }); diff --git a/packages/angular_devkit/build_angular/BUILD.bazel b/packages/angular_devkit/build_angular/BUILD.bazel index 0b0ac4a8e3d6..99286486e3bf 100644 --- a/packages/angular_devkit/build_angular/BUILD.bazel +++ b/packages/angular_devkit/build_angular/BUILD.bazel @@ -411,6 +411,7 @@ LARGE_SPECS = { jasmine_node_test( name = "build_angular_" + spec + "_test", size = LARGE_SPECS[spec].get("size", "medium"), + data = ["//:puppeteer_browsers"], flaky = LARGE_SPECS[spec].get("flaky", False), shard_count = LARGE_SPECS[spec].get("shards", 2), # These tests are resource intensive and should not be over-parallized as they will diff --git a/packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts b/packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts index 05119cb51e85..a277a62d0587 100644 --- a/packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts +++ b/packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts @@ -168,7 +168,7 @@ describeServeBuilder( // See: https://github.com/angular/angular-cli/pull/17624 // eslint-disable-next-line max-len // executablePath: '/Users//git/angular-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents/MacOS/Chromium', - ignoreHTTPSErrors: true, + acceptInsecureCerts: true, args: ['--no-sandbox', '--disable-gpu'], }); }); diff --git a/yarn.lock b/yarn.lock index e77ab8eacc28..d073e99d30ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -751,7 +751,7 @@ __metadata: postcss-loader: "npm:8.1.1" prettier: "npm:^3.0.0" protractor: "npm:~7.0.0" - puppeteer: "npm:18.2.1" + puppeteer: "npm:23.1.0" quicktype-core: "npm:23.0.170" resolve-url-loader: "npm:5.0.0" rollup: "npm:4.20.0" @@ -3862,6 +3862,24 @@ __metadata: languageName: node linkType: hard +"@puppeteer/browsers@npm:2.3.1": + version: 2.3.1 + resolution: "@puppeteer/browsers@npm:2.3.1" + dependencies: + debug: "npm:^4.3.6" + extract-zip: "npm:^2.0.1" + progress: "npm:^2.0.3" + proxy-agent: "npm:^6.4.0" + semver: "npm:^7.6.3" + tar-fs: "npm:^3.0.6" + unbzip2-stream: "npm:^1.4.3" + yargs: "npm:^17.7.2" + bin: + browsers: lib/cjs/main-cli.js + checksum: 10c0/2dd195b35f2b30bd6f3c3eebfb2612bed333b0f1fdffd068903c26e8cb941b1bc8522a3b2dd0b8412e85ffa080f93bdd59703e380de807cdb02d88c99caab5db + languageName: node + linkType: hard + "@rollup/plugin-commonjs@npm:^26.0.0": version: 26.0.1 resolution: "@rollup/plugin-commonjs@npm:26.0.1" @@ -6681,7 +6699,7 @@ __metadata: languageName: node linkType: hard -"bl@npm:^4.0.3, bl@npm:^4.1.0": +"bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" dependencies: @@ -7126,13 +7144,6 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1": - version: 1.1.4 - resolution: "chownr@npm:1.1.4" - checksum: 10c0/ed57952a84cc0c802af900cf7136de643d3aba2eecb59d29344bc2f3f9bf703a301b9d84cdc71f82c3ffc9ccde831b0d92f5b45f91727d6c9da62f23aef9d9db - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -7174,6 +7185,19 @@ __metadata: languageName: node linkType: hard +"chromium-bidi@npm:0.6.4": + version: 0.6.4 + resolution: "chromium-bidi@npm:0.6.4" + dependencies: + mitt: "npm:3.0.1" + urlpattern-polyfill: "npm:10.0.0" + zod: "npm:3.23.8" + peerDependencies: + devtools-protocol: "*" + checksum: 10c0/16eec63277f2ac3b696333997146e4cda4c53263a3599af4944e3684a70645d39792789b2351270c9809920e0a675eb3ea9274c0dc3def5fb147a7ec1722d2c4 + languageName: node + linkType: hard + "ci-info@npm:^4.0.0": version: 4.0.0 resolution: "ci-info@npm:4.0.0" @@ -7700,15 +7724,6 @@ __metadata: languageName: node linkType: hard -"cross-fetch@npm:3.1.5": - version: 3.1.5 - resolution: "cross-fetch@npm:3.1.5" - dependencies: - node-fetch: "npm:2.6.7" - checksum: 10c0/29b457f8df11b46b8388a53c947de80bfe04e6466a59c1628c9870b48505b90ec1d28a05b543a0247416a99f1cfe147d1efe373afdeb46a192334ba5fe91b871 - languageName: node - linkType: hard - "cross-fetch@npm:^4.0.0": version: 4.0.0 resolution: "cross-fetch@npm:4.0.0" @@ -8119,13 +8134,6 @@ __metadata: languageName: node linkType: hard -"devtools-protocol@npm:0.0.1045489": - version: 0.0.1045489 - resolution: "devtools-protocol@npm:0.0.1045489" - checksum: 10c0/908793a0c10b3f40981c3564c02844493c667d4f16c8a2471be76ccab8e85e0dd97413eb0e51bc737e0aa37779b6d74678ba123b9d6a23ba4cdff716950a7b85 - languageName: node - linkType: hard - "devtools-protocol@npm:0.0.1312386": version: 0.0.1312386 resolution: "devtools-protocol@npm:0.0.1312386" @@ -9196,7 +9204,7 @@ __metadata: languageName: node linkType: hard -"extract-zip@npm:2.0.1, extract-zip@npm:^2.0.1": +"extract-zip@npm:^2.0.1": version: 2.0.1 resolution: "extract-zip@npm:2.0.1" dependencies: @@ -9570,13 +9578,6 @@ __metadata: languageName: node linkType: hard -"fs-constants@npm:^1.0.0": - version: 1.0.0 - resolution: "fs-constants@npm:1.0.0" - checksum: 10c0/a0cde99085f0872f4d244e83e03a46aa387b74f5a5af750896c6b05e9077fac00e9932fdf5aef84f2f16634cd473c63037d7a512576da7d5c2b9163d1909f3a8 - languageName: node - linkType: hard - "fs-extra@npm:3.0.1": version: 3.0.1 resolution: "fs-extra@npm:3.0.1" @@ -12658,13 +12659,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-classic@npm:^0.5.2": - version: 0.5.3 - resolution: "mkdirp-classic@npm:0.5.3" - checksum: 10c0/95371d831d196960ddc3833cc6907e6b8f67ac5501a6582f47dfae5eb0f092e9f8ce88e0d83afcae95d6e2b61a01741ba03714eeafb6f7a6e9dcc158ac85b168 - languageName: node - linkType: hard - "mkdirp@npm:1.0.4, mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" @@ -12942,9 +12936,9 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.7, node-fetch@npm:cjs": - version: 2.6.7 - resolution: "node-fetch@npm:2.6.7" +"node-fetch@npm:^2.6.12": + version: 2.7.0 + resolution: "node-fetch@npm:2.7.0" dependencies: whatwg-url: "npm:^5.0.0" peerDependencies: @@ -12952,13 +12946,13 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 10c0/fcae80f5ac52fbf5012f5e19df2bd3915e67d3b3ad51cb5942943df2238d32ba15890fecabd0e166876a9f98a581ab50f3f10eb942b09405c49ef8da36b826c7 + checksum: 10c0/b55786b6028208e6fbe594ccccc213cab67a72899c9234eb59dba51062a299ea853210fcf526998eaa2867b0963ad72338824450905679ff0fa304b8c5093ae8 languageName: node linkType: hard -"node-fetch@npm:^2.6.12": - version: 2.7.0 - resolution: "node-fetch@npm:2.7.0" +"node-fetch@npm:cjs": + version: 2.6.7 + resolution: "node-fetch@npm:2.6.7" dependencies: whatwg-url: "npm:^5.0.0" peerDependencies: @@ -12966,7 +12960,7 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 10c0/b55786b6028208e6fbe594ccccc213cab67a72899c9234eb59dba51062a299ea853210fcf526998eaa2867b0963ad72338824450905679ff0fa304b8c5093ae8 + checksum: 10c0/fcae80f5ac52fbf5012f5e19df2bd3915e67d3b3ad51cb5942943df2238d32ba15890fecabd0e166876a9f98a581ab50f3f10eb942b09405c49ef8da36b826c7 languageName: node linkType: hard @@ -14336,7 +14330,7 @@ __metadata: languageName: node linkType: hard -"proxy-from-env@npm:1.1.0, proxy-from-env@npm:^1.1.0": +"proxy-from-env@npm:^1.1.0": version: 1.1.0 resolution: "proxy-from-env@npm:1.1.0" checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b @@ -14402,21 +14396,17 @@ __metadata: languageName: node linkType: hard -"puppeteer-core@npm:18.2.1": - version: 18.2.1 - resolution: "puppeteer-core@npm:18.2.1" +"puppeteer-core@npm:23.1.0": + version: 23.1.0 + resolution: "puppeteer-core@npm:23.1.0" dependencies: - cross-fetch: "npm:3.1.5" - debug: "npm:4.3.4" - devtools-protocol: "npm:0.0.1045489" - extract-zip: "npm:2.0.1" - https-proxy-agent: "npm:5.0.1" - proxy-from-env: "npm:1.1.0" - rimraf: "npm:3.0.2" - tar-fs: "npm:2.1.1" - unbzip2-stream: "npm:1.4.3" - ws: "npm:8.9.0" - checksum: 10c0/10d1f9f65e3263b61b6cd518e11064dd39c8f069ed11e3d95577c8898112162601c7440dc94e4d22120ffbb6e205ab30776928453b36c2b6c73521d736d09612 + "@puppeteer/browsers": "npm:2.3.1" + chromium-bidi: "npm:0.6.4" + debug: "npm:^4.3.6" + devtools-protocol: "npm:0.0.1312386" + typed-query-selector: "npm:^2.12.0" + ws: "npm:^8.18.0" + checksum: 10c0/9dd09291762a2123019ea481502ec7e82d824901f5c98782ef2a46718e2da7f42bfdec8df1a2a68c15033f698bf95ee488359cff28c26e14db32924e8218c03f languageName: node linkType: hard @@ -14433,15 +14423,19 @@ __metadata: languageName: node linkType: hard -"puppeteer@npm:18.2.1": - version: 18.2.1 - resolution: "puppeteer@npm:18.2.1" +"puppeteer@npm:23.1.0": + version: 23.1.0 + resolution: "puppeteer@npm:23.1.0" dependencies: - https-proxy-agent: "npm:5.0.1" - progress: "npm:2.0.3" - proxy-from-env: "npm:1.1.0" - puppeteer-core: "npm:18.2.1" - checksum: 10c0/843d605b5482da441998c9a1762d59d1c43ae023e6458ffafc391594608607ced3e167a506ca475d17ae35284c3393902d39f5ea6209ddc390cce0b085515a5d + "@puppeteer/browsers": "npm:2.3.1" + chromium-bidi: "npm:0.6.4" + cosmiconfig: "npm:^9.0.0" + devtools-protocol: "npm:0.0.1312386" + puppeteer-core: "npm:23.1.0" + typed-query-selector: "npm:^2.12.0" + bin: + puppeteer: lib/cjs/puppeteer/node/cli.js + checksum: 10c0/c2088e07eac2136379260192b3a4709a045611fea0167150474f550217e3667120a700fc50adce020fff0a212ef30e4c302191eaa462ffef25a14f509ea7833f languageName: node linkType: hard @@ -14944,25 +14938,25 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:3.0.2, rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": - version: 3.0.2 - resolution: "rimraf@npm:3.0.2" +"rimraf@npm:^2.2.8, rimraf@npm:^2.5.2, rimraf@npm:^2.5.4": + version: 2.7.1 + resolution: "rimraf@npm:2.7.1" dependencies: glob: "npm:^7.1.3" bin: - rimraf: bin.js - checksum: 10c0/9cb7757acb489bd83757ba1a274ab545eafd75598a9d817e0c3f8b164238dd90eba50d6b848bd4dcc5f3040912e882dc7ba71653e35af660d77b25c381d402e8 + rimraf: ./bin.js + checksum: 10c0/4eef73d406c6940927479a3a9dee551e14a54faf54b31ef861250ac815172bade86cc6f7d64a4dc5e98b65e4b18a2e1c9ff3b68d296be0c748413f092bb0dd40 languageName: node linkType: hard -"rimraf@npm:^2.2.8, rimraf@npm:^2.5.2, rimraf@npm:^2.5.4": - version: 2.7.1 - resolution: "rimraf@npm:2.7.1" +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": + version: 3.0.2 + resolution: "rimraf@npm:3.0.2" dependencies: glob: "npm:^7.1.3" bin: - rimraf: ./bin.js - checksum: 10c0/4eef73d406c6940927479a3a9dee551e14a54faf54b31ef861250ac815172bade86cc6f7d64a4dc5e98b65e4b18a2e1c9ff3b68d296be0c748413f092bb0dd40 + rimraf: bin.js + checksum: 10c0/9cb7757acb489bd83757ba1a274ab545eafd75598a9d817e0c3f8b164238dd90eba50d6b848bd4dcc5f3040912e882dc7ba71653e35af660d77b25c381d402e8 languageName: node linkType: hard @@ -16205,18 +16199,6 @@ __metadata: languageName: node linkType: hard -"tar-fs@npm:2.1.1": - version: 2.1.1 - resolution: "tar-fs@npm:2.1.1" - dependencies: - chownr: "npm:^1.1.1" - mkdirp-classic: "npm:^0.5.2" - pump: "npm:^3.0.0" - tar-stream: "npm:^2.1.4" - checksum: 10c0/871d26a934bfb7beeae4c4d8a09689f530b565f79bd0cf489823ff0efa3705da01278160da10bb006d1a793fa0425cf316cec029b32a9159eacbeaff4965fb6d - languageName: node - linkType: hard - "tar-fs@npm:^3.0.6": version: 3.0.6 resolution: "tar-fs@npm:3.0.6" @@ -16234,19 +16216,6 @@ __metadata: languageName: node linkType: hard -"tar-stream@npm:^2.1.4": - version: 2.2.0 - resolution: "tar-stream@npm:2.2.0" - dependencies: - bl: "npm:^4.0.3" - end-of-stream: "npm:^1.4.1" - fs-constants: "npm:^1.0.0" - inherits: "npm:^2.0.3" - readable-stream: "npm:^3.1.1" - checksum: 10c0/2f4c910b3ee7196502e1ff015a7ba321ec6ea837667220d7bcb8d0852d51cb04b87f7ae471008a6fb8f5b1a1b5078f62f3a82d30c706f20ada1238ac797e7692 - languageName: node - linkType: hard - "tar-stream@npm:^3.1.5, tar-stream@npm:^3.1.7": version: 3.1.7 resolution: "tar-stream@npm:3.1.7" @@ -16742,6 +16711,13 @@ __metadata: languageName: node linkType: hard +"typed-query-selector@npm:^2.12.0": + version: 2.12.0 + resolution: "typed-query-selector@npm:2.12.0" + checksum: 10c0/069509887ecfff824a470f5f93d300cc9223cb059a36c47ac685f2812c4c9470340e07615893765e4264cef1678507532fa78f642fd52f276b589f7f5d791f79 + languageName: node + linkType: hard + "typescript@npm:5.4.2": version: 5.4.2 resolution: "typescript@npm:5.4.2" @@ -16851,7 +16827,7 @@ __metadata: languageName: node linkType: hard -"unbzip2-stream@npm:1.4.3, unbzip2-stream@npm:^1.4.3": +"unbzip2-stream@npm:^1.4.3": version: 1.4.3 resolution: "unbzip2-stream@npm:1.4.3" dependencies: @@ -17768,21 +17744,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.9.0": - version: 8.9.0 - resolution: "ws@npm:8.9.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10c0/0a1e9868f2e527e33419ddf874027742acc62cdc7541d4a09a28ea7d0d860856fb09712ec6d85d4a64dc1f0fb512c3e107469ddf99a8a44f5944d5733a72099a - languageName: node - linkType: hard - "ws@npm:^7.4.2": version: 7.5.10 resolution: "ws@npm:7.5.10"