forked from microsoft/playwright
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prepare to npm publish (microsoft#148)
- setup .npmignore; - index.js selecting a browser; - minor package.json tweaks; - example script which works against npm pack'ed module.
- Loading branch information
1 parent
4478c65
commit 0a9377e
Showing
5 changed files
with
53 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ yarn.lock | |
/utils/browser/playwright-web.js | ||
/index.d.ts | ||
lib/ | ||
playwright-*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,20 @@ | ||
.appveyor.yml | ||
.gitattributes | ||
# this ignores everything by default, except for package.json and LICENSE and README.md | ||
# see https://docs.npmjs.com/misc/developers | ||
**/* | ||
|
||
# no longer generated, but old checkouts might still have it | ||
node6 | ||
# include sources from lib except for injected, but not map files | ||
!lib/**/*.js | ||
# Injected files are included via lib/generated, see src/injected/README.md | ||
lib/injected/ | ||
|
||
# exclude all tests | ||
test | ||
utils/node6-transform | ||
# root for "playwright" package | ||
!index.js | ||
|
||
# exclude source files | ||
src | ||
# specific browsers | ||
!chromium.js | ||
!firefox.js | ||
!webkit.js | ||
|
||
# repeats from .gitignore | ||
node_modules | ||
.local-chromium | ||
.local-browser | ||
.local-webkit | ||
.dev_profile* | ||
.DS_Store | ||
*.swp | ||
*.pyc | ||
.vscode | ||
package-lock.json | ||
/node6/test | ||
/node6/utils | ||
/test | ||
/utils | ||
/docs | ||
yarn.lock | ||
|
||
# other | ||
/.ci | ||
/examples | ||
.appveyour.yml | ||
.cirrus.yml | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.travis.yml | ||
README.md | ||
tsconfig.json | ||
|
||
# exclude types, see https://github.com/GoogleChrome/puppeteer/issues/3878 | ||
/index.d.ts | ||
|
||
# install.js only does stuff for development | ||
/install.js | ||
# Dgozman says to remove these | ||
!DeviceDescriptors.js | ||
!Errors.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
(async () => { | ||
const browserName = process.argv[2]; | ||
const playwright = require('playwright')(browserName); | ||
|
||
console.log('downloading ' + browserName + '...'); | ||
const revisionInfo = await playwright.downloadBrowser(); | ||
console.log('downloaded to ' + revisionInfo.folderPath); | ||
|
||
console.log('checking user agent...'); | ||
const browser = await playwright.launch(); | ||
const page = await browser.newPage(); | ||
console.log(await page.evaluate('navigator.userAgent')); | ||
await browser.close(); | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
module.exports = browser => { | ||
if (browser === 'chromium') | ||
return require('./chromium'); | ||
if (browser === 'firefox') | ||
return require('./firefox'); | ||
if (browser === 'webkit') | ||
return require('./webkit'); | ||
throw new Error(`Unsupported browser "${browser}"`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"name": "playwright", | ||
"version": "0.9.0-post", | ||
"description": "A high-level API to control headless Chrome over the DevTools Protocol", | ||
"description": "A high-level API to control web browsers", | ||
"repository": "github:Microsoft/playwright", | ||
"engines": { | ||
"node": ">=10.17.0" | ||
}, | ||
"main": "index.js", | ||
"playwright": { | ||
"chromium_revision": "719491", | ||
"firefox_revision": "1004", | ||
|
@@ -18,7 +19,7 @@ | |
"debug-unit": "node --inspect-brk test/test.js", | ||
"test-doclint": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js", | ||
"test": "npm run lint --silent && npm run coverage && npm run test-doclint && npm run test-types && node utils/testrunner/test/test.js", | ||
"install": "node install.js", | ||
"prepare": "node install.js", | ||
"lint": "([ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts ./src || eslint --ext js,ts ./src) && npm run tsc && npm run doc", | ||
"doc": "node utils/doclint/cli.js", | ||
"coverage": "cross-env COVERAGE=true npm run unit", | ||
|
@@ -30,8 +31,10 @@ | |
"test-types": "node utils/doclint/generate_types && npx -p [email protected] tsc -p utils/doclint/generate_types/test/", | ||
"unit-bundle": "node utils/browser/test.js" | ||
}, | ||
"author": "The Chromium Authors", | ||
"license": "Apache-2.0", | ||
"author": { | ||
"name": "Microsoft Corporation" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"debug": "^4.1.0", | ||
"extract-zip": "^1.6.6", | ||
|