Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
141 lines (107 loc) · 4.25 KB
/
Copy pathMakefile
File metadata and controls
141 lines (107 loc) · 4.25 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.PHONY: build build-backend build-frontend test test-backend test-frontend test-frontend-critical secret-scan migration-check \
stable-up stable-down stable-logs stable-status stable-restart stable-rebuild \
dev-up dev-down dev-logs dev-status dev-restart dev-rebuild \
door-restart door-status \
systemd-install systemd-status systemd-restart \
autostart-install autostart-uninstall autostart-status autostart-restart \
sync-upstream backup-runtime
PNPM := $(shell if command -v pnpm >/dev/null 2>&1; then printf 'pnpm'; else printf 'corepack pnpm'; fi)
FRONTEND_CRITICAL_VITEST := \
src/i18n/__tests__/localeKeyCompleteness.spec.ts \
src/api/__tests__/client.spec.ts \
src/api/__tests__/tokenRefresh.spec.ts \
src/api/__tests__/keys.bulkUpdate.spec.ts \
src/components/account/__tests__/OpenAIReferralCell.spec.ts \
src/components/account/__tests__/OpenAIReferralCell.transport.spec.ts \
src/components/account/__tests__/OpenAIQuotaResetCell.spark_shadow.spec.ts \
src/constants/__tests__/platforms.spec.ts \
src/components/account/__tests__/credentialsBuilder.platformCatalog.spec.ts \
src/components/account/__tests__/CreateAccountModal.spec.ts \
src/components/account/__tests__/EditAccountModal.spec.ts \
src/components/account/__tests__/credentialsBuilder.spec.ts \
src/components/account/__tests__/OpenCodeGoProtocolRulesEditor.spec.ts \
src/components/keys/__tests__/BulkEditKeysModal.spec.ts \
src/components/admin/user/__tests__/UserPlatformQuotaModal.spec.ts \
src/views/user/__tests__/KeysView.spec.ts \
src/api/__tests__/channelMonitorV2.spec.ts \
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/views/user/__tests__/ChannelStatusView.mode.spec.ts \
src/components/user/profile/__tests__/ProfileInfoCard.spec.ts \
src/components/user/profile/__tests__/ProfileIdentityBindingsSection.spec.ts \
src/views/admin/__tests__/SettingsView.spec.ts \
src/features/channel-monitor-v2/__tests__/designSystem.structure.spec.ts \
src/features/channel-monitor-v2/__tests__/monitorFormat.spec.ts \
src/features/channel-monitor-v2/__tests__/monitorZoom.spec.ts \
src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.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)
secret-scan:
@python3 tools/secret_scan.py
migration-check:
@./scripts/check-migration-numbering
@./scripts/tests/check-migration-numbering-test.sh
stable-up:
@./scripts/sub2api-local stable up
stable-down:
@./scripts/sub2api-local stable down
stable-logs:
@./scripts/sub2api-local stable logs
stable-status:
@./scripts/sub2api-local stable status
stable-restart:
@./scripts/sub2api-local stable restart
stable-rebuild:
@./scripts/sub2api-local stable rebuild
dev-up:
@./scripts/sub2api-local dev up --build
dev-down:
@./scripts/sub2api-local dev down
dev-logs:
@./scripts/sub2api-local dev logs
dev-status:
@./scripts/sub2api-local dev status
dev-restart:
@./scripts/sub2api-local dev restart
dev-rebuild:
@./scripts/sub2api-local dev rebuild
door-restart:
@./scripts/sub2api-local door restart
door-status:
@./scripts/sub2api-local door status
systemd-install:
@./scripts/sub2api-local systemd install
systemd-status:
@./scripts/sub2api-local systemd status
systemd-restart:
@./scripts/sub2api-local systemd restart
autostart-install:
@./scripts/sub2api-local autostart install
autostart-uninstall:
@./scripts/sub2api-local autostart uninstall
autostart-status:
@./scripts/sub2api-local autostart status
autostart-restart:
@./scripts/sub2api-local autostart restart
sync-upstream:
@./scripts/sub2api-local sync upstream
backup-runtime:
@./scripts/sub2api-local backup runtime