Girish Ramakrishnan
|
e9f96593c3
|
reorder functions for no-use-before-define
|
2026-02-14 16:34:34 +01:00 |
|
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
|
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
|
a93c85ebc9
|
profile: drop gravatar support
gravatar is owned by an external entity (Automattic) and we have an
unnecessary dep to this service. users can just upload a profile pic
|
2025-06-08 18:12:40 +02:00 |
|
Girish Ramakrishnan
|
0a4aede3a8
|
eventlog: branding events
|
2024-12-02 12:18:09 +01:00 |
|
Girish Ramakrishnan
|
872705d58d
|
oidc: use the cloudron name as provider name
|
2024-12-02 12:01:19 +01:00 |
|
Johannes Zellner
|
2515b032d0
|
Add branding background UI
|
2024-04-05 14:31:41 +02:00 |
|
Johannes Zellner
|
91d3980e3b
|
Add cloudron background branding apis
|
2024-04-03 17:27:22 +02:00 |
|
Girish Ramakrishnan
|
e0d07c3c19
|
settings: move branding settings into branding.js
|
2023-08-02 23:02:40 +05:30 |
|
Girish Ramakrishnan
|
2aa5c387c7
|
branding: add template variables
we can now have %YEAR% and %VERSION% in the footer
|
2020-10-18 10:19:13 -07:00 |
|