Skip to content

Commit 96c44de

Browse files
Add site (#40)
* Add site * fix warnings * Add external step models upload functionality * fix text
1 parent df619c7 commit 96c44de

File tree

6 files changed

+805
-4
lines changed

6 files changed

+805
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ debug-output
4242

4343
# Snapshot diff files
4444
*.diff.png
45+
.vercel

lib/mesh-generation.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { CircuitJson } from "circuit-json"
2-
import type { Triangle as GLTFTriangle } from "circuit-json-to-gltf"
3-
import { convertCircuitJsonTo3D } from "circuit-json-to-gltf"
42
import type { Ref } from "stepts"
3+
import type { Triangle as GLTFTriangle } from "circuit-json-to-gltf"
54
import type { Repository } from "stepts"
65
import {
76
AdvancedFace,
@@ -315,6 +314,13 @@ export async function generateComponentMeshes(
315314
return e
316315
})
317316

317+
// Dynamically import circuit-json-to-gltf to avoid bundling native dependencies
318+
// Use a variable to prevent the bundler from statically analyzing the import
319+
const gltfModule = "circuit-json-to-gltf"
320+
const { convertCircuitJsonTo3D } = await import(
321+
/* @vite-ignore */ gltfModule
322+
)
323+
318324
// Convert circuit JSON to 3D scene
319325
const scene3d = await convertCircuitJsonTo3D(filteredCircuitJson, {
320326
boardThickness,

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@
99
"test:update-snapshots": "BUN_UPDATE_SNAPSHOTS=1 bun test",
1010
"build": "tsup-node ./lib/index.ts --format esm --dts",
1111
"format": "biome format --write .",
12-
"format:check": "biome format ."
12+
"format:check": "biome format .",
13+
"start": "bun site/index.html",
14+
"build:site": "bun build site/index.html --outdir=site-export"
1315
},
1416
"devDependencies": {
1517
"@biomejs/biome": "^2.3.8",
18+
"@resvg/resvg-js": "^2.6.2",
19+
"@resvg/resvg-wasm": "^2.6.2",
1620
"@types/bun": "latest",
1721
"circuit-json": "^0.0.286",
1822
"looks-same": "^10.0.1",

0 commit comments

Comments
 (0)