feat: walk up to discover parent tsconfig.json#569
Open
fengmk2 wants to merge 3 commits intooxc-project:mainfrom
Open
feat: walk up to discover parent tsconfig.json#569fengmk2 wants to merge 3 commits intooxc-project:mainfrom
fengmk2 wants to merge 3 commits intooxc-project:mainfrom
Conversation
When oxnode is run from a sub-project of a monorepo that has no local tsconfig.json, previously the root workspace's tsconfig.json was silently ignored. This made settings like experimentalDecorators configured at the root inapplicable to sub-projects. init_resolver now walks up cwd.ancestors() to find a tsconfig.json when: - neither TS_NODE_PROJECT nor OXC_TSCONFIG_PATH is set, and - cwd/tsconfig.json does not exist. Explicit env var settings are still honored as-is, so a non-existent path in TS_NODE_PROJECT/OXC_TSCONFIG_PATH disables discovery entirely (escape hatch). Matches the behavior of tsc, ts-node, and tsx.
…check - Track tsconfig_exists inline with path resolution so the manual TsconfigDiscovery gate no longer re-stats the same path. - Use Path::is_absolute() so an absolute TS_NODE_PROJECT/OXC_TSCONFIG_PATH on Windows (e.g. C:\\proj\\tsconfig.json) is not joined with cwd.
Contributor
Author
|
@cursor review |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
6 tasks
The subprocess pattern used by this spec (`node --input-type=module -e`
with an inline `await import("@oxc-node/core")`) crashes when
NAPI_RS_FORCE_WASI=1 is inherited into the child — the forced-WASI
worker init fails inside a nested inline ESM script. The walk-up
logic itself is platform-agnostic and already exercised on every
native target in CI.
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.
When oxnode is run from a sub-project of a monorepo that has no local
tsconfig.json, previously the root workspace's tsconfig.json was
silently ignored. This made settings like experimentalDecorators
configured at the root inapplicable to sub-projects.
init_resolver now walks up cwd.ancestors() to find a tsconfig.json when:
Explicit env var settings are still honored as-is, so a non-existent
path in TS_NODE_PROJECT/OXC_TSCONFIG_PATH disables discovery entirely
(escape hatch). Matches the behavior of tsc, ts-node, and tsx.