openpencil/packages/fig/scripts/smoke-dist.ts
Danila Poyarkov 85c3c8fad1 refactor(fig): own NodeChange export policy
- Move SceneGraph-to-NodeChange conversion, text payload assembly, and blob encoding into @open-pencil/fig\n- Inject core glyph outline lookup through an explicit runtime service\n- Centralize neutral font naming in scene-graph and retain core IO/runtime orchestration
2026-07-18 02:41:35 +03:00

28 lines
902 B
TypeScript

export {}
const mod = await import('../dist/index.js')
const instanceOverrides = await import('../dist/instance-overrides.js')
const nodeChange = await import('../dist/node-change.js')
if (
mod.FIG_PACKAGE_STATUS !== 'archive-api' ||
typeof mod.effectiveFigmaRawNodeFields !== 'function' ||
typeof mod.parseFigBuffer !== 'function' ||
typeof mod.writeFigArchive !== 'function' ||
typeof instanceOverrides.populateAndApplyOverrides !== 'function' ||
typeof nodeChange.convertLineHeight !== 'function' ||
typeof nodeChange.sceneNodeToKiwi !== 'function'
) {
throw new Error('Expected @open-pencil/fig archive API exports')
}
const bytes = mod.writeFigContainer({
schemaDeflated: new Uint8Array([1]),
dataRaw: new Uint8Array([2])
})
const document = mod.readFigContainer(bytes)
if (document.dataRaw[0] !== 2) {
throw new Error('Expected @open-pencil/fig container round-trip')
}