chore: rename browsers folders and files (#9866)

This commit is contained in:
Alex Rudenko 2023-03-16 08:16:44 +01:00 committed by GitHub
parent 16b39de5ca
commit 64cf9db602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 22 additions and 15 deletions

View File

@ -9,7 +9,7 @@
"test": "wireit"
},
"bin": {
"@puppeteer/browsers": "lib/cjs/browsers.js"
"@puppeteer/browsers": "lib/cjs/main-cli.js"
},
"main": "./lib/cjs/main.js",
"exports": {
@ -20,7 +20,7 @@
},
"wireit": {
"build": {
"command": "tsc -b && chmod a+x lib/cjs/browsers.js lib/esm/browsers.js",
"command": "tsc -b && chmod a+x lib/cjs/main-cli.js lib/esm/main-cli.js",
"files": [
"src/**/*.ts",
"tsconfig.json"

View File

@ -18,12 +18,12 @@ import ProgressBar from 'progress';
import yargs from 'yargs';
import {hideBin} from 'yargs/helpers';
import {resolveBuildId} from './browsers/browsers.js';
import {
resolveBuildId,
Browser,
BrowserPlatform,
ChromeReleaseChannel,
} from './browsers/types.js';
} from './browser-data/browser-data.js';
import {detectBrowserPlatform} from './detectPlatform.js';
import {fetch} from './fetch.js';
import {

View File

@ -16,7 +16,7 @@
import path from 'path';
import {Browser, BrowserPlatform} from './browsers/types.js';
import {Browser, BrowserPlatform} from './browser-data/browser-data.js';
/**
* The cache used by Puppeteer relies on the following structure:

View File

@ -16,7 +16,7 @@
import os from 'os';
import {BrowserPlatform} from './browsers/browsers.js';
import {BrowserPlatform} from './browser-data/browser-data.js';
export function detectBrowserPlatform(): BrowserPlatform | undefined {
const platform = os.platform();

View File

@ -20,7 +20,11 @@ import {mkdir, unlink} from 'fs/promises';
import os from 'os';
import path from 'path';
import {Browser, BrowserPlatform, downloadUrls} from './browsers/browsers.js';
import {
Browser,
BrowserPlatform,
downloadUrls,
} from './browser-data/browser-data.js';
import {CacheStructure} from './CacheStructure.js';
import {debug} from './debug.js';
import {detectBrowserPlatform} from './detectPlatform.js';

View File

@ -25,8 +25,8 @@ import {
BrowserPlatform,
executablePathByBrowser,
resolveSystemExecutablePath,
} from './browsers/browsers.js';
import {ChromeReleaseChannel} from './browsers/types.js';
ChromeReleaseChannel,
} from './browser-data/browser-data.js';
import {CacheStructure} from './CacheStructure.js';
import {debug} from './debug.js';
import {detectBrowserPlatform} from './detectPlatform.js';

View File

@ -27,4 +27,5 @@ export {
Browser,
BrowserPlatform,
ChromeReleaseChannel,
} from './browsers/browsers.js';
} from './browser-data/browser-data.js';
export {CLI} from './CLI.js';

View File

@ -17,13 +17,15 @@
import assert from 'assert';
import path from 'path';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {
BrowserPlatform,
ChromeReleaseChannel,
} from '../../lib/cjs/browser-data/browser-data.js';
import {
resolveDownloadUrl,
relativeExecutablePath,
resolveSystemExecutablePath,
} from '../../lib/cjs/browsers/chrome.js';
import {ChromeReleaseChannel} from '../../lib/cjs/browsers/types.js';
} from '../../lib/cjs/browser-data/chrome.js';
describe('Chrome', () => {
it('should resolve download URLs', () => {

View File

@ -21,12 +21,12 @@ import path from 'path';
import rimraf from 'rimraf';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {BrowserPlatform} from '../../lib/cjs/browser-data/browser-data.js';
import {
createProfile,
relativeExecutablePath,
resolveDownloadUrl,
} from '../../lib/cjs/browsers/firefox.js';
} from '../../lib/cjs/browser-data/firefox.js';
describe('Firefox', () => {
it('should resolve download URLs', () => {