File size: 1,424 Bytes
cce8120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

OUT="interrogation/frontend"
mkdir -p "$OUT"

echo "[1/12] Project..."
pwd > "$OUT/project.txt"

echo "[2/12] Next.js..."
npm ls next --depth=0 > "$OUT/next.txt" 2>&1 || true

echo "[3/12] Routes..."
find app -type f 2>/dev/null | sort > "$OUT/routes.txt" || true
find src/app -type f 2>/dev/null | sort >> "$OUT/routes.txt" || true

echo "[4/12] Components..."
find components -type f 2>/dev/null | sort > "$OUT/components.txt" || true

echo "[5/12] Hooks..."
find hooks -type f 2>/dev/null | sort > "$OUT/hooks.txt" || true

echo "[6/12] Services..."
find services -type f 2>/dev/null | sort > "$OUT/services.txt" || true

echo "[7/12] API..."
grep -R "NEXT_PUBLIC_API_URL" . > "$OUT/api.txt" 2>/dev/null || true

echo "[8/12] GrapesJS..."
grep -R "grapesjs" . > "$OUT/grapesjs.txt" 2>/dev/null || true

echo "[9/12] Build..."
npm run build > "$OUT/build.log" 2>&1 || true

echo "[10/12] Dependencies..."
npm ls > "$OUT/dependencies.txt" 2>&1 || true

echo "[11/12] Summary..."
{
echo "Routes: $(wc -l < "$OUT/routes.txt" 2>/dev/null || echo 0)"
echo "Components: $(wc -l < "$OUT/components.txt" 2>/dev/null || echo 0)"
echo "Hooks: $(wc -l < "$OUT/hooks.txt" 2>/dev/null || echo 0)"
echo "Services: $(wc -l < "$OUT/services.txt" 2>/dev/null || echo 0)"
} > "$OUT/summary.txt"

echo "[12/12] Complete."
echo "$OUT"