mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: refactor build commands (#8874)
This commit is contained in:
parent
3732757450
commit
ae4c5ea031
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -170,7 +170,7 @@ jobs:
|
|||||||
if: ${{ matrix.spec.name == 'Linux' }}
|
if: ${{ matrix.spec.name == 'Linux' }}
|
||||||
run: sudo apt-get install xvfb
|
run: sudo apt-get install xvfb
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build:ci
|
run: npm run build:dev
|
||||||
- name: Test types
|
- name: Test types
|
||||||
run: npm run test:types
|
run: npm run test:types
|
||||||
# On Linux we run all Chrome tests without retries and Firefox tests with retries.
|
# On Linux we run all Chrome tests without retries and Firefox tests with retries.
|
||||||
@ -220,7 +220,7 @@ jobs:
|
|||||||
ls .local-chromium
|
ls .local-chromium
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
npm run build:ci
|
npm run build:dev
|
||||||
docker/pack.sh
|
docker/pack.sh
|
||||||
- name: Build docker image
|
- name: Build docker image
|
||||||
working-directory: ./docker
|
working-directory: ./docker
|
||||||
|
@ -36,13 +36,27 @@ npm install
|
|||||||
PUPPETEER_PRODUCT=firefox npm install
|
PUPPETEER_PRODUCT=firefox npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Build and run Puppeteer tests locally. For more information about tests, read
|
## Building Puppeteer
|
||||||
[Running & Writing Tests](#running--writing-tests).
|
|
||||||
|
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
|
```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
|
## Code reviews
|
||||||
|
|
||||||
All submissions, including submissions by project members, require review. We
|
All submissions, including submissions by project members, require review. We
|
||||||
|
13
package.json
13
package.json
@ -48,18 +48,17 @@
|
|||||||
"format:prettier": "prettier --write .",
|
"format:prettier": "prettier --write .",
|
||||||
"format:eslint": "eslint --ext js --ext ts --fix .",
|
"format:eslint": "eslint --ext js --ext ts --fix .",
|
||||||
"docs": "run-s build generate:markdown",
|
"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",
|
"commitlint": "commitlint --from=HEAD~1",
|
||||||
"clean": "rimraf lib && rimraf test/build",
|
"clean": "rimraf lib && rimraf test/build",
|
||||||
"check": "run-p check:*",
|
"check": "run-p check:*",
|
||||||
"check:protocol-revision": "tsx scripts/ensure-correct-devtools-protocol-package",
|
"check:protocol-revision": "tsx scripts/ensure-correct-devtools-protocol-package",
|
||||||
"check:pinned-deps": "tsx scripts/ensure-pinned-deps",
|
"check:pinned-deps": "tsx scripts/ensure-pinned-deps",
|
||||||
"build": "npm run build:lib",
|
"build": "npm run build:prod",
|
||||||
"build:test": "run-s generate:sources build:tsc:test",
|
"build:dev": "run-s generate:sources build:tsc:dev generate:artifacts",
|
||||||
"build:ci": "run-s build:test generate:artifacts",
|
"build:prod": "run-s generate:sources build:tsc:prod generate:artifacts",
|
||||||
"build:lib": "run-s generate:sources build:tsc:lib generate:artifacts",
|
"build:tsc:dev": "tsc -b test",
|
||||||
"build:tsc:test": "tsc -b test",
|
"build:tsc:prod": "tsc -b tsconfig.lib.json"
|
||||||
"build:tsc:lib": "tsc -b tsconfig.lib.json"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"lib",
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"references": [
|
"references": [
|
||||||
{"path": "../src/tsconfig.cjs.json"},
|
{"path": "../tsconfig.lib.json"},
|
||||||
{"path": "../utils/testserver/tsconfig.json"}
|
{"path": "../utils/testserver/tsconfig.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user