Skip to content

Releasing

A release is three things at once:

  1. A git tag vX.Y.Z on main.
  2. A deploy of this site from that commit. Cloudflare Pages builds every push to main, so the tag and the site agree.
  3. The downloads on this site (xg-tokens.css, xg-tokens.json, xg-ui.css, xg-ui.js, the kit and the brand pack), rebuilt from that commit.

The version number is version in package.json and is printed in the brand pack’s README.

Semantic versioning, applied to the class names, token names and data attributes:

Change Version
A fix that changes nothing anyone depends on; a new rule or page Patch 1.0.x
A new token, component, modifier or attribute; a changed value (a color, a radius) Minor 1.x.0
A renamed or removed token, class or attribute; a changed meaning Major x.0.0

A changed value is a minor, not a patch: products look different after it, so it is announced.

  • Patches any time, once npm test passes.
  • Minors when ready, at most monthly, with a changelog entry.
  • Majors announced one minor ahead, with the deprecations in place.

4. Status and version are two different things

Section titled “4. Status and version are two different things”

Each component has a status. The version says when something changed; the status says what the component promises.

Status Promise
Draft Being designed. Do not build on it.
Beta Usable today. A class name may still change in a minor release, with a note.
Ready Stable. Changes only in a major release, with a migration note.
Deprecated Has a replacement and a removal date: the major that removes it.

A component moves from Beta to Ready when it meets the bar, not at a release:

  1. It is used in a shipped product screen.
  2. All its states are in the workshop, in both brands and both modes.
  3. Its contrast pairs are in the measured set.
  4. It works with keyboard only and with a screen reader.
  5. Its markup has not changed for one minor release.

A rename or removal is never silent:

  1. The old name keeps working for at least one minor release, marked Deprecated on its page with the replacement.
  2. The changelog lists the old and new names side by side.
  3. The major release removes it, with a migration note at the top of its changelog entry.

The changelog has one entry per release: tokens, kit, brand, site. Write the entry in the pull request, under “Unreleased”, so the release only renames the heading.

Terminal window
# on main, with a clean tree
npm test # build, contrast, stated numbers
npm version minor # or patch / major: updates package.json and tags
git push origin main --tags # Cloudflare Pages deploys main

Then rename “Unreleased” in the changelog to the version and date if npm version did not.

Pages are served with Cache-Control: no-cache, so a returning visitor always gets the new HTML. Scripts and styles have content hashes in their names and are cached for a year; the new HTML points at the new names. A visitor never sees a page that references a file that no longer exists. Details are in the repository’s README.