Skip to content
Draft
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ interface SchematicPort {
display_pin_label?: string
subcircuit_id?: string
is_connected?: boolean
is_intentionally_not_connected?: boolean
}
```

Expand Down
4 changes: 2 additions & 2 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ts-node": "^10.9.2",
"tsup": "^8.3.0",
"typescript": "^5.7.2",
"zod": "3",
"zod": "^4.0.5",
},
},
},
Expand Down Expand Up @@ -581,7 +581,7 @@

"yocto-queue": ["[email protected]", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],

"zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
"zod": ["zod@4.0.5", "", {}, "sha512-/5UuuRPStvHXu7RS+gmvRf4NXrNxpSllGwDnCBcJZtQsKrviYXm54yDGV2KYNLT5kq0lHGcl7lqWJLgSaG+tgA=="],

"@anthropic-ai/sdk/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-hHTHp+sEz6SxFsp+SA+Tqrua3AbmlAw+Y//aEwdHrdZkYVRWdvWD3y5uPZ0flYOkgskaFWqZ/YGFm3FaFQ0pRw=="],

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ts-node": "^10.9.2",
"tsup": "^8.3.0",
"typescript": "^5.7.2",
"zod": "3"
"zod": "^4.0.5"
},
"description": "Definitions for the tscircuit intermediary JSON format",
"files": [
Expand Down
2 changes: 2 additions & 0 deletions src/schematic/schematic_port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface SchematicPort {
display_pin_label?: string
subcircuit_id?: string
is_connected?: boolean
is_intentionally_not_connected?: boolean
}

export const schematic_port = z
Expand All @@ -33,6 +34,7 @@ export const schematic_port = z
display_pin_label: z.string().optional(),
subcircuit_id: z.string().optional(),
is_connected: z.boolean().optional(),
is_intentionally_not_connected: z.boolean().optional(),
})
.describe("Defines a port on a schematic component")

Expand Down
23 changes: 23 additions & 0 deletions tests/schematic_port.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { test, expect } from "bun:test"
import { schematic_port } from "../src/schematic/schematic_port"

test("schematic_port.is_intentionally_not_connected defaults to undefined", () => {
const port = schematic_port.parse({
type: "schematic_port",
schematic_port_id: "sp1",
source_port_id: "p1",
center: { x: 0, y: 0 },
})
expect(port.is_intentionally_not_connected).toBeUndefined()
})

test("schematic_port.is_intentionally_not_connected can be true", () => {
const port = schematic_port.parse({
type: "schematic_port",
schematic_port_id: "sp2",
source_port_id: "p2",
center: { x: 1, y: 1 },
is_intentionally_not_connected: true,
})
expect(port.is_intentionally_not_connected).toBe(true)
})
Loading