scad-gltf 0.5.0 → 0.5.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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/rust/build.rs +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scad-gltf",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "WASM build of a custom OpenSCAD fork that compiles .scad scripts directly to glTF/GLB with PBR and animation support",
5
5
  "type": "module",
6
6
  "main": "./src/ext/openscad.js",
@@ -29,6 +29,7 @@
29
29
  "bin",
30
30
  "src",
31
31
  "godot",
32
+ "rust",
32
33
  "editor/dist"
33
34
  ],
34
35
  "bin": {
package/rust/build.rs ADDED
@@ -0,0 +1,22 @@
1
+ use std::process::Command;
2
+
3
+ fn main() {
4
+ // Tell Cargo to re-run this script only if the 'scad' directory changes
5
+ println!("cargo::rerun-if-changed=scad");
6
+
7
+ // Ensure cross-platform compatibility for npm global binaries
8
+ let cmd = if cfg!(target_os = "windows") {
9
+ "scad-gltf.cmd"
10
+ } else {
11
+ "scad-gltf"
12
+ };
13
+
14
+ let status = Command::new(cmd)
15
+ .args(["convert", "./scad", "./assets/models", "--cache"])
16
+ .status()
17
+ .expect("Failed to execute scad-gltf. Is scad-gltf installed globally?");
18
+
19
+ if !status.success() {
20
+ panic!("scad-gltf convert failed with status: {}", status);
21
+ }
22
+ }