@aiready/consistency 0.16.2 → 0.16.3
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/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-test.log +12 -10
- package/dist/chunk-AASFXGUR.mjs +1622 -0
- package/dist/chunk-AR7DIZLP.mjs +827 -0
- package/dist/chunk-BMILMNKJ.mjs +1633 -0
- package/dist/chunk-HJCP36VW.mjs +821 -0
- package/dist/chunk-QOIPVP6P.mjs +1607 -0
- package/dist/chunk-RMEQWG52.mjs +1633 -0
- package/dist/chunk-XVW5DKJQ.mjs +1619 -0
- package/dist/cli.js +277 -1019
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +320 -1242
- package/dist/index.mjs +58 -230
- package/package.json +2 -2
- package/src/__tests__/contract.test.ts +18 -2
- package/src/analyzer.ts +49 -28
- package/src/analyzers/naming-ast.ts +188 -328
- package/src/analyzers/naming.ts +52 -365
- package/src/analyzers/patterns.ts +51 -228
- package/src/types.ts +10 -10
- package/src/utils/context-detector.ts +23 -10
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
1
|
+
import { Severity, Issue, IssueType, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
2
2
|
|
|
3
3
|
interface ConsistencyOptions extends ScanOptions {
|
|
4
4
|
/** Check naming conventions and quality */
|
|
@@ -8,10 +8,10 @@ interface ConsistencyOptions extends ScanOptions {
|
|
|
8
8
|
/** Check architectural consistency */
|
|
9
9
|
checkArchitecture?: boolean;
|
|
10
10
|
/** Minimum severity to report */
|
|
11
|
-
minSeverity?:
|
|
11
|
+
minSeverity?: Severity;
|
|
12
12
|
}
|
|
13
13
|
interface ConsistencyIssue extends Issue {
|
|
14
|
-
type:
|
|
14
|
+
type: IssueType.NamingInconsistency | IssueType.NamingQuality | IssueType.PatternInconsistency | IssueType.ArchitectureInconsistency;
|
|
15
15
|
category: 'naming' | 'patterns' | 'architecture';
|
|
16
16
|
/** Examples of the inconsistency found */
|
|
17
17
|
examples?: string[];
|
|
@@ -22,10 +22,10 @@ interface NamingIssue {
|
|
|
22
22
|
file: string;
|
|
23
23
|
line: number;
|
|
24
24
|
column?: number;
|
|
25
|
-
type:
|
|
25
|
+
type: string;
|
|
26
26
|
identifier: string;
|
|
27
27
|
suggestion?: string;
|
|
28
|
-
severity:
|
|
28
|
+
severity: Severity;
|
|
29
29
|
category?: 'naming';
|
|
30
30
|
}
|
|
31
31
|
interface PatternIssue {
|
|
@@ -33,13 +33,13 @@ interface PatternIssue {
|
|
|
33
33
|
type: 'error-handling' | 'async-style' | 'import-style' | 'api-design';
|
|
34
34
|
description: string;
|
|
35
35
|
examples: string[];
|
|
36
|
-
severity:
|
|
36
|
+
severity: Severity;
|
|
37
37
|
}
|
|
38
38
|
interface ArchitectureIssue {
|
|
39
39
|
type: 'file-organization' | 'module-structure' | 'export-style';
|
|
40
40
|
description: string;
|
|
41
41
|
affectedPaths: string[];
|
|
42
|
-
severity:
|
|
42
|
+
severity: Severity;
|
|
43
43
|
}
|
|
44
44
|
interface ConsistencyReport {
|
|
45
45
|
summary: {
|
|
@@ -60,15 +60,15 @@ interface ConsistencyReport {
|
|
|
60
60
|
declare function analyzeConsistency(options: ConsistencyOptions): Promise<ConsistencyReport>;
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
* Only supports TypeScript/JavaScript files (.ts, .tsx, .js, .jsx)
|
|
63
|
+
* Advanced naming analyzer using TypeScript AST
|
|
65
64
|
*/
|
|
66
|
-
declare function analyzeNamingAST(
|
|
65
|
+
declare function analyzeNamingAST(filePaths: string[]): Promise<NamingIssue[]>;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
|
-
*
|
|
68
|
+
* Legacy regex-based naming analyzer
|
|
69
|
+
* (Used as fallback or for languages without AST support)
|
|
70
70
|
*/
|
|
71
|
-
declare function analyzeNaming(
|
|
71
|
+
declare function analyzeNaming(filePaths: string[]): Promise<NamingIssue[]>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Detect naming convention patterns across the codebase
|
|
@@ -82,9 +82,9 @@ declare function detectNamingConventions(files: string[], allIssues: Array<{
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Detect inconsistent code patterns across files
|
|
86
86
|
*/
|
|
87
|
-
declare function analyzePatterns(
|
|
87
|
+
declare function analyzePatterns(filePaths: string[]): Promise<PatternIssue[]>;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Calculate AI Readiness Score for code consistency (0-100)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Issue, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
1
|
+
import { Severity, Issue, IssueType, ScanOptions, AnalysisResult, CostConfig, ToolScoringOutput } from '@aiready/core';
|
|
2
2
|
|
|
3
3
|
interface ConsistencyOptions extends ScanOptions {
|
|
4
4
|
/** Check naming conventions and quality */
|
|
@@ -8,10 +8,10 @@ interface ConsistencyOptions extends ScanOptions {
|
|
|
8
8
|
/** Check architectural consistency */
|
|
9
9
|
checkArchitecture?: boolean;
|
|
10
10
|
/** Minimum severity to report */
|
|
11
|
-
minSeverity?:
|
|
11
|
+
minSeverity?: Severity;
|
|
12
12
|
}
|
|
13
13
|
interface ConsistencyIssue extends Issue {
|
|
14
|
-
type:
|
|
14
|
+
type: IssueType.NamingInconsistency | IssueType.NamingQuality | IssueType.PatternInconsistency | IssueType.ArchitectureInconsistency;
|
|
15
15
|
category: 'naming' | 'patterns' | 'architecture';
|
|
16
16
|
/** Examples of the inconsistency found */
|
|
17
17
|
examples?: string[];
|
|
@@ -22,10 +22,10 @@ interface NamingIssue {
|
|
|
22
22
|
file: string;
|
|
23
23
|
line: number;
|
|
24
24
|
column?: number;
|
|
25
|
-
type:
|
|
25
|
+
type: string;
|
|
26
26
|
identifier: string;
|
|
27
27
|
suggestion?: string;
|
|
28
|
-
severity:
|
|
28
|
+
severity: Severity;
|
|
29
29
|
category?: 'naming';
|
|
30
30
|
}
|
|
31
31
|
interface PatternIssue {
|
|
@@ -33,13 +33,13 @@ interface PatternIssue {
|
|
|
33
33
|
type: 'error-handling' | 'async-style' | 'import-style' | 'api-design';
|
|
34
34
|
description: string;
|
|
35
35
|
examples: string[];
|
|
36
|
-
severity:
|
|
36
|
+
severity: Severity;
|
|
37
37
|
}
|
|
38
38
|
interface ArchitectureIssue {
|
|
39
39
|
type: 'file-organization' | 'module-structure' | 'export-style';
|
|
40
40
|
description: string;
|
|
41
41
|
affectedPaths: string[];
|
|
42
|
-
severity:
|
|
42
|
+
severity: Severity;
|
|
43
43
|
}
|
|
44
44
|
interface ConsistencyReport {
|
|
45
45
|
summary: {
|
|
@@ -60,15 +60,15 @@ interface ConsistencyReport {
|
|
|
60
60
|
declare function analyzeConsistency(options: ConsistencyOptions): Promise<ConsistencyReport>;
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
64
|
-
* Only supports TypeScript/JavaScript files (.ts, .tsx, .js, .jsx)
|
|
63
|
+
* Advanced naming analyzer using TypeScript AST
|
|
65
64
|
*/
|
|
66
|
-
declare function analyzeNamingAST(
|
|
65
|
+
declare function analyzeNamingAST(filePaths: string[]): Promise<NamingIssue[]>;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
|
-
*
|
|
68
|
+
* Legacy regex-based naming analyzer
|
|
69
|
+
* (Used as fallback or for languages without AST support)
|
|
70
70
|
*/
|
|
71
|
-
declare function analyzeNaming(
|
|
71
|
+
declare function analyzeNaming(filePaths: string[]): Promise<NamingIssue[]>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Detect naming convention patterns across the codebase
|
|
@@ -82,9 +82,9 @@ declare function detectNamingConventions(files: string[], allIssues: Array<{
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Detect inconsistent code patterns across files
|
|
86
86
|
*/
|
|
87
|
-
declare function analyzePatterns(
|
|
87
|
+
declare function analyzePatterns(filePaths: string[]): Promise<PatternIssue[]>;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Calculate AI Readiness Score for code consistency (0-100)
|