diff --git a/app/src/routes/nodes/[user]/[collection].json/+server.ts b/app/src/routes/nodes/[user]/[collection].json/+server.ts index 7813fa2..cb4cd52 100644 --- a/app/src/routes/nodes/[user]/[collection].json/+server.ts +++ b/app/src/routes/nodes/[user]/[collection].json/+server.ts @@ -8,7 +8,7 @@ export const entries: EntryGenerator = async () => { const users = await registry.getUsers(); return users.map(user => { return user.collections.map(collection => { - return { user: user.id, collection: collection.id } + return { user: user.id, collection: collection.id.split("/")[1] } }) }).flat(2); } diff --git a/app/src/routes/nodes/[user]/[collection]/[node].json/+server.ts b/app/src/routes/nodes/[user]/[collection]/[node].json/+server.ts index e44d547..5161d59 100644 --- a/app/src/routes/nodes/[user]/[collection]/[node].json/+server.ts +++ b/app/src/routes/nodes/[user]/[collection]/[node].json/+server.ts @@ -11,7 +11,7 @@ export const entries: EntryGenerator = async () => { return users.map(user => { return user.collections.map(collection => { return collection.nodes.map(node => { - return { user: user.id, collection: collection.id, node: node.id } + return { user: user.id, collection: collection.id.split("/")[1], node: node.id.split("/")[2] } }); }) }).flat(2); diff --git a/app/src/routes/nodes/[user]/[collection]/[node].wasm/+server.ts b/app/src/routes/nodes/[user]/[collection]/[node].wasm/+server.ts index 372f63c..6acc01f 100644 --- a/app/src/routes/nodes/[user]/[collection]/[node].wasm/+server.ts +++ b/app/src/routes/nodes/[user]/[collection]/[node].wasm/+server.ts @@ -9,7 +9,7 @@ export const entries: EntryGenerator = async () => { return users.map(user => { return user.collections.map(collection => { return collection.nodes.map(node => { - return { user: user.id, collection: collection.id, node: node.id } + return { user: user.id, collection: collection.id.split("/")[1], node: node.id.split("/")[2] } }); }) }).flat(2); diff --git a/app/src/routes/test/+page.svelte b/app/src/routes/test/+page.svelte index 6eeb9ba..9118e2a 100644 --- a/app/src/routes/test/+page.svelte +++ b/app/src/routes/test/+page.svelte @@ -2,9 +2,9 @@ import { decodeFloat, encodeFloat, - decode, - encode, - concat_encoded, + decodeNestedArray, + encodeNestedArray, + concatEncodedArrays, } from "@nodes/utils"; console.clear(); @@ -28,14 +28,14 @@ } if (false) { - const input_a = encode([1, 2, 3]); + const input_a = encodeNestedArray([1, 2, 3]); const input_b = 2; const input_c = 89; - const input_d = encode([4, 5, 6]); + const input_d = encodeNestedArray([4, 5, 6]); - const output = concat_encoded([input_a, input_b, input_c, input_d]); + const output = concatNestedArrays([input_a, input_b, input_c, input_d]); - const decoded = decode(output); + const decoded = decodeNestedArray(output); console.log("CONCAT", [input_a, input_b, input_c, input_d]); console.log(output); console.log(decoded); @@ -84,14 +84,14 @@ console.log("INPUT"); console.log(input); - let encoded = encode(input); + let encoded = encodeNestedArray(input); // encoded = []; console.log("ENCODED"); console.log(encoded); encoded = [0, 2, 1, 0, 4, 4, 2, 4, 1, 2, 2, 0, 3, 2, 3, 1, 1, 1, 1]; - const decoded = decode(encoded); + const decoded = decodeNestedArray(encoded); console.log("DECODED"); console.log(decoded); diff --git a/package.json b/package.json index c78602a..544b4ca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "scripts": { "build": "pnpm build:nodes && pnpm build:app", - "build:app": "pnpm -r --filter 'app' build", + "build:app": "pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build", "build:nodes": "pnpm -r --filter './nodes/**' build", "dev:nodes": "pnpm -r --parallel --filter './nodes/**' dev", "dev": "pnpm -r --filter 'app' --filter './packages/node-registry' dev" diff --git a/packages/ui/package.json b/packages/ui/package.json index 79abc2e..745f7c0 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -14,10 +14,10 @@ }, "exports": { ".": { - "types": "./src/lib/index.ts", - "svelte": "./src/lib/index.ts" + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" }, - "./app.css": "./src/lib/app.css" + "./app.css": "./dist/app.css" }, "files": [ "dist",