Repository navigation
Compose generic adapter cables with independently specified connector ends - #10
Merged
Merged
Conversation
This was referenced Oct 6, 2026
seveibar
marked this pull request as ready for review
October 6, 2026 21:46
This was referenced Oct 6, 2026
Collaborator
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compose independently specified connector ends with
adaptercable_a(CONNECTOR)_b(CONNECTOR). For a BLDC motor's three 3.5 mm male outputs and a board's 4 mm male plugs, useadaptercable_a(bullet3_d3.5mm_gfemale)_b(bullet3_d4mm_gfemale). Female board sockets usegmaleat B.The wrapper uses the same connector parser and composition factory for bullet-to-bullet, bullet-to-JST, and JST SH-to-PH adapters. Each connector retains its native dimensions and contact pitch. Wire insulation fits both ends and explicit contact counts must match. A/B and inner named modifiers are order-independent; reject missing or duplicate ends, malformed parentheses, positional parameters, nested cables, and trailing tokens. Remove the unmerged
da/dbanddiameterA/diameterBAPIs. Existing cable preset strings and common/bullet snapshots are preserved.Export
parseConnectorString,getAdapterCableDefinition, and canonical connector/cable serializers. The object form isgetCableDefinition({ standard: "adaptercable", connectorA, connectorB }), with optional cross-section configuration. Physical interfaces do not imply electrical pin mapping.Validation: parser/composition rejection and round-trip tests, mixed-family cases in both directions, existing preset regressions, local type checking, and inspected actual 3D adapter meshes. Native CI also checks the package entrypoint, gallery, formatting, and previews. Rendering uses published
jscad-electronics@^0.0.210(merged #427), with compact bundles and smooth fanout within the final 20 mm at each connector. The renderer preview dependency has been replaced with the npm release.Consumers: props #910, circuit-json-to-gltf #239, and core #4416.
Render different-pitch bundles compactly through the middle, with smooth fanout confined to 20 mm at each end (shortened on short routes). The separate adapter snapshot is updated and inspected; existing common and bullet catalogs are unchanged and pass CI.