@eduardbar/drift 0.2.3 → 0.4.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/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +39 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +46 -0
- package/AGENTS.md +229 -0
- package/CHANGELOG.md +105 -0
- package/CODE_OF_CONDUCT.md +30 -0
- package/CONTRIBUTING.md +125 -0
- package/LICENSE +21 -0
- package/README.md +89 -7
- package/ROADMAP.md +213 -0
- package/assets/og-v030-linkedin.png +0 -0
- package/assets/og-v030-linkedin.svg +120 -0
- package/assets/og-v030-x.png +0 -0
- package/assets/og-v030-x.svg +94 -0
- package/content-v030.txt +165 -0
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.js +630 -2
- package/dist/cli.js +61 -5
- package/dist/config.d.ts +12 -0
- package/dist/config.js +40 -0
- package/dist/diff.d.ts +10 -0
- package/dist/diff.js +58 -0
- package/dist/git.d.ts +19 -0
- package/dist/git.js +84 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/printer.d.ts +5 -2
- package/dist/printer.js +157 -2
- package/dist/reporter.d.ts +2 -1
- package/dist/reporter.js +86 -0
- package/dist/types.d.ts +70 -0
- package/package.json +9 -1
- package/src/analyzer.ts +688 -3
- package/src/cli.ts +66 -5
- package/src/config.ts +45 -0
- package/src/diff.ts +74 -0
- package/src/git.ts +98 -0
- package/src/index.ts +2 -1
- package/src/printer.ts +175 -3
- package/src/reporter.ts +94 -1
- package/src/types.ts +85 -0
package/dist/types.d.ts
CHANGED
|
@@ -25,4 +25,74 @@ export interface DriftReport {
|
|
|
25
25
|
byRule: Record<string, number>;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
export interface AIOutput {
|
|
29
|
+
summary: {
|
|
30
|
+
score: number;
|
|
31
|
+
grade: string;
|
|
32
|
+
total_issues: number;
|
|
33
|
+
files_affected: number;
|
|
34
|
+
files_clean: number;
|
|
35
|
+
};
|
|
36
|
+
priority_order: AIIssue[];
|
|
37
|
+
context_for_ai: {
|
|
38
|
+
project_type: string;
|
|
39
|
+
scan_path: string;
|
|
40
|
+
rules_detected: string[];
|
|
41
|
+
recommended_action: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface AIIssue {
|
|
45
|
+
rank: number;
|
|
46
|
+
file: string;
|
|
47
|
+
line: number;
|
|
48
|
+
rule: string;
|
|
49
|
+
severity: string;
|
|
50
|
+
message: string;
|
|
51
|
+
snippet: string;
|
|
52
|
+
fix_suggestion: string;
|
|
53
|
+
effort: 'low' | 'medium' | 'high';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Layer definition for architectural boundary enforcement.
|
|
57
|
+
*/
|
|
58
|
+
export interface LayerDefinition {
|
|
59
|
+
name: string;
|
|
60
|
+
patterns: string[];
|
|
61
|
+
canImportFrom: string[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Module boundary definition for cross-boundary enforcement.
|
|
65
|
+
*/
|
|
66
|
+
export interface ModuleBoundary {
|
|
67
|
+
name: string;
|
|
68
|
+
root: string;
|
|
69
|
+
allowedExternalImports?: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Optional project-level configuration for drift.
|
|
73
|
+
* Place in drift.config.ts (or .js / .json) at the project root.
|
|
74
|
+
*/
|
|
75
|
+
export interface DriftConfig {
|
|
76
|
+
layers?: LayerDefinition[];
|
|
77
|
+
modules?: ModuleBoundary[];
|
|
78
|
+
}
|
|
79
|
+
export interface FileDiff {
|
|
80
|
+
path: string;
|
|
81
|
+
scoreBefore: number;
|
|
82
|
+
scoreAfter: number;
|
|
83
|
+
scoreDelta: number;
|
|
84
|
+
newIssues: DriftIssue[];
|
|
85
|
+
resolvedIssues: DriftIssue[];
|
|
86
|
+
}
|
|
87
|
+
export interface DriftDiff {
|
|
88
|
+
baseRef: string;
|
|
89
|
+
projectPath: string;
|
|
90
|
+
scannedAt: string;
|
|
91
|
+
files: FileDiff[];
|
|
92
|
+
totalScoreBefore: number;
|
|
93
|
+
totalScoreAfter: number;
|
|
94
|
+
totalDelta: number;
|
|
95
|
+
newIssuesCount: number;
|
|
96
|
+
resolvedIssuesCount: number;
|
|
97
|
+
}
|
|
28
98
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eduardbar/drift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Detect silent technical debt left by AI-generated code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,6 +23,14 @@
|
|
|
23
23
|
],
|
|
24
24
|
"author": "eduardbar",
|
|
25
25
|
"license": "MIT",
|
|
26
|
+
"homepage": "https://github.com/eduardbar/drift#readme",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/eduardbar/drift.git"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/eduardbar/drift/issues"
|
|
33
|
+
},
|
|
26
34
|
"dependencies": {
|
|
27
35
|
"commander": "^14.0.3",
|
|
28
36
|
"kleur": "^4.1.5",
|