Separate runtime manifest inputs from directly served files

This commit is contained in:
Jonathan Sykes
2026-10-09 14:40:46 +08:00
parent 0b8e398469
commit dd09f66578
5 changed files with 88 additions and 14 deletions

View File

@@ -88,3 +88,13 @@ test('layout-independent visibility and transport defaults stay in eager CSS',()
for(const selector of ['.stg-overlay','.deck-chips','.np-btn.done .i-save','.sleep-status .sl-ic','.ab-group','.mc-tune'])assert.ok(shared.includes(selector));
assert.ok(html.includes('href="layout-base.css"'));
});
test('runtime exclusion rules never remove shell or declared dynamic assets', async () => {
const { isRuntimeAsset } = await import('../server/asset-manifest.js');
const definition = JSON.parse(readFileSync(join(__dirname, 'assets.json'), 'utf8'));
for (const asset of new Set([...shell.filter(p => p !== '/'), ...Object.values(definition.groups).flatMap(g => g.files)])) {
assert.ok(isRuntimeAsset(asset, definition), `${asset} remains a runtime asset`);
}
for (const asset of ['/app.test.js', '/nested/probe.test.mjs', '/README.md', '/fonts/font-OFL.txt', '/admin.html', '/perf/fixture.js']) assert.equal(isRuntimeAsset(asset, definition), false, asset);
});