chore: upgrade to pnpm v12, vitest v5 and resolve deprecated subdependencies
Gitea Actions Runner Test / test-job (push) Successful in 1s
CI / check (push) Failing after 21s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped

This commit is contained in:
openhands committed 2026-09-27 19:42:34 +02:00
1 parent f187cd70a9
commit e4f83a8036
18 files changed
+1692 -1121

No files matched your search

+149 -11
View File
File diff suppressed because it is too large. Load diff
+27 -25
View File
@@ -1,29 +1,31 @@
#!/bin/bash #!/usr/bin/env bash
# Forcefully free port 3002 and redeploy the CMS # Handmatige release uitvoeren.
PORT=3002 #
# Dit script is bewust een dunne wrapper. Het echte werk zit in
# `scripts/ci-deploy.sh`, want dat is wat Gitea Actions ook draait. Eén deploypad
# betekent dat een handmatige release niet anders kan werken dan een release uit
# CI, dus er is geen tweede, slechter onderhouden pad meer.
#
# Waarom dit niet meer zelf doet wat het deed:
# - `fuser -k 3002/tcp` sloopte de live release bij elke mislukte build;
# - `docker compose down` haalde de site omlaag vóórdat er iets nieuws stond;
# - de container draait via `docker run` uit ci-deploy.sh, niet via compose, dus
# compose beheerde hier nooit de release die er echt draaide.
#
# `scripts/ci-deploy.sh` start nu blue/green: de nieuwe release komt op de vrije
# poort terwijl de live release door blijft draaien, en nginx gaat pas om nadat
# de kandidaat gezond is en de e2e-test heeft gewonnen.
set -Eeuo pipefail
echo "--- Preparing for deployment ---" deploy_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$deploy_dir"
# Check if fuser is installed, if not, warn the user if [ "${1:-}" = "--help" ] || [ "${1:-}" = "-h" ]; then
if ! command -v fuser &> /dev/null; then sed -n '2,20p' "$deploy_dir/deploy.sh" | sed 's/^# \{0,1\}//'
echo "Error: 'fuser' command not found. Please install psmisc (e.g., sudo apt install psmisc)." exit 0
exit 1
fi
echo "Forcefully freeing port $PORT..."
# -k kills processes, -n tcp specifies tcp socket
fuser -k $PORT/tcp || echo "No process found on port $PORT or already free."
echo "Stopping containers..."
docker compose down
echo "Starting deployment..."
if docker compose up -d --build; then
./scripts/alert.sh "Deployment successful for EpicNext-Cms"
echo "--- Deployment successful ---"
else
./scripts/alert.sh "Deployment FAILED for EpicNext-Cms"
echo "--- Deployment FAILED ---"
exit 1
fi fi
# De branch-guard in ci-deploy.sh accepteert alleen main/master, en controleert
# daarna of de HEAD-commit nog de nieuwste op de remote is. Deployen vanuit een
# feature-branch kan dus niet per ongeluk; dat was eerder wél mogelijk.
exec bash "$deploy_dir/scripts/ci-deploy.sh" "$@"
+75 -83
View File
File diff suppressed because it is too large. Load diff
+109 -109
View File
File diff suppressed because it is too large. Load diff
+890 -821
View File
File diff suppressed because it is too large. Load diff
+12 -11
View File
@@ -1,17 +1,18 @@
packages:
- '.'
allowBuilds: allowBuilds:
'@parcel/watcher': true
'@swc/core': true
cpu-features: true
esbuild: true esbuild: true
sharp: true msw: true
"@parcel/watcher": true protobufjs: true
"@swc/core": true ssh2: true
msw: false
cpu-features: false
protobufjs: false
ssh2: false
minimumReleaseAge: 60 minimumReleaseAge: 60
overrides: overrides:
# drizzle-kit still uses an obsolete development-server dependency. glob: '^11.0.0'
"@esbuild-kit/core-utils>esbuild": "^0.25.9" '@esbuild-kit/core-utils': 'npm:tsx@^4.23.15'
"@types/react": "19.2.18" '@esbuild-kit/esm-loader': 'npm:tsx@^4.23.15'
"@types/react-dom": "19.2.7"
+240 -54
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -79,6 +79,7 @@ export const POST = withAdmin(
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
@@ -343,6 +343,7 @@ export const POST = withAdmin(
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
@@ -529,6 +529,7 @@ export const POST = withAdmin(
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
@@ -40,6 +40,7 @@ export const POST = withAdmin({ permission: PERMS.ASSETS_IMPORT }, async () => {
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
@@ -124,6 +124,7 @@ export const POST = withAdmin(
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
@@ -125,6 +125,7 @@ export const GET = withAdmin(
headers: { headers: {
"Content-Type": "text/event-stream", "Content-Type": "text/event-stream",
"Cache-Control": "no-cache", "Cache-Control": "no-cache",
"X-Accel-Buffering": "no",
Connection: "keep-alive", Connection: "keep-alive",
}, },
}); });
+1
View File
@@ -103,6 +103,7 @@ export async function GET(req: Request) {
headers: { headers: {
"content-type": "text/event-stream; charset=utf-8", "content-type": "text/event-stream; charset=utf-8",
"cache-control": "no-store, no-transform", "cache-control": "no-store, no-transform",
"x-accel-buffering": "no",
connection: "keep-alive", connection: "keep-alive",
}, },
}); });
+1
View File
@@ -61,6 +61,7 @@ export async function GET(req: Request) {
headers: { headers: {
"content-type": "text/event-stream; charset=utf-8", "content-type": "text/event-stream; charset=utf-8",
"cache-control": "no-store, no-transform", "cache-control": "no-store, no-transform",
"x-accel-buffering": "no",
connection: "keep-alive", connection: "keep-alive",
}, },
}); });
File diff suppressed because it is too large. Load diff
+4 -2
View File
@@ -43,8 +43,10 @@ async function warm<T>(name: string, load: () => Promise<T>): Promise<void> {
} }
export async function warmPublicCaches(): Promise<void> { export async function warmPublicCaches(): Promise<void> {
// Small delays between groups: a boot-time burst of COUNT(*) queries against // Elke `warm` wordt afgewacht voordat de volgende begint, dus de COUNT(*)
// a database that is still opening connections helps nobody. // queries gaan één voor één in plaats van als een burst op een database die
// nog aan het opstarten is. Dat is goed genoeg; kunstmatige sleeps zouden
// de warme start alleen maar vertragen zonder iets te winnen.
await warm("online_count", () => await warm("online_count", () =>
cached("online_count", ONLINE_TTL_MS, countOnline, { staleMs: 15_000 }), cached("online_count", ONLINE_TTL_MS, countOnline, { staleMs: 15_000 }),
); );
+28 -5
View File
@@ -11,13 +11,30 @@ git() {
} }
flock() { echo "lock" >> "$TEST_DIR/calls"; [ "$SCENARIO" != lock-failure ]; } flock() { echo "lock" >> "$TEST_DIR/calls"; [ "$SCENARIO" != lock-failure ]; }
pnpm() { pnpm() {
echo "pnpm $*" >> "$TEST_DIR/calls" # De env-prefix (bv. PLAYWRIGHT_BASE_URL) hoort bij het deploypad dat getest
# wordt, dus die loggen we mee: zo blijft zichtbaar dat de e2e-test tegen de
# juiste poort draait.
echo "${PLAYWRIGHT_BASE_URL:+PLAYWRIGHT_BASE_URL=$PLAYWRIGHT_BASE_URL }pnpm $*" >> "$TEST_DIR/calls"
if [ "$1" = db:migrate ] && [ "$SCENARIO" = migration-failure ]; then return 1; fi if [ "$1" = db:migrate ] && [ "$SCENARIO" = migration-failure ]; then return 1; fi
if [ "$1" = test:e2e ] && [ "$SCENARIO" = smoke-failure ] && [ "$(cat "$TEST_DIR/epicnext-cms-app" 2>/dev/null)" = new ]; then return 1; fi if [ "$1" = test:e2e ] && [ "$SCENARIO" = smoke-failure ] && candidate_is_new; then return 1; fi
return 0
}
# De kandidaat is het container dat het script zojuist heeft gestart. Bij
# blue/green is dat niet per se `epicnext-cms-app`.
candidate_is_new() {
for f in epicnext-cms-app epicnext-cms-green; do
if [ "$(cat "$TEST_DIR/$f" 2>/dev/null)" = new ]; then return 0; fi
done
return 1
}
nginx() {
echo "nginx $*" >> "$TEST_DIR/calls"
if [ "$SCENARIO" = nginx-reject ] && [ "$1" = "-t" ]; then return 1; fi
if [ "$SCENARIO" = nginx-reload-fail ] && [ "$1" = "-s" ]; then return 1; fi
return 0 return 0
} }
curl() { curl() {
if [ "$SCENARIO" = health-failure ] && [ "$(cat "$TEST_DIR/epicnext-cms-app" 2>/dev/null)" = new ]; then return 1; fi if [ "$SCENARIO" = health-failure ] && candidate_is_new; then return 1; fi
echo '{"database":true}' echo '{"database":true}'
} }
sleep() { :; } sleep() { :; }
@@ -40,14 +57,20 @@ docker() {
stop) return 0 ;; stop) return 0 ;;
rename) mv "$TEST_DIR/$2" "$TEST_DIR/$3" ;; rename) mv "$TEST_DIR/$2" "$TEST_DIR/$3" ;;
run) run)
echo new > "$TEST_DIR/epicnext-cms-app" run_name=epicnext-cms-app
prev=""
for arg in "$@"; do
if [ "$prev" = "--name" ]; then run_name="$arg"; fi
prev="$arg"
done
echo new > "$TEST_DIR/$run_name"
[ "$SCENARIO" != run-failure ] ;; [ "$SCENARIO" != run-failure ] ;;
start) [ -f "$TEST_DIR/$2" ] ;; start) [ -f "$TEST_DIR/$2" ] ;;
rm) rm -f "$TEST_DIR/$name" ;; rm) rm -f "$TEST_DIR/$name" ;;
*) return 0 ;; *) return 0 ;;
esac esac
} }
export -f git flock pnpm curl sleep docker export -f git flock pnpm curl sleep docker nginx candidate_is_new
node() { node() {
echo "node $*" >> "$TEST_DIR/calls" echo "node $*" >> "$TEST_DIR/calls"