@tscircuit/core 0.0.63 → 0.0.64

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.d.ts CHANGED
@@ -3773,7 +3773,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3773
3773
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3774
3774
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3775
3775
  }>>;
3776
- }, "pcbRotation" | "layer">, {
3776
+ }, "layer" | "pcbRotation">, {
3777
3777
  name: zod.ZodOptional<zod.ZodString>;
3778
3778
  shape: zod.ZodLiteral<"circle">;
3779
3779
  holeDiameter: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
@@ -3808,7 +3808,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3808
3808
  }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
3809
3809
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
3810
3810
  }>>;
3811
- }, "pcbRotation" | "layer">, {
3811
+ }, "layer" | "pcbRotation">, {
3812
3812
  name: zod.ZodOptional<zod.ZodString>;
3813
3813
  shape: zod.ZodLiteral<"oval">;
3814
3814
  outerWidth: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
package/dist/index.js CHANGED
@@ -2590,7 +2590,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
2590
2590
  const [trace] = traces;
2591
2591
  if (dominantLayer) {
2592
2592
  trace.route = trace.route.map((p) => {
2593
- if (p.route_type === "wire") {
2593
+ if (p.route_type === "wire" && !p.layer) {
2594
2594
  p.layer = dominantLayer;
2595
2595
  }
2596
2596
  return p;
@@ -3445,10 +3445,9 @@ var FabricationNotePath = class extends PrimitiveComponent {
3445
3445
  y: transformedPosition.y
3446
3446
  };
3447
3447
  }),
3448
- stroke_width: props.strokeWidth ?? 0.1,
3449
- fabrication_note_path_id: `fabrication_note_${Math.random().toString()}`
3448
+ stroke_width: props.strokeWidth ?? 0.1
3450
3449
  });
3451
- this.fabrication_note_path_id = fabrication_note_path.fabrication_note_path_id;
3450
+ this.fabrication_note_path_id = fabrication_note_path.pcb_fabrication_note_path_id;
3452
3451
  }
3453
3452
  };
3454
3453
 
@@ -3524,7 +3523,7 @@ var Circuit = class {
3524
3523
  "${e.message}"`
3525
3524
  );
3526
3525
  });
3527
- return circuitToSvg.circuitJsonToPcbSvg(this.getSoup());
3526
+ return circuitToSvg.circuitJsonToPcbSvg(this.getCircuitJson());
3528
3527
  }
3529
3528
  async preview(previewNameOrOpts) {
3530
3529
  const previewOpts = typeof previewNameOrOpts === "object" ? previewNameOrOpts : { previewName: previewNameOrOpts };
package/lib/Project.ts CHANGED
@@ -86,7 +86,7 @@ export class Circuit {
86
86
  )
87
87
  })
88
88
 
89
- return circuitToSvg.circuitJsonToPcbSvg(this.getSoup())
89
+ return circuitToSvg.circuitJsonToPcbSvg(this.getCircuitJson())
90
90
  }
91
91
 
92
92
  async preview(
@@ -42,10 +42,9 @@ export class FabricationNotePath extends PrimitiveComponent<
42
42
  }
43
43
  }),
44
44
  stroke_width: props.strokeWidth ?? 0.1,
45
- fabrication_note_path_id: `fabrication_note_${Math.random().toString()}`,
46
45
  })
47
46
 
48
47
  this.fabrication_note_path_id =
49
- fabrication_note_path.fabrication_note_path_id
48
+ fabrication_note_path.pcb_fabrication_note_path_id
50
49
  }
51
50
  }
@@ -504,15 +504,13 @@ export class Trace extends PrimitiveComponent<typeof traceProps> {
504
504
  })
505
505
  return
506
506
  }
507
- // TODO ijump returns multiple traces for some reason
508
507
  const [trace] = traces as PCBTrace[]
509
- // TODO ijump always returns on top layer and has no multilayer support
510
- // https://github.com/tscircuit/autorouting-dataset/issues/35
511
- // For now, we'll move the trace to whatever layer the first point
512
- // specifies we should have "via'd" to
508
+
509
+ // If the autorouter didn't specify a layer, use the dominant layer
510
+ // Some of the single-layer autorouters don't add the layer property
513
511
  if (dominantLayer) {
514
512
  trace.route = trace.route.map((p) => {
515
- if (p.route_type === "wire") {
513
+ if (p.route_type === "wire" && !p.layer) {
516
514
  p.layer = dominantLayer
517
515
  }
518
516
  return p
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tscircuit/core",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.0.63",
5
+ "version": "0.0.64",
6
6
  "types": "dist/index.d.ts",
7
7
  "main": "dist/index.js",
8
8
  "files": [
@@ -23,7 +23,7 @@
23
23
  "@types/react": "^18.3.3",
24
24
  "@types/react-reconciler": "^0.28.8",
25
25
  "bun-match-svg": "0.0.2",
26
- "circuit-to-svg": "^0.0.28",
26
+ "circuit-to-svg": "^0.0.32",
27
27
  "debug": "^4.3.6",
28
28
  "howfat": "^0.3.8",
29
29
  "looks-same": "^9.0.1",
@@ -38,8 +38,8 @@
38
38
  "@tscircuit/infgrid-ijump-astar": "^0.0.18",
39
39
  "@tscircuit/math-utils": "^0.0.4",
40
40
  "@tscircuit/props": "^0.0.63",
41
- "@tscircuit/soup": "^0.0.69",
42
- "@tscircuit/soup-util": "^0.0.26",
41
+ "@tscircuit/soup": "^0.0.71",
42
+ "@tscircuit/soup-util": "^0.0.27",
43
43
  "circuit-json-to-connectivity-map": "^0.0.15",
44
44
  "footprinter": "^0.0.44",
45
45
  "nanoid": "^5.0.7",