Files
novalon-website/package.json
T
zhangxiang 81daedbea1 feat(tokens): 视觉语法收口到对标实测——圆角 0–4 记档、彩色阴影退役、卡片去 lift
依据是实测而非口味。Bain & Company(archive 快照 2026-08-31, 1600×846)与
Porsche Consulting(live 国际站)的 getComputedStyle 抽样收敛到同一条:
**两家全站 border-radius 均为 0**,且面/字色近乎单色
(Bain 字色仅 #000/#FFF/#CC0000/#767676;Porsche 面色 #FFF/#000/#D6001D/#F2F2F2,
红出现 4 次且全部是按钮底、无一次是阴影或背景)。本仓此前的「中度软化」
3→32px 八档 + 三枚品牌红阴影 + 卡片 hover 抬升,三件全是对标没有的语法。

本轮按「借语法、不借色相」执行:保留 #C41E3A 色相与朱砂条,只收口形状与层次。

圆角
- --radius-xs/sm 3/6→0、md/lg 8/12→2、xl/2xl/3xl 18/24/32→4,新增 --radius-cta: 0
- **--radius-full 保持 9999 不动**:它承载真圆(avatar/switch/slider/radio-group/
  progress/scroll-area/skeleton),一并归零会把所有旋钮与头像方角化。这条是
  check:grammar R2/R9 的正向守卫 —— 刻意做成「仪器坏了它仍要失败」的那一维
- --badge-radius 由 var(--radius-full) 改指 var(--radius-cta)(实测该令牌零消费者,
  留档不复用,删除动作留给死码族 DEC-P-2 统一处理)
- button.tsx 的 sm/default/lg/xl 走 rounded-cta,icon 档保持 rounded-full(功能形状)

彩色阴影
- --shadow-brand / --shadow-brand-hover / --shadow-glow 三枚退役(实测前两者仅 2 处、
  后者 0 处消费者),消费方回落中性档
- 同批发现并修掉一处暖化漏网:阴影基色仍是冷墨 rgba(10,14,20,α)=#0A0E14,
  而暖墨 #141210 早已落地 —— globals.css 16 处 + 业务 2 处。check:token-twins 抓不到它,
  因为阴影是字面量 rgba、没有 -rgb 孪生兄弟可对照

卡片
- .bain-card hover 去 translateY(-4px) 与阴影增长,改为 hairline→rule + 底色微移
- --card-shadow-hover / --card-transition 随之退役(前者仅 :hover 消费、后者零消费者)

新增信息线令牌 --color-border-rule #8A8377
hover 边框是「告诉用户这个可交互」的信息,按品牌 P4 三档拆分不能用界灰 #C3BDB1
(实测对卡底仅 1.78,不达非文本 3:1)。#8A8377 由我自己算:对白 3.75、对纸 #FBF9F5
3.57、对暗底 #141210 4.89 —— 两主题都过 3:1,且 -rgb 孪生已同步(44/44)。

动效
- 补 --transition-hover: 150ms 并接进 Tailwind duration 档。动效四原则 CONTEXT.md:76
  早就写了 hover 150ms,仓库从来没有这个档(BRAND-MANUAL §6 冲突 C-1)。
  抬升与光晕去掉后 hover 成了唯一的可交互提示,没档可用等于语法自相矛盾
- cta-button 的 transition-all duration-200(裸字面量)一并改为 transition-colors duration-hover

CTA 两轨(实测尺寸之间取值:Bain 20/32+14px、Porsche 13/24+16px → px-7 py-3.5 + text-sm/500)
- 实心/描边两轨都直角;不做 text-transform(中文无大小写)、不补字距(Bain 实测
  letterSpacing: normal,它的大写感来自全大写本身)
- 箭头只保留在 inline 文字链轨:两家按钮实测都是纯文字
- 描边轨静止边框用 border-border-rule,不用 ink/20(≈1.54 不达 3:1)
- 改动半径实测:63 处 <CTAButton> 调用,其中 36 处不写 variant ⇒ 落默认 primary,
  24 处 secondary、3 处 dark、0 处 inline

新闸 npm run check:grammar(9 条规则)+ check:grammar:selftest(9/9 双向自证)
- 闸只看代码:扫描前统一剥注释。不剥的话,解释「为什么退出 rounded-full」的文档注释
  本身会被判红,于是只剩两条出路 —— 改措辞去绕闸(应试,闸就此失去解释力)或把闸调瞎
- 每条规则报分母;分母为 0 ⇒ exit 2 判「未能度量」,不算通过
- 退出码分档 0/1/2,避免闸自身崩溃与判红共用 exit 1 而吞掉同批已算好的打印

顺带删死码 hero-section-v2.tsx(200 行、单一导出、全站零生产引用,仅被自己的 3 个测试
dynamic import)+ 那 3 个测试。留测试会让死码继续占覆盖率分母,并被误读成「有活在跑」。

