import { cp, mkdir, rm, writeFile } from 'node:fs/promises'; const root = new URL('../', import.meta.url); const out = new URL('dist/', root); await rm(out, { recursive: true, force: true }); await mkdir(new URL('labs/hex-video/', out), { recursive: true }); await mkdir(new URL('src/', out), { recursive: true }); for (const name of ['index.html','lab.js','lab.css','fixture.js','designv2.md','designv2.html','README.md','reference']) { await cp(new URL(name, root), new URL('labs/hex-video/'+name, out), { recursive: true }); } for (const name of ['core.js','geometry.js','path-math.js']) { await cp(new URL('../../src/'+name, root), new URL('src/'+name, out)); } await cp(new URL('../../Design.md', root), new URL('Design.md', out)); await writeFile(new URL('index.html', out), 'HEX Video Lab打开 HEX Video Lab'); console.log('Hex Video build ready in labs/hex-video/dist/');