Skip to content

Commit

Permalink
chore: Run 'yarn install' when building (#215)
Browse files Browse the repository at this point in the history
I noticed when showing the development flow to a few engineers, there was one awkward step - you have to `cd site` and run `yarn install`, and then come back to root to `make build` or `./develop.sh`

This just adds `yarn install` as part of `make build` and `./develop.sh` - so whichever one is run first will start work.
  • Loading branch information
bryphe-coder committed Feb 9, 2022
1 parent c44d036 commit b6fcd81
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ provisionersdk/proto: provisionersdk/proto/provisioner.proto
.PHONY: provisionersdk/proto

site/out:
cd site && yarn install
cd site && yarn build
cd site && yarn export
.PHONY: site/out
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ This repository contains source code for Coder V2. Additional documentation:
- [`semantic.yaml`](./github/semantic.yaml): Configuration for [semantic pull requests](https://github.com/apps/semantic-pull-requests)
- `site`: Front-end UI code.

## Development

### Cloning

- `git clone https://github.com/coder/coder`
- `cd coder`

### Building

- `make build`

### Development

- `./develop.sh`

The `develop.sh` script runs the server locally on port `3000`, and runs a hot-reload server for front-end code on `8080`.

## Front-End Plan

For the front-end team, we're planning on 2 phases to the 'v2' work:
Expand Down
3 changes: 3 additions & 0 deletions develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function create_initial_user() {
http://localhost:3000/api/v2/user
}

# Run yarn install, to make sure node_modules are ready to go
yarn --cwd=./site install

# Do initial build - a dev build for coderd.
# It's OK that we don't build the front-end before - because the front-end
# assets are handled by the `yarn dev` devserver.
Expand Down

0 comments on commit b6fcd81

Please sign in to comment.