收口 Makelore 客户端变更
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-12 22:35:06 +08:00
parent 253bad8b40
commit f4113a872f
232 changed files with 4617 additions and 20121 deletions

View File

@@ -1,4 +1,4 @@
import { readFileSync } from 'node:fs';
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
@@ -53,4 +53,25 @@ describe('light visual system', () => {
expect(globalsSource).toMatch(/--brand-hover:\s*15 84% 38%;/);
expect(uiSource).not.toMatch(/#3A5578|#F2F5F8|#4b6385|bg-sky-500/i);
});
it('uses bundled mixed-script typography with language-aware fallbacks', () => {
const globalsSource = readSource('styles/globals.css');
const tailwindSource = readFileSync(join(process.cwd(), 'tailwind.config.js'), 'utf8');
const appSource = readSource('App.tsx');
expect(globalsSource).toContain('font-family: "Makelore Latin";');
expect(globalsSource).toContain('font-family: "Makelore CJK";');
expect(globalsSource).toContain('SourceHanSansSC-Regular.otf');
expect(globalsSource).toContain('unicode-range: U+2E80-2EFF');
expect(globalsSource).toContain('font-display: swap;');
expect(tailwindSource).toContain("var(--font-sans)");
expect(appSource).toContain('root.dataset.uiLanguage = resolvedLanguage;');
expect(appSource).toContain("root.lang = resolvedLanguage === 'zh' ? 'zh-CN' : resolvedLanguage;");
expect(existsSync(join(process.cwd(), 'src/assets/fonts/InterVariable.woff2'))).toBe(true);
expect(existsSync(join(process.cwd(), 'src/assets/fonts/InterVariable-Italic.woff2'))).toBe(true);
expect(existsSync(join(process.cwd(), 'src/assets/fonts/SourceHanSansSC-Regular.otf'))).toBe(true);
expect(existsSync(join(process.cwd(), 'public/fonts/licenses/OFL-1.1.txt'))).toBe(true);
expect(existsSync(join(process.cwd(), 'public/fonts/licenses/NOTICE.md'))).toBe(true);
});
});