Skip to content

v0.9.3

Choose a tag to compare

@github-actions github-actions released this 29 Oct 11:41
682788e

This release speeds up asset export, makes exported sizes predictable, reads more node data, and fixes the node types tree prints.

Export many nodes from one decode

export used to decode the whole .fig for every node, which made exporting hundreds of frames slow. --frames now exports a list of nodes from a single decode:

figlens export design.fig --frames ids.txt --out-dir exports --format png --scale 2

The list has one node id per line, and - reads it from stdin. Each node is written to <dir>/<nodeId>.<format> (: becomes -). The command prints one JSON line per id: the usual export output plus nodeId, or {nodeId, error}. The export options are the same as for a single export, and a list can hold at most 10,000 ids.

Export at the layout box

By default, an export covers everything the node draws. Shadows, outside strokes and overflowing children can therefore make the image larger than the frame. Every export now reports layoutBox (the node's own box) and renderBox (what it draws). When the two differ, warnings names what reaches past the frame.

When the asset must fill its layout slot exactly, add --bounds layout (MCP: bounds: "layout"). The export is then cut to the node's own box.

Per-side stroke weights

A stroke with a different weight on each side, such as a bottom-only divider, used to read as strokeWeight: 0 and disappear from exports. nodes and inspect now emit individualStrokeWeights ({top, right, bottom, left}), and export and preview draw each side at its own weight.

tree --json carries size and visibility

tree --json now includes the following, so you can classify frames without a second nodes call:

  • size: [width, height], the same values find and nodes print.
  • visible: false: on hidden layers only.
  • layoutMode: on auto-layout frames.

The text output and the existing JSON keys are unchanged.

tree prints the same node types as nodes and find

Behavior change. tree and the preview layer tree used to print the raw stored type, so a component appeared as SYMBOL and a component set as FRAME. They now print the REST types that nodes, find and inspect already use:

Before Now
SYMBOL COMPONENT
FRAME (component set) COMPONENT_SET
FRAME (resize-to-fit group) GROUP
ROUNDED_RECTANGLE RECTANGLE

Update any script that filters tree output by the old names.

Inlining exported SVGs

Exported SVGs draw in page coordinates under one root <g transform>, and their definition ids are scoped to the node. Tools that rename ids can break this. For example, SVGO's default cleanupIds renames them to a, b, …, so when several such SVGs are inlined into one page, a later icon picks up an earlier one's clip and vanishes. Keep the root transform, and use prefixIds or disable cleanupIds. The skill and docs now say so.

Update

figlens update
# or
brew upgrade runkids/tap/figlens
# or
npx @runkids/figlens@0.9.3 --version