fix(export): set exit code 0 on a successful export#152
Open
arpitjain099 wants to merge 1 commit into
Open
Conversation
The success branches (css-tailwind, json-tailwind, dtcg, css-vars) write their output but never assign process.exitCode, so a successful export left the code at its incoming value instead of an explicit 0. That is the success-path counterpart to google-labs-code#126, which decoupled the exit code from source lint findings; the subprocess test there only exercises json-tailwind and a real process happens to exit 0 when exitCode is unset, so the gap went unnoticed. Set process.exitCode = 0 after the format branches (every error branch already returns first). The in-process export.test.ts added in google-labs-code#109 asserts process.exitCode === 0 after a css-vars export, so it was failing on main. Also fix a companion assertion in that file: it read error.error for the human message, but the error envelope is { error: CODE, message: TEXT }, so the text lives on error.message. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The export success branches (css-tailwind, json-tailwind, dtcg, css-vars) write their output but never assign
process.exitCode, so a successful run just leaves whatever value was already there rather than an explicit 0. This is the success-path counterpart to #126: that PR decoupled the exit code from source lint findings, but its subprocess test only covers json-tailwind, and a real process exits 0 whenexitCodeis unset, so the gap slipped through. I setprocess.exitCode = 0after the format branches (every error branch already returns first, so it only runs on success).While confirming that, the in-process
export.test.tsadded in #109 turned out to be failing on main: it assertsprocess.exitCode === 0after a css-vars export, which was undefined. The same file also readerror.errorfor the human-readable message, but the error envelope is{ error: CODE, message: TEXT }, so I pointed that one assertion aterror.message.Verified with
bun testinpackages/cli: the twoexport.test.tsfailures now pass and the full suite is green (308 pass, 1 skip, 0 fail),bun run lintclean. Happy to adjust if you'd rather split the test-assertion tweak out. Thanks!