Girish Ramakrishnan
|
36aa641cb9
|
migrate to "export default"
also, set no-use-before-define in linter
|
2026-02-14 15:43:24 +01:00 |
|
Girish Ramakrishnan
|
96dc79cfe6
|
Migrate codebase from CommonJS to ES Modules
- Convert all require()/module.exports to import/export across 260+ files
- Add "type": "module" to package.json to enable ESM by default
- Add migrations/package.json with "type": "commonjs" to keep db-migrate compatible
- Convert eslint.config.js to ESM with sourceType: "module"
- Replace __dirname/__filename with import.meta.dirname/import.meta.filename
- Replace require.main === module with process.argv[1] === import.meta.filename
- Remove 'use strict' directives (implicit in ESM)
- Convert dynamic require() in switch statements to static import lookup maps
(dns.js, domains.js, backupformats.js, backupsites.js, network.js)
- Extract self-referencing exports.CONSTANT patterns into standalone const
declarations (apps.js, services.js, locks.js, users.js, mail.js, etc.)
- Lazify SERVICES object in services.js to avoid circular dependency TDZ issues
- Add clearMailQueue() to mailer.js for ESM-safe queue clearing in tests
- Add _setMockApp() to ldapserver.js for ESM-safe test mocking
- Add _setMockResolve() wrapper to dig.js for ESM-safe DNS mocking in tests
- Convert backupupload.js to use dynamic imports so --check exits before
loading the module graph (which requires BOX_ENV)
- Update check-install to use ESM import for infra_version.js
- Convert scripts/ (hotfix, release, remote_hotfix.js, find-unused-translations)
- All 1315 tests passing
Migration stats (AI-assisted using Cursor with Claude):
- Wall clock time: ~3-4 hours
- Assistant completions: ~80-100
- Estimated token usage: ~1-2M tokens
Co-authored-by: Cursor <cursoragent@cursor.com>
|
2026-02-14 15:11:45 +01:00 |
|
Girish Ramakrishnan
|
e76d4b3474
|
tests: fix app passwords test
|
2026-02-12 19:57:34 +01:00 |
|
Girish Ramakrishnan
|
e9c3e42aa6
|
appPassword: add expiry
|
2026-02-12 16:23:31 +01:00 |
|
Girish Ramakrishnan
|
5dd5a20fc1
|
code -> sqlCode
|
2025-09-29 12:18:26 +02:00 |
|
Girish Ramakrishnan
|
12e073e8cf
|
use node: prefix for requires
mostly because code is being autogenerated by all the AI stuff using
this prefix. it's also used in the stack trace.
|
2025-08-14 12:55:35 +05:30 |
|
Girish Ramakrishnan
|
cbc73f5c9a
|
remove uuid module
built into node.js now
|
2025-07-28 12:54:09 +02:00 |
|
Girish Ramakrishnan
|
dd5e4adc73
|
replace underscore with our own
we only need like 5 simple functions
|
2025-02-13 14:14:34 +01:00 |
|
Girish Ramakrishnan
|
c5fff756d1
|
move addon config db code to addonconfigs.js
|
2021-08-19 22:08:31 -07:00 |
|
Girish Ramakrishnan
|
a1c61facdc
|
merge userdb.js into users.js
|
2021-07-16 22:33:22 -07:00 |
|
Girish Ramakrishnan
|
147c8df6e3
|
async'ify avatar and apppassword code
|
2021-06-25 23:32:21 -07:00 |
|