- Reporting bugs
- Requesting features
- Contributing code
- Setting up a development installation
- Setting up a development environment
- Testing
- Linting
- Check that the bug hasn't been reported in an existing issue. View similar issues to the left of the submit button.
- Make sure you are running the latest version of the program. Click "Check for Update" in the bottom left corner.
- If you've found an issue with offence or defence calculations, make sure you check the breakdown for that calculation in the Calcs tab to see how it is being performed, as this may help you find the cause.
- Select the "Bug Report" issue template and fill out all fields.
- Please provide detailed instructions on how to reproduce the bug, if possible.
- Provide a build share code for a build that is affected by the bug, if possible. In the "Import/Export Build" tab, click "Generate", then "Share" and add the link to your post.
Build share codes allow us to reproduce bugs much more quickly.
Feature requests are always welcome. Note that not all requests will receive an immediate response.
- Check that the feature hasn't already been requested. Look at all issues with titles that might be related to the feature.
- Make sure you are running the latest version of the program, as the feature may already have been added. Click "Check for Update" in the bottom left corner.
- Select the "Feature Request" issue template and fill out all fields.
- Be specific! The more details, the better.
- Small requests are fine, even if it's just adding support for a minor modifier on a rarely-used unique.
- Familiarise yourself with the code base here to get you started.
- There is a Discord server for active development on the fork and members are happy to answer your questions there. If you are interested in joining, send a private message to any of Cinnabarit#1341, LocalIdentity#9871, Yamin#5575 and we'll send you an invitation.
- Pull requests must be created against the
dev
branch, as all changes to the code are staged there before merging tomain
. - Make sure that the changes have been thoroughly tested!
Note: This tutorial assumes that you are already familiar with Git.
Clone the repository using this command:
git clone -b dev https://github.com/Vilsol/go-pob.git
We require you to use Go version 1.21 or above.
To build the WASM binary, you can use the following command:
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -v -o frontend/static/go-pob.wasm ./wasm
To re-generate any new typings that have been exposed from Go, you can use this:
go generate -tags tools -x ./...
We require NodeJS version 18.4.0
which can either be installed via nvm
or via installer.
We also use the pnpm
package manager.
You can install all frontend dependencies using:
pnpm i
And then start the dev server via:
pnpm run dev
Note: This tutorial assumes that you are already familiar with the development tool of your choice.
If you want to use a text editor, Visual Studio Code (proprietary) is recommended. All you need are the Go and Svelte extensions.
If you want to use an IDE instead, GoLand (for backend) and WebStorm (for frontend) are recommended.
PoB uses the builtin Go testing platform together with testza framework.
All tests are run twice, first time in native Go, second time through WASM to ensure that nothing breaks on either deployment.
Simply executing go test ./...
from the project root directory should run all tests.
First ensure that you have the appropriate NodeJS version installed. (current version can be seen in devbox.json)
Then you should be able to execute all tests using ./.github/wasm_test.sh
script.
If any of these linters fail, the CI build will not pass.
The backend is linted using golangci-lint
. You can execute it via golangci-lint run
The frontend is linted using prettier
, eslint
and svelte-check
. You can execute those by using pnpm run lint
and pnpm run check
You want to clone the dev
branch of this repo https://github.com/Vilsol/PathOfBuilding (important, as it's pinned to specific commit)
After that, simply running devbox run install
will setup emmylua and then devbox run launch
will run PoB with a debugger.
Then add the following config in your local clone under .vscode/launch.js
and run the debugger via VSCode UI:
{
"version": "0.2.0",
"configurations": [
{
"type": "emmylua_new",
"request": "launch",
"name": "Debug",
"host": "localhost",
"port": 9966,
"ext": [
".lua",
".lua.txt",
".lua.bytes"
],
"ideConnectDebugger": true
}
]
}
In general, follow Go's best practices.
If you are using regex, make sure that you precompile it instead of creating a new one every time. (as Go's regex implementation runs in linear time)