@depxray/core 1.3.0

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.
Files changed (57) hide show
  1. package/dist/buildGraph.d.ts +11 -0
  2. package/dist/buildGraph.d.ts.map +1 -0
  3. package/dist/buildGraph.js +111 -0
  4. package/dist/buildGraph.js.map +1 -0
  5. package/dist/buildStructureGraph.d.ts +3 -0
  6. package/dist/buildStructureGraph.d.ts.map +1 -0
  7. package/dist/buildStructureGraph.js +45 -0
  8. package/dist/buildStructureGraph.js.map +1 -0
  9. package/dist/configLoader.d.ts +18 -0
  10. package/dist/configLoader.d.ts.map +1 -0
  11. package/dist/configLoader.js +188 -0
  12. package/dist/configLoader.js.map +1 -0
  13. package/dist/detectCircularDeps.d.ts +21 -0
  14. package/dist/detectCircularDeps.d.ts.map +1 -0
  15. package/dist/detectCircularDeps.js +159 -0
  16. package/dist/detectCircularDeps.js.map +1 -0
  17. package/dist/detectOrphanFiles.d.ts +4 -0
  18. package/dist/detectOrphanFiles.d.ts.map +1 -0
  19. package/dist/detectOrphanFiles.js +58 -0
  20. package/dist/detectOrphanFiles.js.map +1 -0
  21. package/dist/exportGraph.d.ts +16 -0
  22. package/dist/exportGraph.d.ts.map +1 -0
  23. package/dist/exportGraph.js +50 -0
  24. package/dist/exportGraph.js.map +1 -0
  25. package/dist/fileDiscovery.d.ts +21 -0
  26. package/dist/fileDiscovery.d.ts.map +1 -0
  27. package/dist/fileDiscovery.js +119 -0
  28. package/dist/fileDiscovery.js.map +1 -0
  29. package/dist/filterTreeByDepth.d.ts +3 -0
  30. package/dist/filterTreeByDepth.d.ts.map +1 -0
  31. package/dist/filterTreeByDepth.js +22 -0
  32. package/dist/filterTreeByDepth.js.map +1 -0
  33. package/dist/index.d.ts +15 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +43 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/parseImports.d.ts +30 -0
  38. package/dist/parseImports.d.ts.map +1 -0
  39. package/dist/parseImports.js +196 -0
  40. package/dist/parseImports.js.map +1 -0
  41. package/dist/resolveImports.d.ts +25 -0
  42. package/dist/resolveImports.d.ts.map +1 -0
  43. package/dist/resolveImports.js +189 -0
  44. package/dist/resolveImports.js.map +1 -0
  45. package/dist/scanFileTree.d.ts +3 -0
  46. package/dist/scanFileTree.d.ts.map +1 -0
  47. package/dist/scanFileTree.js +118 -0
  48. package/dist/scanFileTree.js.map +1 -0
  49. package/dist/scanProject.d.ts +39 -0
  50. package/dist/scanProject.d.ts.map +1 -0
  51. package/dist/scanProject.js +224 -0
  52. package/dist/scanProject.js.map +1 -0
  53. package/dist/types.d.ts +316 -0
  54. package/dist/types.d.ts.map +1 -0
  55. package/dist/types.js +45 -0
  56. package/dist/types.js.map +1 -0
  57. package/package.json +44 -0
