Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .PHONY: build build-backend build-frontend test test-backend test-frontend test-frontend-critical
  2. FRONTEND_CRITICAL_VITEST := \
  3. src/i18n/__tests__/localeKeyCompleteness.spec.ts \
  4. src/api/__tests__/client.spec.ts \
  5. src/api/__tests__/tokenRefresh.spec.ts \
  6. src/api/__tests__/channelMonitorV2.spec.ts \
  7. src/views/auth/__tests__/LinuxDoCallbackView.spec.ts \
  8. src/views/auth/__tests__/WechatCallbackView.spec.ts \
  9. src/views/user/__tests__/PaymentView.spec.ts \
  10. src/views/user/__tests__/PaymentResultView.spec.ts \
  11. src/views/user/__tests__/ChannelStatusView.mode.spec.ts \
  12. src/components/user/profile/__tests__/ProfileInfoCard.spec.ts \
  13. src/views/admin/__tests__/SettingsView.spec.ts \
  14. src/features/channel-monitor-v2/__tests__/designSystem.structure.spec.ts \
  15. src/features/channel-monitor-v2/__tests__/monitorFormat.spec.ts \
  16. src/features/channel-monitor-v2/__tests__/monitorZoom.spec.ts
  17. # 一键编译前后端
  18. build: build-backend build-frontend
  19. # 编译后端(复用 backend/Makefile)
  20. build-backend:
  21. @$(MAKE) -C backend build
  22. # 编译前端(需要已安装依赖)
  23. build-frontend:
  24. @pnpm --dir frontend run build
  25. # 运行测试(后端 + 前端)
  26. test: test-backend test-frontend
  27. test-backend:
  28. @$(MAKE) -C backend test
  29. test-frontend:
  30. @pnpm --dir frontend run lint:check
  31. @pnpm --dir frontend run typecheck
  32. @pnpm --dir frontend run test:run
  33. test-frontend-critical:
  34. @pnpm --dir frontend exec vitest run $(FRONTEND_CRITICAL_VITEST)