refactor(data): establish API contract guardrails
CI / Quality and Bundle Budgets (push) Has been cancelled

This commit is contained in:
2026-07-16 20:09:30 +08:00
parent cc06ed034d
commit 19d36ed5bf
24 changed files with 498 additions and 230 deletions
+4 -1
View File
@@ -17,7 +17,7 @@
"lint": "eslint",
"lint:fix": "eslint --fix",
"typecheck": "tsc --noEmit",
"quality": "pnpm lint && pnpm typecheck && pnpm test",
"quality": "pnpm lint && pnpm typecheck && pnpm test && pnpm test:contracts",
"test": "vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
@@ -25,8 +25,11 @@
"test:e2e:chrome": "PLAYWRIGHT_USE_SYSTEM_CHROME=1 playwright test --project=mock-chromium",
"test:e2e:headed": "playwright test --project=mock-chromium --headed",
"test:e2e:ui": "playwright test --ui",
"test:e2e:mobile-smoke": "playwright test --project=mock-mobile-chrome e2e/specs/mock/auth/email-login-from-other-options.spec.ts e2e/specs/mock/auth/logout-from-sidebar.spec.ts e2e/specs/mock/chat/chat-send-token-refresh-retry.spec.ts e2e/specs/mock/unlock-message/image-unlock-insufficient-credits.spec.ts",
"test:e2e:real": "E2E_REAL_BACKEND=1 PLAYWRIGHT_BASE_URL=${PLAYWRIGHT_BASE_URL:-https://frontend-test.banlv-ai.com} E2E_API_BASE_URL=${E2E_API_BASE_URL:-https://proapi.banlv-ai.com} playwright test --project=real-backend",
"test:e2e:prod": "E2E_REAL_BACKEND=1 PLAYWRIGHT_BASE_URL=${PLAYWRIGHT_BASE_URL:-https://cozsweet.com} E2E_API_BASE_URL=${E2E_API_BASE_URL:-https://proapi.banlv-ai.com} playwright test --project=prod-smoke",
"contract:check": "node scripts/contracts/check-openapi.mjs",
"test:contracts": "node --test scripts/contracts/__tests__/*.test.mjs",
"perf:bundle": "next experimental-analyze --output && node scripts/performance/report-bundle.mjs",
"perf:bundle:check": "PERF_BUNDLE_ENFORCE=1 pnpm perf:bundle",
"perf:vitals": "node scripts/performance/collect-web-vitals.mjs",