@housekit/kit 0.1.31 → 0.1.32
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/index.js +38 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9471,7 +9471,24 @@ async function pushCommand(options) {
|
|
|
9471
9471
|
} catch (e) {
|
|
9472
9472
|
error("Push failed");
|
|
9473
9473
|
error("Error during push:");
|
|
9474
|
-
|
|
9474
|
+
if (e instanceof AggregateError) {
|
|
9475
|
+
error("Multiple errors occurred:");
|
|
9476
|
+
for (const err of e.errors) {
|
|
9477
|
+
error(` • ${err instanceof Error ? err.message : String(err)}`);
|
|
9478
|
+
if (err instanceof Error && err.stack) {
|
|
9479
|
+
const stackLines = err.stack.split(`
|
|
9480
|
+
`).slice(1, 3);
|
|
9481
|
+
stackLines.forEach((line) => error(` ${line.trim()}`));
|
|
9482
|
+
}
|
|
9483
|
+
}
|
|
9484
|
+
} else if (e instanceof Error) {
|
|
9485
|
+
error(e.message);
|
|
9486
|
+
if (e.cause) {
|
|
9487
|
+
error(`Caused by: ${e.cause instanceof Error ? e.cause.message : String(e.cause)}`);
|
|
9488
|
+
}
|
|
9489
|
+
} else {
|
|
9490
|
+
error(String(e));
|
|
9491
|
+
}
|
|
9475
9492
|
} finally {
|
|
9476
9493
|
await client.close();
|
|
9477
9494
|
}
|
|
@@ -11581,13 +11598,32 @@ program.hook("preAction", (thisCommand) => {
|
|
|
11581
11598
|
const opts = thisCommand.optsWithGlobals?.() ?? thisCommand.opts();
|
|
11582
11599
|
setGlobalYesMode(Boolean(opts.yes));
|
|
11583
11600
|
});
|
|
11601
|
+
function formatError(err) {
|
|
11602
|
+
const lines = [];
|
|
11603
|
+
if (err instanceof AggregateError) {
|
|
11604
|
+
lines.push("Multiple errors occurred:");
|
|
11605
|
+
for (const e of err.errors) {
|
|
11606
|
+
lines.push(` • ${e instanceof Error ? e.message : String(e)}`);
|
|
11607
|
+
}
|
|
11608
|
+
} else if (err instanceof Error) {
|
|
11609
|
+
lines.push(err.message);
|
|
11610
|
+
if (err.cause) {
|
|
11611
|
+
lines.push(`Caused by: ${err.cause instanceof Error ? err.cause.message : String(err.cause)}`);
|
|
11612
|
+
}
|
|
11613
|
+
} else {
|
|
11614
|
+
lines.push(String(err));
|
|
11615
|
+
}
|
|
11616
|
+
return lines;
|
|
11617
|
+
}
|
|
11584
11618
|
function withErrorHandling(fn) {
|
|
11585
11619
|
return async (...args) => {
|
|
11586
11620
|
try {
|
|
11587
11621
|
await fn(...args);
|
|
11588
11622
|
} catch (error3) {
|
|
11623
|
+
const errorLines = formatError(error3);
|
|
11589
11624
|
console.error(chalk5.red(`
|
|
11590
|
-
✖ Error: ` +
|
|
11625
|
+
✖ Error: ` + errorLines[0]));
|
|
11626
|
+
errorLines.slice(1).forEach((line) => console.error(chalk5.red(line)));
|
|
11591
11627
|
if (process.env.DEBUG) {
|
|
11592
11628
|
console.error(error3);
|
|
11593
11629
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@housekit/kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "CLI tool for HouseKit - manage ClickHouse schemas, migrations, and database operations with type-safe workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@clickhouse/client": "^1.14.0",
|
|
51
|
-
"@housekit/orm": "^0.1.
|
|
51
|
+
"@housekit/orm": "^0.1.38",
|
|
52
52
|
"boxen": "8.0.1",
|
|
53
53
|
"chalk": "^5.6.2",
|
|
54
54
|
"cli-table3": "^0.6.5",
|