driftdetect 0.7.0 → 0.8.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/dist/bin/drift.d.ts +11 -0
- package/dist/bin/drift.js +26 -1
- package/dist/bin/drift.js.map +1 -1
- package/dist/commands/approve.d.ts +2 -0
- package/dist/commands/approve.d.ts.map +1 -1
- package/dist/commands/approve.js +92 -1
- package/dist/commands/approve.js.map +1 -1
- package/dist/commands/boundaries.d.ts +20 -0
- package/dist/commands/callgraph.d.ts.map +1 -1
- package/dist/commands/callgraph.js +42 -52
- package/dist/commands/callgraph.js.map +1 -1
- package/dist/commands/constraints.d.ts.map +1 -1
- package/dist/commands/constraints.js +8 -7
- package/dist/commands/constraints.js.map +1 -1
- package/dist/commands/context.d.ts +19 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +301 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/cpp.d.ts +22 -0
- package/dist/commands/cpp.d.ts.map +1 -0
- package/dist/commands/cpp.js +485 -0
- package/dist/commands/cpp.js.map +1 -0
- package/dist/commands/dashboard.d.ts +16 -0
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +3 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/dna/export.d.ts +6 -0
- package/dist/commands/dna/gene.d.ts +6 -0
- package/dist/commands/dna/index.d.ts +8 -0
- package/dist/commands/dna/mutations.d.ts +6 -0
- package/dist/commands/dna/playbook.d.ts +6 -0
- package/dist/commands/dna/scan.d.ts +6 -0
- package/dist/commands/dna/status.d.ts +6 -0
- package/dist/commands/gate.d.ts +33 -0
- package/dist/commands/gate.d.ts.map +1 -0
- package/dist/commands/gate.js +199 -0
- package/dist/commands/gate.js.map +1 -0
- package/dist/commands/ignore.d.ts.map +1 -1
- package/dist/commands/ignore.js +36 -0
- package/dist/commands/ignore.js.map +1 -1
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +12 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +19 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +41 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/license.d.ts +12 -0
- package/dist/commands/license.d.ts.map +1 -0
- package/dist/commands/license.js +133 -0
- package/dist/commands/license.js.map +1 -0
- package/dist/commands/parser.d.ts +20 -0
- package/dist/commands/rust.d.ts +21 -0
- package/dist/commands/rust.d.ts.map +1 -0
- package/dist/commands/rust.js +526 -0
- package/dist/commands/rust.js.map +1 -0
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +69 -1
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/simulate.d.ts.map +1 -1
- package/dist/commands/simulate.js +22 -1
- package/dist/commands/simulate.js.map +1 -1
- package/dist/commands/telemetry.d.ts +9 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +289 -0
- package/dist/commands/telemetry.js.map +1 -0
- package/dist/commands/trends.d.ts +12 -0
- package/dist/commands/watch.d.ts +13 -0
- package/dist/git/hooks.d.ts +108 -0
- package/dist/git/index.d.ts +6 -0
- package/dist/git/staged-files.d.ts +41 -0
- package/dist/reporters/github-reporter.d.ts +13 -0
- package/dist/reporters/gitlab-reporter.d.ts +16 -0
- package/dist/reporters/index.d.ts +9 -0
- package/dist/reporters/json-reporter.d.ts +13 -0
- package/dist/reporters/text-reporter.d.ts +13 -0
- package/dist/reporters/types.d.ts +42 -0
- package/dist/services/boundary-scanner.d.ts +21 -0
- package/dist/services/contract-scanner.d.ts +35 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/progress.d.ts +115 -0
- package/dist/ui/prompts.d.ts +91 -0
- package/dist/ui/spinner.d.ts +109 -0
- package/dist/ui/table.d.ts +118 -0
- package/package.json +17 -17
- package/LICENSE +0 -21
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table - Table formatting for output
|
|
3
|
+
*
|
|
4
|
+
* Provides formatted table output for CLI results.
|
|
5
|
+
*
|
|
6
|
+
* @requirements 29.1
|
|
7
|
+
*/
|
|
8
|
+
import Table from 'cli-table3';
|
|
9
|
+
import type { Severity } from 'driftdetect-core';
|
|
10
|
+
/**
|
|
11
|
+
* Table style presets
|
|
12
|
+
*/
|
|
13
|
+
export type TableStyle = 'default' | 'compact' | 'borderless' | 'minimal';
|
|
14
|
+
/**
|
|
15
|
+
* Table configuration options
|
|
16
|
+
*/
|
|
17
|
+
export interface TableOptions {
|
|
18
|
+
/** Table headers */
|
|
19
|
+
head?: string[];
|
|
20
|
+
/** Column widths */
|
|
21
|
+
colWidths?: number[];
|
|
22
|
+
/** Column alignments */
|
|
23
|
+
colAligns?: Array<'left' | 'center' | 'right'>;
|
|
24
|
+
/** Table style preset */
|
|
25
|
+
style?: TableStyle;
|
|
26
|
+
/** Word wrap long content */
|
|
27
|
+
wordWrap?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a formatted table
|
|
31
|
+
*/
|
|
32
|
+
export declare function createTable(options?: TableOptions): Table.Table;
|
|
33
|
+
/**
|
|
34
|
+
* Format a severity value with color
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatSeverity(severity: Severity): string;
|
|
37
|
+
/**
|
|
38
|
+
* Format a confidence score with color
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatConfidence(confidence: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* Format a count with color based on value
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatCount(count: number, threshold?: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* Format a file path (truncate if too long)
|
|
47
|
+
*/
|
|
48
|
+
export declare function formatPath(path: string, maxLength?: number): string;
|
|
49
|
+
/**
|
|
50
|
+
* Pattern table row data
|
|
51
|
+
*/
|
|
52
|
+
export interface PatternRow {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
category: string;
|
|
56
|
+
confidence: number;
|
|
57
|
+
locations: number;
|
|
58
|
+
outliers: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a patterns table
|
|
62
|
+
*/
|
|
63
|
+
export declare function createPatternsTable(patterns: PatternRow[]): string;
|
|
64
|
+
/**
|
|
65
|
+
* Violation table row data
|
|
66
|
+
*/
|
|
67
|
+
export interface ViolationRow {
|
|
68
|
+
severity: Severity;
|
|
69
|
+
file: string;
|
|
70
|
+
line: number;
|
|
71
|
+
message: string;
|
|
72
|
+
pattern: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a violations table
|
|
76
|
+
*/
|
|
77
|
+
export declare function createViolationsTable(violations: ViolationRow[]): string;
|
|
78
|
+
/**
|
|
79
|
+
* Summary table row data
|
|
80
|
+
*/
|
|
81
|
+
export interface SummaryRow {
|
|
82
|
+
label: string;
|
|
83
|
+
value: string | number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a summary table
|
|
87
|
+
*/
|
|
88
|
+
export declare function createSummaryTable(rows: SummaryRow[]): string;
|
|
89
|
+
/**
|
|
90
|
+
* Status summary data
|
|
91
|
+
*/
|
|
92
|
+
export interface StatusSummary {
|
|
93
|
+
totalPatterns: number;
|
|
94
|
+
approvedPatterns: number;
|
|
95
|
+
discoveredPatterns: number;
|
|
96
|
+
ignoredPatterns: number;
|
|
97
|
+
totalViolations: number;
|
|
98
|
+
errors: number;
|
|
99
|
+
warnings: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a status summary table
|
|
103
|
+
*/
|
|
104
|
+
export declare function createStatusTable(summary: StatusSummary): string;
|
|
105
|
+
/**
|
|
106
|
+
* Category breakdown data
|
|
107
|
+
*/
|
|
108
|
+
export interface CategoryBreakdown {
|
|
109
|
+
category: string;
|
|
110
|
+
patterns: number;
|
|
111
|
+
violations: number;
|
|
112
|
+
coverage: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a category breakdown table
|
|
116
|
+
*/
|
|
117
|
+
export declare function createCategoryTable(categories: CategoryBreakdown[]): string;
|
|
118
|
+
//# sourceMappingURL=table.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "driftdetect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Codebase pattern detection for AI agents - scans your code, learns conventions, feeds context to Claude/Cursor/Copilot via MCP. Static analysis for TypeScript, Python, C#, Java, PHP.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
6
|
"author": "Geoffrey Fernald",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -49,15 +49,26 @@
|
|
|
49
49
|
"files": [
|
|
50
50
|
"dist"
|
|
51
51
|
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"clean": "rm -rf dist",
|
|
55
|
+
"dev": "tsc --watch",
|
|
56
|
+
"lint": "eslint src --ext .ts",
|
|
57
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"test:watch": "vitest",
|
|
60
|
+
"test:coverage": "vitest run --coverage",
|
|
61
|
+
"typecheck": "tsc --noEmit"
|
|
62
|
+
},
|
|
52
63
|
"dependencies": {
|
|
53
64
|
"@inquirer/prompts": "^7.0.0",
|
|
54
65
|
"chalk": "^5.3.0",
|
|
55
66
|
"cli-progress": "^3.12.0",
|
|
56
67
|
"cli-table3": "^0.6.5",
|
|
57
68
|
"commander": "^12.1.0",
|
|
58
|
-
"driftdetect-core": "^0.7.
|
|
59
|
-
"driftdetect-dashboard": "^0.7.
|
|
60
|
-
"driftdetect-detectors": "^0.7.
|
|
69
|
+
"driftdetect-core": "^0.7.1",
|
|
70
|
+
"driftdetect-dashboard": "^0.7.1",
|
|
71
|
+
"driftdetect-detectors": "^0.7.1",
|
|
61
72
|
"ora": "^8.1.0",
|
|
62
73
|
"piscina": "^5.1.4"
|
|
63
74
|
},
|
|
@@ -68,16 +79,5 @@
|
|
|
68
79
|
"fast-check": "^3.15.0",
|
|
69
80
|
"typescript": "^5.3.0",
|
|
70
81
|
"vitest": "^1.0.0"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"build": "tsc",
|
|
74
|
-
"clean": "rm -rf dist",
|
|
75
|
-
"dev": "tsc --watch",
|
|
76
|
-
"lint": "eslint src --ext .ts",
|
|
77
|
-
"lint:fix": "eslint src --ext .ts --fix",
|
|
78
|
-
"test": "vitest run",
|
|
79
|
-
"test:watch": "vitest",
|
|
80
|
-
"test:coverage": "vitest run --coverage",
|
|
81
|
-
"typecheck": "tsc --noEmit"
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Geoffrey Fernald
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|