Skip to content

Commit

Permalink
chore: migrate puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Sep 29, 2022
1 parent 4e4f36a commit 95d7412
Show file tree
Hide file tree
Showing 188 changed files with 1,024 additions and 646 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Expand Up @@ -18,7 +18,7 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/

# IDE Artifacts
.vscode
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -242,7 +242,7 @@ jobs:
if: ${{ matrix.spec.xvfb }}
run: sudo apt-get install xvfb
- name: Build
run: npm run build:dev
run: npm run build:test
- name: Test types
run: npm run test:types
- name: Run all tests with xvfb
Expand All @@ -258,7 +258,8 @@ jobs:
npm run clean
npm run build
# Note: this modifies package.json to test puppeteer-core, so we test this last.
npm run test:install
# TODO(jrandolf): Disabled for now.
# npm run test:install
docker-tests:
runs-on: ${{ matrix.os }}
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/publish.yml
Expand Up @@ -15,25 +15,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Build puppeteer
run: |
npm install
npx lerna bootstrap
- name: Build packages
run: npm run build
- name: Publish puppeteer
- name: Publish packages
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER}}
run: |
npm config set registry 'https://wombat-dressing-room.appspot.com/'
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}'
echo "Publishing puppeteer"
npm publish
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NODE_AUTH_TOKEN}'
npx lerna publish from-package --registry 'https://wombat-dressing-room.appspot.com/'
# DEPRECATED_RANGE=$(node utils/get_deprecated_version_range.js)
# echo "Deprecating old puppeteer versions: $DEPRECATED_RANGE"
# npm deprecate puppeteer@$DEPRECATED_RANGE "Version no longer supported. Upgrade to @latest"
- name: Publish puppeteer-core
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN_PUPPETEER_CORE}}
run: |
utils/prepare_puppeteer_core.js
npm config set registry 'https://wombat-dressing-room.appspot.com/'
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}'
npm publish
6 changes: 3 additions & 3 deletions .github/workflows/tot-ci.yml
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in headless
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in headful
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
echo "Installing revision $REV"
cat src/revisions.ts | sed "s/[0-9]\{6,\}/$REV/" > src/revisions.ts.replaced
mv src/revisions.ts.replaced src/revisions.ts
npm run build:dev
npm run build:test
npm install
- name: Run unit tests in chrome headless
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Expand Up @@ -7,7 +7,7 @@ lib/

# Generated files
**/*.tsbuildinfo
puppeteer.api.json
*.api.json
puppeteer*.tgz
yarn.lock
.docusaurus/
Expand All @@ -17,7 +17,8 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/
.eslintcache

# IDE Artifacts
.vscode
Expand All @@ -33,3 +34,6 @@ src/generated
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Wireit
.wireit
3 changes: 1 addition & 2 deletions .prettierignore
Expand Up @@ -18,7 +18,7 @@ yarn.lock
test/output-*/
.dev_profile*
coverage/
src/generated
generated/

# IDE Artifacts
.vscode
Expand All @@ -40,7 +40,6 @@ yarn-error.log*
assets/
CHANGELOG.md
package-lock.json
package.json
test/assets/
docs/
versioned_*/
4 changes: 3 additions & 1 deletion .release-please-manifest.json
@@ -1,3 +1,5 @@
{
".": "18.0.5"
"puppeteer": "18.0.5",
"puppeteer-core": "18.0.5",
"testserver": "0.5.0"
}
8 changes: 0 additions & 8 deletions compat/cjs/tsconfig.json

This file was deleted.

8 changes: 0 additions & 8 deletions compat/esm/tsconfig.json

This file was deleted.

5 changes: 3 additions & 2 deletions docs/api/puppeteer.connect.md
Expand Up @@ -7,6 +7,7 @@ sidebar_label: connect
**Signature:**

```typescript
connect: (options: import('./types.js').ConnectOptions) =>
Promise<import('./types.js').Browser>;
connect: (
options: import('puppeteer-core/internal/common/Puppeteer.js').ConnectOptions
) => Promise<import('puppeteer-core/internal/api/Browser.js').Browser>;
```
4 changes: 2 additions & 2 deletions docs/api/puppeteer.launch.md
Expand Up @@ -7,6 +7,6 @@ sidebar_label: launch
**Signature:**

```typescript
launch: (options?: import('./types.js').PuppeteerLaunchOptions) =>
Promise<import('./types.js').Browser>;
launch: (options?: import('./node/PuppeteerNode.js').PuppeteerLaunchOptions) =>
Promise<import('puppeteer-core/internal/api/Browser.js').Browser>;
```
6 changes: 3 additions & 3 deletions docs/contributing.md
Expand Up @@ -42,15 +42,15 @@ 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, test runner, tests, and artifacts used in
- `npm run build:test` - Builds Puppeteer, test runner, tests, and artifacts used in
production.

## Testing Puppeteer

For browser testing, you can run

```bash
npm run build:dev && npm run test
npm run build:test && npm run test
```

We also have other tests such as `test:types` that tests types and
Expand Down Expand Up @@ -274,7 +274,7 @@ The following steps are needed to update the Chromium version.
1. Update `versions.js` with the new Chromium-to-Puppeteer version mapping and update `lastMaintainedChromiumVersion` with the latest stable Chrome version.
1. Run `npm run check:protocol-revision`.
If it fails, update `package.json` with the expected `devtools-protocol` version.
1. Run `npm run build && npm run build:dev` and `npm install`.
1. Run `npm run build && npm run build:test` and `npm install`.
1. Run `npm test` and ensure that all tests pass. If a test fails, [bisect](#bisecting-upstream-changes) the upstream cause of the failure, and either update the test expectations accordingly (if it was an intended change) or work around the changes in Puppeteer (if it’s not desirable to change Puppeteer’s observable behavior).
1. Commit and push your changes and open a pull request.
The commit message must contain the version in `Chromium <version> (<revision>)` format to ensure that [pptr.dev](https://pptr.dev/) can parse it correctly, e.g. `'feat(chromium): roll to Chromium 90.0.4427.0 (r856583)'`.
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Expand Up @@ -2,5 +2,5 @@
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useNx": true,
"useWorkspaces": true,
"version": "0.0.0"
"version": "independent"
}

0 comments on commit 95d7412

Please sign in to comment.