ITADN

fix: Build issues using 'strict' mode in tsconfig

#5Pull RequestSynergyMike 创建于 2025-04-19已合并
S
SynergyMikecommented
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](https://github.com/user-attachments/assets/8554ecfc-21e2-4af0-a8c4-f8e69f874758) 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
合并状态:已合并 合并于 2025-04-19 关闭于 2025-04-19 1 条评论