- 23 source files in src/ (build via scripts/build.sh) - Forum-sourced player knowledge in references/ - DESIGN.md with architecture and corrections - References to existing scripts (Monsterbation, jpx, HV Utils)
64 lines
1.3 KiB
Bash
Executable file
64 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
# Build HV Unified from src/* into a single hv-unified.user.js
|
|
# Usage: ./scripts/build.sh [--watch]
|
|
# No dependencies — pure cat concatenation.
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
SRC_DIR="$PROJECT_DIR/src"
|
|
OUTPUT="$PROJECT_DIR/scripts/hv-unified.user.js"
|
|
|
|
# Ordered list of source files
|
|
FILES=(
|
|
header.user.js
|
|
config.js
|
|
state.js
|
|
utils.js
|
|
page-detector.js
|
|
battle-parser.js
|
|
items.js
|
|
knowledge-base.js
|
|
strategy-engine.js
|
|
action-executor.js
|
|
hover-system.js
|
|
keybindings.js
|
|
ui-overlays.js
|
|
settings-panel.js
|
|
out-of-battle.js
|
|
guidance.js
|
|
progress-tracker.js
|
|
abilities.js
|
|
armory.js
|
|
battle-logger.js
|
|
re-timer.js
|
|
public-api.js
|
|
init.js
|
|
)
|
|
|
|
echo "🛡️ Building HV Unified..."
|
|
echo " Source: $SRC_DIR"
|
|
echo " Output: $OUTPUT"
|
|
echo ""
|
|
|
|
# Clear output
|
|
> "$OUTPUT"
|
|
|
|
# Concatenate with clear separators
|
|
for file in "${FILES[@]}"; do
|
|
src_path="$SRC_DIR/$file"
|
|
if [ ! -f "$src_path" ]; then
|
|
echo " ⚠️ MISSING: $file (skipping)"
|
|
continue
|
|
fi
|
|
echo " ├── $file"
|
|
cat "$src_path" >> "$OUTPUT"
|
|
echo "" >> "$OUTPUT"
|
|
done
|
|
|
|
# Count lines
|
|
LINES=$(wc -l < "$OUTPUT")
|
|
SIZE=$(du -h "$OUTPUT" | cut -f1)
|
|
echo ""
|
|
echo " ✅ Built: $LINES lines, $SIZE"
|