Skip to content

Conversation

@hckhanh
Copy link
Owner

@hckhanh hckhanh commented Nov 3, 2025

This pull request introduces significant improvements to the project's developer tooling, automation, and documentation. The main focus areas are the addition of automated formatting and dependency consistency tools, enhancements to CI workflows (including benchmarks and autofix), and the introduction of configuration files for various tools. There are also updates to documentation and package metadata to improve clarity and maintainability.

CI/CD and Automation Enhancements:

  • Added a new .github/workflows/autofix.yml workflow to automatically apply code fixes and formatting using Biome and Syncpack, and submit them via autofix.ci.
  • Updated .github/workflows/tests.yml to use mise-action for toolchain setup, streamlined dependency installation, and added a new benchmark job that runs performance benchmarks with CodSpeed. [1] [2] [3]

Tooling and Configuration:

  • Introduced biome.json for code formatting and linting configuration, enabling automated code style enforcement.
  • Added .syncpackrc.json to enforce consistent and sorted dependencies in package.json files.
  • Added mise.toml to specify consistent versions for Node.js, npm, and pnpm across development environments.
  • Added codecov.yml to configure code coverage reporting and thresholds.
  • Updated pnpm-workspace.yaml to specify esbuild as a dependency that must be built.

Benchmarking and Testing:

  • Added comprehensive benchmarks for number formatting functions in src/format/number.bench.ts, covering various input types, edge cases, and real-world scenarios.

Documentation and Metadata Improvements:

  • Improved badges and clarity in README.md, and made minor corrections to feature descriptions. [1] [2] [3] [4] [5] [6]
  • Updated package.json and jsr.json to include more complete metadata, author information, and improved publish/include/exclude rules. [1] [2] [3]
  • Improved renovate.json configuration for dependency update automation, with new grouping and scheduling rules.

These changes collectively enhance the project's maintainability, code quality, and developer experience.

Added `syncpack` and `biome` configuration for consistent project dependencies and formatting. Updated `renovate.json` and introduced additional tooling files like `.syncpackrc.json`, `biome.json`, `pnpm-workspace.yaml`, and `mise.toml`. Enhanced TypeScript configurations for better compilation and bundling settings.
Introduced a new `autofix.ci` workflow to apply automated fixes on PRs and pushes to the main branch. Replaced individual Node.js and pnpm setup in test workflows with a unified toolchain setup using `jdx/mise-action` for consistency.
Updated function syntax in test files to use arrow functions for consistency. Added trailing commas in multiline arguments and object definitions. Reorganized imports in `NumberReader.ts` and improved object method access in static methods for better clarity.
Introduced `tsdown.config.ts` for bundling settings with ESM output and DTS generation. Added `vitest.config.mts` with Codspeed plugin and custom exclusions for tests and coverage. Enhances development and testing workflows.
Replaced the outdated JSR badge with separate badges for weekly downloads and JSR. Improves the README's informational clarity and visual appeal by showcasing key project metrics.
Adjusted formatting by moving the description above the badges for better structure. Updated a minor phrasing in the release notes section for clarity.
Simplified and standardized section titles by removing example text from headers. This improves readability and maintains a consistent structure throughout the documentation.
Introduced benchmarking for `formatVnNumber`, `formatVnCurrency`, `formatVnPercent`, and `readVnNumber` to evaluate performance under various scenarios. These tests help identify performance bottlenecks and ensure the reliability and efficiency of the formatting functions. Updated CI workflow to include a benchmark step using CodSpeed.
Copilot AI review requested due to automatic review settings November 3, 2025 03:31
@autofix-troubleshooter
Copy link

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

Copy link
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 modernizes the codebase with significant tooling and code quality improvements, including migration to Biome for linting/formatting, addition of benchmarking infrastructure, and code style consistency updates.

  • Adds new tooling (Biome, syncpack, tsdown, CodSpeed benchmarking)
  • Updates configuration files (tsconfig, vitest, mise) with modern best practices
  • Applies code style improvements (trailing commas, arrow functions, modern API usage)

