chore: switch to npm from yarn (#1878)
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.
This commit is contained in:
parent
b61e67d001
commit
f2b6016354
@ -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
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,5 @@
|
||||
*.pyc
|
||||
.vscode
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
/node6
|
||||
|
14
.travis.yml
14
.travis.yml
@ -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: aslushnikov@gmail.com
|
||||
|
@ -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).
|
||||
@ -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**
|
||||
|
@ -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 \
|
||||
@ -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).
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user