Skip to content

refactor: rename mod.ts to index.ts, + misc improvements#13

Merged
nberlette merged 21 commits intomainfrom
refactor/imports
Jan 12, 2026
Merged

refactor: rename mod.ts to index.ts, + misc improvements#13
nberlette merged 21 commits intomainfrom
refactor/imports

Conversation

@nberlette
Copy link
Copy Markdown
Owner

@nberlette nberlette commented Jan 12, 2026

Closes #12.

Changes

  • refactor: rename mod.ts to src/index.ts
  • refactor: use inline jsr imports for test utils
  • refactor(float16): rename entrypoint from mod.ts to index.ts
  • refactor(float32): rename entrypoint from mod.ts to index.ts
  • refactor(guards): rename entrypoint from mod.ts to index.ts
  • refactor(types): rename entrypoint from mod.ts to index.ts
  • refactor(constants): switch to index.ts, clean up imports
  • refactor(Imports): update index and deno.json
  • refactor(ieee754): update float16 and float32 specifiers
  • tests: update imports in trigonometry test
  • feat: add default export to root module
  • fix(tests): update doctest imports in exp module
  • refactor(guards): improve imports and docs
  • refactor(float16): improve imports and exports
  • refactor(float32): improve fround and float32 imports

Copilot AI review requested due to automatic review settings January 12, 2026 15:29
@nberlette nberlette added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 12, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the codebase to use index.ts instead of mod.ts as module entrypoints, aligning with modern JavaScript/TypeScript conventions. The changes also include improvements to documentation, inline JSR imports for test utilities, and refactoring of the float16/float32 encode/decode functions to use shared configuration objects.

Changes:

  • Renamed all mod.ts files to index.ts across the codebase (root, constants, guards, types, float16, float32)
  • Updated test files to use inline JSR import specifiers instead of import map
  • Refactored float16/float32 encode/decode functions to use default exported configuration objects
  • Improved documentation and added missing @tags annotations in guard functions

Reviewed changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/index.ts New main entry point with all exports; replaces root mod.ts
src/types/index.ts New types module entry point
src/guards/index.ts New guards module entry point with improved documentation
src/guards/safe_integer.ts Updated implementation to inline integer check; added documentation notes
src/guards/integer.ts Added isNumberInteger function; improved documentation
src/guards/negative_infinity.ts Fixed category from "Arithmetic" to "Guards"; added @tags
src/guards/positive_infinity.ts Added @tags annotation
src/constants/index.ts New constants module entry point
src/float16/index.ts New float16 module entry point
src/float16/constants.ts Changed bit counts to hex notation; added default export object
src/float16/encode.ts Simplified to use default config object
src/float16/decode.ts Simplified to use default config object
src/float16/round.ts Updated import aliases; improved doctest example
src/float32/index.ts New float32 module entry point
src/float32/constants.ts Changed bit count to hex notation; added default export object
src/float32/encode.ts Simplified to use default config object
src/float32/decode.ts Simplified to use default config object
src/float32/round.ts Improved doctest example (though with a bug)
src/ieee754.ts Updated imports to use new index.ts paths
src/f16round.ts Simplified to call roundFloat16 directly
src/fround.ts Simplified to call roundFloat32 directly
src/sin.ts Updated imports to individual constant files
src/asin.ts Updated imports to individual constant files
src/acosh.ts Updated imports to individual constant files
src/exp.ts Updated doctest to use node:assert
src/trigonometry.test.ts Updated to use inline JSR imports and new index.ts path
src/random.test.ts Updated to use inline JSR imports
src/constants.test.ts Updated to use inline JSR imports and new index.ts path
mod.ts Deleted root entry point (moved to src/index.ts)
deno.json Updated all exports to point to index.ts files; removed imports section; added lint config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts
Comment thread src/guards/safe_integer.ts
Comment thread src/guards/index.ts Outdated
Comment thread src/float32/round.ts Outdated
Comment thread src/guards/integer.ts Outdated
Comment thread src/guards/integer.ts Outdated
Comment thread src/index.ts
Comment thread src/float32/constants.ts Outdated
@nberlette nberlette merged commit f3c5338 into main Jan 12, 2026
2 checks passed
@nberlette nberlette deleted the refactor/imports branch January 12, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: rename mod.ts to index.ts following node/npm conventions

2 participants