Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: Run 'yarn install' when building #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long does the install take? seems like it'd slow down builds if we re-install every time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's already been installed (ie, already have a node_modules) - less than a second to validate dependencies:

yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.78s.

I think that 0.78s trade-off is worth it to make sure that the first-build always works for people on-boarding to the project (esp in the open-core world) - but let me know if you disagree

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that seems alright. I'd like to try switching to Yarn 3 and using the CJS resolution thing to see if it's faster, but that should be done separately

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