-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prep export of launcher as a standalone module #2358
Changes from 4 commits
eb4af86
3fb556e
ed165c2
0d9738a
2aa9734
cc8589c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ echo "Upload the package zip to CWS dev dashboard" | |
|
||
echo "Verify the npm package won't include unncessary files" | ||
yarn global add irish-pub pkgfiles | ||
irish-pub; pkgfiles; | ||
irish-pub; pkgfiles; | ||
|
||
echo "ship it" | ||
npm publish | ||
|
@@ -110,6 +110,17 @@ echo "Generate the release notes, and update the release page" | |
echo "Inform various peoples" | ||
``` | ||
|
||
### Releasing chrome launcher. | ||
|
||
```sh | ||
cd chrome-launcher | ||
echo "build the launcher source code" | ||
yarn build | ||
echo "run npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]" | ||
echo "commit the change as a version bump" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i prefer versioning with yarn because it's interactive, but w/e. also in both cases the commit (and tag) is made automatically.
|
||
npm publish | ||
``` | ||
|
||
### Canary release | ||
|
||
```sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# folders | ||
.vscode/ | ||
test/ | ||
|
||
# dev files | ||
.appveyor.yml | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.travis.yml | ||
gulpfile.js |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Chrome Launcher | ||
|
||
Launch chrome with ease from node. | ||
|
||
### Installing | ||
|
||
``` | ||
yarn add chrome-launcher | ||
``` | ||
|
||
or | ||
|
||
``` | ||
npm install chrome-launcher | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
``` | ||
|
||
|
||
## API | ||
|
||
#### Launch options | ||
|
||
```js | ||
chromeLauncher.launch({ | ||
// optional staring url string | ||
startingUrl: string; | ||
// optional array of (string) flags to pass to chrome, for example ['--headless', '--disable-gpu'] | ||
// See all flags here: http://peter.sh/experiments/chromium-command-line-switches/ | ||
chromeFlags: Array<string>; | ||
// optional explicit remote debugging port number to use, otherwise an open port is autoselected for you. | ||
port: number; | ||
// optional, handle cleaning up chrome when node process gets killed via SIGINT | ||
handleSIGINT: boolean; | ||
// optional, explicit path to chrome to launch | ||
chromePath: string; | ||
// optional, user dir path to reuse | ||
userDataDir: string; | ||
}); | ||
``` | ||
|
||
#### Launched chrome interface | ||
|
||
```js | ||
{ | ||
// process id of chrome. | ||
pid: number; | ||
// the remote debuging port exposed by the launched chrome. | ||
port: number; | ||
// a function to kill and cleanup chrome. | ||
kill: () => Promise<{}>; | ||
} | ||
``` | ||
|
||
|
||
## Examples | ||
|
||
#### Launching chrome: | ||
|
||
```js | ||
const chromeLauncher = require('chrome-launcher'); | ||
|
||
chromeLauncher.launch({ | ||
startingUrl: 'https://google.com' | ||
}).then(info => { | ||
console.log(`Chrome debugging port running on ${info.port}`); | ||
}); | ||
``` | ||
|
||
|
||
#### Launching headless chrome: | ||
|
||
```js | ||
const chromeLauncher = require('chrome-launcher'); | ||
|
||
chromeLauncher.launch({ | ||
startingUrl: 'https://google.com', | ||
chromeFlags: ['--headless', '--disable-gpu'] | ||
}).then(info => { | ||
console.log(`Chrome debugging port running on ${info.port}`); | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about suggesting
npm version (major|minor|patch)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already updated :)