build(src): switch package + tsconfig to ESM (type: module, NodeNext)

This commit is contained in:
SamTV12345 2026-04-26 12:17:55 +02:00
parent ca6cf43315
commit a26d7d3b63
2 changed files with 8 additions and 6 deletions

View file

@ -1,5 +1,6 @@
{
"name": "ep_etherpad-lite",
"type": "module",
"description": "A free and open source realtime collaborative editor",
"homepage": "https://etherpad.org",
"keywords": [
@ -146,15 +147,15 @@
"test": "cross-env NODE_ENV=production mocha --import=tsx --timeout 120000 --recursive tests/backend/specs/**.ts ../node_modules/ep_*/static/tests/backend/specs/**",
"test-utils": "cross-env NODE_ENV=production mocha --import=tsx --timeout 5000 --recursive tests/backend/specs/*utils.ts",
"test-container": "mocha --import=tsx --timeout 5000 tests/container/specs/api",
"dev": "cross-env NODE_ENV=development node --require tsx/cjs node/server.ts",
"prod": "cross-env NODE_ENV=production node --require tsx/cjs node/server.ts",
"dev": "cross-env NODE_ENV=development node --import tsx node/server.ts",
"prod": "cross-env NODE_ENV=production node --import tsx node/server.ts",
"ts-check": "tsc --noEmit",
"ts-check:watch": "tsc --noEmit --watch",
"test-ui": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/specs",
"test-ui:ui": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/specs --ui",
"test-admin": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/admin-spec --workers 1 --project=chromium",
"test-admin:ui": "cross-env NODE_ENV=production npx playwright test tests/frontend-new/admin-spec --ui --workers 1",
"debug:socketio": "cross-env DEBUG=socket.io* node --require tsx/cjs node/server.ts",
"debug:socketio": "cross-env DEBUG=socket.io* node --import tsx node/server.ts",
"test:vitest": "vitest"
},
"version": "2.7.2",

View file

@ -3,11 +3,11 @@
/* Visit https://aka.ms/tsconfig to read more about this file */
"moduleDetection": "force",
"lib": ["ES2023", "DOM"],
"types": ["node", "jquery"],
/* Language and Environment */
"target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
/* Modules */
"module": "CommonJS", /* Specify what module code is generated. */
"module": "NodeNext", /* Specify what module code is generated. */
"moduleResolution": "NodeNext", /* Specify how TypeScript resolves modules. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
@ -16,5 +16,6 @@
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"resolveJsonModule": true,
"types": ["node", "jquery", "mocha"]
}
},
"exclude": ["../plugin_packages", "node_modules"]
}