Skip to content

v3: migrate Numeral.js runtime to TypeScript#798

Open
adamwdraper wants to merge 7 commits intomasterfrom
adamwdraper/create-v3-pr
Open

v3: migrate Numeral.js runtime to TypeScript#798
adamwdraper wants to merge 7 commits intomasterfrom
adamwdraper/create-v3-pr

Conversation

@adamwdraper
Copy link
Copy Markdown
Owner

This PR delivers the full 3.0.0 rewrite with TypeScript as the source of truth across core, formats, and locales while preserving existing runtime behavior. It expands core API coverage in tests, adds bundled type declarations, updates package metadata/scripts for the TS-backed build, and regenerates JS/minified distribution artifacts. It also adds GitHub Actions CI (Node 18/20/22), updates README/changelog for v3, and includes a migration guide. Validation: npm test passes (181 tests).

Copy link
Copy Markdown

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 delivers version 3.0.0, a comprehensive TypeScript migration of Numeral.js while preserving existing runtime behavior. The migration converts all core, format, and locale files from JavaScript to TypeScript as the source of truth, adds bundled type declarations, updates build infrastructure, and implements GitHub Actions CI for Node 18/20/22.

Changes:

  • Migrated entire codebase from JavaScript to TypeScript with type definitions
  • Added first-party TypeScript declarations via numeral.d.ts
  • Updated build pipeline to compile TypeScript before Grunt tasks
  • Replaced Travis CI with GitHub Actions (Node 18/20/22)
  • Updated documentation with v3 migration guide

Reviewed changes

Copilot reviewed 130 out of 168 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.core.json TypeScript compiler configuration for ES5 target
src/numeral.ts Main TypeScript source (762 lines) with type definitions
src/numeral.js Generated JavaScript from TypeScript compilation
numeral.d.ts Bundled TypeScript declarations for consumers
src/globals.d.ts Global type declarations for module systems
src/formats/*.ts Format plugins migrated to TypeScript
src/locales/*.ts Locale files migrated to TypeScript
tests/numeral.js Expanded test coverage with new API tests
package.json Updated to 3.0.0, added types field, TypeScript dev dependency
.github/workflows/ci.yml New GitHub Actions CI workflow
README.md Updated docs with v3 notes and contribution guide
MIGRATION.md New migration guide for upgrading to 3.0.0

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

Comment on lines +5 to +6
"strict": false,
"noImplicitAny": false,
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

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

The TypeScript compiler option "strict" is set to false, which disables all strict type checking. For a TypeScript migration, it's recommended to enable strict mode to catch type errors and enforce better type safety. Consider setting "strict": true or at minimum enabling "noImplicitAny": true.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

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

Copilot reviewed 131 out of 170 changed files in this pull request and generated no new comments.


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

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