@codexa/cli 8.6.0 → 8.6.9

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.
@@ -1,129 +1,129 @@
1
- /**
2
- * Detector Loader
3
- *
4
- * Loads all ecosystem detectors and provides unified detection API.
5
- * This module should be imported once to register all detectors.
6
- */
7
-
8
- // Import all detectors to register them
9
- import "./dotnet";
10
- import "./node";
11
- import "./python";
12
- import "./go";
13
- import "./rust";
14
- import "./jvm";
15
- import "./flutter";
16
-
17
- // Re-export main functions from index
18
- export {
19
- detectUniversal,
20
- detectStackLegacy,
21
- getDetectors,
22
- type UnifiedDetectionResult,
23
- type LegacyStackDetection,
24
- type LegacyStructureDetection,
25
- type DetectedTechnology,
26
- type DetectorResult,
27
- } from "./index";
28
-
29
- /**
30
- * Convenience function for CLI display
31
- */
32
- export function formatDetectionResult(result: import("./index").UnifiedDetectionResult): string {
33
- const lines: string[] = [];
34
-
35
- lines.push("═".repeat(60));
36
- lines.push("STACK DETECTADO");
37
- lines.push("═".repeat(60));
38
-
39
- // Primary info
40
- lines.push("");
41
- lines.push(` Linguagem: ${result.primary.language}`);
42
- if (result.primary.runtime) lines.push(` Runtime: ${result.primary.runtime}`);
43
- if (result.primary.framework) lines.push(` Framework: ${result.primary.framework}`);
44
-
45
- // Ecosystems
46
- if (result.ecosystems.length > 0) {
47
- lines.push(` Ecossistemas: ${result.ecosystems.join(", ")}`);
48
- }
49
-
50
- // Stack by category
51
- const categories: [string, string[] | undefined][] = [
52
- ["Frontend", result.stack.frontend],
53
- ["Backend", result.stack.backend],
54
- ["Database", result.stack.database],
55
- ["ORM", result.stack.orm],
56
- ["Styling", result.stack.styling],
57
- ["Auth", result.stack.auth],
58
- ["Testing", result.stack.testing],
59
- ["DevOps", result.stack.devops],
60
- ];
61
-
62
- const hasStack = categories.some(([_, items]) => items && items.length > 0);
63
- if (hasStack) {
64
- lines.push("");
65
- lines.push("─".repeat(60));
66
- lines.push("TECNOLOGIAS");
67
- lines.push("─".repeat(60));
68
- lines.push("");
69
-
70
- for (const [name, items] of categories) {
71
- if (items && items.length > 0) {
72
- lines.push(` ${name}: ${items.join(", ")}`);
73
- }
74
- }
75
- }
76
-
77
- // Structure
78
- if (Object.keys(result.structure).length > 0) {
79
- lines.push("");
80
- lines.push("─".repeat(60));
81
- lines.push("ESTRUTURA");
82
- lines.push("─".repeat(60));
83
- lines.push("");
84
-
85
- for (const [key, path] of Object.entries(result.structure)) {
86
- lines.push(` ${key}: ${path}/`);
87
- }
88
- }
89
-
90
- // Config files
91
- if (result.configFiles.length > 0) {
92
- lines.push("");
93
- lines.push("─".repeat(60));
94
- lines.push("ARQUIVOS DE CONFIGURACAO");
95
- lines.push("─".repeat(60));
96
- lines.push("");
97
-
98
- for (const file of result.configFiles.slice(0, 10)) {
99
- lines.push(` • ${file}`);
100
- }
101
- if (result.configFiles.length > 10) {
102
- lines.push(` ... e mais ${result.configFiles.length - 10} arquivos`);
103
- }
104
- }
105
-
106
- lines.push("");
107
- lines.push("─".repeat(60));
108
-
109
- return lines.join("\n");
110
- }
111
-
112
- /**
113
- * Get detailed technology list for JSON output
114
- */
115
- export function getDetailedTechnologies(result: import("./index").UnifiedDetectionResult): {
116
- category: string;
117
- name: string;
118
- version?: string;
119
- confidence: number;
120
- source: string;
121
- }[] {
122
- return result.allTechnologies.map(t => ({
123
- category: t.category,
124
- name: t.name,
125
- version: t.version,
126
- confidence: t.confidence,
127
- source: t.source,
128
- }));
1
+ /**
2
+ * Detector Loader
3
+ *
4
+ * Loads all ecosystem detectors and provides unified detection API.
5
+ * This module should be imported once to register all detectors.
6
+ */
7
+
8
+ // Import all detectors to register them
9
+ import "./dotnet";
10
+ import "./node";
11
+ import "./python";
12
+ import "./go";
13
+ import "./rust";
14
+ import "./jvm";
15
+ import "./flutter";
16
+
17
+ // Re-export main functions from index
18
+ export {
19
+ detectUniversal,
20
+ detectStackLegacy,
21
+ getDetectors,
22
+ type UnifiedDetectionResult,
23
+ type LegacyStackDetection,
24
+ type LegacyStructureDetection,
25
+ type DetectedTechnology,
26
+ type DetectorResult,
27
+ } from "./index";
28
+
29
+ /**
30
+ * Convenience function for CLI display
31
+ */
32
+ export function formatDetectionResult(result: import("./index").UnifiedDetectionResult): string {
33
+ const lines: string[] = [];
34
+
35
+ lines.push("═".repeat(60));
36
+ lines.push("STACK DETECTADO");
37
+ lines.push("═".repeat(60));
38
+
39
+ // Primary info
40
+ lines.push("");
41
+ lines.push(` Linguagem: ${result.primary.language}`);
42
+ if (result.primary.runtime) lines.push(` Runtime: ${result.primary.runtime}`);
43
+ if (result.primary.framework) lines.push(` Framework: ${result.primary.framework}`);
44
+
45
+ // Ecosystems
46
+ if (result.ecosystems.length > 0) {
47
+ lines.push(` Ecossistemas: ${result.ecosystems.join(", ")}`);
48
+ }
49
+
50
+ // Stack by category
51
+ const categories: [string, string[] | undefined][] = [
52
+ ["Frontend", result.stack.frontend],
53
+ ["Backend", result.stack.backend],
54
+ ["Database", result.stack.database],
55
+ ["ORM", result.stack.orm],
56
+ ["Styling", result.stack.styling],
57
+ ["Auth", result.stack.auth],
58
+ ["Testing", result.stack.testing],
59
+ ["DevOps", result.stack.devops],
60
+ ];
61
+
62
+ const hasStack = categories.some(([_, items]) => items && items.length > 0);
63
+ if (hasStack) {
64
+ lines.push("");
65
+ lines.push("─".repeat(60));
66
+ lines.push("TECNOLOGIAS");
67
+ lines.push("─".repeat(60));
68
+ lines.push("");
69
+
70
+ for (const [name, items] of categories) {
71
+ if (items && items.length > 0) {
72
+ lines.push(` ${name}: ${items.join(", ")}`);
73
+ }
74
+ }
75
+ }
76
+
77
+ // Structure
78
+ if (Object.keys(result.structure).length > 0) {
79
+ lines.push("");
80
+ lines.push("─".repeat(60));
81
+ lines.push("ESTRUTURA");
82
+ lines.push("─".repeat(60));
83
+ lines.push("");
84
+
85
+ for (const [key, path] of Object.entries(result.structure)) {
86
+ lines.push(` ${key}: ${path}/`);
87
+ }
88
+ }
89
+
90
+ // Config files
91
+ if (result.configFiles.length > 0) {
92
+ lines.push("");
93
+ lines.push("─".repeat(60));
94
+ lines.push("ARQUIVOS DE CONFIGURACAO");
95
+ lines.push("─".repeat(60));
96
+ lines.push("");
97
+
98
+ for (const file of result.configFiles.slice(0, 10)) {
99
+ lines.push(` • ${file}`);
100
+ }
101
+ if (result.configFiles.length > 10) {
102
+ lines.push(` ... e mais ${result.configFiles.length - 10} arquivos`);
103
+ }
104
+ }
105
+
106
+ lines.push("");
107
+ lines.push("─".repeat(60));
108
+
109
+ return lines.join("\n");
110
+ }
111
+
112
+ /**
113
+ * Get detailed technology list for JSON output
114
+ */
115
+ export function getDetailedTechnologies(result: import("./index").UnifiedDetectionResult): {
116
+ category: string;
117
+ name: string;
118
+ version?: string;
119
+ confidence: number;
120
+ source: string;
121
+ }[] {
122
+ return result.allTechnologies.map(t => ({
123
+ category: t.category,
124
+ name: t.name,
125
+ version: t.version,
126
+ confidence: t.confidence,
127
+ source: t.source,
128
+ }));
129
129
  }