https://www.reddit.com/r/HermitCraft/comments/10wksaw/hctcg_online/
Use Node.js 16-18 (19+ is not supported).
If you don't have Node.js yet we recommend using nvm.
- First, you must install packages using
npm ci- use this instead ofnpm installto avoid unneccesary changes in package-lock.json - The client is compiled, so must be built before use with
npm run build - The server can then be run using
npm run startornpm run server - Whilst developing, it may be useful so run the client or server such that they reload if you make a change. This can be done by running
npm run client:devandnpm run server:devrespectively.
You can configure your instance using the config/server-config.json file.
| Key | Description |
|---|---|
| port | Server port |
| clientDevPort | Port for vite client server |
| clientPath | Path for the client build used |
| cors | Useful when testing on local network or when your server runs on a different domain |
| world | Identifier for your instance when tracking stats |
| limits | Limits for players' decks |
| logoSubText | Animated text to show next to logo |
| botUrl | Url to report game results to |
| version | Version displayed on the client |
We run lint/prettier/tsc as part of the PR process. However if you want to avoid back and forth we recommend adding a pre-commit hook that will test this for you locally every time you create a new commit:
npm run huskyWe also recommend to run prettier on save in your editor, this is an example configuration using the prettier extension for VSCode: