Skip to content

Conversation

@SynergyMike
Copy link
Contributor

In consuming projects with strict mode enabled in their tsconfig.json, they will experience issues compiling due to how typescript is resolving imports. Currently, index.d.ts is exporting nn, optimizers, and utils from lib/ instead of from dist/, which causes typescript to include those source files (instead of just the declaration files) during compilation/type-checking of the importing project.

CleanShot 2025-04-18 at 16 28 55@2x

This change aims to remedy that by:

  • Moving exports into lib/index.ts to be included in the compilation output
  • Changing types in package.json to point to the compilation output
  • Moving the bindings import/export into its own file lib/core.ts (which also accounts for the circular reference issues)
  • Only using a root level .d.ts file for declaring the shape of the bindings import

@SynergyMike SynergyMike changed the title fix: Build issues in consuming projects using 'strict' mode in tsconfig fix: Build issues using 'strict' mode in tsconfig Apr 19, 2025
Copy link
Contributor

@zcbenz zcbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, it has been a long time headache for me to correctly export types.

Can you do a rebase on latest main? I added a change to run CI for pull requests.

@SynergyMike SynergyMike force-pushed the synergymike/update-ts-exports branch from 7e4e7eb to 1fa1a5a Compare April 19, 2025 06:15
@SynergyMike
Copy link
Contributor Author

No worries! Thank you for bringing this to Node 💜

@zcbenz zcbenz merged commit 4bf8b1d into frost-beta:main Apr 19, 2025
6 checks passed
@SynergyMike SynergyMike deleted the synergymike/update-ts-exports branch April 19, 2025 16:07
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.

2 participants