feat(design-data)!: nest token lifecycle fields under lifecycle object - #1325
Conversation
Restructure cascade token deprecation/lifecycle metadata into a nested `lifecycle` object (introduced, deprecatedIn, deprecatedComment, replacedBy, plannedRemoval), matching the component schema's existing nested pattern. The old flat `deprecated` field read as boolean-ish even though it held a version string, and diverged from components. Also backfills the `deprecated: "unknown"` migration placeholder left over from the legacy->cascade migration with the real @adobe/spectrum-tokens release version for all 1,323 affected tokens, recovered from CHANGELOG history and git archaeology. Legacy output (@adobe/spectrum-tokens) is unchanged (verified byte-identical) — deprecated/deprecated_comment/renamed stay flat there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: e8b6a68 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
Run report for e8b6a683Total time: 3m 19s | Comparison time: 5m 12s | Estimated savings: 1m 53s (36.4% faster)
Expanded report
Changed files |
🎨 Token Changes ReportTokens Changed (0)Original Branch: This comment was automatically generated by the token diff tool. 🤖 |
🧩 Component Schema Changes ReportNo component schema changes detected.This comment was automatically generated by the component schema diff tool. 🤖 |
…d objects
diff_recursive's Added/Deleted branches never recursed into nested
objects, reporting one blob change for the whole subtree instead of
per-field leaf paths. This violated spec/diff.md's own normative rule
("comparison MUST be recursive... changes reported at the leaf level
with full dot-separated paths") whenever an object-valued key was
wholly added or removed — previously latent since deprecated/
deprecated_comment/replaced_by were flat scalar fields, but now
material since #1325 nested them under one `lifecycle` object.
Add record_added/record_deleted helpers that decompose a wholly-new or
wholly-removed subtree into individual leaf-level property_changes
entries, matching the granularity already used for updated (both-sides-
present) keys. Updates the three affected diff conformance fixtures
accordingly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Thanks for the thorough review — responding to all three points: 1. Diff-report granularity changeConfirmed and fixed in e8b6a68, rather than just documented. Traced this down: it wasn't actually specific to Fix: added Also had an agent trace every consumer of 2.
|
Description
Restructures cascade token deprecation/lifecycle metadata into a nested
lifecycleobject (
introduced,deprecatedIn,deprecatedComment,replacedBy,plannedRemoval), matching the component schema's existinglifecyclepattern. Theold flat
deprecatedfield held a version string but read as boolean-ish, anddiverged from the component schema's naming.
Also backfills the
deprecated: "unknown"migration placeholder (left over from thelegacy→cascade migration) with the real
@adobe/spectrum-tokensrelease version forall 1,323 affected tokens, recovered from CHANGELOG history and git archaeology.
Changes
packages/design-data-spec/schemas/token.schema.json: new$defs.lifecycle,referenced from
tokenWithValue/tokenWithRefin place of the 5 removed flat fields.packages/design-data-spec/schemas/component.schema.json: renamedlifecycle.deprecated→lifecycle.deprecatedInso token and component schemas match.packages/design-data/tokens/*.tokens.json(7 of 8 files): 1,323 tokens migratedinto the nested shape, with real deprecation versions backfilled.
packages/design-data/scripts/{backfill-deprecated-versions,migrate-lifecycle-nesting}.js:new re-runnable migration scripts.
sdk/core/src(legacy.rs,migrate.rs,diff.rs,authoring/{lifecycle,session}.rs,validate/rules/spec0{10,11,12,13,14,36,37}.rs): cascade↔legacy conversion, diff pairing,and validation rules retargeted to
lifecycle.*.packages/design-data-spec/spec/{token-format,authoring-workflow,evolution}.md:documentation updated for the nested shape.
packages/design-data-spec/conformance/updated to match.Legacy output (
@adobe/spectrum-tokens) is unchanged —deprecated/deprecated_comment/renamedstay flat there; verified byte-identical.Motivation and Context
deprecatedon a token is a version string (e.g."14.5.0"), not a boolean, but theflat name reads like one. The component schema already solved this with a nested
lifecycleobject; tokens were the odd one out. The spec is still1.0.0-draft, sothis breaking rename is cheapest now, before external consumers pin to it.
How Has This Been Tested?
cargo test --workspace— 1257 passed, 2 ignored (includes ~30 conformance-fixturetest modules covering SPEC-010–014/036/037 validation, diff pairing, and legacy
generation round-trips).
cargo clippy --workspace -- -D warnings— clean.cargo fmt --all— applied.moon run design-data:validate-dataset— clean (only pre-existing unrelatedSPEC-050 warnings).
moon run design-data:legacy-output— byte-identical to the committedpackages/tokens/src/*.json(verified via direct binary diff, bypassing moon cache).moon run design-data:roundtrip-verify— "Roundtrip OK".token-diff-generatorandtoken-changeset-generatorAVA suites — green, zeroedits needed (they operate on legacy-format output, which is unaffected).
node tools/changeset-linter/src/cli.js check --fail-on-warnings) — passes.Types of changes
Checklist