@pd4castr/cli 0.0.7 → 0.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +38 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -63,6 +63,7 @@ var WSL_NETWORK_INTERFACE_DEFAULT = "eth0";
63
63
 
64
64
  // src/commands/fetch/handle-action.ts
65
65
  import path5 from "path";
66
+ import { ExecaError } from "execa";
66
67
  import { HTTPError } from "ky";
67
68
  import ora from "ora";
68
69
  import { ZodError as ZodError2 } from "zod";
@@ -347,9 +348,11 @@ ${link} to view fetched data
347
348
  spinner.fail(formatNestErrorMessage(errorResponse));
348
349
  } else if (error instanceof Error) {
349
350
  spinner.fail(error.message);
350
- if (error.cause) {
351
- console.error(error.cause);
352
- }
351
+ }
352
+ if (error instanceof Error && error.cause instanceof ExecaError) {
353
+ console.error(error.cause.shortMessage);
354
+ } else if (error instanceof Error && error.cause) {
355
+ console.error(error.cause);
353
356
  }
354
357
  process.exit(1);
355
358
  }
@@ -367,6 +370,7 @@ function registerFetchCommand(program2) {
367
370
  // src/commands/init/handle-action.ts
368
371
  import path6 from "path";
369
372
  import * as inquirer from "@inquirer/prompts";
373
+ import { ExecaError as ExecaError2 } from "execa";
370
374
  import ora2 from "ora";
371
375
  import tiged from "tiged";
372
376
 
@@ -418,7 +422,9 @@ async function handleAction2() {
418
422
  spinner.succeed("Template fetched successfully");
419
423
  } catch (error) {
420
424
  spinner.fail("Error fetching template");
421
- if (error instanceof Error && error.cause) {
425
+ if (error instanceof Error && error.cause instanceof ExecaError2) {
426
+ console.error(error.cause.shortMessage);
427
+ } else if (error instanceof Error && error.cause) {
422
428
  console.error(error.cause);
423
429
  }
424
430
  process.exit(1);
@@ -440,6 +446,7 @@ function registerInitCommand(program2) {
440
446
  }
441
447
 
442
448
  // src/commands/login/handle-action.ts
449
+ import { ExecaError as ExecaError3 } from "execa";
443
450
  import ora3 from "ora";
444
451
  import { ZodError as ZodError3 } from "zod";
445
452
 
@@ -545,9 +552,11 @@ async function handleAction3() {
545
552
  logZodIssues(error);
546
553
  } else if (error instanceof Error) {
547
554
  spinner.fail(error.message);
548
- if (error.cause) {
549
- console.error(error.cause);
550
- }
555
+ }
556
+ if (error instanceof Error && error.cause instanceof ExecaError3) {
557
+ console.error(error.cause.shortMessage);
558
+ } else if (error instanceof Error && error.cause) {
559
+ console.error(error.cause);
551
560
  }
552
561
  process.exit(1);
553
562
  }
@@ -559,6 +568,7 @@ function registerLoginCommand(program2) {
559
568
  }
560
569
 
561
570
  // src/commands/logout/handle-action.ts
571
+ import { ExecaError as ExecaError4 } from "execa";
562
572
  import ora4 from "ora";
563
573
  import { ZodError as ZodError4 } from "zod";
564
574
  async function handleAction4() {
@@ -580,9 +590,11 @@ async function handleAction4() {
580
590
  logZodIssues(error);
581
591
  } else if (error instanceof Error) {
582
592
  spinner.fail(error.message);
583
- if (error.cause) {
584
- console.error(error.cause);
585
- }
593
+ }
594
+ if (error instanceof Error && error.cause instanceof ExecaError4) {
595
+ console.error(error.cause.shortMessage);
596
+ } else if (error instanceof Error && error.cause) {
597
+ console.error(error.cause);
586
598
  }
587
599
  process.exit(1);
588
600
  }
@@ -594,6 +606,7 @@ function registerLogoutCommand(program2) {
594
606
  }
595
607
 
596
608
  // src/commands/publish/handle-action.ts
609
+ import { ExecaError as ExecaError5 } from "execa";
597
610
  import express2 from "express";
598
611
  import { HTTPError as HTTPError3 } from "ky";
599
612
  import ora5 from "ora";
@@ -970,7 +983,7 @@ async function handleCreateModelFlow(options, app, spinner, ctx, authCtx) {
970
983
  await runModelIOTests(dockerImage, options, app, ctx);
971
984
  spinner.succeed("Model I/O test passed");
972
985
  }
973
- spinner.start("Publishing model...");
986
+ spinner.start("Publishing new model...");
974
987
  const modelConfig = await getModelConfigFromProjectConfig(ctx);
975
988
  const model = await createModel(modelConfig, authCtx);
976
989
  await updateProjectConfig((config) => {
@@ -1049,6 +1062,7 @@ async function handleModelRevisionCreateFlow(options, app, spinner, ctx, authCtx
1049
1062
  await runModelIOTests(dockerImage, options, app, ctx);
1050
1063
  spinner.succeed("Model I/O test passed");
1051
1064
  }
1065
+ spinner.start("Publishing new model revision...");
1052
1066
  const modelConfig = await getModelConfigFromProjectConfig(ctx);
1053
1067
  const model = await createModel(modelConfig, authCtx);
1054
1068
  await updateProjectConfig((config) => {
@@ -1106,6 +1120,7 @@ async function handleModelRevisionUpdateFlow(options, app, spinner, ctx, authCtx
1106
1120
  await runModelIOTests(dockerImage, options, app, ctx);
1107
1121
  spinner.succeed("Model I/O test passed");
1108
1122
  }
1123
+ spinner.start("Updating model revision...");
1109
1124
  const modelConfig = await getModelConfigFromProjectConfig(ctx);
1110
1125
  const model = await updateModel(modelConfig, authCtx);
1111
1126
  await updateProjectConfig((config) => {
@@ -1177,9 +1192,11 @@ async function handleAction5(options) {
1177
1192
  spinner.fail(formatNestErrorMessage(errorResponse));
1178
1193
  } else if (error instanceof Error) {
1179
1194
  spinner.fail(error.message);
1180
- if (error.cause) {
1181
- console.error(error.cause);
1182
- }
1195
+ }
1196
+ if (error instanceof Error && error.cause instanceof ExecaError5) {
1197
+ console.error(error.cause.shortMessage);
1198
+ } else if (error instanceof Error && error.cause) {
1199
+ console.error(error.cause);
1183
1200
  }
1184
1201
  process.exit(1);
1185
1202
  }
@@ -1205,6 +1222,7 @@ function registerPublishCommand(program2) {
1205
1222
 
1206
1223
  // src/commands/test/handle-action.ts
1207
1224
  import path14 from "path";
1225
+ import { ExecaError as ExecaError6 } from "execa";
1208
1226
  import express3 from "express";
1209
1227
  import ora6 from "ora";
1210
1228
  import { ZodError as ZodError6 } from "zod";
@@ -1264,9 +1282,11 @@ ${clickHereLink} to view output (${fileLink})
1264
1282
  logZodIssues(error);
1265
1283
  } else if (error instanceof Error) {
1266
1284
  spinner.fail(error.message);
1267
- if (error.cause) {
1268
- console.error(error.cause);
1269
- }
1285
+ }
1286
+ if (error instanceof Error && error.cause instanceof ExecaError6) {
1287
+ console.error(error.cause.shortMessage);
1288
+ } else if (error instanceof Error && error.cause) {
1289
+ console.error(error.cause);
1270
1290
  }
1271
1291
  process.exit(1);
1272
1292
  }
@@ -1298,7 +1318,7 @@ import { Command } from "commander";
1298
1318
  // package.json
1299
1319
  var package_default = {
1300
1320
  name: "@pd4castr/cli",
1301
- version: "0.0.7",
1321
+ version: "0.0.8",
1302
1322
  description: "CLI tool for creating, testing, and publishing pd4castr models",
1303
1323
  main: "dist/index.js",
1304
1324
  type: "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pd4castr/cli",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "CLI tool for creating, testing, and publishing pd4castr models",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",