Skip to content

feat: add source_simple_connector type for standard connectors#366

Open
Lulzx wants to merge 1 commit intotscircuit:mainfrom
Lulzx:feat/connector-standard-usb-c
Open

feat: add source_simple_connector type for standard connectors#366
Lulzx wants to merge 1 commit intotscircuit:mainfrom
Lulzx:feat/connector-standard-usb-c

Conversation

@Lulzx
Copy link
Copy Markdown

@Lulzx Lulzx commented Dec 4, 2025

Summary

Adds a new source component type for connectors with standard support as part of issue tscircuit/tscircuit#748.

Changes

  • Create source_simple_connector schema in src/source/source_simple_connector.ts
  • Add fields:
    • ftype: "simple_connector"
    • connector_standard?: "usb_c" | "m2" - The connector standard
    • pin_count?: number - Number of contacts/pins
    • gender?: "male" | "female" - Connector gender
  • Export from src/source/index.ts
  • Add SourceSimpleConnector to any_source_component union type

Schema

export const source_simple_connector = source_component_base.extend({
  ftype: z.literal("simple_connector"),
  connector_standard: z.enum(["usb_c", "m2"]).optional(),
  pin_count: z.number().optional(),
  gender: z.enum(["male", "female"]).optional(),
})

Related PRs

  • tscircuit/core: Add Connector component
  • tscircuit/props: Add StandardPartResult type
  • tscircuit/parts-engine: Add USB-C connector support

Test plan

  • Schema validates correctly
  • Type exports work
  • Existing code continues to work

Adds a new source component type for connectors with standard support:

- Create source_simple_connector schema with ftype "simple_connector"
- Add connector_standard field (usb_c, m2)
- Add pin_count and gender optional fields
- Export from source index and add to any_source_component union

Part of the connector standard implementation for issue tscircuit/tscircuit#748.
Lulzx added a commit to Lulzx/tscircuit that referenced this pull request Dec 4, 2025
This feature is implemented across multiple repositories:

- tscircuit/core#1715 - Add Connector component with USB-C standard support
- tscircuit/parts-engine#17 - Add USB-C connector support and findStandardPart API
- tscircuit/props#525 - Add StandardPartResult type and findStandardPart to PartsEngine
- tscircuit/circuit-json#366 - Add source_simple_connector type

No changes needed in this repository as it re-exports from @tscircuit/core.
Once the dependent packages are published, the Connector component will be
available automatically.

Usage:
```tsx
<connector standard="usb_c" name="USB1" />
<trace from=".USB1 > .DP" to=".MCU > .USB_DP" />
```

Closes tscircuit#748
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.

1 participant