Skip to content

Commit

Permalink
chore: refactor build commands (#8874)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Aug 31, 2022
1 parent 3732757 commit ae4c5ea
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
20 changes: 17 additions & 3 deletions docs/contributing.md
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/tsconfig.json
Expand Up @@ -9,7 +9,7 @@
},
"include": ["src"],
"references": [
{"path": "../src/tsconfig.cjs.json"},
{"path": "../tsconfig.lib.json"},
{"path": "../utils/testserver/tsconfig.json"}
]
}

0 comments on commit ae4c5ea

Please sign in to comment.