backend build with esbuild is working

This commit is contained in:
einhornimmond 2025-05-01 10:16:48 +02:00
parent 211e4047aa
commit 8ae1219a74
6 changed files with 19 additions and 7 deletions

View File

@ -69,7 +69,7 @@ jobs:
- name: Backend | Unit tests
id: test
run: |
cd out && turbo backend#lint backend#test
cd out && turbo backend#lint backend#test backend#build backend#typecheck
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
lint:

View File

@ -1,3 +1,4 @@
import { esbuildDecorators } from '@anatine/esbuild-decorators'
import { build } from 'esbuild'
build({
@ -8,6 +9,7 @@ build({
bundle: true,
keepNames: true,
// legalComments: 'inline',
external: ['sodium-native'],
external: ['reflect-metadata', 'sodium-native', 'email-templates'],
plugins: [esbuildDecorators()],
minify: true,
})

View File

@ -8,10 +8,10 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"build": "tsc --build && mkdirp build/src/emails/templates/ && ncp src/emails/templates build/src/emails/templates && mkdirp build/src/locales/ && ncp src/locales build/src/locales",
"clean": "tsc --build --clean",
"start": "cross-env TZ=UTC TS_NODE_BASEURL=./build node -r tsconfig-paths/register build/src/index.js",
"dev": "cross-env TZ=UTC nodemon -w src --ext ts,pug,json,css --exec ts-node -r tsconfig-paths/register src/index.ts",
"build": "tsx esbuild.config.ts",
"start": "cross-env TZ=UTC node build/index.js",
"dev": "cross-env TZ=UTC tsx watch src/index.ts",
"typecheck": "tsc --noEmit",
"lint": "biome check --error-on-warnings .",
"lint:fix": "biome check --error-on-warnings . --write",
"test": "cross-env TZ=UTC NODE_ENV=development DB_DATABASE=gradido_test_backend jest --runInBand --forceExit --detectOpenHandles",
@ -60,9 +60,10 @@
"xregexp": "^5.1.1"
},
"devDependencies": {
"@anatine/esbuild-decorators": "^0.2.19",
"@biomejs/biome": "1.9.4",
"@types/email-templates": "^10.0.4",
"@types/express": "^4.17.21",
"@biomejs/biome": "1.9.4",
"@types/faker": "^5.5.9",
"@types/i18n": "^0.13.4",
"@types/jest": "27.0.2",

View File

@ -1,3 +1,4 @@
import 'reflect-metadata'
import { CONFIG } from './config'
import { startValidateCommunities } from './federation/validateCommunities'
import { createServer } from './server/createServer'

View File

@ -122,6 +122,7 @@
"xregexp": "^5.1.1",
},
"devDependencies": {
"@anatine/esbuild-decorators": "^0.2.19",
"@biomejs/biome": "1.9.4",
"@types/email-templates": "^10.0.4",
"@types/express": "^4.17.21",
@ -355,6 +356,8 @@
"packages": {
"@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
"@anatine/esbuild-decorators": ["@anatine/esbuild-decorators@0.2.19", "", { "peerDependencies": { "esbuild": "~0.14.29" } }, "sha512-pyj6ULyMacyzpDqlnbS2OCkOqxcVgk8IqiTMRJ5CrsF8Yl1azvlX/AM6xWR8UzHKUYDlWOw5mOpos3+7KKR0Lw=="],
"@antfu/install-pkg": ["@antfu/install-pkg@0.4.1", "", { "dependencies": { "package-manager-detector": "^0.2.0", "tinyexec": "^0.3.0" } }, "sha512-T7yB5QNG29afhWVkVq7XeIMBa5U/vs9mX69YqayXypPRmYzUmzwnYltplHmPtZ4HPCn+sQKeXW8I47wCbuBOjw=="],
"@antfu/utils": ["@antfu/utils@0.7.10", "", {}, "sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww=="],

View File

@ -10,6 +10,11 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.24"
"@anatine/esbuild-decorators@^0.2.19":
version "0.2.19"
resolved "https://registry.yarnpkg.com/@anatine/esbuild-decorators/-/esbuild-decorators-0.2.19.tgz#d4137182abfdf0e6de680f69b447492813b62ef4"
integrity sha512-pyj6ULyMacyzpDqlnbS2OCkOqxcVgk8IqiTMRJ5CrsF8Yl1azvlX/AM6xWR8UzHKUYDlWOw5mOpos3+7KKR0Lw==
"@antfu/install-pkg@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@antfu/install-pkg/-/install-pkg-0.4.1.tgz#d1d7f3be96ecdb41581629cafe8626d1748c0cf1"