-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-reproductible-dev.sh
More file actions
executable file
·71 lines (57 loc) · 1.79 KB
/
build-reproductible-dev.sh
File metadata and controls
executable file
·71 lines (57 loc) · 1.79 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
#!/bin/bash
# Reproducible build script for local development
# Uses the npm workaround to avoid Yarn workspaces resolution conflicts
set -e
echo "🔨 Reproducible build with npm workaround"
echo "=========================================="
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Backup Yarn workspace files
echo -e "${YELLOW}💾 Backing up Yarn workspace files...${NC}"
if [ -f "package.json" ]; then
mv package.json package.json.bak
fi
# Clean existing node_modules
echo -e "${YELLOW}🧹 Cleaning node_modules...${NC}"
rm -rf node_modules
rm -rf apps/client/node_modules
rm -rf apps/cloudflare-worker/node_modules
rm -rf .turbo
rm -rf apps/client/.turbo
rm -rf apps/client/dist
# npm install in each app
echo -e "${YELLOW}📦 npm install in client...${NC}"
cd apps/client
npm install
cd ../../
echo -e "${YELLOW}📦 npm install in cloudflare-worker...${NC}"
cd apps/cloudflare-worker
npm install
cd ../../
# Restore Lock files
echo -e "${YELLOW}🔄 Restoring Lock files...${NC}"
if [ -f "package.json.bak" ]; then
mv package.json.bak package.json
fi
# Build client with environment
echo -e "${YELLOW}🔨 Building project...${NC}"
npm run build:env
# Check
if [ -d "apps/client/dist" ]; then
echo -e "${GREEN}✅ Client build succeeded${NC}"
# Check HeroUI styles
echo -e "${YELLOW}🎨 Checking HeroUI styles...${NC}"
if find apps/client/dist -name "*.css" -exec grep -l "rounded\|heroui" {} \; | grep -q .; then
echo -e "${GREEN}✅ HeroUI styles detected${NC}"
else
echo -e "${RED}⚠️ HeroUI styles not detected${NC}"
fi
else
echo -e "${RED}❌ Build failed${NC}"
exit 1
fi
echo -e "${GREEN}✅ Reproducible build finished${NC}"
echo -e "${YELLOW}🚀 You can now run: yarn preview:client${NC}"