@tscircuit/core 0.0.300 → 0.0.301

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 +7 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2028,9 +2028,15 @@ var Port = class extends PrimitiveComponent {
2028
2028
  }
2029
2029
  _getGlobalPcbPositionBeforeLayout() {
2030
2030
  const matchedPcbElm = this.matchedComponents.find((c) => c.isPcbPrimitive);
2031
+ const parentComponent = this.parent;
2032
+ if (parentComponent && !parentComponent.props.footprint) {
2033
+ throw new Error(
2034
+ `${parentComponent.componentName} "${parentComponent.props.name}" does not have a footprint. Add a footprint prop, e.g. <${parentComponent.componentName.toLowerCase()} footprint="..." />`
2035
+ );
2036
+ }
2031
2037
  if (!matchedPcbElm) {
2032
2038
  throw new Error(
2033
- `Port ${this} has no matched pcb component, can't get global pcb position`
2039
+ `Port ${this} has no matching PCB primitives. This often means the footprint's pads lack matching port hints.`
2034
2040
  );
2035
2041
  }
2036
2042
  return matchedPcbElm?._getGlobalPcbPositionBeforeLayout() ?? { x: 0, y: 0 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.300",
4
+ "version": "0.0.301",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",