Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1130 +/- ##
==========================================
- Coverage 97.48% 97.44% -0.05%
==========================================
Files 49 49
Lines 5997 5979 -18
Branches 1518 1522 +4
==========================================
- Hits 5846 5826 -20
- Misses 149 151 +2
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6a30950 to
618a9fc
Compare
There were some necessary changes to make the code compatible with tsdown bundling: 1. Replace CJS require with ESM import 2. Replace CJS export with ESM default export 3. Type all node-type guards explicitly to avoid "This is likely not portable. A type annotation is necessary" errors
78e7c26 to
05f7fcf
Compare
287f839 to
7361a6e
Compare
There was a problem hiding this comment.
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 tosrc/throughout the codebase - Configure TypeScript with
"module": "preserve"and"noEmit": truefor 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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 64 out of 108 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 7.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Checks
Changes
tsdown)package.jsonfields for CJS and ESM exposed filespublintfor linting the published bundletypeto "module"lib/tosrc/to better reflect the folder holds the source code but must be bundledContext
Closes #900