Skip to content

feat: add ordered child support to SxClass#54

Open
vahapogut wants to merge 1 commit into
tscircuit:mainfrom
vahapogut:codex/add-sxclass-child-order
Open

feat: add ordered child support to SxClass#54
vahapogut wants to merge 1 commit into
tscircuit:mainfrom
vahapogut:codex/add-sxclass-child-order

Conversation

@vahapogut

Copy link
Copy Markdown

Fixes #3

Summary

  • Add SxClass.childPropertyOrder so ordered S-expression classes can declare child property order once.
  • Support ordered arrays and single SxClass child properties in the shared base helper.
  • Refactor Bus to use the ordered child support instead of a manual getChildren implementation.

Verification

  • bun test tests\sexpr\base-classes\sx-class.test.ts tests\sexpr\classes\KicadSch.test.ts
  • bun x tsc --noEmit
  • bun run build
  • bun x biome check lib\sexpr\base-classes\SxClass.ts lib\sexpr\classes\Bus.ts tests\sexpr\base-classes\sx-class.test.ts
  • git diff --check

Note: full bun test ran 83 passing / 2 skipped tests and stopped on the existing missing optional KiCad demo fixture kicad-demos/demos/simulation/rectifier/rectifier.kicad_sch.

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.

Ordered vs Unordered Children SxClass support (unordered just has a getChildren method, ordered must define the type of the children)

1 participant