style(copy): punctuation rules and site-wide fix with a CI check (QA U11)

- glossary: 10 punctuation rules (full-width in Chinese, CJK/Latin spacing,
  full-width parens around Chinese, single ellipsis, 「」 quotes, period rules)
- scripts/check-copy-punctuation.mjs: checks string literals, templates and JSX
  text (not comments, types, keys, match/compare strings); --fix, --strict,
  --by-file; wired into deno task ci as check:copy in warn mode
- --fix applied to web, server and contracts; files other lanes were editing
  (subscriptions, sites, browser, agent, auth/account, inventory) left for them
- tests updated for the changed messages

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 20:09:29 +08:00
1 parent 9b017906cf
commit 52402864d6
143 files changed
+985 -606

No files matched your search

+5 -5
View File
@@ -24,7 +24,7 @@ export async function runPreflight({ config, db, uid = Deno.uid() }: PreflightDe
const prod = config.NODE_ENV === "production";
if (prod && PLACEHOLDER.test(config.SECRET_MASTER_KEY)) {
problems.push({ check: "secret", message: "SECRET_MASTER_KEY 仍是占位符,生产环境必须换成随机串" });
problems.push({ check: "secret", message: "SECRET_MASTER_KEY 仍是占位符,生产环境必须换成随机串" });
}
if (prod && uid === 0) {
problems.push({ check: "user", message: "生产环境不允许以 root 运行" });
@@ -32,7 +32,7 @@ export async function runPreflight({ config, db, uid = Deno.uid() }: PreflightDe
try {
await sql`select 1`.execute(db);
} catch (err) {
problems.push({ check: "db", message: `数据库不可达: ${(err as Error).message}` });
problems.push({ check: "db", message: `数据库不可达:${(err as Error).message}` });
}
if (config.WEB_ROOT) {
try {
@@ -109,7 +109,7 @@ export async function checkStorage(opts: {
await Deno.mkdir(dir, { recursive: true });
await probeWrite(dir);
} catch (e) {
problems.push({ check: "data_dir", message: `数据目录不可写: ${dir}(${errText(e)});检查卷挂载与 PUID/PGID` });
problems.push({ check: "data_dir", message: `数据目录不可写:${dir}(${errText(e)});检查卷挂载与 PUID/PGID` });
}
}
for (const m of opts.mounts) {
@@ -118,13 +118,13 @@ export async function checkStorage(opts: {
if (!st.isDirectory) throw Object.assign(new Error("不是目录"), { code: "ENOTDIR" });
for await (const _ of Deno.readDir(m.path)) break;
} catch (e) {
warnings.push({ ...m, reason: `不可读: ${errText(e)}` });
warnings.push({ ...m, reason: `不可读:${errText(e)}` });
continue;
}
try {
await probeWrite(m.path);
} catch (e) {
warnings.push({ ...m, reason: `不可写: ${errText(e)}` });
warnings.push({ ...m, reason: `不可写:${errText(e)}` });
}
}
return { problems, warnings };