refactor(esm): migrate server and tests from CommonJS to ESM

Convert all server/, test, and setup files from require()/module.exports
to import/export syntax. Activate ESM globally via "type": "module" in
package.json and load dotenv via --import dotenv/config in npm scripts.
This commit is contained in:
Ulas
2026-04-03 23:11:20 +02:00
parent 2f6127911e
commit b139eea623
24 changed files with 113 additions and 154 deletions
+4 -3
View File
@@ -3,13 +3,14 @@
"version": "0.5.9",
"description": "Self-hosted family planner - calendar, tasks, shopping, meal planning, budget and more. Private, open-source, no subscription.",
"main": "server/index.js",
"type": "module",
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"start": "node server/index.js",
"dev": "node --watch server/index.js",
"setup": "node setup.js",
"start": "node --import dotenv/config server/index.js",
"dev": "node --import dotenv/config --watch server/index.js",
"setup": "node --import dotenv/config setup.js",
"test:db": "node --experimental-sqlite test-db.js",
"test:dashboard": "node --experimental-sqlite test-dashboard.js",
"test:tasks": "node --experimental-sqlite test-tasks.js",