@aifabrix/builder 2.21.0 → 2.21.1
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/lib/cli.js +28 -28
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -340,7 +340,33 @@ function setupCommands(program) {
|
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
342
|
|
|
343
|
-
program.command('
|
|
343
|
+
program.command('json <app>')
|
|
344
|
+
.description('Generate deployment JSON (aifabrix-deploy.json for normal apps, application-schema.json for external systems)')
|
|
345
|
+
.action(async(appName) => {
|
|
346
|
+
try {
|
|
347
|
+
const result = await generator.generateDeployJsonWithValidation(appName);
|
|
348
|
+
if (result.success) {
|
|
349
|
+
const fileName = result.path.includes('application-schema.json') ? 'application-schema.json' : 'deployment JSON';
|
|
350
|
+
logger.log(`✓ Generated ${fileName}: ${result.path}`);
|
|
351
|
+
|
|
352
|
+
if (result.validation.warnings && result.validation.warnings.length > 0) {
|
|
353
|
+
logger.log('\n⚠️ Warnings:');
|
|
354
|
+
result.validation.warnings.forEach(warning => logger.log(` • ${warning}`));
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
logger.log('❌ Validation failed:');
|
|
358
|
+
if (result.validation.errors && result.validation.errors.length > 0) {
|
|
359
|
+
result.validation.errors.forEach(error => logger.log(` • ${error}`));
|
|
360
|
+
}
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
} catch (error) {
|
|
364
|
+
handleCommandError(error, 'json');
|
|
365
|
+
process.exit(1);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
program.command('split-json <app>')
|
|
344
370
|
.description('Split deployment JSON into component files (env.template, variables.yaml, rbac.yml, README.md)')
|
|
345
371
|
.option('-o, --output <dir>', 'Output directory for component files (defaults to same directory as JSON)')
|
|
346
372
|
.action(async(appName, options) => {
|
|
@@ -365,33 +391,7 @@ function setupCommands(program) {
|
|
|
365
391
|
}
|
|
366
392
|
logger.log(` • README.md: ${result.readme}`);
|
|
367
393
|
} catch (error) {
|
|
368
|
-
handleCommandError(error, '
|
|
369
|
-
process.exit(1);
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
program.command('json <app>')
|
|
374
|
-
.description('Generate deployment JSON (aifabrix-deploy.json for normal apps, application-schema.json for external systems)')
|
|
375
|
-
.action(async(appName) => {
|
|
376
|
-
try {
|
|
377
|
-
const result = await generator.generateDeployJsonWithValidation(appName);
|
|
378
|
-
if (result.success) {
|
|
379
|
-
const fileName = result.path.includes('application-schema.json') ? 'application-schema.json' : 'deployment JSON';
|
|
380
|
-
logger.log(`✓ Generated ${fileName}: ${result.path}`);
|
|
381
|
-
|
|
382
|
-
if (result.validation.warnings && result.validation.warnings.length > 0) {
|
|
383
|
-
logger.log('\n⚠️ Warnings:');
|
|
384
|
-
result.validation.warnings.forEach(warning => logger.log(` • ${warning}`));
|
|
385
|
-
}
|
|
386
|
-
} else {
|
|
387
|
-
logger.log('❌ Validation failed:');
|
|
388
|
-
if (result.validation.errors && result.validation.errors.length > 0) {
|
|
389
|
-
result.validation.errors.forEach(error => logger.log(` • ${error}`));
|
|
390
|
-
}
|
|
391
|
-
process.exit(1);
|
|
392
|
-
}
|
|
393
|
-
} catch (error) {
|
|
394
|
-
handleCommandError(error, 'json');
|
|
394
|
+
handleCommandError(error, 'split-json');
|
|
395
395
|
process.exit(1);
|
|
396
396
|
}
|
|
397
397
|
});
|