From d07e9ba4139aeeff31f95c409913cc2f80b4ed0c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 24 Nov 2025 14:45:50 +0100 Subject: [PATCH] prepare federation for using emails --- federation/esbuild.config.ts | 3 ++- federation/package.json | 6 +++++- federation/tsconfig.json | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/federation/esbuild.config.ts b/federation/esbuild.config.ts index 2ef5f88e5..879d96cbd 100644 --- a/federation/esbuild.config.ts +++ b/federation/esbuild.config.ts @@ -8,8 +8,9 @@ build({ target: 'node18.20.7', bundle: true, keepNames: true, + entryNames: '[name]', // legalComments: 'inline', - external: ['sodium-native'], + external: ['sodium-native', 'email-templates'], plugins: [esbuildDecorators()], minify: true, sourcemap: true, diff --git a/federation/package.json b/federation/package.json index 20176e3f9..057b22a98 100644 --- a/federation/package.json +++ b/federation/package.json @@ -8,13 +8,14 @@ "license": "Apache-2.0", "private": false, "scripts": { - "build": "ts-node ./esbuild.config.ts", + "build": "ts-node ./esbuild.config.ts && mkdirp build/templates/ && ncp ../core/src/emails/templates build/templates", "start": "cross-env TZ=UTC NODE_ENV=production node build/index.js", "start:bun": "cross-env TZ=UTC NODE_ENV=production bun build/index.js", "dev": "cross-env TZ=UTC nodemon -w src --ext ts,json,css -r tsconfig-paths/register src/index.ts", "dev:bun": "cross-env TZ=UTC bun --hot src/index.ts", "typecheck": "tsc --noEmit", "test": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_federation jest --runInBand --forceExit --detectOpenHandles", + "test:bun": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_federation bun test", "test:debug": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_federation node --inspect-brk node_modules/.bin/jest --bail --runInBand --forceExit --detectOpenHandles", "test:coverage": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_federation jest --coverage --runInBand --forceExit --detectOpenHandles", "lint": "biome check --error-on-warnings .", @@ -23,6 +24,7 @@ }, "dependencies": { "cross-env": "^7.0.3", + "email-templates": "^10.0.1", "sodium-native": "^3.4.1" }, "devDependencies": { @@ -60,6 +62,8 @@ "joi": "17.13.3", "lodash.clonedeep": "^4.5.0", "log4js": "^6.7.1", + "mkdirp": "^3.0.1", + "ncp": "^2.0.0", "nodemon": "^2.0.7", "prettier": "^3.5.3", "reflect-metadata": "^0.1.13", diff --git a/federation/tsconfig.json b/federation/tsconfig.json index 86b102fa6..c42e39505 100644 --- a/federation/tsconfig.json +++ b/federation/tsconfig.json @@ -6,6 +6,7 @@ // "incremental": true, /* Enable incremental compilation */ "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "resolveJsonModule": true, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ @@ -62,7 +63,7 @@ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ "typeRoots": [ /* List of folders to include type definitions from. */ "node_modules/@types", - "../node_modules/@types" + "../node_modules/@types", ], // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ @@ -84,6 +85,9 @@ "skipLibCheck": true, /* Skip type checking of declaration files. */ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, + "include": [ + "../core/src/types", + ], "ts-node": { "swc": true }