@tscircuit/cli 0.1.1839 → 0.1.1840

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.
@@ -11851,16 +11851,28 @@ function analyzeCircuitJson(circuitJson) {
11851
11851
  const hasWarningType = typeof item.warning_type === "string";
11852
11852
  const isTypedError = typeof t === "string" && t.endsWith("_error");
11853
11853
  const isTypedWarning = typeof t === "string" && t.endsWith("_warning");
11854
- if (hasErrorType || isTypedError) {
11855
- errors.push(item);
11856
- continue;
11857
- }
11858
11854
  if (hasWarningType || isTypedWarning) {
11859
11855
  warnings.push(item);
11856
+ continue;
11857
+ }
11858
+ if (hasErrorType || isTypedError) {
11859
+ errors.push(item);
11860
11860
  }
11861
11861
  }
11862
11862
  return { errors, warnings };
11863
11863
  }
11864
+ function formatCircuitJsonDiagnostics({
11865
+ errors,
11866
+ warnings
11867
+ }) {
11868
+ const lines = [`Errors: ${errors.length}`, `Warnings: ${warnings.length}`];
11869
+ for (const issue of [...errors, ...warnings]) {
11870
+ const issueType = issue.warning_type ?? issue.error_type ?? issue.type ?? "unknown_issue";
11871
+ lines.push(`- ${issueType}: ${issue.message ?? ""}`);
11872
+ }
11873
+ return lines.join(`
11874
+ `);
11875
+ }
11864
11876
 
11865
11877
  // lib/shared/generate-circuit-json.tsx
11866
11878
  import fs7 from "node:fs";
@@ -13200,9 +13212,10 @@ var EMPTY_IGNORE_COUNTS = () => ({
13200
13212
  pin_specification: 0,
13201
13213
  placement: 0,
13202
13214
  routing: 0,
13215
+ source: 0,
13203
13216
  unknown: 0
13204
13217
  });
13205
- var normalizeCategory = (category) => category === "netlist" || category === "pin_specification" || category === "placement" || category === "routing" ? category : "unknown";
13218
+ var normalizeCategory = (category) => category === "netlist" || category === "pin_specification" || category === "placement" || category === "routing" || category === "source" ? category : "unknown";
13206
13219
  var categorizeIssue = (issue) => normalizeCategory(categorizeErrorOrWarning(issue));
13207
13220
  var shouldIgnoreCategory = (category, ignoreOptions) => {
13208
13221
  switch (category) {
@@ -13263,6 +13276,7 @@ var formatIgnoredDrcCounts = (counts) => [
13263
13276
  ["pin_specification", counts.pin_specification],
13264
13277
  ["placement", counts.placement],
13265
13278
  ["routing", counts.routing],
13279
+ ["source", counts.source],
13266
13280
  ["unknown", counts.unknown]
13267
13281
  ].filter(([, count]) => count > 0).map(([category, count]) => `${category}: ${count}`).join(", ");
13268
13282