fix(GOV-009): 完成最终复审整改

This commit is contained in:
2026-08-13 18:51:14 +08:00
parent 3a8120a33a
commit cb550e3d5c
15 changed files with 197 additions and 8 deletions
@@ -108,6 +108,20 @@ const value: Internal | undefined = undefined;
assert.match(result.stderr, /IllegalView\.vue/);
});
test('拒绝 Vue 外部 script src 绕过源码边界', async () => {
const repositoryRoot = await createFixture();
await writeFile(
path.join(repositoryRoot, 'web/src/ExternalScript.vue'),
`<script setup lang="ts" src="../../server/libs/internal.ts"></script>\n<template><main /></template>\n`,
);
const result = await runChecker(repositoryRoot);
assert.equal(result.exitCode, 1);
assert.match(result.stderr, /禁止使用外部 script src/);
assert.match(result.stderr, /ExternalScript\.vue/);
});
test('接受只消费公开 OpenAPI 类型的 Web 工程', async () => {
const repositoryRoot = await createFixture();
await writeFile(