裁定(ADR-0008 决策一 + 决策一修订段):**令牌保留、消费面收窄**,不删。 依据是实测而非口味 —— Bain 全站字色只有 4 个值(#000 #FFF #CC0000 #767676)、面色 3 个; Porsche 字色 3 个、面色 4 个,红只出现在按钮上;两家**都不用颜色给内容分类**。 而 ADR-0004 决策一当年按「编号为主 + 4px 色条为辅」把 7 枚 accent 放进令牌层, 实测真正跑起来的营销代码只消费了**一个蓝**(`accent-blue`)做装饰性图标砖与状态徽章: 成本是全站语法被稀释,收益是一处蓝。 改动: - 10 处 `accent-blue*` 换成近单色语法(`bg-bg-tertiary` + `border-border-primary` + `text-text-primary`; 状态签去彩色底改中性描边),涉及 products-content-v3 / solution-value / solution-service-card。 可达营销面 accent 残留实测 **0 处**。 - `globals.css` 在 accent 声明处写明「dataviz / 工具 UI 专用」与退役理由。 - **tailwind 僵尸令牌**:`--shadow-brand/-brand-hover/-glow` 早已从 CSS 退役, 但 `boxShadow` 里三行映射原样留着 ⇒ `shadow-brand` 类照生成、 展开成 `box-shadow: var(--shadow-brand)` 而该属性无人声明 ⇒ **静默什么都不画**, 不报错、不算无效。R5(令牌已退役)与 R7(业务代码零消费)当时**都是绿的**, 因为它们各看一侧,谁都不看 tailwind↔CSS 这条缝(§5.41,与 §5.37 同族)。删映射 + 新增 R11。 新增 `scripts/check-accents.mjs`(`check:accents`):营销面不得出现 `accent-*` 类。 两条防赖设计:① 豁免**按文件名**登记,不写目录通配(通配会让新文件自动继承豁免); ② 名单里的文件命中数变 0 **同样判红**(豁免名单否则必然腐化成"没人记得为什么在这"的永久豁免)。 现读:扫 251 源文件、命中 31 处 / 3 文件,全在豁免内(admin 分类色标 16、 ui/product-card 12、ui/brand-visuals 3 —— 后两枚是不可达库存)。 **自证修好了才算这条成立**(第一版是坏的,绿灯不作数): `--selftest` 原来把「营销面有违规」和「三条豁免全命中」两个**互斥前提**塞进同一份夹具, 于是 `stale.length === 3` 永不可能成立 ⇒ 豁免腐化那一维**从未被测到**,自证 EXIT=1。 现拆成三个各测一维的情景,并**补一个全绿情景** —— 只喂负例的话, 判据写错成恒红也会"抓到所有负例",同样通过自证。三情景现全 ✓。 R10 hover 抬升棘轮按实测**从 31 下调到 28**(19 文件),只降不升; 下调提示从 print 挪进 note —— `checkGrammar` 现在被自证反复调用, 喂合成样本时打「请把上限下调到 0」是噪声,会把人引去改坏登记值。 R11 负对照**在真树上执行**:把 `boxShadow.brand/'glow'` 两行塞回 tailwind ⇒ EXIT=1、报出 2 条悬空;还原 ⇒ 11/11 成立、引用 144 个变量、悬空 0。 写 R11 时踩了两个仪器坑(都记进 §5.40/§5.41): 豁免名单写在规则里、夹具再手抄一遍 ⇒ 改一处另一处静默失效 ⇒ 提到 module 层共用; 夹具不带那条外部所有者引用 ⇒ 「豁免腐化」先判红,把「已声明不误报」这一维污染成假红, 差点被我读成判据坏 —— **先怀疑夹具,再怀疑判据**。 `check:visual`(自证先跑,自证失败即宣布绿灯作废)并入 `test:all`,另补 `check:dead` 入口。 口径边界(必须读,否则会把它当成"视觉已达标"):本闸**只覆盖 Tailwind 类名通道**。 第二条彩色编码通道是 `hero-themes.ts` 的 `accentColor`,以内联样式进 `detail-hero.tsx:81-86`,11 个主题里 **7 个用非品牌色相**(erp #1e3a5f / crm #1e40af / bi #0c4a6e / cms #14532d / sds #78350f / oa #4c1d95 / novavis #0f3d3e), 落在产品·方案·服务详情页 hero 徽章上。**本批不收它**:① 属"套其余模板",决策四明确推到验收之后; ② 去掉逐产品色相等于取消产品线视觉身份,是**设计裁定**不是语法收口,不该由闸顺手替决策人拍板。 这句边界已印进闸的成功输出行(措辞与被验那一维一致),并登记为 DEC-N1。 复测(全部重定向到文件后读 `$?`,不用管道): `check:accents` EXIT=0 · `check:accents:selftest` EXIT=0 · `check:grammar` EXIT=0(11/11)· `check:grammar:selftest` EXIT=0(R1–R9 全判红 + R10「28 不红 / 29 红」+ R11 双向)· `check:contrast` 44/44 · `check:headings` 0 · `check:brand-token` 0 · `check:token-twins` 44/44 · `type-check` EXIT=0 · `lint` EXIT=0(0 error / 81 warning)· `test:unit` 141 套件 / 1747 例 · `npm run build` EXIT=0 · **`npm run test:all` EXIT=0**(八段,含新并入的 check:visual; e2e:fast 59 passed / 25 skipped,那 16 个 GA4 @critical 仍在 skipped 侧,须 `test:e2e:prod` 才真断言)。 已知未闭:`check:motion` 仍 EXIT=1(**8 处**),经 `git show da9a5cb6:` 自证 1000ms 与 0.6s 两处 都是基线既有红、非本轮引入,登记 DEC-N3。
188 lines
9.1 KiB
JSON
188 lines
9.1 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 check:visual && 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:accents": "node scripts/check-accents.mjs",
|
|
"check:accents:selftest": "node scripts/check-accents.mjs --selftest",
|
|
"check:grammar:selftest": "node scripts/check-visual-grammar.mjs --selftest",
|
|
"check:visual": "npm run check:grammar:selftest && npm run check:grammar && npm run check:accents:selftest && npm run check:accents",
|
|
"check:dead": "node scripts/dead-modules.mjs",
|
|
"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"
|
|
}
|
|
}
|