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.
- package/.github/workflows/bun-formatcheck.yml +26 -0
- package/.github/workflows/bun-pver-release.yml +28 -0
- package/.github/workflows/bun-test.yml +28 -0
- package/.github/workflows/bun-typecheck.yml +26 -0
- package/.github/workflows/dependency-check.yml +31 -0
- package/README.md +2 -0
- package/biome.json +53 -0
- package/bun.lock +469 -0
- package/bunfig.toml +2 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +71 -0
- package/lib/getDefaultCameraForPcbBoard.ts +17 -0
- package/lib/index.ts +71 -0
- package/lib/types.ts +0 -0
- package/package.json +23 -0
- package/tests/__snapshots__/svg.snap.svg +3 -0
- package/tests/__snapshots__/usb-c-flashlight.snap.svg +40 -0
- package/tests/assets/usb-c-flashlight.json +2881 -0
- package/tests/fixtures/preload.ts +1 -0
- package/tests/svg.test.ts +11 -0
- package/tests/usb-c-flashlight.test.ts +8 -0
- package/tsconfig.json +33 -0
|
@@ -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
|
+
}
|