English
Contributing
This guide covers developing the library itself. For consumer docs, start at Introduction.
Development setup
bash
git clone --recurse-submodules https://github.com/srtomy/uesp-eso-build-wrapper.git
cd uesp-eso-build-wrapper
npm install
npm testIf you cloned without --recurse-submodules:
bash
git submodule update --init --recursiveRunning tests
bash
npm test # all tests
npx vitest run tests/engine.test.ts # single file
npx vitest run --reporter=verbose -t "baseline" # by name patternTests run in a single fork (singleFork: true): the UESP engine writes to process globals and is not concurrency-safe.
Core principle
Never implement game formulas. All stat calculations are the exclusive responsibility of the vendored UESP engine (esoEditBuild.js). The wrapper's only job is to inject inputs into that engine and read back outputs. If a stat value seems wrong, the fix is always in the data fed to the engine — never in wrapper math.
Updating after a new ESO patch
Two sources change with each patch:
1. Engine scripts (vendor/uesp-esochardata/ submodule):
bash
cd vendor/uesp-esochardata
git fetch upstream && git merge upstream/master
cd ../..2. Game data (vendor/uesp-data/uesp-game-data.json):
bash
# self-contained: parse the UESP SQL dumps straight into uesp-game-data.json
npm run db:seed -- --dir /path/to/dumps --version <patch>
# (or seed local.db and run: npm run generate-data -- --db /path/to/local.db --version <patch>)Then:
- Commit the updated game data (including the
_metapatch marker) - Run
npm test - Update golden values in
tests/engine.test.tsif they changed intentionally (formula patch)
Validating against the UESP browser
scripts/browser-export-build.js runs inside the UESP Build Editor DevTools console and exports the full build — inputs and expected stats — as JSON.
- Open esobuilds.uesp.net, configure your build
- DevTools (F12) → Console → paste and run the script
- A
uesp-build-export.jsonfile downloads - Inspect with
npm run test:build path/to/uesp-build-export.json - Or drop it into
tests/fixtures/—tests/build-fixtures.test.tsauto-discovers it and asserts everyexpectedStatsvalue
Pull requests
- One feature or fix per PR
- All tests, lint and format must pass — CI is required to merge (see
docs/CI-PIPELINE.md) - Add or update tests for any behavior change
- Titles follow Conventional Commits (
feat:,fix:,chore:…)