@archlinter/core 0.7.0-canary.2 → 0.7.0-canary.5
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/index.d.ts +128 -114
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -5,164 +5,178 @@
|
|
|
5
5
|
|
|
6
6
|
export interface JsScanOptions {
|
|
7
7
|
/** Path to config file */
|
|
8
|
-
configPath?: string
|
|
8
|
+
configPath?: string;
|
|
9
9
|
/** Only run these detectors (by ID) */
|
|
10
|
-
detectors?: Array<string
|
|
10
|
+
detectors?: Array<string>;
|
|
11
11
|
/** Exclude these detectors (by ID) */
|
|
12
|
-
excludeDetectors?: Array<string
|
|
12
|
+
excludeDetectors?: Array<string>;
|
|
13
13
|
/** Minimum severity to report */
|
|
14
|
-
minSeverity?: string
|
|
14
|
+
minSeverity?: string;
|
|
15
15
|
/** Minimum score to report */
|
|
16
|
-
minScore?: number
|
|
16
|
+
minScore?: number;
|
|
17
17
|
/** Enable caching (default: true) */
|
|
18
|
-
cache?: boolean
|
|
18
|
+
cache?: boolean;
|
|
19
19
|
/** Enable git integration (default: true) */
|
|
20
|
-
git?: boolean
|
|
20
|
+
git?: boolean;
|
|
21
|
+
/** Git history analysis period (e.g. "90d", "1y", "all") */
|
|
22
|
+
gitHistoryPeriod?: string;
|
|
21
23
|
}
|
|
22
24
|
export interface JsScanResult {
|
|
23
|
-
smells: Array<JsSmellWithExplanation
|
|
24
|
-
summary: JsSummary
|
|
25
|
-
files: Array<JsFileInfo
|
|
26
|
-
grade: JsArchitectureGrade
|
|
27
|
-
projectPath: string
|
|
25
|
+
smells: Array<JsSmellWithExplanation>;
|
|
26
|
+
summary: JsSummary;
|
|
27
|
+
files: Array<JsFileInfo>;
|
|
28
|
+
grade: JsArchitectureGrade;
|
|
29
|
+
projectPath: string;
|
|
28
30
|
}
|
|
29
31
|
export interface JsIncrementalResult {
|
|
30
|
-
smells: Array<JsSmellWithExplanation
|
|
31
|
-
affectedFiles: Array<string
|
|
32
|
-
changedCount: number
|
|
33
|
-
affectedCount: number
|
|
34
|
-
analysisTimeMs: number
|
|
32
|
+
smells: Array<JsSmellWithExplanation>;
|
|
33
|
+
affectedFiles: Array<string>;
|
|
34
|
+
changedCount: number;
|
|
35
|
+
affectedCount: number;
|
|
36
|
+
analysisTimeMs: number;
|
|
35
37
|
}
|
|
36
38
|
export interface JsSmellWithExplanation {
|
|
37
|
-
smell: JsSmell
|
|
38
|
-
explanation: JsExplanation
|
|
39
|
+
smell: JsSmell;
|
|
40
|
+
explanation: JsExplanation;
|
|
39
41
|
}
|
|
40
42
|
export interface JsSmell {
|
|
41
|
-
smellType: string
|
|
42
|
-
severity: string
|
|
43
|
-
files: Array<string
|
|
44
|
-
locations: Array<JsLocationDetail
|
|
43
|
+
smellType: string;
|
|
44
|
+
severity: string;
|
|
45
|
+
files: Array<string>;
|
|
46
|
+
locations: Array<JsLocationDetail>;
|
|
45
47
|
/** Additional metrics as JSON */
|
|
46
|
-
metrics: Record<string, unknown
|
|
47
|
-
cluster?: JsCycleCluster
|
|
48
|
+
metrics: Record<string, unknown>;
|
|
49
|
+
cluster?: JsCycleCluster;
|
|
48
50
|
}
|
|
49
51
|
export interface JsLocationDetail {
|
|
50
|
-
file: string
|
|
51
|
-
line: number
|
|
52
|
-
column?: number
|
|
53
|
-
range?: JsCodeRange
|
|
54
|
-
description: string
|
|
52
|
+
file: string;
|
|
53
|
+
line: number;
|
|
54
|
+
column?: number;
|
|
55
|
+
range?: JsCodeRange;
|
|
56
|
+
description: string;
|
|
55
57
|
}
|
|
56
58
|
export interface JsCodeRange {
|
|
57
|
-
startLine: number
|
|
58
|
-
startColumn: number
|
|
59
|
-
endLine: number
|
|
60
|
-
endColumn: number
|
|
59
|
+
startLine: number;
|
|
60
|
+
startColumn: number;
|
|
61
|
+
endLine: number;
|
|
62
|
+
endColumn: number;
|
|
61
63
|
}
|
|
62
64
|
export interface JsExplanation {
|
|
63
|
-
problem: string
|
|
64
|
-
reason: string
|
|
65
|
-
risks: Array<string
|
|
66
|
-
recommendations: Array<string
|
|
65
|
+
problem: string;
|
|
66
|
+
reason: string;
|
|
67
|
+
risks: Array<string>;
|
|
68
|
+
recommendations: Array<string>;
|
|
67
69
|
}
|
|
68
70
|
export interface JsSummary {
|
|
69
|
-
filesAnalyzed: number
|
|
70
|
-
totalSmells: number
|
|
71
|
-
cyclicDependencies: number
|
|
72
|
-
cycleClusters: number
|
|
73
|
-
filesInCycles: number
|
|
74
|
-
godModules: number
|
|
75
|
-
deadCode: number
|
|
76
|
-
deadSymbols: number
|
|
77
|
-
highComplexityFunctions: number
|
|
78
|
-
unstableInterfaces: number
|
|
79
|
-
featureEnvy: number
|
|
80
|
-
shotgunSurgery: number
|
|
81
|
-
hubDependencies: number
|
|
71
|
+
filesAnalyzed: number;
|
|
72
|
+
totalSmells: number;
|
|
73
|
+
cyclicDependencies: number;
|
|
74
|
+
cycleClusters: number;
|
|
75
|
+
filesInCycles: number;
|
|
76
|
+
godModules: number;
|
|
77
|
+
deadCode: number;
|
|
78
|
+
deadSymbols: number;
|
|
79
|
+
highComplexityFunctions: number;
|
|
80
|
+
unstableInterfaces: number;
|
|
81
|
+
featureEnvy: number;
|
|
82
|
+
shotgunSurgery: number;
|
|
83
|
+
hubDependencies: number;
|
|
82
84
|
}
|
|
83
85
|
export interface JsArchitectureGrade {
|
|
84
|
-
score: number
|
|
85
|
-
level: string
|
|
86
|
-
density: number
|
|
86
|
+
score: number;
|
|
87
|
+
level: string;
|
|
88
|
+
density: number;
|
|
87
89
|
}
|
|
88
90
|
export interface JsFileInfo {
|
|
89
|
-
path: string
|
|
90
|
-
relativePath: string
|
|
91
|
-
imports: Array<JsImportInfo
|
|
92
|
-
exports: Array<JsExportInfo
|
|
93
|
-
metrics: JsFileMetrics
|
|
91
|
+
path: string;
|
|
92
|
+
relativePath: string;
|
|
93
|
+
imports: Array<JsImportInfo>;
|
|
94
|
+
exports: Array<JsExportInfo>;
|
|
95
|
+
metrics: JsFileMetrics;
|
|
94
96
|
}
|
|
95
97
|
export interface JsImportInfo {
|
|
96
|
-
source: string
|
|
97
|
-
names: Array<string
|
|
98
|
-
line: number
|
|
99
|
-
isDefault: boolean
|
|
100
|
-
isNamespace: boolean
|
|
98
|
+
source: string;
|
|
99
|
+
names: Array<string>;
|
|
100
|
+
line: number;
|
|
101
|
+
isDefault: boolean;
|
|
102
|
+
isNamespace: boolean;
|
|
101
103
|
}
|
|
102
104
|
export interface JsExportInfo {
|
|
103
|
-
name: string
|
|
104
|
-
kind: string
|
|
105
|
-
isDefault: boolean
|
|
106
|
-
source?: string
|
|
105
|
+
name: string;
|
|
106
|
+
kind: string;
|
|
107
|
+
isDefault: boolean;
|
|
108
|
+
source?: string;
|
|
107
109
|
}
|
|
108
110
|
export interface JsFileMetrics {
|
|
109
|
-
lines: number
|
|
110
|
-
complexity?: number
|
|
111
|
-
fanIn: number
|
|
112
|
-
fanOut: number
|
|
111
|
+
lines: number;
|
|
112
|
+
complexity?: number;
|
|
113
|
+
fanIn: number;
|
|
114
|
+
fanOut: number;
|
|
113
115
|
}
|
|
114
116
|
export interface JsCycleCluster {
|
|
115
|
-
files: Array<string
|
|
116
|
-
hotspots: Array<JsCycleHotspot
|
|
117
|
-
criticalEdges: Array<JsCriticalEdge
|
|
117
|
+
files: Array<string>;
|
|
118
|
+
hotspots: Array<JsCycleHotspot>;
|
|
119
|
+
criticalEdges: Array<JsCriticalEdge>;
|
|
118
120
|
}
|
|
119
121
|
export interface JsCycleHotspot {
|
|
120
|
-
file: string
|
|
121
|
-
inDegree: number
|
|
122
|
-
outDegree: number
|
|
122
|
+
file: string;
|
|
123
|
+
inDegree: number;
|
|
124
|
+
outDegree: number;
|
|
123
125
|
}
|
|
124
126
|
export interface JsCriticalEdge {
|
|
125
|
-
from: string
|
|
126
|
-
to: string
|
|
127
|
-
line: number
|
|
128
|
-
range?: JsCodeRange
|
|
129
|
-
impact: string
|
|
127
|
+
from: string;
|
|
128
|
+
to: string;
|
|
129
|
+
line: number;
|
|
130
|
+
range?: JsCodeRange;
|
|
131
|
+
impact: string;
|
|
130
132
|
}
|
|
131
133
|
export interface JsDetectorInfo {
|
|
132
|
-
id: string
|
|
133
|
-
name: string
|
|
134
|
-
description: string
|
|
135
|
-
defaultEnabled: boolean
|
|
136
|
-
isDeep: boolean
|
|
134
|
+
id: string;
|
|
135
|
+
name: string;
|
|
136
|
+
description: string;
|
|
137
|
+
defaultEnabled: boolean;
|
|
138
|
+
isDeep: boolean;
|
|
137
139
|
}
|
|
138
140
|
export interface JsConfig {
|
|
139
|
-
ignore: Array<string
|
|
140
|
-
aliases: Record<string, string
|
|
141
|
-
thresholds: Record<string, unknown
|
|
142
|
-
entryPoints: Array<string
|
|
143
|
-
enableGit: boolean
|
|
141
|
+
ignore: Array<string>;
|
|
142
|
+
aliases: Record<string, string>;
|
|
143
|
+
thresholds: Record<string, unknown>;
|
|
144
|
+
entryPoints: Array<string>;
|
|
145
|
+
enableGit: boolean;
|
|
144
146
|
}
|
|
145
147
|
export interface JsStateStats {
|
|
146
|
-
filesCount: number
|
|
147
|
-
graphNodes: number
|
|
148
|
-
graphEdges: number
|
|
149
|
-
}
|
|
150
|
-
export declare function scan(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
export declare function
|
|
148
|
+
filesCount: number;
|
|
149
|
+
graphNodes: number;
|
|
150
|
+
graphEdges: number;
|
|
151
|
+
}
|
|
152
|
+
export declare function scan(
|
|
153
|
+
path: string,
|
|
154
|
+
options?: JsScanOptions | undefined | null
|
|
155
|
+
): Promise<JsScanResult>;
|
|
156
|
+
export declare function scanSync(
|
|
157
|
+
path: string,
|
|
158
|
+
options?: JsScanOptions | undefined | null
|
|
159
|
+
): JsScanResult;
|
|
160
|
+
export declare function loadConfig(path?: string | undefined | null): JsConfig;
|
|
161
|
+
export declare function getDetectors(): Array<JsDetectorInfo>;
|
|
162
|
+
export declare function clearCache(path: string): void;
|
|
155
163
|
export declare class ArchlintAnalyzer {
|
|
156
|
-
constructor(path: string, options?: JsScanOptions | undefined | null)
|
|
157
|
-
scan(): Promise<JsScanResult
|
|
158
|
-
scanIncremental(changedFiles: Array<string>): Promise<JsIncrementalResult
|
|
159
|
-
scanSync(): JsScanResult
|
|
160
|
-
scanIncrementalSync(changedFiles: Array<string>): JsIncrementalResult
|
|
161
|
-
scanIncrementalWithOverlaySync(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
constructor(path: string, options?: JsScanOptions | undefined | null);
|
|
165
|
+
scan(): Promise<JsScanResult>;
|
|
166
|
+
scanIncremental(changedFiles: Array<string>): Promise<JsIncrementalResult>;
|
|
167
|
+
scanSync(): JsScanResult;
|
|
168
|
+
scanIncrementalSync(changedFiles: Array<string>): JsIncrementalResult;
|
|
169
|
+
scanIncrementalWithOverlaySync(
|
|
170
|
+
changedFiles: Array<string>,
|
|
171
|
+
overlays: Record<string, string>
|
|
172
|
+
): JsIncrementalResult;
|
|
173
|
+
scanIncrementalWithOverlay(
|
|
174
|
+
changedFiles: Array<string>,
|
|
175
|
+
overlays: Record<string, string>
|
|
176
|
+
): Promise<JsIncrementalResult>;
|
|
177
|
+
invalidate(files: Array<string>): void;
|
|
178
|
+
rescan(): Promise<JsScanResult>;
|
|
179
|
+
rescanSync(): JsScanResult;
|
|
180
|
+
getAffectedFiles(changedFiles: Array<string>): Array<string>;
|
|
181
|
+
getStateStats(): JsStateStats;
|
|
168
182
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archlinter/core",
|
|
3
|
-
"version": "0.7.0-canary.
|
|
3
|
+
"version": "0.7.0-canary.5",
|
|
4
4
|
"description": "Core library for archlint - programmatic API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"@archlinter/core-win32-x64-msvc": "0.7.0-canary.
|
|
31
|
-
"@archlinter/core-darwin-x64": "0.7.0-canary.
|
|
32
|
-
"@archlinter/core-linux-x64-gnu": "0.7.0-canary.
|
|
33
|
-
"@archlinter/core-linux-x64-musl": "0.7.0-canary.
|
|
34
|
-
"@archlinter/core-linux-arm64-gnu": "0.7.0-canary.
|
|
35
|
-
"@archlinter/core-darwin-arm64": "0.7.0-canary.
|
|
30
|
+
"@archlinter/core-win32-x64-msvc": "0.7.0-canary.5",
|
|
31
|
+
"@archlinter/core-darwin-x64": "0.7.0-canary.5",
|
|
32
|
+
"@archlinter/core-linux-x64-gnu": "0.7.0-canary.5",
|
|
33
|
+
"@archlinter/core-linux-x64-musl": "0.7.0-canary.5",
|
|
34
|
+
"@archlinter/core-linux-arm64-gnu": "0.7.0-canary.5",
|
|
35
|
+
"@archlinter/core-darwin-arm64": "0.7.0-canary.5"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18"
|