@tscircuit/cli 0.1.1051 → 0.1.1052

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.
@@ -13408,7 +13408,7 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13408
13408
  let glbError;
13409
13409
  let previewOk;
13410
13410
  let previewError;
13411
- if (glbOutputPath && !hasErrors) {
13411
+ if (glbOutputPath) {
13412
13412
  try {
13413
13413
  workerLog(`Converting ${path13.relative(projectDir, outputPath)} to GLB in same worker...`);
13414
13414
  await writeGlbFromCircuitJson(circuitJson, glbOutputPath);
@@ -13419,7 +13419,7 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13419
13419
  workerLog(`GLB conversion error: ${glbError}`);
13420
13420
  }
13421
13421
  }
13422
- if (options?.generatePreviewAssets && !hasErrors) {
13422
+ if (options?.generatePreviewAssets) {
13423
13423
  try {
13424
13424
  const resolvedPreviewOutputDir = previewOutputDir ?? path13.dirname(outputPath);
13425
13425
  workerLog(`Generating preview assets for ${path13.relative(projectDir, resolvedPreviewOutputDir)} in same worker...`);
@@ -13442,7 +13442,8 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13442
13442
  glb_error: glbError,
13443
13443
  preview_ok: previewOk,
13444
13444
  preview_error: previewError,
13445
- ok: !hasErrors,
13445
+ ok: true,
13446
+ hasErrors,
13446
13447
  errors,
13447
13448
  warnings,
13448
13449
  durationMs: options?.profile ? performance.now() - startedAt : undefined
@@ -13459,6 +13460,7 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, previewOutputD
13459
13460
  glb_output_path: glbOutputPath,
13460
13461
  preview_output_dir: previewOutputDir,
13461
13462
  ok: false,
13463
+ hasErrors: true,
13462
13464
  isFatalError: {
13463
13465
  errorType: "circuit_generation_failed",
13464
13466
  message: errorMsg
package/dist/cli/main.js CHANGED
@@ -71664,7 +71664,7 @@ var registerStaticAssetLoaders = () => {
71664
71664
  // cli/main.ts
71665
71665
  var import_perfect_cli = __toESM2(require_dist2(), 1);
71666
71666
  // package.json
71667
- var version = "0.1.1050";
71667
+ var version = "0.1.1051";
71668
71668
  var package_default = {
71669
71669
  name: "@tscircuit/cli",
71670
71670
  version,
@@ -80669,15 +80669,11 @@ var buildFile = async (input, output, projectDir, options) => {
80669
80669
  }
80670
80670
  }
80671
80671
  }
80672
- if (errors.length > 0 && !options?.ignoreErrors) {
80673
- console.error(kleur_default.red(`Build failed with ${errors.length} error(s). Use --ignore-errors to continue.`));
80674
- return { ok: false };
80675
- } else {
80676
- return {
80677
- ok: true,
80678
- circuitJson
80679
- };
80680
- }
80672
+ return {
80673
+ ok: true,
80674
+ circuitJson,
80675
+ hasErrors: errors.length > 0 && !options?.ignoreErrors
80676
+ };
80681
80677
  } catch (err) {
80682
80678
  console.error(err);
80683
80679
  if (err instanceof Error) {
@@ -82235,6 +82231,9 @@ var registerBuild = (program2) => {
82235
82231
  outputPath,
82236
82232
  ok: buildOutcome.ok
82237
82233
  });
82234
+ if (buildOutcome.hasErrors) {
82235
+ hasErrors = true;
82236
+ }
82238
82237
  if (!buildOutcome.ok) {
82239
82238
  hasErrors = true;
82240
82239
  if (buildOutcome.isFatalError) {
@@ -82331,7 +82330,11 @@ var registerBuild = (program2) => {
82331
82330
  onJobComplete: async (result) => {
82332
82331
  const relative3 = path39.relative(projectDir, result.filePath);
82333
82332
  if (result.ok) {
82334
- console.log(kleur_default.green(`✓ ${relative3}`));
82333
+ if (result.hasErrors) {
82334
+ console.log(kleur_default.yellow(`⚠ ${relative3} (${result.errors.length} error(s))`));
82335
+ } else {
82336
+ console.log(kleur_default.green(`✓ ${relative3}`));
82337
+ }
82335
82338
  } else {
82336
82339
  console.log(kleur_default.red(`✗ ${relative3}`));
82337
82340
  for (const error of result.errors) {
@@ -82347,6 +82350,7 @@ var registerBuild = (program2) => {
82347
82350
  }
82348
82351
  await processBuildResult(result.filePath, result.outputPath, {
82349
82352
  ok: result.ok,
82353
+ hasErrors: result.hasErrors,
82350
82354
  isFatalError: result.isFatalError
82351
82355
  });
82352
82356
  if (resolvedOptions?.glbs && result.ok) {
@@ -82511,7 +82515,7 @@ var registerBuild = (program2) => {
82511
82515
  }
82512
82516
  }
82513
82517
  }
82514
- const shouldExitNonZero = hasFatalErrors || hasErrors && !resolvedOptions?.ignoreErrors;
82518
+ const shouldExitNonZero = hasFatalErrors;
82515
82519
  const successCount = builtFiles.filter((f) => f.ok).length;
82516
82520
  const failCount = builtFiles.length - successCount;
82517
82521
  const enabledOpts = [
@@ -82548,7 +82552,7 @@ var registerBuild = (program2) => {
82548
82552
  ⚠ Build completed with errors`) : kleur_default.green(`
82549
82553
  ✓ Done`));
82550
82554
  if (shouldExitNonZero) {
82551
- exitBuild(1, hasFatalErrors ? "fatal circuit build errors occurred" : "build errors occurred and --ignore-errors was not enabled");
82555
+ exitBuild(1, "fatal circuit build errors occurred");
82552
82556
  }
82553
82557
  exitBuild(0, "build finished successfully");
82554
82558
  } catch (error) {
package/dist/lib/index.js CHANGED
@@ -60435,7 +60435,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60435
60435
  }));
60436
60436
  };
60437
60437
  // package.json
60438
- var version = "0.1.1050";
60438
+ var version = "0.1.1051";
60439
60439
  var package_default = {
60440
60440
  name: "@tscircuit/cli",
60441
60441
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1051",
3
+ "version": "0.1.1052",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",