Files
Reims-Go/frontend/scripts/test-brand.mjs
千川白浪 aac3979373 refactor: 收敛根目录布局并统一资源与脚本归属 (#203)
* refactor: 收敛根目录布局并统一资源与脚本归属

* fix: 停止监视器时等待显示定位协程退出
2026-12-05 06:34:01 -07:00

22 lines
1.1 KiB
JavaScript

// scripts/brand/wordmark.py is the single source of the icon and the wordmark
// geometry: it copies build/assets/logo.svg into public/ and generates
// wordmark.gen.ts. Neither copy may be edited by hand.
import test from 'node:test'
import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
const repoRoot = path.resolve(import.meta.dirname, '..', '..')
test('frontend/public/logo.svg is the copy of build/assets/logo.svg', () => {
const source = fs.readFileSync(path.join(repoRoot, 'build', 'assets', 'logo.svg'))
const served = fs.readFileSync(path.join(repoRoot, 'frontend', 'public', 'logo.svg'))
assert.ok(source.equals(served), 'run python scripts/brand/wordmark.py to refresh frontend/public/logo.svg')
})
test('the frontend wordmark geometry is generated', () => {
const generated = fs.readFileSync(path.join(repoRoot, 'frontend', 'src', 'components', 'wordmark.gen.ts'), 'utf8')
assert.match(generated, /^\/\/ Code generated by scripts\/brand\/wordmark\.py; DO NOT EDIT\./)
assert.match(generated, /export const WORDMARK_STROKES: WordmarkStroke\[\] = \[/)
})