-
-
Notifications
You must be signed in to change notification settings - Fork 100
Migrate backend from CommonJS to ES Modules #2133
Copy link
Copy link
Open
Labels
complexity: largefeature: InfrastructureSecrets, Prod and Dev setup, etc.Secrets, Prod and Dev setup, etc.housekeepingNon-user story development taskNon-user story development taskrole: Back Endsize: 5ptCan be done in 19-30 hoursCan be done in 19-30 hours
Milestone
Metadata
Metadata
Assignees
Labels
complexity: largefeature: InfrastructureSecrets, Prod and Dev setup, etc.Secrets, Prod and Dev setup, etc.housekeepingNon-user story development taskNon-user story development taskrole: Back Endsize: 5ptCan be done in 19-30 hoursCan be done in 19-30 hours
Type
Projects
Status
New Issue Approval
Overview
The backend uses CommonJS (require/module.exports) while shared/ already uses ESM, causing test failures. The backend should be fully migrated to ES Modules for consistency and to unblock the shared module imports.
Action Items
require()toimportstatements (36 files)require()toimportwith.jsextensions (41 files)module.exportstoexport default/named exports (47 files)require.main === modulewithimport.meta.urlpattern (5 files)__dirnamewithfileURLToPath(import.meta.url)(1 file)"type": "module"to backend/package.jsonjest.mock/jest.fn/jest.spyOnto Vitest equivalentsResources/Instructions
chore/backend-esm-migration