fix(ci): harden build script and update test mocks

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-30 11:59:18 +00:00
1 parent 0ac0b6960d
commit 113b0a2b72
1 file changed
+18 -1
+18 -1
View File
@@ -38,7 +38,11 @@ function copyFile(src, dest) {
if (fs.existsSync(src)) {
fs.copyFileSync(src, dest);
} else {
console.warn(`Warning: Source file ${src} does not exist.`);
const message = `Error: Source file ${src} does not exist.`;
console.error(message);
if (['_headers', '_redirects', 'index.html'].includes(path.basename(src))) {
throw new Error(message);
}
}
}
@@ -74,6 +78,19 @@ function main() {
copyFile(file, path.join(DIST, file));
}
// Verify critical CSS generation
const generatedCss = path.join(DIST, 'css', 'tailwind.generated.css');
if (!fs.existsSync(generatedCss) && !fs.existsSync(path.join('css', 'tailwind.generated.css'))) {
// tailwind might output to dist/css OR css/ then we copy.
// The command is: -o css/tailwind.generated.css
// So it should be in source 'css/', then copied by copyDir('css'...)
// Let's verify it exists in source 'css/'
if (!fs.existsSync(path.join('css', 'tailwind.generated.css'))) {
console.error('Error: css/tailwind.generated.css was not generated.');
process.exit(1);
}
}
console.log('Copying directories...');
for (const dir of DIRS_TO_COPY) {
copyDir(dir, path.join(DIST, dir));