Repository navigation
Local Setup and Workflow
TLDR
packs/_source/is editable content;packs/is generated output- LESS changes need
npm run build:styles- compendium changes need Foundry stopped, then
npm run build:db, then a Foundry restart- code, template, localization, and built CSS changes usually need only a browser reload
This guide is for working on the sw5e-module repository in a practical local setup.
It focuses on:
- where the module lives in Foundry
- which folders are safe to edit
- when you need a browser reload, a style rebuild, or a pack rebuild
- which commands you will use most often
- what to check if a change does not show up
For broader project structure and contributor expectations, use:
Unless a task says otherwise, assume this repo is being worked on with:
- Foundry VTT v13.x
- DND5e v5.2.5
-
lib-wrapperenabled in the test world
Foundry loads modules from its Data/modules/ folder.
On Windows, many contributors use a junction or symlink so the Git repository can stay in a normal working folder while still appearing to Foundry as:
Data/modules/sw5e-module
The important rule is that the Foundry-side module directory must be named sw5e-module.
These folders are normal places to make changes:
-
packs/_source/for compendium source data -
scripts/for module behavior and compatibility patches -
applications/for custom application code -
templates/for sheet or UI templates -
styles/for LESS and CSS styling -
languages/for localization text -
icons/for images and assets -
README.mdanddocs/for documentation
-
packs/because it is generated output -
node_modules/because it is installed automatically
The most important source-of-truth rule is:
- edit
packs/_source/ - build into
packs/
npm run lintnpm run build:stylesnpm run build:dbnpm run build:jsonnpm run build:clean
npm run lint
Checks the repo’s current lint or type expectations.
npm run build:styles
Builds the LESS sources into the shipped CSS output.
npm run build:db
Builds the editable compendium JSON in packs/_source/ into Foundry-ready compendium data in packs/.
npm run build:json
Extracts built compendium data back into JSON source files.
npm run build:clean
Cleans and normalizes compendium source data.
npm run build:db requires Foundry to be fully stopped.
This is one of the most important workflow rules in the project, because Foundry can hold a LevelDB lock on packs/ while it is running.
This is one of the most useful practical distinctions in the whole workflow.
Use:
- a browser reload of Foundry
This is the common path for:
scripts/templates/languages/styles/module.css
Use:
npm run build:styles- then a browser reload of Foundry
Changing LESS alone is not enough, because Foundry reads the built CSS, not the raw LESS source.
Use:
- fully stop Foundry
- run
npm run build:db - restart Foundry
For pack changes, a normal browser reload is not enough.
- edit the relevant file in
packs/_source/ - fully stop Foundry
- run
npm run build:db - restart Foundry
- open the affected compendium entry and confirm the change appears
- edit the relevant file
- if you changed LESS, run
npm run build:styles - browser-reload Foundry
- test the feature that changed
Unless a task says otherwise, a good default test setup is:
- Foundry VTT
13 -
dnd5e5.2.5 -
lib-wrapperinstalled and enabled - a normal test world using the standard
dnd5esheets
If you also use other sheet or UI modules, mention that when reporting problems because they can change how the module behaves.
After changes, the most useful things to verify are:
- the module loads without startup errors
- actors and items open normally
- powers and maneuvers appear in the expected sheet areas
- compendium entries open and import correctly
- any edited item, class, feat, species, or monster shows the expected data in Foundry
For broader testing expectations and contribution discipline, use Testing & Contribution.
I edited something but nothing changed in Foundry
Check whether you changed:
-
packs/_source/, which needsnpm run build:dband a Foundry restart - LESS, which needs
npm run build:stylesbefore a browser reload - ordinary code or templates, which usually need only a browser reload
Foundry is open and build:db failed
Close Foundry fully and run the build again.
I am not sure which file to edit
Use this shortcut:
- compendium entry change ->
packs/_source/ - sheet behavior change ->
scripts/orapplications/ - visible layout change ->
templates/orstyles/ - wording or labels ->
languages/
For a broader “where does this kind of change usually live?” map, use Developer Reference.
When asking for help with this repo, include:
- what you were trying to change
- the compendium entry, actor, item, or feature involved
- what you expected to happen
- what actually happened
- whether you already ran the needed build or reload step
- whether the problem happens in a plain
dnd5eworld with onlylib-wrapperand this module enabled
SW5e Module Wiki
Start here: Home · Getting Started · Feature Overview · Sheets & Features
Popular topics: Blaster Reload and Ammo Use · Themes and Appearance · Starship Sheet Guide · Powercasting Configuration and Overrides
Need help? Troubleshooting · FAQ · Compatibility & Limitations
Working on the module? Developer Guide · Developer Reference · Local Setup and Workflow · Testing & Contribution
For general FoundryVTT help, please use the Foundry VTT Discord, Baileywiki’s Foundry VTT playlist, or Encounter Library’s Foundry VTT Basics playlist.