42b9cc2b64
Prettier: auto-formatted 103 files to fix baseline. Prettier check in CI is now a hard gate (removed continue-on-error). Brotli: installed libnginx-mod-http-brotli-filter/static. Enabled in nginx with brotli_static on for pre-compressed assets and comp_level 6. Sentry releases: deploy script now exports VITE_APP_VERSION=<git-short-sha> before building so each Sentry release maps to an exact commit. CI also passes github.sha as VITE_APP_VERSION. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
984 B
JavaScript
27 lines
984 B
JavaScript
import { readFileSync, writeFileSync } from 'fs';
|
|
import { fileURLToPath } from 'url';
|
|
import { join, dirname } from 'path';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const foldsPath = join(__dirname, '../node_modules/folds/dist/index.js');
|
|
|
|
try {
|
|
let content = readFileSync(foldsPath, 'utf8');
|
|
|
|
// Defensive guard: if src is not a function, render null instead of crashing
|
|
const original = 'children: src(filled)';
|
|
const patched = 'children: typeof src === "function" ? src(filled) : null';
|
|
|
|
if (content.includes(patched)) {
|
|
console.log('folds patch already applied.');
|
|
} else if (content.includes(original)) {
|
|
content = content.replace(original, patched);
|
|
writeFileSync(foldsPath, content, 'utf8');
|
|
console.log('Applied defensive Icon src guard to folds.');
|
|
} else {
|
|
console.warn('Warning: folds Icon patch target not found - may need updating.');
|
|
}
|
|
} catch (e) {
|
|
console.warn('Warning: Could not patch folds:', e.message);
|
|
}
|