@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.
- package/dist/index.js +7 -1
- 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
|
|
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 };
|