-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 1.14 KB
/
Copy pathMakefile
File metadata and controls
36 lines (26 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.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-frontend build-backend
# 编译后端(复用 backend/Makefile)
build-backend:
@cd backend && go build -tags embed -trimpath -o bin/claude2api ./cmd/server
# 编译前端(需要已安装依赖)
build-frontend:
@corepack pnpm@9.15.9 --dir frontend run build
# 运行测试(后端 + 前端)
test: test-backend test-frontend
test-backend:
@$(MAKE) -C backend test
test-frontend:
@corepack pnpm@9.15.9 --dir frontend run lint:check
@corepack pnpm@9.15.9 --dir frontend run typecheck
@$(MAKE) test-frontend-critical
test-frontend-critical:
@corepack pnpm@9.15.9 --dir frontend exec vitest run $(FRONTEND_CRITICAL_VITEST)