feat(esm): Revert #355, #359 and #360#361
Conversation
✅ Deploy Preview for cedarjs canceled.
|
There was a problem hiding this comment.
Greptile Summary
This PR reverts substantial ESM (ECMAScript Module) preparation work by removing testing infrastructure, build configurations, and Vite plugins that were recently added in PRs #355, #359, and #360. The changes systematically remove Vitest-based testing utilities and revert back to simpler build processes to address CI failures on Windows.
Key changes include:
-
Testing Infrastructure Removal: Completely removes Vitest-specific testing plugins and configurations from the
@cedarjs/testingpackage, including auto-import plugins, router import transformations, database tracking plugins, and custom Vitest environments. Thepackages/testing/src/api/vitest/index.tsandpackages/testing/src/web/vitest/index.tsfiles are emptied, removing all plugin exports. -
Build System Simplification: Reverts complex build logic in
packages/testing/build.mtsback to simplebuildCjs()calls, removing custom esbuild configuration that handledimport.meta.globcompatibility for CommonJS builds. -
Package Configuration Rollback: Removes export paths for vitest-related modules from
package.jsonfiles, eliminates dependencies likeunplugin-auto-import, and removes TypeScript project references between packages to decouple build dependencies. -
Vite Plugin Cleanup: Removes test-mode functionality from the Cedar Vite plugin, eliminating conditional plugin registration based on test environments and removing imports of testing-related plugins.
-
Mock System Simplification: Reverts MockRouter and MockProviders components to simpler implementations, removing dynamic imports of user routes via
globRoutesImporter.tsand falling back to more traditional module alias approaches.
These changes represent a significant rollback of ESM migration work, moving from a sophisticated dual Jest/Vitest testing setup back to a Jest-focused approach. The revert affects the entire testing ecosystem but maintains core functionality while eliminating Windows-specific compatibility issues.
Confidence score: 2/5
- This PR introduces significant risk by removing substantial testing infrastructure without clear replacement mechanisms
- Score reflects the large scope of removed functionality that could break existing test setups and development workflows
- Pay close attention to all testing-related files and ensure adequate testing coverage remains after these removals
24 files reviewed, 1 comment
| }, | ||
| }, | ||
| }) | ||
| await buildCjs() |
There was a problem hiding this comment.
style: Potential issue: files using import.meta.glob in src/web/globRoutesImporter.ts may not work properly in CJS builds without the custom handling that was removed
Debugging CI issue with web side tests on Windows
If CI passes for this PR, I'll merge it, and then go back to #358 and see if that passes, and then pick up with adding more and more code from #355 as I was doing