This commit is contained in:
Mateusz Gruszczyński committed 2026-10-21 14:39:51 +02:00
1 parent e037190c14
commit 5cb3b37627
37 files changed
+1031 -138

No files matched your search

+7 -6
View File
@@ -7,7 +7,8 @@ const assert = require('node:assert/strict');
const root = path.resolve(__dirname, '..');
const read = file => fs.readFileSync(path.join(root, file), 'utf8');
const active = read('src/admin/web/style.css');
const unused = read('src/admin/web/unused.css');
// Review-only archives are intentionally optional in reproducible source ZIPs.
const unused = fs.existsSync(path.join(root, 'src/admin/web/unused.css')) ? read('src/admin/web/unused.css') : null;
const docs = read('src/admin/web/docs.css');
const archived = [
'auth-ip-card', 'certificate-dialog', 'config-columns', 'overview-grid',
@@ -18,7 +19,7 @@ const archived = [
for (const name of archived) {
const cssClass = new RegExp(`\\.${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?![-\\w])`);
assert.ok(!cssClass.test(active), `${name} must not remain in the active stylesheet`);
assert.ok(cssClass.test(unused), `${name} must be reviewable in unused.css`);
if (unused !== null) assert.ok(cssClass.test(unused), `${name} must be reviewable in unused.css`);
}
for (const name of ['vh-setting-section', 'dashboard-overview-grid', 'vh-override-fields',
'refresh-settings-grid', 'docker-backend-ip-settings', 'acl-profile-layout']) {
@@ -29,7 +30,7 @@ for (const file of [
'src/admin/panel_assets.rs', 'src/admin/documentation.rs',
]) assert.ok(!read(file).includes('unused.css'), `${file} must not load or serve unused.css`);
assert.ok(!/@import[^;]*unused\.css/.test(active));
assert.match(unused, /NOT INCLUDED by the admin panel/);
if (unused !== null) assert.match(unused, /NOT INCLUDED by the admin panel/);
assert.match(docs, /\.swagger-ui \.opblock/);
for (const style of ['square', 'subtle', 'rounded', 'extra']) {
assert.ok(active.includes(`html[data-corner-style=${style}]`));
@@ -37,10 +38,10 @@ for (const style of ['square', 'subtle', 'rounded', 'extra']) {
}
for (const name of ['app-startup-spin', 'app-startup-reveal']) {
assert.ok(active.includes(`@keyframes ${name}`));
assert.ok(!unused.includes(`@keyframes ${name}`));
if (unused !== null) assert.ok(!unused.includes(`@keyframes ${name}`));
}
assert.ok(!active.includes('--backdrop-soft'));
assert.ok(!active.includes('var(--panel-strong)'));
assert.ok(!active.includes('var(--border)'));
assert.match(read('CHANGELOG.md'), /CSS maintenance:/);
console.log('CSS used/unused segregation, asset isolation and corner-style regression: PASS');
// The review-only CSS history is not a runtime or packaging dependency.
console.log('CSS active/optional archive isolation and corner-style regression: PASS');