// 把 registry 原版组件复制进 renderer(保持 beautifului.dev 原始源码) import { mkdir, copyFile } from 'node:fs/promises' const stage = new URL('./beautifului/stage/', import.meta.url) const root = new URL('../apps/desktop/src/renderer/src/components/', import.meta.url) await mkdir(new URL('atoms/', root), { recursive: true }) await mkdir(new URL('primitives/', root), { recursive: true }) const verbatim = [ ['Button.tsx', 'atoms/Button.tsx'], ['GlideMenu.tsx', 'primitives/GlideMenu.tsx'], ['LoadingState.tsx', 'primitives/LoadingState.tsx'], ['ApprovalCard.tsx', 'primitives/ApprovalCard.tsx'] ] for (const [from, to] of verbatim) { await copyFile(new URL(from, stage), new URL(to, root)) console.log('copied', from, '->', to) }