The @sypnia/design package
One npm package for reading tokens, running the check, serving the gallery and reading Design files.
| Import | For |
|---|---|
@sypnia/design/tokens | reading your tokens in code (for charts, canvas, e-mails): readTokens(), token('color.accent') |
@sypnia/design/check | running design check from your own scripts or tests |
@sypnia/design/gallery | serving the gallery from your own dev server |
@sypnia/design/files | reading and validating the [design] table of sypnia.toml, gallery.yaml, screen files and icon rules |
@sypnia/design/client | the API: proposals, renders, exports Cloud or your engine |
npx @sypnia/design | the CLI |
import { readTokens, token } from '@sypnia/design/tokens';
const t = await readTokens(); // reads design/tokens.json
t.color.accent.light; // "#E0A526"
token('color.accent'); // "var(--espiga-color-accent)"import { check } from '@sypnia/design/check';
const { errors, findings } = await check({ root: '.', renders: 'local' });import { createDesign } from '@sypnia/design/client';
const design = createDesign({ token: process.env.SYPNIA_DESIGN_TOKEN! }); // or { baseUrl } for your engine
const p = await design.proposals.create({ project: 'la-espiga', kind: 'tokens', reason: 'Darker accent for the counter tablet', changes: { 'color.accent': '#C98E12' } });The pieces themselves are not in this package: they are generated into your repository on top of @sypnia/base. ESM with types; Node 20 or later.