Skip to content

Commit

Permalink
Migrate all dev scripts + docs from npm to yarn.
Browse files Browse the repository at this point in the history
Users can install install with npm, though
  • Loading branch information
paulirish committed Apr 26, 2017
1 parent f706752 commit 478603d
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 39 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Expand Up @@ -20,21 +20,21 @@ cache:
- lighthouse-viewer/node_modules
install:
- yarn
- npm run install-all
- yarn install-all
before_script:
- gem install travis-artifacts
- export DISPLAY=:99.0
- export LIGHTHOUSE_CHROMIUM_PATH="$(pwd)/chrome-linux/chrome"
- sh -e /etc/init.d/xvfb start
- ./lighthouse-core/scripts/download-chrome.sh
- npm run build-all
- yarn build-all
script:
- npm run lint
- npm run unit
- npm run closure
- npm run smoke
- npm run smokehouse
- yarn lint
- yarn unit
- yarn closure
- yarn smoke
- yarn smokehouse
after_success:
- npm run coveralls
- yarn coveralls
after_failure:
- grep 'No screenshots' perf.json && travis-artifacts upload --path perf-0.trace.json
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -60,7 +60,7 @@ echo "Bump the versions in extension/app/manifest.json and package.json"
# * Test err'thing *
echo "Test the CLI."
lighthouse --perf "chrome://version"
yarn run smoke
yarn smoke
echo "Test the extension"

echo "Test a fresh local install"
Expand Down Expand Up @@ -93,7 +93,7 @@ irish-pub; pkgfiles;

echo "ship it"
npm publish
yarn run deploy-viewer
yarn deploy-viewer

echo "Use the GitHub web interface to tag the release"
echo "Generate the release notes, and update the release page"
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-cli/README.md
@@ -1,11 +1,11 @@
One time setup:

```sh
npm i
yarn
```

Live dev:

```sh
npm run dev
yarn dev
```
Expand Up @@ -7,7 +7,7 @@ sleep 0.5s
config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js"

npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations
yarn smokehouse -- --config-path=$config --expectations-path=$expectations
exit_code=$?

# kill test servers
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/dobetterweb/run-tests.sh
Expand Up @@ -8,7 +8,7 @@ config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js"

# run smoketest on DBW test page.
npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations
yarn smokehouse -- --config-path=$config --expectations-path=$expectations
exit_code=$?

# kill test servers
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/offline-local/run-tests.sh
Expand Up @@ -8,7 +8,7 @@ config="lighthouse-core/config/default.js"
expectations="lighthouse-cli/test/smokehouse/offline-local/offline-expectations.js"

# run smoketest, expecting results found in offline-expectations
npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations
yarn smokehouse -- --config-path=$config --expectations-path=$expectations
exit_code=$?

# kill test servers
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/perf/run-tests.sh
Expand Up @@ -13,7 +13,7 @@ if [[ "$CI" = true ]]; then
save_assets="--save-assets-path=perf.json"
fi

npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations "$save_assets"
yarn smokehouse -- --config-path=$config --expectations-path=$expectations "$save_assets"
exit_code=$?

# kill test servers
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-extension/README.md
Expand Up @@ -9,15 +9,15 @@
## Dev

* `npm i`
* `npm run watch`
* `yarn watch`
* Load `/app` as Unpacked extension.
* Saved changes _should_ trigger a recompile followed by browsersync automatically refreshing the extension.
* Scripts in `./app/src/` are browserified into `./app/scripts`.

## Manual Deploy to CWS

* Be in lighthouse-extension-owners group
* `npm run build`
* `yarn build`
* Verify that the extension in `dist` works.
* Verify that `dist/manifest.json` bumps the version number vs what's on CWS.
* `gulp package`
Expand All @@ -33,5 +33,5 @@

