Files
wind_power_cal/.claude/skills/wind-build-run/SKILL.md
T
cloud 3cb7684039 更新项目 skills 并完善设计功率曲线前端
- skills: 移除 edge_collector 专属技能(OTA/协议/边缘主机/collector 等),
  保留通用工程规范(analyze-questions/cpp-coding-style/git-commit/shell-scripting/
  frontend-debug/frontend-dialog/frontend-ui-conventions),新增 wind_power_cal
  项目技能(wind-project-overview/build-run/deploy/backend-conventions/
  frontend-conventions/third-party-libs)与元技能 skill-builder;
  .agents/skills 与 .claude/skills 保持同步
- 前端: HomePage/App.css 增加设计功率曲线录入与图表展示

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-14 17:50:23 +08:00

34 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: wind-build-run
description: wind_power_cal 本地构建与运行规范。用于编译后端、构建前端、打包 runtime、或本地运行前后端时,按正确脚本和顺序操作。
---
# 本地构建与运行
## 首次 / Drogon 缺失
`third_party/ensure_third_party.sh` 源码编译 Drogon+Trantor → `third_party/drogon/install/<arch>/`。产物存在则秒过(幂等)。详见 [[wind-third-party-libs]]。
## 打包
`bash package.sh --build-type Release`
`runtime/wind_power/``wind_server` + `config/` + `web/`(前端 dist+ `libs/`libdrogon/libtrantor .so+ `logs/`
`--publish` 额外生成 `publish/wind_power-<ver>.tar.gz`
## 运行
- 一键(后端托管 SPA):`./run.sh`,访问 http://localhost:8848/
- 仅后端:`bash backend/run.sh`(先 build.sh 再启动,设 `LD_LIBRARY_PATH=libs`
- 开发(前后端分离热更):
- 后端 `bash backend/run.sh`:8848
- 前端 `cd frontend/web_app && npm install && npm run dev`:5173,代理 `/api`→:8848
## 后端构建细节
- `backend/CMakeLists.txt``find_package(Drogon CONFIG REQUIRED)``file(GLOB_RECURSE src/*.cpp)`,链 `Drogon::Drogon`include `src` + `third_party`
- 架构检测 `x64/arm64/arm32`;自动注入 `DROGON_LOCAL_PREFIX`
- 运行期 .so 解析:RPATH `$ORIGIN/../lib` + run.sh 设 `LD_LIBRARY_PATH=<app>/libs`
- Drogon 编译依赖(Ubuntu):`libssl-dev libc-ares-dev uuid-dev libjsoncpp-dev zlib1g-dev libbrotli-dev`
## 前端构建
- `npm run build``frontend/web_app/dist/``package.sh` 会 rsync 到 `runtime/wind_power/web/`
- 入口 `src/main.jsx``App.jsx`react-router)。
> 调用 `ensure_third_party.sh` 时**必须**显式传 `THIRD_PARTY=<root>/third_party`(见 [[wind-third-party-libs]]),否则 `SCRIPT_DIR` 推导出错。