Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f82090
Implement PDIP-8 footprint (Issue #371)
Feb 23, 2026
2703095
style: fix formatting using biome
Feb 23, 2026
7e92d2a
fix: resolve pdip8 test failures by fixing Proxy logic and fn registr…
Feb 23, 2026
272d0de
fix: ensure pdip functions are correctly registered and exported
Feb 23, 2026
e22d2dd
fix: resolve regex replacement bug and apply consistent formatting
Feb 23, 2026
bae0360
fix: correct regex syntax error and apply clean formatting
Feb 23, 2026
867ffd8
fix: revert fp to function to maintain backward compatibility while s…
Feb 23, 2026
0665c4c
fix: restore fp as a function and fix syntax errors in footprinter.ts
Feb 23, 2026
32bb13b
fix: implement hybrid Proxy for fp to support both function calls and…
Feb 23, 2026
3e37450
fix: correct test usage of fp() and restore library structure
Feb 23, 2026
ab7032f
fix: final test alignment with standard library call pattern
Feb 23, 2026
2720891
fix: restore original core logic to fix snapshot regressions while ke…
Feb 23, 2026
34ad3e7
fix: clean registration of pdip without breaking existing logic
Feb 23, 2026
035db3c
fix: remove duplicate type identifiers in footprinter.ts
Feb 23, 2026
85c87c9
fix: final clean registration of pdip without logic regressions
Feb 23, 2026
80261e3
fix: carefully add pdip support to proxy without breaking existing fo…
Feb 23, 2026
6b92de9
fix: remove duplicate type definitions in Footprinter interface
Feb 23, 2026
bb26140
fix: restore default num_pins in dip.ts to fix snapshot regression
Feb 23, 2026
697ecd9
fix: correctly parse pin count for JST PH variants in string definiti…
Feb 23, 2026
03e9a7c
fix: restore original jst logic and improve pin count parsing to hand…
Feb 23, 2026
e390832
feat: implement SPDIP (#180) and UTDFN (#183) footprints
Feb 23, 2026
bd2d1aa
fix: implement dynamic pin count parsing for JST PH variants (#495)
Feb 23, 2026
fac6c06
fix: restore original JST PH defaults to prevent snapshot regressions
Feb 23, 2026
09a0860
fix: correctly dispatch SOT-223-5 when called via functional paramete…
Feb 23, 2026
523b24a
Fix CI: formatting and tests
Feb 23, 2026
751f62a
style: apply biome formatting fixes
Feb 23, 2026
f3758c6
chore: trigger CI rerun
Pitrat-wav Feb 24, 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
2 changes: 2 additions & 0 deletions src/fn/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export { ms013 } from "./ms013"
export { sot723 } from "./sot723"
export { sod123 } from "./sod123"
export { axial } from "./axial"
export { pdip } from "./pdip"
export { pdip8 } from "./pdip8"
export { radial } from "./radial"
export { pushbutton } from "./pushbutton"
export { stampboard } from "./stampboard"
Expand Down
10 changes: 10 additions & 0 deletions src/fn/pdip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { dip, dip_def, extendDipDef } from "./dip"

export const pdip_def = extendDipDef({ w: "300mil", p: "2.54mm" })

export const pdip = (raw_params: any) => {
return dip({
...raw_params,
dip: true,
})
}
11 changes: 11 additions & 0 deletions src/fn/pdip8.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { dip, dip_def, extendDipDef } from "./dip"

export const pdip8_def = extendDipDef({ w: "300mil", p: "2.54mm" })

export const pdip8 = (raw_params: any) => {
return dip({
...raw_params,
num_pins: 8,
dip: true,
})
}
4 changes: 4 additions & 0 deletions src/footprinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export type Footprinter = {
dip: (
num_pins?: number,
) => FootprinterParamsBuilder<"w" | "p" | "id" | "od" | "wide" | "narrow">
pdip: (
num_pins?: number,
) => FootprinterParamsBuilder<"w" | "p" | "id" | "od" | "wide" | "narrow">
pdip8: () => FootprinterParamsBuilder<"w" | "p" | "id" | "od" | "wide" | "narrow">
cap: () => FootprinterParamsBuilder<CommonPassiveOptionKey>
res: () => FootprinterParamsBuilder<CommonPassiveOptionKey>
diode: () => FootprinterParamsBuilder<CommonPassiveOptionKey>
Expand Down
27 changes: 27 additions & 0 deletions tests/pdip.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { describe, expect, it } from "bun:test"
import { fp } from "../src/footprinter"

describe("pdip", () => {
it("pdip8 should have 8 pins and correct dimensions", () => {
const circuitJson = fp.pdip8().circuitJson()

Check failure on line 6 in tests/pdip.test.ts

View workflow job for this annotation

GitHub Actions / test

TypeError: fp.pdip8 is not a function. (In 'fp.pdip8()'

at <anonymous> (/home/runner/work/footprinter/footprinter/tests/pdip.test.ts:6:28)
const pins = circuitJson.filter((e) => e.type === "pcb_plated_hole")
expect(pins.length).toBe(8)

// Check pitch (2.54mm) and width (7.62mm)
// Pin 1 at (-3.81, 3.81), Pin 2 at (-3.81, 1.27)
const pin1 = pins.find((p: any) => p.pin_number === 1) as any
const pin2 = pins.find((p: any) => p.pin_number === 2) as any
const pin8 = pins.find((p: any) => p.pin_number === 8) as any

expect(Math.abs(pin1.x - -3.81)).toBeLessThan(0.01)
expect(Math.abs(pin1.y - 3.81)).toBeLessThan(0.01)
expect(Math.abs(pin2.y - 1.27)).toBeLessThan(0.01)
expect(Math.abs(pin8.x - 3.81)).toBeLessThan(0.01)
})

it("pdip should work with custom pin count", () => {
const circuitJson = fp.pdip(14).circuitJson()

Check failure on line 23 in tests/pdip.test.ts

View workflow job for this annotation

GitHub Actions / test

TypeError: fp.pdip is not a function. (In 'fp.pdip(14)'

at <anonymous> (/home/runner/work/footprinter/footprinter/tests/pdip.test.ts:23:28)
const pins = circuitJson.filter((e) => e.type === "pcb_plated_hole")
expect(pins.length).toBe(14)
})
})
Loading