circuit-to-canvas 0.0.12 → 0.0.13

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.
Files changed (40) hide show
  1. package/package.json +2 -2
  2. package/tests/elements/__snapshots__/fabrication-note-text-descenders.snap.png +0 -0
  3. package/tests/elements/__snapshots__/pcb-copper-text-knockout.snap.png +0 -0
  4. package/tests/elements/__snapshots__/pcb-fabrication-note-rect-dashed.snap.png +0 -0
  5. package/tests/elements/__snapshots__/pcb-note-rect-dashed-stroke.snap.png +0 -0
  6. package/tests/elements/__snapshots__/pcb-silkscreen.snap.png +0 -0
  7. package/tests/elements/__snapshots__/silkscreen-text-bottom.snap.png +0 -0
  8. package/tests/elements/pcb-board.test.ts +1 -1
  9. package/tests/elements/pcb-copper-pour.test.ts +1 -1
  10. package/tests/elements/pcb-copper-text.test.ts +1 -1
  11. package/tests/elements/pcb-cutout.test.ts +1 -1
  12. package/tests/elements/pcb-fabrication-note-path-custom-color.test.ts +1 -1
  13. package/tests/elements/pcb-fabrication-note-path-thick-stroke.test.ts +1 -1
  14. package/tests/elements/pcb-fabrication-note-path.test.ts +1 -1
  15. package/tests/elements/pcb-fabrication-note-rect-all-features.test.ts +1 -1
  16. package/tests/elements/pcb-fabrication-note-rect-corner-radius.test.ts +1 -1
  17. package/tests/elements/pcb-fabrication-note-rect-custom-color.test.ts +1 -1
  18. package/tests/elements/pcb-fabrication-note-rect-dashed.test.ts +1 -1
  19. package/tests/elements/pcb-fabrication-note-rect-default-color.test.ts +1 -1
  20. package/tests/elements/pcb-fabrication-note-text-descenders.test.ts +1 -1
  21. package/tests/elements/pcb-fabrication-note-text-full-charset.test.ts +1 -1
  22. package/tests/elements/pcb-fabrication-note-text-rgba-color.test.ts +1 -1
  23. package/tests/elements/pcb-fabrication-note-text-small.test.ts +1 -1
  24. package/tests/elements/pcb-hole.test.ts +1 -1
  25. package/tests/elements/pcb-note-path.test.ts +1 -1
  26. package/tests/elements/pcb-note-rect-all-features.test.ts +1 -1
  27. package/tests/elements/pcb-note-rect-dashed-stroke.test.ts +1 -1
  28. package/tests/elements/pcb-note-rect-filled-no-stroke.test.ts +1 -1
  29. package/tests/elements/pcb-note-text-anchor-alignment.test.ts +1 -1
  30. package/tests/elements/pcb-note-text-custom-color.test.ts +1 -1
  31. package/tests/elements/pcb-note-text-small.test.ts +1 -1
  32. package/tests/elements/pcb-plated-hole.test.ts +1 -1
  33. package/tests/elements/pcb-silkscreen.test.ts +1 -1
  34. package/tests/elements/pcb-smtpad.test.ts +1 -1
  35. package/tests/elements/pcb-trace.test.ts +1 -1
  36. package/tests/elements/pcb-via.test.ts +1 -1
  37. package/tests/shapes/circle.test.ts +1 -1
  38. package/tests/shapes/oval.test.ts +1 -1
  39. package/tests/shapes/pill.test.ts +1 -1
  40. package/tests/shapes/rect.test.ts +1 -1
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.12",
4
+ "version": "0.0.13",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup-node ./lib/index.ts --format esm --dts",
@@ -10,13 +10,13 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "@biomejs/biome": "^2.3.8",
13
+ "@napi-rs/canvas": "^0.1.84",
13
14
  "@resvg/resvg-js": "^2.6.2",
14
15
  "@tscircuit/alphabet": "^0.0.9",
15
16
  "@tscircuit/circuit-json-util": "^0.0.73",
16
17
  "@tscircuit/math-utils": "^0.0.29",
17
18
  "@types/bun": "latest",
18
19
  "bun-match-svg": "^0.0.14",
19
- "canvas": "^3.2.0",
20
20
  "circuit-json": "^0.0.335",
21
21
  "circuit-json-to-connectivity-map": "^0.0.23",
22
22
  "circuit-to-svg": "^0.0.297",
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbBoard } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbCopperPour } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbCopperText } from "circuit-json"
4
4
  import { scale } from "transformation-matrix"
5
5
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbCutout } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNotePath } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNotePath } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNotePath } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbFabricationNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PCBHole } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNotePath } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteRect } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbNoteText } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbPlatedHole } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type {
4
4
  PcbSilkscreenText,
5
5
  PcbSilkscreenRect,
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PcbSmtPad } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PCBTrace } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import type { PCBVia } from "circuit-json"
4
4
  import { CircuitToCanvasDrawer } from "../../lib/drawer"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import { identity } from "transformation-matrix"
4
4
  import { drawCircle } from "../../lib/drawer/shapes/circle"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import { identity } from "transformation-matrix"
4
4
  import { drawOval } from "../../lib/drawer/shapes/oval"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import { identity } from "transformation-matrix"
4
4
  import { drawPill } from "../../lib/drawer/shapes/pill"
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from "bun:test"
2
- import { createCanvas } from "canvas"
2
+ import { createCanvas } from "@napi-rs/canvas"
3
3
  import { identity } from "transformation-matrix"
4
4
  import { drawRect } from "../../lib/drawer/shapes/rect"
5
5