Skip to content

Set up a Development Environment

deukalion edited this page May 5, 2026 · 1 revision

The following software/versions are required for building and testing the system at the current time.

  • NodeJS v22.x

If you use the Visual Studio Code editor, a number of helpful extensions are recommended (but not required):

  • EditorConfig for VS Code
  • ESLint
  • i18n Ally
  • Prettier - Code formatter
  • Todo Tree

Installation

Check Out the Code

Check out the repository with either HTTPS or SSH:

HTTPS Checkout

git clone https://github.com/Muttley/foundryvtt-shadowdark.git

SSH Checkout

git clone git@github.com:Muttley/foundryvtt-shadowdark.git

Build the System

Change directory into the newly checked out repository and run the following steps:

Install NodeJS Modules

npm install

Build the System

npm run build

You should see something like the following output:

❯ npm run build

> build
> gulp build

[11:25:41] Using gulpfile ~/projects/foundryvtt-shadowdark/gulpfile.mjs
[11:25:41] Starting 'build'...
[11:25:41] Starting 'compileSass'...
[11:25:41] Starting 'compileLangs'...
[11:25:41] Starting 'lintJavascript'...
[11:25:41] Starting 'compileJavascript'...
[11:25:41] Finished 'compileSass' after 677 ms
[11:25:42] Finished 'compileLangs' after 722 ms
[11:25:42] Finished 'compileJavascript' after 1.66 s
[11:25:43] Finished 'lintJavascript' after 1.8 s
[11:25:43] Finished 'build' after 1.81 s

Link the System to Foundry

Change directory to the systems directory your Foundry VTT Data folder and create a symbolic link to the respitory system directory:

Linux or OS X
cd <foundry_data_folder>/systems
ln -s <repository_directory>/system shadowdark
Windows
cd %localappdata%\FoundryVTT\Data\systems
mklink /d shadowdark <reposity_directory>\system

Run Foundry VTT

Once the above steps are completed you should be able to run Foundry VTT and create a new World for the Shadowdark as you would for any other system.

Development Workflow

Within the repository you can run the following to compile the system and then watch files for changes:

npm run build:watch

This will allow you to make changes to the code within the repository and then just use F5 to refresh Foundry and pick up the changes for testing.

If you enable Hot Reloading in Foundry by passing the --hotReload command line parameter when starting it, then any CSS or i18n changes will automatically reloaded without any need to refresh the browser manually.

Improved Intellisense for Visual Studio Code

If you are using Visual Studio Code to edit code then you can improve the Intellisense provided as follows.

Copy the example-foundry-config.yaml file to foundry-config.yaml:

Linux or OS X
cp example-foundry-config.yaml foundry-config.yaml
Windows
copy example-foundry-config.yaml foundry-config.yaml

Edit this file and ensure that the installPath points to your Foundry VTT installation directory, and then run the following command:

npm run createSymlinks

This will create a gitignored directory called foundry in the repository.

Once this is done you can restart Visual Studio Code which will now be able to access this additional Intellisense.

See this Wiki article for more details: Foundry VTT Community Wiki - Improving Intellisense

Coding Style

Please use the existing code as a guide, as well as conforming to Editor Config and ESLint settings included within the repository.

There are a few golden rules which should be adhered to:

  • All files should be in UTF-8 format with LF end-of-lines
  • Tabs are used for indentation
  • Trailing whitespace should be trimmed before committing code

Other than that, use your best judgement and try to make your code as easy to read as possible, with sensible variable names, etc.

If you are a new developer, the Code Complete book by Steve Mcconnell is an excellent starting place.

Restrictions

The use of AI to generate code or assets for contribution is not permitted under any circumstances.

Clone this wiki locally