Skip to content

feat(design-data): teach Figma export generator to honor name-mapping overrides (11k.5) - #1322

Merged
GarthDB merged 2 commits into
feat/figma-name-audit-11k.4from
feat/figma-mapping-overrides-11k.5
Jul 31, 2026
Merged

feat(design-data): teach Figma export generator to honor name-mapping overrides (11k.5)#1322
GarthDB merged 2 commits into
feat/figma-name-audit-11k.4from
feat/figma-mapping-overrides-11k.5

Conversation

@GarthDB

@GarthDB GarthDB commented Jul 31, 2026

Copy link
Copy Markdown
Member

Description

Stacked on #1321 (11k.4). Extends build_export_payload (and the internal
process_*/make_variable_action helpers) with an optional overrides: Option<&HashMap<String, String>> parameter — a legacyKey → Figma-name map.
When a token's legacyKey has an override, the generator emits that name
instead of the default {prefix}/{legacyKey}; absent or empty overrides
keep today's 1:1 behavior unchanged for every existing caller.

design-data figma export gains a --mapping <PATH> flag that loads the
override map from a figma audit artifact (reads its nested overrides
field) or a bare {legacyKey: name} JSON object, dropping any empty-string
placeholder entries (the audit's "needs a decision" markers).

Related Issue

spectrum-design-data-11k.5 (bd), depends on spectrum-design-data-11k.4 (#1321)

Motivation and Context

11k.4's audit produces an override scaffold for every naming divergence
between the generator and the real S2–Web file. This closes the loop: once
someone fills in real names for the scaffold's generated_only entries,
figma export --mapping <artifact> will actually emit them, moving the
generator from "1:1 by convention" toward "authoritative for the real file."

How Has This Been Tested?

  • New unit test in mapping.rs: one token with an override remaps to the
    override name; a second token with no override still gets the default
    {prefix}/{legacyKey} name.
  • All existing mapping.rs tests remain green, unchanged.
  • moon run sdk:build && moon run sdk:test && moon run sdk:lint (clippy
    -D warnings) all pass.
  • node tools/changeset-linter/src/cli.js check --fail-on-warnings passes.

Screenshots (if appropriate):

N/A — CLI/library change only.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2754ec2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@adobe/spectrum-design-data Minor
@adobe/spectrum-component-api-schemas Patch
@adobe/design-system-registry Patch
@adobe/design-data-agent-mcp Patch
@adobe/design-data-mcp Patch
markdown-generator Patch
@adobe/token-corpus-migrate Patch
@adobe/token-naming-audit Patch
component-options-editor Patch
@adobe/spectrum-design-data-mcp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🎨 Token Changes Report

Tokens Changed (0)

Original Branch: main


This comment was automatically generated by the token diff tool. 🤖

@github-actions

Copy link
Copy Markdown
Contributor

🧩 Component Schema Changes Report

No component schema changes detected.

This comment was automatically generated by the component schema diff tool. 🤖

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Run report for 2754ec28

Total time: 2m 50s | Comparison time: 3m 8s | Estimated savings: 17.6s (9.3% faster)

Action Time Status Info
⬛️ SetupProto(0.57.4) 0ms Skipped
🟩 SyncWorkspace 10.3ms Passed
🟩 SyncProject(sdk) 0.6ms Passed
⬛️ SetupToolchain(node:20.17.0) 157.2ms Skipped
⬛️ SetupToolchain(rust:1.88.0) 246.9ms Skipped
⬛️ SetupToolchain(pnpm:10.17.1) 120.2ms Skipped
⬛️ SetupToolchain(javascript) 0ms Skipped
⬛️ SetupEnvironment(javascript, sdk) 0.6ms Skipped
🟩 SetupEnvironment(rust, sdk) 137.4ms Passed
⬛️ InstallDependencies(rust, sdk) 2.6ms Skipped
🟩 RunTask(sdk:fmt-check) 1.2s Passed
🟩 InstallDependencies(javascript, sdk) 6.6s Passed
🟩 RunTask(sdk:codegen-check) 289.7ms Passed
🟩 RunTask(sdk:lint) 48.2s Passed
🟩 RunTask(sdk:test) 2m 43s Passed SLOW
Changed files
.changeset/figma-mapping-overrides.md
.changeset/figma-name-audit.md
sdk/Cargo.lock
sdk/README.md
sdk/cli/src/main.rs
sdk/core/src/figma/audit.rs
sdk/core/src/figma/mapping.rs
sdk/core/src/figma/mod.rs
sdk/core/tests/fixtures/figma/name-mapping.audit.json

… overrides (11k.5)

`build_export_payload` accepts an optional legacyKey -> Figma name override
map; `figma export` gains a `--mapping <PATH>` flag to load one from a
`figma audit` artifact. Absent or empty overrides preserve today's
{prefix}/{legacyKey} 1:1 naming.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Addresses review feedback on PR #1322 — documents the overrides param
on build_export_payload and notes that remapping an existing name
produces a CREATE rather than a rename.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@GarthDB
GarthDB merged commit fe338ee into main Jul 31, 2026
9 checks passed
@GarthDB
GarthDB deleted the feat/figma-mapping-overrides-11k.5 branch July 31, 2026 05:57
@GarthDB GarthDB mentioned this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant