Skip to content

Commit

Permalink
chore: migrate puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Sep 28, 2022
1 parent ba86cbc commit 759f4da
Show file tree
Hide file tree
Showing 176 changed files with 299 additions and 279 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Expand Up @@ -18,7 +18,7 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/

# IDE Artifacts
.vscode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -242,7 +242,7 @@ jobs:
if: ${{ matrix.spec.xvfb }}
run: sudo apt-get install xvfb
- name: Build
run: npm run build:dev
run: npm run build:test
- name: Test types
run: npm run test:types
- name: Run all tests with xvfb
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tot-ci.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in headless
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in headful
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in chrome headless
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -17,7 +17,7 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/

# IDE Artifacts
.vscode
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Expand Up @@ -18,7 +18,7 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/

# IDE Artifacts
.vscode
Expand All @@ -40,7 +40,6 @@ yarn-error.log*
assets/
CHANGELOG.md
package-lock.json
package.json
test/assets/
docs/
versioned_*/
2 changes: 1 addition & 1 deletion .release-please-manifest.json
@@ -1,3 +1,3 @@
{
".": "18.0.5"
"puppeteer": "18.0.5"
}
8 changes: 0 additions & 8 deletions compat/cjs/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions compat/esm/tsconfig.json

This file was deleted.

6 changes: 3 additions & 3 deletions docs/contributing.md
Expand Up @@ -42,15 +42,15 @@ Puppeteer has two configurations for building:

- `npm run build` (or `npm run build:prod`) - Builds Puppeteer and artifacts
used in production.
- `npm run build:dev` - Builds Puppeteer, test runner, tests, and artifacts used in
- `npm run build:test` - Builds Puppeteer, test runner, tests, and artifacts used in
production.

## Testing Puppeteer

For browser testing, you can run

```bash
npm run build:dev && npm run test
npm run build:test && npm run test
```

