Skip to content

sync-agency-assets.mjs

Copies finished art from the external design-agency results directory into app/public/art, classifying each set by its own shape, and writes a manifest of what it copied.

Contributor toolingsync-agency-assets.mjs

What it does

Reads every art slug the client can request from the game's own catalog and art modules. Discovers finished sets under the external agency results directory, classifies each by its file shape (tide, body, resource, system-view, flat-hero, fleet-marker), and plans which files to copy into app/public/art.

Copies the headers and carapace-kit sets through their own hand-named conventions on top of that plan, and names every other directory app/public/art already holds that the pipeline above did not place. Writes the whole result to app/public/art/sync-manifest.json, and refuses to copy anything when the planned copy exceeds 500MB.

Usage

Needs a checkout of the design-agency results repository at D:/my-repos/grafted-wars-design-agency/results/wet-foundry. Without it, the tool reports and exits 1 rather than copying anything:

bash
node --import tsx tools/sync-agency-assets.mjs

Options

FlagValueWhat it doesDefault
--dry-runno valuePlans and reports the copy without copying any file, writing the manifest, or running the headers/carapace/legacy passes.Off. The bare invocation copies.

Inputs and outputs

Reads app/src/game/themes/aliens/art.mjs and app/src/game/data/index.mjs to know which slugs the client consumes, and the external agency directory D:/my-repos/grafted-wars-design-agency/results/wet-foundry (plus, for the carapace kit, D:/my-repos/grafted-wars-design-agency/results/ossifrage/carapace-kit) for the art itself. Without --dry-run, writes copied files under app/public/art and writes app/public/art/sync-manifest.json.

On success, exit 0. Prints how many sets were discovered, synced, and left unconsumed, and lists each unconsumed set by name and shape. Confirms the manifest write, or, with --dry-run, that nothing was copied or written.

On failure, exit 1, when the agency directory is absent (nothing to sync from) or the planned copy exceeds the 500MB size limit (reported instead of copied).

Examples

See what a sync would copy before committing to it (needs the agency checkout beside this repo):

bash
node --import tsx tools/sync-agency-assets.mjs --dry-run

Pull finished art out of the agency results into the tracked art tree:

bash
node --import tsx tools/sync-agency-assets.mjs

Notes

The art:check npm script runs node --import tsx tools/sync-agency-assets.mjs --check. This tool never reads a --check flag; it only checks process.argv for --dry-run. Running npm run art:check performs a full, live sync, not a dry run.

The paths to both the agency results directory and the carapace kit are hardcoded to this machine's checkout layout. This tool only does anything on a machine that carries the sibling grafted-wars-design-agency repository beside this one.

Source

tools/sync-agency-assets.mjs — part of Contributor tooling