Skip to content

cli: implement check placement command using placement analysis package#2198

Open
seveibar wants to merge 1 commit intomainfrom
codex/integrate-@tscircuit/circuit-json-placement-analysis
Open

cli: implement check placement command using placement analysis package#2198
seveibar wants to merge 1 commit intomainfrom
codex/integrate-@tscircuit/circuit-json-placement-analysis

Conversation

@seveibar
Copy link
Contributor

@seveibar seveibar commented Mar 3, 2026

Motivation

  • Add a CLI command to partially build and validate component placements with optional scoping by refdes.
  • Wire in a dedicated placement analysis package to produce human-readable placement diagnostics.

Description

  • Implemented the placement check flow in cli/check/placement/register.ts including checkPlacement, input resolution, prebuilt .circuit.json handling, and integration with analyzeAllPlacements and analyzeComponentPlacement from @tscircuit/circuit-json-placement-analysis.
  • Updated the check placement CLI registration to accept [file] and optional [refdes] arguments and to print errors with a non-zero exit code on failure.
  • Added tests/cli/check/check-placement.test.ts which creates a temporary TSX board file and verifies both scoped (refdes) and global placement analysis paths.
  • Updated package.json and bun.lock to add the new dependency and to pin/bump related packages in the lockfile.

Testing

  • Ran the new unit tests with bun test tests/cli/check/check-placement.test.ts and both tests passed.
  • Executed the new checkPlacement code path locally by invoking the CLI action and verified it returns the analysis string for scoped and unscoped runs.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant