Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial: cloud autorouter on group #495

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/components/primitive-components/Group/Group.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
groupProps,
subcircuitGroupProps,
type GroupProps,
type SubcircuitGroupProps,
} from "@tscircuit/props"
Expand Down Expand Up @@ -38,7 +39,7 @@ export class Group<Props extends z.ZodType<any, any, any> = typeof groupProps>

get config() {
return {
zodProps: groupProps as unknown as Props,
zodProps: subcircuitGroupProps as unknown as Props,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use z.union here? (Maybe itll mess something up?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it should be conditional on the subscircuit prop

componentName: "Group",
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { test, expect } from "bun:test"
import { getTestFixture } from "../fixtures/get-test-fixture"
import { getTestAutoroutingServer } from "tests/fixtures/get-test-autorouting-server"

test("remote-autorouter-6 cloud autorouting on group", async () => {
if (process.env.CI) return
const { circuit } = getTestFixture()

// Create a basic circuit that needs routing
circuit.add(
<group autorouter={"auto-cloud" as any}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<group autorouter={"auto-cloud" as any}>
<group autorouter={"auto-cloud"} subcircuit />

<chip name="U1" footprint="soic8" pcbX={5} pcbY={0} />
<resistor
name="R1"
pcbX={-5}
pcbY={0}
resistance={100}
footprint="0402"
/>
<trace from=".U1 > .pin1" to=".R1 > .pin1" />
</group>,
)

await circuit.renderUntilSettled()

// Verify routing request was made
expect(circuit.selectAll("trace").length).toBeGreaterThan(0)
expect(circuit).toMatchPcbSnapshot(import.meta.path)
})
Loading