@archlinter/core 0.7.0-canary.5 → 0.7.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.
- package/index.d.ts +114 -128
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -5,178 +5,164 @@
|
|
|
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
|
|
21
|
-
/** Git history analysis period (e.g. "90d", "1y", "all") */
|
|
22
|
-
gitHistoryPeriod?: string;
|
|
20
|
+
git?: boolean
|
|
23
21
|
}
|
|
24
22
|
export interface JsScanResult {
|
|
25
|
-
smells: Array<JsSmellWithExplanation
|
|
26
|
-
summary: JsSummary
|
|
27
|
-
files: Array<JsFileInfo
|
|
28
|
-
grade: JsArchitectureGrade
|
|
29
|
-
projectPath: string
|
|
23
|
+
smells: Array<JsSmellWithExplanation>
|
|
24
|
+
summary: JsSummary
|
|
25
|
+
files: Array<JsFileInfo>
|
|
26
|
+
grade: JsArchitectureGrade
|
|
27
|
+
projectPath: string
|
|
30
28
|
}
|
|
31
29
|
export interface JsIncrementalResult {
|
|
32
|
-
smells: Array<JsSmellWithExplanation
|
|
33
|
-
affectedFiles: Array<string
|
|
34
|
-
changedCount: number
|
|
35
|
-
affectedCount: number
|
|
36
|
-
analysisTimeMs: number
|
|
30
|
+
smells: Array<JsSmellWithExplanation>
|
|
31
|
+
affectedFiles: Array<string>
|
|
32
|
+
changedCount: number
|
|
33
|
+
affectedCount: number
|
|
34
|
+
analysisTimeMs: number
|
|
37
35
|
}
|
|
38
36
|
export interface JsSmellWithExplanation {
|
|
39
|
-
smell: JsSmell
|
|
40
|
-
explanation: JsExplanation
|
|
37
|
+
smell: JsSmell
|
|
38
|
+
explanation: JsExplanation
|
|
41
39
|
}
|
|
42
40
|
export interface JsSmell {
|
|
43
|
-
smellType: string
|
|
44
|
-
severity: string
|
|
45
|
-
files: Array<string
|
|
46
|
-
locations: Array<JsLocationDetail
|
|
41
|
+
smellType: string
|
|
42
|
+
severity: string
|
|
43
|
+
files: Array<string>
|
|
44
|
+
locations: Array<JsLocationDetail>
|
|
47
45
|
/** Additional metrics as JSON */
|
|
48
|
-
metrics: Record<string, unknown
|
|
49
|
-
cluster?: JsCycleCluster
|
|
46
|
+
metrics: Record<string, unknown>
|
|
47
|
+
cluster?: JsCycleCluster
|
|
50
48
|
}
|
|
51
49
|
export interface JsLocationDetail {
|
|
52
|
-
file: string
|
|
53
|
-
line: number
|
|
54
|
-
column?: number
|
|
55
|
-
range?: JsCodeRange
|
|
56
|
-
description: string
|
|
50
|
+
file: string
|
|
51
|
+
line: number
|
|
52
|
+
column?: number
|
|
53
|
+
range?: JsCodeRange
|
|
54
|
+
description: string
|
|
57
55
|
}
|
|
58
56
|
export interface JsCodeRange {
|
|
59
|
-
startLine: number
|
|
60
|
-
startColumn: number
|
|
61
|
-
endLine: number
|
|
62
|
-
endColumn: number
|
|
57
|
+
startLine: number
|
|
58
|
+
startColumn: number
|
|
59
|
+
endLine: number
|
|
60
|
+
endColumn: number
|
|
63
61
|
}
|
|
64
62
|
export interface JsExplanation {
|
|
65
|
-
problem: string
|
|
66
|
-
reason: string
|
|
67
|
-
risks: Array<string
|
|
68
|
-
recommendations: Array<string
|
|
63
|
+
problem: string
|
|
64
|
+
reason: string
|
|
65
|
+
risks: Array<string>
|
|
66
|
+
recommendations: Array<string>
|
|
69
67
|
}
|
|
70
68
|
export interface JsSummary {
|
|
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
|
|
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
|
|
84
82
|
}
|
|
85
83
|
export interface JsArchitectureGrade {
|
|
86
|
-
score: number
|
|
87
|
-
level: string
|
|
88
|
-
density: number
|
|
84
|
+
score: number
|
|
85
|
+
level: string
|
|
86
|
+
density: number
|
|
89
87
|
}
|
|
90
88
|
export interface JsFileInfo {
|
|
91
|
-
path: string
|
|
92
|
-
relativePath: string
|
|
93
|
-
imports: Array<JsImportInfo
|
|
94
|
-
exports: Array<JsExportInfo
|
|
95
|
-
metrics: JsFileMetrics
|
|
89
|
+
path: string
|
|
90
|
+
relativePath: string
|
|
91
|
+
imports: Array<JsImportInfo>
|
|
92
|
+
exports: Array<JsExportInfo>
|
|
93
|
+
metrics: JsFileMetrics
|
|
96
94
|
}
|
|
97
95
|
export interface JsImportInfo {
|
|
98
|
-
source: string
|
|
99
|
-
names: Array<string
|
|
100
|
-
line: number
|
|
101
|
-
isDefault: boolean
|
|
102
|
-
isNamespace: boolean
|
|
96
|
+
source: string
|
|
97
|
+
names: Array<string>
|
|
98
|
+
line: number
|
|
99
|
+
isDefault: boolean
|
|
100
|
+
isNamespace: boolean
|
|
103
101
|
}
|
|
104
102
|
export interface JsExportInfo {
|
|
105
|
-
name: string
|
|
106
|
-
kind: string
|
|
107
|
-
isDefault: boolean
|
|
108
|
-
source?: string
|
|
103
|
+
name: string
|
|
104
|
+
kind: string
|
|
105
|
+
isDefault: boolean
|
|
106
|
+
source?: string
|
|
109
107
|
}
|
|
110
108
|
export interface JsFileMetrics {
|
|
111
|
-
lines: number
|
|
112
|
-
complexity?: number
|
|
113
|
-
fanIn: number
|
|
114
|
-
fanOut: number
|
|
109
|
+
lines: number
|
|
110
|
+
complexity?: number
|
|
111
|
+
fanIn: number
|
|
112
|
+
fanOut: number
|
|
115
113
|
}
|
|
116
114
|
export interface JsCycleCluster {
|
|
117
|
-
files: Array<string
|
|
118
|
-
hotspots: Array<JsCycleHotspot
|
|
119
|
-
criticalEdges: Array<JsCriticalEdge
|
|
115
|
+
files: Array<string>
|
|
116
|
+
hotspots: Array<JsCycleHotspot>
|
|
117
|
+
criticalEdges: Array<JsCriticalEdge>
|
|
120
118
|
}
|
|
121
119
|
export interface JsCycleHotspot {
|
|
122
|
-
file: string
|
|
123
|
-
inDegree: number
|
|
124
|
-
outDegree: number
|
|
120
|
+
file: string
|
|
121
|
+
inDegree: number
|
|
122
|
+
outDegree: number
|
|
125
123
|
}
|
|
126
124
|
export interface JsCriticalEdge {
|
|
127
|
-
from: string
|
|
128
|
-
to: string
|
|
129
|
-
line: number
|
|
130
|
-
range?: JsCodeRange
|
|
131
|
-
impact: string
|
|
125
|
+
from: string
|
|
126
|
+
to: string
|
|
127
|
+
line: number
|
|
128
|
+
range?: JsCodeRange
|
|
129
|
+
impact: string
|
|
132
130
|
}
|
|
133
131
|
export interface JsDetectorInfo {
|
|
134
|
-
id: string
|
|
135
|
-
name: string
|
|
136
|
-
description: string
|
|
137
|
-
defaultEnabled: boolean
|
|
138
|
-
isDeep: boolean
|
|
132
|
+
id: string
|
|
133
|
+
name: string
|
|
134
|
+
description: string
|
|
135
|
+
defaultEnabled: boolean
|
|
136
|
+
isDeep: boolean
|
|
139
137
|
}
|
|
140
138
|
export interface JsConfig {
|
|
141
|
-
ignore: Array<string
|
|
142
|
-
aliases: Record<string, string
|
|
143
|
-
thresholds: Record<string, unknown
|
|
144
|
-
entryPoints: Array<string
|
|
145
|
-
enableGit: boolean
|
|
139
|
+
ignore: Array<string>
|
|
140
|
+
aliases: Record<string, string>
|
|
141
|
+
thresholds: Record<string, unknown>
|
|
142
|
+
entryPoints: Array<string>
|
|
143
|
+
enableGit: boolean
|
|
146
144
|
}
|
|
147
145
|
export interface JsStateStats {
|
|
148
|
-
filesCount: number
|
|
149
|
-
graphNodes: number
|
|
150
|
-
graphEdges: number
|
|
151
|
-
}
|
|
152
|
-
export declare function scan(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
):
|
|
156
|
-
export declare function
|
|
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;
|
|
146
|
+
filesCount: number
|
|
147
|
+
graphNodes: number
|
|
148
|
+
graphEdges: number
|
|
149
|
+
}
|
|
150
|
+
export declare function scan(path: string, options?: JsScanOptions | undefined | null): Promise<JsScanResult>
|
|
151
|
+
export declare function scanSync(path: string, options?: JsScanOptions | undefined | null): JsScanResult
|
|
152
|
+
export declare function loadConfig(path?: string | undefined | null): JsConfig
|
|
153
|
+
export declare function getDetectors(): Array<JsDetectorInfo>
|
|
154
|
+
export declare function clearCache(path: string): void
|
|
163
155
|
export declare class ArchlintAnalyzer {
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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;
|
|
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(changedFiles: Array<string>, overlays: Record<string, string>): JsIncrementalResult
|
|
162
|
+
scanIncrementalWithOverlay(changedFiles: Array<string>, overlays: Record<string, string>): Promise<JsIncrementalResult>
|
|
163
|
+
invalidate(files: Array<string>): void
|
|
164
|
+
rescan(): Promise<JsScanResult>
|
|
165
|
+
rescanSync(): JsScanResult
|
|
166
|
+
getAffectedFiles(changedFiles: Array<string>): Array<string>
|
|
167
|
+
getStateStats(): JsStateStats
|
|
182
168
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archlinter/core",
|
|
3
|
-
"version": "0.7.0
|
|
3
|
+
"version": "0.7.0",
|
|
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
|
|
31
|
-
"@archlinter/core-darwin-x64": "0.7.0
|
|
32
|
-
"@archlinter/core-linux-x64-gnu": "0.7.0
|
|
33
|
-
"@archlinter/core-linux-x64-musl": "0.7.0
|
|
34
|
-
"@archlinter/core-linux-arm64-gnu": "0.7.0
|
|
35
|
-
"@archlinter/core-darwin-arm64": "0.7.0
|
|
30
|
+
"@archlinter/core-win32-x64-msvc": "0.7.0",
|
|
31
|
+
"@archlinter/core-darwin-x64": "0.7.0",
|
|
32
|
+
"@archlinter/core-linux-x64-gnu": "0.7.0",
|
|
33
|
+
"@archlinter/core-linux-x64-musl": "0.7.0",
|
|
34
|
+
"@archlinter/core-linux-arm64-gnu": "0.7.0",
|
|
35
|
+
"@archlinter/core-darwin-arm64": "0.7.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18"
|