-
Notifications
You must be signed in to change notification settings - Fork 273
chore: CJS to ESM Migration #2484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…and exports for consistency. - Changed require statements to import statements in routes: questions, staging, stocks, subscription, tags, taskRequests, tasks, trading, userStatus, users, wallets. - Updated service imports to use ES module syntax in contributions, discordService, githubService, onboardingExtension, tasks, and users. - Adjusted logger configuration and removed unnecessary comments. - Replaced NotFound errors with httpError.NotFound in various utility functions for better error handling. - Refactored task-related functions to use taskModel for fetching and updating tasks.
…or better module handling
…roved compatibility
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Date:
16 September, 2025
Developer Name: @Achintya-Chatterjee
Issue Ticket Number
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes
Description by Korbit AI
What change is being made?
Migrate the codebase from CommonJS (require/module.exports) to ES Modules (import/export) across the repository, update config and test tooling to support ESM, rename and adjust files (including .cjs to .js/.cjs as appropriate), and align imports/exports throughout various modules, configs, and tests.
Why are these changes being made?
Adopt ES module syntax to align with Node.js ESM support and modern JavaScript practices, improving consistency and future compatibility. This migration sets up the project for easier interop, bundling, and future migrations, though it requires updates to import paths and module formats across many files.