Reorder installation steps for PolyGerrit dependencies

I don't want to have to read the whole file to figure out which
dependencies are required for which steps. Gimme one command I can
copy/paste to get all the npm crap.

Change-Id: I31d8ab2111728b37f125bc502c27923d858224bf
This commit is contained in:
Dave Borowitz
2017-10-24 15:35:21 -04:00
parent c390d5526c
commit 45692323db

View File

@@ -1,26 +1,47 @@
# PolyGerrit
## Installing [Node.js](https://nodejs.org/en/download/)
The minimum nodejs version supported is 6.x+
```sh
# Debian experimental
sudo apt-get install nodejs-legacy
# OS X with Homebrew
brew install node
```
All other platforms: [download from
nodejs.org](https://nodejs.org/en/download/).
## Installing [Bazel](https://bazel.build/)
Follow the instructions
[here](https://gerrit-review.googlesource.com/Documentation/dev-bazel.html#_installation)
to get and install Bazel.
## Installing [Node.js](https://nodejs.org/en/download/) and npm packages
The minimum nodejs version supported is 6.x+
```sh
# Debian experimental
sudo apt-get install nodejs-legacy
sudo apt-get install npm
# OS X with Homebrew
brew install node
brew install npm
```
All other platforms: [download from
nodejs.org](https://nodejs.org/en/download/).
Various steps below require installing additional npm packages. The full list of
dependencies can be installed with:
```sh
sudo npm install -g \
eslint \
eslint-config-google \
eslint-plugin-html \
fried-twinkie \
polylint \
typescript \
web-component-tester
```
It may complain about a missing `typescript@2.3.4` peer dependency, which is
harmless.
If you're interested in the details, keep reading.
## Local UI, Production Data
This is a quick and easy way to test your local changes against real data.
@@ -78,18 +99,7 @@ bazel build polygerrit &&
## Running Tests
One-time setup:
```sh
# Debian/Ubuntu
sudo apt-get install npm
# OS X with Homebrew
brew install npm
# All platforms (including those above)
sudo npm install -g web-component-tester
```
This step requires the `web-component-tester` npm module.
Run all web tests:
@@ -123,11 +133,7 @@ with a few exceptions. When in doubt, remain consistent with the code around you
In addition, we encourage the use of [ESLint](http://eslint.org/).
It is available as a command line utility, as well as a plugin for most editors
and IDEs. It, along with a few dependencies, can also be installed through NPM:
```sh
sudo npm install -g eslint eslint-config-google eslint-plugin-html
```
and IDEs.
`eslint-config-google` is a port of the Google JS Style Guide to an ESLint
config module, and `eslint-plugin-html` allows ESLint to lint scripts inside
@@ -149,13 +155,9 @@ Some useful commands:
* To run the linter on all of your local changes:
`git diff --name-only master | xargs eslint --ext .html,.js`
We also use the polylint tool to lint use of Polymer. To install polylint,
We also use the `polylint` tool to lint use of Polymer. To install polylint,
execute the following command.
```sh
npm install -g polylint
```
To run polylint, execute the following command.
```sh
@@ -168,10 +170,7 @@ A few notes to ensure that these tests pass
- Any functions with optional parameters will need closure annotations.
- Any Polymer parameters that are nullable or can be multiple types (other than the one explicitly delared) will need type annotations.
A few dependencies are necessary to run these tests:
``` sh
npm install -g typescript fried-twinkie
```
These tests require the `typescript` and `fried-twinkie` npm packages.
To run on all files, execute the following command:
@@ -191,4 +190,4 @@ bazel test //polygerrit-ui/app:template_test_<TOP_LEVEL_DIRECTORY> --test_arg=<V
```sh
bazel test //polygerrit-ui/app:template_test_change-list --test_arg=gr-change-list-view --test_output errors
```
```