@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/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  analyzeConsistency
4
- } from "./chunk-J5IFYDVU.mjs";
4
+ } from "./chunk-HJCP36VW.mjs";
5
5
 
6
6
  // src/cli.ts
7
7
  import { Command } from "commander";
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?: 'info' | 'minor' | 'major' | 'critical';
11
+ minSeverity?: Severity;
12
12
  }
13
13
  interface ConsistencyIssue extends Issue {
14
- type: 'naming-inconsistency' | 'naming-quality' | 'pattern-inconsistency' | 'architecture-inconsistency';
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: 'poor-naming' | 'convention-mix' | 'abbreviation' | 'unclear';
25
+ type: string;
26
26
  identifier: string;
27
27
  suggestion?: string;
28
- severity: 'critical' | 'major' | 'minor' | 'info';
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: 'critical' | 'major' | 'minor' | 'info';
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: 'critical' | 'major' | 'minor' | 'info';
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
- * AST-based naming analyzer
64
- * Only supports TypeScript/JavaScript files (.ts, .tsx, .js, .jsx)
63
+ * Advanced naming analyzer using TypeScript AST
65
64
  */
66
- declare function analyzeNamingAST(files: string[]): Promise<NamingIssue[]>;
65
+ declare function analyzeNamingAST(filePaths: string[]): Promise<NamingIssue[]>;
67
66
 
68
67
  /**
69
- * Analyzes naming conventions and quality
68
+ * Legacy regex-based naming analyzer
69
+ * (Used as fallback or for languages without AST support)
70
70
  */
71
- declare function analyzeNaming(files: string[]): Promise<NamingIssue[]>;
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
- * Analyzes code pattern consistency
85
+ * Detect inconsistent code patterns across files
86
86
  */
87
- declare function analyzePatterns(files: string[]): Promise<PatternIssue[]>;
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?: 'info' | 'minor' | 'major' | 'critical';
11
+ minSeverity?: Severity;
12
12
  }
13
13
  interface ConsistencyIssue extends Issue {
14
- type: 'naming-inconsistency' | 'naming-quality' | 'pattern-inconsistency' | 'architecture-inconsistency';
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: 'poor-naming' | 'convention-mix' | 'abbreviation' | 'unclear';
25
+ type: string;
26
26
  identifier: string;
27
27
  suggestion?: string;
28
- severity: 'critical' | 'major' | 'minor' | 'info';
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: 'critical' | 'major' | 'minor' | 'info';
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: 'critical' | 'major' | 'minor' | 'info';
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
- * AST-based naming analyzer
64
- * Only supports TypeScript/JavaScript files (.ts, .tsx, .js, .jsx)
63
+ * Advanced naming analyzer using TypeScript AST
65
64
  */
66
- declare function analyzeNamingAST(files: string[]): Promise<NamingIssue[]>;
65
+ declare function analyzeNamingAST(filePaths: string[]): Promise<NamingIssue[]>;
67
66
 
68
67
  /**
69
- * Analyzes naming conventions and quality
68
+ * Legacy regex-based naming analyzer
69
+ * (Used as fallback or for languages without AST support)
70
70
  */
71
- declare function analyzeNaming(files: string[]): Promise<NamingIssue[]>;
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
- * Analyzes code pattern consistency
85
+ * Detect inconsistent code patterns across files
86
86
  */
87
- declare function analyzePatterns(files: string[]): Promise<PatternIssue[]>;
87
+ declare function analyzePatterns(filePaths: string[]): Promise<PatternIssue[]>;
88
88
 
89
89
  /**
90
90
  * Calculate AI Readiness Score for code consistency (0-100)