chore: refactor build commands (#8874)

This commit is contained in:
jrandolf 2022-09-01 01:05:20 +02:00 committed by GitHub
parent 3732757450
commit ae4c5ea031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -9,7 +9,7 @@
},
"include": ["src"],
"references": [
{"path": "../src/tsconfig.cjs.json"},
{"path": "../tsconfig.lib.json"},
{"path": "../utils/testserver/tsconfig.json"}
]
}