mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
|
install:
|
||||||
- ps: Install-Product node $env:nodejs_version
|
- ps: Install-Product node $env:nodejs_version
|
||||||
- yarn install
|
- npm install
|
||||||
- if "%nodejs_version%" == "7" (
|
- if "%nodejs_version%" == "7" (
|
||||||
yarn run lint &&
|
npm run lint &&
|
||||||
yarn run coverage &&
|
npm run coverage &&
|
||||||
yarn run test-doclint
|
npm run test-doclint
|
||||||
) else (
|
) else (
|
||||||
yarn run unit-node6
|
npm run unit-node6
|
||||||
)
|
)
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,5 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
.vscode
|
.vscode
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
/node6
|
/node6
|
||||||
|
14
.travis.yml
14
.travis.yml
@ -6,28 +6,24 @@ addons:
|
|||||||
# This is required to run new chrome on old trusty
|
# This is required to run new chrome on old trusty
|
||||||
- libnss3
|
- libnss3
|
||||||
cache:
|
cache:
|
||||||
yarn: true
|
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
# allow headful tests
|
# allow headful tests
|
||||||
before_install:
|
before_install:
|
||||||
- "export DISPLAY=:99.0"
|
- "export DISPLAY=:99.0"
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
install:
|
|
||||||
- yarn install
|
|
||||||
# puppeteer's install script downloads Chrome
|
|
||||||
script:
|
script:
|
||||||
- 'if [ "$NODE7" = "true" ]; then yarn run lint; fi'
|
- 'if [ "$NODE7" = "true" ]; then npm run lint; fi'
|
||||||
- 'if [ "$NODE7" = "true" ]; then yarn run coverage; fi'
|
- 'if [ "$NODE7" = "true" ]; then npm run coverage; fi'
|
||||||
- 'if [ "$NODE7" = "true" ]; then yarn run test-doclint; fi'
|
- 'if [ "$NODE7" = "true" ]; then npm run test-doclint; fi'
|
||||||
- 'if [ "$NODE6" = "true" ]; then yarn run unit-node6; fi'
|
- 'if [ "$NODE6" = "true" ]; then npm run unit-node6; fi'
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- node_js: "7.6.0"
|
- node_js: "7.6.0"
|
||||||
env: NODE7=true
|
env: NODE7=true
|
||||||
- node_js: "6.4.0"
|
- node_js: "6.4.0"
|
||||||
env: NODE6=true
|
env: NODE6=true
|
||||||
before_deploy: "yarn run apply-next-version"
|
before_deploy: "npm run apply-next-version"
|
||||||
deploy:
|
deploy:
|
||||||
provider: npm
|
provider: npm
|
||||||
email: aslushnikov@gmail.com
|
email: aslushnikov@gmail.com
|
||||||
|
@ -32,8 +32,8 @@ Give it a spin: https://try-puppeteer.appspot.com/
|
|||||||
|
|
||||||
To use Puppeteer in your project, run:
|
To use Puppeteer in your project, run:
|
||||||
```
|
```
|
||||||
yarn add puppeteer
|
npm i --save puppeteer
|
||||||
# or "npm i 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).
|
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).
|
||||||
|
@ -130,7 +130,7 @@ RUN chmod +x /usr/local/bin/dumb-init
|
|||||||
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
||||||
|
|
||||||
# Install puppeteer so it's available in the container.
|
# 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.
|
# Add user so we don't need --no-sandbox.
|
||||||
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
|
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Running the examples
|
# 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
|
```sh
|
||||||
NODE_PATH=../ node examples/search.js
|
NODE_PATH=../ node examples/search.js
|
||||||
|
@ -92,7 +92,7 @@ class Launcher {
|
|||||||
if (typeof chromeExecutable !== 'string') {
|
if (typeof chromeExecutable !== 'string') {
|
||||||
const downloader = Downloader.createDefault();
|
const downloader = Downloader.createDefault();
|
||||||
const revisionInfo = downloader.revisionInfo(downloader.currentPlatform(), ChromiumRevision);
|
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;
|
chromeExecutable = revisionInfo.executablePath;
|
||||||
}
|
}
|
||||||
if (Array.isArray(options.args))
|
if (Array.isArray(options.args))
|
||||||
|
Loading…
Reference in New Issue
Block a user