circuit-to-canvas 0.0.10 → 0.0.12

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "circuit-to-canvas",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup-node ./lib/index.ts --format esm --dts",
@@ -10,11 +10,17 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "@biomejs/biome": "^2.3.8",
13
+ "@resvg/resvg-js": "^2.6.2",
13
14
  "@tscircuit/alphabet": "^0.0.9",
15
+ "@tscircuit/circuit-json-util": "^0.0.73",
16
+ "@tscircuit/math-utils": "^0.0.29",
14
17
  "@types/bun": "latest",
15
18
  "bun-match-svg": "^0.0.14",
16
19
  "canvas": "^3.2.0",
17
- "circuit-json": "^0.0.327",
20
+ "circuit-json": "^0.0.335",
21
+ "circuit-json-to-connectivity-map": "^0.0.23",
22
+ "circuit-to-svg": "^0.0.297",
23
+ "schematic-symbols": "^0.0.202",
18
24
  "tsup": "^8.5.1"
19
25
  },
20
26
  "peerDependencies": {
@@ -80,6 +80,9 @@ test("draw board with elements", async () => {
80
80
  center: { x: 100, y: 75 },
81
81
  width: 180,
82
82
  height: 130,
83
+ thickness: 1.6,
84
+ num_layers: 2,
85
+ material: "fr4" as const,
83
86
  },
84
87
  {
85
88
  type: "pcb_smtpad" as const,
@@ -142,7 +145,7 @@ test("draw board with elements", async () => {
142
145
  y: 75,
143
146
  outer_diameter: 10,
144
147
  hole_diameter: 5,
145
- layers: ["top", "bottom"],
148
+ layers: ["top", "bottom"] as ("top" | "bottom")[],
146
149
  },
147
150
  ]
148
151
 
@@ -79,6 +79,7 @@ test("draw copper pour with trace", async () => {
79
79
  { x: 90, y: 90 },
80
80
  { x: 10, y: 90 },
81
81
  ],
82
+ covered_with_solder_mask: false,
82
83
  },
83
84
  {
84
85
  type: "pcb_trace" as const,
@@ -107,7 +108,7 @@ test("draw copper pour with trace", async () => {
107
108
  y: 50,
108
109
  outer_diameter: 15,
109
110
  hole_diameter: 8,
110
- layers: ["top", "bottom"],
111
+ layers: ["top", "bottom"] as ("top" | "bottom")[],
111
112
  },
112
113
  ]
113
114
 
@@ -191,26 +191,33 @@ test("draw silkscreen on component", async () => {
191
191
  {
192
192
  type: "pcb_silkscreen_rect" as const,
193
193
  pcb_silkscreen_rect_id: "outline1",
194
+ pcb_component_id: "component1",
194
195
  layer: "top" as const,
195
196
  center: { x: 75, y: 50 },
196
197
  width: 60,
197
198
  height: 30,
199
+ stroke_width: 0.2,
198
200
  },
199
201
  // Pin 1 indicator
200
202
  {
201
203
  type: "pcb_silkscreen_circle" as const,
202
204
  pcb_silkscreen_circle_id: "pin1marker",
205
+ pcb_component_id: "component1",
203
206
  layer: "top" as const,
204
207
  center: { x: 55, y: 40 },
205
208
  radius: 3,
209
+ stroke_width: 0.2,
206
210
  },
207
211
  // Component label
208
212
  {
209
213
  type: "pcb_silkscreen_text" as const,
210
214
  pcb_silkscreen_text_id: "label1",
215
+ pcb_component_id: "component1",
211
216
  layer: "top" as const,
212
217
  text: "IC1",
213
218
  anchor_position: { x: 75, y: 50 },
219
+ anchor_alignment: "center" as const,
220
+ font: "tscircuit2024" as const,
214
221
  font_size: 8,
215
222
  },
216
223
  // SMT pads