-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify-structure.sh
57 lines (47 loc) · 1.34 KB
/
verify-structure.sh
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
#!/bin/bash
echo "Verifying project structure..."
# Check for essential files
ESSENTIAL_FILES=(
"src/main.tsx"
"src/components/App.tsx"
"index.html"
"vite.config.js"
"package.json"
)
for file in "${ESSENTIAL_FILES[@]}"; do
if [ ! -f "$file" ]; then
echo "❌ Missing essential file: $file"
else
echo "✅ Found essential file: $file"
fi
done
# Check if entry points match
HTML_ENTRY=$(grep -o 'src="[^"]*"' index.html | grep -o '/[^"]*')
echo "Entry point in HTML: $HTML_ENTRY"
# Check for correct dependencies
DEPENDENCIES=(
"react"
"react-dom"
"@vitejs/plugin-react"
"vite"
)
for dep in "${DEPENDENCIES[@]}"; do
if npm list "$dep" --depth=0 2>/dev/null | grep -q "$dep"; then
echo "✅ Found dependency: $dep"
else
echo "❌ Missing dependency: $dep"
fi
done
# Fix common issues
echo "Attempting to fix common issues..."
# Ensure index.html points to main.tsx
if ! grep -q 'src="/src/main.tsx"' index.html; then
sed -i.bak 's|src="/src/[^"]*"|src="/src/main.tsx"|g' index.html
echo "✅ Updated index.html to point to /src/main.tsx"
fi
# Ensure vite.config.js has the correct base path
if ! grep -q "base: " vite.config.js; then
sed -i.bak '/plugins: \[react()\],/a \ \ base: `/awesome-scalability-talks/`,' vite.config.js
echo "✅ Added base path to vite.config.js"
fi
echo "Structure verification complete!"