From ad197db873d75629b361fa20eec9b5451aa80fe4 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Mon, 22 Apr 2024 00:33:04 +0200 Subject: [PATCH] feat: make node definitions type safe with zod --- app/src/app.html | 1 + app/src/lib/graph-interface/AddMenu.svelte | 2 +- app/src/lib/graph-interface/graph-manager.ts | 6 +- .../lib/graph-interface/graph/Graph.svelte | 86 +++++++++-- app/src/lib/node-registry-client.ts | 10 +- app/src/lib/node-registry.ts | 9 +- app/src/lib/node-store/DraggableNode.svelte | 4 +- app/src/lib/node-store/NodeStore.svelte | 9 -- app/src/lib/runtime-executor.ts | 14 +- app/src/lib/settings/Settings.svelte | 1 + nodes/max/plantarium/array/src/input.json | 1 + nodes/max/plantarium/box/src/input.json | 1 + nodes/max/plantarium/float/src/input.json | 1 + nodes/max/plantarium/math/src/input.json | 1 + nodes/max/plantarium/output/src/inputs.json | 1 + .../max/plantarium/random/src/definition.json | 1 + nodes/max/plantarium/stem/src/input.json | 1 + nodes/max/plantarium/stem/src/lib.rs | 4 +- nodes/max/plantarium/sum/src/input.json | 1 + nodes/max/plantarium/triangle/src/input.json | 1 + nodes/max/plantarium/triangle/src/lib.rs | 2 +- nodes/max/plantarium/vec3/src/input.json | 1 + packages/macros/src/lib.rs | 8 +- packages/types/src/index.ts | 31 ++-- packages/types/src/inputs.ts | 137 ++++++++++-------- packages/types/src/lib.rs | 6 +- packages/utils/src/tree.rs | 2 +- packages/utils/src/wasm-wrapper.ts | 26 ++-- 28 files changed, 221 insertions(+), 147 deletions(-) diff --git a/app/src/app.html b/app/src/app.html index b2cc029..d45afd4 100644 --- a/app/src/app.html +++ b/app/src/app.html @@ -6,6 +6,7 @@ %sveltekit.head% + Nodes