Skip to content

chore: vite vitest migration and different export types (ES Module, common js) - #531

Open
Puppo wants to merge 11 commits into
AdeleD:masterfrom
Puppo:feat/vite-vitest-migration
Open

chore: vite vitest migration and different export types (ES Module, common js)#531
Puppo wants to merge 11 commits into
AdeleD:masterfrom
Puppo:feat/vite-vitest-migration

Conversation

@Puppo

@Puppo Puppo commented Apr 30, 2026

Copy link
Copy Markdown

This PR moves the builder from WebPack to vite to handle UMD, CommonJS and ES Module formats.
Then it reviews the tests to use vitest instead of jest.

Lastly, it upgrades ESLint to v9.

Puppo and others added 11 commits April 29, 2026 06:17
- Replace Webpack build with Vite (UMD, ES, CJS formats)
- Replace Jest with Vitest for testing
- Rename .js files containing JSX to .jsx extension
- Update tests to use Vitest API (vi instead of jest)
- Add proper exports field in package.json
- Rename demo/js/demo.js to demo.jsx (JSX syntax requires .jsx extension)
- Update demo/vite.config.js to:
  - Add commentsPlugin for /comments API middleware
  - Configure entry point and output filenames for proper bundling
  - Fix react-paginate alias path
- Simplify demo/server.js by removing webpack-specific middleware
- Add jquery dependency (was missing)
- Add demo:build script for production builds

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
React 19 removed ReactDOM.findDOMNode() which caused all 99 tests to fail.
Rewrote PaginationBoxView-test.jsx to use @testing-library/react queries
(screen, within, fireEvent) instead of findDOMNode.

Changes:
- Replace ReactDOM.findDOMNode with screen queries and within helpers
- Add hasClass() and getAttribute() helpers for DOM property access
- Fix incorrect rel attribute assertion for single-page pagination
- Keep dist/ changes (rebuilt with correct format output)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Rebuild dist files with proper format output.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Set "type" to "module" in package.json
- Upgrade eslint and eslint-plugin-react versions
- Add eslint.config.js with recommended settings and custom rules

Co-authored-by: Copilot <copilot@github.com>
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.

1 participant