Skip to content

@directededges/specs-cli v0.36.0

Latest

Choose a tag to compare

@nathanacurtis nathanacurtis released this 29 Oct 18:56
· 5 commits to main since this release

Breaking

  • A workspace that leaves a setting unset now resolves it to a new value for spec.format, spec.keys, spec.color, curation.preserveManualSelections and spec.collapsePrimitiveWrapper. Every workspace specs init scaffolded already writes four of the five, so only a hand-written settings.yaml that omitted them sees a change (ADR-112)

Added

  • Declaring objectProps in your figma conventions folds separator-named properties into one prop with named members — Margin.compact and Margin.expanded become a single margin (ADR-111). specs init scaffolds the block commented out. Dependency and prop analysis, visual manifests, version grading and generated CSS all read members rather than skipping them

  • A slot whose default content holds a text layer or a glyph now says so (ADR-102). The slotPrimitives figma convention is on unless you turn it off: $text/$glyph markers join the slot's anyOf wherever it already names a component, and the formatting that primitive content takes is recorded on the slot element. Set slotPrimitives: false in config/conventions/figma.yaml to stop; specs init scaffolds that off-switch commented out

    • The generated stylesheets carry that formatting, in both the React and custom-element sheets. Every rule is an ordinary declaration, never !important — it styles a slot's unstyled content, so anything you write for the content you pass in wins by ordinary cascade
    • On a slot that accepts a component as well as a primitive, only the inheriting properties are emitted — colour and typography. A glyph's fill and dimensions are withheld there, because nothing in the emitted markup distinguishes a component's own root from a primitive fill, and a rule strong enough to reach one would reshape the other. A mixed slot is the one case where the scaffolds still inline the formatting, because these withheld rules are the only ones that could have carried it

Changed

  • specs init writes every setting with a comment saying what that setting decides, rather than a comment describing the value you would get by changing it. Three settings are scaffolded on while the schema defaults them off, and the file says which three and why

Fixed

  • An invalid spec.collapsePrimitiveWrapper now warns and falls back to the default instead of silently turning the setting off

  • specs analyze styling lists tokens alphabetically in every set of the by-token report — variables, color styles, text styles and effect styles — instead of in the order the catalogue happened to reach them

  • specs analyze styling now reads the token references a name-shaped spec.tokens emits. Under TOKEN_NAME and FIGMA_NAME a reference serializes to the token's name alone, which the analysis skipped — so every styling report came out empty while the run reported success. Names are now matched against the fetched variables and styles, so these two profiles report what TOKEN reports

  • specs analyze styling says so when spec.tokens is a profile it cannot fully read. CUSTOM and the three FIGMA_SYNTAX_* profiles serialize references into shapes the analysis cannot recognise without reproducing the generator, and FIGMA_SYNTAX_* falls back to TOKEN for tokens with no code syntax — so the reports were quietly partial rather than obviously empty. A warning now names the setting and what it costs. A name-shaped profile with no fetched data files warns too, and points at specs fetch

Dependency updates

  • Your specs now record the formatting a slot's primitive content takes. Via @directededges/specs-from-figma 0.38.0, a slot whose default content holds a text layer or a glyph carries that formatting on the slot element and marks the primitive kinds it accepts — which is what the generated stylesheets in this release read. A slot whose only content is primitives names no accepted types at all, because listing them would declare a restriction your design never stated

  • A prop whose Figma name was changed by key formatting keeps a record of the original spelling. Via @directededges/specs-from-figma 0.38.0, that record is now written under naming: NONE as well, so a name is recoverable wherever formatting altered it. This matters more in this release than it used to: a separator-named property folded into an object prop puts a dot in the name, which no formatted key can reverse

  • A default slot is only marked on a slot that children actually go into. Via @directededges/specs-from-figma 0.38.0, a well-named prop bound to a text, instance, glyph or vector element is refused as the default slot, and the run warns with the prop name and the rule

  • The types behind all of it. Via @directededges/specs-schema 0.39.0: ObjectProp and its member-keyed values (ADR-111), ContentStyles for a slot's primitive formatting (ADR-102), and the five settings whose defaults changed (ADR-112)