Fix/ES6 Migration: Complete CommonJS → ES6 Module Refactor#78
Merged
Conversation
Fix/es6 migrations models
…e query handling in getAllDepartments.
…d fix variable naming
…roper export syntax
…e import statements
…se ES module syntax. error message handled properly
…r better readability
Fix/es6-controllers merged into fix/es6-migration
…mprove code consistency -fixed all the remarks for the endpoints
…ove code formatting
Fix/es6 routes - Refactor: Convert routes to ES6 Module Syntax
Fix/es6 services - Refactor: Migrate All Services to ES Modules
Fix/es6 validators - Refactor Validators to ES6 Module Syntax
Fix/es6 config
fix(package): add "type": "module" to enable ES module support
fix(auth): correct token retrieval from cookies and update export syntax
…improve error handling
…improve structure
…eleted. Just changed the file type
Fix/es6 tests - Refactor(tests): convert Department and Instructor test files to ES6 modules
…t is case sensitive. so handled everywhere same
…ixed by changing to Config from config
…fault not exporting separately
…he all files imported correctly. by standardizing path
Owner
Author
|
This pull request completes the migration of the codebase from CommonJS to ES6 module syntax. The changes improve code readability, maintainability, and alignment with modern Node.js standards. No breaking business-logic changes are intended. |
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.
🚀 Refactor: Migrate Codebase from CommonJS to ES6 Module
Overview
This PR completes the migration of the backend codebase from CommonJS (
require/module.exports) to ES6 module syntax (import/export). The refactor improves consistency, maintainability, and alignment with modern Node.js standards.✨ Key Changes
🔁 ES6 Module Migration
"type": "module"topackage.jsonto enable native ES module support.🧩 Models
Departmentmodel.🧠 Controllers & Services
🌐 Routes
⚙️ Config & Database
config→Config) to prevent cross-platform bugs.db.jsand config files.🧪 Tests
.test.jsequivalents.📦 Migrations & Seeders
✅ Benefits
📝 Notes