Files
novalon-website/package.json
T
zhangxiang a571e0bebd feat(hero): 首屏全幅 3D 场景 Phase 0——三镜头分镜 + CC0 机柜 + R22/R26 判据
场景(ADR-0016):
- hero-scene.tsx:three 0.187 全幅场景,三机位分镜(走廊 16s / 俯视阵列 13s /
  柜排斜看 13s),镜头间压黑 420ms,一轮 43.26s;`reduced-motion` 定格、
  `<1024px` 不挂载、离屏与切后台即停、WebGL 失败静默回落 E 案
- 资产:Grab3D《Server Rack》light(CC0 1.0,随包许可已落盘;14,851 面 / 954KB),
  近景 16 台/排按 primitive 建 InstancedMesh 替换灰盒,灰盒保留为兜底
- 文案:hero-scenes.ts 单一真源 + 场景角标(切镜事件驱动、aria-hidden、未登记 id 不置空)

判据:
- R22 第三态:零影像 → 视觉层登记制(载体白名单 / 出处 / 海报存在性 / 表过期 /
  登记与扫描面一致),七向自证;登记 ≠ 整页通行证,未批准载体仍判红
- 新增 R26:首屏 3D 场景契约(周期 [20s,60s] / 必须有 prefers-reduced-motion /
  IntersectionObserver + visibilitychange / 禁 autoRotate),三向自证 + 突变验证
  (ms 16000→46000 ⇒ 73260ms ⇒ 违规 1,还原后 0)

工程:
- 视觉基线对场景区 mask(页脚先例同款理由);flag 关时零匹配,实测 5 passed / 0 重采
- 海报帧 20KB 纯画布(canvas.toDataURL + 抓图模式),兼作 LCP 与降级
- 修 WebGL 失败时为未捕获 rejection 的缺口(此前只有 import 在 try 里)

读数:对比度 6 相位取最坏 5.04:1(AA 通过);tsc / eslint / check:grammar /
--selftest / jest 28 例全绿。性能:headless 走 SwiftShader,真机帧率待复测(ADR §14.5)。
2026-12-02 16:36:44 +08:00

195 lines
9.6 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",
"type-check:e2e": "tsc --noEmit -p e2e/tsconfig.json",
"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 check:package-keys && npm run type-check:e2e && 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:selftest": "node scripts/dead-modules.selftest.mjs",
"check:dead": "npm run check:dead:selftest && 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:selftest": "node scripts/accessibility/axe-node-count.mjs --selftest",
"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",
"check:package-keys": "node scripts/check-package-keys.mjs",
"test:e2e:write-db": "cd e2e && npx playwright test -c playwright.write-db.config.ts"
},
"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",
"three": "^0.187.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",
"@types/three": "^0.187.0",
"@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"
}
}