yaak
yaak copied to clipboard
Fix/vendor node output
This pull request addresses two minor but impactful issues in the project's vendoring scripts (scripts/vendor-node.cjs and scripts/vendor-protoc.cjs), enhancing the robustness of the development setup and improving the overall developer experience.
Changes Introduced:
-
scripts/vendor-node.cjs- Suppressnode --versionoutput:- Problem: Previously, the tryExecSync function used stdio: 'inherit' when checking the vendored Node.js version. This caused the node --version output to be printed to the console every time the bootstrap script ran this check, leading to unnecessary console noise.
- Fix: Changed stdio: 'inherit' to stdio: 'pipe' in tryExecSync.
- Benefit: This change prevents extraneous output, resulting in a cleaner and less verbose console during the bootstrap process. Developers will now only see relevant messages, improving clarity and focus.
-
scripts/vendor-protoc.cjs- Improve error handling and suppressprotoc --versionoutput:- Problem 1 (Error Handling): The main asynchronous function's error handler only logged errors but did not terminate the script with process.exit(1). If protoc vendoring failed, the bootstrap process would continue, potentially leading to confusing cascading errors later on.
- Problem 2 (Console Noise): Similar to vendor-node.cjs, the tryExecSync function used stdio: 'inherit' for the protoc --version check, adding unnecessary output to the console.
- Fix 1: Added process.exit(1) to the error handler of the main async function.
- Fix 2: Changed stdio: 'inherit' to stdio: 'pipe' in tryExecSync.
- Benefit: The improved error handling ensures that the bootstrap process fails fast and provides immediate, clear feedback if protoc vendoring encounters an issue. This prevents wasted time debugging subsequent failures. The stdio: 'pipe' change also contributes to a cleaner console output, consistent with the vendor-node.cjs fix.
These changes are bug fixes that enhance the reliability and user-friendability of the project's development setup, aligning with the project's contribution policy.