Repository navigation
Developer Reference
This page is a quick-reference companion to Developer Guide.
Use this page when you already know you are working on the module and need a fast answer to questions like:
- where does this kind of change usually live?
- what folder should I inspect first?
- am I looking at source content or generated output?
- what should I test first after I change this?
This page is meant to be:
- fast to scan
- useful while coding or tracing a bug
- focused on “where do I look?” and “what else does this change touch?” rather than step-by-step teaching
If you are brand new to the repo, read Developer Guide first.
The SW5e Module is an SW5E implementation for DND5e, so most changes live at the boundary between:
- FoundryVTT core
- the DND5e system
- SW5E-specific patches, templates, styles, localization, and content
When debugging or implementing a change, do not ask only “what file is wrong?” Ask:
- is the problem in data preparation?
- rendering or templates?
- styles or theme scoping?
- localization?
- migration or normalization?
- compendium source data?
-
scripts/: runtime logic, hooks, migrations, feature mechanics, custom apps -
scripts/patch/: DND5e-to-SW5E integration layer -
templates/: Handlebars UI structure -
styles/: LESS and built CSS -
languages/: localization -
packs/_source/: editable compendium source -
packs/: generated compendium output -
utils/: build and normalization helpers
- edit source content, not generated output
- prefer helper-based resolution over hardcoded module IDs or legacy paths
- assume migration matters if the feature touches existing content
Likely files:
scripts/patch/blaster-reload.mjsscripts/patch/blaster-ammo-ux.mjs
First runtime surfaces to test:
- weapon row Reload control
- private Reload card
- Attack, Rapid, and Burst with empty or partial ammo
Likely files:
scripts/patch/power-bonuses.mjsscripts/powercasting-overrides.mjsscripts/power-casting-ability-config.mjs
First runtime surfaces to test:
- actor power save DCs
- actor power attack rolls
- Configure Powercasting app
- Active Effect bonus paths
Likely files:
scripts/starship-system-damage.mjsscripts/starship-destruction-saves.mjsscripts/starship-conditions.mjsscripts/starship-token-status.mjsscripts/patch/starship-sheet.mjs
First runtime surfaces to test:
- starship
Core | Inventory | Features | Effects | Descriptiontabs - System Damage pips
- Destruction Save tray
- token HUD icon sync
Likely files:
scripts/theme.mjsstyles/less/theme-overrides.lessstyles/less/rest-activity-dialog-theme.lessstyles/less/active-effect-config-theme.less
First runtime surfaces to test:
- manual theme setting changes
- actor and item sheets
- themed dialogs
- icon-only controls and dropdowns
Check:
languages/en.json- relevant templates
- prep code that supplies labels
Check:
templates/- then the render or prep layer that supplies the template
Check:
scripts/patch/*- feature-specific runtime files
- related data prep
Check:
styles/less/*scripts/theme.mjs- scope-application hooks
Check:
- migration
- normalization
- whether the older item needs refresh or re-import
Check:
- whether you rebuilt packs
- whether the wrong layer is actually being tested
Useful scripts:
npm run lintnpm run build:stylesnpm run build:dbnpm run build:jsonnpm run build:clean
Important reminder:
-
npm run build:dbrequires Foundry to be fully stopped
When you need context beyond this quick page, use:
CHANGELOG.mddocs/actor-sheet-tabs.mddocs/weapon-property-status.md- Developer Guide
- Local Setup and Workflow
- Testing & Contribution
When debugging a module issue, move in this order:
- classify the issue as runtime, template, style, localization, content, or migration
- compare against a known-good built-in example when possible
- inspect the source-of-truth location before touching generated output
- test both the visible UI result and the actual in-play behavior
- if older content is involved, assume migration may be part of the story until proven otherwise
If you want the shortest useful summary of this page, it is this:
-
scripts/is usually behavior -
templates/is usually structure -
styles/is usually presentation -
languages/is usually visible text -
packs/_source/is editable content - the 1.3.8 hotspots are blasters, powercasting, starships, and themes
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.