@tscircuit/eval 0.0.304 → 0.0.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,9 +7,22 @@ export const getPlatformConfig = (): PlatformConfig => ({
7
7
  partsEngine: jlcPartsEngine,
8
8
  footprintLibraryMap: {
9
9
  kicad: async (footprintName: string) => {
10
- const url = `${KICAD_FOOTPRINT_CACHE_URL}/${footprintName}.circuit.json`
11
- const res = await fetch(url)
12
- return { footprintCircuitJson: await res.json() }
10
+ const baseUrl = `${KICAD_FOOTPRINT_CACHE_URL}/${footprintName}`
11
+ const circuitJsonUrl = `${baseUrl}.circuit.json`
12
+ const res = await fetch(circuitJsonUrl)
13
+ const raw = await res.json()
14
+ // Filter pcb_silkscreen_text to only keep entries with text === "REF**"
15
+ // Apply filtering only to elements coming from the kicad_mod_server response
16
+ const filtered = Array.isArray(raw)
17
+ ? raw.filter((el) =>
18
+ el?.type === "pcb_silkscreen_text" ? el?.text === "REF**" : true,
19
+ )
20
+ : raw
21
+ const wrlUrl = `${baseUrl}.wrl`
22
+ return {
23
+ footprintCircuitJson: filtered,
24
+ cadModel: { model_wrl_url: wrlUrl },
25
+ }
13
26
  },
14
27
  },
15
28
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/eval",
3
3
  "main": "dist/lib/index.js",
4
- "version": "0.0.304",
4
+ "version": "0.0.306",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "bun run build:lib && bun run build:webworker && bun run build:blob-url && bun run build:runner && bun run build:worker-wrapper",
@@ -57,7 +57,7 @@
57
57
  "@tscircuit/checks": "^0.0.71",
58
58
  "@tscircuit/circuit-json-flex": "^0.0.3",
59
59
  "@tscircuit/circuit-json-util": "^0.0.67",
60
- "@tscircuit/core": "^0.0.704",
60
+ "@tscircuit/core": "^0.0.706",
61
61
  "@tscircuit/footprinter": "^0.0.236",
62
62
  "@tscircuit/import-snippet": "^0.0.4",
63
63
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
@@ -79,7 +79,7 @@
79
79
  "@types/react-dom": "^19.1.6",
80
80
  "@types/react-reconciler": "^0.28.9",
81
81
  "bpc-graph": "^0.0.57",
82
- "bun-match-svg": "0.0.12",
82
+ "bun-match-svg": "^0.0.13",
83
83
  "calculate-elbow": "^0.0.12",
84
84
  "chokidar-cli": "^3.0.0",
85
85
  "circuit-json": "^0.0.245",
@@ -89,20 +89,20 @@
89
89
  "circuit-to-svg": "^0.0.185",
90
90
  "comlink": "^4.4.2",
91
91
  "concurrently": "^9.1.2",
92
+ "connectivity-map": "^1.0.0",
92
93
  "debug": "^4.3.6",
94
+ "flatbush": "^4.5.0",
93
95
  "graphics-debug": "^0.0.60",
94
96
  "howfat": "^0.3.8",
95
97
  "live-server": "^1.2.2",
96
98
  "looks-same": "^9.0.1",
99
+ "minicssgrid": "^0.0.9",
97
100
  "pkg-pr-new": "^0.0.37",
98
101
  "react": "^19.1.0",
99
102
  "react-dom": "^19.1.0",
100
103
  "schematic-symbols": "^0.0.195",
101
104
  "ts-expect": "^1.3.0",
102
- "tsup": "^8.2.4",
103
- "minicssgrid": "^0.0.9",
104
- "connectivity-map": "^1.0.0",
105
- "flatbush": "^4.5.0"
105
+ "tsup": "^8.2.4"
106
106
  },
107
107
  "peerDependencies": {
108
108
  "typescript": "^5.0.0",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" data-software-used-string="@tscircuit/core@0.0.706"><style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="69.204152249135" y="139.44636678200698" width="661.5916955017301" height="321.10726643598616"/><path class="pcb-board" d="M 69.204152249135 460.55363321799314 L 730.795847750865 460.55363321799314 L 730.795847750865 139.44636678200698 L 69.204152249135 139.44636678200698 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="6.920415224913495"/><path class="pcb-trace" stroke="rgb(200, 52, 52)" fill="none" d="M 503.11418685121106 300.00000000000006 L 296.88581314878894 300.00000000000006" stroke-width="10.380622837370241" stroke-linecap="round" stroke-linejoin="round" shape-rendering="crispEdges" data-layer="top"/><path class="pcb-trace" stroke="rgb(200, 52, 52)" fill="none" d="M 296.88581314878894 300.00000000000006 L 296.88581314878894 300.00000000000006" stroke-width="10.380622837370241" stroke-linecap="round" stroke-linejoin="round" shape-rendering="crispEdges" data-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="484.42906574394465" y="277.8546712802769" width="37.37024221453287" height="44.29065743944637" data-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="555.0173010380622" y="277.8546712802769" width="37.37024221453287" height="44.29065743944637" data-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="207.61245674740485" y="277.8546712802769" width="37.37024221453287" height="44.29065743944637" data-layer="top"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="278.20069204152253" y="277.8546712802769" width="37.37024221453287" height="44.29065743944637" data-layer="top"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 573.7024221453287 250.17301038062288 L 470.5882352941177 250.17301038062288 L 470.5882352941177 349.82698961937723 L 573.7024221453287 349.82698961937723" fill="none" stroke="#f2eda1" stroke-width="6.920415224913495" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_1" data-pcb-silkscreen-path-id="pcb_silkscreen_path_0"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 250.95910034602076 273.7024221453288 L 272.22429065743944 273.7024221453288" fill="none" stroke="#f2eda1" stroke-width="8.304498269896193" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_0" data-pcb-silkscreen-path-id="pcb_silkscreen_path_1"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 250.95910034602076 326.2975778546713 L 272.22429065743944 326.2975778546713" fill="none" stroke="#f2eda1" stroke-width="8.304498269896193" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_0" data-pcb-silkscreen-path-id="pcb_silkscreen_path_2"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="27.68166089965398" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,538.4083044982699,215.5709342560554)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_component_1" stroke="none">C1</text><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="101.73010380622837" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,261.5916955017301,219.03114186851218)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_component_0" stroke="none">R1</text></svg>
@@ -1,5 +1,6 @@
1
1
  import { createCircuitWebWorker } from "lib/index"
2
2
  import { expect, test } from "bun:test"
3
+ import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
3
4
 
4
5
  test("example18-kicad-footprint-server", async () => {
5
6
  const circuitWebWorker = await createCircuitWebWorker({
@@ -30,5 +31,9 @@ test("example18-kicad-footprint-server", async () => {
30
31
  expect(pcb_trace).toBeDefined()
31
32
  expect(pcb_trace.length).toBe(1)
32
33
 
34
+ expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot(
35
+ import.meta.path,
36
+ )
37
+
33
38
  await circuitWebWorker.kill()
34
39
  })
@@ -1,4 +1,5 @@
1
1
  import { afterEach } from "bun:test"
2
+ import "bun-match-svg"
2
3
 
3
4
  // Clean up all workers after each test
4
5
  afterEach(async () => {