Extend Luma-style dark theme to two more Enact web overlays: - com.webos.app.notificationcenter: dark pills, transparent compositor, notification-specific components - com.webos.app.gameoptimizer: same plus GameItem, GameButton, GameSwitch, GamePanel custom components Rename build.js → build.cjs (ESM compat) and update to build all three themes from a single script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const APPS = [
|
|
'com.palm.app.settings',
|
|
'com.webos.app.notificationcenter',
|
|
'com.webos.app.gameoptimizer',
|
|
];
|
|
|
|
const outDir = path.join(__dirname, 'dist');
|
|
fs.mkdirSync(outDir, { recursive: true });
|
|
|
|
for (const app of APPS) {
|
|
const srcPath = path.join(__dirname, app + '.js');
|
|
if (!fs.existsSync(srcPath)) {
|
|
console.log('SKIP:', app, '(source not found)');
|
|
continue;
|
|
}
|
|
|
|
const code = fs.readFileSync(srcPath, 'utf8');
|
|
|
|
let minified = code
|
|
.replace(/\/\/[^\n]*/g, '')
|
|
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
.replace(/\n\s*\n/g, '\n')
|
|
.replace(/^\s+/gm, '')
|
|
.replace(/\n/g, '')
|
|
.replace(/ +/g, ' ');
|
|
|
|
console.log(app + ':');
|
|
console.log(' Original:', code.length, 'bytes');
|
|
console.log(' Minified:', minified.length, 'bytes');
|
|
|
|
const minPath = path.join(outDir, app + '.min.js');
|
|
fs.writeFileSync(minPath, minified);
|
|
|
|
const b64 = Buffer.from(minified).toString('base64');
|
|
const b64Path = path.join(outDir, app + '.b64');
|
|
fs.writeFileSync(b64Path, b64);
|
|
console.log(' Base64: ', b64.length, 'bytes');
|
|
}
|