mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore(deps): update deps
Signed-off-by: Randolf Jung <jrandolf@chromium.org> Co-authored-by: Randolf Jung <jrandolf@chromium.org>
This commit is contained in:
parent
523b487e88
commit
8ff9d598bf
@ -25,5 +25,5 @@
|
||||
* This means that we can publish to CJS and ESM whilst maintaining the expected
|
||||
* import behaviour for CJS and ESM users.
|
||||
*/
|
||||
const puppeteerExport = require('./lib/cjs/puppeteer/node-puppeteer-core');
|
||||
const puppeteerExport = require('./lib/cjs/puppeteer/node-puppeteer-core.js');
|
||||
module.exports = puppeteerExport.default;
|
||||
|
@ -25,5 +25,5 @@
|
||||
* This means that we can publish to CJS and ESM whilst maintaining the expected
|
||||
* import behaviour for CJS and ESM users.
|
||||
*/
|
||||
const puppeteerExport = require('./lib/cjs/puppeteer/node');
|
||||
const puppeteerExport = require('./lib/cjs/puppeteer/node.js');
|
||||
module.exports = puppeteerExport.default;
|
||||
|
@ -1,3 +1,19 @@
|
||||
/**
|
||||
* Copyright 2022 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { dirname } from 'path';
|
||||
|
||||
export const puppeteerDirname = dirname(dirname(dirname(__dirname)));
|
||||
|
@ -1,3 +1,19 @@
|
||||
/**
|
||||
* Copyright 2022 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
const compileTypeScriptIfRequired = require('./typescript-if-required');
|
||||
const compileTypeScriptIfRequired = require('./typescript-if-required.js');
|
||||
|
||||
async function download() {
|
||||
await compileTypeScriptIfRequired();
|
||||
@ -32,7 +32,7 @@ async function download() {
|
||||
const {
|
||||
downloadBrowser,
|
||||
logPolitely,
|
||||
} = require('./lib/cjs/puppeteer/node/install');
|
||||
} = require('./lib/cjs/puppeteer/node/install.js');
|
||||
|
||||
if (process.env.PUPPETEER_SKIP_DOWNLOAD) {
|
||||
logPolitely(
|
||||
|
@ -1,4 +1,4 @@
|
||||
const base = require('./base');
|
||||
const base = require('./base.js');
|
||||
|
||||
module.exports = {
|
||||
...base,
|
||||
|
@ -1,4 +1,4 @@
|
||||
const base = require('./base');
|
||||
const base = require('./base.js');
|
||||
|
||||
module.exports = {
|
||||
...base,
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const base = require('./base');
|
||||
const base = require('./base.js');
|
||||
|
||||
module.exports = {
|
||||
...base,
|
||||
|
48
package.json
48
package.json
@ -67,61 +67,61 @@
|
||||
"author": "The Chromium Authors",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"cross-fetch": "3.1.5",
|
||||
"debug": "4.3.3",
|
||||
"devtools-protocol": "0.0.960912",
|
||||
"extract-zip": "2.0.1",
|
||||
"https-proxy-agent": "5.0.0",
|
||||
"node-fetch": "2.6.7",
|
||||
"pkg-dir": "4.2.0",
|
||||
"progress": "2.0.3",
|
||||
"proxy-from-env": "1.1.0",
|
||||
"rimraf": "3.0.2",
|
||||
"tar-fs": "2.1.1",
|
||||
"unbzip2-stream": "1.4.3",
|
||||
"ws": "8.2.3"
|
||||
"ws": "8.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "13.2.0",
|
||||
"@commitlint/cli": "16.1.0",
|
||||
"@commitlint/config-conventional": "16.0.0",
|
||||
"@microsoft/api-documenter": "7.13.65",
|
||||
"@microsoft/api-extractor": "7.18.15",
|
||||
"@microsoft/api-documenter": "7.15.1",
|
||||
"@microsoft/api-extractor": "7.19.4",
|
||||
"@types/debug": "4.1.7",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/mocha": "9.0.0",
|
||||
"@types/node": "17.0.15",
|
||||
"@types/mocha": "9.1.0",
|
||||
"@types/node": "17.0.16",
|
||||
"@types/progress": "2.0.5",
|
||||
"@types/proxy-from-env": "1.0.1",
|
||||
"@types/rimraf": "3.0.2",
|
||||
"@types/sinon": "10.0.4",
|
||||
"@types/sinon": "10.0.11",
|
||||
"@types/tar-fs": "2.0.1",
|
||||
"@types/ws": "8.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "4.23.0",
|
||||
"@typescript-eslint/parser": "4.33.0",
|
||||
"@web/test-runner": "0.13.18",
|
||||
"commonmark": "0.29.3",
|
||||
"@types/ws": "8.2.2",
|
||||
"@typescript-eslint/eslint-plugin": "5.11.0",
|
||||
"@typescript-eslint/parser": "5.11.0",
|
||||
"@web/test-runner": "0.13.27",
|
||||
"commonmark": "0.30.0",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "7.32.0",
|
||||
"eslint": "8.8.0",
|
||||
"eslint-config-prettier": "8.3.0",
|
||||
"eslint-plugin-import": "2.22.1",
|
||||
"eslint-plugin-mocha": "9.0.0",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint-plugin-mocha": "10.0.3",
|
||||
"eslint-plugin-prettier": "4.0.0",
|
||||
"eslint-plugin-unicorn": "37.0.1",
|
||||
"eslint-plugin-unicorn": "40.1.0",
|
||||
"esprima": "4.0.1",
|
||||
"expect": "25.2.7",
|
||||
"husky": "7.0.2",
|
||||
"husky": "7.0.4",
|
||||
"jpeg-js": "0.4.3",
|
||||
"mime": "2.5.2",
|
||||
"mime": "3.0.0",
|
||||
"minimist": "1.2.5",
|
||||
"mocha": "9.1.3",
|
||||
"mocha": "9.2.0",
|
||||
"ncp": "2.0.0",
|
||||
"pixelmatch": "5.2.1",
|
||||
"pngjs": "6.0.0",
|
||||
"prettier": "2.3.0",
|
||||
"sinon": "9.2.4",
|
||||
"source-map-support": "0.5.19",
|
||||
"prettier": "2.5.1",
|
||||
"sinon": "13.0.1",
|
||||
"source-map-support": "0.5.21",
|
||||
"standard-version": "9.3.2",
|
||||
"text-diff": "1.0.1",
|
||||
"ts-node": "10.4.0",
|
||||
"ts-node": "10.5.0",
|
||||
"typescript": "4.4.4"
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ import { Browser, TargetFilterCallback } from './Browser.js';
|
||||
import { assert } from './assert.js';
|
||||
import { debugError } from '../common/helper.js';
|
||||
import { Connection } from './Connection.js';
|
||||
import { getFetch } from './fetch.js';
|
||||
import { Viewport } from './PuppeteerViewport.js';
|
||||
import { isNode } from '../environment.js';
|
||||
import { getFetch } from './fetch.js';
|
||||
|
||||
/**
|
||||
* Generic browser options that can be passed when launching any browser or when
|
||||
|
@ -273,12 +273,7 @@ export class JSCoverage {
|
||||
assert(this._enabled, 'JSCoverage is not enabled');
|
||||
this._enabled = false;
|
||||
|
||||
const result = await Promise.all<
|
||||
Protocol.Profiler.TakePreciseCoverageResponse,
|
||||
void,
|
||||
void,
|
||||
void
|
||||
>([
|
||||
const result = await Promise.all([
|
||||
this._client.send('Profiler.takePreciseCoverage'),
|
||||
this._client.send('Profiler.stopPreciseCoverage'),
|
||||
this._client.send('Profiler.disable'),
|
||||
|
@ -133,7 +133,7 @@ export class ExecutionContext {
|
||||
*
|
||||
* @returns A promise that resolves to the return value of the given function.
|
||||
*/
|
||||
async evaluate<ReturnType extends any>(
|
||||
async evaluate<ReturnType>(
|
||||
pageFunction: Function | string,
|
||||
...args: unknown[]
|
||||
): Promise<ReturnType> {
|
||||
|
@ -1795,7 +1795,7 @@ export class Page extends EventEmitter {
|
||||
* more than 2 network connections for at least `500` ms.
|
||||
*/
|
||||
async reload(options?: WaitForOptions): Promise<HTTPResponse | null> {
|
||||
const result = await Promise.all<HTTPResponse, void>([
|
||||
const result = await Promise.all([
|
||||
this.waitForNavigation(options),
|
||||
this._client.send('Page.reload'),
|
||||
]);
|
||||
|
@ -138,7 +138,7 @@ export class WebWorker extends EventEmitter {
|
||||
* @param args - Arguments to pass to `pageFunction`.
|
||||
* @returns Promise which resolves to the return value of `pageFunction`.
|
||||
*/
|
||||
async evaluate<ReturnType extends any>(
|
||||
async evaluate<ReturnType>(
|
||||
pageFunction: Function | string,
|
||||
...args: any[]
|
||||
): Promise<ReturnType> {
|
||||
|
@ -18,5 +18,5 @@ import { isNode } from '../environment.js';
|
||||
|
||||
/* Use the global version if we're in the browser, else load the node-fetch module. */
|
||||
export const getFetch = async (): Promise<typeof fetch> => {
|
||||
return isNode ? await import('node-fetch') : globalThis.fetch;
|
||||
return isNode ? (await import('cross-fetch')).fetch : globalThis.fetch;
|
||||
};
|
||||
|
@ -127,7 +127,7 @@ function isNumber(obj: unknown): obj is number {
|
||||
return typeof obj === 'number' || obj instanceof Number;
|
||||
}
|
||||
|
||||
async function waitForEvent<T extends any>(
|
||||
async function waitForEvent<T>(
|
||||
emitter: CommonEventEmitter,
|
||||
eventName: string | symbol,
|
||||
predicate: (event: T) => Promise<boolean> | boolean,
|
||||
@ -295,7 +295,7 @@ function makePredicateString(
|
||||
})() `;
|
||||
}
|
||||
|
||||
async function waitWithTimeout<T extends any>(
|
||||
async function waitWithTimeout<T>(
|
||||
promise: Promise<T>,
|
||||
taskName: string,
|
||||
timeout: number
|
||||
|
@ -1,3 +1,19 @@
|
||||
/**
|
||||
* Copyright 2022 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
declare const puppeteerDirname: string;
|
||||
|
||||
export { puppeteerDirname };
|
||||
|
@ -16,12 +16,12 @@
|
||||
|
||||
import { PuppeteerNode } from './node/Puppeteer.js';
|
||||
import { PUPPETEER_REVISIONS } from './revisions.js';
|
||||
import pkgDir from 'pkg-dir';
|
||||
import { sync } from 'pkg-dir';
|
||||
import { Product } from './common/Product.js';
|
||||
import { puppeteerDirname } from './compat.js';
|
||||
|
||||
export const initializePuppeteerNode = (packageName: string): PuppeteerNode => {
|
||||
const puppeteerRootDirectory = pkgDir.sync(puppeteerDirname);
|
||||
const puppeteerRootDirectory = sync(puppeteerDirname);
|
||||
|
||||
let preferredRevision = PUPPETEER_REVISIONS.chromium;
|
||||
const isPuppeteerCore = packageName === 'puppeteer-core';
|
||||
|
@ -1,5 +1,5 @@
|
||||
const { describe, it } = require('mocha');
|
||||
const { getCoverageResults } = require('./coverage-utils');
|
||||
const { getCoverageResults } = require('./coverage-utils.js');
|
||||
const expect = require('expect');
|
||||
|
||||
describe('API coverage test', () => {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
const path = require('path');
|
||||
const { TestServer } = require('../utils/testserver/');
|
||||
const { TestServer } = require('../utils/testserver/index.js');
|
||||
|
||||
const port = 8907;
|
||||
const httpsPort = 8908;
|
||||
|
@ -20,7 +20,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const expect = require('expect');
|
||||
const GoldenUtils = require('./golden-utils');
|
||||
const GoldenUtils = require('./golden-utils.js');
|
||||
const PROJECT_ROOT = fs.existsSync(path.join(__dirname, '..', 'package.json'))
|
||||
? path.join(__dirname, '..')
|
||||
: path.join(__dirname, '..', '..');
|
||||
|
@ -172,7 +172,7 @@ async function checkRollCandidate(channel) {
|
||||
10
|
||||
);
|
||||
const currentRevision = parseInt(
|
||||
require('../lib/cjs/puppeteer/revisions').PUPPETEER_REVISIONS.chromium,
|
||||
require('../lib/cjs/puppeteer/revisions.js').PUPPETEER_REVISIONS.chromium,
|
||||
10
|
||||
);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
const ts = require('typescript');
|
||||
const path = require('path');
|
||||
const Documentation = require('./Documentation');
|
||||
const Documentation = require('./Documentation.js');
|
||||
module.exports = checkSources;
|
||||
|
||||
/**
|
||||
|
@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const Documentation = require('./Documentation');
|
||||
const commonmark = require('commonmark');
|
||||
const Documentation = require('./Documentation.js');
|
||||
const { Parser, HtmlRenderer } = require('commonmark');
|
||||
|
||||
class MDOutline {
|
||||
/**
|
||||
@ -25,9 +25,9 @@ class MDOutline {
|
||||
*/
|
||||
static async create(page, text) {
|
||||
// Render markdown as HTML.
|
||||
const reader = new commonmark.Parser();
|
||||
const reader = new Parser();
|
||||
const parsed = reader.parse(text);
|
||||
const writer = new commonmark.HtmlRenderer();
|
||||
const writer = new HtmlRenderer();
|
||||
const html = writer.render(parsed);
|
||||
|
||||
page.on('console', (msg) => {
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const jsBuilder = require('./JSBuilder');
|
||||
const mdBuilder = require('./MDBuilder');
|
||||
const Documentation = require('./Documentation');
|
||||
const Message = require('../Message');
|
||||
const jsBuilder = require('./JSBuilder.js');
|
||||
const mdBuilder = require('./MDBuilder.js');
|
||||
const Documentation = require('./Documentation.js');
|
||||
const Message = require('../Message.js');
|
||||
const {
|
||||
MODULES_TO_CHECK_FOR_COVERAGE,
|
||||
} = require('../../../test/coverage-utils');
|
||||
} = require('../../../test/coverage-utils.js');
|
||||
|
||||
const EXCLUDE_PROPERTIES = new Set([
|
||||
'Browser.create',
|
||||
|
@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/extensions
|
||||
const puppeteer = require('../..');
|
||||
const path = require('path');
|
||||
const Source = require('./Source');
|
||||
const Source = require('./Source.js');
|
||||
|
||||
const PROJECT_DIR = path.join(__dirname, '..', '..');
|
||||
const VERSION = require(path.join(PROJECT_DIR, 'package.json')).version;
|
||||
@ -58,7 +59,7 @@ async function run() {
|
||||
);
|
||||
const mdSources = [readme, api, troubleshooting, contributing];
|
||||
|
||||
const preprocessor = require('./preprocessor');
|
||||
const preprocessor = require('./preprocessor/index.js');
|
||||
messages.push(...(await preprocessor.runCommands(mdSources, VERSION)));
|
||||
messages.push(
|
||||
...(await preprocessor.ensureReleasedAPILinks([readme], VERSION))
|
||||
@ -66,7 +67,7 @@ async function run() {
|
||||
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
const checkPublicAPI = require('./check_public_api');
|
||||
const checkPublicAPI = require('./check_public_api/index.js');
|
||||
const tsSources = [
|
||||
/* Source.readdir doesn't deal with nested directories well.
|
||||
* Rather than invest time here when we're going to remove this Doc tooling soon
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const Message = require('../Message');
|
||||
const Message = require('../Message.js');
|
||||
|
||||
const IS_RELEASE = Boolean(process.env.IS_RELEASE);
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
const { runCommands, ensureReleasedAPILinks } = require('.');
|
||||
const Source = require('../Source');
|
||||
const Source = require('../Source.js');
|
||||
const expect = require('expect');
|
||||
|
||||
describe('doclint preprocessor specs', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user