2017-02-15 21:21:25 +03:00
# For Contributors
2016-01-15 20:13:20 +03:00
2017-02-15 21:21:25 +03:00
We'd love your help! This doc covers how to become a contributor and submit code to the project.
## Follow the coding style
The `.eslintrc` defines all. We use [JSDoc ](http://usejsdoc.org/ ) along with [closure annotations ](https://developers.google.com/closure/compiler/docs/js-for-compiler ). Annotations encouraged for all contributions.
## Learn about the architecture
See [Lighthouse Architecture ](./docs/architecture.md ), our overview and tour of the codebase.
## Sign the Contributor License Agreement
2016-01-15 20:13:20 +03:00
We'd love to accept your sample apps and patches! Before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement (CLA).
2017-01-25 22:46:04 +03:00
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA ](https://developers.google.com/open-source/cla/individual ).
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA ](https://developers.google.com/open-source/cla/corporate ).
2016-01-15 20:13:20 +03:00
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to
accept your pull requests.
2017-02-15 21:21:25 +03:00
## Contributing a patch
2016-01-15 20:13:20 +03:00
2017-05-03 06:59:41 +03:00
If you have a contribution for our [documentation ](https://developers.google.com/web/tools/lighthouse/ ), please submit it in the [WebFundamentals repo ](https://github.com/google/WebFundamentals/tree/master/src/content/en/tools/lighthouse ).
2016-01-15 20:13:20 +03:00
1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
1. Fork the repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the sample to which you are contributing.
1. Submit a pull request.
2017-01-06 00:51:39 +03:00
2017-02-15 21:21:25 +03:00
# For Maintainers
## Updating traceviewer source
```sh
cd lighthouse-core
# if not already there, clone catapult and copy license over
git clone --depth=1 https://github.com/catapult-project/catapult.git third_party/src/catapult
cp third_party/src/catapult/LICENSE third_party/traceviewer-js/
# pull for latest
git -C "./third_party/src/catapult/" pull
# run our conversion script
node scripts/build-traceviewer-module.js
```
2017-01-06 00:51:39 +03:00
## Release guide
```sh
2017-01-12 13:28:53 +03:00
# * Install the latest. This also builds the cli, extension, and viewer *
2017-01-06 00:51:39 +03:00
yarn
2017-01-12 13:28:53 +03:00
yarn install-all
yarn build-all
2017-01-06 00:51:39 +03:00
# * Bump it *
echo "Bump the versions in extension/app/manifest.json and package.json"
2017-01-12 13:28:53 +03:00
# * Test err'thing *
2017-01-06 00:51:39 +03:00
echo "Test the CLI."
2017-03-29 00:53:55 +03:00
lighthouse --perf "chrome://version"
2017-04-26 22:41:01 +03:00
yarn smoke
2017-01-06 00:51:39 +03:00
echo "Test the extension"
2017-01-06 08:27:16 +03:00
2017-01-12 13:28:53 +03:00
echo "Test a fresh local install"
2017-01-06 08:27:16 +03:00
# (starting from lighthouse root...)
# cd ..; mkdir tmp; cd tmp
# npm install ../lighthouse
# npm explore lighthouse -- npm run smoke
# npm explore lighthouse -- npm run smokehouse
# npm explore lighthouse -- npm run chrome # try the manual launcher
2017-03-24 22:50:18 +03:00
# npm explore lighthouse -- npm run fast -- http://example.com
2017-01-06 08:27:16 +03:00
# cd ..; rm -rf ./tmp;
2017-01-06 00:51:39 +03:00
echo "Test the lighthouse-viewer build"
2017-01-06 08:27:16 +03:00
# Manual test for now:
2017-01-12 13:28:53 +03:00
# Start a server in lighthouse-viewer/dist/ and open the page in a tab. You should see the viewer.
2017-01-06 08:27:16 +03:00
# Drop in a results.json or paste an existing gist url (e.g. https://gist.github.com/ebidel/b9fd478b5f40bf5fab174439dc18f83a).
# Check for errors!
2017-01-06 00:51:39 +03:00
# * Put up the PR *
echo "Branch and commit the version bump."
echo "Generate a PR and get it merged."
# * Deploy-time *
2017-02-23 09:16:17 +03:00
cd lighthouse-extension; yarn build; gulp package; cd ..
2017-01-06 00:51:39 +03:00
echo "Upload the package zip to CWS dev dashboard"
2017-03-24 20:48:11 +03:00
echo "Verify the npm package won't include unncessary files"
yarn global add irish-pub pkgfiles
irish-pub; pkgfiles;
echo "ship it"
2017-01-06 00:51:39 +03:00
npm publish
2017-04-26 22:41:01 +03:00
yarn deploy-viewer
2017-01-06 00:51:39 +03:00
2017-01-25 19:47:16 +03:00
echo "Use the GitHub web interface to tag the release"
2017-01-06 00:51:39 +03:00
echo "Generate the release notes, and update the release page"
# * Tell the world!!! *
echo "Inform various peoples"
```