feat(packages): add poster component to video skins (#994)

This commit is contained in:
Sam Potts
2026-03-18 17:57:10 +11:00
committed by GitHub
parent b9bada9567
commit 59bbf6c209
45 changed files with 445 additions and 171 deletions
+8 -23
View File
@@ -1,27 +1,12 @@
import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync } from 'node:fs';
import { resolve } from 'node:path';
import { mirrorTemplatesToSrc, removeGeneratedSrcFiles } from './shared.js';
const root = resolve(import.meta.dirname, '..');
const templatesDir = resolve(root, 'templates');
const srcDir = resolve(root, 'src');
const created = await mirrorTemplatesToSrc();
const removed = await removeGeneratedSrcFiles();
/** Recursively copy template files into `src/`, preserving relative paths. */
function mirror(dir: string) {
for (const entry of readdirSync(dir)) {
const templatePath = resolve(dir, entry);
const targetPath = resolve(srcDir, templatePath.slice(templatesDir.length + 1));
if (statSync(templatePath).isDirectory()) {
mkdirSync(targetPath, { recursive: true });
mirror(templatePath);
continue;
}
if (!existsSync(targetPath)) {
copyFileSync(templatePath, targetPath);
console.log(`Created ${targetPath.slice(root.length + 1)}`);
}
}
for (const file of created) {
console.log(`Created ${file}`);
}
mirror(templatesDir);
for (const file of removed) {
console.log(`Removed generated ${file}`);
}