Repository navigation
fix(cli): keep oxnode watch --tsconfig over an --env-file's TS_NODE_PROJECT - #877
Merged
Merged
Conversation
…ROJECT --tsconfig now sets TS_NODE_PROJECT to the same path as OXC_TSCONFIG_PATH instead of removing it. Node.js keeps a variable the environment already has, so an env file can no longer override the choice. When both name the same path, the binding's warnings name OXC_TSCONFIG_PATH. Closes #876 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Closes #876.
tsconfigEnv()setsTS_NODE_PROJECTto the resolved--tsconfigpath instead of removing it, as the issue suggests.src/lib.rs: whenTS_NODE_PROJECTandOXC_TSCONFIG_PATHname the same path, the warnings (missing or unreadable config) nameOXC_TSCONFIG_PATH, the variable--tsconfigstands for. Without this,oxnode watch --tsconfig missing.jsonwould blameTS_NODE_PROJECT, which the user never set. Which config is used does not change.Tests
watch-cli.spec.ts:--tsconfig cli.json --env-file=.env, where.envsets bothTS_NODE_PROJECTandOXC_TSCONFIG_PATHto other configs; the run usescli.json. Fails before the fix.tsconfig-discovery.spec.ts: both variables naming one missing file gives theOXC_TSCONFIG_PATHwarning.watch-args.spec.ts: the new env values.--env-file,--env-file-if-existsand several env files. No other CLI path passes--tsconfigto a child.One side effect, for the maintainers
A process the app starts now inherits
TS_NODE_PROJECTas well. If it picks its own config by changing onlyOXC_TSCONFIG_PATH, the inheritedTS_NODE_PROJECTwins, since it is read first. This is the same as running withTS_NODE_PROJECT=cli.jsonset in the shell. Avoiding it would need the child's preload to undo the env file's value, which every loader embedding the watcher would have to do too, so this PR keeps the simple fix.🤖 Generated with Claude Code