-
Notifications
You must be signed in to change notification settings - Fork 1
Setting up a dev environment
This details setting up a dev environment on a Mac; if you're setting up on another system and find incompatibilities, we will update with alternate procedures.
The goal with this setup is to have our development target for foundry running on the local system with Node, a separate foundry data directory, and the sinless-foundry-system repo present. We'll symlink the sinless-foundry-system repo into our data directory. This setup leaves our structure only lightly coupled and leaves the flexibility to install and use different versions of foundry and Node as needed.
- Foundry version 12.328
- Node v20.12.1
- fnm as your node manager, installed via
brew
- You own a Foundry license and have a foundryvtt.com login
This is the overall directory structure we will be using. Creation of it is laid out step-by-step below, but here's a reference so you can see where we're headed:
foundry
├── 12.328 # can be multiple directories with foundry versions at this level, if needed
├── server_data
│ └── v11 # can be multiple directories with foundry data at this level, if needed
└── start_current.sh
sinless-foundry-system # cloned from remote
├── CHANGELOG.md
├── LICENSE.txt
├── README.md
└── (rest of the repo contents)
-
Clone this repo into your root project directory with
git clone [email protected]:CommanderTso/sinless-foundry-system.git
-
Create foundry directory structure
mkdir -p foundry/12.328 mkdir -p server_data/v11
-
Install a Node manager if you need one. fnm is a great candidate (make sure you do the step to add it to your shell's rc file and source that).
-
Install Node with
fnm install v20.12.1
-
Install Foundry by getting a timed download link for the NodeJS Foundry package. You can get this link from the Download Software page at https://foundryvtt.com/. Install with:
cd foundry wget -O FoundryVTT-12.328.zip "PASTED-URL-FROM-FOUNDRY-WEBSITE-HERE" unzip FoundryVTT-12.328.zip -d 12.328
-
Create a bash script in
foundry
calledstart_current.sh
(or whatever you like) to start up your Foundry server locally. Don't forget tochmod +x
if needed to make it executable. Script contents:#! /bin/bash /opt/homebrew/bin/fnm use v20.12.1 node <your_root_project_directory>/foundry/12.328/resources/app/main.js --dataPath=<your_root_project_directory>/projects/foundry/server_data/v11/data
-
Start up Foundry with your bash script so it will initialize the data directories, then shut it down. On a Mac, you may need to allow the process in the Security settings; you'll get a popup if you need to do that.
-
Symlink in the Sinless system module directory:
cd <your_root_project_directory>/foundry/server_data/v11/data/Data/systems` ln -s <your_root_project_directory>/sinless-foundry-system
-
You should be all set! Running
start_current.sh
should bring up Foundry onlocalhost:30000
, and the Sinless system module should be present in the Systems tab. -
Optional - in VS code with this setup, any Foundry level objects will get linter errors as not being defined. Following ChaosOS' advice in the Foundry discord, you can symlink the foundry code directory (
foundry/12.328
) into the system module's module directory (sinless-foundry-system/module
). VS Code will then take advantage of the symlink to utilize the checked-in jsconfig.json to look at the Foundry code for IntelliSense stuff.