// Working on the brand

Building

Every asset is generated by scripts/build.ts, which runs each brand's art: scripts/art/ draws the studio, Raptor, NeoSkript, MostWanted and the plugins, airfields-brand.ts Airfields and badges.ts the badges, from the colours, marks and copy in each scripts/<brand>-brand.ts. Needs Node 24 and pnpm. pnpm install is all the setup there is: every font comes from npm.

pnpm install
pnpm build            # regenerate every asset (only what changed)
pnpm dev              # rebuild on every save, and refresh the preview
pnpm preview          # write .preview/index.html: every asset, what changed marked
pnpm check            # rebuild everything, and fail if anything committed is out of date
pnpm verify           # type check, and the checks below
pnpm test             # unit tests (test/)
pnpm build:plugins    # only the plugin family, its cards and the badges
pnpm build:airfields  # only Airfields
pnpm build:badges     # only the badges
pnpm build:logos      # only logo/ and people/: needs Ethnocentric

Fonts

The build outlines every letter, so no font ever ships. The faces are all OFL and installed from npm (Fontsource): JetBrains Mono, Space Grotesk, Geist, Geist Mono, Hanken Grotesk, Lilita One and Figtree. scripts/fonts.ts lists which file each one is, and Renovate keeps them current.

Ethnocentric is the exception: it's licensed, so it's never in the repo. It draws only the logos in logo/ and the initials in people/, with pnpm build:logos. Every other graphic that shows XENA STUDIOS reads it back from the committed logo/ files (scripts/logo.ts), so pnpm build and CI never need it. To redraw the logos, put your licensed copy at .local-fonts/Ethnocentric-Regular.otf (git ignores the folder), run pnpm build:logos, then pnpm build so everything showing them follows.

To use another copy of any font, set its path with one of these: ETHNOCENTRIC, MONO, MONO_LIGHT, MONO_SEMIBOLD, HANKEN_BOLD, GROTESK_BOLD, GEIST_BOLD, GEIST_MONO, LILITA, FIGTREE.

How the build works

  • Each graphic is an SVG drawn in code, then rendered to its PNG with resvg. Rendering is nearly all of the time, so a PNG is only rendered when its SVG changed, and renders run on every CPU core (scripts/output.ts). A build where nothing changed takes about a second; --force renders everything (about 20 seconds).
  • The Airfields pixel scene is the slowest single thing, so it's skipped when neither its script nor the wordmark changed. Its stamp is in .cache/, which git ignores.
  • Running the build twice changes nothing. Each SVG's ids start with its own path, so a file only changes when its graphic does.
  • Commit the generated files with the change that produced them.
  • The scripts are TypeScript that Node runs directly, so there's no compile step. Stick to syntax Node can strip (no enums, namespaces or parameter properties). tsconfig.json enforces this.

Reviewing a change

pnpm dev rebuilds whenever a script changes and rewrites .preview/index.html: every image, grouped by folder, with what changed since the last commit marked and an Only changed switch, on a dark, light or checkerboard background. On a pull request, GitHub's Files tab also compares each changed PNG with its old version (2-up, swipe and onion skin).

Releasing

A release is a tag, vX.Y.Z, with notes, and it's what other repos and Modrinth pages link (see Linking files). When main has changes worth releasing, run Actions → Release → Run workflow. It checks main builds clean, then scripts/release.ts works out the version from the Conventional Commits since the last release: a breaking change (feat!:, or BREAKING CHANGE: in the body) is a major release, a feat: a minor one, anything else a patch. It tags main and publishes the notes, grouped by kind, as a GitHub release, with xena-studios-press-kit.zip attached: the logos and avatar, every brand's logos and icons, the colour tokens, the brand guides, the licence and the notices. Link the latest release to anyone who asks for a press kit.

Once the release is out, the workflow builds brand.xenastudios.co from the tagged commit and deploys it (below), so the site always shows the latest release.

pnpm release:notes shows what the next release would be, without releasing.

A breaking change is one that breaks something that links or reads these files: a file renamed, moved or removed, a token renamed, or the catalog's shape changed (which also bumps its version).

The site

brand.xenastudios.co is the guides and files as a website: a page per brand with its guide, every colour and every file to download, the badges with their HTML, and the press kit. It's a static Astro site in site/, its own pnpm project, styled like xenastudios.co. It has no content of its own: the pages read docs/, tokens/ and the files at build time, so writing a guide or adding a file here is all it takes.

cd site
pnpm install
pnpm dev      # http://localhost:4321
pnpm build    # copy the files in, type-check, build to dist/
  • A guide's links work on both: a link to another guide goes to its page, a link to a file to the copy the site serves (at its path here, such as /raptor/icon.png), and anything else to GitHub at the release.
  • site.yml deploys it to the xena-brand Cloudflare Worker. The Release workflow runs it after each release; run Actions → Site → Run workflow to redeploy the latest release with the site as it is on main, after a change to the site alone.
  • The Cloudflare token is in the production environment, which only main can use. static/_headers sets a strict CSP: no scripts and no inline styles.

CI

check.yml runs on every pull request, and main requires it:

  • verify: pnpm verify and pnpm test. Besides the type check, verify fails when:
    • an SVG doesn't render or has no PNG beside it, a token file doesn't parse, or a doc shows or links a file that isn't there;
    • the plugin catalog is out of date or doesn't match its schema;
    • two accents in the studio look alike, under 0.07 apart in OKLab;
    • a brand's text or secondary text is under 4.5:1 on its backgrounds, its accent under 3:1, or its daylight accent under 4.5:1 on its light background;
    • a brand is missing its icon, banner, social preview or (with a website) favicon;
    • a file a platform takes isn't the size it wants or is over its upload limit: the 64×64 Minecraft server icon, GitHub's social preview (1280×640, under 1 MB), Modrinth's icon (under 256 KB), link previews, the Discord banner, the X header and README banners.
  • rebuild: pnpm check, so the committed files have to be exactly what the build makes. If it fails, run pnpm build and commit what changed.
  • site: builds brand.xenastudios.co, since a change to a guide, a token or a file can break a page. It isn't required, so a site problem never blocks an asset fix.

CodeQL (codeql.yml) scans the scripts and workflows.

Files that aren't generated

  • raptor/official/ is copied from the raptor repo: docs-site/src/assets/logo-dark.svg and logo-light.svg, site/public/favicon.svg and site/public/og.png. Refresh it when Raptor's logos or link preview change.
  • mostwanted/official/ is copied from the mostwanted repo. See MostWanted.