add back playwright package that downloads all browsers

This commit is contained in:
Joel Einbinder 2020-01-20 22:58:45 +00:00
parent bbb8845db5
commit 9c4c4808b9
5 changed files with 28 additions and 8 deletions

View file

@ -1,2 +1,2 @@
# playwright
This is a placeholder package for [Playwright](http://github.com/microsoft/playwright). Install one of `playwright-chromium`, `playwright-webkit`, or `playwright-firefox` to use playwright.
This packagage contains the [Chromium](https://www.chromium.org/), [Firefox](https://www.mozilla.org/firefox/) and [WebKit](https://www.webkit.org/) flavors of [Playwright](http://github.com/microsoft/playwright).

View file

@ -0,0 +1,16 @@
/**
* Copyright (c) Microsoft Corporation.
*
* 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.
*/
module.exports = require('playwright-core');

View file

@ -13,5 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
console.error('This package, "playwright", is a placeholder. Please install "playwright-chromium", "playwright-firefox", or "playwright-webkit" to use playwright.');
process.exit(1);
const {downloadBrowser} = require('playwright-core/download-browser');
(async function() {
await downloadBrowser('chromium');
await downloadBrowser('firefox');
await downloadBrowser('webkit');
})();

View file

@ -10,5 +10,8 @@
"author": {
"name": "Microsoft Corporation"
},
"license": "Apache-2.0"
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "=0.9.13-post"
}
}

View file

@ -16,11 +16,8 @@
const fs = require('fs');
const path = require('path');
const {version} = require('../package.json');
updatePackage('playwright', packageJSON => {
packageJSON.version = version;
});
for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit']) {
for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit', 'playwright']) {
updatePackage(packageName, packageJSON => {
packageJSON.version = version;
packageJSON.dependencies['playwright-core'] = `=${version}`;