@tscircuit/core 0.0.360 → 0.0.362

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
@@ -1036,6 +1036,7 @@ declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>
1036
1036
  * or if using a "fullview" or "rip and replace" autorouting mode
1037
1037
  */
1038
1038
  _shouldUseTraceByTraceRouting(): boolean;
1039
+ doInitialPcbDesignRuleChecks(): void;
1039
1040
  }
1040
1041
 
1041
1042
  declare class Board extends Group<typeof boardProps> {
package/dist/index.js CHANGED
@@ -5629,6 +5629,7 @@ var getPhaseTimingsFromRenderEvents = (renderEvents) => {
5629
5629
  };
5630
5630
 
5631
5631
  // lib/components/primitive-components/Group/Group.ts
5632
+ import "@tscircuit/checks";
5632
5633
  var Group = class extends NormalComponent {
5633
5634
  pcb_group_id = null;
5634
5635
  subcircuit_id = null;
@@ -6130,10 +6131,38 @@ var Group = class extends NormalComponent {
6130
6131
  const autorouter = this._getAutorouterConfig();
6131
6132
  return autorouter.groupMode === "sequential-trace";
6132
6133
  }
6134
+ doInitialPcbDesignRuleChecks() {
6135
+ if (this.root?.pcbDisabled) return;
6136
+ if (this.getInheritedProperty("routingDisabled")) return;
6137
+ const { db } = this.root;
6138
+ if (this.isSubcircuit) {
6139
+ const subcircuitComponentsByName = /* @__PURE__ */ new Map();
6140
+ for (const child of this.children) {
6141
+ if (child.isSubcircuit) continue;
6142
+ if (child._parsedProps.name) {
6143
+ const components = subcircuitComponentsByName.get(child._parsedProps.name) || [];
6144
+ components.push(child);
6145
+ subcircuitComponentsByName.set(child._parsedProps.name, components);
6146
+ }
6147
+ }
6148
+ for (const [name, components] of subcircuitComponentsByName.entries()) {
6149
+ if (components.length > 1) {
6150
+ db.pcb_trace_error.insert({
6151
+ error_type: "pcb_trace_error",
6152
+ message: `Multiple components found with name "${name}" in subcircuit "${this._parsedProps.name || "unnamed"}". Component names must be unique within a subcircuit.`,
6153
+ source_trace_id: "",
6154
+ pcb_trace_id: "",
6155
+ pcb_component_ids: components.map((c) => c.pcb_component_id).filter(Boolean),
6156
+ pcb_port_ids: []
6157
+ });
6158
+ }
6159
+ }
6160
+ }
6161
+ }
6133
6162
  };
6134
6163
 
6135
6164
  // lib/components/normal-components/Board.ts
6136
- import { checkEachPcbTraceNonOverlapping } from "@tscircuit/checks";
6165
+ import { checkEachPcbTraceNonOverlapping as checkEachPcbTraceNonOverlapping2 } from "@tscircuit/checks";
6137
6166
  var Board = class extends Group {
6138
6167
  pcb_board_id = null;
6139
6168
  get isSubcircuit() {
@@ -6234,7 +6263,8 @@ var Board = class extends Group {
6234
6263
  if (this.root?.pcbDisabled) return;
6235
6264
  if (this.getInheritedProperty("routingDisabled")) return;
6236
6265
  const { db } = this.root;
6237
- const errors = checkEachPcbTraceNonOverlapping(db.toArray());
6266
+ super.doInitialPcbDesignRuleChecks();
6267
+ const errors = checkEachPcbTraceNonOverlapping2(db.toArray());
6238
6268
  for (const error of errors) {
6239
6269
  db.pcb_trace_error.insert(error);
6240
6270
  }
@@ -7332,7 +7362,7 @@ import { identity as identity4 } from "transformation-matrix";
7332
7362
  var package_default = {
7333
7363
  name: "@tscircuit/core",
7334
7364
  type: "module",
7335
- version: "0.0.359",
7365
+ version: "0.0.361",
7336
7366
  types: "dist/index.d.ts",
7337
7367
  main: "dist/index.js",
7338
7368
  module: "dist/index.js",
@@ -7384,7 +7414,7 @@ var package_default = {
7384
7414
  },
7385
7415
  dependencies: {
7386
7416
  "@lume/kiwi": "^0.4.3",
7387
- "@tscircuit/capacity-autorouter": "^0.0.44",
7417
+ "@tscircuit/capacity-autorouter": "^0.0.49",
7388
7418
  "@tscircuit/checks": "^0.0.30",
7389
7419
  "@tscircuit/circuit-json-util": "^0.0.45",
7390
7420
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.360",
4
+ "version": "0.0.362",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@lume/kiwi": "^0.4.3",
56
- "@tscircuit/capacity-autorouter": "^0.0.44",
56
+ "@tscircuit/capacity-autorouter": "^0.0.49",
57
57
  "@tscircuit/checks": "^0.0.30",
58
58
  "@tscircuit/circuit-json-util": "^0.0.45",
59
59
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",