fix(NodeNext): add package entrypoints - #143
Conversation
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1794af08e9
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "./dist/*": { | ||
| "types": "./dist/*.d.ts", | ||
| "import": "./dist/*.js", | ||
| "require": "./dist/*.js", | ||
| "default": "./dist/*.js" |
There was a problem hiding this comment.
Preserve dist directory deep imports
When consumers still import a directory-style dist subpath such as require('@stoqey/ibkr/dist/account'), this wildcard substitutes account into ./dist/*.js, so Node now resolves /dist/account.js and throws MODULE_NOT_FOUND instead of falling through to /dist/account/index.js; adding an exports map disables the previous package subpath directory resolution. Since the change explicitly aims to keep existing dist deep imports working, add explicit ./dist/account, ./dist/connection, etc. index entries (and ./dist if needed) rather than relying only on the file wildcard.
Useful? React with 馃憤聽/ 馃憥.
Summary
exportsfor the root module, domain subpaths, existingdistdeep imports, andregisterhelpers.typesVersionsmappings so subpath type resolution still works for consumers that do not read export-condition types.distpaths.Tests run
yarn test:types:nodenextyarn lintgit diff --checknpm pack --dry-runRisks / follow-ups