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" "test": "wireit"
}, },
"bin": { "bin": {
"@puppeteer/browsers": "lib/cjs/browsers.js" "@puppeteer/browsers": "lib/cjs/main-cli.js"
}, },
"main": "./lib/cjs/main.js", "main": "./lib/cjs/main.js",
"exports": { "exports": {
@ -20,7 +20,7 @@
}, },
"wireit": { "wireit": {
"build": { "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": [ "files": [
"src/**/*.ts", "src/**/*.ts",
"tsconfig.json" "tsconfig.json"

View File

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

View File

@ -16,7 +16,7 @@
import path from 'path'; 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: * The cache used by Puppeteer relies on the following structure:

View File

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

View File

@ -20,7 +20,11 @@ import {mkdir, unlink} from 'fs/promises';
import os from 'os'; import os from 'os';
import path from 'path'; 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 {CacheStructure} from './CacheStructure.js';
import {debug} from './debug.js'; import {debug} from './debug.js';
import {detectBrowserPlatform} from './detectPlatform.js'; import {detectBrowserPlatform} from './detectPlatform.js';

View File

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

View File

@ -27,4 +27,5 @@ export {
Browser, Browser,
BrowserPlatform, BrowserPlatform,
ChromeReleaseChannel, 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 assert from 'assert';
import path from 'path'; import path from 'path';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js'; import {
BrowserPlatform,
ChromeReleaseChannel,
} from '../../lib/cjs/browser-data/browser-data.js';
import { import {
resolveDownloadUrl, resolveDownloadUrl,
relativeExecutablePath, relativeExecutablePath,
resolveSystemExecutablePath, resolveSystemExecutablePath,
} from '../../lib/cjs/browsers/chrome.js'; } from '../../lib/cjs/browser-data/chrome.js';
import {ChromeReleaseChannel} from '../../lib/cjs/browsers/types.js';
describe('Chrome', () => { describe('Chrome', () => {
it('should resolve download URLs', () => { it('should resolve download URLs', () => {

View File

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