Repo rebuild

This commit is contained in:
Mark Gregory
2026-09-15 12:33:28 +01:00
commit be28c4feec
5629 changed files with 317074 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo "Usage:"
echo " $0 <source> <backup-directory>"
exit 1
fi
SOURCE="$(cd "$1" && pwd)"
BACKUP_ROOT="$2"
NAME="$(basename "$SOURCE")"
STAMP="$(date +"%Y%m%d-%H%M%S")"
WORK_DIR="$BACKUP_ROOT/${NAME}-${STAMP}"
ZIP_FILE="$BACKUP_ROOT/${NAME}-${STAMP}.zip"
mkdir -p "$BACKUP_ROOT"
echo "Copying clean source..."
rsync -a \
--delete \
--exclude=".git/" \
--exclude="node_modules/" \
--exclude="storage/" \
--exclude="bootstrap/cache/" \
--exclude="provision/" \
"$SOURCE/" \
"$WORK_DIR/"
# --exclude="vendor/" \
echo "Recreating required empty Laravel directories..."
mkdir -p "$WORK_DIR/storage" "$WORK_DIR/bootstrap/cache"
touch "$WORK_DIR/storage/.gitkeep" "$WORK_DIR/bootstrap/cache/.gitkeep"
echo "Creating zip..."
(
cd "$BACKUP_ROOT"
zip -qr "$(basename "$ZIP_FILE")" "$(basename "$WORK_DIR")"
)
echo "Deleting temporary backup folder..."
rm -rf "$WORK_DIR"
echo "Done:"
echo "$ZIP_FILE"
+37
View File
@@ -0,0 +1,37 @@
import fs from 'node:fs';
import path from 'node:path';
import { execSync } from 'node:child_process';
const modulesDir = path.resolve('Modules');
for (const moduleName of fs.readdirSync(modulesDir)) {
const modulePath = path.join(modulesDir, moduleName);
if (!fs.statSync(modulePath).isDirectory()) {
continue;
}
const packageJson = path.join(modulePath, 'package.json');
const viteConfig = path.join(modulePath, 'vite.config.js');
if (!fs.existsSync(packageJson) || !fs.existsSync(viteConfig)) {
console.log(`Skipping ${moduleName}`);
continue;
}
console.log(`Building ${moduleName}`);
try {
execSync(
'npm run build',
{
cwd: modulePath,
stdio: 'inherit',
}
);
} catch (error) {
console.error(`Failed building ${moduleName}`);
process.exit(1);
}
}