thrivekit 2.0.10 → 2.0.11
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/ralph/init.sh +38 -7
package/package.json
CHANGED
package/ralph/init.sh
CHANGED
|
@@ -189,15 +189,31 @@ auto_configure_project() {
|
|
|
189
189
|
# 2. Detect testUrlBase from common patterns
|
|
190
190
|
local base_url=""
|
|
191
191
|
|
|
192
|
-
# Check for
|
|
193
|
-
for
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
# Check docker-compose.yml for frontend/web service port mappings
|
|
193
|
+
for compose_file in "docker-compose.yml" "docker-compose.yaml" "compose.yml" "compose.yaml"; do
|
|
194
|
+
if [[ -f "$compose_file" && -z "$base_url" ]]; then
|
|
195
|
+
# Look for web/frontend service port mapping
|
|
196
|
+
local web_port
|
|
197
|
+
web_port=$(grep -A 20 -E '^\s*(web|frontend|client|ui):' "$compose_file" 2>/dev/null | \
|
|
198
|
+
grep -E '^\s*-\s*"?[0-9]+:[0-9]+"?' | head -1 | \
|
|
199
|
+
grep -oE '[0-9]+:' | head -1 | tr -d ':')
|
|
200
|
+
if [[ -n "$web_port" ]]; then
|
|
201
|
+
base_url="http://localhost:$web_port"
|
|
202
|
+
fi
|
|
198
203
|
fi
|
|
199
204
|
done
|
|
200
205
|
|
|
206
|
+
# Check for Vite config (uses port 5173 by default)
|
|
207
|
+
if [[ -z "$base_url" ]]; then
|
|
208
|
+
for vite_config in "vite.config.ts" "vite.config.js" "apps/web/vite.config.ts" "apps/web/vite.config.js" \
|
|
209
|
+
"apps/frontend/vite.config.ts" "frontend/vite.config.ts"; do
|
|
210
|
+
if [[ -f "$vite_config" ]]; then
|
|
211
|
+
base_url="http://localhost:5173"
|
|
212
|
+
break
|
|
213
|
+
fi
|
|
214
|
+
done
|
|
215
|
+
fi
|
|
216
|
+
|
|
201
217
|
# Check for Next.js (uses port 3000 by default)
|
|
202
218
|
if [[ -z "$base_url" ]]; then
|
|
203
219
|
for next_config in "next.config.js" "next.config.ts" "next.config.mjs" \
|
|
@@ -278,7 +294,22 @@ auto_configure_project() {
|
|
|
278
294
|
|
|
279
295
|
# 4. Detect API baseUrl based on backend type
|
|
280
296
|
local api_url=""
|
|
281
|
-
|
|
297
|
+
|
|
298
|
+
# Check docker-compose.yml for API service port mappings (most common)
|
|
299
|
+
for compose_file in "docker-compose.yml" "docker-compose.yaml" "compose.yml" "compose.yaml"; do
|
|
300
|
+
if [[ -f "$compose_file" && -z "$api_url" ]]; then
|
|
301
|
+
# Look for api/backend service port mapping like "8000:8000" or "3001:3000"
|
|
302
|
+
local api_port
|
|
303
|
+
api_port=$(grep -A 20 -E '^\s*(api|backend|server|app):' "$compose_file" 2>/dev/null | \
|
|
304
|
+
grep -E '^\s*-\s*"?[0-9]+:[0-9]+"?' | head -1 | \
|
|
305
|
+
grep -oE '[0-9]+:' | head -1 | tr -d ':')
|
|
306
|
+
if [[ -n "$api_port" ]]; then
|
|
307
|
+
api_url="http://localhost:$api_port"
|
|
308
|
+
fi
|
|
309
|
+
fi
|
|
310
|
+
done
|
|
311
|
+
|
|
312
|
+
if [[ -n "$backend_dir" && -z "$api_url" ]]; then
|
|
282
313
|
# Check Dockerfile for EXPOSE directive
|
|
283
314
|
if [[ -f "$backend_dir/Dockerfile" ]]; then
|
|
284
315
|
local docker_port
|