fix(ui): 完善界面交互与开发配置

This commit is contained in:
zhanjunhao
2026-11-18 19:09:00 +08:00
parent 381751a28d
commit ae7f773627
87 changed files with 2212 additions and 2823 deletions
+9 -5
View File
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
*/
import assert from 'node:assert/strict';
import { mkdtemp, readFile, writeFile, rm } from 'node:fs/promises';
import { mkdir, mkdtemp, readFile, writeFile, rm } from 'node:fs/promises';
import path from 'node:path';
import { createServer as createHttpServer } from 'node:http';
import { fileURLToPath } from 'node:url';
@@ -35,10 +35,11 @@ async function fixture(run) {
path.join(dir, 'vite.config.js'),
await readFile(path.join(root, 'vite.config.js')),
);
// vite.config.js 引用的旧内核 @layer 兜底插件(b7bac50b5)需同目录存在
// 保留 Vite 配置引用的构建插件目录结构。
await mkdir(path.join(dir, 'scripts/vite'), { recursive: true });
await writeFile(
path.join(dir, 'vite-plugin-legacy-css-layers.js'),
await readFile(path.join(root, 'vite-plugin-legacy-css-layers.js')),
path.join(dir, 'scripts/vite/legacy-css-layers.js'),
await readFile(path.join(root, 'scripts/vite/legacy-css-layers.js')),
);
await writeFile(
path.join(dir, '.env.development'),
@@ -121,7 +122,10 @@ test('checked-in defaults preserve same-origin behavior and disable analytics',
for (const mode of ['development', 'production']) {
const env = loadEnv(mode, root);
assert.equal(env.VITE_REACT_APP_SERVER_URL, '');
assert.equal(env.VITE_CLOUD_BRAIN_UI_ENABLED, 'false');
assert.equal(
env.VITE_CLOUD_BRAIN_UI_ENABLED,
mode === 'development' ? 'true' : 'false',
);
assert.equal(analytics(await config(root, mode)), html);
}
});