基于Tree-sitter的TypeScript解析器 - .NET绑定
dotnet add package TypeScriptParser# 1. 构建native库
(cd tree-sitter/ && make clean && make)
# 2. 复制运行时文件
RID=$(dotnet --info | grep "RID:" | awk '{print $2}')
mkdir -p TypeScriptParser/runtimes/$RID/native
cp -r tree-sitter/dist/* TypeScriptParser/runtimes/$RID/native/
# 3. 构建和测试
dotnet restore
dotnet build -c Release
dotnet test --configuration Release
# 4. 打包NuGet包
dotnet pack -c Release -o ./artifacts
# 5. 测试打包
dotnet package add TypeScriptParser --project TypeScriptParser.TestPackage/ --version 0.0.1-dev
dotnet test TypeScriptParser.TestPackageTypeScriptParser/- 主要的.NET绑定库TypeScriptParser.Tests/- 单元测试
- Linux x64
- macOS ARM64
- Windows x64
- 创建功能分支
- 提交Pull Request → 自动构建测试
- 合并到main分支
- 创建版本标签:
(VERSION=v0.0.1 && git tag $VERSION && git push origin $VERSION)- 自动构建测试发布到NuGet.org
- 版本号格式:
1.2.0.{构建号}