diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a5cea32..557f56cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: if: ${{ matrix.spec.name == 'Linux' }} run: sudo apt-get install xvfb - name: Build - run: npm run build:ci + run: npm run build:dev - name: Test types run: npm run test:types # On Linux we run all Chrome tests without retries and Firefox tests with retries. @@ -220,7 +220,7 @@ jobs: ls .local-chromium - name: Build run: | - npm run build:ci + npm run build:dev docker/pack.sh - name: Build docker image working-directory: ./docker diff --git a/docs/contributing.md b/docs/contributing.md index f991937e..ac99bea9 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -36,13 +36,27 @@ npm install PUPPETEER_PRODUCT=firefox npm install ``` -3. Build and run Puppeteer tests locally. For more information about tests, read - [Running & Writing Tests](#running--writing-tests). +## Building Puppeteer + +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, tests, and artifacts used in + production. + +## Testing Puppeteer + +For browser testing, you can run ```bash -npm run build && npm run test +npm run build:dev && npm run test ``` +We also have other tests such as `test:types` that tests types and +`test:install` which tests installation. See the `package.json` for more tests +(all prefixed with `tests`). + ## Code reviews All submissions, including submissions by project members, require review. We diff --git a/package.json b/package.json index 29abc880..10744ab5 100644 --- a/package.json +++ b/package.json @@ -48,18 +48,17 @@ "format:prettier": "prettier --write .", "format:eslint": "eslint --ext js --ext ts --fix .", "docs": "run-s build generate:markdown", - "debug": "npm run build:test && mocha --inspect-brk", + "debug": "npm run build:dev && 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", "check:pinned-deps": "tsx scripts/ensure-pinned-deps", - "build": "npm run build:lib", - "build:test": "run-s generate:sources build:tsc:test", - "build:ci": "run-s build:test generate:artifacts", - "build:lib": "run-s generate:sources build:tsc:lib generate:artifacts", - "build:tsc:test": "tsc -b test", - "build:tsc:lib": "tsc -b tsconfig.lib.json" + "build": "npm run build:prod", + "build:dev": "run-s generate:sources build:tsc:dev generate:artifacts", + "build:prod": "run-s generate:sources build:tsc:prod generate:artifacts", + "build:tsc:dev": "tsc -b test", + "build:tsc:prod": "tsc -b tsconfig.lib.json" }, "files": [ "lib", diff --git a/test/tsconfig.json b/test/tsconfig.json index 056e740f..962644f9 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -9,7 +9,7 @@ }, "include": ["src"], "references": [ - {"path": "../src/tsconfig.cjs.json"}, + {"path": "../tsconfig.lib.json"}, {"path": "../utils/testserver/tsconfig.json"} ] }