Files
dwroller/scripts/fast-build.sh
Alex 4c1b19fb8c feat: Implement bestiary routes for data retrieval and management
- Added bestiaryRoutes.js to handle API endpoints for fetching enemies, full bestiary data, and statistics.
- Implemented caching mechanism for bestiary data with a 5-minute expiration.
- Created transformation functions for bestiary entries to standardize data format for the dice roller.
- Added admin-only endpoint to force reload bestiary data with GM authentication.

chore: Create scripts for analyzing and cleaning bestiary data

- Developed analyze-bestiary-quality.js to review data quality and identify duplicates or inconsistencies.
- Implemented clean-bestiary-fields.js to extract and clean specific fields from bestiary entries, reducing text duplication.
- Created clean-corrupted-bestiary.js to remove corrupted entries based on defined patterns.
- Generated a comprehensive database-cleanup-report.md summarizing the cleaning process and results.

build: Add fast build script for streamlined deployment

- Introduced fast-build.sh to facilitate quick builds and PM2 reloads without reinstalling dependencies.

test: Add GM authentication logic test

- Created test-gm-auth.js to verify the correctness of GM authentication logic with various test cases.
2025-08-17 18:15:39 +02:00

25 lines
740 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Fast build script - skips dependency reinstall and tests
# Usage:
# ./scripts/fast-build.sh # just build and reload
# ./scripts/fast-build.sh --test # run tests first
echo "[fast-build] Starting fast build"
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"
if [ "${1:-}" = "--test" ]; then
echo "[fast-build] Running unit tests"
npm run test:unit --silent
fi
echo "[fast-build] Building production bundle"
npx react-scripts build
echo "[fast-build] Reloading PM2"
npm run pm2:reload || (echo "[fast-build] npm run pm2:reload failed, attempting pm2 reload directly" && pm2 reload database/pm2.config.js || true)
echo "[fast-build] Fast build completed successfully"