Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiboSoftwareDev committed Sep 13, 2024
2 parents d5ed42c + 75822b5 commit 1cb905d
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 18 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/bun-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Type Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun i

- name: Run type check
run: bunx tsc --noEmit
27 changes: 27 additions & 0 deletions .github/workflows/bunaider.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Bunaider Auto-Fix
on:
issues:
types: [labeled]

jobs:
auto-fix:
if: github.event.label.name == 'aider' || github.event.label.name == 'bunaider'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install bunaider
run: bun install -g bunaider

- run: bunaider init

- name: Run bunaider fix
env:
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.TSCIRCUIT_BOT_ANTHROPIC_API_KEY }}
AIDER_SONNET: 1
run: bunaider fix ${{ github.event.issue.number }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tscircuit/soup",
"version": "0.0.59",
"version": "0.0.68",
"description": "Definitions for the tscircuit intermediary JSON format",
"main": "dist/index.js",
"files": [
Expand Down
1 change: 1 addition & 0 deletions src/any_soup_element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const any_soup_element = z.union([
pcb.pcb_component,
pcb.pcb_hole,
pcb.pcb_plated_hole,
pcb.pcb_keepout,
pcb.pcb_port,
pcb.pcb_text,
pcb.pcb_trace,
Expand Down
2 changes: 2 additions & 0 deletions src/pcb/pcb_hole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { distance } from "../units"

export const pcb_hole = z
.object({
pcb_hole_id: z.string(),
type: z.literal("pcb_hole"),
hole_shape: z.enum(["round", "square"]).default("round"),
hole_diameter: z.number(),
Expand All @@ -11,6 +12,7 @@ export const pcb_hole = z
})
.or(
z.object({
pcb_hole_id: z.string(),
type: z.literal("pcb_hole"),
hole_shape: z.literal("oval"),
hole_width: z.number(),
Expand Down
32 changes: 15 additions & 17 deletions src/pcb/pcb_keepout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@ import { distance } from "../units"
export const pcb_keepout = z
.object({
type: z.literal("pcb_keepout"),
shape: z.literal("rect"),
center: point,
width: distance,
height: distance,
pcb_keepout_id: z.string(),
layer: z.array(z.string()).optional(), // Specify layers where the keepout applies
layers: z.array(z.string()), // Specify layers where the keepout applies
description: z.string().optional(), // Optional description of the keepout
})
.and(
z
.object({
shape: z.literal("rect"),
x: distance,
y: distance,
width: distance,
height: distance,
})
.or(
z.object({
shape: z.literal("circle"),
center: point,
radius: distance,
}),
),
.or(
z.object({
type: z.literal("pcb_keepout"),
shape: z.literal("circle"),
center: point,
radius: distance,
pcb_keepout_id: z.string(),
layers: z.array(z.string()), // Specify layers where the keepout applies
description: z.string().optional(), // Optional description of the keepout
}),
)

export type PCBKeepoutInput = z.input<typeof pcb_keepout>
Expand Down
2 changes: 2 additions & 0 deletions src/pcb/pcb_plated_hole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const pcb_plated_hole = z
port_hints: z.array(z.string()).optional(),
pcb_component_id: z.string().optional(),
pcb_port_id: z.string().optional(),
pcb_plated_hole_id: z.string(),
})
.or(
z.object({
Expand All @@ -29,6 +30,7 @@ export const pcb_plated_hole = z
port_hints: z.array(z.string()).optional(),
pcb_component_id: z.string().optional(),
pcb_port_id: z.string().optional(),
pcb_plated_hole_id: z.string(),
}),
)
.describe("Defines a plated hole on the PCB")
Expand Down

0 comments on commit 1cb905d

Please sign in to comment.