You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
62 lines
1.4 KiB
import { existsSync, readFileSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
|
|
const root = process.cwd();
|
|
|
|
const checks = [
|
|
{
|
|
file: 'build/active.html',
|
|
contains: 'Active',
|
|
reason: 'docs landing page'
|
|
},
|
|
{
|
|
file: 'build/active/get-started/installation.html',
|
|
contains: 'Bundle smoke',
|
|
reason: 'installation guide'
|
|
},
|
|
{
|
|
file: 'build/active/get-started/ai-agents.html',
|
|
contains: 'AI agent instructions',
|
|
reason: 'AI contributor guide'
|
|
},
|
|
{
|
|
file: 'build/active/security.html',
|
|
contains: 'Security',
|
|
reason: 'security page'
|
|
},
|
|
{
|
|
file: 'build/test/ecosystem.html',
|
|
contains: 'ecosystem',
|
|
reason: 'ecosystem test page'
|
|
},
|
|
{
|
|
file: 'build/manifest.webmanifest',
|
|
contains: 'Active',
|
|
reason: 'web manifest'
|
|
}
|
|
];
|
|
|
|
const failures = [];
|
|
|
|
for (const check of checks) {
|
|
const path = resolve(root, check.file);
|
|
|
|
if (!existsSync(path)) {
|
|
failures.push(`${check.file}: missing (${check.reason})`);
|
|
continue;
|
|
}
|
|
|
|
const body = readFileSync(path, 'utf8');
|
|
if (!body.toLowerCase().includes(check.contains.toLowerCase())) {
|
|
failures.push(`${check.file}: did not contain "${check.contains}" (${check.reason})`);
|
|
}
|
|
}
|
|
|
|
if (failures.length > 0) {
|
|
console.error('active static smoke failed:');
|
|
for (const failure of failures) console.error(`- ${failure}`);
|
|
process.exitCode = 1;
|
|
} else {
|
|
console.log(`active static smoke: ${checks.length} generated assets verified`);
|
|
}
|