Skip to content

Commit e8eda34

Browse files
committed
chore: remove uncompiled download-browser
1 parent f5ef6bf commit e8eda34

File tree

21 files changed

+196
-248
lines changed

21 files changed

+196
-248
lines changed

.npmignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ lib/injected/
1010
!types/*
1111
!index.d.ts
1212

13-
# used for npm install scripts
14-
!download-browser.js
15-
1613
# root for "playwright-core" package
1714
!index.js
1815

download-browser.js

Lines changed: 0 additions & 69 deletions
This file was deleted.

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { initializePlaywright } = require('./download-browser');
17+
const { Playwright } = require('./lib/server/playwright');
1818

19-
module.exports = initializePlaywright(__dirname, require('./browsers.json'));
19+
module.exports = new Playwright(__dirname, require('./browsers.json')['browsers']);

install-from-github.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,19 @@ async function listFiles(dirpath) {
6363
}
6464

6565
async function downloadAllBrowsersAndGenerateProtocolTypes() {
66-
const { targetDirectory, executablePath, downloadBrowserWithProgressBar } = require('./download-browser');
66+
const { downloadBrowserWithProgressBar } = require('./lib/install/browserFetcher');
6767
const protocolGenerator = require('./utils/protocol-types-generator');
68+
const browserPaths = require('./lib/install/browserPaths');
6869
const browsers = require('./browsers.json')['browsers'];
6970
for (const browser of browsers) {
7071
if (await downloadBrowserWithProgressBar(__dirname, browser))
71-
await protocolGenerator.generateProtocol(browser.name, executablePath(__dirname, browser)).catch(console.warn);
72+
await protocolGenerator.generateProtocol(browser.name, browserPaths.executablePath(__dirname, browser)).catch(console.warn);
7273
}
7374

7475
// Cleanup stale revisions.
7576
const directories = new Set(await readdirAsync(path.join(__dirname, '.local-browsers')));
7677
for (const browser of browsers)
77-
directories.delete(targetDirectory(__dirname, browser));
78+
directories.delete(browserPaths.browserDirectory(__dirname, browser));
7879
await Promise.all([...directories].map(directory => rmAsync(directory)));
7980

8081
try {

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,5 @@
7676
"typescript": "^3.8.3",
7777
"webpack": "^4.41.0",
7878
"webpack-cli": "^3.3.9"
79-
},
80-
"browser": {
81-
"./lib/BrowserFetcher.js": false,
82-
"ws": "./utils/browser/WebSocket",
83-
"fs": false,
84-
"child_process": false,
85-
"rimraf": false,
86-
"readline": false
8779
}
8880
}

packages/playwright-chromium/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { initializePlaywright } = require('playwright-core/download-browser');
17+
const { Playwright } = require('playwright-core/lib/server/playwright');
1818

19-
module.exports = initializePlaywright(__dirname, require('./browsers.json'));
19+
module.exports = new Playwright(__dirname, require('./browsers.json')['browsers']);

packages/playwright-chromium/install.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { downloadBrowsersWithProgressBar } = require('playwright-core/download-browser');
17+
const { downloadBrowsersWithProgressBar } = require('playwright-core/lib/install/browserFetcher');
1818

19-
downloadBrowsersWithProgressBar(__dirname, require('./browsers.json'));
19+
downloadBrowsersWithProgressBar(__dirname, require('./browsers.json')['browsers']);

packages/playwright-firefox/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { initializePlaywright } = require('playwright-core/download-browser');
17+
const { Playwright } = require('playwright-core/lib/server/playwright');
1818

19-
module.exports = initializePlaywright(__dirname, require('./browsers.json'));
19+
module.exports = new Playwright(__dirname, require('./browsers.json')['browsers']);

packages/playwright-firefox/install.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { downloadBrowsersWithProgressBar } = require('playwright-core/download-browser');
17+
const { downloadBrowsersWithProgressBar } = require('playwright-core/lib/install/browserFetcher');
1818

19-
downloadBrowsersWithProgressBar(__dirname, require('./browsers.json'));
19+
downloadBrowsersWithProgressBar(__dirname, require('./browsers.json')['browsers']);

packages/playwright-webkit/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
const { initializePlaywright } = require('playwright-core/download-browser');
17+
const { Playwright } = require('playwright-core/lib/server/playwright');
1818

19-
module.exports = initializePlaywright(__dirname, require('./browsers.json'));
19+
module.exports = new Playwright(__dirname, require('./browsers.json')['browsers']);

0 commit comments

Comments
 (0)