refactor(Makefile): update targets and directory references for web app integration

This commit is contained in:
mlogclub
2026-04-24 12:04:05 +08:00
parent a9275c2d4a
commit 6616b66e72
2 changed files with 19 additions and 19 deletions
+17 -17
View File
@@ -1,4 +1,4 @@
.PHONY: help install run run-server run-dashboard run-widget build build-all build-assets build-dashboard build-widget \ .PHONY: help install run run-server run-web run-widget build build-all build-assets build-web build-widget \
package-current package-platform build-linux-amd64 clean-dist clean-temp generator enums migration testdata package-current package-platform build-linux-amd64 clean-dist clean-temp generator enums migration testdata
DIST_DIR ?= dist DIST_DIR ?= dist
@@ -16,15 +16,15 @@ PLATFORM ?= $(CURRENT_PLATFORM)
help: help:
@echo "Available targets:" @echo "Available targets:"
@echo " make help Show this help message" @echo " make help Show this help message"
@echo " make install Install Go, dashboard, and widget dependencies" @echo " make install Install Go, web, and widget dependencies"
@echo " make run Run server, dashboard, and widget" @echo " make run Run server, web, and widget"
@echo " make run-server Run Go server" @echo " make run-server Run Go server"
@echo " make run-dashboard Run dashboard app" @echo " make run-web Run web app"
@echo " make run-widget Run widget app" @echo " make run-widget Run widget app"
@echo " make build Build assets and package current platform" @echo " make build Build assets and package current platform"
@echo " make build-all Build and package all platforms" @echo " make build-all Build and package all platforms"
@echo " make build-assets Build dashboard and widget assets" @echo " make build-assets Build web and widget assets"
@echo " make build-dashboard Build dashboard app" @echo " make build-web. Build web app"
@echo " make build-widget Build widget sdk and app" @echo " make build-widget Build widget sdk and app"
@echo " make package-current Package current platform" @echo " make package-current Package current platform"
@echo " make package-platform Package specified PLATFORM" @echo " make package-platform Package specified PLATFORM"
@@ -38,7 +38,7 @@ help:
install: install:
go mod download go mod download
cd dashboard && pnpm install cd web && pnpm install
cd widget && pnpm install cd widget && pnpm install
@echo "[install] done" @echo "[install] done"
@@ -49,7 +49,7 @@ run:
trap 'kill $$server_pid $$dashboard_pid $$widget_pid 2>/dev/null || true' INT TERM EXIT; \ trap 'kill $$server_pid $$dashboard_pid $$widget_pid 2>/dev/null || true' INT TERM EXIT; \
$(MAKE) run-server & \ $(MAKE) run-server & \
server_pid=$$!; \ server_pid=$$!; \
$(MAKE) run-dashboard & \ $(MAKE) run-web & \
dashboard_pid=$$!; \ dashboard_pid=$$!; \
$(MAKE) run-widget & \ $(MAKE) run-widget & \
widget_pid=$$!; \ widget_pid=$$!; \
@@ -66,8 +66,8 @@ run:
run-server: run-server:
go run ./cmd/server go run ./cmd/server
run-dashboard: run-web:
cd dashboard && pnpm dev cd web && pnpm dev
run-widget: run-widget:
cd widget && pnpm dev cd widget && pnpm dev
@@ -84,13 +84,13 @@ build-all: clean-dist build-assets
@$(MAKE) clean-temp @$(MAKE) clean-temp
@echo "[build-all] done" @echo "[build-all] done"
build-assets: build-dashboard build-widget build-assets: build-web build-widget
@echo "[build-assets] done" @echo "[build-assets] done"
build-dashboard: build-web:
@echo "[build-dashboard] building dashboard app" @echo "[build-web] building web app"
cd dashboard && pnpm build cd web && pnpm build
@echo "[build-dashboard] done" @echo "[build-web] done"
build-widget: build-widget:
@echo "[build-widget] building widget sdk" @echo "[build-widget] building widget sdk"
@@ -117,11 +117,11 @@ package-platform:
if [ "$$goos" = "windows" ]; then binary_name="$(APP_NAME).exe"; fi; \ if [ "$$goos" = "windows" ]; then binary_name="$(APP_NAME).exe"; fi; \
echo "[package] start $$platform"; \ echo "[package] start $$platform"; \
rm -rf "$$stage_dir"; \ rm -rf "$$stage_dir"; \
mkdir -p "$$package_dir/dashboard" "$$package_dir/widget" "$$package_dir/config" "$$dist_dir"; \ mkdir -p "$$package_dir/web" "$$package_dir/widget" "$$package_dir/config" "$$dist_dir"; \
echo "[package] go build $$platform"; \ echo "[package] go build $$platform"; \
GOOS=$$goos GOARCH=$$goarch go build -o "$$package_dir/$$binary_name" $(APP_ENTRY); \ GOOS=$$goos GOARCH=$$goarch go build -o "$$package_dir/$$binary_name" $(APP_ENTRY); \
echo "[package] copy assets $$platform"; \ echo "[package] copy assets $$platform"; \
cp -R dashboard/out "$$package_dir/dashboard/out"; \ cp -R web/out "$$package_dir/web/out"; \
cp -R widget/out "$$package_dir/widget/out"; \ cp -R widget/out "$$package_dir/widget/out"; \
echo "[package] include example config only"; \ echo "[package] include example config only"; \
cp config/config.example.yaml "$$package_dir/config/config.example.yaml"; \ cp config/config.example.yaml "$$package_dir/config/config.example.yaml"; \
+1 -1
View File
@@ -69,7 +69,7 @@ func NewServer() (*iris.Application, error) {
}) })
// 注册dashboard静态资源服务 // 注册dashboard静态资源服务
app.HandleDir("/", iris.Dir("dashboard/out"), iris.DirOptions{ app.HandleDir("/", iris.Dir("web/out"), iris.DirOptions{
IndexName: "index.html", IndexName: "index.html",
Compress: true, Compress: true,
ShowList: false, ShowList: false,