@tscircuit/core 0.0.94 → 0.0.96

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
@@ -611,6 +611,7 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
611
611
  x: number;
612
612
  y: number;
613
613
  }): void;
614
+ _hasMatchedPcbPrimitive(): boolean;
614
615
  }
615
616
 
616
617
  type ReactSubtree = {
package/dist/index.js CHANGED
@@ -984,6 +984,9 @@ var Port = class extends PrimitiveComponent {
984
984
  y: newCenter.y
985
985
  });
986
986
  }
987
+ _hasMatchedPcbPrimitive() {
988
+ return this.matchedComponents.some((c) => c.isPcbPrimitive);
989
+ }
987
990
  };
988
991
 
989
992
  // lib/components/base-components/NormalComponent.ts
@@ -2598,6 +2601,23 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
2598
2601
  const { allPortsFound, ports } = this._findConnectedPorts();
2599
2602
  const portsConnectedOnPcbViaNet = [];
2600
2603
  if (!allPortsFound) return;
2604
+ const portsWithoutMatchedPcbPrimitive = [];
2605
+ for (const port of ports) {
2606
+ if (!port._hasMatchedPcbPrimitive()) {
2607
+ portsWithoutMatchedPcbPrimitive.push(port);
2608
+ }
2609
+ }
2610
+ if (portsWithoutMatchedPcbPrimitive.length > 0) {
2611
+ db.pcb_trace_error.insert({
2612
+ error_type: "pcb_trace_error",
2613
+ source_trace_id: this.source_trace_id,
2614
+ message: `Some ports did not have a matching PCB primitive (e.g. a pad or plated hole), this can happen if a footprint is missing. As a result, ${this} wasn't routed. Missing ports: ${portsWithoutMatchedPcbPrimitive.map((p) => p.getString()).join(", ")}`,
2615
+ pcb_trace_id: this.pcb_trace_id,
2616
+ pcb_component_ids: [],
2617
+ pcb_port_ids: portsWithoutMatchedPcbPrimitive.map((p) => p.pcb_port_id).filter(Boolean)
2618
+ });
2619
+ return;
2620
+ }
2601
2621
  const nets = this._findConnectedNets().netsWithSelectors;
2602
2622
  if (ports.length === 0 && nets.length === 2) {
2603
2623
  this.renderError(
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.94",
4
+ "version": "0.0.96",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/tscircuit/core"
14
+ },
11
15
  "scripts": {
12
16
  "build": "tsup-node index.ts --format esm --dts",
13
17
  "measure-bundle": "howfat -r table ."