Skip to content

Conversation

@Belco90
Copy link
Member

@Belco90 Belco90 commented Dec 12, 2025

Checks

Changes

  • Set up a bundler (tsdown)
  • Update package.json fields for CJS and ESM exposed files
  • Set up publint for linting the published bundle
  • Update type to "module"
  • Move CJS code to ESM
  • Rename lib/ to src/ to better reflect the folder holds the source code but must be bundled

Context

Closes #900

@Belco90 Belco90 self-assigned this Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (9c78006) to head (8464ca9).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1130      +/-   ##
==========================================
- Coverage   97.48%   97.47%   -0.01%     
==========================================
  Files          49       49              
  Lines        5997     5974      -23     
  Branches     1518     1518              
==========================================
- Hits         5846     5823      -23     
  Misses        149      149              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Belco90 Belco90 requested a review from a team December 16, 2025 08:57
@Belco90 Belco90 marked this pull request as ready for review December 16, 2025 08:57
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 build infrastructure by converting from CommonJS to ESM format and setting up a bundler (tsdown). The changes enable dual CJS/ESM bundle distribution, improve TypeScript configuration for module preservation, and reorganize the source structure from lib/ to src/ to better distinguish between source code and built artifacts.

Key changes:

  • Convert module system from CommonJS (require/module.exports) to ESM (import/export default)
  • Update Node.js built-in imports to use node: protocol
  • Rename lib/ directory to src/ throughout the codebase
  • Configure TypeScript with "module": "preserve" and "noEmit": true for bundler compatibility

Reviewed changes

Copilot reviewed 59 out of 106 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vitest.setup.ts New test setup file for typescript-eslint RuleTester
vitest.config.ts Updated setup file path and coverage directory from lib/ to src/
tsconfig.json Changed module system to "preserve" with noEmit enabled
tools/generate-configs/utils.ts Converted to ESM imports, updated dirname handling, changed export to default
tools/generate-configs/index.ts Updated import paths from lib/ to src/
tests/**/*.test.ts Updated all test imports from ../lib/ or ../../../lib/ to ../src/ or ../../src/
tests/test-utils.ts Updated import path to ../src/utils
tests/fake-rule.ts Updated import path to ../src/create-testing-library-rule
tests/eslint-remote-tester.config.js Deleted file (removed)
tests/create-testing-library-rule.test.ts Fixed import path from ./lib/test-utils to ./test-utils
tests/index.test.ts Updated paths from lib/ to src/ and imports to ESM
src/utils/*.ts New ESM files with export statements
src/rules/*.ts New ESM rule files with default exports
src/node-utils/*.ts New ESM utility files
src/index.ts Converted to ESM with default export, updated package.json imports
src/create-testing-library-rule/*.ts New ESM files for rule creation utilities
src/configs/*.ts Converted config exports from export = to export default

💡 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.

Bundle plugin in ESM format

2 participants