@@ -9,12 +9,14 @@ SDK_FRONTEND := ../airgate-sdk/frontend
99# data/plugins/<id>/assets 读。这样三个插件的 dev 体验完全一致,没有特例。
1010OPENAI_PLUGIN := ../airgate-openai/web
1111CLAUDE_PLUGIN := ../airgate-claude/web
12+ PLAYGROUND_PLUGIN := ../airgate-playground/web
1213EPAY_PLUGIN := ../airgate-epay/web
1314HEALTH_PLUGIN := ../airgate-health/web
1415# build-plugins 阶段(生产)同步各插件的 admin dist/index.js 到
1516# core 的 plugin assets dir;health 的公开状态页仍走 /status 反代,不经过这套 assets。
1617OPENAI_ASSETS := $(BACKEND_DIR ) /data/plugins/gateway-openai/assets
1718CLAUDE_ASSETS := $(BACKEND_DIR ) /data/plugins/gateway-anthropic/assets
19+ PLAYGROUND_ASSETS := $(BACKEND_DIR ) /data/plugins/airgate-playground/assets
1820EPAY_ASSETS := $(BACKEND_DIR ) /data/plugins/payment-epay/assets
1921HEALTH_ASSETS := $(BACKEND_DIR ) /data/plugins/airgate-health/assets
2022BINARY := $(BACKEND_DIR ) /server
@@ -25,7 +27,7 @@ GO := GOTOOLCHAIN=local go
2527VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
2628LDFLAGS := -X github.com/DouDOU-start/airgate-core/internal/version.Version=$(VERSION )
2729
28- .PHONY : help dev dev-backend dev-frontend dev-sdk dev-plugins dev-plugin-openai dev-plugin-claude dev-plugin-epay dev-plugin-health \
30+ .PHONY : help dev dev-backend dev-frontend dev-sdk dev-plugins dev-plugin-openai dev-plugin-claude dev-plugin-playground dev-plugin- epay dev-plugin-health \
2931 build build-backend build-frontend \
3032 build-plugins sync-plugins \
3133 ent lint fmt test clean install ci pre-commit setup-hooks \
@@ -50,12 +52,14 @@ dev-sdk: ## 启动 SDK 主题 watch 模式(修改 token 自动编译)
5052
5153dev-plugins : # # 启动所有插件前端 watch 模式
5254 @echo " 启动插件前端 watch(统一输出到 <plugin>/web/dist,core 在 dev 模式下直读):"
53- @echo " - openai → ../airgate-openai/web/dist/"
54- @echo " - claude → ../airgate-claude/web/dist/"
55- @echo " - epay → ../airgate-epay/web/dist/"
56- @echo " - health → ../airgate-health/web/dist/ (含 admin index.js + standalone status page)"
55+ @echo " - openai → ../airgate-openai/web/dist/"
56+ @echo " - claude → ../airgate-claude/web/dist/"
57+ @echo " - playground → ../airgate-playground/web/dist/"
58+ @echo " - epay → ../airgate-epay/web/dist/"
59+ @echo " - health → ../airgate-health/web/dist/ (含 admin index.js + standalone status page)"
5760 @$(MAKE ) dev-plugin-openai &
5861 @$(MAKE ) dev-plugin-claude &
62+ @$(MAKE ) dev-plugin-playground &
5963 @$(MAKE ) dev-plugin-epay &
6064 @$(MAKE ) dev-plugin-health &
6165 @wait
@@ -74,6 +78,13 @@ dev-plugin-claude: ## 单独 watch claude 插件前端(输出到 ../airgate-cl
7478 echo " 跳过 claude 插件前端 watch:$( CLAUDE_PLUGIN) 不存在" ; \
7579 fi
7680
81+ dev-plugin-playground : # # 单独 watch playground 插件前端(输出到 ../airgate-playground/web/dist)
82+ @if [ -d $( PLAYGROUND_PLUGIN) ]; then \
83+ cd $(PLAYGROUND_PLUGIN ) && npx vite build --watch; \
84+ else \
85+ echo " 跳过 playground 插件前端 watch:$( PLAYGROUND_PLUGIN) 不存在" ; \
86+ fi
87+
7788dev-plugin-epay : # # 单独 watch epay 插件前端(输出到 ../airgate-epay/web/dist)
7889 @if [ -d $( EPAY_PLUGIN) ]; then \
7990 cd $(EPAY_PLUGIN ) && npx vite build --watch; \
@@ -131,7 +142,7 @@ build-plugins: sync-plugins ## 构建插件前端并同步到 core
131142sync-plugins : # # 构建插件前端并同步 admin 资源到 data/plugins/
132143 @if [ -d $( OPENAI_PLUGIN) ]; then \
133144 echo " 构建并同步 openai 插件前端..." ; \
134- cd $(OPENAI_PLUGIN ) && npm run build; \
145+ ( cd $( OPENAI_PLUGIN) && npm run build) ; \
135146 mkdir -p $(OPENAI_ASSETS ) ; \
136147 cp $(OPENAI_PLUGIN ) /dist/index.js $(OPENAI_ASSETS ) /index.js; \
137148 echo " openai 插件前端已同步到 $( OPENAI_ASSETS) /" ; \
@@ -140,16 +151,25 @@ sync-plugins: ## 构建插件前端并同步 admin 资源到 data/plugins/
140151 fi
141152 @if [ -d $( CLAUDE_PLUGIN) ]; then \
142153 echo " 构建并同步 claude 插件前端..." ; \
143- cd $(CLAUDE_PLUGIN ) && npm run build; \
154+ ( cd $( CLAUDE_PLUGIN) && npm run build) ; \
144155 mkdir -p $(CLAUDE_ASSETS ) ; \
145156 cp $(CLAUDE_PLUGIN ) /dist/index.js $(CLAUDE_ASSETS ) /index.js; \
146157 echo " claude 插件前端已同步到 $( CLAUDE_ASSETS) /" ; \
147158 else \
148159 echo " 跳过 claude 插件前端构建:$( CLAUDE_PLUGIN) 不存在" ; \
149160 fi
161+ @if [ -d $( PLAYGROUND_PLUGIN) ]; then \
162+ echo " 构建并同步 playground 插件前端..." ; \
163+ (cd $( PLAYGROUND_PLUGIN) && npm run build); \
164+ mkdir -p $(PLAYGROUND_ASSETS ) ; \
165+ cp $(PLAYGROUND_PLUGIN ) /dist/index.js $(PLAYGROUND_ASSETS ) /index.js; \
166+ echo " playground 插件前端已同步到 $( PLAYGROUND_ASSETS) /" ; \
167+ else \
168+ echo " 跳过 playground 插件前端构建:$( PLAYGROUND_PLUGIN) 不存在" ; \
169+ fi
150170 @if [ -d $( EPAY_PLUGIN) ]; then \
151171 echo " 构建并同步 epay 插件前端..." ; \
152- cd $(EPAY_PLUGIN ) && npm run build; \
172+ ( cd $( EPAY_PLUGIN) && npm run build) ; \
153173 mkdir -p $(EPAY_ASSETS ) ; \
154174 cp $(EPAY_PLUGIN ) /dist/index.js $(EPAY_ASSETS ) /index.js; \
155175 echo " epay 插件前端已同步到 $( EPAY_ASSETS) /" ; \
@@ -158,7 +178,7 @@ sync-plugins: ## 构建插件前端并同步 admin 资源到 data/plugins/
158178 fi
159179 @if [ -d $( HEALTH_PLUGIN) ]; then \
160180 echo " 构建并同步 health 插件前端..." ; \
161- cd $(HEALTH_PLUGIN ) && npm run build; \
181+ ( cd $( HEALTH_PLUGIN) && npm run build) ; \
162182 mkdir -p $(HEALTH_ASSETS ) ; \
163183 cp $(HEALTH_PLUGIN ) /dist/index.js $(HEALTH_ASSETS ) /index.js; \
164184 echo " health 插件 admin 前端已同步到 $( HEALTH_ASSETS) /" ; \
0 commit comments