Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

chore(dashboard): add elkjs, graphology, vitest

Lum110428362dbfe0ee
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b026d0b1..64dddbdc 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -115,6 +115,15 @@ importers:
devlop:
specifier: ^1.1.0
version: 1.1.0
+ elkjs:
+ specifier: ^0.9.3
+ version: 0.9.3
+ graphology:
+ specifier: ^0.25.4
+ version: 0.25.4([email protected])
+ graphology-communities-louvain:
+ specifier: ^2.0.1
+ version: 2.0.2([email protected])
hast-util-to-jsx-runtime:
specifier: ^2.3.6
version: 2.3.6
@@ -149,6 +158,9 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.0
+ '@vitest/coverage-v8':
+ specifier: ^3.2.4
tailwindcss:
specifier: ^4.0.0
version: 4.2.1
@@ -158,6 +170,9 @@ importers:
vite:
specifier: ^6.0.0
+ vitest:
+ specifier: ^3.1.0
packages:
@@ -1455,6 +1470,9 @@ packages:
resolution: {integrity: sha512-q9n5T4BR4Xwa2cwbrwcsDJtHD/enpQ5S1xF1IAtdqf5AAgqDFmR/aakqH3ChFdqd/QXJhS3rnnXFtexU7rax6Q==}
+ resolution: {integrity: sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==}
+
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
@@ -1509,6 +1527,10 @@ packages:
resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}
+ resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
+ engines: {node: '>=0.8.x'}
+
resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==}
engines: {node: '>=12.0.0'}
@@ -1564,6 +1586,29 @@ packages:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
+ resolution: {integrity: sha512-zt+2hHVPYxjEquyecxWXoUoIuN/UvYzsvI7boDdMNz0rRvpESQ7+e+Ejv6wK7AThycbZXuQ6DkG8NPMCq6XwoA==}
+ peerDependencies:
+ graphology-types: '>=0.19.0'
+
+ resolution: {integrity: sha512-A7RXuKQvdqSWOpn7ZVQo4S33O0vCfPBnUSf7FwE0zNCasqwZVUaCXePuWo5HBpWw68KJcwObZDHpFk6HKH6MYQ==}
+ peerDependencies:
+ graphology-types: '>=0.20.0'
+
+ resolution: {integrity: sha512-hDRKYXa8TsoZHjgEaysSRyPdT6uB78Ci8WnjgbStlQysz7xR52PInxNsmnB7IBOM1BhikxkNyCVEFgmPKnpx3Q==}
+
+ resolution: {integrity: sha512-ckHg8MXrXJkOARk56ZaSCM1g1Wihe2d6iTmz1enGOz4W/l831MBCKSayeFQfowgF8wd+PQ4rlch/56Vs/VZLDQ==}
+ peerDependencies:
+ graphology-types: '>=0.23.0'
+
+ resolution: {integrity: sha512-33g0Ol9nkWdD6ulw687viS8YJQBxqG5LWII6FI6nul0pq6iM2t5EKquOTFDbyTblRB3O9I+7KX4xI8u5ffekAQ==}
+ peerDependencies:
+ graphology-types: '>=0.24.0'
+
resolution: {integrity: sha512-oi15ESLW5LRthZ+qPCi5GNasY/gvynSKUQxgiovrY63bPAtG59wtM+LSrlcwvOHAXzGrXVLnI97brbkdPF9WoQ==}
@@ -2034,6 +2079,9 @@ packages:
resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==}
engines: {node: '>=16 || 14 >=14.17'}
+ resolution: {integrity: sha512-vyWo2K3fjrUw8YeeZ1zF0fy6Mu59RHokURlld8ymdUPjMlD9EC9ov1/YPqTgqRvUN9nTr3Gqfz29LYAmu0PHPQ==}
+
resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==}
engines: {node: '>=10'}
@@ -2077,6 +2125,9 @@ packages:
resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}
+ resolution: {integrity: sha512-42CPE9AhahZRsMNslczq0ctAEtqk8Eka26QofnqC346BZdHDySk3LWka23LI7ULIw11NmltpiLagIq8gBozxTw==}
+
resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==}
@@ -2110,6 +2161,9 @@ packages:
resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==}
+ resolution: {integrity: sha512-wRqjisUyiUfXowgm7MFH2rwJzKIr20rca5FsHXCMNm1W5YPP1hCtrZfgmQ62kP7OZ7Xt+cR858aB28lu5NX55g==}
+
resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==}
@@ -3656,6 +3710,14 @@ snapshots:
chai: 5.3.3
tinyrainbow: 2.0.0
+ dependencies:
+ '@vitest/spy': 3.2.4
+ estree-walker: 3.0.3
+ magic-string: 0.30.21
+ optionalDependencies:
+
dependencies:
'@vitest/spy': 3.2.4
@@ -4048,6 +4110,8 @@ snapshots:
+
@@ -4137,6 +4201,8 @@ snapshots:
+
@@ -4184,6 +4250,32 @@ snapshots:
+ dependencies:
+ graphology-indices: 0.17.0([email protected])
+ graphology-types: 0.24.8
+ graphology-utils: 2.5.2([email protected])
+ mnemonist: 0.39.8
+ pandemonium: 2.4.1
+
+ dependencies:
+ graphology-types: 0.24.8
+ graphology-utils: 2.5.2([email protected])
+ mnemonist: 0.39.8
+
+
+ dependencies:
+ graphology-types: 0.24.8
+
+ dependencies:
+ events: 3.3.0
+ graphology-types: 0.24.8
+ obliterator: 2.0.5
+
dependencies:
cookie-es: 1.2.2
@@ -4888,6 +4980,10 @@ snapshots:
+ dependencies:
+ obliterator: 2.0.5
+
@@ -4916,6 +5012,8 @@ snapshots:
dependencies:
boolbase: 1.0.0
+
@@ -4949,6 +5047,10 @@ snapshots:
+ dependencies:
+ mnemonist: 0.39.8
+
dependencies:
'@types/unist': 2.0.11
@@ -5616,7 +5718,7 @@ snapshots:
dependencies:
'@types/chai': 5.2.3
'@vitest/expect': 3.2.4
'@vitest/pretty-format': 3.2.4
'@vitest/runner': 3.2.4
'@vitest/snapshot': 3.2.4
diff --git a/understand-anything-plugin/packages/dashboard/package.json b/understand-anything-plugin/packages/dashboard/package.json
index 8bb91963..626db7df 100644
--- a/understand-anything-plugin/packages/dashboard/package.json
+++ b/understand-anything-plugin/packages/dashboard/package.json
@@ -7,7 +7,9 @@
"dev": "vite",
"build": "tsc -b && vite build",
"build:demo": "tsc -b && vite build --config vite.config.demo.ts",
- "preview": "vite preview"
+ "preview": "vite preview",
+ "test": "vitest run",
+ "test:watch": "vitest"
},
"dependencies": {
"@dagrejs/dagre": "^2.0.4",
@@ -15,6 +17,9 @@
"@xyflow/react": "^12.0.0",
"d3-force": "^3.0.0",
"devlop": "^1.1.0",
+ "elkjs": "^0.9.3",
+ "graphology": "^0.25.4",
+ "graphology-communities-louvain": "^2.0.1",
"hast-util-to-jsx-runtime": "^2.3.6",
"prism-react-renderer": "^2.4.1",
"react": "^19.0.0",
@@ -28,8 +33,10 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.0",
+ "@vitest/coverage-v8": "^3.2.4",
"tailwindcss": "^4.0.0",
"typescript": "^5.7.0",
- "vite": "^6.0.0"
+ "vite": "^6.0.0",
+ "vitest": "^3.1.0"
}
}
diff --git a/understand-anything-plugin/packages/dashboard/src/utils/__tests__/smoke.test.ts b/understand-anything-plugin/packages/dashboard/src/utils/__tests__/smoke.test.ts
new file mode 100644
index 00000000..833878d7
--- /dev/null
+++ b/understand-anything-plugin/packages/dashboard/src/utils/__tests__/smoke.test.ts
@@ -0,0 +1,20 @@
+import { describe, it, expect } from "vitest";
+import ELK from "elkjs/lib/elk.bundled.js";
+import Graph from "graphology";
+import louvain from "graphology-communities-louvain";
+
+describe("dependency smoke test", () => {
+ it("imports elkjs", () => {
+ expect(typeof ELK).toBe("function");
+ });
+
+ it("imports graphology", () => {
+ const g = new Graph();
+ g.addNode("a");
+ expect(g.order).toBe(1);
+ });
+
+ it("imports graphology-communities-louvain", () => {
+ expect(typeof louvain).toBe("function");
+ });
+});
diff --git a/understand-anything-plugin/packages/dashboard/vite.config.ts b/understand-anything-plugin/packages/dashboard/vite.config.ts
index 697ca5b2..35079025 100644
--- a/understand-anything-plugin/packages/dashboard/vite.config.ts
+++ b/understand-anything-plugin/packages/dashboard/vite.config.ts
@@ -1,3 +1,4 @@
+/// <reference types="vitest" />
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
@@ -176,6 +177,11 @@ function readSourceFile(url: URL) {
}
export default defineConfig({
+ test: {
+ environment: "node",
+ include: ["src/**/__tests__/**/*.test.ts"],
+ },
+
// FIX 1 — bind only to localhost, not 0.0.0.0
// This blocks access from any other device on the same LAN / WiFi.
server: {