scmJS docs

Repository layout

What each folder and file at the top of the repository holds:

index.html      The editor's page, with the boot splash in plain markup
data.html       The Game Data page, on its own
install.html    The page another page of the site frames to install game data
src/
  atoms/        Jotai state: the open documents and their undo history, UI state, the dialog stack, preferences
  editor/       The edits: invertible change lists per layer, placement checks, settings transactions,
                save planning, validation, find, statistics
    modTerrain/ What a mod's tileset adds: borrowed and copied terrain, drawn borders, pieces, the tile sheet
  app/          The application around the map: the platform and the desktop bridge's types, storage,
                the log, preferences, commands and their keys, updates, release notes
  data/         Reference tables (tilesets, players, units, upgrades, techs, trigger definitions) and
                the names read out of the loaded game data
  gamedata/     Where the game files come from: the resolver, the browser's stored copies, extraction,
                data sets
  formats/
    chk/        The scenario: container reader, section registry, typed section codecs, new maps
    mpq/        .scm/.scx open and save on top of mopaq
    text/       Text encodings of the string table
    tileset/    Tileset decoding, the megatile atlas, the terrain catalogue, palette cycling
    dat/        units/flingy/sprites/images.dat, .tbl, GRP, PCX, .lo and iscript decoders
    units/      Unit tables, lazy sprite loading, the frame cache, team colours, the animator
    triggers/   The text trigger format (TrigEdit syntax)
  i18n/         The translator and the language catalogues (ko.json)
  lib/          Small general-purpose helpers
  pages/        The entry points of data.html and install.html
  plugins/      The plugin API (the contract), host, loader, defaults, registry
  services/     File pickers and saving, image export, the startup preload, Test Map, data-set switching
  hooks/        The React side of the tools, file actions, hotkeys, plugins, updates
  components/
    chrome/     Menu bar, toolbar, status bar, toasts, the debug console
    panels/     Left dock (layers and palettes), right dock (minimap, layers, properties), plugin panels
    viewport/   The map canvas: its draw passes, the drags, the context menu, the corner chips
    dialogs/    Every dialog, and the registry that lazy-loads them
    splash/     The splash screen
    ui/         Primitives: buttons, inputs, lists, tabs, the dialog frame, error boundaries
  styles/       Plain CSS, imported in order: tokens → base → ui → chrome → panels → viewport → dialogs → splash
desktop/        The Electron shell: main process, preload bridge, updater
cli/            The scmjs command line, built from the editor's code into one file (docs/cli.md)
core/           The @scm-js/core package: one entry file naming the editor's modules it exports (docs/core.md)
bot/            The @scm-js/bot package: the bot interface's types, copied from the play page's engine (docs/bots.md)
action/         The scmjs maps GitHub Action: Check Map and a pull request's changes for the maps in a repository
packaging/      The Scoop, winget and Homebrew recipes for the scmjs program, with placeholders a release fills in
trailer/        The demo video's script and shot list, recorded by scripts/trailer.mjs
scripts/        Extraction, vendoring, the desktop and docs builds, plugin typings, screenshots
tests/          vitest suites; tests/maps holds the maps they open, made by tests/support
e2e/            Browser tests: Playwright specs that drive the built editor
docs/           These documents, the release notes, the pictures
docker/         The container image
.claude/        The per-area design notes (internals/)
plugins/        Generated: the default plugins' source at their pinned versions (gitignored)
public/         Generated: the extracted game data (gitignored except its README and the icons)
fixtures/       Blizzard maps and archives used by tests (gitignored)
plugin-api/     Generated: the bundled plugin typings (gitignored)