基于Tree-sitter的TypeScript解析器 - .NET绑定
dotnet add package TypeScriptParser
或通过包管理器控制台:
Install-Package TypeScriptParser也可以访问 NuGet包页面 查看更多安装选项。
# 1. 构建native库 (cd tree-sitter/ && make clean && make) # 2. 复制运行时文件 RID=$(dotnet --info | grep "RID:" | awk '{print $2}') mkdir -p TypeScriptParser.Native/runtimes/$RID/native cp -r tree-sitter/dist/* TypeScriptParser.Native/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.TestPackage
TypeScriptParser/- 主要的.NET绑定库TypeScriptParser.Native/- 跨平台Native库包TypeScriptParser.Tests/- 单元测试
dotnet build -c Debug
dotnet test --configuration Debug - Linux x64
- macOS ARM64
- Windows x64
- 创建功能分支
- 提交Pull Request → 自动构建测试
- 合并到main分支
- 创建版本标签:
git tag v1.2.0 && git push origin v1.2.0 - 自动构建测试发布到NuGet.org
- 版本号格式:
1.2.0.{构建号}