From 5d26423d18101a5cb94a7969ade10e2fe1d41918 Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 6 Sep 2024 15:46:03 -0700 Subject: [PATCH 1/5] round hole fix --- .../getObstaclesFromCircuitJson.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts index f4d95c2..41564ba 100644 --- a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts +++ b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts @@ -55,8 +55,7 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => { connectedTo: [], }) } - } - else if (element.type === "pcb_hole") { + } else if (element.type === "pcb_hole") { if (element.hole_shape === "oval") { obstacles.push({ // @ts-ignore @@ -80,6 +79,17 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => { height: element.hole_diameter, connectedTo: [], }) + } else if (element.hole_shape === "round") { + obstacles.push({ + type: "rect", + center: { + x: element.x, + y: element.y, + }, + width: element.hole_diameter, + height: element.hole_diameter, + connectedTo: [], + }) } } else if (element.type === "pcb_plated_hole") { if (element.shape === "circle") { @@ -108,7 +118,10 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => { }) } } else if (element.type === "pcb_trace") { - const traceObstacles = getObstaclesFromRoute(element.route, element.source_trace_id!) + const traceObstacles = getObstaclesFromRoute( + element.route, + element.source_trace_id!, + ) obstacles.push(...traceObstacles) } } From 5dfe46c11bfa14d43be3212155c3cc640718115e Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 6 Sep 2024 15:47:40 -0700 Subject: [PATCH 2/5] add formatcheck --- .github/workflows/formatcheck.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/formatcheck.yml diff --git a/.github/workflows/formatcheck.yml b/.github/workflows/formatcheck.yml new file mode 100644 index 0000000..bb1bcf7 --- /dev/null +++ b/.github/workflows/formatcheck.yml @@ -0,0 +1,26 @@ +# Created using @tscircuit/plop (npm install -g @tscircuit/plop) +name: Format Check + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + format-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: "22" + + - name: Install dependencies + run: npm ci + + - name: Run format check + run: npm run format:check From 6875a149da276c0840a7914e829358557cffe988 Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 6 Sep 2024 15:49:04 -0700 Subject: [PATCH 3/5] add ignore files to format --- biome.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/biome.json b/biome.json index d400c1d..a36ffa9 100644 --- a/biome.json +++ b/biome.json @@ -8,7 +8,15 @@ "indentStyle": "space" }, "files": { - "ignore": ["cosmos-export", "dist", "package.json"] + "ignore": [ + "cosmos-export", + "dist", + "package.json", + "static-server", + "frontend-dist", + ".vercel", + ".vscode" + ] }, "javascript": { "formatter": { From 77c7978b1c2b5135331d5953cd01b0651a50aa4a Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 6 Sep 2024 15:51:40 -0700 Subject: [PATCH 4/5] switch to bun formatcheck --- .../workflows/{formatcheck.yml => bun-formatcheck.yml} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{formatcheck.yml => bun-formatcheck.yml} (69%) diff --git a/.github/workflows/formatcheck.yml b/.github/workflows/bun-formatcheck.yml similarity index 69% rename from .github/workflows/formatcheck.yml rename to .github/workflows/bun-formatcheck.yml index bb1bcf7..2d36363 100644 --- a/.github/workflows/formatcheck.yml +++ b/.github/workflows/bun-formatcheck.yml @@ -14,13 +14,13 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 + - name: Setup bun + uses: oven-sh/setup-bun@v1 with: - node-version: "22" + bun-version: latest - name: Install dependencies - run: npm ci + run: bun install - name: Run format check - run: npm run format:check + run: bun run format:check From ca36e08175d3a64913aa4b1b943c45277697642c Mon Sep 17 00:00:00 2001 From: seveibar Date: Fri, 6 Sep 2024 15:52:54 -0700 Subject: [PATCH 5/5] add format check command --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 3504954..12e9b44 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build:cli": "tsup ./module/cli.ts --dts --sourcemap --out-dir ./dist", "build-and-serve": "npm run build && bun --hot module/cli.ts server start", "format": "biome format --write .", + "format:check": "biome format .", "build:static": "bun run build && bun scripts/build-static.ts", "build:infgrid-ijump-astar": "tsup-node ./algos/infinite-grid-ijump-astar/v2/index.ts -d ./algos/infinite-grid-ijump-astar/dist --format esm --dts --sourcemap" },