From 2a87ec67afc7a7c23b415aa5dfe35ef4990d9da2 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Tue, 24 Mar 2026 11:49:05 +0100 Subject: [PATCH] Front-end fixes --- .gitignore | 3 ++ tests/e2e/integration.spec.js | 54 +++++++++++++++++++++++++++++++++++ web/build.mjs | 14 ++++++++- web/src/css/critical.css | 46 +++++++++++++++++++++++++++++ web/src/css/style.css | 33 +++++---------------- web/src/index.html | 18 ++---------- 6 files changed, 125 insertions(+), 43 deletions(-) create mode 100644 web/src/css/critical.css diff --git a/.gitignore b/.gitignore index a237787..449034a 100644 --- a/.gitignore +++ b/.gitignore @@ -42,5 +42,8 @@ tests/e2e/test_firmware.zip # NickelMenu build artifacts nickelmenu/kobo-config/ +# Proposals +proposals/ + # Claude .claude diff --git a/tests/e2e/integration.spec.js b/tests/e2e/integration.spec.js index 1126a20..ccf4f8b 100644 --- a/tests/e2e/integration.spec.js +++ b/tests/e2e/integration.spec.js @@ -1150,3 +1150,57 @@ test.describe('Custom patches', () => { await expect(page.locator('#step-connect')).not.toBeHidden(); }); }); + +// ============================================================ +// Build output +// ============================================================ + +test.describe('Build output', () => { + const path = require('path'); + const distDir = path.join(__dirname, '..', '..', 'web', 'dist'); + + test('CSS cache-bust hash is present on style.css link', async () => { + const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); + expect(html).toMatch(/css\/style\.css\?h=[0-9a-f]{8}/); + }); + + test('JS cache-bust hash is present on bundle.js script', async () => { + const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); + expect(html).toMatch(/bundle\.js\?h=[0-9a-f]{8}/); + }); + + test('critical CSS is inlined with :root tokens', async () => { + const html = fs.readFileSync(path.join(distDir, 'index.html'), 'utf-8'); + // :root block should be inside an inline ` + ); + // Remove all