1
0
forked from boos/BoosAPI

refactor: purge Node.js, Rust is the one true backend

- Moved boosapi-rs/* to repo root
- Deleted all Node.js source (src/server/, src/web/, scripts/)
- Deleted node_modules, package.json, tsconfig, vite.config
- Updated .gitignore and AGENTS.md for Rust-only stack
- Fixed static file path for frontend dist/web/
- Dockerfile stays the same (already Rust-only)
- Kept dist/web/ for Rust static serving
This commit is contained in:
boos
2026-05-18 09:11:29 +08:00
parent 725f44699a
commit 5d29f03d50
1165 changed files with 271 additions and 323571 deletions
-47
View File
@@ -1,47 +0,0 @@
import { describe, expect, it } from 'vitest';
import { translateText } from './i18n.js';
describe('translateText', () => {
it('keeps zh text unchanged in zh mode', () => {
expect(translateText('模型广场', 'zh')).toBe('模型广场');
});
it('translates exact key in en mode', () => {
expect(translateText('模型广场', 'en')).toBe('Model Marketplace');
});
it('supports phrase replacement for mixed text', () => {
expect(translateText('覆盖槽位 3', 'en')).toBe('Coverage Slots 3');
expect(translateText('共 12 个模型', 'en')).toBe('Total 12 models');
});
it('never returns Chinese characters in strict en mode', () => {
const samples = [
'站点已禁用',
'缓存清理后重建失败:unknown error',
'签到任务执行中,请稍后查看签到日志',
];
for (const sample of samples) {
expect(translateText(sample, 'en')).not.toMatch(/[\u3400-\u9fff]/);
}
});
it('uses concrete english translations instead of fallback for common runtime text', () => {
expect(translateText('切换到中文', 'en')).toBe('Switch to Chinese');
expect(translateText('中', 'en')).toBe('ZH');
const samples = [
'站点已禁用',
'签到任务执行中,请稍后查看签到日志',
'下游访问令牌至少 6 位(含 sk-)',
'路由重建任务执行中,请稍后查看程序日志',
];
for (const sample of samples) {
const translated = translateText(sample, 'en');
expect(translated).not.toBe('Untranslated');
expect(translated).not.toMatch(/[\u3400-\u9fff]/);
}
});
});