Skip to content

feat: add noSolderPaste to all SMT pad shapes - #938

Merged
seveibar merged 1 commit into
mainfrom
feat/smtpad-no-solder-paste
Oct 14, 2026
Merged

seveibar merged 1 commit into
mainfrom
feat/smtpad-no-solder-paste

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Adds noSolderPaste?: boolean to the TypeScript interfaces and Zod schemas for every <smtpad> shape: rect, rotated rect, circle, pill, rotated pill, and polygon. This lets TSX authors express test/probe pads with exposed copper and no solder paste, including pads inside footprints.

Related to tscircuit/core#4630.

The parser accepts only booleans, preserves explicit true/false, and leaves omitted values undefined. The intended behavior is that true suppresses paste independently of solder mask settings and takes precedence over solderPasteMargin; omission or false preserves existing paste behavior. There are no aliases or migration requirements. Core still needs to consume this prop to suppress pcb_solder_paste generation.

Includes tests for all six shapes, omitted and explicit values, coexistence with mask and margin settings, and invalid inputs. Regenerated all required documentation.

Validation: bun test (680 passed), tsc --noEmit, biome format ., and bun run build passed.

Comment thread tests/smtpad.test.ts
Comment on lines +191 to +218
for (const pad of smtPadShapes) {
test(`${pad.shape} accepts optional noSolderPaste independently of solder mask`, () => {
expect(smtPadProps.parse(pad).noSolderPaste).toBeUndefined()
for (const noSolderPaste of [true, false]) {
for (const coveredWithSolderMask of [true, false]) {
const rawProps: SmtPadProps = {
...pad,
noSolderPaste,
coveredWithSolderMask,
solderPasteMargin: "0.1mm",
}
expect(smtPadProps.parse(rawProps)).toMatchObject({
noSolderPaste,
coveredWithSolderMask,
solderPasteMargin: 0.1,
})
}
}
})

test(`${pad.shape} rejects non-boolean noSolderPaste`, () => {
for (const noSolderPaste of ["true", "false", 0, 1, null]) {
expect(smtPadProps.safeParse({ ...pad, noSolderPaste }).success).toBe(
false,
)
}
})
}

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.

The rule states that a *.test.ts file may have AT MOST one test(...) call; after that the user should split into multiple, numbered files (e.g., smtpad1.test.ts, smtpad2.test.ts). The added for loop over smtPadShapes generates two test(...) calls per shape (6 shapes × 2 = 12 new tests), and the file already contained multiple test(...) calls before line 174. All these tests must be split into separate, numbered test files rather than accumulated in a single smtpad.test.ts.

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

Fix in Graphite


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

@seveibar
seveibar merged commit 2f5238f into main Oct 14, 2026
8 checks passed
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

2 participants