Skip to content

Commit 090ea21

Browse files
committed
Add TQFP footprint support
1 parent 207c77a commit 090ea21

File tree

8 files changed

+34
-3
lines changed

8 files changed

+34
-3
lines changed

bun.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "@tscircuit/footprinter",
66
"dependencies": {
77
"@tscircuit/mm": "^0.0.8",
8-
"zod": "^3.23.8",
8+
"zod": "^3.25.74",
99
},
1010
"devDependencies": {
1111
"@biomejs/biome": "^1.9.4",
@@ -517,10 +517,14 @@
517517

518518
"yn": ["[email protected]", "", {}, "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q=="],
519519

520-
"zod": ["[email protected].64", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],
520+
"zod": ["[email protected].74", "", {}, "sha512-J8poo92VuhKjNknViHRAIuuN6li/EwFbAC8OedzI8uxpEPGiXHGQu9wemIAioIpqgfB4SySaJhdk0mH5Y4ICBg=="],
521521

522522
"@jridgewell/gen-mapping/@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ=="],
523523

524+
"@tscircuit/footprinter/zod": ["[email protected]", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],
525+
526+
"circuit-json/zod": ["[email protected]", "", {}, "sha512-hbP9FpSZf7pkS7hRVUrOjhwKJNyampPgtXKc3AN6DsWtoHsg2Sb4SQaS4Tcay380zSwd2VPo9G9180emBACp5g=="],
527+
524528
"circuit-to-svg/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw=="],
525529

526530
"color/color-convert": ["[email protected]", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@tscircuit/mm": "^0.0.8",
40-
"zod": "^3.23.8"
40+
"zod": "^3.25.74"
4141
},
4242
"peerDependencies": {
4343
"circuit-json": "*"

src/fn/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export { pushbutton } from "./pushbutton"
2525
export { stampboard } from "./stampboard"
2626
export { stampreceiver } from "./stampreceiver"
2727
export { lqfp } from "./lqfp"
28+
export { tqfp } from "./tqfp"
2829
export { breakoutheaders } from "./breakoutheaders"
2930
export { hc49 } from "./hc49"
3031
export { pad } from "./pad"

src/fn/tqfp.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { AnyCircuitElement } from "circuit-json"
2+
import type { z } from "zod"
3+
import { qfp, qfp_def } from "./qfp"
4+
5+
export const tqfp_def = qfp_def
6+
7+
export const tqfp = (
8+
raw_params: z.input<typeof tqfp_def>,
9+
): { circuitJson: AnyCircuitElement[]; parameters: any } => {
10+
return qfp(raw_params)
11+
}

src/footprinter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export type Footprinter = {
112112
ms013: () => FootprinterParamsBuilder<"w" | "p">
113113
ms012: () => FootprinterParamsBuilder<"w" | "p">
114114
lqfp: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">
115+
tqfp: (num_pins?: number) => FootprinterParamsBuilder<"w" | "h" | "pl" | "pw">
115116
sma: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">
116117
smf: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">
117118
smb: () => FootprinterParamsBuilder<"w" | "h" | "p" | "pl" | "pw">
Lines changed: 1 addition & 0 deletions
Loading

tests/get-footprint-names.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test("getFootprintNamesByType groups footprint names by component type", () => {
2121
expect(normalFootprintNames).toContain("dip")
2222
expect(normalFootprintNames).toContain("soic")
2323
expect(normalFootprintNames).toContain("qfp")
24+
expect(normalFootprintNames).toContain("tqfp")
2425
expect(normalFootprintNames).not.toContain("res")
2526
expect(normalFootprintNames).not.toContain("cap")
2627
expect(normalFootprintNames).not.toContain("diode")

tests/tqfp.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { test, expect } from "bun:test"
2+
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
3+
import { fp } from "../src/footprinter"
4+
5+
test("tqfp64_w10_h10_pl1_pw0.25mm", () => {
6+
const soup = fp.string("tqfp64_w10_h10_pl1_pw0.25mm").circuitJson()
7+
const svgContent = convertCircuitJsonToPcbSvg(soup)
8+
expect(svgContent).toMatchSvgSnapshot(
9+
import.meta.path,
10+
"tqfp64_w10_h10_pl1_pw0.25mm",
11+
)
12+
})

0 commit comments

Comments
 (0)