fix(grpc): 🐛 Fix gRPC doc generation for proto files organized in packages#1117
Conversation
|
🔍 Before proceeding, please review the contribution guidelines This includes requirements for:
Thanks for your PR. 🙏 In addition, if you have added new features, please provide example code in the repository smart-doc-group/smart-doc-example-cn. This will help other users understand how to use the new features. Code Style Reminder: 🔍 提交前请务必完成以下检查 需特别注意:
感谢您提交的PR。 🙏 另外,如果您添加了新功能,请在仓库smart-doc-group/smart-doc-example-cn中提供示例代码。这将帮助其他用户了解如何使用新功能。 代码风格提示: |
fc2ff43 to
7279b54
Compare
…kages - Closes TongchengOpenSource#1116 - Fixes the core issue: Resolves the problem where grpc-xxx goals fail when .proto files are organized using packages (e.g., base/enum.proto, file/fileops.proto). The root cause was an incorrect --proto_path calculation. - Enhances path handling: Refactored getUniqueParentDirectories to correctly find the deepest common ancestor directory, ensuring --proto_path points to the actual root of the .proto files. - Improves command robustness: Uses absolute paths for protoc, protoc-gen-doc, and all input .proto files to guarantee reliable execution across different environments. - Adds comprehensive logging: Logs the final protoc command for debugging and adds [protoc] prefix to plugin output, making it easier to distinguish between smart-doc logs and protoc errors.
7279b54 to
f585368
Compare
Closes gRPC doc doesn't work if proto files organized in package #1116
Fixes the core issue: Resolves the problem where grpc-xxx goals fail when .proto files are organized using packages (e.g., base/enum.proto, file/fileops.proto). The root cause was an incorrect --proto_path calculation.
Enhances path handling: Refactored getUniqueParentDirectories to correctly find the deepest common ancestor directory, ensuring --proto_path points to the actual root of the .proto files.
Improves command robustness: Uses absolute paths for protoc, protoc-gen-doc, and all input .proto files to guarantee reliable execution across different environments.
Adds comprehensive logging: Logs the final protoc command for debugging and adds [protoc] prefix to plugin output, making it easier to distinguish between smart-doc logs and protoc errors.