barsa a3dbd07183 Enhance ESLint Rules and Refactor Domain Imports
- Updated ESLint configuration to enforce stricter import rules for the @customer-portal/domain package, promoting better import hygiene and preventing deep imports.
- Refactored various files across the BFF and portal applications to comply with the new import rules, ensuring that only the appropriate modules are imported from the domain.
- Cleaned up unused imports and optimized code structure for improved maintainability and clarity.
- Updated documentation to reflect changes in import practices and domain structure.
2025-12-26 14:53:03 +09:00

34 lines
1.0 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
# Ensures packages/domain/dist stays in sync with source.
# Intended for CI or local verification before pushing.
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
cd "$ROOT_DIR"
echo "[domain] Building @customer-portal/domain…"
pnpm --filter @customer-portal/domain build >/dev/null
echo "[domain] Checking exports contract…"
node ./scripts/domain/check-exports.mjs
echo "[domain] Checking import contract…"
bash ./scripts/domain/check-import-contract.sh
if command -v git >/dev/null 2>&1; then
if git diff --quiet -- packages/domain/dist; then
echo "[domain] OK: packages/domain/dist is up to date."
exit 0
fi
echo "[domain] ERROR: packages/domain/dist is out of sync with source."
echo "[domain] Run: pnpm --filter @customer-portal/domain build"
echo "[domain] Then commit the updated dist outputs."
git --no-pager diff -- packages/domain/dist | head -200
exit 1
fi
echo "[domain] WARNING: git not found; cannot verify dist drift. Build completed."