@idealyst/cli 1.0.34 → 1.0.35
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 +1 -1
- package/templates/workspace/.devcontainer/Dockerfile +22 -0
- package/templates/workspace/.devcontainer/devcontainer.json +0 -140
- package/templates/workspace/.devcontainer/docker-compose.yml +13 -26
- package/templates/workspace/.devcontainer/{post-create.sh → setup.sh} +10 -35
- package/templates/workspace/Dockerfile +24 -6
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
FROM node:20-bullseye
|
|
2
|
+
|
|
3
|
+
# Install additional tools
|
|
4
|
+
RUN apt-get update && apt-get install -y \
|
|
5
|
+
git \
|
|
6
|
+
postgresql-client \
|
|
7
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
8
|
+
|
|
9
|
+
# Enable corepack for yarn
|
|
10
|
+
RUN corepack enable
|
|
11
|
+
|
|
12
|
+
# Set working directory
|
|
13
|
+
WORKDIR /workspace
|
|
14
|
+
|
|
15
|
+
# Install global tools that might be useful
|
|
16
|
+
RUN npm install -g @expo/cli
|
|
17
|
+
|
|
18
|
+
# Set up git (will be configured in setup script)
|
|
19
|
+
RUN git config --global init.defaultBranch main
|
|
20
|
+
|
|
21
|
+
# Keep container running
|
|
22
|
+
CMD ["sleep", "infinity"]
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Idealyst Development Environment",
|
|
3
|
-
"dockerComposeFile": ["./docker-compose.yml"],
|
|
4
|
-
"service": "dev",
|
|
5
|
-
"workspaceFolder": "/app",
|
|
6
|
-
"shutdownAction": "stopCompose",
|
|
7
|
-
|
|
8
|
-
// VS Code configuration
|
|
9
|
-
"customizations": {
|
|
10
|
-
"vscode": {
|
|
11
|
-
"settings": {
|
|
12
|
-
"terminal.integrated.shell.linux": "/bin/bash",
|
|
13
|
-
"typescript.preferences.includePackageJsonAutoImports": "auto",
|
|
14
|
-
"editor.formatOnSave": true,
|
|
15
|
-
"editor.codeActionsOnSave": {
|
|
16
|
-
"source.fixAll.eslint": "explicit",
|
|
17
|
-
"source.organizeImports": "explicit"
|
|
18
|
-
},
|
|
19
|
-
"files.watcherExclude": {
|
|
20
|
-
"**/node_modules/**": true,
|
|
21
|
-
"**/.git/**": true,
|
|
22
|
-
"**/dist/**": true,
|
|
23
|
-
"**/coverage/**": true
|
|
24
|
-
},
|
|
25
|
-
"search.exclude": {
|
|
26
|
-
"**/node_modules": true,
|
|
27
|
-
"**/dist": true,
|
|
28
|
-
"**/coverage": true,
|
|
29
|
-
"**/.yarn": true
|
|
30
|
-
},
|
|
31
|
-
"typescript.preferences.importModuleSpecifier": "relative",
|
|
32
|
-
"jest.jestCommandLine": "yarn test",
|
|
33
|
-
"jest.autoRun": "off"
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// Extensions to install
|
|
37
|
-
"extensions": [
|
|
38
|
-
"ms-vscode.vscode-typescript-next",
|
|
39
|
-
"bradlc.vscode-tailwindcss",
|
|
40
|
-
"esbenp.prettier-vscode",
|
|
41
|
-
"dbaeumer.vscode-eslint",
|
|
42
|
-
"ms-vscode.vscode-json",
|
|
43
|
-
"ms-vscode.test-adapter-converter",
|
|
44
|
-
"orta.vscode-jest",
|
|
45
|
-
"ms-vscode.vscode-npm-script",
|
|
46
|
-
"christian-kohler.path-intellisense",
|
|
47
|
-
"formulahendry.auto-rename-tag",
|
|
48
|
-
"bradlc.vscode-tailwindcss",
|
|
49
|
-
"ms-vscode.vscode-docker",
|
|
50
|
-
"ms-azuretools.vscode-docker",
|
|
51
|
-
"redhat.vscode-yaml",
|
|
52
|
-
"ms-vscode.vscode-markdown",
|
|
53
|
-
"yzhang.markdown-all-in-one",
|
|
54
|
-
"davidanson.vscode-markdownlint",
|
|
55
|
-
"ms-vscode.vscode-git-graph",
|
|
56
|
-
"eamodio.gitlens",
|
|
57
|
-
"github.vscode-pull-request-github",
|
|
58
|
-
"github.copilot",
|
|
59
|
-
"github.copilot-chat",
|
|
60
|
-
"ms-vscode.vscode-react-native",
|
|
61
|
-
"msjsdiag.vscode-react-native"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
// Development container features
|
|
67
|
-
"features": {
|
|
68
|
-
"ghcr.io/devcontainers/features/git:1": {
|
|
69
|
-
"ppa": true,
|
|
70
|
-
"version": "latest"
|
|
71
|
-
},
|
|
72
|
-
"ghcr.io/devcontainers/features/github-cli:1": {
|
|
73
|
-
"version": "latest"
|
|
74
|
-
},
|
|
75
|
-
"ghcr.io/devcontainers/features/common-utils:2": {
|
|
76
|
-
"installZsh": true,
|
|
77
|
-
"configureZshAsDefaultShell": true,
|
|
78
|
-
"installOhMyZsh": true,
|
|
79
|
-
"username": "devuser",
|
|
80
|
-
"userUid": 1001,
|
|
81
|
-
"userGid": 1001
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
// Port forwarding for development servers
|
|
86
|
-
"forwardPorts": [
|
|
87
|
-
3000, // Web dev server
|
|
88
|
-
3001, // API server
|
|
89
|
-
5173, // Vite dev server
|
|
90
|
-
8080, // Additional dev server
|
|
91
|
-
19006, // Expo dev tools
|
|
92
|
-
5432, // PostgreSQL
|
|
93
|
-
6379 // Redis
|
|
94
|
-
],
|
|
95
|
-
|
|
96
|
-
"portsAttributes": {
|
|
97
|
-
"3000": {
|
|
98
|
-
"label": "Web App",
|
|
99
|
-
"onAutoForward": "openBrowser"
|
|
100
|
-
},
|
|
101
|
-
"3001": {
|
|
102
|
-
"label": "API Server",
|
|
103
|
-
"onAutoForward": "silent"
|
|
104
|
-
},
|
|
105
|
-
"5173": {
|
|
106
|
-
"label": "Vite Dev Server",
|
|
107
|
-
"onAutoForward": "openBrowser"
|
|
108
|
-
},
|
|
109
|
-
"19006": {
|
|
110
|
-
"label": "Expo Dev Tools",
|
|
111
|
-
"onAutoForward": "openBrowser"
|
|
112
|
-
},
|
|
113
|
-
"5432": {
|
|
114
|
-
"label": "PostgreSQL",
|
|
115
|
-
"onAutoForward": "silent"
|
|
116
|
-
},
|
|
117
|
-
"6379": {
|
|
118
|
-
"label": "Redis",
|
|
119
|
-
"onAutoForward": "silent"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
// Post-create commands
|
|
124
|
-
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
|
125
|
-
|
|
126
|
-
// Development user
|
|
127
|
-
"remoteUser": "devuser",
|
|
128
|
-
|
|
129
|
-
// Environment variables
|
|
130
|
-
"remoteEnv": {
|
|
131
|
-
"NODE_ENV": "development",
|
|
132
|
-
"DATABASE_URL": "postgresql://postgres:postgres@postgres:5432/idealyst_db",
|
|
133
|
-
"REDIS_URL": "redis://redis:6379"
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
// Mount the workspace with proper permissions
|
|
137
|
-
"mounts": [
|
|
138
|
-
"source=${localWorkspaceFolder},target=/app,type=bind,consistency=cached"
|
|
139
|
-
]
|
|
140
|
-
}
|
|
@@ -2,7 +2,7 @@ services:
|
|
|
2
2
|
# PostgreSQL Database
|
|
3
3
|
postgres:
|
|
4
4
|
image: postgres:15-alpine
|
|
5
|
-
container_name: ${PROJECT_NAME:-
|
|
5
|
+
container_name: ${PROJECT_NAME:-idealyst}-postgres
|
|
6
6
|
environment:
|
|
7
7
|
POSTGRES_DB: ${POSTGRES_DB:-idealyst_db}
|
|
8
8
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
@@ -11,40 +11,30 @@ services:
|
|
|
11
11
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
12
12
|
volumes:
|
|
13
13
|
- postgres_data:/var/lib/postgresql/data
|
|
14
|
-
- ../docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
15
|
-
healthcheck:
|
|
16
|
-
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
17
|
-
interval: 30s
|
|
18
|
-
timeout: 10s
|
|
19
|
-
retries: 5
|
|
20
14
|
networks:
|
|
21
15
|
- idealyst-network
|
|
22
16
|
|
|
23
17
|
# Redis Cache
|
|
24
18
|
redis:
|
|
25
19
|
image: redis:7-alpine
|
|
26
|
-
container_name: ${PROJECT_NAME:-
|
|
20
|
+
container_name: ${PROJECT_NAME:-idealyst}-redis
|
|
27
21
|
ports:
|
|
28
22
|
- "${REDIS_PORT:-6379}:6379"
|
|
29
23
|
volumes:
|
|
30
24
|
- redis_data:/data
|
|
31
|
-
healthcheck:
|
|
32
|
-
test: ["CMD", "redis-cli", "ping"]
|
|
33
|
-
interval: 30s
|
|
34
|
-
timeout: 10s
|
|
35
|
-
retries: 5
|
|
36
25
|
networks:
|
|
37
26
|
- idealyst-network
|
|
38
27
|
|
|
39
28
|
# Development Service (for devcontainer)
|
|
40
|
-
|
|
29
|
+
app:
|
|
41
30
|
build:
|
|
42
31
|
context: ..
|
|
43
|
-
dockerfile: Dockerfile
|
|
44
|
-
|
|
45
|
-
container_name: ${PROJECT_NAME:-truday}-dev
|
|
32
|
+
dockerfile: .devcontainer/Dockerfile
|
|
33
|
+
container_name: ${PROJECT_NAME:-idealyst}-app
|
|
46
34
|
environment:
|
|
47
35
|
NODE_ENV: development
|
|
36
|
+
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/idealyst_db
|
|
37
|
+
REDIS_URL: redis://redis:6379
|
|
48
38
|
ports:
|
|
49
39
|
- "3000:3000" # Web dev server
|
|
50
40
|
- "3001:3001" # API dev server
|
|
@@ -52,22 +42,19 @@ services:
|
|
|
52
42
|
- "8080:8080" # Additional dev server
|
|
53
43
|
- "19006:19006" # Expo dev tools
|
|
54
44
|
volumes:
|
|
55
|
-
- ..:/
|
|
56
|
-
- /
|
|
57
|
-
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
45
|
+
- ..:/workspace
|
|
46
|
+
- node_modules:/workspace/node_modules
|
|
58
47
|
depends_on:
|
|
59
|
-
postgres
|
|
60
|
-
|
|
61
|
-
redis:
|
|
62
|
-
condition: service_healthy
|
|
48
|
+
- postgres
|
|
49
|
+
- redis
|
|
63
50
|
networks:
|
|
64
51
|
- idealyst-network
|
|
65
|
-
|
|
66
|
-
stdin_open: true
|
|
52
|
+
command: sleep infinity
|
|
67
53
|
|
|
68
54
|
volumes:
|
|
69
55
|
postgres_data:
|
|
70
56
|
redis_data:
|
|
57
|
+
node_modules:
|
|
71
58
|
|
|
72
59
|
networks:
|
|
73
60
|
idealyst-network:
|
|
@@ -1,31 +1,15 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
# Post-create script for Idealyst dev container
|
|
4
3
|
echo "🚀 Setting up Idealyst development environment..."
|
|
5
4
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Make scripts executable
|
|
10
|
-
chmod +x /app/scripts/*.sh
|
|
11
|
-
|
|
12
|
-
# Install dependencies if not already installed
|
|
13
|
-
if [ ! -d "/app/node_modules" ]; then
|
|
14
|
-
echo "📦 Installing dependencies..."
|
|
15
|
-
yarn install
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
# Set up git configuration (if not already set)
|
|
19
|
-
if [ -z "$(git config --global user.name)" ]; then
|
|
20
|
-
echo "⚙️ Please configure git:"
|
|
21
|
-
echo " git config --global user.name \"Your Name\""
|
|
22
|
-
echo " git config --global user.email \"your.email@example.com\""
|
|
23
|
-
fi
|
|
5
|
+
# Install dependencies
|
|
6
|
+
echo "📦 Installing dependencies..."
|
|
7
|
+
yarn install
|
|
24
8
|
|
|
25
9
|
# Create environment file if it doesn't exist
|
|
26
|
-
if [ ! -f "
|
|
10
|
+
if [ ! -f ".env" ]; then
|
|
27
11
|
echo "📝 Creating .env file..."
|
|
28
|
-
cat >
|
|
12
|
+
cat > .env << EOF
|
|
29
13
|
# Database Configuration
|
|
30
14
|
DATABASE_URL=postgresql://postgres:postgres@postgres:5432/idealyst_db
|
|
31
15
|
POSTGRES_DB=idealyst_db
|
|
@@ -61,29 +45,20 @@ done
|
|
|
61
45
|
echo "✅ Database is ready!"
|
|
62
46
|
|
|
63
47
|
# Run database migrations if they exist
|
|
64
|
-
if [ -d "
|
|
48
|
+
if [ -d "packages" ]; then
|
|
65
49
|
echo "🗄️ Setting up database..."
|
|
66
50
|
|
|
67
51
|
# Check if any package has prisma
|
|
68
|
-
for package_dir in
|
|
52
|
+
for package_dir in packages/*/; do
|
|
69
53
|
if [ -f "${package_dir}prisma/schema.prisma" ]; then
|
|
70
54
|
echo "Running Prisma setup for $(basename "$package_dir")..."
|
|
71
55
|
cd "$package_dir"
|
|
72
56
|
npx prisma generate
|
|
73
57
|
npx prisma db push
|
|
74
|
-
cd /
|
|
58
|
+
cd /workspace
|
|
75
59
|
fi
|
|
76
60
|
done
|
|
77
61
|
fi
|
|
78
62
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
echo "🐕 Setting up git hooks..."
|
|
82
|
-
yarn husky install
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
|
-
# Create helpful aliases
|
|
86
|
-
echo "⚡ Setting up helpful aliases..."
|
|
87
|
-
cat >> ~/.bashrc << EOF
|
|
88
|
-
|
|
89
|
-
source ~/.bashrc
|
|
63
|
+
echo "✅ Development environment is ready!"
|
|
64
|
+
echo "🎉 You can now start developing your Idealyst application!"
|
|
@@ -66,16 +66,34 @@ CMD ["nginx", "-g", "daemon off;"]
|
|
|
66
66
|
# Development stage - for use with dev containers
|
|
67
67
|
FROM base AS dev
|
|
68
68
|
|
|
69
|
+
# Install additional tools for development
|
|
70
|
+
RUN apt-get update && apt-get install -y \
|
|
71
|
+
sudo \
|
|
72
|
+
postgresql-client \
|
|
73
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
74
|
+
|
|
75
|
+
# Create dev user with proper permissions
|
|
76
|
+
RUN groupadd --gid 1000 devuser \
|
|
77
|
+
&& useradd --uid 1000 --gid devuser --shell /bin/bash --create-home devuser \
|
|
78
|
+
&& echo 'devuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
|
79
|
+
|
|
80
|
+
# Set up workspace directory with proper ownership
|
|
81
|
+
RUN mkdir -p /app && chown -R devuser:devuser /app
|
|
82
|
+
|
|
83
|
+
# Switch to dev user for remaining setup
|
|
84
|
+
USER devuser
|
|
85
|
+
WORKDIR /app
|
|
86
|
+
|
|
69
87
|
# Copy package files
|
|
70
|
-
COPY package.json yarn.lock .yarnrc.yml ./
|
|
71
|
-
COPY .yarn .yarn
|
|
88
|
+
COPY --chown=devuser:devuser package.json yarn.lock .yarnrc.yml ./
|
|
89
|
+
COPY --chown=devuser:devuser .yarn .yarn
|
|
72
90
|
|
|
73
91
|
# Create packages directory structure and copy package.json files
|
|
74
92
|
RUN mkdir -p packages/api packages/app packages/components packages/web
|
|
75
|
-
COPY packages/api/package.json ./packages/api/
|
|
76
|
-
COPY packages/app/package.json ./packages/app/
|
|
77
|
-
COPY packages/components/package.json ./packages/components/
|
|
78
|
-
COPY packages/web/package.json ./packages/web/
|
|
93
|
+
COPY --chown=devuser:devuser packages/api/package.json ./packages/api/
|
|
94
|
+
COPY --chown=devuser:devuser packages/app/package.json ./packages/app/
|
|
95
|
+
COPY --chown=devuser:devuser packages/components/package.json ./packages/components/
|
|
96
|
+
COPY --chown=devuser:devuser packages/web/package.json ./packages/web/
|
|
79
97
|
|
|
80
98
|
# Install dependencies including dev dependencies
|
|
81
99
|
RUN yarn install
|