Skip to content

refactor: Modernising the repository#7

Open
jdrydn wants to merge 9 commits into
masterfrom
refactor/modern
Open

refactor: Modernising the repository#7
jdrydn wants to merge 9 commits into
masterfrom
refactor/modern

Conversation

@jdrydn

@jdrydn jdrydn commented Apr 11, 2026

Copy link
Copy Markdown
Member

This pull request modernizes the project's build, test, and linting infrastructure, updates Node.js support, and introduces a new ESM/CJS-compatible build output. It also migrates from Mocha to Vitest for testing, removes legacy configuration files, and adds comprehensive integration tests for both ESM and CJS usage. These changes improve maintainability, compatibility with modern tooling, and ensure robust multi-environment support.

  • Switches package output to a dist directory with both ESM (index.mjs) and CJS (index.js) entry points, updates the exports field for dual module support, and provides type declarations for both formats. (package.json)
  • Replaces legacy build/test scripts with tsup for building and updates scripts for linting (ESLint and type checks) and testing (unit and integration with Vitest). (package.json)
  • Migrates from Mocha/NYC to Vitest for both unit and integration testing, removing Mocha/NYC-specific configuration and dependencies.
  • Adds new integration tests to verify both ESM (integration-tests/esm.test.ts) and CJS (integration-tests/cjs.test.js) usage of the package, ensuring correct exports and error handling in both environments.
  • Updates the minimum supported Node.js version to 18 and expands CI testing to Node.js versions 18.x, 20.x, 22.x, 24.x, and 25.x.
  • Updates CI workflow steps to match new scripts and Node.js versions, including separate unit/integration test runs and a build step.
  • Removes the old .eslintrc.json and introduces a new eslint.config.mjs using the latest ESLint and TypeScript-ESLint flat config, with updated rules and ignore patterns.

These changes collectively modernize the project, improve compatibility with current JavaScript/TypeScript tooling, and ensure robust support for both ESM and CJS consumers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant