mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-22 06:40:21 +08:00
35 lines
1018 B
Makefile
35 lines
1018 B
Makefile
.PHONY: build build-backend build-frontend test test-backend test-frontend test-frontend-critical
|
||
|
||
FRONTEND_CRITICAL_VITEST := \
|
||
src/views/auth/__tests__/LinuxDoCallbackView.spec.ts \
|
||
src/views/auth/__tests__/WechatCallbackView.spec.ts \
|
||
src/views/user/__tests__/PaymentView.spec.ts \
|
||
src/views/user/__tests__/PaymentResultView.spec.ts \
|
||
src/components/user/profile/__tests__/ProfileInfoCard.spec.ts \
|
||
src/views/admin/__tests__/SettingsView.spec.ts
|
||
|
||
# 一键编译前后端
|
||
build: build-backend build-frontend
|
||
|
||
# 编译后端(复用 backend/Makefile)
|
||
build-backend:
|
||
@$(MAKE) -C backend build
|
||
|
||
# 编译前端(需要已安装依赖)
|
||
build-frontend:
|
||
@pnpm --dir frontend run build
|
||
|
||
# 运行测试(后端 + 前端)
|
||
test: test-backend test-frontend
|
||
|
||
test-backend:
|
||
@$(MAKE) -C backend test
|
||
|
||
test-frontend:
|
||
@pnpm --dir frontend run lint:check
|
||
@pnpm --dir frontend run typecheck
|
||
@$(MAKE) test-frontend-critical
|
||
|
||
test-frontend-critical:
|
||
@pnpm --dir frontend exec vitest run $(FRONTEND_CRITICAL_VITEST)
|