feat(cli): load TypeScript config files with tsx, falling back to ts-node - #193
Merged
Conversation
tsx compiles the TypeScript config file and the project files it imports, and resolves tsconfig `paths` aliases from the tsconfig.json nearest to the working directory. It ships as a regular dependency, so a project needs no setup for a `.ts` config file. Compared with ts-node: hooks listed in the tsconfig `ts-node.require` field no longer run, aliases defined only in babel.config.js (babel-plugin-module-resolver) are not resolved, and type errors in the config file no longer stop the CLI.
floyd-soomgo
force-pushed
the
feat/tsx-config-loader
branch
from
September 3, 2026 15:48
6903c34 to
946c74a
Compare
floydkim
marked this pull request as ready for review
September 3, 2026 15:49
floydkim
marked this pull request as draft
September 6, 2026 12:16
…onal Projects that already set up ts-node keep working without a change, and tsx moves from a regular dependency to an optional peer dependency so a project adopts it when it is ready. The loader tries tsx first and falls back to ts-node, which leaves existing ts-node projects untouched while letting a migrating project switch by installing tsx alone. When neither is installed, the CLI points at tsx. Both are resolved from the project the config file lives in rather than from the CLI install. ts-node is no longer maintained, so the README marks support for it as deprecated without committing to a removal version.
ts-node is no longer maintained, and support for it as a config loader will be removed in a future major version. Projects still on it now see the notice on every command that reads the config file. The warning goes to stderr, so piping a command's JSON output is unaffected.
floydkim
marked this pull request as ready for review
September 6, 2026 13:49
floyd-soomgo
added a commit
that referenced
this pull request
Sep 7, 2026
## Summary - Run the setup scripts and e2e entry with tsx, and remove ts-node from the root devDependencies. - Update setup scripts to install and invoke tsx. Rename `configure-ts-node` to `configure-tsconfig`; it now only adds `code-push.config.ts` to `tsconfig.json`. - Remove ts-node configuration from all 13 example apps and regenerate the affected lockfiles. - Delete `scripts/setupExampleApp/tsconfig.json`, which was only used by `ts-node --project`. Depends on #193, which adds tsx as a library dependency. Its three commits are included in this PR until #193 merges. ## Verification - `npm run type:scripts`, `npm run type:e2e`, and ESLint for changed scripts - Confirmed tsx launches both setup scripts and `e2e/run.ts` with `--help` - Confirmed `Examples/RN0821` syncs the local library through tsx --------- Co-authored-by: Floyd Kim <for12gm@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.
Summary
code-push.config.tswithtsx, falling back tots-nodefor projects that still use it.tsxandts-nodeoptional peer dependencies, so projects install the loader they choose.tsx.tsx, support default exports andtsconfigpathsaliases..jsconfig files continue to load through Node'srequire.pathsalias.tsxand deprecatets-nodesupport.ts-node.Compatibility notes
Existing
ts-nodeprojects need no changes. Installingtsxmakes it the preferred loader; removingts-nodeis optional.After switching to
tsx:ts-node.requireno longer runbabel.config.jsare not resolved; define them intsconfig.jsonpathstsxtranspiles without type-checkingts-nodesupport is deprecated and will be removed in a future major version.Verification
npm run type:cliand ESLint on changed filesnpm run --workspace cli test: 11 suites, 102 teststsconfigpathsaliasests-nodefallback with a CommonJS config in a project that hasts-nodebut nottsxtsxinstallation hint and exit code 1 when neither loader is installedFollow-up
Example setup scripts and apps still use
ts-node; their migration is handled separately in #194.