Skip to content

Conversation

@schickling
Copy link

Summary

This PR fixes TypeScript module resolution for consumers using moduleResolution: "NodeNext".

  • Add .js extensions to all relative imports/exports in TypeScript source files
  • Convert directory imports like ./lib to ./lib/index.js
  • Convert from "." imports to from "./index.js"

Problem

When TypeScript processes the package with moduleResolution: "NodeNext", it cannot resolve re-exports like export * from "./renderer" because NodeNext requires explicit file extensions. This causes TypeScript to report errors like:

Module '"@opentui/core"' has no exported member 'BoxRenderable'.
Module '"@opentui/react"' has no exported member 'createRoot'.

Solution

Add explicit .js extensions to all relative imports/exports. TypeScript understands that ./renderer.js refers to ./renderer.ts during compilation, and the generated .d.ts files will have the correct extensions for NodeNext resolution.

Test plan

Fixes #504


Generated with Claude Code

This fixes TypeScript module resolution for consumers using
`moduleResolution: "NodeNext"`. Without explicit `.js` extensions,
TypeScript cannot resolve re-exports like `export * from "./renderer"`
in the generated declaration files.

Changes:
- Add `.js` extensions to all relative imports/exports in source files
- Convert directory imports like `./lib` to `./lib/index.js`
- Convert `from "."` imports to `from "./index.js"`

Fixes anomalyco#504

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 1, 2026

@opentui/core

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core@614

@opentui/react

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/react@614

@opentui/solid

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/solid@614

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-arm64@614

@opentui/core-darwin-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-x64@614

@opentui/core-linux-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-arm64@614

@opentui/core-linux-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-x64@614

@opentui/core-win32-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-arm64@614

@opentui/core-win32-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-x64@614

commit: e5bb983

@msmps
Copy link
Collaborator

msmps commented Feb 1, 2026

@schickling mind running a quick prettier:write from the root?

@schickling
Copy link
Author

@msmps Thanks for the review! I've resolved the merge conflict and run prettier:write as requested.

Resolved:

  • Merged latest main branch changes
  • Fixed conflict in Markdown.test.ts by combining both the .js extensions (for NodeNext compatibility) and the new TextRenderable import from upstream
  • Applied prettier formatting

Ready for another look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript NodeNext resolution fails with extensionless re-exports

3 participants