@aiready/visualizer 0.7.0 → 0.7.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.
package/README.md CHANGED
@@ -16,11 +16,11 @@ This package provides tools to transform AIReady analysis results into interacti
16
16
 
17
17
 
18
18
  🎛️ @aiready/cli (orchestrator)
19
- │ │ │ │ │ │ │ │ │
20
- ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
21
- [PAT] [CTX] [CON] [AMP] [DEP] [DOC] [SIG] [AGT] [TST]
22
- │ │ │ │ │ │ │ │ │
23
- └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
19
+ │ │ │ │ │ │ │ │ │
20
+ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
21
+ [PAT] [CTX] [CON] [AMP] [DEP] [DOC] [SIG] [AGT] [TST] [CTR]
22
+ │ │ │ │ │ │ │ │ │
23
+ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
24
24
 
25
25
 
26
26
  🏢 @aiready/core
@@ -30,7 +30,7 @@ Legend:
30
30
  CON = consistency AMP = change-amplification
31
31
  DEP = deps-health DOC = doc-drift
32
32
  SIG = ai-signal-clarity AGT = agent-grounding
33
- TST = testability
33
+ TST = testability CTR = contract-enforcement
34
34
  VIZ = @aiready/visualizer ★ (support package — renders analysis results, not a scorer)
35
35
  ★ = YOU ARE HERE
36
36
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/visualizer",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Interactive graph visualization for AIReady analysis results",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "react": "19.2.4",
50
50
  "react-dom": "19.2.4",
51
51
  "regenerator-runtime": "^0.14.1",
52
- "@aiready/core": "0.24.0"
52
+ "@aiready/core": "0.24.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@tailwindcss/vite": "^4.1.18",
package/web/package.json CHANGED
@@ -12,9 +12,14 @@
12
12
  "dependencies": {
13
13
  "@aiready/components": "workspace:*",
14
14
  "@aiready/core": "workspace:*",
15
+ "class-variance-authority": "^0.7.1",
16
+ "clsx": "^2.1.1",
15
17
  "d3": "^7.9.0",
18
+ "framer-motion": "^12.35.0",
19
+ "lucide-react": "^0.577.0",
16
20
  "react": "^19.0.0",
17
- "react-dom": "^19.0.0"
21
+ "react-dom": "^19.0.0",
22
+ "tailwind-merge": "^3.0.0"
18
23
  },
19
24
  "devDependencies": {
20
25
  "@tailwindcss/postcss": "^4.1.18",
@@ -1,10 +1,12 @@
1
- import { defineConfig } from 'vite';
1
+ import { defineConfig, type UserConfig } from 'vite';
2
2
  import { resolve } from 'path';
3
3
  import react from '@vitejs/plugin-react';
4
- import { existsSync } from 'fs';
5
- import tailwindcss from '@tailwindcss/vite';
4
+ import { existsSync, readFileSync } from 'fs';
5
+ import { createRequire } from 'module';
6
6
 
7
- export default defineConfig(async ({ command }) => {
7
+ const require = createRequire(import.meta.url);
8
+
9
+ export default defineConfig(({ command }): UserConfig => {
8
10
  const isDev = command === 'serve';
9
11
 
10
12
  // Resolve path to @aiready/components for alias
@@ -13,61 +15,57 @@ export default defineConfig(async ({ command }) => {
13
15
  if (!existsSync(componentsPath)) {
14
16
  // Fallback: try installed package
15
17
  try {
16
- componentsPath = require.resolve('@aiready/components');
17
- componentsPath = resolve(componentsPath, '..');
18
+ // Use synchronous resolve
19
+ componentsPath = resolve(
20
+ require.resolve('@aiready/components'),
21
+ '../../src'
22
+ );
18
23
  } catch (e) {
19
24
  // Use build dist as last resort
20
25
  componentsPath = resolve(__dirname, '../../components/dist');
21
26
  }
22
27
  }
23
28
 
24
- const plugins: any[] = [react() /*, tailwindcss()*/];
25
- // Dev-time middleware: if the CLI sets AIREADY_REPORT_PATH when spawning Vite,
26
- // serve that file at /report-data.json so the client can fetch the report
27
- // directly from the consumer working directory without copying into node_modules.
29
+ const plugins: any[] = [react()];
30
+
31
+ // Dev-time middleware
28
32
  const reportProxyPlugin = {
29
33
  name: 'aiready-report-proxy',
30
34
  configureServer(server: any) {
31
35
  const reportPath = process.env.AIREADY_REPORT_PATH;
32
36
  const visualizerConfigStr = process.env.AIREADY_VISUALIZER_CONFIG;
33
37
  if (!reportPath) return;
34
- server.middlewares.use(async (req: any, res: any, next: any) => {
35
- try {
36
- const url = req.url || '';
37
- if (
38
- url === '/report-data.json' ||
39
- url.startsWith('/report-data.json?')
40
- ) {
41
- const { promises: fsp } = await import('fs');
38
+
39
+ server.middlewares.use((req: any, res: any, next: any) => {
40
+ const url = req.url || '';
41
+ if (url === '/report-data.json' || url.startsWith('/report-data.json?')) {
42
+ try {
42
43
  if (!existsSync(reportPath)) {
43
44
  res.statusCode = 404;
44
45
  res.setHeader('Content-Type', 'text/plain; charset=utf-8');
45
46
  res.end('Report not found');
46
47
  return;
47
48
  }
48
- const data = await fsp.readFile(reportPath, 'utf8');
49
+ const data = readFileSync(reportPath, 'utf8');
49
50
  const report = JSON.parse(data);
50
51
 
51
- // Inject visualizer config from env if available
52
52
  if (visualizerConfigStr) {
53
53
  try {
54
54
  const visualizerConfig = JSON.parse(visualizerConfigStr);
55
55
  report.visualizerConfig = visualizerConfig;
56
- } catch (e) {
57
- // Silently ignore parse errors
58
- }
56
+ } catch (e) {}
59
57
  }
60
58
 
61
59
  res.statusCode = 200;
62
60
  res.setHeader('Content-Type', 'application/json; charset=utf-8');
63
61
  res.end(JSON.stringify(report));
64
62
  return;
63
+ } catch (e) {
64
+ res.statusCode = 500;
65
+ res.setHeader('Content-Type', 'text/plain; charset=utf-8');
66
+ res.end('Error reading report');
67
+ return;
65
68
  }
66
- } catch (e) {
67
- res.statusCode = 500;
68
- res.setHeader('Content-Type', 'text/plain; charset=utf-8');
69
- res.end('Error reading report');
70
- return;
71
69
  }
72
70
  next();
73
71
  });
@@ -89,16 +87,14 @@ export default defineConfig(async ({ command }) => {
89
87
  },
90
88
  },
91
89
  server: {
92
- // Use default port (5173); don't hardcode to avoid conflicts
93
90
  open: false,
94
91
  },
95
92
  resolve: {
96
- alias: {
97
- // during dev resolve to source for HMR; during build use the built dist
98
- '@aiready/components': isDev
99
- ? componentsPath
100
- : resolve(__dirname, '../../components/dist/index.js'),
101
- },
93
+ alias: isDev
94
+ ? {
95
+ '@aiready/components': componentsPath,
96
+ }
97
+ : ({} as Record<string, string>),
102
98
  },
103
99
  };
104
100
  });