* Install [web store api app](https://chrome.google.com/webstore/detail/web-store-api-sample-app/ndgidogppopohjpghapeojgoehfmflab)
* Add dist folder
* `npm run build`
* `yarn build`
* Use ID: `blipmdconlkpinefehnmjammfjpmpbjk`
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -11,21 +11,21 @@
"node": ">=6"
},
"scripts": {
"install-all": "npm run install-cli && npm run install-extension && npm run install-viewer",
"install-all": "yarn install-cli && yarn install-extension && yarn install-viewer",
"install-cli": "cd ./lighthouse-cli && yarn install && yarn build",
"install-extension": "cd ./lighthouse-extension && yarn install",
"install-viewer": "cd ./lighthouse-viewer && yarn install",
"build-all": "gulp && npm run build-cli && npm run build-extension && npm run build-viewer",
"build-cli": "cd ./lighthouse-cli && npm run build",
"build-extension": "cd ./lighthouse-extension && npm run build",
"build-viewer": "cd ./lighthouse-viewer && npm run build",
"build-all": "gulp && yarn build-cli && yarn build-extension && yarn build-viewer",
"build-cli": "cd ./lighthouse-cli && yarn build",
"build-extension": "cd ./lighthouse-extension && yarn build",
"build-viewer": "cd ./lighthouse-viewer && yarn build",
"clean": "rimraf *.report.html *.report.dom.html *.report.json *.screenshots.html *.devtoolslog.json *.trace.json || true",
"lint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe . || eslint .",
"smoke": "bash lighthouse-cli/test/smokehouse/offline-local/run-tests.sh && bash lighthouse-cli/test/smokehouse/perf/run-tests.sh && bash lighthouse-cli/test/smokehouse/dobetterweb/run-tests.sh && bash lighthouse-cli/test/smokehouse/byte-efficiency/run-tests.sh",
"coverage": "node $(npm bin)/istanbul cover -x \"**/third_party/**\" _mocha -- $(find */test -name '*-test.js') --timeout 10000 --reporter progress",
"coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls",
"coverage": "node $(yarn bin)/istanbul cover -x \"**/third_party/**\" _mocha -- $(find */test -name '*-test.js') --timeout 10000 --reporter progress",
"coveralls": "yarn coverage && cat ./coverage/lcov.info | coveralls",
"start": "gulp && node ./lighthouse-cli/index.js",
"test": "npm run lint --silent && gulp && npm run unit && npm run closure",
"test": "yarn lint --silent && gulp && yarn unit && yarn closure",
"core-unit": "bash lighthouse-core/scripts/run-mocha.sh --core",
"cli-unit": "bash lighthouse-core/scripts/run-mocha.sh --cli",
"viewer-unit": "bash lighthouse-core/scripts/run-mocha.sh --viewer",
Expand All @@ -34,7 +34,7 @@
"devtools": "bash lighthouse-core/scripts/roll-to-devtools.sh",
"watch": "bash lighthouse-core/scripts/run-mocha.sh --watch",
"chrome": "node ./lighthouse-cli/manual-chrome-launcher.js",
"fast": "npm run start -- --disable-device-emulation --disable-cpu-throttling --disable-network-throttling",
"fast": "yarn start -- --disable-device-emulation --disable-cpu-throttling --disable-network-throttling",
"smokehouse": "node lighthouse-cli/test/smokehouse/smokehouse.js",
"deploy-viewer": "cd lighthouse-viewer && gulp deploy"
},
Expand Down
8 changes: 4 additions & 4 deletions plots/README.md
Expand Up @@ -16,15 +16,15 @@ You need to build lighthouse first.
```
# View all commands
$ cd plots
$ npm run
$ yarn run
# Run lighthouse to collect metrics data
$ npm run measure
$ yarn measure
# Analyze the data to generate a summary file (i.e. out/generatedResults.js)
# This will launch the charts web page in the browser
$ npm run analyze
$ yarn analyze
# If you need to view the charts later
$ npm run open
$ yarn open
```
13 changes: 6 additions & 7 deletions readme.md
Expand Up @@ -238,13 +238,12 @@ right corner and signing in to GitHub.
git clone https://github.com/GoogleChrome/lighthouse

cd lighthouse
npm install
npm run install-all
yarn install-all
gulp # to precompile the handlebar templates.

# The CLI is authored in TypeScript and requires compilation.
# If you need to make changes to the CLI, run the TS compiler in watch mode:
# cd lighthouse-cli && npm run dev
# cd lighthouse-cli && yarn dev
```

See [Contributing](./CONTRIBUTING.md) for more information.
Expand Down Expand Up @@ -309,15 +308,15 @@ Some basic unit tests forked are in `/test` and run via mocha. eslint is also ch

```sh
# lint and test all files
npm test
yarn test

# watch for file changes and run tests
# Requires http://entrproject.org : brew install entr
npm run watch
yarn watch

## run linting and unit tests separately
npm run lint
npm run unit
yarn lint
yarn unit
```

## Lighthouse as trace processor
Expand Down

0 comments on commit 478603d

Please sign in to comment.