Project cleanup and reorganization

This commit is contained in:
adilallo
2026-01-26 15:41:25 -07:00
parent f513aecacc
commit 94a7922b30
24 changed files with 83 additions and 420 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ const fs = require("fs");
const path = require("path");
const BUNDLE_ANALYSIS_DIR = path.join(__dirname, "..", ".next", "analyze");
const PERFORMANCE_BUDGETS = require("../performance-budgets.json");
const PERFORMANCE_BUDGETS = require("../config/performance-budgets.json");
class BundleAnalyzer {
constructor() {
+1 -1
View File
@@ -9,7 +9,7 @@ const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");
const PERFORMANCE_BUDGETS = require("../performance-budgets.json");
const PERFORMANCE_BUDGETS = require("../config/performance-budgets.json");
const MONITORING_DIR = path.join(__dirname, "..", ".next", "monitoring");
class PerformanceMonitor {
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
echo "🚀 Starting Gitea Actions Runner..."
# Ensure Node.js is available in PATH
export PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH"
# Verify Node.js is accessible
if ! command -v node >/dev/null 2>&1; then
echo "❌ Node.js not found in PATH!"
echo "Current PATH: $PATH"
exit 1
fi
echo "✅ Node.js found: $(which node) - $(node -v)"
# Check if runner is already running
if pgrep -f "act_runner daemon" > /dev/null; then
echo "⚠️ Runner is already running!"
echo "To stop it, run: ./scripts/stop-runner.sh"
exit 1
fi
# Start the runner in the background with proper PATH
PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin:$PATH" ./act_runner daemon --config config/gitea-runner.yaml &
RUNNER_PID=$!
# Save PID to file for easy stopping
echo $RUNNER_PID > .runner.pid
echo "✅ Runner started with PID: $RUNNER_PID"
echo "📝 Logs will be written to: runner.log"
echo ""
echo "To stop the runner, run: ./scripts/stop-runner.sh"
echo "To check status, run: ./scripts/status-runner.sh"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
echo "📊 Gitea Actions Runner Status"
echo "=============================="
# Check if runner is running
if pgrep -f "act_runner daemon" > /dev/null; then
RUNNER_PID=$(pgrep -f "act_runner daemon")
echo "✅ Runner is RUNNING (PID: $RUNNER_PID)"
echo ""
echo "📝 Recent logs:"
if [ -f runner.log ]; then
tail -5 runner.log
else
echo "No log file found"
fi
echo ""
echo "To stop the runner: ./scripts/stop-runner.sh"
else
echo "❌ Runner is NOT RUNNING"
echo ""
echo "To start the runner: ./scripts/start-runner.sh"
fi
echo ""
echo "🔗 Gitea Actions URL:"
echo "https://git.medlab.host/CommunityRule/community-rule/actions"
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
echo "🛑 Stopping Gitea Actions Runner..."
# Check if PID file exists
if [ -f .runner.pid ]; then
RUNNER_PID=$(cat .runner.pid)
# Check if process is still running
if ps -p $RUNNER_PID > /dev/null; then
echo "🔄 Stopping runner with PID: $RUNNER_PID"
kill $RUNNER_PID
# Wait a moment for graceful shutdown
sleep 2
# Force kill if still running
if ps -p $RUNNER_PID > /dev/null; then
echo "⚡ Force stopping runner..."
kill -9 $RUNNER_PID
fi
echo "✅ Runner stopped successfully"
else
echo "⚠️ Runner process not found (PID: $RUNNER_PID)"
fi
# Clean up PID file
rm -f .runner.pid
else
echo "🔍 No PID file found, checking for any running runners..."
pkill -f "act_runner daemon"
echo "✅ Any running runners have been stopped"
fi
+4 -4
View File
@@ -10,10 +10,10 @@ const path = require("path");
console.log("🔍 Testing LHCI Configuration...\n");
// Check if .lighthouserc.json exists
const configPath = path.join(process.cwd(), ".lighthouserc.json");
// Check if config/lighthouse.json exists
const configPath = path.join(process.cwd(), "config/lighthouse.json");
if (fs.existsSync(configPath)) {
console.log("✅ .lighthouserc.json found");
console.log("✅ config/lighthouse.json found");
try {
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));
@@ -30,7 +30,7 @@ if (fs.existsSync(configPath)) {
console.log("❌ Configuration is not valid JSON:", error.message);
}
} else {
console.log("❌ .lighthouserc.json not found");
console.log("❌ config/lighthouse.json not found");
}
// Check if @lhci/cli is installed