We also have other tests such as `test:types` that tests types and
Expand Down Expand Up @@ -274,7 +274,7 @@ The following steps are needed to update the Chromium version.
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 check:protocol-revision`.
If it fails, update `package.json` with the expected `devtools-protocol` version.
1. Run `npm run build && npm run build:dev` and `npm install`.
1. Run `npm run build && npm run build:test` and `npm install`.
1. Run `npm test` and ensure that all tests pass. If a test fails, [bisect](#bisecting-upstream-changes) the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended change) or work around the changes in Puppeteer (if it’s not desirable to change Puppeteer’s observable behavior).
1. Commit and push your changes and open a pull request.
The commit message must contain the version in `Chromium <version> (<revision>)` format to ensure that [pptr.dev](https://pptr.dev/) can parse it correctly, e.g. `'feat(chromium): roll to Chromium 90.0.4427.0 (r856583)'`.
Expand Down
61 changes: 42 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 12 additions & 62 deletions package.json
@@ -1,34 +1,11 @@
{
"name": "puppeteer",
"version": "18.0.5",
"description": "A high-level API to control headless Chrome over the DevTools Protocol",
"keywords": [
"puppeteer",
"chrome",
"headless",
"automation"
],
"type": "commonjs",
"main": "./lib/cjs/puppeteer/puppeteer.js",
"exports": {
".": {
"types": "./lib/types.d.ts",
"import": "./lib/esm/puppeteer/puppeteer.js",
"require": "./lib/cjs/puppeteer/puppeteer.js"
},
"./*": {
"import": "./*",
"require": "./*"
}
},
"types": "lib/types.d.ts",
"repository": "github:puppeteer/puppeteer",
"engines": {
"node": ">=14.1.0"
"repository": {
"type": "git",
"url": "https://github.com/puppeteer/puppeteer"
},
"scripts": {
"test": "cross-env PUPPETEER_DEFERRED_PROMISE_DEBUG_TIMEOUT=20000 node utils/mochaRunner/lib/main.js",
"test:types": "tsd",
"test:types": "tsd -t packages/puppeteer/lib/types.d.ts",
"test:install": "scripts/test-install.sh",
"test:firefox": "run-s test:firefox:*",
"test:firefox:headless": "npm run test -- --test-suite firefox-headless",
Expand All @@ -38,51 +15,23 @@
"test:chrome:headless-chrome": "npm run test -- --test-suite chrome-new-headless",
"test:chrome:headful": "npm run test -- --test-suite chrome-headful",
"prepublishOnly": "npm run build",
"prepare": "node typescript-if-required.js && husky install",
"install": "lerna run install && npm run install:husky",
"install:husky": "husky install",
"lint": "run-s lint:prettier lint:eslint",
"lint:prettier": "prettier --check .",
"lint:eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
"install": "node install.js",
"generate:sources": "tsx utils/generate_sources.ts",
"generate:artifacts": "tsx utils/generate_artifacts.ts",
"generate:markdown": "tsx utils/generate_docs.ts",
"format": "run-s format:*",
"format:prettier": "prettier --write .",
"format:eslint": "eslint --ext js --ext ts --fix .",
"docs": "run-s build generate:markdown",
"debug": "npm run build:dev && mocha --inspect-brk",
"debug": "npm run build:test && mocha --inspect-brk",
"commitlint": "commitlint --from=HEAD~1",
"clean": "rimraf lib && rimraf test/build",
"check": "run-p check:*",
"check:protocol-revision": "tsx scripts/ensure-correct-devtools-protocol-package",
"clean": "lerna run clean",
"check": "lerna run check && run-p check:*",
"check:pinned-deps": "tsx scripts/ensure-pinned-deps",
"build": "npm run build:prod",
"build:dev": "run-s generate:sources build:tsc:dev && run-p bundle:third_party generate:artifacts",
"build:prod": "run-s generate:sources build:tsc:prod && run-p bundle:third_party generate:artifacts",
"build:tsc:dev": "tsc -b test",
"build:tsc:prod": "tsc -b tsconfig.lib.json",
"bundle:third_party": "rollup --config rollup.third_party.config.js"
},
"files": [
"lib",
"install.js",
"typescript-if-required.js",
"!**/*.tsbuildinfo"
],
"author": "The Chromium Authors",
"license": "Apache-2.0",
"dependencies": {
"cross-fetch": "3.1.5",
"debug": "4.3.4",
"devtools-protocol": "0.0.1036444",
"extract-zip": "2.0.1",
"https-proxy-agent": "5.0.1",
"progress": "2.0.3",
"proxy-from-env": "1.1.0",
"rimraf": "3.0.2",
"tar-fs": "2.1.1",
"unbzip2-stream": "1.4.3",
"ws": "8.9.0"
"build": "lerna run build",
"build:test": "npm run build && tsc -b test"
},
"devDependencies": {
"@commitlint/cli": "17.1.2",
Expand Down Expand Up @@ -139,6 +88,7 @@
"pixelmatch": "5.3.0",
"pngjs": "6.0.0",
"prettier": "2.7.1",
"puppeteer": "*",
"rollup": "2.79.1",
"rollup-plugin-dts": "4.2.2",
"rollup-plugin-node-resolve": "5.2.0",
Expand Down
File renamed without changes.
Expand Up @@ -9,7 +9,7 @@

"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/docs/<unscopedPackageName>.api.json"
"apiJsonFilePath": "<projectFolder>/../../docs/<unscopedPackageName>.api.json"
},

"dtsRollup": {
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions packages/puppeteer/compat/cjs/tsconfig.json
@@ -0,0 +1,7 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "../../lib/cjs/puppeteer"
}
}
File renamed without changes.
6 changes: 6 additions & 0 deletions packages/puppeteer/compat/esm/tsconfig.json
@@ -0,0 +1,6 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../lib/esm/puppeteer"
}
}
File renamed without changes.

0 comments on commit 759f4da

Please sign in to comment.