genbox 1.0.109 → 1.0.111

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.
@@ -1212,6 +1212,15 @@ function generateSetupScript(resolved, config, envFilesToMove = []) {
1212
1212
  lines.push(' fi');
1213
1213
  lines.push(' }');
1214
1214
  lines.push('');
1215
+ lines.push(' # Function to normalize CORS_ORIGINS format (remove quotes for Docker compatibility)');
1216
+ lines.push(' fix_cors_origins() {');
1217
+ lines.push(' local envfile="$1"');
1218
+ lines.push(' if grep -q "^CORS_ORIGINS=" "$envfile" 2>/dev/null; then');
1219
+ lines.push(' sed -i \'/^CORS_ORIGINS=/ s/"//g\' "$envfile" 2>/dev/null || true');
1220
+ lines.push(" sed -i \"/^CORS_ORIGINS=/ s/'//g\" \"$envfile\" 2>/dev/null || true");
1221
+ lines.push(' fi');
1222
+ lines.push(' }');
1223
+ lines.push('');
1215
1224
  for (const { stagingName, targetPath } of envFilesToMove) {
1216
1225
  // Determine runner type for this app
1217
1226
  // stagingName could be "appName" or "appName/serviceName" for service sections
@@ -1221,6 +1230,7 @@ function generateSetupScript(resolved, config, envFilesToMove = []) {
1221
1230
  lines.push(` mkdir -p "$(dirname "${targetPath}")"`);
1222
1231
  lines.push(` extract_section "${stagingName}" /home/dev/.env.genbox > "${targetPath}"`);
1223
1232
  lines.push(` expand_infra_urls "${targetPath}" "${runner}"`);
1233
+ lines.push(` fix_cors_origins "${targetPath}"`);
1224
1234
  lines.push(` echo " Created ${targetPath}"`);
1225
1235
  }
1226
1236
  lines.push('');
@@ -421,7 +421,10 @@ exports.statusCommand = new commander_1.Command('status')
421
421
  for (const app of pm2Services) {
422
422
  const statusColor = app.status === 'online' ? chalk_1.default.green :
423
423
  app.status === 'stopped' ? chalk_1.default.yellow : chalk_1.default.red;
424
- console.log(`${app.name}\t\t${statusColor(app.status)}\t\t${app.cpu || 0}%\t${app.memory || 0}MB`);
424
+ // Memory is already in MB from heartbeat (or bytes from legacy heartbeats)
425
+ // If value > 10000, assume bytes and convert; otherwise assume MB
426
+ const memoryMb = app.memory ? (app.memory > 10000 ? Math.round(app.memory / (1024 * 1024)) : app.memory) : 0;
427
+ console.log(`${app.name}\t\t${statusColor(app.status)}\t\t${app.cpu || 0}%\t${memoryMb}MB`);
425
428
  }
426
429
  console.log('');
427
430
  }
package/dist/index.js CHANGED
File without changes
@@ -94,6 +94,18 @@ function buildAppEnvContent(sections, appName, serviceUrlMap) {
94
94
  const pattern = new RegExp(`\\$\\{${varName}\\}`, 'g');
95
95
  envContent = envContent.replace(pattern, value);
96
96
  }
97
+ // Normalize CORS_ORIGINS format: Docker env_file doesn't support mixed quoting like "url1","url2",url3
98
+ // Convert to unquoted comma-separated format: CORS_ORIGINS=url1,url2,url3
99
+ envContent = envContent
100
+ .split('\n')
101
+ .map(line => {
102
+ if (line.startsWith('CORS_ORIGINS=')) {
103
+ // Remove all quotes from the CORS_ORIGINS value
104
+ return line.replace(/["']/g, '');
105
+ }
106
+ return line;
107
+ })
108
+ .join('\n');
97
109
  // Keep only actual env vars (filter out pure comment lines but keep var definitions)
98
110
  envContent = envContent
99
111
  .split('\n')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.109",
3
+ "version": "1.0.111",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -10,17 +10,6 @@
10
10
  "files": [
11
11
  "dist/**/*"
12
12
  ],
13
- "scripts": {
14
- "build": "tsc",
15
- "start": "node dist/index.js",
16
- "dev": "ts-node src/index.ts",
17
- "prepublishOnly": "npm run build",
18
- "publish:patch": "./scripts/publish.sh patch",
19
- "publish:minor": "./scripts/publish.sh minor",
20
- "publish:major": "./scripts/publish.sh major",
21
- "release": "./scripts/publish.sh patch",
22
- "test": "echo \"Error: no test specified\" && exit 1"
23
- },
24
13
  "keywords": [
25
14
  "genbox",
26
15
  "ai",
@@ -65,5 +54,15 @@
65
54
  "inquirer": "^13.0.2",
66
55
  "js-yaml": "^4.1.1",
67
56
  "ora": "^9.0.0"
57
+ },
58
+ "scripts": {
59
+ "build": "tsc",
60
+ "start": "node dist/index.js",
61
+ "dev": "ts-node src/index.ts",
62
+ "publish:patch": "./scripts/publish.sh patch",
63
+ "publish:minor": "./scripts/publish.sh minor",
64
+ "publish:major": "./scripts/publish.sh major",
65
+ "release": "./scripts/publish.sh patch",
66
+ "test": "echo \"Error: no test specified\" && exit 1"
68
67
  }
69
- }
68
+ }