3ea9e630ed
Prep PR for the admin auth module (docs/plan-admin-auth.md step 1).
better-auth 1.7 ships ESM only, so the API moves off CommonJS:
- "type": "module", module nodenext, target ES2024, .js suffixes on all
relative imports, require('mariadb'|'cors') replaced by imports, and
export= packages (winston, app-root-path, bcrypt) consumed via default
imports. The logger now uses appRoot.path explicitly.
- TypeScript 5.9, @types/node 26, tslint removed. Node 26 pinned via
engines and .nvmrc (Plesk runs 26).
- Jest 28 + ts-jest replaced by vitest 5. Eight test files depend on
hoisted module mocks with static imports and resetModules + require,
which Jest's ESM mode does not support; vitest keeps them nearly
verbatim. Coverage via @vitest/coverage-v8 (lcov), Sonar generic report
via vitest-sonar-reporter, so sonar-project.properties is unchanged.
vitest.config.ts sets FEEDBACK_IP_SALT so the suite passes without a
local .env.
- dotenv 8 -> 16 and axios 0.24 -> 1.x: their old typings are not
resolvable under nodenext.
- autoCommit: false dropped from the pool configs; it is not a mariadb
connector option and was silently ignored.
tsc clean, 96/96 tests green, compiled app boots and serves /, /docs and
CORS under Node ESM.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
54 lines
1.2 KiB
JSON
54 lines
1.2 KiB
JSON
{
|
|
"name": "nachklang-api",
|
|
"version": "0.1.0",
|
|
"description": "",
|
|
"main": "index.js",
|
|
"type": "module",
|
|
"engines": {
|
|
"node": ">=26"
|
|
},
|
|
"scripts": {
|
|
"start": "tsc && node ./dist/app.js",
|
|
"build": "tsc",
|
|
"debug": "export DEBUG=* && npm run start",
|
|
"test": "vitest run --coverage",
|
|
"test:watch": "vitest"
|
|
},
|
|
"keywords": [],
|
|
"author": "",
|
|
"license": "ISC",
|
|
"dependencies": {
|
|
"app-root-path": "^3.0.0",
|
|
"axios": "^1.20.0",
|
|
"bcrypt": "^5.0.1",
|
|
"cors": "^2.8.5",
|
|
"debug": "^4.3.1",
|
|
"dotenv": "^16.6.1",
|
|
"express": "^4.18.2",
|
|
"guid-typescript": "^1.0.9",
|
|
"mariadb": "^3.0.2",
|
|
"random-words": "^1.1.1",
|
|
"swagger-jsdoc": "^6.1.0",
|
|
"swagger-ui-express": "^4.3.0",
|
|
"winston": "^3.3.3"
|
|
},
|
|
"devDependencies": {
|
|
"@types/app-root-path": "^1.2.4",
|
|
"@types/bcrypt": "^3.0.1",
|
|
"@types/cors": "^2.8.19",
|
|
"@types/debug": "^4.1.5",
|
|
"@types/express": "^4.17.15",
|
|
"@types/node": "^26.4.1",
|
|
"@types/random-words": "^1.1.2",
|
|
"@types/swagger-jsdoc": "^6.0.1",
|
|
"@types/swagger-ui-express": "^4.1.3",
|
|
"@types/winston": "^2.4.4",
|
|
"@vitest/coverage-v8": "^5.0.0",
|
|
"is-number": "^7.0.0",
|
|
"source-map-support": "^0.5.19",
|
|
"typescript": "^5.9.3",
|
|
"vitest": "^5.0.0",
|
|
"vitest-sonar-reporter": "^3.0.0"
|
|
}
|
|
}
|