You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update Tokens Studio pipeline documentation (#5167)
* docs: update Tokens Studio pipeline documentation
* docs: drop note about claude reviews on workflow PRs
* docs: add generated-output README and legacy-guide pointer
Copy file name to clipboardExpand all lines: documentation/agent-instructions/TOKENS_STUDIO.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ The CLI is `@tokens-studio/studio-cli` (binary name `studio`), installed as a **
50
50
```
51
51
52
52
- The `ref` can reference a `branch`, a `release`, or a `tag` — pin to a release for reproducible builds.
53
-
- Pull formats are `raw` (default), `dtcg`, and `css`. **There is no TypeScript pull format** — pull raw/DTCG JSON and generate TS locally, as the existing Style Dictionary build does for `build/ts/*`.
53
+
- Pull formats are `raw` (default), `dtcg`, and `css`. **There is no TypeScript pull or export format** — TS modules are generated locally by `packages/eds-tokens/scripts/generate-ts-tokens.mjs` (see § The release pipeline below).
54
54
-`studio config show` displays the config; `studio config remove <alias>` (alias `rm`) removes a source from `.studio.json`. It does **not** delete already-pulled token files — clean those up manually.
55
55
-`.studio.json` is meant to be committed for team consistency.
56
56
@@ -69,7 +69,14 @@ The CLI is `@tokens-studio/studio-cli` (binary name `studio`), installed as a **
69
69
|`studio exports run <name-or-id> --out <dir>`| Run a saved export configuration and write the output |
70
70
|`studio exports delete <name-or-id>`| Delete a saved export configuration (`--force` skips the confirmation prompt) — **destructive, remote**|
71
71
72
-
Export formats on the platform: CSS Variables, DTCG JSON, Raw JSON, and Figma Variables. Aliases: `studio pull` = `tokens pull`, `studio login`/`logout` = `auth login`/`logout`, `studio init` = `config init`. Global flags everywhere: `--json`, `--verbose`, `--host`.
-**Only the CSS export evaluates the platform's colour formulas** (`set_chroma(set_lightness(...))`) into concrete values. The DTCG export keeps raw `{alias}` references and unevaluated formulas — it is a structural interchange format, NOT "resolved tokens". Plan any downstream generation accordingly.
77
+
-**Reference export configurations by ID, not name, in anything automated.** A rename in the Studio UI silently breaks name-based `studio exports run` — this happened when `EDS` was renamed to `EDS-CSS` and would have failed the next release run.
78
+
-**`naming.prefix` (css config) must not include a trailing separator.** The schema example says `'ds-'`, but the CLI appends the casing separator itself: `eds-` produces `--eds--token` (double dash); use `eds`.
79
+
-**The `dtcg` format is config-less** — `exports schema --format dtcg` returns 404 and there are no templates. Create it with just `--format dtcg --name <name>`; it inherits the project's dimension/theme-group setup.
73
80
74
81
## Safety rubric
75
82
@@ -79,6 +86,15 @@ Classify every command before running it:
79
86
-**Edits or overwrites local files (fine in a clean git tree, mention it):**`tokens pull` without `--dry-run`, `exports run`/`exports preview --out`, `config init/add/remove` (edit `.studio.json` only).
80
87
-**Mutates remote state or credentials — always ask the user first:**`exports create/update/duplicate/delete`, `auth logout` (revokes and deletes stored credentials), and any push-like or write-scoped command that appears in future CLI versions. Remember the shortcut aliases (`studio logout` = `auth logout`) count too. When in doubt, treat a command as remote-mutating until `--help` proves otherwise.
81
88
89
+
## The release pipeline
90
+
91
+
`.github/workflows/tokens_studio_release.yaml` runs on every Tokens Studio release and opens/updates an automated PR (branch `tokens-studio-release`) with the full token state:
92
+
93
+
1.**Trigger:** the outbound **CI Trigger** in Studio (Integrations → CI Triggers, `eds-tokens-release`) sends a `repository_dispatch` event (type `tokens-release`) to this repo on `release.created`. It can be fired manually with its **Test** button.
94
+
2.**Auth:** the workflow authenticates back to Studio via GitHub OIDC against the inbound **CI Integration** (Integrations → CI Integration (Inbound); subject pattern `repo:equinor/design-system:ref:refs/heads/main`, read-only). The outbound trigger and the inbound integration are **separate configs** — a 403 `No matching CI integration found` from `studio ... --ci` means the *inbound* integration is missing or misconfigured, no matter how healthy the trigger looks.
95
+
3.**Steps:**`studio tokens pull` (raw token sets → `src/tokens/<alias>/`), `studio exports run` for the two saved configurations — `EDS-CSS` (css) and `EDS-DTCG` (dtcg), referenced by ID — into `src/tokens/css/` and `src/tokens/dtcg/`, then `pnpm run generate:ts-tokens` which combines DTCG structure with evaluated CSS values into TS modules in `src/tokens/ts/` (see the script header in `packages/eds-tokens/scripts/generate-ts-tokens.mjs` for the mechanics, including CSS Color 4 gamut mapping).
96
+
4.**Output:** all three directories are committed to the release PR. They are **generated — never edit them by hand**, and they are not yet wired into the package `exports` map.
97
+
82
98
## Staying current
83
99
84
100
The CLI and platform are young and move fast (v0.1.x as of the snapshot below). **Never answer Tokens Studio questions from memory alone.** In order of authority:
@@ -105,4 +121,4 @@ studio
105
121
└── flags --host --json --no-color --verbose
106
122
```
107
123
108
-
Known state in this repo at snapshot time: CLI installed as a devDependency of `packages/eds-tokens` and approved in `onlyBuiltDependencies`. `.studio.json` lives in `packages/eds-tokens`and is pulled in CI by `.github/workflows/tokens_studio_release.yaml`, triggered by the Tokens Studio CI integration (`repository_dispatch`, event type `tokens-release`) on every platform release. CI auth is OIDC (`id-token: write` + `--ci`) — no service token stored.
124
+
Known state in this repo at snapshot time: CLI installed as a devDependency of `packages/eds-tokens` and approved in `onlyBuiltDependencies`. `.studio.json` lives in `packages/eds-tokens`(single source alias `eds-test-3`, project `4952a007-699a-4124-a043-124e80cc28d6`, branch `main`, format raw — the test-phase alias/output is due a production-shaped rename). Two saved export configurations on the project: `EDS-CSS` (css, id `39d37416-632b-4f04-b49b-cfaec63e3baa`, prefix `eds`, split layout, density base comfortable) and `EDS-DTCG` (dtcg, id `019463d4-9bef-4e37-9425-6de80eec87c8`). CI auth is OIDC (`id-token: write` + `--ci`) — no service token stored. See § The release pipeline for the workflow chain.
> This guide covers the **legacy pipeline** (Figma REST sync + Style Dictionary),
6
+
> which still owns everything the `@equinor/eds-tokens` package publishes.
7
+
3
8
This guide provides a comprehensive walkthrough of the <abbrtitle="Equinor Design System">EDS</abbr> token system – from Figma setup through syncing, building, and implementation. It covers the complete token lifecycle and serves as documentation for working with design tokens in the EDS.
Copy file name to clipboardExpand all lines: packages/eds-tokens/CLAUDE.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
Design tokens package — CSS variables, JSON, and JS/TS outputs consumed by EDS components and product teams.
4
4
5
+
## Two pipelines coexist
6
+
7
+
The **legacy pipeline** below (Figma REST sync + Style Dictionary) still owns everything the package *publishes* (`build/`, the `exports` map). The **new Tokens Studio pipeline** writes generated output to `src/tokens/{<alias>,css,dtcg,ts}` via `.github/workflows/tokens_studio_release.yaml` — those directories are **generated, never edit them by hand**, and are not yet wired into the `exports` map. The TS modules are produced by `pnpm run generate:ts-tokens` (`scripts/generate-ts-tokens.mjs` — DTCG export for structure + CSS export for evaluated values; the script header documents the mechanics). Canonical pipeline doc: [`documentation/agent-instructions/TOKENS_STUDIO.md`](../../documentation/agent-instructions/TOKENS_STUDIO.md).
0 commit comments