genbox 1.0.59 → 1.0.61
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/dist/commands/destroy.js +1 -1
- package/dist/commands/list.js +1 -0
- package/dist/commands/rebuild.js +5 -64
- package/dist/commands/scan.js +1162 -0
- package/dist/index.js +0 -0
- package/dist/migration.js +335 -0
- package/dist/schema-v3.js +48 -0
- package/package.json +12 -13
package/dist/commands/destroy.js
CHANGED
|
@@ -290,7 +290,7 @@ async function createPRForChanges(genbox) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
exports.destroyCommand = new commander_1.Command('destroy')
|
|
293
|
-
.
|
|
293
|
+
.aliases(['delete', 'remove', 'rm'])
|
|
294
294
|
.description('Destroy one or more Genboxes')
|
|
295
295
|
.argument('[name]', 'Name of the Genbox to destroy (optional - will prompt if not provided)')
|
|
296
296
|
.option('-y, --yes', 'Skip confirmation')
|
package/dist/commands/list.js
CHANGED
|
@@ -9,6 +9,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
9
9
|
const api_1 = require("../api");
|
|
10
10
|
const genbox_selector_1 = require("../genbox-selector");
|
|
11
11
|
exports.listCommand = new commander_1.Command('list')
|
|
12
|
+
.alias('ls')
|
|
12
13
|
.description('List genboxes (scoped to current project by default)')
|
|
13
14
|
.option('-a, --all', 'Show all genboxes across all projects')
|
|
14
15
|
.option('--terminated', 'Include terminated genboxes')
|
package/dist/commands/rebuild.js
CHANGED
|
@@ -244,19 +244,12 @@ function buildRebuildPayload(resolved, config, publicKey, privateKey, configLoad
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
content: setupScript,
|
|
253
|
-
permissions: '0755',
|
|
254
|
-
});
|
|
255
|
-
}
|
|
247
|
+
// NOTE: Setup script generation removed from CLI.
|
|
248
|
+
// The API generates a comprehensive setup script with clone commands at /root/setup-genbox.sh
|
|
249
|
+
// and copies it to /home/dev/setup-genbox.sh via runcmd. This avoids having two conflicting
|
|
250
|
+
// scripts in write_files where the CLI version lacked clone commands.
|
|
251
|
+
// The envFilesToMove variable is kept as API needs this info for .env file movement.
|
|
256
252
|
const postDetails = [];
|
|
257
|
-
if (setupScript) {
|
|
258
|
-
postDetails.push('su - dev -c "/home/dev/setup-genbox.sh"');
|
|
259
|
-
}
|
|
260
253
|
// Build repos
|
|
261
254
|
const repos = {};
|
|
262
255
|
for (const repo of resolved.repos) {
|
|
@@ -298,58 +291,6 @@ function validateGitCredentials(repos, gitToken, privateKey) {
|
|
|
298
291
|
}
|
|
299
292
|
return { warnings, errors };
|
|
300
293
|
}
|
|
301
|
-
/**
|
|
302
|
-
* Generate setup script
|
|
303
|
-
*/
|
|
304
|
-
function generateSetupScript(resolved, config, envFilesToMove = []) {
|
|
305
|
-
const lines = [
|
|
306
|
-
'#!/bin/bash',
|
|
307
|
-
'# Generated by genbox rebuild',
|
|
308
|
-
'set -e',
|
|
309
|
-
'',
|
|
310
|
-
];
|
|
311
|
-
if (envFilesToMove.length > 0) {
|
|
312
|
-
lines.push('# Move .env files from staging to app directories');
|
|
313
|
-
for (const { stagingName, targetPath } of envFilesToMove) {
|
|
314
|
-
lines.push(`if [ -f "/home/dev/.env-staging/${stagingName}" ]; then`);
|
|
315
|
-
lines.push(` mkdir -p "$(dirname "${targetPath}")"`);
|
|
316
|
-
lines.push(` mv "/home/dev/.env-staging/${stagingName}" "${targetPath}"`);
|
|
317
|
-
lines.push(` echo "Moved .env to ${targetPath}"`);
|
|
318
|
-
lines.push('fi');
|
|
319
|
-
}
|
|
320
|
-
lines.push('rm -rf /home/dev/.env-staging 2>/dev/null || true');
|
|
321
|
-
lines.push('');
|
|
322
|
-
}
|
|
323
|
-
if (resolved.repos.length > 0) {
|
|
324
|
-
lines.push(`cd ${resolved.repos[0].path} || exit 1`);
|
|
325
|
-
lines.push('');
|
|
326
|
-
}
|
|
327
|
-
lines.push('# Install dependencies');
|
|
328
|
-
lines.push('if [ -f "pnpm-lock.yaml" ]; then');
|
|
329
|
-
lines.push(' echo "Installing dependencies with pnpm..."');
|
|
330
|
-
lines.push(' pnpm install --frozen-lockfile');
|
|
331
|
-
lines.push('elif [ -f "yarn.lock" ]; then');
|
|
332
|
-
lines.push(' echo "Installing dependencies with yarn..."');
|
|
333
|
-
lines.push(' yarn install --frozen-lockfile');
|
|
334
|
-
lines.push('elif [ -f "bun.lockb" ]; then');
|
|
335
|
-
lines.push(' echo "Installing dependencies with bun..."');
|
|
336
|
-
lines.push(' bun install --frozen-lockfile');
|
|
337
|
-
lines.push('elif [ -f "package-lock.json" ]; then');
|
|
338
|
-
lines.push(' echo "Installing dependencies with npm..."');
|
|
339
|
-
lines.push(' npm ci');
|
|
340
|
-
lines.push('fi');
|
|
341
|
-
const hasLocalApi = resolved.apps.some(a => a.name === 'api' || a.type === 'backend');
|
|
342
|
-
if (hasLocalApi) {
|
|
343
|
-
lines.push('');
|
|
344
|
-
lines.push('echo "Starting Docker services..."');
|
|
345
|
-
lines.push('if [ -f "docker-compose.yml" ] || [ -f "compose.yml" ]; then');
|
|
346
|
-
lines.push(' docker compose up -d');
|
|
347
|
-
lines.push('fi');
|
|
348
|
-
}
|
|
349
|
-
lines.push('');
|
|
350
|
-
lines.push('echo "Setup complete!"');
|
|
351
|
-
return lines.join('\n');
|
|
352
|
-
}
|
|
353
294
|
/**
|
|
354
295
|
* Prompt for branch options interactively
|
|
355
296
|
*/
|