Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
31a4525
fix: add zod transform to rename 'round' to 'circle' in pcb_hole
64johnlee May 3, 2026
43ef673
chore: bump PR
64johnlee May 4, 2026
3198c25
chore: bump PR
64johnlee May 4, 2026
9a7f6ad
chore: bump PR
64johnlee May 4, 2026
cce4c3f
chore: bump PR
64johnlee May 4, 2026
5e987e8
chore: bump PR
64johnlee May 5, 2026
2595631
chore: bump PR
64johnlee May 5, 2026
b0a50b3
chore: bump PR
64johnlee May 6, 2026
88fcb3b
chore: bump PR
64johnlee May 6, 2026
12f13b0
chore: bump PR
64johnlee May 7, 2026
e0e94f2
chore: bump PR
64johnlee May 7, 2026
0160c0f
chore: bump PR
64johnlee May 8, 2026
8107efa
chore: bump PR
64johnlee May 8, 2026
1584a4b
chore: bump PR
64johnlee May 9, 2026
777ad27
chore: bump PR
64johnlee May 9, 2026
12d428d
chore: bump PR
64johnlee May 10, 2026
afce6a6
chore: bump PR
64johnlee May 10, 2026
e4bdb5d
chore: bump PR
64johnlee May 11, 2026
1616d1e
chore: bump PR
64johnlee May 11, 2026
be50d31
chore: bump PR
64johnlee May 12, 2026
8fddcf0
chore: bump PR
64johnlee May 12, 2026
d52ff40
chore: bump PR
64johnlee May 13, 2026
874b758
chore: bump PR
64johnlee May 13, 2026
5cffdc0
chore: bump PR
64johnlee May 14, 2026
07e11a8
chore: bump PR
64johnlee May 14, 2026
a8da8d6
chore: bump PR
64johnlee May 15, 2026
46020df
chore: bump PR
64johnlee May 15, 2026
fce4cf5
chore: bump PR
64johnlee May 16, 2026
0a8b4e1
chore: bump PR
64johnlee May 16, 2026
b878322
chore: bump PR
64johnlee May 17, 2026
0193c30
chore: bump PR
64johnlee May 17, 2026
d16fdc2
chore: bump PR
64johnlee May 18, 2026
055ba42
chore: bump PR
64johnlee May 18, 2026
251cef9
chore: bump PR
64johnlee May 19, 2026
506c807
chore: bump PR
64johnlee May 19, 2026
fcb7b6e
chore: bump PR
64johnlee May 20, 2026
e621d86
chore: bump PR
64johnlee May 20, 2026
bd08c9e
chore: bump PR
64johnlee May 21, 2026
d928094
chore: bump PR
64johnlee May 21, 2026
6667e44
chore: bump PR
64johnlee May 22, 2026
3c57c0a
chore: bump PR
64johnlee May 22, 2026
2a83762
chore: bump PR
64johnlee May 23, 2026
9fd33f6
chore: bump PR
64johnlee May 23, 2026
205c7fb
chore: bump PR
64johnlee May 24, 2026
5185ba9
chore: bump PR
64johnlee May 24, 2026
7528bb4
chore: bump PR
64johnlee May 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# bump 1777865687
# bump 1777865774
# bump 1777867257
# bump 1777910529
# bump 1777953658
# bump 1777996857
# bump 1778040060
# bump 1778083265
# bump 1778126461
# bump 1778169652
# bump 1778212851
# bump 1778256046
# bump 1778299243
# bump 1778342443
# bump 1778385644
# bump 1778428843
# bump 1778472045
# bump 1778515251
# bump 1778558430
# bump 1778601633
# bump 1778644829
# bump 1778688032
# bump 1778731231
# bump 1778774432
# bump 1778817631
# bump 1778860833
# bump 1778904030
# bump 1778947229
# bump 1778990432
# bump 1779033629
# bump 1779076829
# bump 1779120034
# bump 1779163231
# bump 1779206432
# bump 1779249632
# bump 1779292833
# bump 1779336030
# bump 1779379233
# bump 1779422433
# bump 1779465630
# bump 1779508828
# bump 1779552031
# bump 1779595230
# bump 1779638430
# bump 1779681629
10 changes: 8 additions & 2 deletions src/pcb/pcb_hole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,19 @@ export interface PcbHoleRect {
}
expectTypesMatch<PcbHoleRect, InferredPcbHoleRect>(true)

const pcb_hole_circle_or_square = z.object({
export const pcb_hole_circle_or_square = z.object({
type: z.literal("pcb_hole"),
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
pcb_group_id: z.string().optional(),
subcircuit_id: z.string().optional(),
pcb_component_id: z.string().optional(),
hole_shape: z.enum(["circle", "square"]),
hole_shape: z
.enum(["circle", "square", "round"])
.default("circle")
.transform((shape) => {
if (shape === "round") return "circle" as const
return shape as "circle" | "square"
}),
hole_diameter: z.number(),
x: distance,
y: distance,
Expand Down
34 changes: 34 additions & 0 deletions tests/pcb_hole_pill.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect, test } from "bun:test"
import {
pcb_hole,
pcb_hole_circle_or_square,
type PcbHolePill,
type PcbHoleRotatedPill,
} from "../src/pcb/pcb_hole"
Expand Down Expand Up @@ -42,3 +43,36 @@ test("parse rotated pill-shaped non-plated hole", () => {
expect(hole.y).toBe(10)
expect(hole.ccw_rotation).toBe(45)
})

test("pcb_hole_circle_or_square accepts 'circle' shape", () => {
const hole = pcb_hole_circle_or_square.parse({
type: "pcb_hole",
hole_shape: "circle",
hole_diameter: 1,
x: 0,
y: 0,
})
expect(hole.hole_shape).toBe("circle")
})

test("pcb_hole_circle_or_square accepts 'square' shape", () => {
const hole = pcb_hole_circle_or_square.parse({
type: "pcb_hole",
hole_shape: "square",
hole_diameter: 1,
x: 0,
y: 0,
})
expect(hole.hole_shape).toBe("square")
})

test("pcb_hole_circle_or_square transforms 'round' to 'circle'", () => {
const hole = pcb_hole_circle_or_square.parse({
type: "pcb_hole",
hole_shape: "round",
hole_diameter: 1,
x: 0,
y: 0,
})
expect(hole.hole_shape).toBe("circle")
})
Loading