Skip to content

Add PDIP footprint as alias for DIP#559

Open
mendarb wants to merge 2 commits intotscircuit:mainfrom
mendarb:feat/add-pdip-footprint
Open

Add PDIP footprint as alias for DIP#559
mendarb wants to merge 2 commits intotscircuit:mainfrom
mendarb:feat/add-pdip-footprint

Conversation

@mendarb
Copy link
Copy Markdown

@mendarb mendarb commented Mar 20, 2026

Summary

  • Adds PDIP (Plastic Dual Inline Package) footprint as an alias for DIP, since PDIP is simply a DIP in a plastic package
  • Implements pdip function in src/fn/pdip.ts that delegates to the existing dip implementation
  • Adds type definition, export, and 4 tests (including equivalence test confirming pdip8 == dip8)

Fixes #371

Test plan

  • pdip8 string parsing produces correct circuit JSON
  • pdip8 output is identical to dip8 output
  • pdip16 renders correctly
  • Builder API (fp().pdip(8).w(7.62)) works correctly
  • All 385 existing tests continue to pass

🤖 Generated with Claude Code

PDIP (Plastic Dual Inline Package) is functionally identical to DIP.
Added pdip as a thin wrapper that delegates to the existing dip
implementation, with type definitions, exports, and tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +1 to +28
import { test, expect } from "bun:test"
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { fp } from "../src/footprinter"
import type { AnyCircuitElement } from "circuit-json"

test("pdip8", () => {
const circuitJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8")
})

test("pdip8 produces same circuit json as dip8", () => {
const pdipJson = fp.string("pdip8").circuitJson() as AnyCircuitElement[]
const dipJson = fp.string("dip8").circuitJson() as AnyCircuitElement[]
expect(pdipJson).toEqual(dipJson)
})

test("pdip16", () => {
const circuitJson = fp.string("pdip16").circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip16")
})

test("pdip8 with builder API", () => {
const circuitJson = fp().pdip(8).w(7.62).circuitJson() as AnyCircuitElement[]
const svgContent = convertCircuitJsonToPcbSvg(circuitJson)
expect(svgContent).toMatchSvgSnapshot(import.meta.path, "pdip8_builder")
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test file violates the rule that a *.test.ts file may have AT MOST one test(...) call. The file contains 4 test() calls on lines 6, 12, 18, and 24. According to the rule, after the first test, the user should split into multiple, numbered files. This file should be split into separate files like pdip1.test.ts, pdip2.test.ts, pdip3.test.ts, and pdip4.test.ts, with each file containing only one test() call.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Address Graphite review: split 4 test() calls into pdip.test.ts,
pdip2.test.ts, pdip3.test.ts, pdip4.test.ts per repo convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement PDIP-8

1 participant