@tscircuit/core 0.0.460 → 0.0.462

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -486,8 +486,10 @@ var preprocessSelector = (selector) => {
486
486
  );
487
487
  }
488
488
  if (/net\.[0-9]/.test(selector)) {
489
+ const match = selector.match(/net\.([^ >]+)/);
490
+ const netName = match ? match[1] : "";
489
491
  throw new Error(
490
- 'Net names cannot start with a number, try using a prefix like "VBUS1"'
492
+ `Net name "${netName}" cannot start with a number, try using a prefix like "VBUS1"`
491
493
  );
492
494
  }
493
495
  return selector.replace(/ pin/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").replace(
@@ -854,6 +856,9 @@ var PrimitiveComponent2 = class extends Renderable {
854
856
  this.parent?.onChildChanged?.(child);
855
857
  }
856
858
  add(component) {
859
+ if (this.lowercaseComponentName === "board" && component.lowercaseComponentName === "board") {
860
+ throw new Error("Nested boards are not supported");
861
+ }
857
862
  if (!component.onAddToParent) {
858
863
  throw new Error(
859
864
  `Invalid JSX Element: Expected a React component but received "${JSON.stringify(component)}"`
@@ -1618,8 +1623,9 @@ var createNetsFromProps = (component, props) => {
1618
1623
  );
1619
1624
  }
1620
1625
  if (/net\.[0-9]/.test(prop)) {
1626
+ const netName = prop.split("net.")[1];
1621
1627
  throw new Error(
1622
- 'Net names cannot start with a number, try using a prefix like "VBUS1"'
1628
+ `Net name "${netName}" cannot start with a number, try using a prefix like "VBUS1"`
1623
1629
  );
1624
1630
  }
1625
1631
  const subcircuit = component.getSubcircuit();
@@ -9613,7 +9619,7 @@ import { identity as identity4 } from "transformation-matrix";
9613
9619
  var package_default = {
9614
9620
  name: "@tscircuit/core",
9615
9621
  type: "module",
9616
- version: "0.0.459",
9622
+ version: "0.0.461",
9617
9623
  types: "dist/index.d.ts",
9618
9624
  main: "dist/index.js",
9619
9625
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.460",
4
+ "version": "0.0.462",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",