Reviewed Changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
biome.json Configures Biome linter/formatter with project-specific rules
vitest.config.mts Adds vitest configuration with CodSpeed plugin and coverage settings
tsdown.config.ts Configures tsdown build tool for ESM output
tsconfig.json Modernizes TypeScript config with bundler mode and stricter settings
package.json Adds new dev dependencies and reorders fields
mise.toml Defines node/npm/pnpm versions for development
.syncpackrc.json Configures syncpack for package.json consistency
src/**/*.test.ts Updates test syntax from function expressions to arrow functions
src/**/*.bench.ts Adds comprehensive benchmark suites for performance tracking
src/read/Utils.ts Updates to modern API (Object.hasOwn) and adds trailing commas
src/read/NumberReader.ts Replaces 'this' with explicit class name and reorders imports
src/format/number.ts Adds trailing commas for consistency
renovate.json Updates Renovate configuration with new presets
.github/workflows/*.yml Updates CI workflows to use mise for toolchain setup
README.md Minor formatting improvements in section headers
jsr.json Simplifies publish configuration
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

})

it('should read number 2.500.000.000 in BigIn', function () {
it('should read number 2.500.000.000 in BigIn', () => {
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'BigIn' to 'BigInt'.

Suggested change
it('should read number 2.500.000.000 in BigIn', () => {
it('should read number 2.500.000.000 in BigInt', () => {

Copilot uses AI. Check for mistakes.
hckhanh and others added 2 commits November 3, 2025 10:40
Replaced Prettier checks with Biome for formatting and added `syncpack` commands for dependency management. Updated test workflow to improve coverage reporting using Codecov, and removed obsolete Prettier configurations from the repository.
@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

hckhanh and others added 16 commits November 3, 2025 10:43
Upgraded `vitest` to 4.0.5 for compatibility and performance improvements. Added `@codspeed/vitest-plugin` to enhance benchmarking capabilities, ensuring better testing accuracy and performance analysis.
Removed `@edge-runtime/vm`, `happy-dom`, and `jsdom` from `devDependencies` in `package.json` as they were no longer in use. Adjusted `pnpm-lock.yaml` to reflect these changes and marked related dependencies as optional where applicable.
Added a step to automatically fix audit issues using `pnpm audit --fix` for improved dependency security. Adjusted `pnpm install` step to no longer use the `--fix-lockfile` option for better compatibility and workflow stability.
Added `@vitest/coverage-v8` to `devDependencies` for enhanced test coverage reporting. Removed outdated overrides for `happy-dom` in `pnpm-lock.yaml` and `pnpm-workspace.yaml` to simplify dependency management. Adjusted the lockfile to include new transitive dependencies.
Introduced Changesets configuration files to support version management and publishing workflows. This setup provides tools for managing multi-package or single-package repositories, improving release processes.
Optimized the GitHub Actions workflow by simplifying and restructuring steps in the publish process. Replaced `semantic-release` with `changesets` for improved versioning and release management, and removed the obsolete `.releaserc.json` configuration. This enhances the workflow's efficiency and maintainability.
Added `main`, `module`, `types`, and `exports` fields in `package.json` to establish proper package entry points. Updated `files` to include `dist` for NPM publication and upgraded `version` to `1.5.7`. Enhanced the build setup with `tsdown` and `[email protected]` for improved TypeScript support.
Updated the test job name in the GitHub Actions workflow to `unit-test`. This improves job naming consistency and distinguishes unit tests from other potential test types in the workflow.
Bumped `vitest` and related packages (`@vitest/coverage-v8`, `@vitest/expect`, etc.) to version 4.0.6 in `package.json` and `pnpm-lock.yaml`. These updates ensure compatibility, performance improvements, and the latest features for testing.
Simplified `vitest.config.mts` by removing redundant `coverage` and `exclude` settings. These configurations are no longer applicable or needed, streamlining the test configuration.
Updated `esbuild` to version 0.25.12 in `pnpm-lock.yaml`, ensuring compatibility with the latest features and bug fixes. Removed multiple unused dependencies from the lockfile, significantly simplifying and streamlining the dependency tree.
Updated the bench description in `number.bench.ts` to replace "100%" with "100 percent". This improves readability and aligns with descriptive naming conventions in benchmarks.
Updated `actions/checkout` to v5.0.0 and `denoland/setup-deno` to v2.0.3 in the GitHub Actions workflows. Added descriptive step names for better readability and consistency across the workflow.
Added the `override` specifier to `read` methods in `Billion` and `Zerofill` classes for better clarity and adherence to TypeScript standards. Updated doc comments for consistency and clarity by correcting phrasing.
Removed the `needs: lints` dependency from the Deno job in the GitHub Actions workflow. This cleanup eliminates a redundant configuration, streamlining the workflow setup without affecting functionality.
@hckhanh hckhanh self-assigned this Nov 3, 2025
@hckhanh
Copy link
Owner Author

hckhanh commented Nov 3, 2025

Blocked by CodSpeedHQ/codspeed-node#66

Removed the `CODSPEED_TOKEN` secret from the bench job in the GitHub Actions workflow. This token is no longer necessary and its removal simplifies the job configuration.
Downgraded `vitest` and `@vitest/coverage-v8` to version 3.2.4 in `package.json`. This change addresses compatibility issues or aligns with project requirements by using stable, well-supported versions.
Removed the `NODE_OPTIONS` environment variable from the bench job in the GitHub Actions workflow. This cleanup eliminates redundant settings, simplifying the workflow configuration without affecting functionality.
Reverted `esbuild` from 0.25.12 to 0.25.11 in `pnpm-lock.yaml` for compatibility with `[email protected]`. Removed unused references to `[email protected]`, simplifying the lockfile and ensuring a consistent dependency tree.
Updated the autofix workflow to use `pnpm install --no-frozen-lockfile`. This ensures flexibility in resolving dependencies, particularly when the lockfile may not align with the current environment.
Updated the bench command in the GitHub Actions workflow to include a `--testTimeout 10000` flag. This ensures that benchmarks have adequate time to complete without timing out in CI environments.
Removed redundant `--testTimeout` flag from vitest bench command in workflows. Standardized and clarified benchmark descriptions for better readability and alignment with typical usage scenarios. Streamlined batch and real-world operation setups across all benchmarks without affecting functionality.
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2025

Refactored `metrics` data generation and number reading loops for better readability and maintainability. Ensured consistent code style and alignment with project formatting guidelines without altering functionality.
@hckhanh hckhanh merged commit 8e3032f into main Nov 3, 2025
6 checks passed
@hckhanh hckhanh deleted the upgrade branch November 3, 2025 06:29
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.

4 participants