-
-
Notifications
You must be signed in to change notification settings - Fork 744
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support old and new puppeteer types (#555)
* docs: Add package testing example * feat: Support old and new puppeteer types * ci: Update puppeteer version matrix * lint: Refactor if statement * chore: TS fix * feat: Disable hoisting for types, upgrade adblocker plugin * lint: Make TS happy * chore: Update deps * fix: Add mising dev dep due to hoisting rule * chore: Add @types/puppeteer as dev dependency * ci: Add smaller fixes * ci: Testing ci * ci: Testing ci * chore: Disable adblocker plugin build in old pptr versions * ci: Testing ci
- Loading branch information
Showing
18 changed files
with
1,743 additions
and
1,499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/puppeteer-extra-plugin-adblocker/build_version_check.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const pkg = require('./package.json') | ||
|
||
const isIncompatiblePuppeteerVersion = () => { | ||
const version = pkg.devDependencies.puppeteer | ||
const majorVersion = parseInt(version.split('.')[0]) | ||
if (majorVersion >= 6) { | ||
return true | ||
} else { | ||
return false | ||
} | ||
} | ||
|
||
const incompatible = isIncompatiblePuppeteerVersion() | ||
if (incompatible) { | ||
console.warn( | ||
'ERR: The adblocker plugin requires pptr >= 6', | ||
process.env.PUPPETEER_VERSION | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/puppeteer-extra/src/puppeteer.ts → ...s/puppeteer-extra-plugin/src/puppeteer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// A wildcard import would result in a `require("puppeteer")` statement | ||
// at the top of the transpiled js file, not what we want. :-/ | ||
// "import type" is a solution here but requires TS >= v3.8 which we don't want to require yet as a minimum. | ||
|
||
export { Browser } from 'puppeteer' | ||
export { Page } from 'puppeteer' | ||
export { Target } from 'puppeteer' | ||
export { ConnectOptions } from 'puppeteer' | ||
export { ChromeArgOptions } from 'puppeteer' | ||
export { LaunchOptions } from 'puppeteer' | ||
export { FetcherOptions } from 'puppeteer' | ||
export { BrowserFetcher } from 'puppeteer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.