KNOWN-RED: test:visual —— 全局令牌改动没有"爆炸半径"可言,页面级 130 张基线预期全部churn。
按计划 §10 只在 #3–#9 落地后一次性重捕(需 AUTH-VISUAL 单独授权),不按笔重写以免归因失效。

门禁实测:type-check EXIT=0 · check:grammar 9/9 · check:grammar:selftest 9/9 ·
check:token-twins 44/44 · check:contrast 44/44 · check:brand-token 0 违规 ·
check:motion 23→22(--transition-* 采集数 6→7,假红已消)· 全量 jest 143 套件 / 1769 例通过
2026-10-16 20:02:11 +08:00

184 lines
8.8 KiB
JSON

{
"name": "ruixin-website-react",
"version": "1.0.0-phase1",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"dev:clean": "rm -rf .next dist && next dev -p 3000",
"build": "next build",
"postbuild": "rm -rf dist/standalone/dist/static dist/standalone/public && mkdir -p dist/standalone/dist && cp -R dist/static dist/standalone/dist/static && cp -R public dist/standalone/public",
"build:clean": "rm -rf .next dist && next build",
"start": "next start -p 3000",
"db:seed": "npx tsx prisma/seed.ts",
"db:reset": "npx prisma migrate reset --force && npm run db:seed",
"lint": "eslint",
"type-check": "tsc --noEmit",
"preview": "next start -p 3000",
"test": "npm run test:functional && npm run test:visual:all",
"test:unit": "jest",
"test:coverage": "jest --coverage",
"test:coverage:check": "jest --coverage --ci",
"coverage:report": "open coverage/lcov-report/index.html",
"test:functional": "cd e2e && npx playwright test --config=playwright.config.ts --project=chromium --project=chromium-mobile --project=firefox --project=webkit",
"test:e2e": "npm run test:functional",
"test:visual": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-desktop",
"test:visual:all": "cd e2e && npx playwright test visual-regression.spec.ts",
"test:visual:update": "cd e2e && npx playwright test visual-regression.spec.ts --update-snapshots",
"test:visual:mobile": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-mobile",
"test:visual:tablet": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-tablet",
"test:visual:browsers": "cd e2e && npx playwright test visual-regression.spec.ts --project=visual-chromium-desktop --project=visual-firefox-desktop --project=visual-webkit-desktop",
"test:performance": "k6 run tests/performance/load-test.js",
"test:stress": "k6 run tests/performance/stress-test.js",
"test:integration:mocked": "jest --testPathPatterns='src/app/api/'",
"test:integration:real": "jest --config config/test/jest.integration.config.js",
"test:performance:api": "k6 run tests/performance/api-test.js",
"test:performance:soak": "k6 run tests/performance/soak-test.js",
"test:smoke": "cd e2e && npx playwright test --grep @smoke",
"test:critical": "cd e2e && npx playwright test --grep @critical",
"test:e2e:fast": "cd e2e && npx playwright test --grep '@smoke|@critical'",
"test:e2e:standard": "cd e2e && npx playwright test --grep @regression",
"test:e2e:journey": "cd e2e && npx playwright test --grep @journey",
"test:e2e:prod": "cd e2e && E2E_TARGET=production npx playwright test --grep '@smoke|@critical|@journey' --project=chromium --project=chromium-mobile --project=firefox --project=webkit",
"test:e2e:journey:home": "cd e2e && npx playwright test uj-11-home-conversion.spec.ts --project=chromium --project=chromium-mobile",
"test:e2e:mobile": "cd e2e && npx playwright test --grep @mobile",
"test:e2e:mobile:performance": "cd e2e && npx playwright test --grep @mobile.*@performance",
"test:e2e:mobile:accessibility": "cd e2e && npx playwright test --grep @mobile.*@accessibility",
"test:mutation": "rm -rf .stryker-tmp && npx stryker run",
"test:mutation:quick": "rm -rf .stryker-tmp && npx stryker run --mutate 'src/lib/utils.ts'",
"test:all": "npm run type-check && npm run lint && npm run test:coverage && npm run test:integration:real && npm run check:a11y && npm run test:e2e:fast && npm run test:security:headers",
"check:contrast": "tsx scripts/utils/check-color-contrast.ts",
"check:headings": "tsx scripts/utils/check-heading-hierarchy.ts",
"check:brand-token": "tsx scripts/utils/check-brand-text-token.ts",
"check:token-twins": "node scripts/check-token-twins.mjs",
"check:grammar": "node scripts/check-visual-grammar.mjs",
"check:grammar:selftest": "node scripts/check-visual-grammar.mjs --selftest",
"check:motion": "tsx scripts/utils/check-motion-constraints.ts",
"check:motion:test": "jest --roots '<rootDir>/scripts/utils/__tests__'",
"check:a11y": "npm run check:contrast && npm run check:headings && npm run check:brand-token",
"check:axe": "node scripts/accessibility/axe-node-count.mjs",
"check:axe:routes": "node scripts/accessibility/crawl-routes.mjs",
"test:security": "npm audit --audit-level=high && npm run test:security:headers",
"test:security:headers": "tsx scripts/utils/check-security-headers.ts",
"lighthouse": "lhci autorun --config=config/test/lighthouserc.json",
"lighthouse:collect": "lhci collect --config=config/test/lighthouserc.json",
"lighthouse:assert": "lhci assert --config=config/test/lighthouserc.json",
"lighthouse:upload": "lhci upload --config=config/test/lighthouserc.json",
"lighthouse:desktop": "lhci autorun --config=config/test/lighthouserc.json --collect.settings.preset=desktop",
"lighthouse:mobile": "lhci autorun --config=config/test/lighthouserc.json --collect.settings.preset=mobile",
"prepare": "husky",
"deploy": "bash scripts/deploy.sh deploy",
"deploy:skip-build": "bash scripts/deploy.sh deploy --skip-build",
"deploy:rollback": "bash scripts/deploy.sh rollback",
"deploy:status": "bash scripts/deploy.sh status"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.1089.0",
"@hookform/resolvers": "^5.4.0",
"@playwright/test": "^1.58.2",
"@prisma/client": "^6.19.3",
"@radix-ui/react-accordion": "^1.2.15",
"@radix-ui/react-alert-dialog": "^1.1.18",
"@radix-ui/react-avatar": "^1.2.1",
"@radix-ui/react-checkbox": "^1.3.6",
"@radix-ui/react-context-menu": "^2.3.2",
"@radix-ui/react-dialog": "^1.1.18",
"@radix-ui/react-dropdown-menu": "^2.1.19",
"@radix-ui/react-hover-card": "^1.1.18",
"@radix-ui/react-label": "^2.1.11",
"@radix-ui/react-popover": "^1.1.18",
"@radix-ui/react-progress": "^1.1.11",
"@radix-ui/react-radio-group": "^1.4.2",
"@radix-ui/react-scroll-area": "^1.2.13",
"@radix-ui/react-select": "^2.3.2",
"@radix-ui/react-separator": "^1.1.11",
"@radix-ui/react-slider": "^1.4.2",
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-switch": "^1.3.2",
"@radix-ui/react-tabs": "^1.1.16",
"@radix-ui/react-tooltip": "^1.2.11",
"@sentry/nextjs": "^10.52.0",
"@sentry/tracing": "^7.120.4",
"@tiptap/extension-link": "^3.27.1",
"@tiptap/extension-placeholder": "^3.27.1",
"@tiptap/pm": "^3.27.1",
"@tiptap/react": "^3.27.1",
"@tiptap/starter-kit": "^3.27.1",
"bcryptjs": "^3.0.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^12.34.3",
"jsonwebtoken": "^9.0.3",
"lucide-react": "^0.563.0",
"next": "^16.2.11",
"prisma": "^6.19.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.80.0",
"sanitize-html": "^2.17.7",
"sharp": "^0.35.3",
"sonner": "^2.0.7",
"tailwind-merge": "^3.4.0",
"zod": "^4.3.6"
},
"devDependencies": {
"@axe-core/playwright": "^4.11.1",
"@babel/core": "^7.29.0",
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@eslint/eslintrc": "^3.3.5",
"@lhci/cli": "^0.15.1",
"@stryker-mutator/core": "^9.6.1",
"@stryker-mutator/jest-runner": "^9.6.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/bcryptjs": "^2.4.6",
"@types/jest": "^30.0.0",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/sanitize-html": "^2.16.1",
"@typescript-eslint/eslint-plugin": "^8.65.0",
"@typescript-eslint/parser": "^8.65.0",
"allure-playwright": "^3.10.2",
"autoprefixer": "^10.4.20",
"chrome-launcher": "^1.2.1",
"eslint": "^9.25.1",
"eslint-config-next": "^16.2.11",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"husky": "^9.1.7",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"k6": "^0.0.0",
"lighthouse": "^13.0.3",
"lint-staged": "^16.4.0",
"postcss": "^8.5.21",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.4.6",
"tsx": "^4.23.1",
"typescript": "^5"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "^16.2.9"
},
"overrides": {
"postcss": "^8.5.21",
"tmp": "^0.2.7",
"uuid": "^14.0.1",
"ws": "^8.21.1",
"esbuild": "^0.28.1",
"glob": "^13.0.6",
"sharp": "^0.35.3",
"qs": "^6.15.2",
"deepmerge-ts": "^8.0.1"
}
}