From fa659ab74e09de27bb912e8018eb1270c4d0dab2 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sat, 2 Nov 2024 17:21:04 +0100 Subject: [PATCH] feat: upgrade app to svelte-5 --- app/package.json | 37 +- .../lib/graph-interface/graph/Wrapper.svelte | 6 +- .../performance/SmallPerformanceViewer.svelte | 2 + .../lib/settings/panels/NestedSettings.svelte | 6 +- app/vite.config.ts | 8 +- packages/runtime/package.json | 2 +- .../runtime/src/worker-runtime-executor.ts | 2 +- packages/types/package.json | 2 +- packages/ui/package.json | 38 +- packages/ui/src/lib/elements/Checkbox.svelte | 6 +- packages/utils/package.json | 4 +- pnpm-lock.yaml | 8981 ++++------------- 12 files changed, 1754 insertions(+), 7340 deletions(-) diff --git a/app/package.json b/app/package.json index 65227cb..f6eeaeb 100644 --- a/app/package.json +++ b/app/package.json @@ -14,35 +14,34 @@ "@nodes/runtime": "link:../packages/runtime", "@nodes/ui": "link:../packages/ui", "@nodes/utils": "link:../packages/utils", - "@sveltejs/kit": "^2.5.7", - "@threlte/core": "^7.3.0", - "@threlte/extras": "^8.11.2", - "@types/three": "^0.164.0", - "@unocss/reset": "^0.59.4", + "@sveltejs/kit": "^2.7.4", + "@threlte/core": "8.0.0-next.23", + "@threlte/extras": "9.0.0-next.33", + "@types/three": "^0.169.0", + "@unocss/reset": "^0.63.6", "comlink": "^4.4.1", "file-saver": "^2.0.5", "idb": "^8.0.0", "jsondiffpatch": "^0.6.0", - "three": "^0.164.1" + "three": "^0.170.0" }, "devDependencies": { - "@iconify-json/tabler": "^1.1.110", + "@iconify-json/tabler": "^1.2.7", "@nodes/types": "link:../packages/types", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/vite-plugin-svelte": "^3.1.0", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tsconfig/svelte": "^5.0.4", "@types/file-saver": "^2.0.7", - "@unocss/preset-icons": "^0.59.4", - "svelte": "^4.2.15", - "svelte-check": "^3.7.0", - "three-inspect": "^0.4.5", - "tslib": "^2.6.2", - "typescript": "^5.4.5", - "unocss": "^0.59.4", - "vite": "^5.2.10", - "vite-plugin-comlink": "^4.0.3", + "@unocss/preset-icons": "^0.63.6", + "svelte": "^5.1.9", + "svelte-check": "^4.0.5", + "tslib": "^2.8.1", + "typescript": "^5.6.3", + "unocss": "^0.63.6", + "vite": "^5.4.10", + "vite-plugin-comlink": "^5.1.0", "vite-plugin-glsl": "^1.3.0", "vite-plugin-wasm": "^3.3.0", - "vitest": "^1.5.3" + "vitest": "^2.1.4" } } diff --git a/app/src/lib/graph-interface/graph/Wrapper.svelte b/app/src/lib/graph-interface/graph/Wrapper.svelte index 5320df1..e2909e2 100644 --- a/app/src/lib/graph-interface/graph/Wrapper.svelte +++ b/app/src/lib/graph-interface/graph/Wrapper.svelte @@ -38,9 +38,9 @@ updateSettings($settings); } - manager.on("settings", (settings) => { - settingTypes = settings.types; - $settings = settings.values; + manager.on("settings", (_settings) => { + settingTypes = _settings.types; + settings.set(_settings.values); }); manager.on("result", (result) => { diff --git a/app/src/lib/performance/SmallPerformanceViewer.svelte b/app/src/lib/performance/SmallPerformanceViewer.svelte index 347c105..3b9b2d1 100644 --- a/app/src/lib/performance/SmallPerformanceViewer.svelte +++ b/app/src/lib/performance/SmallPerformanceViewer.svelte @@ -24,6 +24,7 @@
+ ($open.runtime = !$open.runtime)}> @@ -61,6 +62,7 @@ +
{$open.runtime ? "-" : "+"} runtime {humanizeDuration(runtime || 1000)}faces {humanizeNumber(faces || 0)}
diff --git a/app/src/lib/settings/panels/NestedSettings.svelte b/app/src/lib/settings/panels/NestedSettings.svelte index 5003f8e..82c8fed 100644 --- a/app/src/lib/settings/panels/NestedSettings.svelte +++ b/app/src/lib/settings/panels/NestedSettings.svelte @@ -6,10 +6,10 @@ type Button = { type: "button"; label?: string; callback: () => void }; - type Input = NodeInput | Button; + type InputType = NodeInput | Button; interface Nested { - [key: string]: (Nested & { __title?: string }) | Input; + [key: string]: (Nested & { __title?: string }) | InputType; } export let id: string; @@ -24,7 +24,7 @@ export let depth = 0; const keys = Object.keys(settings).filter((key) => key !== "__title"); - function isNodeInput(v: Input | Nested): v is Input { + function isNodeInput(v: InputType | Nested): v is InputType { return v && "type" in v; } diff --git a/app/vite.config.ts b/app/vite.config.ts index b75357e..a25c204 100644 --- a/app/vite.config.ts +++ b/app/vite.config.ts @@ -1,9 +1,9 @@ -import { sveltekit } from '@sveltejs/kit/vite' -import { defineConfig } from 'vite' +import { sveltekit } from '@sveltejs/kit/vite'; +import UnoCSS from 'unocss/vite'; +import { defineConfig } from 'vite'; +import comlink from 'vite-plugin-comlink'; import glsl from "vite-plugin-glsl"; import wasm from "vite-plugin-wasm"; -import comlink from 'vite-plugin-comlink'; -import UnoCSS from 'unocss/vite' export default defineConfig({ plugins: [ diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 20e0615..3843a03 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -16,6 +16,6 @@ }, "devDependencies": { "comlink": "^4.4.1", - "vite-plugin-comlink": "^4.0.3" + "vite-plugin-comlink": "^5.1.0" } } diff --git a/packages/runtime/src/worker-runtime-executor.ts b/packages/runtime/src/worker-runtime-executor.ts index 2b273b6..4db21e1 100644 --- a/packages/runtime/src/worker-runtime-executor.ts +++ b/packages/runtime/src/worker-runtime-executor.ts @@ -3,7 +3,7 @@ import type { Graph, RuntimeExecutor } from "@nodes/types"; export class WorkerRuntimeExecutor implements RuntimeExecutor { - private worker = new ComlinkWorker(new URL("./worker-runtime-executor-backend.ts", import.meta.url)); + private worker = new ComlinkWorker(new URL("worker-runtime-executor-backend.ts", import.meta.url)); constructor() { } async execute(graph: Graph, settings: Record) { diff --git a/packages/types/package.json b/packages/types/package.json index 0a4ffaf..a087b21 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -13,6 +13,6 @@ "author": "", "license": "ISC", "dependencies": { - "zod": "^3.23.5" + "zod": "^3.23.8" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index acf0442..1b27411 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -31,35 +31,35 @@ }, "devDependencies": { "@storybook/addon-essentials": "^8.4.1", - "@storybook/addon-svelte-csf": "^5.0.0-next.10", + "@storybook/addon-svelte-csf": "5.0.0-next.10", "@storybook/addon-themes": "^8.4.1", "@storybook/svelte": "^8.4.1", "@storybook/sveltekit": "^8.4.1", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "^2.5.27", - "@sveltejs/package": "^2.3.1", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.7.4", + "@sveltejs/package": "^2.3.7", "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@types/eslint": "^8.56.10", - "@typescript-eslint/eslint-plugin": "^7.7.1", - "@typescript-eslint/parser": "^7.7.1", - "eslint": "^9.1.1", - "eslint-plugin-storybook": "^0.10.1", - "eslint-plugin-svelte": "^2.45.1", - "publint": "^0.2.7", + "@types/eslint": "^9.6.1", + "@typescript-eslint/eslint-plugin": "^8.12.2", + "@typescript-eslint/parser": "^8.12.2", + "eslint": "^9.14.0", + "eslint-plugin-storybook": "^0.10.2", + "eslint-plugin-svelte": "^2.46.0", + "publint": "^0.2.12", "storybook": "^8.4.1", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "tslib": "^2.6.2", - "typescript": "^5.5.0", - "vite": "^5.4.4", - "vitest": "^1.5.2" + "svelte": "^5.1.9", + "svelte-check": "^4.0.5", + "tslib": "^2.8.1", + "typescript": "^5.6.3", + "vite": "^5.4.10", + "vitest": "^2.1.4" }, "svelte": "./dist/index.js", "types": "./dist/index.d.ts", "type": "module", "dependencies": { "@nodes/types": "link:../types", - "@threlte/core": "^7.3.0", - "@threlte/extras": "^8.11.2" + "@threlte/core": "^7.3.1", + "@threlte/extras": "^8.12.0" } } diff --git a/packages/ui/src/lib/elements/Checkbox.svelte b/packages/ui/src/lib/elements/Checkbox.svelte index 1076d41..c54070f 100644 --- a/packages/ui/src/lib/elements/Checkbox.svelte +++ b/packages/ui/src/lib/elements/Checkbox.svelte @@ -1,15 +1,11 @@