feat(build): add dual package support with tsup#23
Merged
Conversation
- Add CLAUDE.md with project overview and development commands - Document core architecture and WebpackSweetEntry function behavior - Include testing structure and code standards for future development
- Revert engines.node from >=21.0.0 to >=20.0.0 - Node.js 20.x LTS is still supported until April 2026
- Align with Microsoft's recommended setting for Node.js 20.x - Enables ES2023 features while maintaining CommonJS output
- Add tsup for ESM and CommonJS dual package builds - Configure package.json exports for both module formats - Update build system from tsc to tsup - Add tsup.config.ts for dual package configuration - Update .gitignore for tsconfig.tsbuildinfo
- Replace Jest with Vitest for modern ESM support - Add comprehensive dual package testing (CommonJS/ESM) - Remove Jest dependencies and configuration - Add Vitest configuration with coverage support - Update test scripts and ESLint configuration - Verify both module formats produce identical results
- Fix tsup config to use default export instead of named export - Disable TypeScript incremental compilation to prevent DTS build conflicts - Move build step from prepare hook to prepublishOnly to avoid unnecessary builds during npm install
- Replace import.meta.url with direct require usage in dual package tests - Add missing vitest imports to all test files - Update tsconfig to include test files in type checking
- Added @vitest/eslint-plugin dependency - Configured ESLint to lint test files with vitest-specific rules - Updated lint scripts to include src/__tests__ directory - Fixed import ordering and formatting in test files - Removed test directory from ignorePatterns
- Added Dual Package Support feature to features list - Added ES Modules usage example with import syntax - Added TypeScript usage example with type annotations - Organized usage examples with clear section headers
- Updated test framework from Jest to Vitest with v8 coverage - Added new test commands: test:watch, test:ui, type-check:watch - Documented dual package support (CommonJS + ESModule) - Updated build system documentation for tsup - Added Node.js 20+ requirement and ES2023 target information - Updated test file patterns and coverage configuration
- Added lcov to vitest coverage reporters for codecov upload
- Replaced generic "Test" describe blocks with descriptive function-specific names - Changed vague "toEqual()" test names to meaningful behavior descriptions - Enhanced test readability for better maintenance and debugging
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #23 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 23 32 +9
Branches 4 5 +1
=========================================
+ Hits 23 32 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(build): add dual package support with tsup