feat: Setup projet Classeo avec infrastructure Docker et architecture DDD
Configure l'environnement de développement complet avec Docker Compose, structure DDD 4 Bounded Contexts, et pipeline CI/CD GitHub Actions. Corrections compatibilité CI: - Symfony 8 nécessite monolog-bundle ^4.0 (la v3.x ne supporte que jusqu'à Symfony 7) - ESLint v9 nécessite flat config (eslint.config.js) - le format .eslintrc.cjs est obsolète
This commit is contained in:
67
scripts/check-bc-isolation.sh
Executable file
67
scripts/check-bc-isolation.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# Bounded Context Isolation Check
|
||||
# Ensures Domain layer has no framework dependencies
|
||||
# =============================================================================
|
||||
|
||||
set -e
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
ERRORS=0
|
||||
|
||||
echo "Checking Bounded Context isolation..."
|
||||
echo ""
|
||||
|
||||
# Define forbidden imports in Domain layer
|
||||
FORBIDDEN_PATTERNS=(
|
||||
"use Symfony\\\\"
|
||||
"use Doctrine\\\\"
|
||||
"use ApiPlatform\\\\"
|
||||
"use Lexik\\\\"
|
||||
"#\[ORM\\\\"
|
||||
"#\[ApiResource"
|
||||
"#\[Assert\\\\"
|
||||
)
|
||||
|
||||
# Check each BC Domain folder
|
||||
for BC in Administration Scolarite VieScolaire Communication; do
|
||||
DOMAIN_PATH="backend/src/${BC}/Domain"
|
||||
|
||||
if [ -d "$DOMAIN_PATH" ]; then
|
||||
echo "Checking ${BC}/Domain..."
|
||||
|
||||
for pattern in "${FORBIDDEN_PATTERNS[@]}"; do
|
||||
# Use grep with -r for recursive, -n for line numbers
|
||||
if grep -rn "$pattern" "$DOMAIN_PATH" 2>/dev/null; then
|
||||
echo -e "${RED}ERROR: Found forbidden import pattern '$pattern' in ${BC}/Domain${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# Check Shared/Domain as well
|
||||
SHARED_DOMAIN="backend/src/Shared/Domain"
|
||||
if [ -d "$SHARED_DOMAIN" ]; then
|
||||
echo "Checking Shared/Domain..."
|
||||
|
||||
for pattern in "${FORBIDDEN_PATTERNS[@]}"; do
|
||||
if grep -rn "$pattern" "$SHARED_DOMAIN" 2>/dev/null; then
|
||||
echo -e "${RED}ERROR: Found forbidden import pattern '$pattern' in Shared/Domain${NC}"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo ""
|
||||
if [ $ERRORS -gt 0 ]; then
|
||||
echo -e "${RED}BC Isolation check FAILED with $ERRORS error(s)${NC}"
|
||||
echo "Domain layer must be pure PHP without framework dependencies."
|
||||
exit 1
|
||||
else
|
||||
echo -e "${GREEN}BC Isolation check PASSED${NC}"
|
||||
exit 0
|
||||
fi
|
||||
Reference in New Issue
Block a user