import fs, {readFileSync} from 'fs'; import path from 'path'; import {$} from 'bun'; // @ts-ignore outside project import * as seo from '../convert/app/seo'; await $`bunx turbo "@remotion/convert#build-spa" "@remotion/brand#bundle" "@remotion/example#bundle-testbed"`; const dir = path.join(__dirname, '../convert/spa-dist/client'); fs.cpSync(dir, path.join(__dirname, './build/convert'), {recursive: true}); const brandDir = path.join(__dirname, '../brand/build'); fs.cpSync(brandDir, path.join(__dirname, './build/brand'), {recursive: true}); const testbedDir = path.join(__dirname, '../example/build-testbed'); fs.cpSync(testbedDir, path.join(__dirname, './build/testbed'), {recursive: true}); fs.cpSync( path.join(__dirname, './build/convert/convert-service-worker.js'), path.join(__dirname, './build/convert-service-worker.js'), ); const extraPages: seo.RouteAction[] = []; for (const inputs of seo.inputContainers) { for (const outputs of seo.outputContainers) { extraPages.push({ input: inputs, output: outputs, type: 'convert', }); } extraPages.push({ type: 'rotate-format', format: inputs, }); extraPages.push({ type: 'mirror-format', format: inputs, }); extraPages.push({ type: 'crop-format', format: inputs, }); extraPages.push({ type: 'resize-format', format: inputs, }); } const contents = path.join(dir, 'index.html'); // Replace the text in