@idealyst/cli 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,6 +130,10 @@ This workspace includes comprehensive Docker support for development, staging, a
130
130
  ### Quick Start with Docker
131
131
 
132
132
  ```bash
133
+ # Use the Docker build helper (recommended)
134
+ ./scripts/docker-build.sh dev
135
+
136
+ # Or manually:
133
137
  # Development environment
134
138
  cp .env.example .env
135
139
  ./scripts/docker/deploy.sh development
@@ -140,6 +144,8 @@ cp .env.production .env
140
144
  ./scripts/docker/deploy.sh production
141
145
  ```
142
146
 
147
+ **Docker Build Helper**: The `./scripts/docker-build.sh` script automatically handles common issues like missing yarn.lock files and environment configuration.
148
+
143
149
  ### VS Code Dev Container
144
150
 
145
151
  Open this workspace in VS Code and select "Reopen in Container" for a fully configured development environment with:
@@ -0,0 +1,151 @@
1
+ #!/bin/bash
2
+
3
+ # Docker build helper script for Idealyst workspace
4
+ # Handles common issues like missing yarn.lock files
5
+
6
+ set -e
7
+
8
+ # Colors for output
9
+ RED='\033[0;31m'
10
+ GREEN='\033[0;32m'
11
+ YELLOW='\033[1;33m'
12
+ BLUE='\033[0;34m'
13
+ NC='\033[0m' # No Color
14
+
15
+ echo -e "${BLUE}🐳 Idealyst Docker Build Helper${NC}"
16
+ echo ""
17
+
18
+ # Check if yarn.lock exists
19
+ if [ ! -f "yarn.lock" ]; then
20
+ echo -e "${YELLOW}⚠️ yarn.lock not found${NC}"
21
+ echo "This can cause Docker build failures with 'immutable' installs."
22
+ echo ""
23
+ read -p "Would you like to generate yarn.lock now? (y/N): " -n 1 -r
24
+ echo ""
25
+
26
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
27
+ echo -e "${BLUE}📦 Installing dependencies to generate yarn.lock...${NC}"
28
+ yarn install
29
+ echo -e "${GREEN}✅ yarn.lock generated${NC}"
30
+ else
31
+ echo -e "${YELLOW}⚠️ Continuing without yarn.lock (may cause build issues)${NC}"
32
+ fi
33
+ echo ""
34
+ fi
35
+
36
+ # Check if .env exists
37
+ if [ ! -f ".env" ]; then
38
+ echo -e "${YELLOW}⚠️ .env file not found${NC}"
39
+ if [ -f ".env.example" ]; then
40
+ read -p "Would you like to copy .env.example to .env? (y/N): " -n 1 -r
41
+ echo ""
42
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
43
+ cp .env.example .env
44
+ echo -e "${GREEN}✅ .env file created from .env.example${NC}"
45
+ echo -e "${YELLOW}📝 Please review and update .env with your settings${NC}"
46
+ fi
47
+ else
48
+ echo -e "${YELLOW}📝 Please create a .env file with your configuration${NC}"
49
+ fi
50
+ echo ""
51
+ fi
52
+
53
+ # Determine what to build
54
+ if [ $# -eq 0 ]; then
55
+ echo "What would you like to do?"
56
+ echo "1) Build and start development environment"
57
+ echo "2) Build and start production services"
58
+ echo "3) Build specific service"
59
+ echo "4) Just build (no start)"
60
+ echo ""
61
+ read -p "Choice (1-4): " -n 1 -r
62
+ echo ""
63
+
64
+ case $REPLY in
65
+ 1)
66
+ echo -e "${BLUE}🚀 Building and starting development environment...${NC}"
67
+ docker-compose build dev
68
+ docker-compose up -d postgres redis
69
+ docker-compose up dev
70
+ ;;
71
+ 2)
72
+ echo -e "${BLUE}🚀 Building and starting production services...${NC}"
73
+ docker-compose build
74
+ docker-compose up -d
75
+ ;;
76
+ 3)
77
+ echo "Available services: api, web, dev, postgres, redis"
78
+ read -p "Service name: " service
79
+ echo -e "${BLUE}🚀 Building ${service}...${NC}"
80
+ docker-compose build $service
81
+ ;;
82
+ 4)
83
+ echo -e "${BLUE}🏗️ Building all services...${NC}"
84
+ docker-compose build
85
+ ;;
86
+ *)
87
+ echo -e "${RED}❌ Invalid choice${NC}"
88
+ exit 1
89
+ ;;
90
+ esac
91
+ else
92
+ # Handle command line arguments
93
+ case "$1" in
94
+ "dev")
95
+ echo -e "${BLUE}🚀 Building and starting development environment...${NC}"
96
+ docker-compose build dev
97
+ docker-compose up -d postgres redis
98
+ docker-compose up dev
99
+ ;;
100
+ "prod"|"production")
101
+ echo -e "${BLUE}🚀 Building and starting production services...${NC}"
102
+ docker-compose build
103
+ docker-compose up -d
104
+ ;;
105
+ "build")
106
+ if [ -n "$2" ]; then
107
+ echo -e "${BLUE}🏗️ Building ${2}...${NC}"
108
+ docker-compose build $2
109
+ else
110
+ echo -e "${BLUE}🏗️ Building all services...${NC}"
111
+ docker-compose build
112
+ fi
113
+ ;;
114
+ "help"|"-h"|"--help")
115
+ echo "Usage: $0 [command] [service]"
116
+ echo ""
117
+ echo "Commands:"
118
+ echo " dev Build and start development environment"
119
+ echo " prod Build and start production services"
120
+ echo " build [svc] Build all services or specific service"
121
+ echo " help Show this help"
122
+ echo ""
123
+ echo "Services: api, web, dev, postgres, redis"
124
+ ;;
125
+ *)
126
+ echo -e "${RED}❌ Unknown command: $1${NC}"
127
+ echo "Use '$0 help' for usage information"
128
+ exit 1
129
+ ;;
130
+ esac
131
+ fi
132
+
133
+ echo ""
134
+ echo -e "${GREEN}🎉 Done!${NC}"
135
+
136
+ # Show helpful information
137
+ if docker-compose ps | grep -q "Up"; then
138
+ echo ""
139
+ echo -e "${BLUE}📋 Running services:${NC}"
140
+ docker-compose ps
141
+ echo ""
142
+ echo -e "${BLUE}🔗 Access your application:${NC}"
143
+ echo "• Web: http://localhost:3000"
144
+ echo "• API: http://localhost:3001"
145
+ echo "• Vite Dev: http://localhost:5173"
146
+ echo ""
147
+ echo -e "${BLUE}💡 Useful commands:${NC}"
148
+ echo "• View logs: docker-compose logs -f"
149
+ echo "• Stop services: docker-compose down"
150
+ echo "• Access dev container: docker-compose exec dev bash"
151
+ fi