Files
at-mintel/scripts/validate-extensions.sh
Marc Mintel f48d89c368
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 6s
Monorepo Pipeline / 🧪 Test (push) Successful in 56s
Monorepo Pipeline / 🧹 Lint (push) Successful in 2m22s
Monorepo Pipeline / 🏗️ Build (push) Successful in 3m51s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
chore: comprehensive commit of all debugging, infrastructure, and extension fixes
Summary of changes:
- Corrected Directus extensions to use 'vue-router' for 'useRouter' instead of '@directus/extensions-sdk' (Fixed runtime crash).
- Standardized extension folder structure and moved built extensions to the root 'directus/extensions' directory.
- Updated 'scripts/sync-extensions.sh' and 'scripts/validate-extensions.sh' for better extension management.
- Added 'scripts/validate-sdk-imports.sh' as a safeguard against future invalid SDK imports.
- Integrated import validation into the '.husky/pre-push' hook.
- Standardized Docker restart policies and network configurations in 'cms-infra/docker-compose.yml'.
- Updated tracked 'data.db' with the correct 'module_bar' settings to ensure extension visibility.
- Cleaned up legacy files and consolidated extension package source code.

This commit captures the full state of the repository after resolving the 'missing extensions' issue.
2026-02-14 01:44:18 +01:00

68 lines
1.7 KiB
Bash

#!/bin/bash
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
TARGET_DIRS=(
"$REPO_ROOT/packages/cms-infra/extensions"
"$REPO_ROOT/directus/extensions"
)
echo "🛡️ Directus Extension Validator"
echo "================================="
for TARGET in "${TARGET_DIRS[@]}"; do
echo ""
echo "📂 Checking: $TARGET"
if [ ! -d "$TARGET" ]; then
echo " ❌ Directory does not exist!"
continue
fi
CATEGORIES=("endpoints" "hooks" "layouts" "modules" "operations" "panels" "displays" "interfaces")
FOUND_ANY=false
for CAT in "${CATEGORIES[@]}"; do
CAT_PATH="$TARGET/$CAT"
if [ -d "$CAT_PATH" ]; then
EXTS=$(ls "$CAT_PATH")
if [ -n "$EXTS" ]; then
FOUND_ANY=true
echo " 📦 $CAT:"
for EXT in $EXTS; do
EXT_PATH="$CAT_PATH/$EXT"
if [ -f "$EXT_PATH/package.json" ]; then
VERSION=$(node -e "console.log(require('$EXT_PATH/package.json').version)")
echo "$EXT (v$VERSION)"
else
echo " ⚠️ $EXT (MISSING package.json!)"
fi
done
fi
fi
done
if [ "$FOUND_ANY" = false ]; then
echo " 📭 No extensions found in standard category folders."
fi
# Check for legacy files
LEGACY=$(find "$TARGET" -maxdepth 1 -not -path "$TARGET" -not -name ".*" -type d)
for L in $LEGACY; do
BN=$(basename "$L")
IS_CAT=false
for CAT in "${CATEGORIES[@]}"; do
if [ "$BN" == "$CAT" ]; then IS_CAT=true; break; fi
done
if [ "$IS_CAT" = false ]; then
echo " 🚨 LEGACY/UNRESOLVED FOLDER FOUND: $BN (Will NOT be loaded by Directus)"
fi
done
done
echo ""
echo "✨ Validation complete."