@buoy-design/cli 0.1.0 → 0.1.2
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/commands/audit.d.ts +3 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +235 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/baseline.d.ts +39 -0
- package/dist/commands/baseline.d.ts.map +1 -0
- package/dist/commands/baseline.js +298 -0
- package/dist/commands/baseline.js.map +1 -0
- package/dist/commands/check.d.ts +16 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +168 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/ci.d.ts +2 -2
- package/dist/commands/ci.d.ts.map +1 -1
- package/dist/commands/ci.js +124 -142
- package/dist/commands/ci.js.map +1 -1
- package/dist/commands/compare.d.ts +3 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +170 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/drift.d.ts +1 -1
- package/dist/commands/drift.d.ts.map +1 -1
- package/dist/commands/drift.js +79 -121
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/explain.d.ts +3 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +212 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/graph.d.ts +3 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/commands/graph.js +430 -0
- package/dist/commands/graph.js.map +1 -0
- package/dist/commands/index.d.ts +14 -8
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +14 -8
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +404 -237
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +32 -41
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/scan.d.ts +1 -1
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +107 -219
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +114 -122
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tokens.d.ts +3 -0
- package/dist/commands/tokens.d.ts.map +1 -0
- package/dist/commands/tokens.js +261 -0
- package/dist/commands/tokens.js.map +1 -0
- package/dist/config/auto-detect.d.ts +21 -0
- package/dist/config/auto-detect.d.ts.map +1 -0
- package/dist/config/auto-detect.js +278 -0
- package/dist/config/auto-detect.js.map +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +17 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +63 -63
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +20 -2
- package/dist/config/schema.js.map +1 -1
- package/dist/constants.d.ts +36 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +37 -0
- package/dist/constants.js.map +1 -0
- package/dist/detect/frameworks.d.ts +11 -2
- package/dist/detect/frameworks.d.ts.map +1 -1
- package/dist/detect/frameworks.js +78 -78
- package/dist/detect/frameworks.js.map +1 -1
- package/dist/detect/index.d.ts +1 -0
- package/dist/detect/index.d.ts.map +1 -1
- package/dist/detect/index.js +3 -0
- package/dist/detect/index.js.map +1 -1
- package/dist/detect/monorepo-patterns.d.ts +54 -0
- package/dist/detect/monorepo-patterns.d.ts.map +1 -0
- package/dist/detect/monorepo-patterns.js +209 -0
- package/dist/detect/monorepo-patterns.js.map +1 -0
- package/dist/detect/project-detector.d.ts +1 -1
- package/dist/detect/project-detector.d.ts.map +1 -1
- package/dist/detect/project-detector.js +132 -0
- package/dist/detect/project-detector.js.map +1 -1
- package/dist/explain/agents.d.ts +31 -0
- package/dist/explain/agents.d.ts.map +1 -0
- package/dist/explain/agents.js +507 -0
- package/dist/explain/agents.js.map +1 -0
- package/dist/hooks/index.d.ts +26 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +283 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/integrations/github-formatter.d.ts +55 -0
- package/dist/integrations/github-formatter.d.ts.map +1 -0
- package/dist/integrations/github-formatter.js +391 -0
- package/dist/integrations/github-formatter.js.map +1 -0
- package/dist/integrations/github.d.ts +95 -0
- package/dist/integrations/github.d.ts.map +1 -0
- package/dist/integrations/github.js +281 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations/index.d.ts +4 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +4 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/output/formatters.d.ts.map +1 -1
- package/dist/output/formatters.js +5 -10
- package/dist/output/formatters.js.map +1 -1
- package/dist/scan/orchestrator.d.ts +76 -0
- package/dist/scan/orchestrator.d.ts.map +1 -0
- package/dist/scan/orchestrator.js +247 -0
- package/dist/scan/orchestrator.js.map +1 -0
- package/dist/services/ai-analysis.d.ts +54 -0
- package/dist/services/ai-analysis.d.ts.map +1 -0
- package/dist/services/ai-analysis.js +239 -0
- package/dist/services/ai-analysis.js.map +1 -0
- package/dist/services/drift-analysis.d.ts +77 -0
- package/dist/services/drift-analysis.d.ts.map +1 -0
- package/dist/services/drift-analysis.js +145 -0
- package/dist/services/drift-analysis.js.map +1 -0
- package/package.json +17 -5
- package/dist/commands/__tests__/ci.test.d.ts +0 -2
- package/dist/commands/__tests__/ci.test.d.ts.map +0 -1
- package/dist/commands/__tests__/ci.test.js +0 -33
- package/dist/commands/__tests__/ci.test.js.map +0 -1
- package/dist/commands/bootstrap.d.ts +0 -3
- package/dist/commands/bootstrap.d.ts.map +0 -1
- package/dist/commands/bootstrap.js +0 -458
- package/dist/commands/bootstrap.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -3
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -3
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/loader.d.ts +0 -11
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js +0 -77
- package/dist/plugins/loader.js.map +0 -1
- package/dist/plugins/registry.d.ts +0 -15
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -32
- package/dist/plugins/registry.js.map +0 -1
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// apps/cli/src/services/drift-analysis.ts
|
|
2
|
+
/**
|
|
3
|
+
* DriftAnalysisService - Consolidated drift detection workflow
|
|
4
|
+
*
|
|
5
|
+
* Handles the common pattern of:
|
|
6
|
+
* 1. Scanning components via ScanOrchestrator
|
|
7
|
+
* 2. Running SemanticDiffEngine analysis
|
|
8
|
+
* 3. Applying ignore rules from config
|
|
9
|
+
* 4. Filtering against baseline
|
|
10
|
+
*/
|
|
11
|
+
import { ScanOrchestrator } from "../scan/orchestrator.js";
|
|
12
|
+
import { getSeverityWeight } from "@buoy-design/core";
|
|
13
|
+
/**
|
|
14
|
+
* Severity order for filtering and sorting (0 = lowest, 2 = highest)
|
|
15
|
+
* Use getSeverityWeight from @buoy-design/core for consistent ordering
|
|
16
|
+
*/
|
|
17
|
+
const SEVERITY_ORDER = {
|
|
18
|
+
info: 0,
|
|
19
|
+
warning: 1,
|
|
20
|
+
critical: 2,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Calculate summary counts for drift signals
|
|
24
|
+
*/
|
|
25
|
+
export function calculateDriftSummary(drifts) {
|
|
26
|
+
return {
|
|
27
|
+
total: drifts.length,
|
|
28
|
+
critical: drifts.filter((d) => d.severity === "critical").length,
|
|
29
|
+
warning: drifts.filter((d) => d.severity === "warning").length,
|
|
30
|
+
info: drifts.filter((d) => d.severity === "info").length,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Determine if drifts exceed a severity threshold
|
|
35
|
+
*/
|
|
36
|
+
export function hasDriftsAboveThreshold(drifts, failOn) {
|
|
37
|
+
if (failOn === "none")
|
|
38
|
+
return false;
|
|
39
|
+
const threshold = SEVERITY_ORDER[failOn] ?? SEVERITY_ORDER.critical;
|
|
40
|
+
return drifts.some((d) => SEVERITY_ORDER[d.severity] >= threshold);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sort drifts by severity (critical first)
|
|
44
|
+
*/
|
|
45
|
+
export function sortDriftsBySeverity(drifts) {
|
|
46
|
+
return [...drifts].sort((a, b) => getSeverityWeight(b.severity) - getSeverityWeight(a.severity));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Apply ignore rules from config to filter out matching drifts
|
|
50
|
+
*/
|
|
51
|
+
export function applyIgnoreRules(drifts, ignoreRules, onWarning) {
|
|
52
|
+
let filtered = drifts;
|
|
53
|
+
for (const rule of ignoreRules) {
|
|
54
|
+
filtered = filtered.filter((d) => {
|
|
55
|
+
if (d.type !== rule.type)
|
|
56
|
+
return true;
|
|
57
|
+
if (!rule.pattern)
|
|
58
|
+
return false;
|
|
59
|
+
try {
|
|
60
|
+
const regex = new RegExp(rule.pattern);
|
|
61
|
+
return !regex.test(d.source.entityName);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
onWarning?.(`Invalid regex pattern "${rule.pattern}" in ignore rule, skipping`);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return filtered;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Apply severity filter to drifts
|
|
73
|
+
*/
|
|
74
|
+
export function filterBySeverity(drifts, minSeverity) {
|
|
75
|
+
const minLevel = SEVERITY_ORDER[minSeverity] ?? 0;
|
|
76
|
+
return drifts.filter((d) => SEVERITY_ORDER[d.severity] >= minLevel);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Apply type filter to drifts
|
|
80
|
+
*/
|
|
81
|
+
export function filterByType(drifts, type) {
|
|
82
|
+
return drifts.filter((d) => d.type === type);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* DriftAnalysisService - Main entry point for drift detection
|
|
86
|
+
*/
|
|
87
|
+
export class DriftAnalysisService {
|
|
88
|
+
config;
|
|
89
|
+
constructor(config) {
|
|
90
|
+
this.config = config;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Run full drift analysis pipeline
|
|
94
|
+
*/
|
|
95
|
+
async analyze(options = {}) {
|
|
96
|
+
const { onProgress, includeBaseline, minSeverity, filterType } = options;
|
|
97
|
+
// Step 1: Scan components
|
|
98
|
+
onProgress?.("Scanning components...");
|
|
99
|
+
const orchestrator = new ScanOrchestrator(this.config);
|
|
100
|
+
const { components } = await orchestrator.scanComponents({
|
|
101
|
+
onProgress,
|
|
102
|
+
});
|
|
103
|
+
// Step 2: Run semantic diff analysis
|
|
104
|
+
onProgress?.("Analyzing drift...");
|
|
105
|
+
const { SemanticDiffEngine } = await import("@buoy-design/core/analysis");
|
|
106
|
+
const engine = new SemanticDiffEngine();
|
|
107
|
+
const diffResult = engine.analyzeComponents(components, {
|
|
108
|
+
checkDeprecated: true,
|
|
109
|
+
checkNaming: true,
|
|
110
|
+
checkDocumentation: true,
|
|
111
|
+
});
|
|
112
|
+
let drifts = diffResult.drifts;
|
|
113
|
+
// Step 3: Apply severity filter (before other filters for efficiency)
|
|
114
|
+
if (minSeverity) {
|
|
115
|
+
drifts = filterBySeverity(drifts, minSeverity);
|
|
116
|
+
}
|
|
117
|
+
// Step 4: Apply type filter
|
|
118
|
+
if (filterType) {
|
|
119
|
+
drifts = filterByType(drifts, filterType);
|
|
120
|
+
}
|
|
121
|
+
// Step 5: Apply ignore rules from config
|
|
122
|
+
drifts = applyIgnoreRules(drifts, this.config.drift.ignore, (msg) => {
|
|
123
|
+
onProgress?.(`Warning: ${msg}`);
|
|
124
|
+
});
|
|
125
|
+
// Step 6: Apply baseline filtering
|
|
126
|
+
let baselinedCount = 0;
|
|
127
|
+
if (!includeBaseline) {
|
|
128
|
+
const { loadBaseline, filterBaseline } = await import("../commands/baseline.js");
|
|
129
|
+
const baseline = await loadBaseline();
|
|
130
|
+
const filtered = filterBaseline(drifts, baseline);
|
|
131
|
+
drifts = filtered.newDrifts;
|
|
132
|
+
baselinedCount = filtered.baselinedCount;
|
|
133
|
+
if (baselinedCount > 0) {
|
|
134
|
+
onProgress?.(`Filtered out ${baselinedCount} baselined drift signals.`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
drifts,
|
|
139
|
+
components,
|
|
140
|
+
baselinedCount,
|
|
141
|
+
summary: calculateDriftSummary(drifts),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=drift-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drift-analysis.js","sourceRoot":"","sources":["../../src/services/drift-analysis.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C;;;;;;;;GAQG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA6BtD;;;GAGG;AACH,MAAM,cAAc,GAA6B;IAC/C,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAqB;IAMzD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC,MAAM;QAChE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,C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CAAC;YAEzC,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;gBACvB,UAAU,EAAE,CAAC,gBAAgB,cAAc,2BAA2B,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,OAAO;YACL,MAAM;YACN,UAAU;YACV,cAAc;YACd,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC;SACvC,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-design/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Buoy CLI - Design drift detection for the AI era",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,8 +14,17 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/dylantarre/buoy-design/issues"
|
|
16
16
|
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
|
|
17
|
+
"keywords": [
|
|
18
|
+
"buoy",
|
|
19
|
+
"design-system",
|
|
20
|
+
"drift-detection",
|
|
21
|
+
"cli",
|
|
22
|
+
"design-tokens"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
19
28
|
"bin": {
|
|
20
29
|
"buoy": "./dist/bin.js"
|
|
21
30
|
},
|
|
@@ -31,15 +40,18 @@
|
|
|
31
40
|
"test:watch": "vitest"
|
|
32
41
|
},
|
|
33
42
|
"dependencies": {
|
|
43
|
+
"@anthropic-ai/sdk": "^0.71.2",
|
|
34
44
|
"@buoy-design/core": "workspace:*",
|
|
35
|
-
"@buoy-design/db": "workspace:*",
|
|
36
45
|
"@buoy-design/scanners": "workspace:*",
|
|
46
|
+
"@octokit/rest": "^21.0.0",
|
|
37
47
|
"chalk": "^5.3.0",
|
|
38
48
|
"cli-table3": "^0.6.5",
|
|
39
49
|
"commander": "^12.1.0",
|
|
40
50
|
"glob": "^11.0.0",
|
|
41
51
|
"ora": "^8.1.1",
|
|
42
|
-
"
|
|
52
|
+
"yaml": "^2.7.0",
|
|
53
|
+
"zod": "^3.24.1",
|
|
54
|
+
"zod-validation-error": "^5.0.0"
|
|
43
55
|
},
|
|
44
56
|
"devDependencies": {
|
|
45
57
|
"@types/node": "^22.10.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ci.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/ci.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// apps/cli/src/commands/__tests__/ci.test.ts
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
3
|
-
// Import the function we want to test
|
|
4
|
-
// Note: We'll need to export buildCIOutput for testing
|
|
5
|
-
// For now, test the output structure
|
|
6
|
-
describe('buoy ci', () => {
|
|
7
|
-
describe('exit codes', () => {
|
|
8
|
-
it('should exit 0 when no drift found', () => {
|
|
9
|
-
// Placeholder - would need to mock config and scanners
|
|
10
|
-
expect(true).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
it('should exit 1 when critical drift found and fail-on=critical', () => {
|
|
13
|
-
expect(true).toBe(true);
|
|
14
|
-
});
|
|
15
|
-
it('should exit 0 when warning drift found and fail-on=critical', () => {
|
|
16
|
-
expect(true).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
it('should exit 1 when warning drift found and fail-on=warning', () => {
|
|
19
|
-
expect(true).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
it('should exit 0 when fail-on=none regardless of drift', () => {
|
|
22
|
-
expect(true).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
describe('output format', () => {
|
|
26
|
-
it('should output valid JSON with required fields', () => {
|
|
27
|
-
const expectedFields = ['version', 'timestamp', 'summary', 'topIssues', 'exitCode'];
|
|
28
|
-
// Placeholder
|
|
29
|
-
expect(expectedFields.length).toBe(5);
|
|
30
|
-
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