test: 允许NapCat WebUI网关子域
This commit is contained in:
parent
4a7bc96fde
commit
106fec6a62
@ -60,6 +60,9 @@ describe('QQBot third-phase module boundaries', () => {
|
|||||||
'infrastructure',
|
'infrastructure',
|
||||||
'schema',
|
'schema',
|
||||||
]);
|
]);
|
||||||
|
const moduleSpecificAllowedDirectories = new Map([
|
||||||
|
['napcat', new Set(['webui-gateway'])],
|
||||||
|
]);
|
||||||
const allowedRootFiles = new Set(['index.ts']);
|
const allowedRootFiles = new Set(['index.ts']);
|
||||||
|
|
||||||
const violations = ['core', 'plugin-platform', 'napcat'].flatMap(
|
const violations = ['core', 'plugin-platform', 'napcat'].flatMap(
|
||||||
@ -67,7 +70,10 @@ describe('QQBot third-phase module boundaries', () => {
|
|||||||
listTopLevelEntries(moduleName)
|
listTopLevelEntries(moduleName)
|
||||||
.filter((entry) =>
|
.filter((entry) =>
|
||||||
entry.isDirectory
|
entry.isDirectory
|
||||||
? !allowedDirectories.has(entry.name)
|
? !allowedDirectories.has(entry.name) &&
|
||||||
|
!moduleSpecificAllowedDirectories
|
||||||
|
.get(moduleName)
|
||||||
|
?.has(entry.name)
|
||||||
: !allowedRootFiles.has(entry.name) &&
|
: !allowedRootFiles.has(entry.name) &&
|
||||||
!entry.name.endsWith('.module.ts'),
|
!entry.name.endsWith('.module.ts'),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user