Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 4.11 KB

File metadata and controls

86 lines (61 loc) · 4.11 KB

Local Dev Installation

This project has dependencies on Go >=1.25, protobuf-compiler and the corresponding Go plugins, and node >= 22.

Ubuntu

Do not use apt to install any dependencies, the versions they install are all too old. Script below will curl latest versions and install them.

# Standard Go installation script
curl -O https://dl.google.com/go/go1.25.4.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.25.4.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc
echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin' >> $HOME/.bashrc
source $HOME/.bashrc

cd tbc

# Install protobuf compiler and Go plugins
sudo apt update && sudo apt upgrade
sudo apt install protobuf-compiler
go get -u -v google.golang.org/protobuf
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# Install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 22

# Install the npm package dependencies using node
npm install

Docker

Alternatively, install Docker and your workflow will look something like this:

git clone https://github.com/wowsims/tbc-new.git
cd tbc-new

# Build the docker image and install npm dependencies (only need to run these once).
docker build --tag wowsims-tbc .
docker run --rm -v $(pwd):/tbc wowsims-tbc npm install

# Now you can run the commands as shown in the Commands sections, preceding everything with, "docker run --rm -it -p 8080:8080 -v $(pwd):/tbc wowsims-tbc".
# For convenience, set these as aliases in your shell config (e.g. ~/.bashrc):
alias TBC_CMD='docker run --rm -it -p 8080:8080 -v $(pwd):/tbc wowsims-tbc'
alias TBC_WATCH_CMD='docker run --rm -it -p 8080:8080 -p 3333:3333 -p 5173:5173 -e WATCH=1 -v $(pwd):/tbc wowsims-tbc'

# Generate protobuf files (required before first build)
TBC_CMD make proto

# ... do some coding on the sim ...

# Run tests
TBC_CMD make test

# ... do some coding on the UI ...

# Host a local site
TBC_CMD make host

Windows

If you want to develop on Windows, we recommend setting up a Ubuntu virtual machine (VM) or running Docker using this guide and then following the Ubuntu or Docker instructions, respectively.

If you prefer working natively:

With all the dependencies setup, you should be able to run the make commands and compile the project.

Mac OS

  • Docker is available in OS X as well, so in theory similar instructions should work for the Docker method
  • You can also use the Ubuntu setup instructions as above to run natively, with a few modifications:
    • You may need a different Go installer if go1.18.3.linux-amd64.tar.gz is not compatible with your system's architecture; you can do the Go install manually from https://go.dev/doc/install.
    • OS X uses Homebrew instead of apt, so in order to install protobuf-compiler you'll instead need to run brew install protobuf-c (note the package name is also a little different than in apt). You might need to first update or upgrade brew.
    • The provided install script for Node will not included a precompiled binary for OS X, but it's smart enough to compile one. Be ready for your CPU to melt on running curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash.