test: 允许NapCat WebUI网关子域

This commit is contained in:
sunlei 2026-06-24 16:45:38 +08:00
parent 4a7bc96fde
commit 106fec6a62

View File

@ -60,6 +60,9 @@ describe('QQBot third-phase module boundaries', () => {
'infrastructure',
'schema',
]);
const moduleSpecificAllowedDirectories = new Map([
['napcat', new Set(['webui-gateway'])],
]);
const allowedRootFiles = new Set(['index.ts']);
const violations = ['core', 'plugin-platform', 'napcat'].flatMap(
@ -67,7 +70,10 @@ describe('QQBot third-phase module boundaries', () => {
listTopLevelEntries(moduleName)
.filter((entry) =>
entry.isDirectory
? !allowedDirectories.has(entry.name)
? !allowedDirectories.has(entry.name) &&
!moduleSpecificAllowedDirectories
.get(moduleName)
?.has(entry.name)
: !allowedRootFiles.has(entry.name) &&
!entry.name.endsWith('.module.ts'),
)