Guides
Point Calque at your component library and Figma INSTANCE nodes become real imports —
not div-soup, not hallucinated @/components/Whatever when you provided priors.
// without --repo → weak fallback (demos only)
import { Button } from '@/components/Button'
// with --repo, Button found at src/ui/button.tsx
import { Button } from '@/src/ui/button'
Calque never executes your code. The scanner walks TypeScript/TSX:
PascalCase names onlytsconfig paths aliases; --alias sets import prefix (default @)bun run calque scan-index --repo ./src --out calque.index.json --json
# or during convert
bun run calque convert design.json --repo ./src --out ./generated
| Level | Signal | Result |
|---|---|---|
| L2 | INSTANCE name normalize (Button/Primary → Button) | Real import + declared props only |
| L3 | Loop hole props ⊆ component props, unique tightest cover | Real import + map call |
| L4 | Explicit calque.map.json | Forced binding (can override L3) |
| L0 | No index / unmatched rich loop | Local function Card / defineComponent |
When an index or map is provided, unmatched INSTANCEs are not imported as fake paths — bindings drop to plain layout tags. Zero priors still use the weak fallback so demos work.
index or index_jsonfiles[] into the projectDeep dive: Context Ladder · file schemas: Index · map · context.