()
| 57 | |
| 58 | // fallow-ignore-next-line complexity |
| 59 | async function main() { |
| 60 | for (const sub of ["studio", "docs", "templates", "skills", "docker"]) { |
| 61 | mkdirSync(join(DIST, sub), { recursive: true }); |
| 62 | } |
| 63 | mkdirSync(join(DIST, "commands"), { recursive: true }); |
| 64 | |
| 65 | const studioDist = resolve(CLI_ROOT, "..", "studio", "dist"); |
| 66 | await waitForStudioDist(studioDist); |
| 67 | copyDirContents(studioDist, join(DIST, "studio")); |
| 68 | |
| 69 | for (const tmpl of ["blank", "_shared"]) { |
| 70 | copyDir(join(CLI_ROOT, "src", "templates", tmpl), join(DIST, "templates", tmpl)); |
| 71 | } |
| 72 | |
| 73 | // Bundle warm-grain from the repo registry so the built CLI can scaffold it |
| 74 | // offline and CI smoke tests pick up PR-branch changes before merge to main. |
| 75 | const warmGrainSrc = join(REPO_ROOT, "registry", "examples", "warm-grain"); |
| 76 | if (existsSync(warmGrainSrc)) { |
| 77 | copyDir(warmGrainSrc, join(DIST, "templates", "warm-grain")); |
| 78 | } |
| 79 | |
| 80 | // Skills bundled into the published CLI. Branches don't all carry the same |
| 81 | // skills/ tree (it gets restructured), so each entry is existsSync-guarded: |
| 82 | // a missing skill dir warns + skips instead of crashing the build. |
| 83 | for (const skill of ["hyperframes", "hyperframes-cli", "gsap"]) { |
| 84 | const src = join(REPO_ROOT, "skills", skill); |
| 85 | if (!existsSync(src)) { |
| 86 | console.warn(`[build-copy] skill not found, skipping: skills/${skill}`); |
| 87 | continue; |
| 88 | } |
| 89 | copyDir(src, join(DIST, "skills", skill)); |
| 90 | } |
| 91 | |
| 92 | const dockerfile = join(CLI_ROOT, "src", "docker", "Dockerfile.render"); |
| 93 | if (existsSync(dockerfile)) { |
| 94 | cpSync(dockerfile, join(DIST, "docker", "Dockerfile.render")); |
| 95 | } |
| 96 | |
| 97 | const layoutAuditScript = join(CLI_ROOT, "src", "commands", "layout-audit.browser.js"); |
| 98 | if (existsSync(layoutAuditScript)) { |
| 99 | cpSync(layoutAuditScript, join(DIST, "commands", "layout-audit.browser.js")); |
| 100 | } |
| 101 | |
| 102 | const contrastAuditScript = join(CLI_ROOT, "src", "commands", "contrast-audit.browser.js"); |
| 103 | if (existsSync(contrastAuditScript)) { |
| 104 | cpSync(contrastAuditScript, join(DIST, "commands", "contrast-audit.browser.js")); |
| 105 | } |
| 106 | |
| 107 | const motionSampleScript = join(CLI_ROOT, "src", "commands", "motion-sample.browser.js"); |
| 108 | if (existsSync(motionSampleScript)) { |
| 109 | cpSync(motionSampleScript, join(DIST, "commands", "motion-sample.browser.js")); |
| 110 | } |
| 111 | |
| 112 | // Player bundles for the standalone browser player used by `present` and |
| 113 | // `play`. resolvePlayerPath/resolveSlideshowPath look for these alongside the |
| 114 | // built CLI (dist/<name>.global.js), so they must ship in the package — the |
| 115 | // monorepo-dev fallback paths don't exist once installed from npm. Without |
| 116 | // this, `npx hyperframes present` fails with "@hyperframes/player not found". |
no test coverage detected