| Crates.io | wow-addon-builder |
| lib.rs | wow-addon-builder |
| version | 0.2.1 |
| created_at | 2025-11-22 10:27:30.406585+00 |
| updated_at | 2026-01-05 02:21:41.354939+00 |
| description | A powerful World of Warcraft addon build tool written in Rust |
| homepage | |
| repository | https://github.com/dulingzhi/wow-addon-builder |
| max_upload_size | |
| id | 1945178 |
| size | 412,259 |
这是一个用 Rust 重写的 World of Warcraft 插件构建工具,功能与原 TypeScript 版本的 wow-curse-tools 保持兼容。
--verbose 查看详细调试信息--quiet 只显示错误信息.wctrc (JSON) 或 wct.toml 配置文件wct new 命令快速创建插件项目git clone <repository-url>
cd wow-addon-builder
cargo build --release
编译后的可执行文件位于 target/release/wct.exe
将 target/release 目录添加到系统 PATH 环境变量,即可在任意位置使用 wct 命令。
使用模板快速创建插件项目:
# 交互式创建
wct new MyAddon
# 指定模板创建
wct new MyAddon --template advanced
可用模板:
在现有项目目录下运行:
wct init
这将交互式地配置 package.json 中的 WoW 插件信息。
wct init-config
生成 .wctrc 配置文件,可以配置:
在插件项目目录下运行:
wct init
这将交互式地配置 package.json 中的 WoW 插件信息。
打包所有构建版本:
wct package
打包特定版本:
wct package Mainline
wct package Wrath Vanilla
构建一次:
# 基本用法
wct build Mainline
# 详细输出
wct build Mainline --verbose
# 静默模式
wct build Mainline --quiet
# 禁用缓存
wct build Mainline --no-cache
指定输出目录:
wct build Mainline -O "C:\Games\World of Warcraft\_retail_\Interface\AddOns"
监视模式(自动重新构建):
wct watch Mainline
示例输出:
ℹ Building addon...
✓ Build completed!
Build Summary
42 files processed in 0.23s
✓ 8 compiled
✓ 12 copied
○ 22 skipped (unchanged)
📦 Total size: 1.24 MB
⚡ Speed: 183 files/sec
从 CHANGELOG.md 生成 BBCode 格式:
wct changelog
自动扫描并保存 WoW 路径:
# 自动探测所有版本的 WoW 安装路径
wct config scan
交互式配置 WoW 路径和 API Token:
wct config set
这将引导你设置:
# 使用配置的 token
wct publish
# 使用命令行参数
wct publish -T YOUR_CURSEFORGE_TOKEN
# 发布特定版本
wct publish Mainline Wrath
导出翻译:
wct locale export -T YOUR_TOKEN
导入翻译:
wct locale import -T YOUR_TOKEN
扫描本地化字符串:
wct locale scan
扫描功能会查找代码中的本地化字符串,支持以下模式:
L["key"] 或 L['key']GetLocale("key")locale["key"]可以导出为 Lua 或 JSON 格式,或与现有 locale 文件对比。
从 GitHub 或 CurseForge 下载依赖库(需要 .pkgmeta 文件):
wct update
.pkgmeta 示例:
externals:
Libs/LibStub: github@DengSir/LibStub@[releases]
Libs/CallbackHandler: curse@callbackhandler
Libs/AceAddon: github@WoWUIDev/Ace3@AceAddon-3.0
# 使用配置的 cookie
wct nga
# 使用命令行参数
wct nga --cookie YOUR_NGA_COOKIE
项目级配置文件支持 JSON 或 TOML 格式:
{
"build": {
"cache": true,
"cache_file": ".wct-cache.json",
"validate_lua": true,
"parallel": false,
"exclude": [".git/**", "*.md"]
},
"package": {
"output_dir": "dist",
"filename_template": "{name}-{version}.zip",
"compression_level": 6,
"include_changelog": true
},
"publish": {
"auto_publish": false,
"targets": ["curseforge"],
"release_type": "release"
},
"dev": {
"watch": {
"debounce": 300,
"ignore": ["*.tmp"]
}
}
}
存储全局设置和密钥:
{
"curse-forge-token": "YOUR_TOKEN",
"github-token": "YOUR_TOKEN",
"buildPath": {
"Mainline": "C:\\Games\\World of Warcraft\\_retail_",
"Wrath": "C:\\Games\\World of Warcraft\\_classic_"
}
}
{
"name": "my-addon",
"version": "1.0.0",
"wow": {
"name": "MyAddon",
"curse_id": 123456,
"builds": {
"Mainline": "110000",
"Wrath": "30403",
"Vanilla": "11503"
},
"addons": {
"MyAddonCore": "./Core",
"MyAddonConfig": "./Config"
},
"res-filters": [
"*.psd",
"*.blend"
],
"no-compiles": [
"Libs/**/*.lua"
],
"changelog": "CHANGELOG.md"
}
}
"nga_id": {
"Mainline": 12345678
}
工具支持在代码中使用条件注释来控制不同版本的代码:
--@retail@
print("This only appears in retail")
--@end-retail@
--@debug@
print("This only appears in debug builds")
--@end-debug@
<!--@retail@-->
<Script file="RetailOnly.lua"/>
<!--@end@-->
## Interface-Mainline@
RetailScript.lua
## Interface-Wrath@
WrathScript.lua
本工具保持与原 wow-curse-tools 的命令行接口兼容,可以直接替换使用。主要改进:
package.json 配置格式完全兼容当前版本实现了核心功能:
待完善功能:
MIT License
本项目基于 @Dencer 的 wow-curse-tools 重写,感谢原作者的出色工作。