@@ -0,0 +1,316 @@
1
+ /**
2
+ * A single node in the scanned folder/file tree.
3
+ *
4
+ * This structure is the source of truth for the project structure graph MVP.
5
+ * Unlike dependency graph nodes, directories and files are both represented.
6
+ */
7
+ export interface FileTreeNode {
8
+ /** Unique identifier — the absolute path */
9
+ id: string;
10
+ /** Short display name (last path segment only) */
11
+ name: string;
12
+ /** Path relative to the scanned project root */
13
+ relativePath: string;
14
+ /** Absolute path on disk */
15
+ absolutePath: string;
16
+ /** Whether this node is a file or directory */
17
+ kind: 'file' | 'directory';
18
+ /** File extension for files, otherwise null */
19
+ extension: string | null;
20
+ /** Nesting depth from the root node */
21
+ depth: number;
22
+ /** Child nodes, only populated for directories */
23
+ children: FileTreeNode[];
24
+ /** File size in bytes, only populated for files */
25
+ sizeBytes?: number;
26
+ }
27
+ /**
28
+ * A node in the structure graph used by the browser UI.
29
+ */
30
+ export interface StructureGraphNode {
31
+ /** Unique identifier — the absolute path */
32
+ id: string;
33
+ /** Short label for display */
34
+ label: string;
35
+ /** Path relative to the scanned project root */
36
+ relativePath: string;
37
+ /** Absolute path on disk */
38
+ absolutePath: string;
39
+ /** Whether this node is a file or directory */
40
+ kind: 'file' | 'directory';
41
+ /** File extension for files, otherwise null */
42
+ extension: string | null;
43
+ /** Nesting depth from the root node */
44
+ depth: number;
45
+ /** Whether this directory is currently collapsed */
46
+ collapsed: boolean;
47
+ /** Whether this node is hidden because an ancestor is collapsed */
48
+ hidden: boolean;
49
+ /** Number of direct children */
50
+ childCount: number;
51
+ /** Total recursive descendant count */
52
+ descendantCount: number;
53
+ /** File size in bytes, only populated for files */
54
+ sizeBytes?: number;
55
+ }
56
+ /**
57
+ * A directed edge from a parent node to its child in the file tree.
58
+ */
59
+ export interface StructureGraphEdge {
60
+ /** Stable edge identifier */
61
+ id: string;
62
+ /** Parent node absolute path */
63
+ source: string;
64
+ /** Child node absolute path */
65
+ target: string;
66
+ }
67
+ /**
68
+ * The structure graph payload produced from a file tree.
69
+ */
70
+ export interface StructureGraph {
71
+ /** Root project directory */
72
+ rootDir: string;
73
+ /** Graph nodes for directories and files */
74
+ nodes: StructureGraphNode[];
75
+ /** Parent-to-child edges */
76
+ edges: StructureGraphEdge[];
77
+ }
78
+ /**
79
+ * A single file node in the dependency graph.
80
+ *
81
+ * Each scanned file becomes a GraphNode. The `id` is the absolute path,
82
+ * which guarantees uniqueness. The `relativePath` is for display purposes.
83
+ */
84
+ export interface GraphNode {
85
+ /** Unique identifier — the absolute file path */
86
+ id: string;
87
+ /** Path relative to the project root (for display and portability) */
88
+ relativePath: string;
89
+ /** File extension: '.ts', '.tsx', '.js', or '.jsx' */
90
+ extension: string;
91
+ /** Number of files that import this file (incoming edges) */
92
+ inDegree: number;
93
+ /** Number of files this file imports (outgoing edges) */
94
+ outDegree: number;
95
+ /** Whether this file participates in a circular dependency */
96
+ isCircular: boolean;
97
+ /** Detected component or export name (from default export, if any) */
98
+ componentName?: string;
99
+ }
100
+ /**
101
+ * A directed edge representing an import relationship.
102
+ *
103
+ * The edge goes from `source` (the file that contains the import statement)
104
+ * to `target` (the file being imported).
105
+ */
106
+ export interface GraphEdge {
107
+ /** Absolute path of the importing file */
108
+ source: string;
109
+ /** Absolute path of the imported file */
110
+ target: string;
111
+ /** The original import specifier as written in the source code */
112
+ importSpecifier: string;
113
+ /** List of named imports, e.g., ['useState', 'useEffect'] */
114
+ importedNames: string[];
115
+ /** Whether this is a type-only import (`import type { ... }`) */
116
+ isTypeOnly: boolean;
117
+ /** Whether this is a dynamic import (`import('...')`) */
118
+ isDynamic: boolean;
119
+ }
120
+ /**
121
+ * A detected circular dependency chain.
122
+ *
123
+ * For example, if A imports B and B imports A, the chain would be:
124
+ * ['A.tsx', 'B.tsx', 'A.tsx']
125
+ */
126
+ export interface CircularChain {
127
+ /** Ordered list of relative file paths forming the cycle */
128
+ chain: string[];
129
+ /** Human-readable description, e.g., "A.tsx → B.tsx → A.tsx" */
130
+ description: string;
131
+ }
132
+ /**
133
+ * The complete dependency graph for a project.
134
+ */
135
+ export interface DependencyGraph {
136
+ /** Absolute path of the scanned project root */
137
+ rootDir: string;
138
+ /** All file nodes in the graph */
139
+ nodes: GraphNode[];
140
+ /** All import edges in the graph */
141
+ edges: GraphEdge[];
142
+ /** All detected circular dependency chains */
143
+ circularDependencies: CircularChain[];
144
+ /** Metadata about the scan */
145
+ metadata: ScanMetadata;
146
+ }
147
+ /**
148
+ * Options for configuring the scanner.
149
+ *
150
+ * All fields are optional and have sensible defaults.
151
+ */
152
+ export interface ScanOptions {
153
+ /** Absolute path to the project root directory (required) */
154
+ rootDir: string;
155
+ /**
156
+ * File extensions to include in the scan.
157
+ * @default ['.js', '.jsx', '.ts', '.tsx']
158
+ */
159
+ extensions?: string[];
160
+ /**
161
+ * Additional directory/file patterns to ignore (on top of defaults).
162
+ * Uses glob-like matching against relative paths.
163
+ */
164
+ ignorePatterns?: string[];
165
+ /**
166
+ * Whether to detect circular dependencies.
167
+ * @default true
168
+ */
169
+ detectCircular?: boolean;
170
+ /**
171
+ * Whether to resolve path aliases from tsconfig.json/jsconfig.json.
172
+ * @default true
173
+ */
174
+ resolveAliases?: boolean;
175
+ /**
176
+ * Maximum depth for directory traversal.
177
+ * @default Infinity
178
+ */
179
+ maxDepth?: number;
180
+ /**
181
+ * Whether to include type-only imports in the graph.
182
+ * @default true
183
+ */
184
+ includeTypeImports?: boolean;
185
+ /**
186
+ * Whether to include dynamic imports (`import('...')`) in the graph.
187
+ * @default true
188
+ */
189
+ includeDynamicImports?: boolean;
190
+ /**
191
+ * Patterns for known entry points to exclude from orphan detection.
192
+ * Uses lightweight glob matching against relative paths.
193
+ */
194
+ entryPointPatterns?: string[];
195
+ }
196
+ /**
197
+ * Options for detecting files that have no incoming import edges.
198
+ */
199
+ export interface OrphanDetectionOptions {
200
+ /** Patterns for known entry points to exclude from orphan detection */
201
+ entryPointPatterns?: string[];
202
+ }
203
+ /**
204
+ * Options for scanning a raw folder/file tree.
205
+ */
206
+ export interface ScanFileTreeOptions {
207
+ /** Additional directory/file names to ignore */
208
+ ignorePatterns?: string[];
209
+ /**
210
+ * Maximum child depth to traverse from the root node.
211
+ * @default Infinity
212
+ */
213
+ maxDepth?: number;
214
+ }
215
+ /**
216
+ * The result returned by `scanProject()`.
217
+ *
218
+ * Contains the full dependency graph, summary statistics, and any errors
219
+ * encountered during scanning.
220
+ */
221
+ export interface ScanResult {
222
+ /** The complete dependency graph */
223
+ graph: DependencyGraph;
224
+ /** Total number of files scanned */
225
+ totalFiles: number;
226
+ /** Total number of import edges found */
227
+ totalImports: number;
228
+ /** Total number of circular dependency chains */
229
+ circularCount: number;
230
+ /** Relative paths of files with no incoming imports, excluding entry points */
231
+ orphanFiles: string[];
232
+ /** Files that could not be parsed, with error details */
233
+ errors: ScanError[];
234
+ /** How long the scan took in milliseconds */
235
+ durationMs: number;
236
+ }
237
+ /**
238
+ * A file that failed to parse during scanning.
239
+ */
240
+ export interface ScanError {
241
+ /** Absolute path of the file that failed */
242
+ filePath: string;
243
+ /** Human-readable error message */
244
+ error: string;
245
+ }
246
+ /**
247
+ * Metadata about a scan, included in the graph and exported JSON.
248
+ */
249
+ export interface ScanMetadata {
250
+ /** ISO 8601 timestamp of when the scan was performed */
251
+ scannedAt: string;
252
+ /** How long the scan took in milliseconds */
253
+ scanDurationMs: number;
254
+ /** Absolute path of the project root */
255
+ projectRoot: string;
256
+ /** Total number of files in the graph */
257
+ totalFiles: number;
258
+ /** Total number of edges in the graph */
259
+ totalEdges: number;
260
+ /** Number of circular dependency chains detected */
261
+ circularCount: number;
262
+ /** Version of @depxray/core that produced this graph */
263
+ depxrayVersion: string;
264
+ }
265
+ /**
266
+ * Raw import information extracted from a single file's AST.
267
+ * This is an intermediate representation before path resolution.
268
+ */
269
+ export interface RawImportInfo {
270
+ /** The import specifier as written in source, e.g., './Button' or '@/utils' */
271
+ source: string;
272
+ /** Named imports: ['Button', 'ButtonProps'] */
273
+ specifiers: string[];
274
+ /** Whether this is `import type { ... }` */
275
+ isTypeOnly: boolean;
276
+ /** Whether this is a dynamic `import('...')` */
277
+ isDynamic: boolean;
278
+ /** Line number in the source file */
279
+ line: number;
280
+ }
281
+ /**
282
+ * A resolved import — the raw import after path resolution.
283
+ */
284
+ export interface ResolvedImport {
285
+ /** The original raw import info */
286
+ raw: RawImportInfo;
287
+ /** The resolved absolute file path, or null if unresolvable */
288
+ resolvedPath: string | null;
289
+ /** Why the import couldn't be resolved (if resolvedPath is null) */
290
+ error?: string;
291
+ }
292
+ /**
293
+ * A path alias mapping loaded from tsconfig.json or jsconfig.json.
294
+ *
295
+ * Example: `"@/*": ["./src/*"]` becomes:
296
+ * { prefix: '@/', paths: ['/abs/path/to/src/'] }
297
+ */
298
+ export interface AliasMapping {
299
+ /** The alias prefix (without the wildcard `*`), e.g., '@/' */
300
+ prefix: string;
301
+ /** Absolute directory paths this alias maps to */
302
+ paths: string[];
303
+ }
304
+ /**
305
+ * Default directories and patterns to ignore during file discovery.
306
+ */
307
+ export declare const DEFAULT_IGNORE_PATTERNS: string[];
308
+ /**
309
+ * Default file extensions to scan.
310
+ */
311
+ export declare const DEFAULT_EXTENSIONS: string[];
312
+ /**
313
+ * Default entry points excluded from orphan detection.
314
+ */
315
+ export declare const DEFAULT_ENTRY_POINT_PATTERNS: string[];
316
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IAEX,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IAErB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAE3B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IAEd,kDAAkD;IAClD,QAAQ,EAAE,YAAY,EAAE,CAAC;IAEzB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IAEX,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IAErB,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;IAErB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAE3B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IAEd,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IAEnB,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;IAEhB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IAEnB,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IAExB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,MAAM,WAAW,YAAY;IAC3B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IAEf,kDAAkD;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,EAY3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,EAAmC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,EAUhD,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ // ============================================================================
3
+ // React Dependency Graph — Core Types
4
+ // ============================================================================
5
+ // All shared type definitions for the scanner, graph, and output formats.
6
+ // These types are consumed by the CLI and future integrations
7
+ // (MCP server, Antigravity, Codex).
8
+ // ============================================================================
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DEFAULT_ENTRY_POINT_PATTERNS = exports.DEFAULT_EXTENSIONS = exports.DEFAULT_IGNORE_PATTERNS = void 0;
11
+ /**
12
+ * Default directories and patterns to ignore during file discovery.
13
+ */
14
+ exports.DEFAULT_IGNORE_PATTERNS = [
15
+ 'node_modules',
16
+ 'dist',
17
+ 'build',
18
+ 'out',
19
+ '.next',
20
+ 'coverage',
21
+ '.git',
22
+ '.cache',
23
+ '.turbo',
24
+ '.depxray',
25
+ '__mocks__',
26
+ ];
27
+ /**
28
+ * Default file extensions to scan.
29
+ */
30
+ exports.DEFAULT_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
31
+ /**
32
+ * Default entry points excluded from orphan detection.
33
+ */
34
+ exports.DEFAULT_ENTRY_POINT_PATTERNS = [
35
+ '**/index.*',
36
+ '**/main.*',
37
+ '**/app.*',
38
+ '**/App.*',
39
+ '**/*.test.*',
40
+ '**/*.spec.*',
41
+ '**/*.config.*',
42
+ '**/vite.config.*',
43
+ '**/next.config.*',
44
+ ];
45
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,sCAAsC;AACtC,+EAA+E;AAC/E,0EAA0E;AAC1E,8DAA8D;AAC9D,oCAAoC;AACpC,+EAA+E;;;AA8Y/E;;GAEG;AACU,QAAA,uBAAuB,GAAa;IAC/C,cAAc;IACd,MAAM;IACN,OAAO;IACP,KAAK;IACL,OAAO;IACP,UAAU;IACV,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,WAAW;CACZ,CAAC;AAEF;;GAEG;AACU,QAAA,kBAAkB,GAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAE3E;;GAEG;AACU,QAAA,4BAA4B,GAAa;IACpD,YAAY;IACZ,WAAW;IACX,UAAU;IACV,UAAU;IACV,aAAa;IACb,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,kBAAkB;CACnB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@depxray/core",
3
+ "version": "1.3.0",
4
+ "description": "Static analysis engine for JavaScript and TypeScript dependency graphs, codebase context, and AI-agent tooling.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "test": "vitest run",
14
+ "test:watch": "vitest",
15
+ "clean": "rm -rf dist"
16
+ },
17
+ "dependencies": {
18
+ "@babel/parser": "^7.24.0",
19
+ "@babel/traverse": "^7.24.0",
20
+ "@babel/types": "^7.24.0"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.4.0",
24
+ "vitest": "^1.6.0",
25
+ "@types/babel__traverse": "^7.20.0",
26
+ "@types/node": "^20.0.0"
27
+ },
28
+ "keywords": [
29
+ "dependency-graph",
30
+ "dependency-analysis",
31
+ "static-analysis",
32
+ "javascript",
33
+ "typescript",
34
+ "imports",
35
+ "codebase",
36
+ "codebase-explorer",
37
+ "architecture",
38
+ "ai-agent",
39
+ "coding-agent",
40
+ "agentic-ai",
41
+ "llm"
42
+ ],
43
+ "license": "MIT"
44
+ }