diff --git a/biome.json b/biome.json index ec1121f..a5484be 100644 --- a/biome.json +++ b/biome.json @@ -1,8 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", - "organizeImports": { - "enabled": true - }, + "$schema": "https://biomejs.dev/schemas/2.2.4/schema.json", "formatter": { "enabled": true, "indentStyle": "space" diff --git a/scripts/generate-pcb-component-overview.ts b/scripts/generate-pcb-component-overview.ts index 3d8f8e5..e0ff192 100644 --- a/scripts/generate-pcb-component-overview.ts +++ b/scripts/generate-pcb-component-overview.ts @@ -1,6 +1,6 @@ -import Anthropic from "@anthropic-ai/sdk" import fs from "node:fs" import path from "node:path" +import Anthropic from "@anthropic-ai/sdk" // Read all the files in the src/pcb directory const pcbDir = path.join(__dirname, "../src/pcb") diff --git a/scripts/generate-schematic-component-overview.ts b/scripts/generate-schematic-component-overview.ts index c6743f6..81cf710 100644 --- a/scripts/generate-schematic-component-overview.ts +++ b/scripts/generate-schematic-component-overview.ts @@ -1,6 +1,6 @@ -import Anthropic from "@anthropic-ai/sdk" import fs from "node:fs" import path from "node:path" +import Anthropic from "@anthropic-ai/sdk" // Read all the files in the src/schematic directory const schematicDir = path.join(__dirname, "../src/schematic") diff --git a/scripts/generate-source-component-overview.ts b/scripts/generate-source-component-overview.ts index d592b6a..c0c8fde 100644 --- a/scripts/generate-source-component-overview.ts +++ b/scripts/generate-source-component-overview.ts @@ -1,6 +1,6 @@ -import Anthropic from "@anthropic-ai/sdk" import fs from "node:fs" import path from "node:path" +import Anthropic from "@anthropic-ai/sdk" // Read all the files in the src/source directory const sourceDir = path.join(__dirname, "../src/source") diff --git a/scripts/refactor.ts b/scripts/refactor.ts index 317c155..2ae922b 100644 --- a/scripts/refactor.ts +++ b/scripts/refactor.ts @@ -1,7 +1,7 @@ +import fs from "node:fs" import Anthropic from "@anthropic-ai/sdk" // @ts-ignore import refactorTemplate from "./refactor-template.md" with { type: "text" } -import fs from "node:fs" const anthropic = new Anthropic() diff --git a/src/any_circuit_element.ts b/src/any_circuit_element.ts index cb14631..6c9ec86 100644 --- a/src/any_circuit_element.ts +++ b/src/any_circuit_element.ts @@ -1,9 +1,9 @@ import { z } from "zod" +import * as cad from "./cad" import * as pcb from "./pcb" import * as sch from "./schematic" -import * as src from "./source" -import * as cad from "./cad" import * as sim from "./simulation" +import * as src from "./source" import { expectStringUnionsMatch, expectTypesMatch, diff --git a/src/cad/cad_component.ts b/src/cad/cad_component.ts index 88c7bb6..375c81e 100644 --- a/src/cad/cad_component.ts +++ b/src/cad/cad_component.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point3, type Point3 } from "../common" -import { rotation, length, type Rotation, type Length } from "../units" -import { layer_ref, type LayerRef } from "src/pcb" +import { type LayerRef, layer_ref } from "src/pcb" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point3, point3 } from "../common" +import { type Length, type Rotation, length, rotation } from "../units" export const cad_component = z .object({ diff --git a/src/common/CircuitJsonError.ts b/src/common/CircuitJsonError.ts index e929097..60f6e51 100644 --- a/src/common/CircuitJsonError.ts +++ b/src/common/CircuitJsonError.ts @@ -1,11 +1,11 @@ import type { - PcbTraceError, - PcbPlacementError, - PcbPortNotMatchedError, PcbAutoroutingError, + PcbComponentOutsideBoardError, PcbFootprintOverlapError, PcbMissingFootprintError, - PcbComponentOutsideBoardError, + PcbPlacementError, + PcbPortNotMatchedError, + PcbTraceError, } from "src/pcb" import type { SchematicError } from "src/schematic" diff --git a/src/common/FivePointAnchor.ts b/src/common/FivePointAnchor.ts index 41967e3..4c11b1f 100644 --- a/src/common/FivePointAnchor.ts +++ b/src/common/FivePointAnchor.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export type FivePointAnchor = "center" | "left" | "right" | "top" | "bottom" diff --git a/src/common/NinePointAnchor.ts b/src/common/NinePointAnchor.ts index 9212d67..7e4c3bf 100644 --- a/src/common/NinePointAnchor.ts +++ b/src/common/NinePointAnchor.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export type NinePointAnchor = | "top_left" diff --git a/src/common/point.ts b/src/common/point.ts index 0c3a760..f3f4933 100644 --- a/src/common/point.ts +++ b/src/common/point.ts @@ -1,6 +1,6 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export const point = z.object({ x: distance, diff --git a/src/common/point3.ts b/src/common/point3.ts index 041de48..337691b 100644 --- a/src/common/point3.ts +++ b/src/common/point3.ts @@ -1,6 +1,6 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export const point3 = z.object({ x: distance, diff --git a/src/common/size.ts b/src/common/size.ts index 4727000..9f1f67e 100644 --- a/src/common/size.ts +++ b/src/common/size.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const size = z.object({ width: z.number(), diff --git a/src/pcb/circuit_json_footprint_load_error.ts b/src/pcb/circuit_json_footprint_load_error.ts index 54b0a63..89dcd86 100644 --- a/src/pcb/circuit_json_footprint_load_error.ts +++ b/src/pcb/circuit_json_footprint_load_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const circuit_json_footprint_load_error = z .object({ diff --git a/src/pcb/external_footprint_load_error.ts b/src/pcb/external_footprint_load_error.ts index 81715b5..7d5c7fa 100644 --- a/src/pcb/external_footprint_load_error.ts +++ b/src/pcb/external_footprint_load_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const external_footprint_load_error = z .object({ diff --git a/src/pcb/index.ts b/src/pcb/index.ts index 17b5df2..17b596a 100644 --- a/src/pcb/index.ts +++ b/src/pcb/index.ts @@ -45,41 +45,41 @@ export * from "./pcb_thermal_spoke" export * from "./pcb_copper_pour" export * from "./pcb_component_outside_board_error" +import type { CircuitJsonFootprintLoadError } from "./circuit_json_footprint_load_error" +import type { ExternalFootprintLoadError } from "./external_footprint_load_error" +import type { PcbAutoroutingError } from "./pcb_autorouting_error" +import type { PcbBoard } from "./pcb_board" +import type { PcbBreakoutPoint } from "./pcb_breakout_point" import type { PcbComponent } from "./pcb_component" +import type { PcbComponentOutsideBoardError } from "./pcb_component_outside_board_error" +import type { PcbCopperPour } from "./pcb_copper_pour" +import type { PcbCutout } from "./pcb_cutout" +import type { PcbFootprintOverlapError } from "./pcb_footprint_overlap_error" +import type { PcbGroundPlane } from "./pcb_ground_plane" +import type { PcbGroundPlaneRegion } from "./pcb_ground_plane_region" import type { PcbHole } from "./pcb_hole" +import type { PcbManualEditConflictWarning } from "./pcb_manual_edit_conflict_warning" +import type { PcbMissingFootprintError } from "./pcb_missing_footprint_error" +import type { PcbNet } from "./pcb_net" +import type { PcbPlacementError } from "./pcb_placement_error" import type { PcbPlatedHole } from "./pcb_plated_hole" import type { PcbPort } from "./pcb_port" +import type { PcbPortNotConnectedError } from "./pcb_port_not_connected_error" +import type { PcbPortNotMatchedError } from "./pcb_port_not_matched_error" +import type { PcbSilkscreenCircle } from "./pcb_silkscreen_circle" +import type { PcbSilkscreenLine } from "./pcb_silkscreen_line" +import type { PcbSilkscreenPath } from "./pcb_silkscreen_path" +import type { PcbSilkscreenRect } from "./pcb_silkscreen_rect" +import type { PcbSilkscreenText } from "./pcb_silkscreen_text" import type { PcbSmtPad } from "./pcb_smtpad" import type { PcbSolderPaste } from "./pcb_solder_paste" import type { PcbText } from "./pcb_text" +import type { PcbThermalSpoke } from "./pcb_thermal_spoke" import type { PcbTrace } from "./pcb_trace" import type { PcbTraceError } from "./pcb_trace_error" +import type { PcbTraceHint } from "./pcb_trace_hint" import type { PcbTraceMissingError } from "./pcb_trace_missing_error" -import type { PcbPortNotMatchedError } from "./pcb_port_not_matched_error" -import type { PcbPortNotConnectedError } from "./pcb_port_not_connected_error" import type { PcbVia } from "./pcb_via" -import type { PcbNet } from "./pcb_net" -import type { PcbBoard } from "./pcb_board" -import type { PcbPlacementError } from "./pcb_placement_error" -import type { PcbMissingFootprintError } from "./pcb_missing_footprint_error" -import type { ExternalFootprintLoadError } from "./external_footprint_load_error" -import type { PcbManualEditConflictWarning } from "./pcb_manual_edit_conflict_warning" -import type { PcbTraceHint } from "./pcb_trace_hint" -import type { PcbSilkscreenLine } from "./pcb_silkscreen_line" -import type { PcbSilkscreenPath } from "./pcb_silkscreen_path" -import type { PcbSilkscreenText } from "./pcb_silkscreen_text" -import type { PcbSilkscreenRect } from "./pcb_silkscreen_rect" -import type { PcbSilkscreenCircle } from "./pcb_silkscreen_circle" -import type { PcbAutoroutingError } from "./pcb_autorouting_error" -import type { PcbFootprintOverlapError } from "./pcb_footprint_overlap_error" -import type { PcbCutout } from "./pcb_cutout" -import type { PcbBreakoutPoint } from "./pcb_breakout_point" -import type { PcbGroundPlane } from "./pcb_ground_plane" -import type { PcbGroundPlaneRegion } from "./pcb_ground_plane_region" -import type { PcbThermalSpoke } from "./pcb_thermal_spoke" -import type { PcbCopperPour } from "./pcb_copper_pour" -import type { PcbComponentOutsideBoardError } from "./pcb_component_outside_board_error" -import type { CircuitJsonFootprintLoadError } from "./circuit_json_footprint_load_error" export type PcbCircuitElement = | PcbComponent diff --git a/src/pcb/pcb_autorouting_error.ts b/src/pcb/pcb_autorouting_error.ts index 8fbda47..25f6da7 100644 --- a/src/pcb/pcb_autorouting_error.ts +++ b/src/pcb/pcb_autorouting_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_autorouting_error = z .object({ diff --git a/src/pcb/pcb_board.ts b/src/pcb/pcb_board.ts index ee9012e..aa7f919 100644 --- a/src/pcb/pcb_board.ts +++ b/src/pcb/pcb_board.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_board = z .object({ diff --git a/src/pcb/pcb_breakout_point.ts b/src/pcb/pcb_breakout_point.ts index b3dd2a2..aa583ad 100644 --- a/src/pcb/pcb_breakout_point.ts +++ b/src/pcb/pcb_breakout_point.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { distance, type Distance } from "src/units" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_breakout_point = z .object({ diff --git a/src/pcb/pcb_component.ts b/src/pcb/pcb_component.ts index 32d8400..b482b12 100644 --- a/src/pcb/pcb_component.ts +++ b/src/pcb/pcb_component.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { rotation, length, type Rotation, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Length, type Rotation, length, rotation } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_component = z .object({ diff --git a/src/pcb/pcb_component_outside_board_error.ts b/src/pcb/pcb_component_outside_board_error.ts index 9cc115c..7590f6a 100644 --- a/src/pcb/pcb_component_outside_board_error.ts +++ b/src/pcb/pcb_component_outside_board_error.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { point, type Point } from "src/common" +import { type Point, point } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_component_outside_board_error = z .object({ diff --git a/src/pcb/pcb_copper_pour.ts b/src/pcb/pcb_copper_pour.ts index 2de15ee..69422dd 100644 --- a/src/pcb/pcb_copper_pour.ts +++ b/src/pcb/pcb_copper_pour.ts @@ -1,9 +1,9 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { length, type Length, rotation, type Rotation } from "src/units" -import { layer_ref, type LayerRef } from "./properties/layer_ref" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, type Rotation, length, rotation } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" -import { brep_shape, type BRepShape } from "./properties/brep" +import { z } from "zod" +import { type BRepShape, brep_shape } from "./properties/brep" +import { type LayerRef, layer_ref } from "./properties/layer_ref" // Common properties base for all pour shapes (internal) const pcb_copper_pour_base = z.object({ diff --git a/src/pcb/pcb_cutout.ts b/src/pcb/pcb_cutout.ts index 4015ce7..7e6fd85 100644 --- a/src/pcb/pcb_cutout.ts +++ b/src/pcb/pcb_cutout.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { length, type Length, rotation, type Rotation } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, type Rotation, length, rotation } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" // Common properties base for all cutout shapes (internal) const pcb_cutout_base = z.object({ diff --git a/src/pcb/pcb_fabrication_note_path.ts b/src/pcb/pcb_fabrication_note_path.ts index eb79314..2f443f6 100644 --- a/src/pcb/pcb_fabrication_note_path.ts +++ b/src/pcb/pcb_fabrication_note_path.ts @@ -1,13 +1,13 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" +import { type Point, point } from "src/common" import { + type LayerRef, layer_ref, visible_layer, - type LayerRef, } from "src/pcb/properties/layer_ref" -import { point, type Point } from "src/common" -import { length, type Length } from "src/units" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_fabrication_note_path = z .object({ diff --git a/src/pcb/pcb_fabrication_note_text.ts b/src/pcb/pcb_fabrication_note_text.ts index 8e16f4b..db4ec80 100644 --- a/src/pcb/pcb_fabrication_note_text.ts +++ b/src/pcb/pcb_fabrication_note_text.ts @@ -1,13 +1,13 @@ -import { z } from "zod" -import { point, type Point } from "src/common" -import { distance, type Length } from "src/units" +import { type Point, point } from "src/common" +import { getZodPrefixedIdWithDefault } from "src/common/getZodPrefixedIdWithDefault" import { - visible_layer, type LayerRef, type VisibleLayer, + visible_layer, } from "src/pcb/properties/layer_ref" -import { getZodPrefixedIdWithDefault } from "src/common/getZodPrefixedIdWithDefault" +import { type Length, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_fabrication_note_text = z .object({ diff --git a/src/pcb/pcb_footprint_overlap_error.ts b/src/pcb/pcb_footprint_overlap_error.ts index 1de74a2..6ed13bd 100644 --- a/src/pcb/pcb_footprint_overlap_error.ts +++ b/src/pcb/pcb_footprint_overlap_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_footprint_overlap_error = z .object({ diff --git a/src/pcb/pcb_ground_plane.ts b/src/pcb/pcb_ground_plane.ts index f8b00d9..80db83a 100644 --- a/src/pcb/pcb_ground_plane.ts +++ b/src/pcb/pcb_ground_plane.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_ground_plane = z .object({ diff --git a/src/pcb/pcb_ground_plane_region.ts b/src/pcb/pcb_ground_plane_region.ts index f950df5..d906de8 100644 --- a/src/pcb/pcb_ground_plane_region.ts +++ b/src/pcb/pcb_ground_plane_region.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_ground_plane_region = z .object({ diff --git a/src/pcb/pcb_group.ts b/src/pcb/pcb_group.ts index 3c28a0a..3a1f7db 100644 --- a/src/pcb/pcb_group.ts +++ b/src/pcb/pcb_group.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_group = z .object({ diff --git a/src/pcb/pcb_hole.ts b/src/pcb/pcb_hole.ts index c27e098..8cacd76 100644 --- a/src/pcb/pcb_hole.ts +++ b/src/pcb/pcb_hole.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { distance, type Distance } from "src/units" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" const pcb_hole_circle_or_square = z.object({ type: z.literal("pcb_hole"), diff --git a/src/pcb/pcb_keepout.ts b/src/pcb/pcb_keepout.ts index 7e2cc5f..29d2cfb 100644 --- a/src/pcb/pcb_keepout.ts +++ b/src/pcb/pcb_keepout.ts @@ -1,7 +1,7 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" -import { point, type Point } from "../common" +import { type Point, point } from "../common" import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export const pcb_keepout = z .object({ diff --git a/src/pcb/pcb_missing_footprint_error.ts b/src/pcb/pcb_missing_footprint_error.ts index c790e7e..1ab8423 100644 --- a/src/pcb/pcb_missing_footprint_error.ts +++ b/src/pcb/pcb_missing_footprint_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_missing_footprint_error = z .object({ diff --git a/src/pcb/pcb_net.ts b/src/pcb/pcb_net.ts index 0e0ec71..2e74d4d 100644 --- a/src/pcb/pcb_net.ts +++ b/src/pcb/pcb_net.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_net = z .object({ diff --git a/src/pcb/pcb_placement_error.ts b/src/pcb/pcb_placement_error.ts index 3b9fe30..52784a1 100644 --- a/src/pcb/pcb_placement_error.ts +++ b/src/pcb/pcb_placement_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_placement_error = z .object({ diff --git a/src/pcb/pcb_plated_hole.ts b/src/pcb/pcb_plated_hole.ts index 7ccbe1f..e24a67c 100644 --- a/src/pcb/pcb_plated_hole.ts +++ b/src/pcb/pcb_plated_hole.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { distance, type Distance, rotation, type Rotation } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" import { getZodPrefixedIdWithDefault } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, type Rotation, distance, rotation } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" const pcb_plated_hole_circle = z.object({ type: z.literal("pcb_plated_hole"), diff --git a/src/pcb/pcb_port.ts b/src/pcb/pcb_port.ts index 8167989..aaefdd6 100644 --- a/src/pcb/pcb_port.ts +++ b/src/pcb/pcb_port.ts @@ -1,8 +1,8 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { distance, type Distance } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_port = z .object({ diff --git a/src/pcb/pcb_port_not_connected_error.ts b/src/pcb/pcb_port_not_connected_error.ts index 5a3bc05..2a62515 100644 --- a/src/pcb/pcb_port_not_connected_error.ts +++ b/src/pcb/pcb_port_not_connected_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_port_not_connected_error = z .object({ diff --git a/src/pcb/pcb_port_not_matched_error.ts b/src/pcb/pcb_port_not_matched_error.ts index 278b437..bdf6155 100644 --- a/src/pcb/pcb_port_not_matched_error.ts +++ b/src/pcb/pcb_port_not_matched_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_port_not_matched_error = z .object({ diff --git a/src/pcb/pcb_silkscreen_circle.ts b/src/pcb/pcb_silkscreen_circle.ts index d92aa53..388b9cc 100644 --- a/src/pcb/pcb_silkscreen_circle.ts +++ b/src/pcb/pcb_silkscreen_circle.ts @@ -1,13 +1,13 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { - layer_ref, - visible_layer, type LayerRef, type VisibleLayer, + layer_ref, + visible_layer, } from "src/pcb/properties/layer_ref" -import { length, type Length } from "src/units" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_circle = z .object({ diff --git a/src/pcb/pcb_silkscreen_line.ts b/src/pcb/pcb_silkscreen_line.ts index a2f16db..289149b 100644 --- a/src/pcb/pcb_silkscreen_line.ts +++ b/src/pcb/pcb_silkscreen_line.ts @@ -1,13 +1,13 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" +import { getZodPrefixedIdWithDefault } from "src/common" import { - layer_ref, type LayerRef, type VisibleLayer, + layer_ref, visible_layer, } from "src/pcb/properties/layer_ref" -import { getZodPrefixedIdWithDefault } from "src/common" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_line = z .object({ diff --git a/src/pcb/pcb_silkscreen_oval.ts b/src/pcb/pcb_silkscreen_oval.ts index dfbbf32..536b876 100644 --- a/src/pcb/pcb_silkscreen_oval.ts +++ b/src/pcb/pcb_silkscreen_oval.ts @@ -1,13 +1,13 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { - layer_ref, type LayerRef, - visible_layer, type VisibleLayer, + layer_ref, + visible_layer, } from "src/pcb/properties/layer_ref" -import { distance, type Distance } from "src/units" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_oval = z .object({ diff --git a/src/pcb/pcb_silkscreen_path.ts b/src/pcb/pcb_silkscreen_path.ts index 0f93c5e..b66a65e 100644 --- a/src/pcb/pcb_silkscreen_path.ts +++ b/src/pcb/pcb_silkscreen_path.ts @@ -1,11 +1,11 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { - visible_layer, type VisibleLayerRef, + visible_layer, } from "src/pcb/properties/layer_ref" -import { length, type Length } from "src/units" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_path = z .object({ diff --git a/src/pcb/pcb_silkscreen_pill.ts b/src/pcb/pcb_silkscreen_pill.ts index a28a627..6e32761 100644 --- a/src/pcb/pcb_silkscreen_pill.ts +++ b/src/pcb/pcb_silkscreen_pill.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_pill = z .object({ diff --git a/src/pcb/pcb_silkscreen_rect.ts b/src/pcb/pcb_silkscreen_rect.ts index 18fba84..e4f3842 100644 --- a/src/pcb/pcb_silkscreen_rect.ts +++ b/src/pcb/pcb_silkscreen_rect.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_rect = z .object({ diff --git a/src/pcb/pcb_silkscreen_text.ts b/src/pcb/pcb_silkscreen_text.ts index fcdd527..5b56193 100644 --- a/src/pcb/pcb_silkscreen_text.ts +++ b/src/pcb/pcb_silkscreen_text.ts @@ -1,12 +1,12 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { distance, length, type Length } from "src/units" -import { expectTypesMatch } from "src/utils/expect-types-match" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { - ninePointAnchor, type NinePointAnchor, + ninePointAnchor, } from "src/common/NinePointAnchor" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Length, distance, length } from "src/units" +import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_silkscreen_text = z .object({ @@ -33,6 +33,9 @@ export const pcb_silkscreen_text = z right: "0.2mm", }) .optional(), + knockout_corner_radius: length.optional(), + knockout_border_width: length.optional(), + knockout_color: z.string().optional(), ccw_rotation: z.number().optional(), layer: layer_ref, is_mirrored: z.boolean().default(false).optional(), @@ -63,6 +66,9 @@ export interface PcbSilkscreenText { bottom: Length right: Length } + knockout_corner_radius?: Length + knockout_border_width?: Length + knockout_color?: string ccw_rotation?: number layer: LayerRef is_mirrored?: boolean diff --git a/src/pcb/pcb_smtpad.ts b/src/pcb/pcb_smtpad.ts index 0ddf9c0..0f4bb6f 100644 --- a/src/pcb/pcb_smtpad.ts +++ b/src/pcb/pcb_smtpad.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { distance, type Distance, rotation, type Rotation } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { getZodPrefixedIdWithDefault, point, type Point } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, type Rotation, distance, rotation } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" const pcb_smtpad_circle = z.object({ type: z.literal("pcb_smtpad"), diff --git a/src/pcb/pcb_solder_paste.ts b/src/pcb/pcb_solder_paste.ts index da84ed6..0dd4f7b 100644 --- a/src/pcb/pcb_solder_paste.ts +++ b/src/pcb/pcb_solder_paste.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" import { getZodPrefixedIdWithDefault } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" const pcb_solder_paste_circle = z.object({ type: z.literal("pcb_solder_paste"), diff --git a/src/pcb/pcb_text.ts b/src/pcb/pcb_text.ts index 24710bd..c56fdfb 100644 --- a/src/pcb/pcb_text.ts +++ b/src/pcb/pcb_text.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_text = z .object({ diff --git a/src/pcb/pcb_thermal_spoke.ts b/src/pcb/pcb_thermal_spoke.ts index c38e600..9abaf34 100644 --- a/src/pcb/pcb_thermal_spoke.ts +++ b/src/pcb/pcb_thermal_spoke.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" import { getZodPrefixedIdWithDefault } from "src/common" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_thermal_spoke = z .object({ diff --git a/src/pcb/pcb_trace.ts b/src/pcb/pcb_trace.ts index f4ed4f0..7f0f0d3 100644 --- a/src/pcb/pcb_trace.ts +++ b/src/pcb/pcb_trace.ts @@ -1,8 +1,8 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { distance, type Distance } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_trace_route_point_wire = z.object({ route_type: z.literal("wire"), diff --git a/src/pcb/pcb_trace_error.ts b/src/pcb/pcb_trace_error.ts index 356a761..b349718 100644 --- a/src/pcb/pcb_trace_error.ts +++ b/src/pcb/pcb_trace_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_trace_error = z .object({ diff --git a/src/pcb/pcb_trace_hint.ts b/src/pcb/pcb_trace_hint.ts index 166a4f2..8c685bd 100644 --- a/src/pcb/pcb_trace_hint.ts +++ b/src/pcb/pcb_trace_hint.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" -import { route_hint_point, type RouteHintPoint } from "src/pcb" +import { type RouteHintPoint, route_hint_point } from "src/pcb" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" /** * A hint that can be used during generation of a PCB trace. diff --git a/src/pcb/pcb_trace_missing_error.ts b/src/pcb/pcb_trace_missing_error.ts index e0b1aac..c6e92c3 100644 --- a/src/pcb/pcb_trace_missing_error.ts +++ b/src/pcb/pcb_trace_missing_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_trace_missing_error = z .object({ diff --git a/src/pcb/pcb_via.ts b/src/pcb/pcb_via.ts index 685eefb..63a3c0f 100644 --- a/src/pcb/pcb_via.ts +++ b/src/pcb/pcb_via.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" import { getZodPrefixedIdWithDefault } from "src/common" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const pcb_via = z .object({ diff --git a/src/pcb/properties/brep.ts b/src/pcb/properties/brep.ts index 4ff5ac7..2f8eae4 100644 --- a/src/pcb/properties/brep.ts +++ b/src/pcb/properties/brep.ts @@ -1,6 +1,6 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const point_with_bulge = z.object({ x: distance, diff --git a/src/pcb/properties/layer_ref.ts b/src/pcb/properties/layer_ref.ts index 4c8f873..ba83f03 100644 --- a/src/pcb/properties/layer_ref.ts +++ b/src/pcb/properties/layer_ref.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const all_layers = [ "top", diff --git a/src/pcb/properties/pcb_route_hints.ts b/src/pcb/properties/pcb_route_hints.ts index f6922d0..d52d984 100644 --- a/src/pcb/properties/pcb_route_hints.ts +++ b/src/pcb/properties/pcb_route_hints.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { distance } from "src/units" -import { layer_ref, type LayerRef } from "./layer_ref" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type LayerRef, layer_ref } from "./layer_ref" // x: string | number // y: string | number diff --git a/src/pcb/properties/route_hint_point.ts b/src/pcb/properties/route_hint_point.ts index 0bd8ff8..4c59a4d 100644 --- a/src/pcb/properties/route_hint_point.ts +++ b/src/pcb/properties/route_hint_point.ts @@ -1,7 +1,7 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { distance } from "../../units" -import { layer_ref, type LayerRef } from "./layer_ref" -import { expectTypesMatch } from "src/utils/expect-types-match" +import { type LayerRef, layer_ref } from "./layer_ref" export const route_hint_point = z.object({ x: distance, diff --git a/src/pcb/properties/supplier_name.ts b/src/pcb/properties/supplier_name.ts index 58393bc..14b7fed 100644 --- a/src/pcb/properties/supplier_name.ts +++ b/src/pcb/properties/supplier_name.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const supplier_name = z.enum([ "jlcpcb", diff --git a/src/schematic/schematic_arc.ts b/src/schematic/schematic_arc.ts index 696931a..852292f 100644 --- a/src/schematic/schematic_arc.ts +++ b/src/schematic/schematic_arc.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { distance, rotation } from "../units" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" +import { distance, rotation } from "../units" /** Draws a styled arc on the schematic */ export interface SchematicArc { diff --git a/src/schematic/schematic_box.ts b/src/schematic/schematic_box.ts index 269acbd..290ca6c 100644 --- a/src/schematic/schematic_box.ts +++ b/src/schematic/schematic_box.ts @@ -1,6 +1,6 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export interface SchematicBox { type: "schematic_box" diff --git a/src/schematic/schematic_circle.ts b/src/schematic/schematic_circle.ts index 4423632..a8efdaf 100644 --- a/src/schematic/schematic_circle.ts +++ b/src/schematic/schematic_circle.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { distance } from "../units" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" +import { distance } from "../units" /** Draws a styled circle on the schematic */ export interface SchematicCircle { diff --git a/src/schematic/schematic_component.ts b/src/schematic/schematic_component.ts index 16931fa..3c22545 100644 --- a/src/schematic/schematic_component.ts +++ b/src/schematic/schematic_component.ts @@ -1,8 +1,8 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" -import { point, type Point } from "../common/point" -import { size, type Size } from "../common/size" +import { type Point, point } from "../common/point" +import { type Size, size } from "../common/size" import { length } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export const schematic_pin_styles = z.record( z.object({ diff --git a/src/schematic/schematic_debug_object.ts b/src/schematic/schematic_debug_object.ts index b6dc68a..5387cde 100644 --- a/src/schematic/schematic_debug_object.ts +++ b/src/schematic/schematic_debug_object.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { size, type Size } from "../common/size" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" +import { type Size, size } from "../common/size" export const schematic_debug_object_base = z.object({ type: z.literal("schematic_debug_object"), diff --git a/src/schematic/schematic_error.ts b/src/schematic/schematic_error.ts index a7ec63c..efec379 100644 --- a/src/schematic/schematic_error.ts +++ b/src/schematic/schematic_error.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export interface SchematicError { type: "schematic_error" diff --git a/src/schematic/schematic_group.ts b/src/schematic/schematic_group.ts index e9023c6..ef178fe 100644 --- a/src/schematic/schematic_group.ts +++ b/src/schematic/schematic_group.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point, getZodPrefixedIdWithDefault } from "src/common" -import { length, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, length } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const schematic_group = z .object({ diff --git a/src/schematic/schematic_layout_error.ts b/src/schematic/schematic_layout_error.ts index d8ce045..46a2496 100644 --- a/src/schematic/schematic_layout_error.ts +++ b/src/schematic/schematic_layout_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const schematic_layout_error = z .object({ diff --git a/src/schematic/schematic_line.ts b/src/schematic/schematic_line.ts index 0f7c655..60cfd68 100644 --- a/src/schematic/schematic_line.ts +++ b/src/schematic/schematic_line.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { distance } from "../units" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { distance } from "../units" /** Draws a styled line on the schematic */ export interface SchematicLine { diff --git a/src/schematic/schematic_net_label.ts b/src/schematic/schematic_net_label.ts index f0bd4a7..4f6e677 100644 --- a/src/schematic/schematic_net_label.ts +++ b/src/schematic/schematic_net_label.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { expectTypesMatch } from "src/utils/expect-types-match" import { getZodPrefixedIdWithDefault } from "src/common" +import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" export interface SchematicNetLabel { type: "schematic_net_label" diff --git a/src/schematic/schematic_path.ts b/src/schematic/schematic_path.ts index 9207dc5..ce5f787 100644 --- a/src/schematic/schematic_path.ts +++ b/src/schematic/schematic_path.ts @@ -1,6 +1,6 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" export interface SchematicPath { type: "schematic_path" diff --git a/src/schematic/schematic_port.ts b/src/schematic/schematic_port.ts index b165ee6..4777134 100644 --- a/src/schematic/schematic_port.ts +++ b/src/schematic/schematic_port.ts @@ -1,6 +1,6 @@ -import { z } from "zod" -import { point, type Point } from "../common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common" export interface SchematicPort { type: "schematic_port" diff --git a/src/schematic/schematic_rect.ts b/src/schematic/schematic_rect.ts index 02b1c96..f9ce1f5 100644 --- a/src/schematic/schematic_rect.ts +++ b/src/schematic/schematic_rect.ts @@ -1,8 +1,8 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { distance, rotation } from "../units" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" +import { distance, rotation } from "../units" /** Draws a styled rectangle on the schematic */ export interface SchematicRect { diff --git a/src/schematic/schematic_table.ts b/src/schematic/schematic_table.ts index 4e086e5..082000e 100644 --- a/src/schematic/schematic_table.ts +++ b/src/schematic/schematic_table.ts @@ -1,13 +1,13 @@ -import { z } from "zod" import { + type NinePointAnchor, + type Point, getZodPrefixedIdWithDefault, ninePointAnchor, point, - type NinePointAnchor, - type Point, } from "src/common" -import { distance, type Length } from "src/units" +import { type Length, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const schematic_table = z .object({ diff --git a/src/schematic/schematic_table_cell.ts b/src/schematic/schematic_table_cell.ts index 82df147..107fc3e 100644 --- a/src/schematic/schematic_table_cell.ts +++ b/src/schematic/schematic_table_cell.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { getZodPrefixedIdWithDefault, point, type Point } from "src/common" -import { distance, type Length } from "src/units" +import { type Point, getZodPrefixedIdWithDefault, point } from "src/common" +import { type Length, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const schematic_table_cell = z .object({ diff --git a/src/schematic/schematic_text.ts b/src/schematic/schematic_text.ts index f906121..4e58e72 100644 --- a/src/schematic/schematic_text.ts +++ b/src/schematic/schematic_text.ts @@ -1,10 +1,10 @@ -import { z } from "zod" -import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" -import { ninePointAnchor } from "src/common/NinePointAnchor" -import type { NinePointAnchor } from "src/common/NinePointAnchor" import type { FivePointAnchor } from "src/common/FivePointAnchor" import { fivePointAnchor } from "src/common/FivePointAnchor" +import { ninePointAnchor } from "src/common/NinePointAnchor" +import type { NinePointAnchor } from "src/common/NinePointAnchor" +import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { distance } from "../units" export interface SchematicText { type: "schematic_text" diff --git a/src/schematic/schematic_trace.ts b/src/schematic/schematic_trace.ts index 592a391..d7964b5 100644 --- a/src/schematic/schematic_trace.ts +++ b/src/schematic/schematic_trace.ts @@ -1,6 +1,6 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { distance } from "../units" -import { expectTypesMatch } from "src/utils/expect-types-match" export interface SchematicTraceEdge { from: { diff --git a/src/schematic/schematic_voltage_probe.ts b/src/schematic/schematic_voltage_probe.ts index f200235..6bed708 100644 --- a/src/schematic/schematic_voltage_probe.ts +++ b/src/schematic/schematic_voltage_probe.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { point, type Point } from "../common/point" -import { expectTypesMatch } from "src/utils/expect-types-match" import { voltage } from "src/units" +import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { type Point, point } from "../common/point" export interface SchematicVoltageProbe { type: "schematic_voltage_probe" diff --git a/src/simulation/simulation_voltage_source.ts b/src/simulation/simulation_voltage_source.ts index 0c36c10..ae5ba5b 100644 --- a/src/simulation/simulation_voltage_source.ts +++ b/src/simulation/simulation_voltage_source.ts @@ -1,7 +1,7 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { frequency, rotation, voltage } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const wave_shape = z.enum(["sinewave", "square", "triangle", "sawtooth"]) export type WaveShape = z.infer @@ -11,9 +11,9 @@ const percentage = z .transform((val) => { if (typeof val === "string") { if (val.endsWith("%")) { - return parseFloat(val.slice(0, -1)) / 100 + return Number.parseFloat(val.slice(0, -1)) / 100 } - return parseFloat(val) + return Number.parseFloat(val) } return val }) diff --git a/src/source/any_source_component.ts b/src/source/any_source_component.ts index 4a14dae..50cae00 100644 --- a/src/source/any_source_component.ts +++ b/src/source/any_source_component.ts @@ -1,100 +1,100 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" import { - source_simple_resistor, - type SourceSimpleResistor, -} from "./source_simple_resistor" + type SourceFailedToCreateComponentError, + source_failed_to_create_component_error, +} from "./source_failed_to_create_component_error" +import { + type SourceMissingPropertyError, + source_missing_property_error, +} from "./source_missing_property_error" +import { + type SourcePinMissingTraceWarning, + source_pin_missing_trace_warning, +} from "./source_pin_missing_trace_warning" +import { + type SourceProjectMetadata, + source_project_metadata, +} from "./source_project_metadata" +import { + type SourcePropertyIgnoredWarning, + source_property_ignored_warning, +} from "./source_property_ignored_warning" +import { + type SourceSimpleBattery, + source_simple_battery, +} from "./source_simple_battery" import { - source_simple_capacitor, type SourceSimpleCapacitor, + source_simple_capacitor, } from "./source_simple_capacitor" -import { source_simple_fuse, type SourceSimpleFuse } from "./source_simple_fuse" +import { type SourceSimpleChip, source_simple_chip } from "./source_simple_chip" +import { + type SourceSimpleCrystal, + source_simple_crystal, +} from "./source_simple_crystal" import { - source_simple_diode, type SourceSimpleDiode, + source_simple_diode, } from "./source_simple_diode" -import { source_simple_led, type SourceSimpleLed } from "./source_simple_led" +import { type SourceSimpleFuse, source_simple_fuse } from "./source_simple_fuse" import { - source_simple_ground, type SourceSimpleGround, + source_simple_ground, } from "./source_simple_ground" -import { source_simple_chip, type SourceSimpleChip } from "./source_simple_chip" -import { - source_simple_power_source, - type SourceSimplePowerSource, -} from "./source_simple_power_source" -import { - source_simple_battery, - type SourceSimpleBattery, -} from "./source_simple_battery" import { - source_simple_inductor, type SourceSimpleInductor, + source_simple_inductor, } from "./source_simple_inductor" +import { type SourceSimpleLed, source_simple_led } from "./source_simple_led" import { - source_simple_push_button, - type SourceSimplePushButton, -} from "./source_simple_push_button" -import { - source_simple_potentiometer, - type SourceSimplePotentiometer, -} from "./source_simple_potentiometer" -import { - source_simple_crystal, - type SourceSimpleCrystal, -} from "./source_simple_crystal" + type SourceSimpleMosfet, + source_simple_mosfet, +} from "./source_simple_mosfet" import { - source_simple_pin_header, type SourceSimplePinHeader, + source_simple_pin_header, } from "./source_simple_pin_header" import { - source_simple_pinout, type SourceSimplePinout, + source_simple_pinout, } from "./source_simple_pinout" import { - source_simple_resonator, - type SourceSimpleResonator, -} from "./source_simple_resonator" + type SourceSimplePotentiometer, + source_simple_potentiometer, +} from "./source_simple_potentiometer" import { - source_simple_transistor, - type SourceSimpleTransistor, -} from "./source_simple_transistor" + type SourceSimplePowerSource, + source_simple_power_source, +} from "./source_simple_power_source" import { - source_simple_test_point, - type SourceSimpleTestPoint, -} from "./source_simple_test_point" + type SourceSimplePushButton, + source_simple_push_button, +} from "./source_simple_push_button" import { - source_simple_mosfet, - type SourceSimpleMosfet, -} from "./source_simple_mosfet" + type SourceSimpleResistor, + source_simple_resistor, +} from "./source_simple_resistor" +import { + type SourceSimpleResonator, + source_simple_resonator, +} from "./source_simple_resonator" import { - source_simple_switch, type SourceSimpleSwitch, + source_simple_switch, } from "./source_simple_switch" import { - source_project_metadata, - type SourceProjectMetadata, -} from "./source_project_metadata" -import { - source_missing_property_error, - type SourceMissingPropertyError, -} from "./source_missing_property_error" + type SourceSimpleTestPoint, + source_simple_test_point, +} from "./source_simple_test_point" import { - source_failed_to_create_component_error, - type SourceFailedToCreateComponentError, -} from "./source_failed_to_create_component_error" + type SourceSimpleTransistor, + source_simple_transistor, +} from "./source_simple_transistor" import { - source_trace_not_connected_error, type SourceTraceNotConnectedError, + source_trace_not_connected_error, } from "./source_trace_not_connected_error" -import { - source_property_ignored_warning, - type SourcePropertyIgnoredWarning, -} from "./source_property_ignored_warning" -import { - source_pin_missing_trace_warning, - type SourcePinMissingTraceWarning, -} from "./source_pin_missing_trace_warning" export const any_source_component = z.union([ source_simple_resistor, diff --git a/src/source/base/source_component_base.ts b/src/source/base/source_component_base.ts index 892d77d..799fd88 100644 --- a/src/source/base/source_component_base.ts +++ b/src/source/base/source_component_base.ts @@ -1,6 +1,6 @@ import { - supplier_name, type SupplierName, + supplier_name, } from "src/pcb/properties/supplier_name" import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" diff --git a/src/source/source_failed_to_create_component_error.ts b/src/source/source_failed_to_create_component_error.ts index b3d31a6..280e640 100644 --- a/src/source/source_failed_to_create_component_error.ts +++ b/src/source/source_failed_to_create_component_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_failed_to_create_component_error = z .object({ diff --git a/src/source/source_group.ts b/src/source/source_group.ts index 9d3eb51..5fa8440 100644 --- a/src/source/source_group.ts +++ b/src/source/source_group.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_group = z.object({ type: z.literal("source_group"), diff --git a/src/source/source_manually_placed_via.ts b/src/source/source_manually_placed_via.ts index d0696bc..bc591cd 100644 --- a/src/source/source_manually_placed_via.ts +++ b/src/source/source_manually_placed_via.ts @@ -1,7 +1,7 @@ -import { z } from "zod" -import { distance, type Distance } from "src/units" -import { layer_ref, type LayerRef } from "src/pcb/properties/layer_ref" +import { type LayerRef, layer_ref } from "src/pcb/properties/layer_ref" +import { type Distance, distance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_manually_placed_via = z .object({ diff --git a/src/source/source_missing_property_error.ts b/src/source/source_missing_property_error.ts index 098d516..979c2d0 100644 --- a/src/source/source_missing_property_error.ts +++ b/src/source/source_missing_property_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_missing_property_error = z .object({ diff --git a/src/source/source_net.ts b/src/source/source_net.ts index 2c88757..22572b3 100644 --- a/src/source/source_net.ts +++ b/src/source/source_net.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_net = z.object({ type: z.literal("source_net"), diff --git a/src/source/source_pcb_ground_plane.ts b/src/source/source_pcb_ground_plane.ts index 0b633e6..d413cc4 100644 --- a/src/source/source_pcb_ground_plane.ts +++ b/src/source/source_pcb_ground_plane.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_pcb_ground_plane = z .object({ diff --git a/src/source/source_pin_missing_trace_warning.ts b/src/source/source_pin_missing_trace_warning.ts index 7047f7d..9328533 100644 --- a/src/source/source_pin_missing_trace_warning.ts +++ b/src/source/source_pin_missing_trace_warning.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_pin_missing_trace_warning = z .object({ diff --git a/src/source/source_port.ts b/src/source/source_port.ts index 7f7b51e..d3698fc 100644 --- a/src/source/source_port.ts +++ b/src/source/source_port.ts @@ -1,5 +1,5 @@ -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_port = z.object({ type: z.literal("source_port"), diff --git a/src/source/source_property_ignored_warning.ts b/src/source/source_property_ignored_warning.ts index 3454302..14bee2b 100644 --- a/src/source/source_property_ignored_warning.ts +++ b/src/source/source_property_ignored_warning.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_property_ignored_warning = z .object({ diff --git a/src/source/source_simple_battery.ts b/src/source/source_simple_battery.ts index 434c00a..def55db 100644 --- a/src/source/source_simple_battery.ts +++ b/src/source/source_simple_battery.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { battery_capacity } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_battery = source_component_base.extend({ ftype: z.literal("simple_battery"), diff --git a/src/source/source_simple_capacitor.ts b/src/source/source_simple_capacitor.ts index 7074e22..a157b61 100644 --- a/src/source/source_simple_capacitor.ts +++ b/src/source/source_simple_capacitor.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { capacitance, distance, voltage } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_capacitor = source_component_base.extend({ ftype: z.literal("simple_capacitor"), diff --git a/src/source/source_simple_chip.ts b/src/source/source_simple_chip.ts index cb71063..344d84a 100644 --- a/src/source/source_simple_chip.ts +++ b/src/source/source_simple_chip.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_chip = source_component_base.extend({ ftype: z.literal("simple_chip"), diff --git a/src/source/source_simple_crystal.ts b/src/source/source_simple_crystal.ts index d95bb57..1c47b35 100644 --- a/src/source/source_simple_crystal.ts +++ b/src/source/source_simple_crystal.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_crystal = source_component_base.extend({ ftype: z.literal("simple_crystal"), diff --git a/src/source/source_simple_diode.ts b/src/source/source_simple_diode.ts index b535800..969093f 100644 --- a/src/source/source_simple_diode.ts +++ b/src/source/source_simple_diode.ts @@ -1,9 +1,9 @@ import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_diode = source_component_base.extend({ ftype: z.literal("simple_diode"), diff --git a/src/source/source_simple_fuse.ts b/src/source/source_simple_fuse.ts index d2fe7c1..d6b3f61 100644 --- a/src/source/source_simple_fuse.ts +++ b/src/source/source_simple_fuse.ts @@ -1,9 +1,9 @@ +import { expectTypesMatch } from "src/utils/expect-types-match" import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "./base/source_component_base" -import { expectTypesMatch } from "src/utils/expect-types-match" export const source_simple_fuse = source_component_base.extend({ ftype: z.literal("simple_fuse"), diff --git a/src/source/source_simple_ground.ts b/src/source/source_simple_ground.ts index 98d308f..5266f65 100644 --- a/src/source/source_simple_ground.ts +++ b/src/source/source_simple_ground.ts @@ -1,9 +1,9 @@ import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_ground = source_component_base.extend({ ftype: z.literal("simple_ground"), diff --git a/src/source/source_simple_inductor.ts b/src/source/source_simple_inductor.ts index 7a2ac38..f7ec31f 100644 --- a/src/source/source_simple_inductor.ts +++ b/src/source/source_simple_inductor.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { inductance } from "../units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { inductance } from "../units" export const source_simple_inductor = source_component_base.extend({ ftype: z.literal("simple_inductor"), diff --git a/src/source/source_simple_led.ts b/src/source/source_simple_led.ts index 1f01da0..fa63564 100644 --- a/src/source/source_simple_led.ts +++ b/src/source/source_simple_led.ts @@ -1,12 +1,12 @@ import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" import { - source_simple_diode, type SourceSimpleDiode, + source_simple_diode, } from "./source_simple_diode" export const source_simple_led = source_simple_diode.extend({ diff --git a/src/source/source_simple_mosfet.ts b/src/source/source_simple_mosfet.ts index 2caa5d0..c3c24d4 100644 --- a/src/source/source_simple_mosfet.ts +++ b/src/source/source_simple_mosfet.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_mosfet = source_component_base.extend({ ftype: z.literal("simple_mosfet"), diff --git a/src/source/source_simple_pin_header.ts b/src/source/source_simple_pin_header.ts index 94ab833..db0197d 100644 --- a/src/source/source_simple_pin_header.ts +++ b/src/source/source_simple_pin_header.ts @@ -1,9 +1,9 @@ import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { z } from "zod" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_pin_header = source_component_base.extend({ ftype: z.literal("simple_pin_header"), diff --git a/src/source/source_simple_pinout.ts b/src/source/source_simple_pinout.ts index eaeebad..499920c 100644 --- a/src/source/source_simple_pinout.ts +++ b/src/source/source_simple_pinout.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_pinout = source_component_base.extend({ ftype: z.literal("simple_pinout"), diff --git a/src/source/source_simple_potentiometer.ts b/src/source/source_simple_potentiometer.ts index e1dc1cf..f573b6e 100644 --- a/src/source/source_simple_potentiometer.ts +++ b/src/source/source_simple_potentiometer.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { resistance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_potentiometer = source_component_base.extend({ ftype: z.literal("simple_potentiometer"), diff --git a/src/source/source_simple_power_source.ts b/src/source/source_simple_power_source.ts index 461a72e..175954c 100644 --- a/src/source/source_simple_power_source.ts +++ b/src/source/source_simple_power_source.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { voltage } from "../units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" +import { voltage } from "../units" export const source_simple_power_source = source_component_base.extend({ ftype: z.literal("simple_power_source"), diff --git a/src/source/source_simple_push_button.ts b/src/source/source_simple_push_button.ts index 68c8afc..10a2184 100644 --- a/src/source/source_simple_push_button.ts +++ b/src/source/source_simple_push_button.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_push_button = source_component_base.extend({ ftype: z.literal("simple_push_button"), diff --git a/src/source/source_simple_resistor.ts b/src/source/source_simple_resistor.ts index c6a9a02..ad2a3fa 100644 --- a/src/source/source_simple_resistor.ts +++ b/src/source/source_simple_resistor.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { resistance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_resistor = source_component_base.extend({ ftype: z.literal("simple_resistor"), diff --git a/src/source/source_simple_resonator.ts b/src/source/source_simple_resonator.ts index 54792f1..2342801 100644 --- a/src/source/source_simple_resonator.ts +++ b/src/source/source_simple_resonator.ts @@ -1,10 +1,10 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" -import { capacitance, resistance, frequency } from "src/units" +import { capacitance, frequency, resistance } from "src/units" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_resonator = source_component_base.extend({ ftype: z.literal("simple_resonator"), diff --git a/src/source/source_simple_switch.ts b/src/source/source_simple_switch.ts index 884542c..be926e2 100644 --- a/src/source/source_simple_switch.ts +++ b/src/source/source_simple_switch.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_switch = source_component_base.extend({ ftype: z.literal("simple_switch"), diff --git a/src/source/source_simple_test_point.ts b/src/source/source_simple_test_point.ts index 6fbcd8a..ed71189 100644 --- a/src/source/source_simple_test_point.ts +++ b/src/source/source_simple_test_point.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_test_point = source_component_base.extend({ ftype: z.literal("simple_test_point"), diff --git a/src/source/source_simple_transistor.ts b/src/source/source_simple_transistor.ts index bde2b49..6312833 100644 --- a/src/source/source_simple_transistor.ts +++ b/src/source/source_simple_transistor.ts @@ -1,9 +1,9 @@ -import { z } from "zod" import { - source_component_base, type SourceComponentBase, + source_component_base, } from "src/source/base/source_component_base" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_simple_transistor = source_component_base.extend({ ftype: z.literal("simple_transistor"), diff --git a/src/source/source_trace_not_connected_error.ts b/src/source/source_trace_not_connected_error.ts index 15aae0e..408a2f6 100644 --- a/src/source/source_trace_not_connected_error.ts +++ b/src/source/source_trace_not_connected_error.ts @@ -1,6 +1,6 @@ -import { z } from "zod" import { getZodPrefixedIdWithDefault } from "src/common" import { expectTypesMatch } from "src/utils/expect-types-match" +import { z } from "zod" export const source_trace_not_connected_error = z .object({ diff --git a/tests/cad_component_model_unit_to_mm_scale_factor_optional.test.ts b/tests/cad_component_model_unit_to_mm_scale_factor_optional.test.ts index e2708a7..c2480e3 100644 --- a/tests/cad_component_model_unit_to_mm_scale_factor_optional.test.ts +++ b/tests/cad_component_model_unit_to_mm_scale_factor_optional.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { cad_component } from "../src/cad/cad_component" test("cad_component.model_unit_to_mm_scale_factor is optional", () => { diff --git a/tests/capacitance.test.ts b/tests/capacitance.test.ts index 596225b..8543b96 100644 --- a/tests/capacitance.test.ts +++ b/tests/capacitance.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { capacitance } from "src/units" test("Capacitance Precision Tests", () => { diff --git a/tests/circuit_json_footprint_load_error.test.ts b/tests/circuit_json_footprint_load_error.test.ts index fb6b292..6ae649a 100644 --- a/tests/circuit_json_footprint_load_error.test.ts +++ b/tests/circuit_json_footprint_load_error.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { circuit_json_footprint_load_error } from "../src/pcb/circuit_json_footprint_load_error" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { circuit_json_footprint_load_error } from "../src/pcb/circuit_json_footprint_load_error" test("circuit_json_footprint_load_error parses", () => { const error = circuit_json_footprint_load_error.parse({ diff --git a/tests/external_footprint_load_error.test.ts b/tests/external_footprint_load_error.test.ts index 1bca742..fd1ad9f 100644 --- a/tests/external_footprint_load_error.test.ts +++ b/tests/external_footprint_load_error.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { external_footprint_load_error } from "../src/pcb/external_footprint_load_error" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { external_footprint_load_error } from "../src/pcb/external_footprint_load_error" test("external_footprint_load_error parses", () => { const error = external_footprint_load_error.parse({ diff --git a/tests/generate-readme-filter.test.ts b/tests/generate-readme-filter.test.ts index ec4cff1..18b0bd2 100644 --- a/tests/generate-readme-filter.test.ts +++ b/tests/generate-readme-filter.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import fs from "node:fs" import ts from "typescript" diff --git a/tests/pcb_component_outside_board_error.test.ts b/tests/pcb_component_outside_board_error.test.ts index 6ddcc5d..eb2883e 100644 --- a/tests/pcb_component_outside_board_error.test.ts +++ b/tests/pcb_component_outside_board_error.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { pcb_component_outside_board_error } from "src/pcb/pcb_component_outside_board_error" +import { expect, test } from "bun:test" import { any_circuit_element } from "src/any_circuit_element" +import { pcb_component_outside_board_error } from "src/pcb/pcb_component_outside_board_error" test("pcb_component_outside_board_error parses", () => { const errorData = { diff --git a/tests/pcb_copper_pour.test.ts b/tests/pcb_copper_pour.test.ts index c68ab2b..10b0c08 100644 --- a/tests/pcb_copper_pour.test.ts +++ b/tests/pcb_copper_pour.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { pcb_copper_pour } from "../src/pcb/pcb_copper_pour" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { pcb_copper_pour } from "../src/pcb/pcb_copper_pour" test("pcb_copper_pour rect parses", () => { const pour = pcb_copper_pour.parse({ diff --git a/tests/pcb_group_autorouter.test.ts b/tests/pcb_group_autorouter.test.ts index 9cb50d6..4ab103e 100644 --- a/tests/pcb_group_autorouter.test.ts +++ b/tests/pcb_group_autorouter.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { pcb_group } from "../src/pcb/pcb_group" // Test autorouter_configuration optional and shape diff --git a/tests/pcb_pill_hole_with_rect_pad.test.ts b/tests/pcb_pill_hole_with_rect_pad.test.ts index caa7117..811b9af 100644 --- a/tests/pcb_pill_hole_with_rect_pad.test.ts +++ b/tests/pcb_pill_hole_with_rect_pad.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "bun:test" import { - pcb_plated_hole, type PcbHolePillWithRectPad, + pcb_plated_hole, } from "../src/pcb/pcb_plated_hole" test("parse pill hole with rect pad defaults hole offset to 0", () => { diff --git a/tests/pcb_port.test.ts b/tests/pcb_port.test.ts index 680a627..4c5b930 100644 --- a/tests/pcb_port.test.ts +++ b/tests/pcb_port.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { pcb_port } from "../src/pcb/pcb_port" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { pcb_port } from "../src/pcb/pcb_port" test("pcb_port parses with is_board_pinout", () => { const port = pcb_port.parse({ diff --git a/tests/pcb_port_not_connected_error.test.ts b/tests/pcb_port_not_connected_error.test.ts index 6855f9c..90ecc03 100644 --- a/tests/pcb_port_not_connected_error.test.ts +++ b/tests/pcb_port_not_connected_error.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { pcb_port_not_connected_error } from "../src/pcb/pcb_port_not_connected_error" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { pcb_port_not_connected_error } from "../src/pcb/pcb_port_not_connected_error" test("pcb_port_not_connected_error parses", () => { const error = pcb_port_not_connected_error.parse({ diff --git a/tests/pcb_rotated_pill_hole_with_rect_pad.test.ts b/tests/pcb_rotated_pill_hole_with_rect_pad.test.ts index f2a9d6c..8af8052 100644 --- a/tests/pcb_rotated_pill_hole_with_rect_pad.test.ts +++ b/tests/pcb_rotated_pill_hole_with_rect_pad.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "bun:test" import { - pcb_plated_hole, type PcbHoleRotatedPillWithRectPad, + pcb_plated_hole, } from "../src/pcb/pcb_plated_hole" test("parse rotated pill hole with rect pad", () => { diff --git a/tests/pcb_rotated_pill_smtpad.test.ts b/tests/pcb_rotated_pill_smtpad.test.ts index 76d9899..2b59dff 100644 --- a/tests/pcb_rotated_pill_smtpad.test.ts +++ b/tests/pcb_rotated_pill_smtpad.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "bun:test" -import { pcb_smtpad, type PcbSmtPadRotatedPill } from "../src/pcb/pcb_smtpad" +import { type PcbSmtPadRotatedPill, pcb_smtpad } from "../src/pcb/pcb_smtpad" test("parse rotated pill smt pad", () => { const pad = pcb_smtpad.parse({ diff --git a/tests/pcb_smtpad_polygon.test.ts b/tests/pcb_smtpad_polygon.test.ts index b1381b9..1c93ad9 100644 --- a/tests/pcb_smtpad_polygon.test.ts +++ b/tests/pcb_smtpad_polygon.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "bun:test" -import { pcb_smtpad, type PcbSmtPadPolygon } from "../src/pcb/pcb_smtpad" +import { type PcbSmtPadPolygon, pcb_smtpad } from "../src/pcb/pcb_smtpad" test("parse polygon smt pad", () => { const pad = pcb_smtpad.parse({ diff --git a/tests/pcb_smtpad_rect.test.ts b/tests/pcb_smtpad_rect.test.ts index 6a9c21b..be16101 100644 --- a/tests/pcb_smtpad_rect.test.ts +++ b/tests/pcb_smtpad_rect.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "bun:test" -import { pcb_smtpad, type PcbSmtPadRect } from "../src/pcb/pcb_smtpad" +import { type PcbSmtPadRect, pcb_smtpad } from "../src/pcb/pcb_smtpad" test("parse rect smt pad with border radius", () => { const pad = pcb_smtpad.parse({ diff --git a/tests/pcb_trace_missing_error.test.ts b/tests/pcb_trace_missing_error.test.ts index ee07d1c..1534dd6 100644 --- a/tests/pcb_trace_missing_error.test.ts +++ b/tests/pcb_trace_missing_error.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { pcb_trace_missing_error } from "../src/pcb/pcb_trace_missing_error" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { pcb_trace_missing_error } from "../src/pcb/pcb_trace_missing_error" test("pcb_trace_missing_error parses", () => { const error = pcb_trace_missing_error.parse({ diff --git a/tests/schematic_box.test.ts b/tests/schematic_box.test.ts index af9213b..3bad6ae 100644 --- a/tests/schematic_box.test.ts +++ b/tests/schematic_box.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { schematic_box } from "../src/schematic/schematic_box" test("schematic_box.schematic_component_id is optional", () => { diff --git a/tests/schematic_net_label.test.ts b/tests/schematic_net_label.test.ts index 1e21a1e..fbe1296 100644 --- a/tests/schematic_net_label.test.ts +++ b/tests/schematic_net_label.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { schematic_net_label } from "../src/schematic/schematic_net_label" test("schematic_net_label.is_movable defaults to undefined", () => { diff --git a/tests/schematic_shapes.test.ts b/tests/schematic_shapes.test.ts index 8523ae6..09c0d52 100644 --- a/tests/schematic_shapes.test.ts +++ b/tests/schematic_shapes.test.ts @@ -1,8 +1,8 @@ import { expect, test } from "bun:test" +import { schematic_arc } from "../src/schematic/schematic_arc" +import { schematic_circle } from "../src/schematic/schematic_circle" import { schematic_line } from "../src/schematic/schematic_line" import { schematic_rect } from "../src/schematic/schematic_rect" -import { schematic_circle } from "../src/schematic/schematic_circle" -import { schematic_arc } from "../src/schematic/schematic_arc" test("schematic_line defaults stroke width and color", () => { const line = schematic_line.parse({ diff --git a/tests/schematic_table.test.ts b/tests/schematic_table.test.ts index 1e376ba..74af59d 100644 --- a/tests/schematic_table.test.ts +++ b/tests/schematic_table.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { schematic_table } from "../src/schematic/schematic_table" test("schematic_table parse", () => { diff --git a/tests/schematic_table_cell.test.ts b/tests/schematic_table_cell.test.ts index 48773df..7e4d5f4 100644 --- a/tests/schematic_table_cell.test.ts +++ b/tests/schematic_table_cell.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { schematic_table_cell } from "../src/schematic/schematic_table_cell" test("schematic_table_cell parse", () => { diff --git a/tests/schematic_trace_optional_fields.test.ts b/tests/schematic_trace_optional_fields.test.ts index 468a94b..b4444ad 100644 --- a/tests/schematic_trace_optional_fields.test.ts +++ b/tests/schematic_trace_optional_fields.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { schematic_trace } from "../src/schematic/schematic_trace" test("schematic_trace.source_trace_id is optional", () => { diff --git a/tests/simulation_voltage_source.test.ts b/tests/simulation_voltage_source.test.ts index 8b359c5..8f1f01a 100644 --- a/tests/simulation_voltage_source.test.ts +++ b/tests/simulation_voltage_source.test.ts @@ -1,9 +1,9 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { - simulation_voltage_source, type SimulationAcVoltageSource, type SimulationAcVoltageSourceInput, type SimulationDcVoltageSource, + simulation_voltage_source, } from "../src/simulation/simulation_voltage_source" test("simulation_voltage_source DC parse with string voltage", () => { diff --git a/tests/source_manually_placed_via.test.ts b/tests/source_manually_placed_via.test.ts index adabe36..52f51aa 100644 --- a/tests/source_manually_placed_via.test.ts +++ b/tests/source_manually_placed_via.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { source_manually_placed_via } from "../src/source/source_manually_placed_via" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { source_manually_placed_via } from "../src/source/source_manually_placed_via" test("source_manually_placed_via parses", () => { const via = source_manually_placed_via.parse({ diff --git a/tests/source_net.test.ts b/tests/source_net.test.ts index a673507..f2cb05c 100644 --- a/tests/source_net.test.ts +++ b/tests/source_net.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from "bun:test" +import { expect, test } from "bun:test" import { source_net } from "../src/source/source_net" test("source_net.is_positive_voltage_source defaults to undefined", () => { diff --git a/tests/source_pin_missing_trace_warning.test.ts b/tests/source_pin_missing_trace_warning.test.ts index e361fd9..55f18e4 100644 --- a/tests/source_pin_missing_trace_warning.test.ts +++ b/tests/source_pin_missing_trace_warning.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { source_pin_missing_trace_warning } from "../src/source/source_pin_missing_trace_warning" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { source_pin_missing_trace_warning } from "../src/source/source_pin_missing_trace_warning" test("source_pin_missing_trace_warning parses", () => { const warning = source_pin_missing_trace_warning.parse({ diff --git a/tests/source_simple_pinout.test.ts b/tests/source_simple_pinout.test.ts index 6f978ee..892b067 100644 --- a/tests/source_simple_pinout.test.ts +++ b/tests/source_simple_pinout.test.ts @@ -1,6 +1,6 @@ -import { test, expect } from "bun:test" -import { source_simple_pinout } from "../src/source/source_simple_pinout" +import { expect, test } from "bun:test" import { any_circuit_element } from "../src/any_circuit_element" +import { source_simple_pinout } from "../src/source/source_simple_pinout" test("source_simple_pinout parses", () => { const pinout = source_simple_pinout.parse({