Skip to content

Commit 2463865

Browse files
committed
fix(cli): handle audit file write errors gracefully
- Wrap writeFile in try/catch to handle filesystem errors - Add cross-field validation for preflight.dependencies (infoCount < warnCount) - Bump versions to 0.7.2
1 parent ae315c5 commit 2463865

File tree

8 files changed

+21
-8
lines changed

8 files changed

+21
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ignite",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"private": true,
55
"description": "Secure JS/TS code execution in Docker with sandboxing for AI agents, untrusted code, and microservices",
66
"workspaces": [

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ignite/cli",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"type": "module",
55
"bin": {
66
"ignite": "./dist/index.js"

packages/cli/src/commands/run.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ export async function runCommand(servicePath: string, options: RunOptions): Prom
6161

6262
if (options.auditOutput && audit) {
6363
const outputPath = resolve(process.cwd(), options.auditOutput);
64-
await writeFile(outputPath, JSON.stringify(audit, null, 2));
65-
logger.success(`Audit saved to ${outputPath}`);
64+
try {
65+
await writeFile(outputPath, JSON.stringify(audit, null, 2));
66+
logger.success(`Audit saved to ${outputPath}`);
67+
} catch (err) {
68+
logger.error(`Failed to write audit to ${outputPath}: ${(err as Error).message}`);
69+
}
6670
}
6771

6872
if (options.json) {

packages/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const program = new Command();
1313
program
1414
.name('ignite')
1515
.description('Secure sandbox for AI-generated code, untrusted scripts, and JS/TS execution')
16-
.version('0.7.1');
16+
.version('0.7.2');
1717

1818
program
1919
.command('init <name>')

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ignite/core",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"type": "module",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/core/src/service/load-service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ function validateServiceConfig(config: unknown): ServiceValidation {
141141
infoCount: 'positive',
142142
});
143143

144+
const dependencyConfig = pf['dependencies'] as Record<string, unknown> | undefined;
145+
const warnCount = dependencyConfig?.['warnCount'];
146+
const infoCount = dependencyConfig?.['infoCount'];
147+
if (typeof warnCount === 'number' && typeof infoCount === 'number') {
148+
if (infoCount >= warnCount) {
149+
errors.push('preflight.dependencies.infoCount must be less than preflight.dependencies.warnCount');
150+
}
151+
}
152+
144153
validatePreflightSection(pf['image'], 'preflight.image', errors, {
145154
warnMb: 'positive',
146155
failMb: 'positive',

packages/http/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ignite/http",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"type": "module",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ignite/shared",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"type": "module",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)