driftdetect-core 0.4.0 → 0.4.2
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/dist/boundaries/boundary-scanner.d.ts +76 -0
- package/dist/boundaries/boundary-scanner.d.ts.map +1 -0
- package/dist/boundaries/boundary-scanner.js +801 -0
- package/dist/boundaries/boundary-scanner.js.map +1 -0
- package/dist/boundaries/data-access-learner.d.ts +126 -0
- package/dist/boundaries/data-access-learner.d.ts.map +1 -0
- package/dist/boundaries/data-access-learner.js +486 -0
- package/dist/boundaries/data-access-learner.js.map +1 -0
- package/dist/boundaries/index.d.ts +6 -0
- package/dist/boundaries/index.d.ts.map +1 -1
- package/dist/boundaries/index.js +6 -0
- package/dist/boundaries/index.js.map +1 -1
- package/dist/boundaries/security-prioritizer.d.ts +118 -0
- package/dist/boundaries/security-prioritizer.d.ts.map +1 -0
- package/dist/boundaries/security-prioritizer.js +316 -0
- package/dist/boundaries/security-prioritizer.js.map +1 -0
- package/dist/call-graph/analysis/coverage-analyzer.d.ts +201 -0
- package/dist/call-graph/analysis/coverage-analyzer.d.ts.map +1 -0
- package/dist/call-graph/analysis/coverage-analyzer.js +553 -0
- package/dist/call-graph/analysis/coverage-analyzer.js.map +1 -0
- package/dist/call-graph/analysis/dead-code-detector.d.ts +145 -0
- package/dist/call-graph/analysis/dead-code-detector.d.ts.map +1 -0
- package/dist/call-graph/analysis/dead-code-detector.js +391 -0
- package/dist/call-graph/analysis/dead-code-detector.js.map +1 -0
- package/dist/call-graph/analysis/graph-builder.d.ts +142 -0
- package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -0
- package/dist/call-graph/analysis/graph-builder.js +624 -0
- package/dist/call-graph/analysis/graph-builder.js.map +1 -0
- package/dist/call-graph/analysis/impact-analyzer.d.ts +150 -0
- package/dist/call-graph/analysis/impact-analyzer.d.ts.map +1 -0
- package/dist/call-graph/analysis/impact-analyzer.js +329 -0
- package/dist/call-graph/analysis/impact-analyzer.js.map +1 -0
- package/dist/call-graph/analysis/index.d.ts +11 -0
- package/dist/call-graph/analysis/index.d.ts.map +1 -0
- package/dist/call-graph/analysis/index.js +9 -0
- package/dist/call-graph/analysis/index.js.map +1 -0
- package/dist/call-graph/analysis/path-finder.d.ts +117 -0
- package/dist/call-graph/analysis/path-finder.d.ts.map +1 -0
- package/dist/call-graph/analysis/path-finder.js +360 -0
- package/dist/call-graph/analysis/path-finder.js.map +1 -0
- package/dist/call-graph/analysis/reachability.d.ts +56 -0
- package/dist/call-graph/analysis/reachability.d.ts.map +1 -0
- package/dist/call-graph/analysis/reachability.js +357 -0
- package/dist/call-graph/analysis/reachability.js.map +1 -0
- package/dist/call-graph/demo.d.ts +11 -0
- package/dist/call-graph/demo.d.ts.map +1 -0
- package/dist/call-graph/demo.js +339 -0
- package/dist/call-graph/demo.js.map +1 -0
- package/dist/call-graph/enrichment/enrichment-engine.d.ts +126 -0
- package/dist/call-graph/enrichment/enrichment-engine.d.ts.map +1 -0
- package/dist/call-graph/enrichment/enrichment-engine.js +760 -0
- package/dist/call-graph/enrichment/enrichment-engine.js.map +1 -0
- package/dist/call-graph/enrichment/impact-scorer.d.ts +59 -0
- package/dist/call-graph/enrichment/impact-scorer.d.ts.map +1 -0
- package/dist/call-graph/enrichment/impact-scorer.js +328 -0
- package/dist/call-graph/enrichment/impact-scorer.js.map +1 -0
- package/dist/call-graph/enrichment/index.d.ts +12 -0
- package/dist/call-graph/enrichment/index.d.ts.map +1 -0
- package/dist/call-graph/enrichment/index.js +15 -0
- package/dist/call-graph/enrichment/index.js.map +1 -0
- package/dist/call-graph/enrichment/remediation-generator.d.ts +41 -0
- package/dist/call-graph/enrichment/remediation-generator.d.ts.map +1 -0
- package/dist/call-graph/enrichment/remediation-generator.js +609 -0
- package/dist/call-graph/enrichment/remediation-generator.js.map +1 -0
- package/dist/call-graph/enrichment/sensitivity-classifier.d.ts +71 -0
- package/dist/call-graph/enrichment/sensitivity-classifier.d.ts.map +1 -0
- package/dist/call-graph/enrichment/sensitivity-classifier.js +454 -0
- package/dist/call-graph/enrichment/sensitivity-classifier.js.map +1 -0
- package/dist/call-graph/enrichment/types.d.ts +402 -0
- package/dist/call-graph/enrichment/types.d.ts.map +1 -0
- package/dist/call-graph/enrichment/types.js +9 -0
- package/dist/call-graph/enrichment/types.js.map +1 -0
- package/dist/call-graph/extractors/base-extractor.d.ts +112 -0
- package/dist/call-graph/extractors/base-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/base-extractor.js +140 -0
- package/dist/call-graph/extractors/base-extractor.js.map +1 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts +76 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.js +387 -0
- package/dist/call-graph/extractors/csharp-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/csharp-extractor.d.ts +87 -0
- package/dist/call-graph/extractors/csharp-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/csharp-extractor.js +470 -0
- package/dist/call-graph/extractors/csharp-extractor.js.map +1 -0
- package/dist/call-graph/extractors/data-access-extractor.d.ts +76 -0
- package/dist/call-graph/extractors/data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/data-access-extractor.js +234 -0
- package/dist/call-graph/extractors/data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/index.d.ts +26 -0
- package/dist/call-graph/extractors/index.d.ts.map +1 -0
- package/dist/call-graph/extractors/index.js +36 -0
- package/dist/call-graph/extractors/index.js.map +1 -0
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts +101 -0
- package/dist/call-graph/extractors/java-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/java-data-access-extractor.js +611 -0
- package/dist/call-graph/extractors/java-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/java-extractor.d.ts +87 -0
- package/dist/call-graph/extractors/java-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/java-extractor.js +510 -0
- package/dist/call-graph/extractors/java-extractor.js.map +1 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts +93 -0
- package/dist/call-graph/extractors/php-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/php-data-access-extractor.js +589 -0
- package/dist/call-graph/extractors/php-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/php-extractor.d.ts +104 -0
- package/dist/call-graph/extractors/php-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/php-extractor.js +619 -0
- package/dist/call-graph/extractors/php-extractor.js.map +1 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts +90 -0
- package/dist/call-graph/extractors/python-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/python-data-access-extractor.js +537 -0
- package/dist/call-graph/extractors/python-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/python-extractor.d.ts +98 -0
- package/dist/call-graph/extractors/python-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/python-extractor.js +681 -0
- package/dist/call-graph/extractors/python-extractor.js.map +1 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts +91 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.d.ts.map +1 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.js +498 -0
- package/dist/call-graph/extractors/semantic-data-access-scanner.js.map +1 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts +122 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.js +788 -0
- package/dist/call-graph/extractors/typescript-data-access-extractor.js.map +1 -0
- package/dist/call-graph/extractors/typescript-extractor.d.ts +145 -0
- package/dist/call-graph/extractors/typescript-extractor.d.ts.map +1 -0
- package/dist/call-graph/extractors/typescript-extractor.js +904 -0
- package/dist/call-graph/extractors/typescript-extractor.js.map +1 -0
- package/dist/call-graph/index.d.ts +127 -0
- package/dist/call-graph/index.d.ts.map +1 -0
- package/dist/call-graph/index.js +247 -0
- package/dist/call-graph/index.js.map +1 -0
- package/dist/call-graph/store/call-graph-store.d.ts +70 -0
- package/dist/call-graph/store/call-graph-store.d.ts.map +1 -0
- package/dist/call-graph/store/call-graph-store.js +210 -0
- package/dist/call-graph/store/call-graph-store.js.map +1 -0
- package/dist/call-graph/store/index.d.ts +7 -0
- package/dist/call-graph/store/index.d.ts.map +1 -0
- package/dist/call-graph/store/index.js +7 -0
- package/dist/call-graph/store/index.js.map +1 -0
- package/dist/call-graph/types.d.ts +376 -0
- package/dist/call-graph/types.d.ts.map +1 -0
- package/dist/call-graph/types.js +8 -0
- package/dist/call-graph/types.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/lake/callgraph-shard-store.d.ts +168 -0
- package/dist/lake/callgraph-shard-store.d.ts.map +1 -0
- package/dist/lake/callgraph-shard-store.js +466 -0
- package/dist/lake/callgraph-shard-store.js.map +1 -0
- package/dist/lake/examples-store.d.ts +127 -0
- package/dist/lake/examples-store.d.ts.map +1 -0
- package/dist/lake/examples-store.js +389 -0
- package/dist/lake/examples-store.js.map +1 -0
- package/dist/lake/index-store.d.ts +82 -0
- package/dist/lake/index-store.d.ts.map +1 -0
- package/dist/lake/index-store.js +359 -0
- package/dist/lake/index-store.js.map +1 -0
- package/dist/lake/index.d.ts +93 -0
- package/dist/lake/index.d.ts.map +1 -0
- package/dist/lake/index.js +138 -0
- package/dist/lake/index.js.map +1 -0
- package/dist/lake/lake.bak/index-store.d.ts +82 -0
- package/dist/lake/lake.bak/index-store.d.ts.map +1 -0
- package/dist/lake/lake.bak/index-store.js +357 -0
- package/dist/lake/lake.bak/index-store.js.map +1 -0
- package/dist/lake/lake.bak/index.d.ts +81 -0
- package/dist/lake/lake.bak/index.d.ts.map +1 -0
- package/dist/lake/lake.bak/index.js +114 -0
- package/dist/lake/lake.bak/index.js.map +1 -0
- package/dist/lake/lake.bak/manifest-store.d.ts +51 -0
- package/dist/lake/lake.bak/manifest-store.d.ts.map +1 -0
- package/dist/lake/lake.bak/manifest-store.js +347 -0
- package/dist/lake/lake.bak/manifest-store.js.map +1 -0
- package/dist/lake/lake.bak/query-engine.d.ts +112 -0
- package/dist/lake/lake.bak/query-engine.d.ts.map +1 -0
- package/dist/lake/lake.bak/query-engine.js +370 -0
- package/dist/lake/lake.bak/query-engine.js.map +1 -0
- package/dist/lake/lake.bak/types.d.ts +428 -0
- package/dist/lake/lake.bak/types.d.ts.map +1 -0
- package/dist/lake/lake.bak/types.js +46 -0
- package/dist/lake/lake.bak/types.js.map +1 -0
- package/dist/lake/lake.bak/view-materializer.d.ts +70 -0
- package/dist/lake/lake.bak/view-materializer.d.ts.map +1 -0
- package/dist/lake/lake.bak/view-materializer.js +314 -0
- package/dist/lake/lake.bak/view-materializer.js.map +1 -0
- package/dist/lake/lake.bak/view-store.d.ts +57 -0
- package/dist/lake/lake.bak/view-store.d.ts.map +1 -0
- package/dist/lake/lake.bak/view-store.js +348 -0
- package/dist/lake/lake.bak/view-store.js.map +1 -0
- package/dist/lake/manifest-store.d.ts +51 -0
- package/dist/lake/manifest-store.d.ts.map +1 -0
- package/dist/lake/manifest-store.js +348 -0
- package/dist/lake/manifest-store.js.map +1 -0
- package/dist/lake/pattern-shard-store.d.ts +87 -0
- package/dist/lake/pattern-shard-store.d.ts.map +1 -0
- package/dist/lake/pattern-shard-store.js +347 -0
- package/dist/lake/pattern-shard-store.js.map +1 -0
- package/dist/lake/query-engine.d.ts +124 -0
- package/dist/lake/query-engine.d.ts.map +1 -0
- package/dist/lake/query-engine.js +453 -0
- package/dist/lake/query-engine.js.map +1 -0
- package/dist/lake/security-shard-store.d.ts +156 -0
- package/dist/lake/security-shard-store.d.ts.map +1 -0
- package/dist/lake/security-shard-store.js +498 -0
- package/dist/lake/security-shard-store.js.map +1 -0
- package/dist/lake/types.d.ts +428 -0
- package/dist/lake/types.d.ts.map +1 -0
- package/dist/lake/types.js +46 -0
- package/dist/lake/types.js.map +1 -0
- package/dist/lake/view-materializer.d.ts +70 -0
- package/dist/lake/view-materializer.d.ts.map +1 -0
- package/dist/lake/view-materializer.js +314 -0
- package/dist/lake/view-materializer.js.map +1 -0
- package/dist/lake/view-store.d.ts +57 -0
- package/dist/lake/view-store.d.ts.map +1 -0
- package/dist/lake/view-store.js +348 -0
- package/dist/lake/view-store.js.map +1 -0
- package/dist/parsers/tree-sitter/index.d.ts +1 -0
- package/dist/parsers/tree-sitter/index.d.ts.map +1 -1
- package/dist/parsers/tree-sitter/index.js +4 -0
- package/dist/parsers/tree-sitter/index.js.map +1 -1
- package/dist/parsers/tree-sitter/typescript-loader.d.ts +58 -0
- package/dist/parsers/tree-sitter/typescript-loader.d.ts.map +1 -0
- package/dist/parsers/tree-sitter/typescript-loader.js +250 -0
- package/dist/parsers/tree-sitter/typescript-loader.js.map +1 -0
- package/dist/store/project-config.d.ts +154 -0
- package/dist/store/project-config.d.ts.map +1 -0
- package/dist/store/project-config.js +235 -0
- package/dist/store/project-config.js.map +1 -0
- package/dist/store/project-registry.d.ts +241 -0
- package/dist/store/project-registry.d.ts.map +1 -0
- package/dist/store/project-registry.js +557 -0
- package/dist/store/project-registry.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree-sitter TypeScript/JavaScript Loader
|
|
3
|
+
*
|
|
4
|
+
* Handles loading tree-sitter and tree-sitter-typescript/javascript with graceful fallback.
|
|
5
|
+
* Provides functions to check availability and access the parser/language.
|
|
6
|
+
*
|
|
7
|
+
* @requirements Unified AST query interface for TypeScript/JavaScript
|
|
8
|
+
*/
|
|
9
|
+
import { createRequire } from 'node:module';
|
|
10
|
+
// Create require function for ESM compatibility
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
// ============================================
|
|
13
|
+
// Module State
|
|
14
|
+
// ============================================
|
|
15
|
+
/** Whether tree-sitter-typescript is available */
|
|
16
|
+
let typescriptAvailable = null;
|
|
17
|
+
/** Whether tree-sitter-javascript is available */
|
|
18
|
+
let javascriptAvailable = null;
|
|
19
|
+
/** Cached tree-sitter module */
|
|
20
|
+
let cachedTreeSitter = null;
|
|
21
|
+
/** Cached TypeScript language */
|
|
22
|
+
let cachedTypeScriptLanguage = null;
|
|
23
|
+
/** Cached TSX language */
|
|
24
|
+
let cachedTsxLanguage = null;
|
|
25
|
+
/** Cached JavaScript language */
|
|
26
|
+
let cachedJavaScriptLanguage = null;
|
|
27
|
+
/** Loading error message if any */
|
|
28
|
+
let loadingError = null;
|
|
29
|
+
// ============================================
|
|
30
|
+
// Public API
|
|
31
|
+
// ============================================
|
|
32
|
+
/**
|
|
33
|
+
* Check if tree-sitter-typescript is available.
|
|
34
|
+
*/
|
|
35
|
+
export function isTypeScriptTreeSitterAvailable() {
|
|
36
|
+
if (typescriptAvailable !== null) {
|
|
37
|
+
return typescriptAvailable;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
loadTypeScriptTreeSitter();
|
|
41
|
+
typescriptAvailable = true;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
typescriptAvailable = false;
|
|
45
|
+
loadingError = error instanceof Error ? error.message : 'Unknown error loading tree-sitter-typescript';
|
|
46
|
+
logDebug(`tree-sitter-typescript not available: ${loadingError}`);
|
|
47
|
+
}
|
|
48
|
+
return typescriptAvailable;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if tree-sitter-javascript is available.
|
|
52
|
+
*/
|
|
53
|
+
export function isJavaScriptTreeSitterAvailable() {
|
|
54
|
+
if (javascriptAvailable !== null) {
|
|
55
|
+
return javascriptAvailable;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
loadJavaScriptTreeSitter();
|
|
59
|
+
javascriptAvailable = true;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
javascriptAvailable = false;
|
|
63
|
+
loadingError = error instanceof Error ? error.message : 'Unknown error loading tree-sitter-javascript';
|
|
64
|
+
logDebug(`tree-sitter-javascript not available: ${loadingError}`);
|
|
65
|
+
}
|
|
66
|
+
return javascriptAvailable;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get the TypeScript language for tree-sitter.
|
|
70
|
+
*/
|
|
71
|
+
export function getTypeScriptLanguage() {
|
|
72
|
+
if (!isTypeScriptTreeSitterAvailable()) {
|
|
73
|
+
throw new Error(`tree-sitter-typescript is not available: ${loadingError ?? 'unknown error'}`);
|
|
74
|
+
}
|
|
75
|
+
if (!cachedTypeScriptLanguage) {
|
|
76
|
+
throw new Error('tree-sitter-typescript language not loaded');
|
|
77
|
+
}
|
|
78
|
+
return cachedTypeScriptLanguage;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the TSX language for tree-sitter.
|
|
82
|
+
*/
|
|
83
|
+
export function getTsxLanguage() {
|
|
84
|
+
if (!isTypeScriptTreeSitterAvailable()) {
|
|
85
|
+
throw new Error(`tree-sitter-typescript is not available: ${loadingError ?? 'unknown error'}`);
|
|
86
|
+
}
|
|
87
|
+
if (!cachedTsxLanguage) {
|
|
88
|
+
throw new Error('tree-sitter-tsx language not loaded');
|
|
89
|
+
}
|
|
90
|
+
return cachedTsxLanguage;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get the JavaScript language for tree-sitter.
|
|
94
|
+
*/
|
|
95
|
+
export function getJavaScriptLanguage() {
|
|
96
|
+
if (!isJavaScriptTreeSitterAvailable()) {
|
|
97
|
+
throw new Error(`tree-sitter-javascript is not available: ${loadingError ?? 'unknown error'}`);
|
|
98
|
+
}
|
|
99
|
+
if (!cachedJavaScriptLanguage) {
|
|
100
|
+
throw new Error('tree-sitter-javascript language not loaded');
|
|
101
|
+
}
|
|
102
|
+
return cachedJavaScriptLanguage;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the tree-sitter Parser constructor.
|
|
106
|
+
*/
|
|
107
|
+
export function getTypeScriptTreeSitter() {
|
|
108
|
+
if (!isTypeScriptTreeSitterAvailable() && !isJavaScriptTreeSitterAvailable()) {
|
|
109
|
+
throw new Error(`tree-sitter is not available: ${loadingError ?? 'unknown error'}`);
|
|
110
|
+
}
|
|
111
|
+
if (!cachedTreeSitter) {
|
|
112
|
+
throw new Error('tree-sitter module not loaded');
|
|
113
|
+
}
|
|
114
|
+
return cachedTreeSitter;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create a new tree-sitter parser instance configured for TypeScript.
|
|
118
|
+
*/
|
|
119
|
+
export function createTypeScriptParser() {
|
|
120
|
+
const Parser = getTypeScriptTreeSitter();
|
|
121
|
+
const language = getTypeScriptLanguage();
|
|
122
|
+
const parser = new Parser();
|
|
123
|
+
parser.setLanguage(language);
|
|
124
|
+
return parser;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Create a new tree-sitter parser instance configured for TSX.
|
|
128
|
+
*/
|
|
129
|
+
export function createTsxParser() {
|
|
130
|
+
const Parser = getTypeScriptTreeSitter();
|
|
131
|
+
const language = getTsxLanguage();
|
|
132
|
+
const parser = new Parser();
|
|
133
|
+
parser.setLanguage(language);
|
|
134
|
+
return parser;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Create a new tree-sitter parser instance configured for JavaScript.
|
|
138
|
+
*/
|
|
139
|
+
export function createJavaScriptParser() {
|
|
140
|
+
const Parser = getTypeScriptTreeSitter();
|
|
141
|
+
const language = getJavaScriptLanguage();
|
|
142
|
+
const parser = new Parser();
|
|
143
|
+
parser.setLanguage(language);
|
|
144
|
+
return parser;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Create a parser for the given file extension.
|
|
148
|
+
*/
|
|
149
|
+
export function createParserForFile(filePath) {
|
|
150
|
+
const ext = filePath.toLowerCase();
|
|
151
|
+
if (ext.endsWith('.tsx')) {
|
|
152
|
+
return isTypeScriptTreeSitterAvailable() ? createTsxParser() : null;
|
|
153
|
+
}
|
|
154
|
+
if (ext.endsWith('.ts') || ext.endsWith('.mts') || ext.endsWith('.cts')) {
|
|
155
|
+
return isTypeScriptTreeSitterAvailable() ? createTypeScriptParser() : null;
|
|
156
|
+
}
|
|
157
|
+
if (ext.endsWith('.jsx')) {
|
|
158
|
+
// JSX uses JavaScript parser with JSX support
|
|
159
|
+
return isJavaScriptTreeSitterAvailable() ? createJavaScriptParser() : null;
|
|
160
|
+
}
|
|
161
|
+
if (ext.endsWith('.js') || ext.endsWith('.mjs') || ext.endsWith('.cjs')) {
|
|
162
|
+
return isJavaScriptTreeSitterAvailable() ? createJavaScriptParser() : null;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get the loading error message if tree-sitter failed to load.
|
|
168
|
+
*/
|
|
169
|
+
export function getTypeScriptLoadingError() {
|
|
170
|
+
isTypeScriptTreeSitterAvailable();
|
|
171
|
+
return loadingError;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Reset the loader state (useful for testing).
|
|
175
|
+
*/
|
|
176
|
+
export function resetTypeScriptLoader() {
|
|
177
|
+
typescriptAvailable = null;
|
|
178
|
+
javascriptAvailable = null;
|
|
179
|
+
cachedTreeSitter = null;
|
|
180
|
+
cachedTypeScriptLanguage = null;
|
|
181
|
+
cachedTsxLanguage = null;
|
|
182
|
+
cachedJavaScriptLanguage = null;
|
|
183
|
+
loadingError = null;
|
|
184
|
+
}
|
|
185
|
+
// ============================================
|
|
186
|
+
// Internal Functions
|
|
187
|
+
// ============================================
|
|
188
|
+
/**
|
|
189
|
+
* Load tree-sitter core module.
|
|
190
|
+
*/
|
|
191
|
+
function loadTreeSitterCore() {
|
|
192
|
+
if (cachedTreeSitter)
|
|
193
|
+
return;
|
|
194
|
+
try {
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
196
|
+
cachedTreeSitter = require('tree-sitter');
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
throw new Error(`Failed to load tree-sitter: ${error instanceof Error ? error.message : 'unknown error'}. ` +
|
|
200
|
+
'Install with: pnpm add tree-sitter');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Attempt to load tree-sitter and tree-sitter-typescript.
|
|
205
|
+
*/
|
|
206
|
+
function loadTypeScriptTreeSitter() {
|
|
207
|
+
if (cachedTypeScriptLanguage && cachedTsxLanguage) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
loadTreeSitterCore();
|
|
211
|
+
try {
|
|
212
|
+
// tree-sitter-typescript exports an object with typescript and tsx languages
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
214
|
+
const tsModule = require('tree-sitter-typescript');
|
|
215
|
+
cachedTypeScriptLanguage = tsModule.typescript;
|
|
216
|
+
cachedTsxLanguage = tsModule.tsx;
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
throw new Error(`Failed to load tree-sitter-typescript: ${error instanceof Error ? error.message : 'unknown error'}. ` +
|
|
220
|
+
'Install with: pnpm add tree-sitter-typescript');
|
|
221
|
+
}
|
|
222
|
+
logDebug('tree-sitter-typescript loaded successfully');
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Attempt to load tree-sitter and tree-sitter-javascript.
|
|
226
|
+
*/
|
|
227
|
+
function loadJavaScriptTreeSitter() {
|
|
228
|
+
if (cachedJavaScriptLanguage) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
loadTreeSitterCore();
|
|
232
|
+
try {
|
|
233
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
234
|
+
cachedJavaScriptLanguage = require('tree-sitter-javascript');
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
throw new Error(`Failed to load tree-sitter-javascript: ${error instanceof Error ? error.message : 'unknown error'}. ` +
|
|
238
|
+
'Install with: pnpm add tree-sitter-javascript');
|
|
239
|
+
}
|
|
240
|
+
logDebug('tree-sitter-javascript loaded successfully');
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Log debug message if debug mode is enabled.
|
|
244
|
+
*/
|
|
245
|
+
function logDebug(message) {
|
|
246
|
+
if (process.env['DRIFT_PARSER_DEBUG'] === 'true') {
|
|
247
|
+
console.debug(`[typescript-loader] ${message}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=typescript-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-loader.js","sourceRoot":"","sources":["../../../src/parsers/tree-sitter/typescript-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,gDAAgD;AAChD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,+CAA+C;AAC/C,eAAe;AACf,+CAA+C;AAE/C,kDAAkD;AAClD,IAAI,mBAAmB,GAAmB,IAAI,CAAC;AAE/C,kDAAkD;AAClD,IAAI,mBAAmB,GAAmB,IAAI,CAAC;AAE/C,gCAAgC;AAChC,IAAI,gBAAgB,GAAwC,IAAI,CAAC;AAEjE,iCAAiC;AACjC,IAAI,wBAAwB,GAA8B,IAAI,CAAC;AAE/D,0BAA0B;AAC1B,IAAI,iBAAiB,GAA8B,IAAI,CAAC;AAExD,iCAAiC;AACjC,IAAI,wBAAwB,GAA8B,IAAI,CAAC;AAE/D,mCAAmC;AACnC,IAAI,YAAY,GAAkB,IAAI,CAAC;AAEvC,+CAA+C;AAC/C,aAAa;AACb,+CAA+C;AAE/C;;GAEG;AACH,MAAM,UAAU,+BAA+B;IAC7C,IAAI,mBAAmB,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED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AAiB,GAAG,QAAQ,CAAC,GAAG,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI;YACpG,+CAA+C,CAClD,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,4CAA4C,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAS,wBAAwB;IAC/B,IAAI,wBAAwB,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,kBAAkB,EAAE,CAAC;IAErB,IAAI,CAAC;QACH,iEAAiE;QACjE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAuB,CAAC;IACrF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI;YACpG,+CAA+C,CAClD,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,4CAA4C,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,OAAe;IAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,KAAK,CAAC,uBAAuB,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Config - Enhanced project-level configuration
|
|
3
|
+
*
|
|
4
|
+
* Extends the basic .drift/config.json with project identification
|
|
5
|
+
* and metadata that links to the global registry.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* CI/CD configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface CIConfig {
|
|
11
|
+
/** Severity level that causes CI failure */
|
|
12
|
+
failOn: 'error' | 'warning' | 'info' | 'none';
|
|
13
|
+
/** Report format for CI output */
|
|
14
|
+
reportFormat: 'text' | 'json' | 'sarif' | 'github';
|
|
15
|
+
/** Upload results to dashboard */
|
|
16
|
+
uploadResults?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Learning configuration
|
|
20
|
+
*/
|
|
21
|
+
export interface LearningConfig {
|
|
22
|
+
/** Confidence threshold for auto-approval */
|
|
23
|
+
autoApproveThreshold: number;
|
|
24
|
+
/** Minimum occurrences before pattern is considered */
|
|
25
|
+
minOccurrences: number;
|
|
26
|
+
/** Enable semantic learning */
|
|
27
|
+
semanticLearning?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Performance configuration
|
|
31
|
+
*/
|
|
32
|
+
export interface PerformanceConfig {
|
|
33
|
+
/** Maximum parallel workers */
|
|
34
|
+
maxWorkers: number;
|
|
35
|
+
/** Enable caching */
|
|
36
|
+
cacheEnabled: boolean;
|
|
37
|
+
/** Enable incremental analysis */
|
|
38
|
+
incrementalAnalysis: boolean;
|
|
39
|
+
/** Cache TTL in seconds */
|
|
40
|
+
cacheTTL?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Project metadata
|
|
44
|
+
*/
|
|
45
|
+
export interface ProjectMetadata {
|
|
46
|
+
/** Unique project ID (matches registry) */
|
|
47
|
+
id: string;
|
|
48
|
+
/** Project display name */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Project description */
|
|
51
|
+
description?: string | undefined;
|
|
52
|
+
/** Project version */
|
|
53
|
+
version?: string | undefined;
|
|
54
|
+
/** Team or owner */
|
|
55
|
+
team?: string | undefined;
|
|
56
|
+
/** Custom tags */
|
|
57
|
+
tags?: string[] | undefined;
|
|
58
|
+
/** When drift was initialized */
|
|
59
|
+
initializedAt: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Full project configuration
|
|
63
|
+
*/
|
|
64
|
+
export interface ProjectConfig {
|
|
65
|
+
/** Config schema version */
|
|
66
|
+
version: string;
|
|
67
|
+
/** Project metadata */
|
|
68
|
+
project: ProjectMetadata;
|
|
69
|
+
/** Severity overrides by pattern category */
|
|
70
|
+
severity: Record<string, string>;
|
|
71
|
+
/** Glob patterns to ignore */
|
|
72
|
+
ignore: string[];
|
|
73
|
+
/** CI/CD settings */
|
|
74
|
+
ci: CIConfig;
|
|
75
|
+
/** Learning settings */
|
|
76
|
+
learning: LearningConfig;
|
|
77
|
+
/** Performance settings */
|
|
78
|
+
performance: PerformanceConfig;
|
|
79
|
+
/** Custom detector settings */
|
|
80
|
+
detectors?: Record<string, Record<string, unknown>>;
|
|
81
|
+
/** Feature flags */
|
|
82
|
+
features?: {
|
|
83
|
+
callGraph?: boolean;
|
|
84
|
+
boundaries?: boolean;
|
|
85
|
+
dna?: boolean;
|
|
86
|
+
contracts?: boolean;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Legacy config format (without project metadata)
|
|
91
|
+
*/
|
|
92
|
+
export interface LegacyConfig {
|
|
93
|
+
version: string;
|
|
94
|
+
severity: Record<string, string>;
|
|
95
|
+
ignore: string[];
|
|
96
|
+
ci: CIConfig;
|
|
97
|
+
learning: LearningConfig;
|
|
98
|
+
performance: PerformanceConfig;
|
|
99
|
+
}
|
|
100
|
+
export declare function createDefaultConfig(projectPath: string, options?: Partial<ProjectMetadata>): ProjectConfig;
|
|
101
|
+
export declare class ProjectConfigManager {
|
|
102
|
+
private readonly configPath;
|
|
103
|
+
private config;
|
|
104
|
+
constructor(projectRoot: string);
|
|
105
|
+
/**
|
|
106
|
+
* Load configuration from disk
|
|
107
|
+
*/
|
|
108
|
+
load(): Promise<ProjectConfig>;
|
|
109
|
+
/**
|
|
110
|
+
* Save configuration to disk
|
|
111
|
+
*/
|
|
112
|
+
save(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Get current configuration
|
|
115
|
+
*/
|
|
116
|
+
get(): ProjectConfig;
|
|
117
|
+
/**
|
|
118
|
+
* Get project ID
|
|
119
|
+
*/
|
|
120
|
+
getProjectId(): string;
|
|
121
|
+
/**
|
|
122
|
+
* Get project name
|
|
123
|
+
*/
|
|
124
|
+
getProjectName(): string;
|
|
125
|
+
/**
|
|
126
|
+
* Update configuration
|
|
127
|
+
*/
|
|
128
|
+
update(updates: Partial<ProjectConfig>): Promise<ProjectConfig>;
|
|
129
|
+
/**
|
|
130
|
+
* Update project metadata
|
|
131
|
+
*/
|
|
132
|
+
updateMetadata(updates: Partial<Omit<ProjectMetadata, 'id' | 'initializedAt'>>): Promise<ProjectMetadata>;
|
|
133
|
+
/**
|
|
134
|
+
* Check if config exists
|
|
135
|
+
*/
|
|
136
|
+
exists(): Promise<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Initialize new configuration
|
|
139
|
+
*/
|
|
140
|
+
initialize(projectRoot: string, options?: Partial<ProjectMetadata>): Promise<ProjectConfig>;
|
|
141
|
+
/**
|
|
142
|
+
* Migrate legacy config to new format
|
|
143
|
+
*/
|
|
144
|
+
private migrateLegacyConfig;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Create a project config manager
|
|
148
|
+
*/
|
|
149
|
+
export declare function createProjectConfigManager(projectRoot: string): ProjectConfigManager;
|
|
150
|
+
/**
|
|
151
|
+
* Load project config (convenience function)
|
|
152
|
+
*/
|
|
153
|
+
export declare function loadProjectConfig(projectRoot: string): Promise<ProjectConfig>;
|
|
154
|
+
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/store/project-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,4CAA4C;IAC5C,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,kCAAkC;IAClC,YAAY,E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CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAqBrE;;OAEG;IACG,cAAc,CAClB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,eAAe,CAAC,CAAC,GAC9D,OAAO,CAAC,eAAe,CAAC;IAU3B;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAShC;;OAEG;IACG,UAAU,CACd,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACjC,OAAO,CAAC,aAAa,CAAC;IAMzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;CA8B5B;AAMD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,GAClB,oBAAoB,CAEtB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Config - Enhanced project-level configuration
|
|
3
|
+
*
|
|
4
|
+
* Extends the basic .drift/config.json with project identification
|
|
5
|
+
* and metadata that links to the global registry.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs/promises';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import * as crypto from 'node:crypto';
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Constants
|
|
12
|
+
// ============================================================================
|
|
13
|
+
const CONFIG_VERSION = '2.0.0';
|
|
14
|
+
const DRIFT_DIR = '.drift';
|
|
15
|
+
const CONFIG_FILE = 'config.json';
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Default Configuration
|
|
18
|
+
// ============================================================================
|
|
19
|
+
export function createDefaultConfig(projectPath, options) {
|
|
20
|
+
const now = new Date().toISOString();
|
|
21
|
+
return {
|
|
22
|
+
version: CONFIG_VERSION,
|
|
23
|
+
project: {
|
|
24
|
+
id: options?.id ?? crypto.randomUUID(),
|
|
25
|
+
name: options?.name ?? path.basename(projectPath),
|
|
26
|
+
description: options?.description,
|
|
27
|
+
tags: options?.tags,
|
|
28
|
+
initializedAt: now,
|
|
29
|
+
},
|
|
30
|
+
severity: {},
|
|
31
|
+
ignore: [
|
|
32
|
+
'node_modules/**',
|
|
33
|
+
'dist/**',
|
|
34
|
+
'build/**',
|
|
35
|
+
'.git/**',
|
|
36
|
+
'coverage/**',
|
|
37
|
+
'*.min.js',
|
|
38
|
+
'*.bundle.js',
|
|
39
|
+
'vendor/**',
|
|
40
|
+
'__pycache__/**',
|
|
41
|
+
'.venv/**',
|
|
42
|
+
'target/**',
|
|
43
|
+
'bin/**',
|
|
44
|
+
'obj/**',
|
|
45
|
+
],
|
|
46
|
+
ci: {
|
|
47
|
+
failOn: 'error',
|
|
48
|
+
reportFormat: 'text',
|
|
49
|
+
},
|
|
50
|
+
learning: {
|
|
51
|
+
autoApproveThreshold: 0.95,
|
|
52
|
+
minOccurrences: 3,
|
|
53
|
+
semanticLearning: true,
|
|
54
|
+
},
|
|
55
|
+
performance: {
|
|
56
|
+
maxWorkers: 4,
|
|
57
|
+
cacheEnabled: true,
|
|
58
|
+
incrementalAnalysis: true,
|
|
59
|
+
cacheTTL: 3600,
|
|
60
|
+
},
|
|
61
|
+
features: {
|
|
62
|
+
callGraph: true,
|
|
63
|
+
boundaries: true,
|
|
64
|
+
dna: true,
|
|
65
|
+
contracts: true,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// Config Manager
|
|
71
|
+
// ============================================================================
|
|
72
|
+
export class ProjectConfigManager {
|
|
73
|
+
configPath;
|
|
74
|
+
config = null;
|
|
75
|
+
constructor(projectRoot) {
|
|
76
|
+
this.configPath = path.join(projectRoot, DRIFT_DIR, CONFIG_FILE);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Load configuration from disk
|
|
80
|
+
*/
|
|
81
|
+
async load() {
|
|
82
|
+
try {
|
|
83
|
+
const content = await fs.readFile(this.configPath, 'utf-8');
|
|
84
|
+
const data = JSON.parse(content);
|
|
85
|
+
// Check if legacy format
|
|
86
|
+
if (!data.project) {
|
|
87
|
+
// Migrate legacy config
|
|
88
|
+
this.config = this.migrateLegacyConfig(data);
|
|
89
|
+
await this.save();
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.config = data;
|
|
93
|
+
}
|
|
94
|
+
return this.config;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (error.code === 'ENOENT') {
|
|
98
|
+
throw new Error(`Config not found. Run 'drift init' first.`);
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Save configuration to disk
|
|
105
|
+
*/
|
|
106
|
+
async save() {
|
|
107
|
+
if (!this.config) {
|
|
108
|
+
throw new Error('No config loaded');
|
|
109
|
+
}
|
|
110
|
+
await fs.writeFile(this.configPath, JSON.stringify(this.config, null, 2));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get current configuration
|
|
114
|
+
*/
|
|
115
|
+
get() {
|
|
116
|
+
if (!this.config) {
|
|
117
|
+
throw new Error('Config not loaded. Call load() first.');
|
|
118
|
+
}
|
|
119
|
+
return this.config;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get project ID
|
|
123
|
+
*/
|
|
124
|
+
getProjectId() {
|
|
125
|
+
return this.get().project.id;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get project name
|
|
129
|
+
*/
|
|
130
|
+
getProjectName() {
|
|
131
|
+
return this.get().project.name;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Update configuration
|
|
135
|
+
*/
|
|
136
|
+
async update(updates) {
|
|
137
|
+
if (!this.config) {
|
|
138
|
+
throw new Error('Config not loaded. Call load() first.');
|
|
139
|
+
}
|
|
140
|
+
this.config = {
|
|
141
|
+
...this.config,
|
|
142
|
+
...updates,
|
|
143
|
+
version: this.config.version,
|
|
144
|
+
project: {
|
|
145
|
+
...this.config.project,
|
|
146
|
+
...(updates.project ?? {}),
|
|
147
|
+
id: this.config.project.id, // ID cannot be changed
|
|
148
|
+
initializedAt: this.config.project.initializedAt,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
await this.save();
|
|
152
|
+
return this.config;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Update project metadata
|
|
156
|
+
*/
|
|
157
|
+
async updateMetadata(updates) {
|
|
158
|
+
const config = await this.update({
|
|
159
|
+
project: {
|
|
160
|
+
...this.config.project,
|
|
161
|
+
...updates,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
return config.project;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Check if config exists
|
|
168
|
+
*/
|
|
169
|
+
async exists() {
|
|
170
|
+
try {
|
|
171
|
+
await fs.access(this.configPath);
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Initialize new configuration
|
|
180
|
+
*/
|
|
181
|
+
async initialize(projectRoot, options) {
|
|
182
|
+
this.config = createDefaultConfig(projectRoot, options);
|
|
183
|
+
await this.save();
|
|
184
|
+
return this.config;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Migrate legacy config to new format
|
|
188
|
+
*/
|
|
189
|
+
migrateLegacyConfig(legacy) {
|
|
190
|
+
const projectRoot = path.dirname(path.dirname(this.configPath));
|
|
191
|
+
return {
|
|
192
|
+
version: CONFIG_VERSION,
|
|
193
|
+
project: {
|
|
194
|
+
id: crypto.randomUUID(),
|
|
195
|
+
name: path.basename(projectRoot),
|
|
196
|
+
initializedAt: new Date().toISOString(),
|
|
197
|
+
},
|
|
198
|
+
severity: legacy.severity ?? {},
|
|
199
|
+
ignore: legacy.ignore ?? [],
|
|
200
|
+
ci: legacy.ci ?? { failOn: 'error', reportFormat: 'text' },
|
|
201
|
+
learning: legacy.learning ?? {
|
|
202
|
+
autoApproveThreshold: 0.95,
|
|
203
|
+
minOccurrences: 3,
|
|
204
|
+
},
|
|
205
|
+
performance: legacy.performance ?? {
|
|
206
|
+
maxWorkers: 4,
|
|
207
|
+
cacheEnabled: true,
|
|
208
|
+
incrementalAnalysis: true,
|
|
209
|
+
},
|
|
210
|
+
features: {
|
|
211
|
+
callGraph: true,
|
|
212
|
+
boundaries: true,
|
|
213
|
+
dna: true,
|
|
214
|
+
contracts: true,
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// ============================================================================
|
|
220
|
+
// Factory
|
|
221
|
+
// ============================================================================
|
|
222
|
+
/**
|
|
223
|
+
* Create a project config manager
|
|
224
|
+
*/
|
|
225
|
+
export function createProjectConfigManager(projectRoot) {
|
|
226
|
+
return new ProjectConfigManager(projectRoot);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Load project config (convenience function)
|
|
230
|
+
*/
|
|
231
|
+
export async function loadProjectConfig(projectRoot) {
|
|
232
|
+
const manager = new ProjectConfigManager(projectRoot);
|
|
233
|
+
return manager.load();
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=project-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../src/store/project-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAyGtC,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,cAAc,GAAG,OAAO,CAAC;AAC/B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,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