fix(GOV-009): 完成脚手架审查整改

This commit is contained in:
2026-08-13 18:30:57 +08:00
parent dcdf634457
commit 3a8120a33a
47 changed files with 752 additions and 101 deletions
@@ -89,6 +89,25 @@ test('拒绝通过 tsconfig 路径别名依赖 Server', async () => {
assert.match(result.stderr, /Web 禁止依赖 Server/);
});
test('拒绝 Vue 单文件组件脚本越界依赖 Server', async () => {
const repositoryRoot = await createFixture();
await writeFile(
path.join(repositoryRoot, 'web/src/IllegalView.vue'),
`<script setup lang="ts">
import type { Internal } from '../../server/libs/internal';
const value: Internal | undefined = undefined;
</script>
<template><main>{{ value }}</main></template>
`,
);
const result = await runChecker(repositoryRoot);
assert.equal(result.exitCode, 1);
assert.match(result.stderr, /Web 禁止依赖 Server/);
assert.match(result.stderr, /IllegalView\.vue/);
});
test('接受只消费公开 OpenAPI 类型的 Web 工程', async () => {
const repositoryRoot = await createFixture();
await writeFile(