circuit-json-to-simple-3d 0.0.1

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.
@@ -0,0 +1 @@
1
+ import "bun-match-svg"
@@ -0,0 +1,11 @@
1
+ import { expect, test } from "bun:test"
2
+
3
+ const testSvg = `<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
4
+ <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
5
+ </svg>`
6
+
7
+ test("svg snapshot example", async () => {
8
+ // First run will create the snapshot
9
+ // Subsequent runs will compare against the saved snapshot
10
+ await expect(testSvg).toMatchSvgSnapshot(import.meta.path)
11
+ })
@@ -0,0 +1,8 @@
1
+ import { test, expect } from "bun:test"
2
+ import usbCFlashlightCircuitJson from "./assets/usb-c-flashlight.json"
3
+ import { convertCircuitJsonToSimple3dSvg } from "lib"
4
+
5
+ test("usb-c-flashlight", () => {
6
+ const svg = convertCircuitJsonToSimple3dSvg(usbCFlashlightCircuitJson)
7
+ expect(svg).toMatchSvgSnapshot(import.meta.path)
8
+ })
package/tsconfig.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup & latest features
4
+ "lib": ["ESNext"],
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ "paths": {
12
+ "lib/*": ["./lib/*"],
13
+ "lib": ["./lib"]
14
+ },
15
+
16
+ // Bundler mode
17
+ "moduleResolution": "bundler",
18
+ "allowImportingTsExtensions": true,
19
+ "verbatimModuleSyntax": true,
20
+ "noEmit": true,
21
+
22
+ // Best practices
23
+ "strict": true,
24
+ "skipLibCheck": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "noUncheckedIndexedAccess": true,
27
+
28
+ // Some stricter flags (disabled by default)
29
+ "noUnusedLocals": false,
30
+ "noUnusedParameters": false,
31
+ "noPropertyAccessFromIndexSignature": false
32
+ }
33
+ }