scmJS docs

In the source

For developers. The extraction is one module shared by every route, and the drawing is under src/formats/:

File Does
src/gamedata/source.ts The search order above, as a chain over injected probes so tests/gamedata.test.ts can pin it without a browser.
src/gamedata/store.ts The browser's copies, in the Origin Private File System: gamedata/ for the game's own, gamedata-profiles/<id>/ per data set, a stamp file written last so a half-written copy counts as nothing.
src/gamedata/install.ts, zip.ts The two install routes. zip.ts reads a zip's directory and single members over HTTP ranges with no zip library; tests/zip.test.ts drives it over a zip built in the test.
src/gamedata/extract.ts The extraction: archives in as a ReadMember, a map of paths to bytes out, no file system and no network. It imports only iscript.ts, so Node runs it without a build step.
src/gamedata/extract.worker.ts, scripts/extract-*.mjs, desktop/main.ts The three places it runs: a browser worker, the Node scripts, the desktop's main process (which also holds the disk search and Test Map).
src/gamedata/archives.ts, scripts/lib/archives.mjs Opening the archives with mopaq, later archives winning, with a mod's loose files as an overlay; and finding them on disk.
src/gamedata/profiles.ts, src/services/gameData.ts Data sets: the id and name, the stored choice, and the switch that drops every decoded table and loads again.
src/data/gameNames.ts The per-entry naming rule; tests/names.test.ts pins the differences against the real files.
src/formats/tileset/ decode.ts for the five files, atlas.ts for the atlas, terrain.ts for the terrain catalogue read from the CV5, palette.ts for the terrain names, cycle.ts for the palette bands, doodads.ts for dddata.bin, load.ts for fetching and the per-tileset cache.
src/formats/dat/ Decoders for the .dat tables, .tbl, GRP, PCX, .lo and the iscript bytecode.
src/formats/units/ The unit tables and lazy sprite loading, the per-frame canvas cache with its byte budget, team colours, and the animator.
src/services/testMap.ts Test Map's browser half.

Two things to know before changing any of it. The manifests the extraction writes are what the loaders probe for, so changing what is extracted means re-running it and checking the app against the result, not only the tests. And tests/dat.test.ts, tests/iscript.test.ts, tests/animate.test.ts, tests/palette.test.ts and tests/tileset.test.ts run against the real files in public/ and skip when they are absent, so a green run on a clone without them has not exercised the decoders.