-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathgenerate-structure.sh
More file actions
executable file
·75 lines (65 loc) · 2.37 KB
/
Copy pathgenerate-structure.sh
File metadata and controls
executable file
·75 lines (65 loc) · 2.37 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Clean display of src folder structure
echo "📁 NESTJS PROJECT STRUCTURE"
echo "============================"
echo ""
# Show directories with proper tree formatting
echo "📂 DIRECTORIES:"
echo "--------------"
find src -type d | sort | while read dir; do
# Count depth for indentation
depth=$(echo "$dir" | tr -cd '/' | wc -c)
indent=$(printf "%${depth}s" "" | tr ' ' ' ')
# Get folder name
folder_name=$(basename "$dir")
# Skip root src in display
if [ "$dir" != "src" ]; then
# Check if this is last item at this depth
parent=$(dirname "$dir")
siblings=$(find "$parent" -maxdepth 1 -type d | sort)
last_sibling=$(echo "$siblings" | tail -1)
if [ "$dir" = "$last_sibling" ]; then
echo "${indent}└── $folder_name"
else
echo "${indent}├── $folder_name"
fi
fi
done
echo ""
echo "📄 MAIN FILES:"
echo "-------------"
ls -la src/*.ts 2>/dev/null | grep -E "\.(ts|js)$" | grep -v ".spec.ts" | while read file; do
echo "├── $(basename "$file")"
done
echo ""
echo "🏗️ MODULES:"
echo "-----------"
find src -name "*.module.ts" -not -path "*/node_modules/*" | sort | while read module; do
module_name=$(basename "$module" .module.ts)
echo "├── $module_name.module.ts"
done
echo ""
echo "🎯 CONTROLLERS:"
echo "---------------"
find src -name "*.controller.ts" -not -path "*/node_modules/*" | sort | while read controller; do
controller_name=$(basename "$controller" .controller.ts)
echo "├── $controller_name.controller.ts"
done
echo ""
echo "⚙️ SERVICES:"
echo "-----------"
find src -name "*.service.ts" -not -path "*/node_modules/*" | sort | while read service; do
service_name=$(basename "$service" .service.ts)
echo "├── $service_name.service.ts"
done
echo ""
echo "📊 SUMMARY:"
echo "----------"
echo "📂 Directories: $(find src -type d | wc -l)"
echo "📄 TypeScript files: $(find src -name "*.ts" | grep -v ".spec.ts" | wc -l)"
echo "📦 Modules: $(find src -name "*.module.ts" | wc -l)"
echo "🎯 Controllers: $(find src -name "*.controller.ts" | wc -l)"
echo "⚙️ Services: $(find src -name "*.service.ts" | wc -l)"
echo "📝 DTOs: $(find src -name "*.dto.ts" | wc -l)"
echo "🏛️ Entities: $(find src -name "*.entity.ts" | wc -l)"
echo "🛡️ Guards: $(find src -name "*.guard.ts" | wc -l)"