Merge pull request #2703 from coreos-inc/update-readme-add-yarn-dependency

Update README With How to Add a Yarn Dependency
This commit is contained in:
Alec Merdler 2017-06-14 15:19:42 -07:00 committed by GitHub
commit 165486180d

View file

@ -55,12 +55,13 @@ High-level features include:
2. [Local Scripts](#local-scripts) 2. [Local Scripts](#local-scripts)
3. [Development inside Docker](#development-inside-docker) 3. [Development inside Docker](#development-inside-docker)
4. [Adding a Python Dependency](#adding-a-python-dependency) 4. [Adding a Python Dependency](#adding-a-python-dependency)
5. [Running the Build System](#running-the-build-system) 5. [Adding a Yarn Dependency](#adding-a-yarn-dependency)
6. [To run individual tests](#to-run-individual-tests) 6. [Running the Build System](#running-the-build-system)
7. [To run individual tests](#to-run-individual-tests)
1. [Pytest](#pytest) 1. [Pytest](#pytest)
2. [Tox](#tox) 2. [Tox](#tox)
7. [Running Migrations](#running-migrations) 8. [Running Migrations](#running-migrations)
8. [How to run a build with tests for a push or merge](#how-to-run-a-build-with-tests-for-a-push-or-merge) 9. [How to run a build with tests for a push or merge](#how-to-run-a-build-with-tests-for-a-push-or-merge)
4. **[Documentation](#documentation)** 4. **[Documentation](#documentation)**
1. [Architecture at a Glance](#architecture-at-a-glance) 1. [Architecture at a Glance](#architecture-at-a-glance)
2. [Terminology](#terminology) 2. [Terminology](#terminology)
@ -206,6 +207,23 @@ pip freeze > requirements.txt
pyenv uninstall quay-deps pyenv uninstall quay-deps
``` ```
### Adding a Yarn Dependency
We use [Yarn](https://yarnpkg.com/) for frontend dependency management. The `yarn.lock` file ensures
that we get consistant version installs using the `yarn install` command. However, new dependencies
should be added using `yarn add <npm package>`. This will add an entry to `package.json` and `yarn.lock`.
Occassionally there will be merge conflicts with `yarn.lock`. To resolve them, use the following (taken
from [here](https://github.com/yarnpkg/yarn/issues/1776#issuecomment-269539948).
```sh
git rebase origin/master
git checkout origin/master -- yarn.lock
yarn install
git add yarn.lock
git rebase --continue
```
### Running the Build System ### Running the Build System
TODO TODO