chore: Update build dependencies (#9600)

This commit is contained in:
Nikolay Vitkov 2023-01-30 13:30:49 +01:00 committed by GitHub
parent 390685bbe5
commit aa1d1536b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 79 additions and 22 deletions

View File

@ -27,7 +27,9 @@ again.
2. Install the dependencies 2. Install the dependencies
```sh ```sh
npm install # or PUPPETEER_PRODUCT=firefox npm install npm install
# Or to download Firefox
PUPPETEER_PRODUCT=firefox npm install
``` ```
3. Build all packages 3. Build all packages
@ -61,7 +63,7 @@ again.
## Building a single package ## Building a single package
To build a single package, you can run To build a single package, you can run:
```sh ```sh
npm run build --workspace <package> # e.g. puppeteer npm run build --workspace <package> # e.g. puppeteer
@ -72,6 +74,18 @@ packages is sufficient. This is all possible due to
[wireit](https://github.com/google/wireit) which behaves similar to [wireit](https://github.com/google/wireit) which behaves similar to
[GNU Make](https://www.gnu.org/software/make/). [GNU Make](https://www.gnu.org/software/make/).
### Watch mode
To continuously build a package, you can run:
```sh
npm run build --watch --workspace <package> # e.g. puppeteer
```
You have to only specify a single package to watch else things will not work as expected
As stated above because of [wireit](https://github.com/google/wireit) when a change happens
all dependencies will be build or rebuild (if needed).
## Removing stale artifacts ## Removing stale artifacts
It's possible some generated artifacts (such as It's possible some generated artifacts (such as

24
package-lock.json generated
View File

@ -5617,9 +5617,9 @@
"dev": true "dev": true
}, },
"node_modules/json5": { "node_modules/json5": {
"version": "2.2.1", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true, "dev": true,
"bin": { "bin": {
"json5": "lib/cli.js" "json5": "lib/cli.js"
@ -8040,9 +8040,9 @@
} }
}, },
"node_modules/tsconfig-paths/node_modules/json5": { "node_modules/tsconfig-paths/node_modules/json5": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"minimist": "^1.2.0" "minimist": "^1.2.0"
@ -13050,9 +13050,9 @@
"dev": true "dev": true
}, },
"json5": { "json5": {
"version": "2.2.1", "version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true "dev": true
}, },
"jsonc-parser": { "jsonc-parser": {
@ -14905,9 +14905,9 @@
}, },
"dependencies": { "dependencies": {
"json5": { "json5": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true, "dev": true,
"requires": { "requires": {
"minimist": "^1.2.0" "minimist": "^1.2.0"

View File

@ -8,12 +8,13 @@
"scripts": { "scripts": {
"bisect": "tsx tools/bisect.ts", "bisect": "tsx tools/bisect.ts",
"build": "npm run build --workspaces --if-present", "build": "npm run build --workspaces --if-present",
"build:docs": "npm run build:docs --workspace puppeteer --if-present",
"check:pinned-deps": "tsx tools/ensure-pinned-deps", "check:pinned-deps": "tsx tools/ensure-pinned-deps",
"check": "npm run check --workspaces --if-present && run-p check:*", "check": "npm run check --workspaces --if-present && run-p check:*",
"clean": "npm run clean --workspaces --if-present && rimraf **/.wireit", "clean": "npm run clean --workspaces --if-present && rimraf **/.wireit",
"commitlint": "commitlint --from=HEAD~1", "commitlint": "commitlint --from=HEAD~1",
"debug": "mocha --inspect-brk", "debug": "mocha --inspect-brk",
"docs": "run-s build generate:markdown", "docs": "run-s build:docs generate:markdown",
"format:eslint": "eslint --ext js --ext ts --fix .", "format:eslint": "eslint --ext js --ext ts --fix .",
"format:prettier": "prettier --write .", "format:prettier": "prettier --write .",
"format": "run-s format:*", "format": "run-s format:*",

View File

@ -0,0 +1,15 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/lib/esm/puppeteer/puppeteer-core.d.ts",
"extends": "./api-extractor.json",
"dtsRollup": {
"enabled": false
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/../../docs/<unscopedPackageName>.api.json"
}
}

View File

@ -8,8 +8,7 @@
}, },
"docModel": { "docModel": {
"enabled": true, "enabled": false
"apiJsonFilePath": "<projectFolder>/../../docs/<unscopedPackageName>.api.json"
}, },
"dtsRollup": { "dtsRollup": {

View File

@ -37,6 +37,7 @@
"build:third_party": "wireit", "build:third_party": "wireit",
"build:tsc": "wireit", "build:tsc": "wireit",
"build:types": "wireit", "build:types": "wireit",
"build:docs": "wireit",
"build": "wireit", "build": "wireit",
"check": "tsx tools/ensure-correct-devtools-protocol-package", "check": "tsx tools/ensure-correct-devtools-protocol-package",
"format:types": "wireit", "format:types": "wireit",
@ -58,6 +59,7 @@
}, },
"build": { "build": {
"dependencies": [ "dependencies": [
"build:tsc",
"build:third_party", "build:third_party",
"format:types", "format:types",
"generate:package-json" "generate:package-json"
@ -83,8 +85,7 @@
], ],
"clean": false, "clean": false,
"files": [ "files": [
"lib/esm/third_party/**", "third_party/**"
"lib/cjs/third_party/**"
], ],
"output": [ "output": [
"lib/esm/third_party/**", "lib/esm/third_party/**",
@ -115,6 +116,12 @@
"lib/types.d.ts" "lib/types.d.ts"
] ]
}, },
"build:docs": {
"command": "api-extractor run --local --config \"./api-extractor.docs.json\"",
"dependencies": [
"build:tsc"
]
},
"format:types": { "format:types": {
"command": "eslint --cache-location .eslintcache --cache --ext=ts --no-ignore --no-eslintrc -c=../../.eslintrc.types.cjs --fix lib/types.d.ts", "command": "eslint --cache-location .eslintcache --cache --ext=ts --no-ignore --no-eslintrc -c=../../.eslintrc.types.cjs --fix lib/types.d.ts",
"dependencies": [ "dependencies": [

View File

@ -0,0 +1,15 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/lib/esm/puppeteer/puppeteer.d.ts",
"extends": "./api-extractor.json",
"dtsRollup": {
"enabled": false
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/../../docs/<unscopedPackageName>.api.json"
}
}

View File

@ -8,8 +8,7 @@
}, },
"docModel": { "docModel": {
"enabled": true, "enabled": false
"apiJsonFilePath": "<projectFolder>/../../docs/<unscopedPackageName>.api.json"
}, },
"dtsRollup": { "dtsRollup": {

View File

@ -36,11 +36,11 @@
"scripts": { "scripts": {
"build:tsc": "wireit", "build:tsc": "wireit",
"build:types": "wireit", "build:types": "wireit",
"build:docs": "wireit",
"build": "wireit", "build": "wireit",
"clean": "tsc -b --clean && rimraf lib", "clean": "tsc -b --clean && rimraf lib",
"format:types": "wireit", "format:types": "wireit",
"generate:package-json": "wireit", "generate:package-json": "wireit",
"generate:sources": "wireit",
"postinstall": "node install.js", "postinstall": "node install.js",
"prepack": "wireit" "prepack": "wireit"
}, },
@ -56,6 +56,7 @@
}, },
"build": { "build": {
"dependencies": [ "dependencies": [
"build:tsc",
"format:types", "format:types",
"generate:package-json" "generate:package-json"
] ]
@ -84,6 +85,12 @@
"lib/types.d.ts" "lib/types.d.ts"
] ]
}, },
"build:docs": {
"command": "api-extractor run --local --config \"./api-extractor.docs.json\"",
"dependencies": [
"build:tsc"
]
},
"format:types": { "format:types": {
"command": "eslint --cache-location .eslintcache --cache --ext=ts --no-ignore --no-eslintrc -c=../../.eslintrc.types.cjs --fix lib/types.d.ts", "command": "eslint --cache-location .eslintcache --cache --ext=ts --no-ignore --no-eslintrc -c=../../.eslintrc.types.cjs --fix lib/types.d.ts",
"dependencies": [ "dependencies": [