@idealyst/cli 1.0.30 → 1.0.31

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/cli",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "CLI tool for generating Idealyst Framework projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -6,6 +6,9 @@ echo "🚀 Setting up Idealyst development environment..."
6
6
  # Set proper permissions
7
7
  sudo chown -R devuser:devuser /app
8
8
 
9
+ # Make scripts executable
10
+ chmod +x /app/scripts/*.sh
11
+
9
12
  # Install dependencies if not already installed
10
13
  if [ ! -d "/app/node_modules" ]; then
11
14
  echo "📦 Installing dependencies..."
@@ -87,7 +87,7 @@ LICENSE
87
87
 
88
88
  # Package manager files
89
89
  package-lock.json
90
- yarn.lock
90
+ # yarn.lock - DO NOT IGNORE: Required for immutable installs
91
91
  pnpm-lock.yaml
92
92
 
93
93
  # Development scripts
@@ -295,7 +295,20 @@ All services include health checks:
295
295
  docker-compose build --no-cache
296
296
  ```
297
297
 
298
- 4. **Permission Issues**
298
+ 4. **Yarn Lockfile Issues**
299
+ If you see "The lockfile would have been created by this install, which is explicitly forbidden":
300
+ ```bash
301
+ # Create lockfile first
302
+ yarn install
303
+
304
+ # Then build Docker
305
+ docker-compose build
306
+
307
+ # Alternative: Use development mode (handles missing lockfile)
308
+ docker-compose up dev
309
+ ```
310
+
311
+ 5. **Permission Issues**
299
312
  ```bash
300
313
  # Fix file permissions
301
314
  sudo chown -R $USER:$USER .
@@ -11,9 +11,17 @@ RUN corepack enable
11
11
 
12
12
  # Dependencies stage - install all dependencies
13
13
  FROM base AS deps
14
- COPY package.json yarn.lock* .yarnrc.yml ./
14
+ COPY package.json yarn.lock .yarnrc.yml ./
15
15
  COPY .yarn .yarn
16
- RUN yarn install --immutable
16
+
17
+ # Create packages directory structure and copy package.json files
18
+ RUN mkdir -p packages/api packages/app packages/components packages/web
19
+ COPY packages/api/package.json ./packages/api/
20
+ COPY packages/app/package.json ./packages/app/
21
+ COPY packages/components/package.json ./packages/components/
22
+ COPY packages/web/package.json ./packages/web/
23
+
24
+ RUN yarn install
17
25
 
18
26
  # Build stage - build all packages
19
27
  FROM base AS builder
@@ -70,9 +78,16 @@ RUN apk add --no-cache \
70
78
  RUN npm install -g @types/node typescript ts-node nodemon
71
79
 
72
80
  # Copy package files
73
- COPY package.json yarn.lock* .yarnrc.yml ./
81
+ COPY package.json yarn.lock .yarnrc.yml ./
74
82
  COPY .yarn .yarn
75
83
 
84
+ # Create packages directory structure and copy package.json files
85
+ RUN mkdir -p packages/api packages/app packages/components packages/web
86
+ COPY packages/api/package.json ./packages/api/
87
+ COPY packages/app/package.json ./packages/app/
88
+ COPY packages/components/package.json ./packages/components/
89
+ COPY packages/web/package.json ./packages/web/
90
+
76
91
  # Install dependencies including dev dependencies
77
92
  RUN yarn install
78
93
 
@@ -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