Skip to content

Commit

Permalink
chore: switch to npm from yarn (puppeteer#1878)
Browse files Browse the repository at this point in the history
This patch:
- migrates CI to use NPM
- drops lockfiles (`yarn.lock`). Lockfiles are ignored by package
  managers when the package is installed as a dependency, so this makes CI closer to the 
  installation our clients run.
  • Loading branch information
JoelEinbinder authored and aslushnikov committed Jan 23, 2018
1 parent b61e67d commit f2b6016
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 1,244 deletions.
10 changes: 5 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ build: off

install:
- ps: Install-Product node $env:nodejs_version
- yarn install
- npm install
- if "%nodejs_version%" == "7" (
yarn run lint &&
yarn run coverage &&
yarn run test-doclint
npm run lint &&
npm run coverage &&
npm run test-doclint
) else (
yarn run unit-node6
npm run unit-node6
)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
*.pyc
.vscode
package-lock.json
yarn.lock
/node6
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,24 @@ addons:
# This is required to run new chrome on old trusty
- libnss3
cache:
yarn: true
directories:
- node_modules
# allow headful tests
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
install:
- yarn install
# puppeteer's install script downloads Chrome
script:
- 'if [ "$NODE7" = "true" ]; then yarn run lint; fi'
- 'if [ "$NODE7" = "true" ]; then yarn run coverage; fi'
- 'if [ "$NODE7" = "true" ]; then yarn run test-doclint; fi'
- 'if [ "$NODE6" = "true" ]; then yarn run unit-node6; fi'
- 'if [ "$NODE7" = "true" ]; then npm run lint; fi'
- 'if [ "$NODE7" = "true" ]; then npm run coverage; fi'
- 'if [ "$NODE7" = "true" ]; then npm run test-doclint; fi'
- 'if [ "$NODE6" = "true" ]; then npm run unit-node6; fi'
jobs:
include:
- node_js: "7.6.0"
env: NODE7=true
- node_js: "6.4.0"
env: NODE6=true
before_deploy: "yarn run apply-next-version"
before_deploy: "npm run apply-next-version"
deploy:
provider: npm
email: [email protected]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Give it a spin: https://try-puppeteer.appspot.com/

To use Puppeteer in your project, run:
```
yarn add puppeteer
# or "npm i puppeteer"
npm i --save puppeteer
# or "yarn add puppeteer"
```

Note: When you install Puppeteer, it downloads a recent version of Chromium (~71Mb Mac, ~90Mb Linux, ~110Mb Win) that is guaranteed to work with the API. To skip the download, see [Environment variables](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#environment-variables).
Expand Down Expand Up @@ -131,7 +131,7 @@ const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'});

See [`Puppeteer.launch()`](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions) for more information.

See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description
See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description
of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/lkcr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.

**3. Creates a fresh user profile**
Expand Down
4 changes: 2 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ RUN chmod +x /usr/local/bin/dumb-init
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install puppeteer so it's available in the container.
RUN yarn add puppeteer
RUN npm i puppeteer
# Add user so we don't need --no-sandbox.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
Expand Down Expand Up @@ -227,7 +227,7 @@ Seeing other weird errors when launching Chrome? Try running your container
with `docker run --cap-add=SYS_ADMIN` when developing locally. Since the Dockerfile
adds a `pptr` user as a non-privileged user, it may not have all the necessary privileges.

[dumb-init](https://github.com/Yelp/dumb-init) is worth checking out if you're
[dumb-init](https://github.com/Yelp/dumb-init) is worth checking out if you're
experiencing a lot of zombies Chrome processes sticking around. There's special
treatment for processes with PID=1, which makes it hard to terminate Chrome
properly in some cases (e.g. in Docker).
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Running the examples

Assuming you have a checkout of the Puppeteer repo and have run yarn (or npm i) to install the dependencies, the examples can be run from the root folder like so:
Assuming you have a checkout of the Puppeteer repo and have run npm i (or yarn) to install the dependencies, the examples can be run from the root folder like so:

```sh
NODE_PATH=../ node examples/search.js
Expand Down
2 changes: 1 addition & 1 deletion lib/Launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Launcher {
if (typeof chromeExecutable !== 'string') {
const downloader = Downloader.createDefault();
const revisionInfo = downloader.revisionInfo(downloader.currentPlatform(), ChromiumRevision);
console.assert(revisionInfo.downloaded, `Chromium revision is not downloaded. Run "yarn install" or "npm install"`);
console.assert(revisionInfo.downloaded, `Chromium revision is not downloaded. Run "npm install" or "yarn install"`);
chromeExecutable = revisionInfo.executablePath;
}
if (Array.isArray(options.args))
Expand Down
Loading

0 comments on commit f2b6016

Please sign in to comment.