Commit 4b17067
committed
refactor: move Node/Edge/ReadableGraph types to @bibgraph/types and keep evaluation in algorithms
Move core graph types to @bibgraph/types to break circular dependency:
- Create packages/types/src/graph-algorithms.ts with Node, Edge, NodeBase, EdgeBase, ReadableGraph
- Export core graph types from @bibgraph/types package
- Update algorithms to re-export Node/Edge from @bibgraph/types (backwards compatibility)
- Update graph-expansion to import ReadableGraph, NodeBase, EdgeBase from @bibgraph/types
- Update all evaluation files to import Node/Edge from @bibgraph/types
Move BFS back to algorithms package:
- Copy BFS implementation from graph-expansion to algorithms/traversal/bfs.ts
- Update BFS to import ReadableGraph from @bibgraph/types
- Create algorithms/traversal/index.ts to export BFS
- Update algorithms/src/index.ts to export bfs function (not types to avoid conflicts)
- Update algorithms/src/extraction/path.ts to import bfs from local traversal
- Update algorithms/src/graph-adapter.ts to import ReadableGraph from @bibgraph/types
Keep evaluation framework in algorithms package:
- Move evaluation framework from graph-expansion back to algorithms (where it belongs)
- Update evaluation imports to use relative paths (../.. for Graph/Path types)
- Export all evaluation functions from algorithms/src/index.ts
- Remove evaluation exports from graph-expansion/src/index.ts
- Remove evaluation export configuration from graph-expansion/package.json
This breaks the circular dependency:
- Previously: graph-expansion → algorithms (Node/Edge) → graph-expansion (bfs/ReadableGraph)
- Now: Both packages import from @bibgraph/types (no circular dependency)
- Evaluation stays in algorithms (depends on Graph/Path types from same package)
fix(lint-staged): wrap Nx commands in sh -c for environment variable support
- Fix NX_DAEMON=false spawn error by using shell wrapper
- Enables proper environment variable parsing in pre-commit hook1 parent 5d2225c commit 4b17067
File tree
33 files changed
+1012
-538
lines changed- packages
- algorithms
- __tests__/evaluation
- src
- __tests__/evaluation
- evaluation
- baselines
- path-planting
- runner
- extraction
- pathfinding
- traversal
- types
- graph-expansion
- src
- extraction
- interfaces
- traversal
- types/src
33 files changed
+1012
-538
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments