forked from QuorumProof/QuorumProof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.sh
More file actions
136 lines (121 loc) · 4.16 KB
/
verify.sh
File metadata and controls
136 lines (121 loc) · 4.16 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/bin/bash
# QuorumProof Dashboard Project Verification
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ QuorumProof Dashboard - Project Verification ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
cd "$(dirname "$0")" || exit 1
ERRORS=0
WARNINGS=0
# Check 1: Git branch
echo "• Checking git branch..."
if git branch | grep -q "feature/credential-card-component"; then
echo " ✓ Feature branch exists: feature/credential-card-component"
else
echo " ✗ Feature branch not found"
((ERRORS++))
fi
# Check 2: Files exist
echo ""
echo "• Checking required files..."
REQUIRED_FILES=(
"dashboard/src/components/CredentialCard.tsx"
"dashboard/src/types/credential.ts"
"dashboard/src/styles/credentialCard.css"
"dashboard/src/App.tsx"
"dashboard/package.json"
"dashboard/tsconfig.json"
"dashboard/vite.config.ts"
"dashboard/README.md"
"dashboard/SETUP.md"
)
for file in "${REQUIRED_FILES[@]}"; do
if [ -f "$file" ]; then
echo " ✓ $file"
else
echo " ✗ $file missing"
((ERRORS++))
fi
done
# Check 3: Git commits
echo ""
echo "• Checking git commits..."
COMMIT_COUNT=$(git rev-list --count feature/credential-card-component ^main 2>/dev/null || echo "0")
if [ "$COMMIT_COUNT" -ge 3 ]; then
echo " ✓ Found $COMMIT_COUNT commits on feature branch"
else
echo " ✗ Expected at least 3 commits, found $COMMIT_COUNT"
((ERRORS++))
fi
# Check 4: TypeScript config
echo ""
echo "• Checking TypeScript configuration..."
if grep -q '"jsx": "react-jsx"' dashboard/tsconfig.json; then
echo " ✓ JSX support configured"
else
echo " ✗ JSX configuration incomplete"
((WARNINGS++))
fi
# Check 5: Component structure
echo ""
echo "• Checking component structure..."
if grep -q "export.*CredentialCard" dashboard/src/components/CredentialCard.tsx; then
echo " ✓ CredentialCard properly exported"
else
echo " ✗ CredentialCard export issue"
((ERRORS++))
fi
if grep -q "export interface CredentialCardProps" dashboard/src/components/CredentialCard.tsx; then
echo " ✓ CredentialCardProps interface exported"
else
echo " ✗ CredentialCardProps not exported"
((ERRORS++))
fi
# Check 6: Styling
echo ""
echo "• Checking CSS styling..."
if grep -q "credential-card {" dashboard/src/styles/credentialCard.css; then
echo " ✓ Component styles present"
else
echo " ✗ Component styles missing"
((ERRORS++))
fi
# Check 7: Package.json dependencies
echo ""
echo "• Checking dependencies..."
DEPS="react react-dom lucide-react clsx date-fns"
for dep in $DEPS; do
if grep -q "\"$dep\"" dashboard/package.json; then
echo " ✓ $dep"
else
echo " ✗ $dep missing from package.json"
((ERRORS++))
fi
done
# Summary
echo ""
echo "╔════════════════════════════════════════════════════════════╗"
if [ $ERRORS -eq 0 ]; then
echo "║ ✓ All checks passed! ║"
else
echo "║ ✗ Found $ERRORS error(s) ║"
fi
if [ $WARNINGS -gt 0 ]; then
echo "║ ⚠ Found $WARNINGS warning(s) ║"
fi
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
if [ $ERRORS -eq 0 ]; then
echo "Next steps:"
echo " 1. cd dashboard"
echo " 2. npm install"
echo " 3. npm run dev"
echo " 4. Open http://localhost:5173"
echo ""
echo "To create PR on GitHub:"
echo " gh pr create --base main --head feature/credential-card-component"
exit 0
else
echo "Please fix the errors listed above before proceeding."
exit 1
fi