@tscircuit/checks 0.0.189 → 0.0.191

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
@@ -99,7 +99,7 @@ declare function consolidatePcbOverlapErrors<T extends AnyCircuitElement>(circui
99
99
  */
100
100
  declare function checkPcbComponentOverlap(circuitJson: AnyCircuitElement[]): PcbComponentOverlapError[];
101
101
 
102
- /** Returns a warning for every PCB component without a courtyard. */
102
+ /** Returns warnings for PCB components without courtyards, excluding manually placed vias. */
103
103
  declare function checkPcbComponentsMissingCourtyard(circuitJson: AnyCircuitElement[]): PcbComponentMissingCourtyardWarning[];
104
104
 
105
105
  declare const checkPcbTraceLengths: (circuitJson: AnyCircuitElement[]) => PcbTraceTooLongWarning[];
package/dist/index.js CHANGED
@@ -3551,6 +3551,9 @@ var courtyardTypes = /* @__PURE__ */ new Set([
3551
3551
  "pcb_courtyard_rect"
3552
3552
  ]);
3553
3553
  function checkPcbComponentsMissingCourtyard(circuitJson) {
3554
+ const manuallyPlacedViaSourceIds = new Set(
3555
+ circuitJson.filter((element) => element.type === "source_manually_placed_via").map((element) => element.source_manually_placed_via_id)
3556
+ );
3554
3557
  const componentIdsWithCourtyards = new Set(
3555
3558
  circuitJson.filter((element) => courtyardTypes.has(element.type)).flatMap(
3556
3559
  (element) => "pcb_component_id" in element && element.pcb_component_id ? [element.pcb_component_id] : []
@@ -3559,7 +3562,7 @@ function checkPcbComponentsMissingCourtyard(circuitJson) {
3559
3562
  return circuitJson.filter(
3560
3563
  (element) => element.type === "pcb_component"
3561
3564
  ).filter(
3562
- (component) => !componentIdsWithCourtyards.has(component.pcb_component_id)
3565
+ (component) => !componentIdsWithCourtyards.has(component.pcb_component_id) && (!component.source_component_id || !manuallyPlacedViaSourceIds.has(component.source_component_id))
3563
3566
  ).map((component) => {
3564
3567
  const sourceComponent = component.source_component_id ? circuitJson.find(
3565
3568
  (element) => element.type === "source_component" && element.source_component_id === component.source_component_id