faf-cli 2.1.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.
Files changed (283) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +227 -0
  3. package/dist/cli.d.ts +8 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +1249 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/ai-analyze.d.ts +18 -0
  8. package/dist/commands/ai-analyze.d.ts.map +1 -0
  9. package/dist/commands/ai-analyze.js +226 -0
  10. package/dist/commands/ai-analyze.js.map +1 -0
  11. package/dist/commands/ai-enhance.d.ts +17 -0
  12. package/dist/commands/ai-enhance.d.ts.map +1 -0
  13. package/dist/commands/ai-enhance.js +278 -0
  14. package/dist/commands/ai-enhance.js.map +1 -0
  15. package/dist/commands/audit.d.ts +11 -0
  16. package/dist/commands/audit.d.ts.map +1 -0
  17. package/dist/commands/audit.js +180 -0
  18. package/dist/commands/audit.js.map +1 -0
  19. package/dist/commands/auto.d.ts +27 -0
  20. package/dist/commands/auto.d.ts.map +1 -0
  21. package/dist/commands/auto.js +106 -0
  22. package/dist/commands/auto.js.map +1 -0
  23. package/dist/commands/bi-sync.d.ts +43 -0
  24. package/dist/commands/bi-sync.d.ts.map +1 -0
  25. package/dist/commands/bi-sync.js +224 -0
  26. package/dist/commands/bi-sync.js.map +1 -0
  27. package/dist/commands/chat.d.ts +6 -0
  28. package/dist/commands/chat.d.ts.map +1 -0
  29. package/dist/commands/chat.js +227 -0
  30. package/dist/commands/chat.js.map +1 -0
  31. package/dist/commands/check.d.ts +15 -0
  32. package/dist/commands/check.d.ts.map +1 -0
  33. package/dist/commands/check.js +58 -0
  34. package/dist/commands/check.js.map +1 -0
  35. package/dist/commands/clear.d.ts +15 -0
  36. package/dist/commands/clear.d.ts.map +1 -0
  37. package/dist/commands/clear.js +167 -0
  38. package/dist/commands/clear.js.map +1 -0
  39. package/dist/commands/commit.d.ts +8 -0
  40. package/dist/commands/commit.d.ts.map +1 -0
  41. package/dist/commands/commit.js +164 -0
  42. package/dist/commands/commit.js.map +1 -0
  43. package/dist/commands/convert.d.ts +19 -0
  44. package/dist/commands/convert.d.ts.map +1 -0
  45. package/dist/commands/convert.js +102 -0
  46. package/dist/commands/convert.js.map +1 -0
  47. package/dist/commands/credit.d.ts +13 -0
  48. package/dist/commands/credit.d.ts.map +1 -0
  49. package/dist/commands/credit.js +149 -0
  50. package/dist/commands/credit.js.map +1 -0
  51. package/dist/commands/edit-helper.d.ts +6 -0
  52. package/dist/commands/edit-helper.d.ts.map +1 -0
  53. package/dist/commands/edit-helper.js +55 -0
  54. package/dist/commands/edit-helper.js.map +1 -0
  55. package/dist/commands/edit.d.ts +14 -0
  56. package/dist/commands/edit.d.ts.map +1 -0
  57. package/dist/commands/edit.js +196 -0
  58. package/dist/commands/edit.js.map +1 -0
  59. package/dist/commands/faf-auth.d.ts +10 -0
  60. package/dist/commands/faf-auth.d.ts.map +1 -0
  61. package/dist/commands/faf-auth.js +162 -0
  62. package/dist/commands/faf-auth.js.map +1 -0
  63. package/dist/commands/faf-dna.d.ts +9 -0
  64. package/dist/commands/faf-dna.d.ts.map +1 -0
  65. package/dist/commands/faf-dna.js +141 -0
  66. package/dist/commands/faf-dna.js.map +1 -0
  67. package/dist/commands/faf-log.d.ts +9 -0
  68. package/dist/commands/faf-log.d.ts.map +1 -0
  69. package/dist/commands/faf-log.js +135 -0
  70. package/dist/commands/faf-log.js.map +1 -0
  71. package/dist/commands/faf-recover.d.ts +3 -0
  72. package/dist/commands/faf-recover.d.ts.map +1 -0
  73. package/dist/commands/faf-recover.js +299 -0
  74. package/dist/commands/faf-recover.js.map +1 -0
  75. package/dist/commands/faf-update.d.ts +9 -0
  76. package/dist/commands/faf-update.d.ts.map +1 -0
  77. package/dist/commands/faf-update.js +68 -0
  78. package/dist/commands/faf-update.js.map +1 -0
  79. package/dist/commands/faq.d.ts +12 -0
  80. package/dist/commands/faq.d.ts.map +1 -0
  81. package/dist/commands/faq.js +84 -0
  82. package/dist/commands/faq.js.map +1 -0
  83. package/dist/commands/flow.d.ts +11 -0
  84. package/dist/commands/flow.d.ts.map +1 -0
  85. package/dist/commands/flow.js +117 -0
  86. package/dist/commands/flow.js.map +1 -0
  87. package/dist/commands/formats.d.ts +12 -0
  88. package/dist/commands/formats.d.ts.map +1 -0
  89. package/dist/commands/formats.js +109 -0
  90. package/dist/commands/formats.js.map +1 -0
  91. package/dist/commands/index.d.ts +14 -0
  92. package/dist/commands/index.d.ts.map +1 -0
  93. package/dist/commands/index.js +443 -0
  94. package/dist/commands/index.js.map +1 -0
  95. package/dist/commands/init.d.ts +14 -0
  96. package/dist/commands/init.d.ts.map +1 -0
  97. package/dist/commands/init.js +202 -0
  98. package/dist/commands/init.js.map +1 -0
  99. package/dist/commands/lint.d.ts +11 -0
  100. package/dist/commands/lint.d.ts.map +1 -0
  101. package/dist/commands/lint.js +269 -0
  102. package/dist/commands/lint.js.map +1 -0
  103. package/dist/commands/mirror.d.ts +7 -0
  104. package/dist/commands/mirror.d.ts.map +1 -0
  105. package/dist/commands/mirror.js +130 -0
  106. package/dist/commands/mirror.js.map +1 -0
  107. package/dist/commands/score.d.ts +11 -0
  108. package/dist/commands/score.d.ts.map +1 -0
  109. package/dist/commands/score.js +192 -0
  110. package/dist/commands/score.js.map +1 -0
  111. package/dist/commands/search.d.ts +16 -0
  112. package/dist/commands/search.d.ts.map +1 -0
  113. package/dist/commands/search.js +174 -0
  114. package/dist/commands/search.js.map +1 -0
  115. package/dist/commands/share.d.ts +17 -0
  116. package/dist/commands/share.d.ts.map +1 -0
  117. package/dist/commands/share.js +260 -0
  118. package/dist/commands/share.js.map +1 -0
  119. package/dist/commands/show.d.ts +10 -0
  120. package/dist/commands/show.d.ts.map +1 -0
  121. package/dist/commands/show.js +167 -0
  122. package/dist/commands/show.js.map +1 -0
  123. package/dist/commands/stacks.d.ts +51 -0
  124. package/dist/commands/stacks.d.ts.map +1 -0
  125. package/dist/commands/stacks.js +180 -0
  126. package/dist/commands/stacks.js.map +1 -0
  127. package/dist/commands/status.d.ts +13 -0
  128. package/dist/commands/status.d.ts.map +1 -0
  129. package/dist/commands/status.js +158 -0
  130. package/dist/commands/status.js.map +1 -0
  131. package/dist/commands/sync.d.ts +11 -0
  132. package/dist/commands/sync.d.ts.map +1 -0
  133. package/dist/commands/sync.js +300 -0
  134. package/dist/commands/sync.js.map +1 -0
  135. package/dist/commands/todo.d.ts +14 -0
  136. package/dist/commands/todo.d.ts.map +1 -0
  137. package/dist/commands/todo.js +279 -0
  138. package/dist/commands/todo.js.map +1 -0
  139. package/dist/commands/trust.d.ts +33 -0
  140. package/dist/commands/trust.d.ts.map +1 -0
  141. package/dist/commands/trust.js +316 -0
  142. package/dist/commands/trust.js.map +1 -0
  143. package/dist/commands/validate.d.ts +11 -0
  144. package/dist/commands/validate.d.ts.map +1 -0
  145. package/dist/commands/validate.js +100 -0
  146. package/dist/commands/validate.js.map +1 -0
  147. package/dist/commands/verify.d.ts +36 -0
  148. package/dist/commands/verify.d.ts.map +1 -0
  149. package/dist/commands/verify.js +194 -0
  150. package/dist/commands/verify.js.map +1 -0
  151. package/dist/commands/version.d.ts +5 -0
  152. package/dist/commands/version.d.ts.map +1 -0
  153. package/dist/commands/version.js +33 -0
  154. package/dist/commands/version.js.map +1 -0
  155. package/dist/commands/vibe.d.ts +7 -0
  156. package/dist/commands/vibe.d.ts.map +1 -0
  157. package/dist/commands/vibe.js +78 -0
  158. package/dist/commands/vibe.js.map +1 -0
  159. package/dist/converters/faf-converters.d.ts +43 -0
  160. package/dist/converters/faf-converters.d.ts.map +1 -0
  161. package/dist/converters/faf-converters.js +186 -0
  162. package/dist/converters/faf-converters.js.map +1 -0
  163. package/dist/engine-bridge.d.ts +35 -0
  164. package/dist/engine-bridge.d.ts.map +1 -0
  165. package/dist/engine-bridge.js +76 -0
  166. package/dist/engine-bridge.js.map +1 -0
  167. package/dist/engines/claude-todo-engine.d.ts +115 -0
  168. package/dist/engines/claude-todo-engine.d.ts.map +1 -0
  169. package/dist/engines/claude-todo-engine.js +346 -0
  170. package/dist/engines/claude-todo-engine.js.map +1 -0
  171. package/dist/engines/drop-coach.d.ts +64 -0
  172. package/dist/engines/drop-coach.d.ts.map +1 -0
  173. package/dist/engines/drop-coach.js +222 -0
  174. package/dist/engines/drop-coach.js.map +1 -0
  175. package/dist/engines/fab-formats-processor.d.ts +167 -0
  176. package/dist/engines/fab-formats-processor.d.ts.map +1 -0
  177. package/dist/engines/fab-formats-processor.js +1274 -0
  178. package/dist/engines/fab-formats-processor.js.map +1 -0
  179. package/dist/engines/faf-dna.d.ts +160 -0
  180. package/dist/engines/faf-dna.d.ts.map +1 -0
  181. package/dist/engines/faf-dna.js +522 -0
  182. package/dist/engines/faf-dna.js.map +1 -0
  183. package/dist/engines/relentless-context-extractor.d.ts +101 -0
  184. package/dist/engines/relentless-context-extractor.d.ts.map +1 -0
  185. package/dist/engines/relentless-context-extractor.js +625 -0
  186. package/dist/engines/relentless-context-extractor.js.map +1 -0
  187. package/dist/fix-once/colors.d.ts +83 -0
  188. package/dist/fix-once/colors.d.ts.map +1 -0
  189. package/dist/fix-once/colors.js +145 -0
  190. package/dist/fix-once/colors.js.map +1 -0
  191. package/dist/fix-once/types.d.ts +258 -0
  192. package/dist/fix-once/types.d.ts.map +1 -0
  193. package/dist/fix-once/types.js +26 -0
  194. package/dist/fix-once/types.js.map +1 -0
  195. package/dist/framework-detector.d.ts +286 -0
  196. package/dist/framework-detector.d.ts.map +1 -0
  197. package/dist/framework-detector.js +782 -0
  198. package/dist/framework-detector.js.map +1 -0
  199. package/dist/generators/faf-generator-championship.d.ts +11 -0
  200. package/dist/generators/faf-generator-championship.d.ts.map +1 -0
  201. package/dist/generators/faf-generator-championship.js +371 -0
  202. package/dist/generators/faf-generator-championship.js.map +1 -0
  203. package/dist/index.d.ts +18 -0
  204. package/dist/index.d.ts.map +1 -0
  205. package/dist/index.js +34 -0
  206. package/dist/index.js.map +1 -0
  207. package/dist/output/experience-manager.d.ts +58 -0
  208. package/dist/output/experience-manager.d.ts.map +1 -0
  209. package/dist/output/experience-manager.js +212 -0
  210. package/dist/output/experience-manager.js.map +1 -0
  211. package/dist/schema/faf-schema.d.ts +92 -0
  212. package/dist/schema/faf-schema.d.ts.map +1 -0
  213. package/dist/schema/faf-schema.js +173 -0
  214. package/dist/schema/faf-schema.js.map +1 -0
  215. package/dist/scoring/championship-scorer.d.ts +114 -0
  216. package/dist/scoring/championship-scorer.d.ts.map +1 -0
  217. package/dist/scoring/championship-scorer.js +380 -0
  218. package/dist/scoring/championship-scorer.js.map +1 -0
  219. package/dist/scoring/score-calculator.d.ts +29 -0
  220. package/dist/scoring/score-calculator.d.ts.map +1 -0
  221. package/dist/scoring/score-calculator.js +520 -0
  222. package/dist/scoring/score-calculator.js.map +1 -0
  223. package/dist/telemetry/analytics.d.ts +74 -0
  224. package/dist/telemetry/analytics.d.ts.map +1 -0
  225. package/dist/telemetry/analytics.js +370 -0
  226. package/dist/telemetry/analytics.js.map +1 -0
  227. package/dist/utils/balance-visualizer.d.ts +38 -0
  228. package/dist/utils/balance-visualizer.d.ts.map +1 -0
  229. package/dist/utils/balance-visualizer.js +196 -0
  230. package/dist/utils/balance-visualizer.js.map +1 -0
  231. package/dist/utils/championship-style.d.ts +110 -0
  232. package/dist/utils/championship-style.d.ts.map +1 -0
  233. package/dist/utils/championship-style.js +213 -0
  234. package/dist/utils/championship-style.js.map +1 -0
  235. package/dist/utils/color-utils.d.ts +17 -0
  236. package/dist/utils/color-utils.d.ts.map +1 -0
  237. package/dist/utils/color-utils.js +96 -0
  238. package/dist/utils/color-utils.js.map +1 -0
  239. package/dist/utils/fab-formats-engine.d.ts +76 -0
  240. package/dist/utils/fab-formats-engine.d.ts.map +1 -0
  241. package/dist/utils/fab-formats-engine.js +424 -0
  242. package/dist/utils/fab-formats-engine.js.map +1 -0
  243. package/dist/utils/fafignore-parser.d.ts +21 -0
  244. package/dist/utils/fafignore-parser.d.ts.map +1 -0
  245. package/dist/utils/fafignore-parser.js +178 -0
  246. package/dist/utils/fafignore-parser.js.map +1 -0
  247. package/dist/utils/file-utils.d.ts +65 -0
  248. package/dist/utils/file-utils.d.ts.map +1 -0
  249. package/dist/utils/file-utils.js +598 -0
  250. package/dist/utils/file-utils.js.map +1 -0
  251. package/dist/utils/platform-detector.d.ts +31 -0
  252. package/dist/utils/platform-detector.d.ts.map +1 -0
  253. package/dist/utils/platform-detector.js +218 -0
  254. package/dist/utils/platform-detector.js.map +1 -0
  255. package/dist/utils/technical-credit.d.ts +36 -0
  256. package/dist/utils/technical-credit.d.ts.map +1 -0
  257. package/dist/utils/technical-credit.js +286 -0
  258. package/dist/utils/technical-credit.js.map +1 -0
  259. package/dist/utils/trust-cache.d.ts +29 -0
  260. package/dist/utils/trust-cache.d.ts.map +1 -0
  261. package/dist/utils/trust-cache.js +123 -0
  262. package/dist/utils/trust-cache.js.map +1 -0
  263. package/dist/utils/turbo-cat-knowledge.d.ts +82 -0
  264. package/dist/utils/turbo-cat-knowledge.d.ts.map +1 -0
  265. package/dist/utils/turbo-cat-knowledge.js +1346 -0
  266. package/dist/utils/turbo-cat-knowledge.js.map +1 -0
  267. package/dist/utils/turbo-cat-pyramid.d.ts +38 -0
  268. package/dist/utils/turbo-cat-pyramid.d.ts.map +1 -0
  269. package/dist/utils/turbo-cat-pyramid.js +287 -0
  270. package/dist/utils/turbo-cat-pyramid.js.map +1 -0
  271. package/dist/utils/turbo-cat.d.ts +92 -0
  272. package/dist/utils/turbo-cat.d.ts.map +1 -0
  273. package/dist/utils/turbo-cat.js +412 -0
  274. package/dist/utils/turbo-cat.js.map +1 -0
  275. package/dist/utils/vibe-sync.d.ts +25 -0
  276. package/dist/utils/vibe-sync.d.ts.map +1 -0
  277. package/dist/utils/vibe-sync.js +169 -0
  278. package/dist/utils/vibe-sync.js.map +1 -0
  279. package/dist/utils/yaml-generator.d.ts +39 -0
  280. package/dist/utils/yaml-generator.d.ts.map +1 -0
  281. package/dist/utils/yaml-generator.js +345 -0
  282. package/dist/utils/yaml-generator.js.map +1 -0
  283. package/package.json +96 -0
@@ -0,0 +1,782 @@
1
+ "use strict";
2
+ /**
3
+ * 🏎️ Framework Detection Lookup Implementation
4
+ *
5
+ * Ready-to-use TypeScript/JSON structure for instant framework detection
6
+ * Import this directly into the .faf CLI for rapid framework identification
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.FrameworkDetector = exports.PACKAGE_MANAGERS = exports.CONFIG_INDICATORS = exports.COMBINATION_PATTERNS = exports.DIRECTORY_PATTERNS = exports.UNIQUE_SIGNATURES = void 0;
43
+ exports.detectFramework = detectFramework;
44
+ /**
45
+ * TIER 1: Unique File Signatures
46
+ * These files guarantee specific frameworks with 100% confidence
47
+ */
48
+ exports.UNIQUE_SIGNATURES = {
49
+ // Next.js
50
+ 'next.config.js': {
51
+ framework: 'Next.js',
52
+ confidence: 100,
53
+ versionCheck: 'package.json:next',
54
+ ecosystem: 'npm/yarn/pnpm',
55
+ language: 'JavaScript/TypeScript'
56
+ },
57
+ 'next.config.mjs': {
58
+ framework: 'Next.js',
59
+ confidence: 100,
60
+ versionCheck: 'package.json:next',
61
+ ecosystem: 'npm/yarn/pnpm',
62
+ language: 'JavaScript/TypeScript'
63
+ },
64
+ 'next.config.ts': {
65
+ framework: 'Next.js 13+',
66
+ confidence: 100,
67
+ versionCheck: 'package.json:next',
68
+ ecosystem: 'npm/yarn/pnpm',
69
+ language: 'TypeScript'
70
+ },
71
+ // Nuxt
72
+ 'nuxt.config.js': {
73
+ framework: 'Nuxt 2',
74
+ confidence: 100,
75
+ versionCheck: 'package.json:nuxt',
76
+ ecosystem: 'npm/yarn/pnpm',
77
+ language: 'JavaScript'
78
+ },
79
+ 'nuxt.config.ts': {
80
+ framework: 'Nuxt 3',
81
+ confidence: 100,
82
+ versionCheck: 'package.json:nuxt',
83
+ ecosystem: 'npm/yarn/pnpm',
84
+ language: 'TypeScript'
85
+ },
86
+ // Django
87
+ 'manage.py': {
88
+ framework: 'Django',
89
+ confidence: 100,
90
+ additionalCheck: 'contains:django',
91
+ ecosystem: 'pip/pipenv/poetry',
92
+ language: 'Python'
93
+ },
94
+ // Laravel
95
+ 'artisan': {
96
+ framework: 'Laravel',
97
+ confidence: 100,
98
+ additionalCheck: 'contains:laravel',
99
+ ecosystem: 'composer',
100
+ language: 'PHP'
101
+ },
102
+ // Angular
103
+ 'angular.json': {
104
+ framework: 'Angular',
105
+ confidence: 100,
106
+ versionCheck: 'package.json:@angular/core',
107
+ ecosystem: 'npm/yarn/pnpm',
108
+ language: 'TypeScript'
109
+ },
110
+ // SvelteKit
111
+ 'svelte.config.js': {
112
+ framework: 'SvelteKit',
113
+ confidence: 100,
114
+ versionCheck: 'package.json:@sveltejs/kit',
115
+ ecosystem: 'npm/yarn/pnpm',
116
+ language: 'JavaScript/TypeScript'
117
+ },
118
+ // Remix
119
+ 'remix.config.js': {
120
+ framework: 'Remix',
121
+ confidence: 100,
122
+ versionCheck: 'package.json:@remix-run/node',
123
+ ecosystem: 'npm/yarn/pnpm',
124
+ language: 'JavaScript/TypeScript'
125
+ },
126
+ // Gatsby
127
+ 'gatsby-config.js': {
128
+ framework: 'Gatsby',
129
+ confidence: 100,
130
+ versionCheck: 'package.json:gatsby',
131
+ ecosystem: 'npm/yarn/pnpm',
132
+ language: 'JavaScript'
133
+ },
134
+ 'gatsby-config.ts': {
135
+ framework: 'Gatsby 5+',
136
+ confidence: 100,
137
+ versionCheck: 'package.json:gatsby',
138
+ ecosystem: 'npm/yarn/pnpm',
139
+ language: 'TypeScript'
140
+ },
141
+ // Astro
142
+ 'astro.config.mjs': {
143
+ framework: 'Astro',
144
+ confidence: 100,
145
+ versionCheck: 'package.json:astro',
146
+ ecosystem: 'npm/yarn/pnpm',
147
+ language: 'JavaScript/TypeScript'
148
+ },
149
+ // Ruby on Rails
150
+ 'Rakefile': {
151
+ framework: 'Ruby on Rails',
152
+ confidence: 85,
153
+ additionalCheck: 'contains:Rails',
154
+ ecosystem: 'bundler',
155
+ language: 'Ruby'
156
+ },
157
+ // Flutter
158
+ 'pubspec.yaml': {
159
+ framework: 'Flutter/Dart',
160
+ confidence: 95,
161
+ additionalCheck: 'contains:flutter',
162
+ ecosystem: 'pub',
163
+ language: 'Dart'
164
+ },
165
+ // React Native
166
+ 'metro.config.js': {
167
+ framework: 'React Native',
168
+ confidence: 95,
169
+ versionCheck: 'package.json:react-native',
170
+ ecosystem: 'npm/yarn/pnpm',
171
+ language: 'JavaScript/TypeScript'
172
+ },
173
+ // Spring Boot
174
+ 'mvnw': {
175
+ framework: 'Spring Boot/Maven',
176
+ confidence: 85,
177
+ additionalCheck: 'pom.xml:spring-boot',
178
+ ecosystem: 'maven',
179
+ language: 'Java'
180
+ },
181
+ 'gradlew': {
182
+ framework: 'Spring Boot/Gradle',
183
+ confidence: 85,
184
+ additionalCheck: 'build.gradle:spring-boot',
185
+ ecosystem: 'gradle',
186
+ language: 'Java/Kotlin'
187
+ },
188
+ // Go
189
+ 'go.mod': {
190
+ framework: 'Go',
191
+ confidence: 100,
192
+ ecosystem: 'go modules',
193
+ language: 'Go'
194
+ },
195
+ // Rust
196
+ 'Cargo.toml': {
197
+ framework: 'Rust',
198
+ confidence: 100,
199
+ ecosystem: 'cargo',
200
+ language: 'Rust'
201
+ },
202
+ // Phoenix/Elixir
203
+ 'mix.exs': {
204
+ framework: 'Phoenix/Elixir',
205
+ confidence: 95,
206
+ additionalCheck: 'contains:phoenix',
207
+ ecosystem: 'mix',
208
+ language: 'Elixir'
209
+ },
210
+ // RedwoodJS
211
+ 'redwood.toml': {
212
+ framework: 'RedwoodJS',
213
+ confidence: 100,
214
+ versionCheck: 'package.json:@redwoodjs/core',
215
+ ecosystem: 'npm/yarn/pnpm',
216
+ language: 'JavaScript/TypeScript'
217
+ },
218
+ // Qwik
219
+ 'qwik.config.ts': {
220
+ framework: 'Qwik',
221
+ confidence: 100,
222
+ versionCheck: 'package.json:@builder.io/qwik',
223
+ ecosystem: 'npm/yarn/pnpm',
224
+ language: 'TypeScript'
225
+ },
226
+ // NestJS
227
+ 'nest-cli.json': {
228
+ framework: 'NestJS',
229
+ confidence: 100,
230
+ versionCheck: 'package.json:@nestjs/core',
231
+ ecosystem: 'npm/yarn/pnpm',
232
+ language: 'TypeScript'
233
+ }
234
+ };
235
+ /**
236
+ * TIER 2: Directory Pattern Signatures
237
+ * Specific folder structures that strongly indicate frameworks
238
+ */
239
+ exports.DIRECTORY_PATTERNS = {
240
+ // Next.js App Router
241
+ 'app/layout.tsx': {
242
+ framework: 'Next.js 13+ App Router',
243
+ confidence: 100,
244
+ language: 'TypeScript'
245
+ },
246
+ 'app/page.tsx': {
247
+ framework: 'Next.js 13+ App Router',
248
+ confidence: 100,
249
+ language: 'TypeScript'
250
+ },
251
+ 'app/layout.js': {
252
+ framework: 'Next.js 13+ App Router',
253
+ confidence: 100,
254
+ language: 'JavaScript'
255
+ },
256
+ // Next.js Pages Router
257
+ 'pages/_app.tsx': {
258
+ framework: 'Next.js Pages Router',
259
+ confidence: 100,
260
+ language: 'TypeScript'
261
+ },
262
+ 'pages/_document.tsx': {
263
+ framework: 'Next.js Pages Router',
264
+ confidence: 100,
265
+ language: 'TypeScript'
266
+ },
267
+ 'pages/api': {
268
+ framework: 'Next.js API Routes',
269
+ confidence: 95,
270
+ language: 'JavaScript/TypeScript'
271
+ },
272
+ // Django
273
+ 'models.py': {
274
+ framework: 'Django',
275
+ confidence: 90,
276
+ pattern: true,
277
+ language: 'Python'
278
+ },
279
+ 'views.py': {
280
+ framework: 'Django',
281
+ confidence: 85,
282
+ pattern: true,
283
+ language: 'Python'
284
+ },
285
+ 'serializers.py': {
286
+ framework: 'Django REST Framework',
287
+ confidence: 95,
288
+ pattern: true,
289
+ language: 'Python'
290
+ },
291
+ // Laravel
292
+ 'app/Http/Controllers': {
293
+ framework: 'Laravel',
294
+ confidence: 95,
295
+ language: 'PHP'
296
+ },
297
+ 'app/Models': {
298
+ framework: 'Laravel',
299
+ confidence: 95,
300
+ language: 'PHP'
301
+ },
302
+ 'database/migrations': {
303
+ framework: 'Laravel',
304
+ confidence: 90,
305
+ language: 'PHP'
306
+ },
307
+ // Rails
308
+ 'app/controllers': {
309
+ framework: 'Ruby on Rails',
310
+ confidence: 95,
311
+ language: 'Ruby'
312
+ },
313
+ 'app/models': {
314
+ framework: 'Ruby on Rails',
315
+ confidence: 95,
316
+ language: 'Ruby'
317
+ },
318
+ 'db/migrate': {
319
+ framework: 'Ruby on Rails',
320
+ confidence: 95,
321
+ language: 'Ruby'
322
+ },
323
+ // Angular
324
+ 'src/app/app.module.ts': {
325
+ framework: 'Angular',
326
+ confidence: 100,
327
+ language: 'TypeScript'
328
+ },
329
+ 'src/app/app.component.ts': {
330
+ framework: 'Angular',
331
+ confidence: 100,
332
+ language: 'TypeScript'
333
+ },
334
+ // Vue
335
+ 'src/App.vue': {
336
+ framework: 'Vue',
337
+ confidence: 90,
338
+ language: 'JavaScript/TypeScript'
339
+ },
340
+ 'src/components': {
341
+ framework: 'Vue',
342
+ confidence: 70,
343
+ pattern: true,
344
+ additionalCheck: '.vue files',
345
+ language: 'JavaScript/TypeScript'
346
+ },
347
+ // SvelteKit
348
+ 'src/routes/+page.svelte': {
349
+ framework: 'SvelteKit',
350
+ confidence: 100,
351
+ language: 'JavaScript/TypeScript'
352
+ },
353
+ 'src/lib': {
354
+ framework: 'SvelteKit',
355
+ confidence: 80,
356
+ language: 'JavaScript/TypeScript'
357
+ },
358
+ // Spring Boot
359
+ 'src/main/java': {
360
+ framework: 'Spring Boot/Java',
361
+ confidence: 85,
362
+ language: 'Java'
363
+ },
364
+ 'src/main/resources/application.properties': {
365
+ framework: 'Spring Boot',
366
+ confidence: 95,
367
+ language: 'Java'
368
+ },
369
+ 'src/main/resources/application.yml': {
370
+ framework: 'Spring Boot',
371
+ confidence: 95,
372
+ language: 'Java'
373
+ },
374
+ // .NET
375
+ 'Controllers': {
376
+ framework: '.NET MVC/API',
377
+ confidence: 90,
378
+ language: 'C#'
379
+ },
380
+ 'Views': {
381
+ framework: '.NET MVC',
382
+ confidence: 95,
383
+ language: 'C#'
384
+ },
385
+ // Flutter
386
+ 'lib/main.dart': {
387
+ framework: 'Flutter',
388
+ confidence: 100,
389
+ language: 'Dart'
390
+ },
391
+ 'ios/Runner': {
392
+ framework: 'Flutter',
393
+ confidence: 95,
394
+ language: 'Dart'
395
+ }
396
+ };
397
+ /**
398
+ * TIER 3: File Combination Patterns
399
+ * Multiple files that together indicate a specific framework/stack
400
+ */
401
+ exports.COMBINATION_PATTERNS = {
402
+ 't3-stack': {
403
+ files: ['next.config.mjs', 'prisma/schema.prisma', 'src/server/api/routers'],
404
+ framework: 'T3 Stack',
405
+ confidence: 95,
406
+ features: ['Next.js', 'Prisma', 'tRPC', 'TypeScript'],
407
+ language: 'TypeScript'
408
+ },
409
+ 'mean-stack': {
410
+ files: ['angular.json', 'server.js', 'package.json'],
411
+ checks: ['express', 'mongoose', '@angular/core'],
412
+ framework: 'MEAN Stack',
413
+ confidence: 90,
414
+ features: ['MongoDB', 'Express', 'Angular', 'Node.js'],
415
+ language: 'TypeScript/JavaScript'
416
+ },
417
+ 'mern-stack': {
418
+ files: ['client/package.json', 'server/index.js'],
419
+ checks: ['react', 'express', 'mongoose'],
420
+ framework: 'MERN Stack',
421
+ confidence: 90,
422
+ features: ['MongoDB', 'Express', 'React', 'Node.js'],
423
+ language: 'JavaScript/TypeScript'
424
+ },
425
+ 'django-drf': {
426
+ files: ['manage.py', 'requirements.txt'],
427
+ checks: ['djangorestframework'],
428
+ framework: 'Django + DRF',
429
+ confidence: 95,
430
+ features: ['Django', 'Django REST Framework'],
431
+ language: 'Python'
432
+ },
433
+ 'laravel-vue': {
434
+ files: ['artisan', 'resources/js/app.js'],
435
+ checks: ['vue'],
436
+ framework: 'Laravel + Vue',
437
+ confidence: 90,
438
+ features: ['Laravel', 'Vue.js'],
439
+ language: 'PHP/JavaScript'
440
+ },
441
+ 'fastapi': {
442
+ files: ['main.py', 'requirements.txt'],
443
+ checks: ['fastapi', 'uvicorn'],
444
+ framework: 'FastAPI',
445
+ confidence: 95,
446
+ features: ['FastAPI', 'Uvicorn'],
447
+ language: 'Python'
448
+ },
449
+ 'nestjs-graphql': {
450
+ files: ['nest-cli.json', 'src/app.module.ts'],
451
+ checks: ['@nestjs/graphql'],
452
+ framework: 'NestJS + GraphQL',
453
+ confidence: 95,
454
+ features: ['NestJS', 'GraphQL'],
455
+ language: 'TypeScript'
456
+ }
457
+ };
458
+ /**
459
+ * TIER 4: Configuration File Indicators
460
+ * Files that indicate specific tools, features, or deployment targets
461
+ */
462
+ exports.CONFIG_INDICATORS = {
463
+ // Testing Frameworks
464
+ 'jest.config.js': { feature: 'Jest', type: 'testing' },
465
+ 'jest.config.ts': { feature: 'Jest', type: 'testing' },
466
+ 'vitest.config.ts': { feature: 'Vitest', type: 'testing' },
467
+ 'cypress.config.js': { feature: 'Cypress', type: 'e2e-testing' },
468
+ 'playwright.config.ts': { feature: 'Playwright', type: 'e2e-testing' },
469
+ // Linting & Formatting
470
+ '.eslintrc.js': { feature: 'ESLint', type: 'linting' },
471
+ '.eslintrc.json': { feature: 'ESLint', type: 'linting' },
472
+ '.prettierrc': { feature: 'Prettier', type: 'formatting' },
473
+ 'biome.json': { feature: 'Biome', type: 'formatting' },
474
+ // CI/CD
475
+ '.github/workflows': { feature: 'GitHub Actions', type: 'ci-cd' },
476
+ '.gitlab-ci.yml': { feature: 'GitLab CI', type: 'ci-cd' },
477
+ 'Jenkinsfile': { feature: 'Jenkins', type: 'ci-cd' },
478
+ '.circleci/config.yml': { feature: 'CircleCI', type: 'ci-cd' },
479
+ // Deployment
480
+ 'vercel.json': { feature: 'Vercel', type: 'deployment' },
481
+ 'netlify.toml': { feature: 'Netlify', type: 'deployment' },
482
+ 'render.yaml': { feature: 'Render', type: 'deployment' },
483
+ 'fly.toml': { feature: 'Fly.io', type: 'deployment' },
484
+ 'railway.json': { feature: 'Railway', type: 'deployment' },
485
+ 'Dockerfile': { feature: 'Docker', type: 'containerization' },
486
+ 'docker-compose.yml': { feature: 'Docker Compose', type: 'orchestration' },
487
+ // Database/ORM
488
+ 'prisma/schema.prisma': { feature: 'Prisma', type: 'orm' },
489
+ 'drizzle.config.ts': { feature: 'Drizzle', type: 'orm' },
490
+ 'ormconfig.js': { feature: 'TypeORM', type: 'orm' },
491
+ 'knexfile.js': { feature: 'Knex.js', type: 'query-builder' },
492
+ // Monorepo Tools
493
+ 'nx.json': { feature: 'Nx', type: 'monorepo' },
494
+ 'turbo.json': { feature: 'Turborepo', type: 'monorepo' },
495
+ 'lerna.json': { feature: 'Lerna', type: 'monorepo' },
496
+ 'rush.json': { feature: 'Rush', type: 'monorepo' },
497
+ 'pnpm-workspace.yaml': { feature: 'pnpm workspaces', type: 'monorepo' }
498
+ };
499
+ /**
500
+ * TIER 5: Package Manager Indicators
501
+ * Lock files that indicate the package manager being used
502
+ */
503
+ exports.PACKAGE_MANAGERS = {
504
+ 'package-lock.json': 'npm',
505
+ 'yarn.lock': 'yarn',
506
+ 'pnpm-lock.yaml': 'pnpm',
507
+ 'bun.lockb': 'bun',
508
+ 'Gemfile.lock': 'bundler',
509
+ 'Pipfile.lock': 'pipenv',
510
+ 'poetry.lock': 'poetry',
511
+ 'composer.lock': 'composer',
512
+ 'Cargo.lock': 'cargo',
513
+ 'go.sum': 'go modules',
514
+ 'Package.resolved': 'swift-pm',
515
+ 'Podfile.lock': 'cocoapods'
516
+ };
517
+ /**
518
+ * Main Detection Class
519
+ */
520
+ class FrameworkDetector {
521
+ projectPath;
522
+ detectionStartTime;
523
+ constructor(projectPath) {
524
+ this.projectPath = projectPath;
525
+ this.detectionStartTime = Date.now();
526
+ }
527
+ /**
528
+ * Run the complete detection pipeline
529
+ */
530
+ async detect() {
531
+ // Phase 1: Check unique signatures (fastest)
532
+ const uniqueResult = await this.checkUniqueSignatures();
533
+ if (uniqueResult) {
534
+ return this.createResult(uniqueResult, 'unique');
535
+ }
536
+ // Phase 2: Check directory patterns
537
+ const dirResult = await this.checkDirectoryPatterns();
538
+ if (dirResult && dirResult.confidence && dirResult.confidence > 80) {
539
+ return this.createResult(dirResult, 'directory');
540
+ }
541
+ // Phase 3: Check file combinations
542
+ const comboResult = await this.checkCombinations();
543
+ if (comboResult && comboResult.confidence && comboResult.confidence > 70) {
544
+ return this.createResult(comboResult, 'combination');
545
+ }
546
+ // Phase 4: Package analysis fallback
547
+ const packageResult = await this.analyzePackages();
548
+ return this.createResult(packageResult, 'package');
549
+ }
550
+ /**
551
+ * Check for unique file signatures
552
+ */
553
+ async checkUniqueSignatures() {
554
+ const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
555
+ const path = await Promise.resolve().then(() => __importStar(require('path')));
556
+ for (const [file, signature] of Object.entries(exports.UNIQUE_SIGNATURES)) {
557
+ const filePath = path.join(this.projectPath, file);
558
+ try {
559
+ await fs.access(filePath);
560
+ // File exists, check additional conditions if needed
561
+ if (signature.additionalCheck) {
562
+ const content = await fs.readFile(filePath, 'utf-8');
563
+ if (!content.includes(signature.additionalCheck.split(':')[1])) {
564
+ continue;
565
+ }
566
+ }
567
+ // Get version if needed
568
+ let version;
569
+ if (signature.versionCheck) {
570
+ version = await this.getVersionFromPackageJson(signature.versionCheck);
571
+ }
572
+ return {
573
+ framework: signature.framework,
574
+ confidence: signature.confidence,
575
+ version,
576
+ ecosystem: signature.ecosystem,
577
+ language: signature.language,
578
+ features: []
579
+ };
580
+ }
581
+ catch {
582
+ // File doesn't exist, continue checking
583
+ continue;
584
+ }
585
+ }
586
+ return null;
587
+ }
588
+ /**
589
+ * Check directory patterns
590
+ */
591
+ async checkDirectoryPatterns() {
592
+ const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
593
+ const path = await Promise.resolve().then(() => __importStar(require('path')));
594
+ for (const [pattern, signature] of Object.entries(exports.DIRECTORY_PATTERNS)) {
595
+ const fullPath = path.join(this.projectPath, pattern);
596
+ try {
597
+ const stats = await fs.stat(fullPath);
598
+ if (stats.isDirectory() || stats.isFile()) {
599
+ return {
600
+ framework: signature.framework,
601
+ confidence: signature.confidence,
602
+ language: signature.language,
603
+ features: []
604
+ };
605
+ }
606
+ }
607
+ catch {
608
+ continue;
609
+ }
610
+ }
611
+ return null;
612
+ }
613
+ /**
614
+ * Check file combinations
615
+ */
616
+ async checkCombinations() {
617
+ const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
618
+ const path = await Promise.resolve().then(() => __importStar(require('path')));
619
+ for (const [key, pattern] of Object.entries(exports.COMBINATION_PATTERNS)) {
620
+ let allFilesExist = true;
621
+ for (const file of pattern.files) {
622
+ const filePath = path.join(this.projectPath, file);
623
+ try {
624
+ await fs.access(filePath);
625
+ }
626
+ catch {
627
+ allFilesExist = false;
628
+ break;
629
+ }
630
+ }
631
+ if (allFilesExist) {
632
+ // Check additional conditions
633
+ if ('checks' in pattern && pattern.checks) {
634
+ const packageJson = await this.readPackageJson();
635
+ if (packageJson) {
636
+ for (const check of ('checks' in pattern ? pattern.checks : [])) {
637
+ const deps = {
638
+ ...packageJson.dependencies,
639
+ ...packageJson.devDependencies
640
+ };
641
+ if (!deps[check]) {
642
+ allFilesExist = false;
643
+ break;
644
+ }
645
+ }
646
+ }
647
+ }
648
+ if (allFilesExist) {
649
+ return {
650
+ framework: pattern.framework,
651
+ confidence: pattern.confidence,
652
+ features: pattern.features || [],
653
+ language: pattern.language
654
+ };
655
+ }
656
+ }
657
+ }
658
+ return null;
659
+ }
660
+ /**
661
+ * Analyze package.json as fallback
662
+ */
663
+ async analyzePackages() {
664
+ const packageJson = await this.readPackageJson();
665
+ if (!packageJson) {
666
+ return {
667
+ framework: 'Unknown',
668
+ confidence: 0,
669
+ features: []
670
+ };
671
+ }
672
+ const deps = {
673
+ ...packageJson.dependencies,
674
+ ...packageJson.devDependencies
675
+ };
676
+ // Check for common frameworks in dependencies
677
+ const frameworkChecks = [
678
+ { dep: 'next', framework: 'Next.js' },
679
+ { dep: '@angular/core', framework: 'Angular' },
680
+ { dep: 'vue', framework: 'Vue' },
681
+ { dep: 'react', framework: 'React' },
682
+ { dep: 'svelte', framework: 'Svelte' },
683
+ { dep: '@remix-run/node', framework: 'Remix' },
684
+ { dep: 'gatsby', framework: 'Gatsby' },
685
+ { dep: 'astro', framework: 'Astro' },
686
+ { dep: '@nestjs/core', framework: 'NestJS' },
687
+ { dep: 'express', framework: 'Express.js' },
688
+ { dep: 'fastify', framework: 'Fastify' }
689
+ ];
690
+ for (const check of frameworkChecks) {
691
+ if (deps[check.dep]) {
692
+ return {
693
+ framework: check.framework,
694
+ confidence: 70,
695
+ version: deps[check.dep],
696
+ features: Object.keys(deps).slice(0, 10),
697
+ language: 'JavaScript/TypeScript'
698
+ };
699
+ }
700
+ }
701
+ return {
702
+ framework: 'Node.js Project',
703
+ confidence: 50,
704
+ features: Object.keys(deps).slice(0, 10),
705
+ language: 'JavaScript/TypeScript'
706
+ };
707
+ }
708
+ /**
709
+ * Helper: Read package.json
710
+ */
711
+ async readPackageJson() {
712
+ const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
713
+ const path = await Promise.resolve().then(() => __importStar(require('path')));
714
+ try {
715
+ const content = await fs.readFile(path.join(this.projectPath, 'package.json'), 'utf-8');
716
+ return JSON.parse(content);
717
+ }
718
+ catch {
719
+ return null;
720
+ }
721
+ }
722
+ /**
723
+ * Helper: Get version from package.json
724
+ */
725
+ async getVersionFromPackageJson(check) {
726
+ const [file, dep] = check.split(':');
727
+ if (file !== 'package.json')
728
+ return undefined;
729
+ const packageJson = await this.readPackageJson();
730
+ if (!packageJson)
731
+ return undefined;
732
+ return packageJson.dependencies?.[dep] ||
733
+ packageJson.devDependencies?.[dep];
734
+ }
735
+ /**
736
+ * Create final detection result
737
+ */
738
+ createResult(partial, detectedBy) {
739
+ return {
740
+ framework: partial.framework || 'Unknown',
741
+ confidence: partial.confidence || 0,
742
+ version: partial.version,
743
+ ecosystem: partial.ecosystem,
744
+ language: partial.language,
745
+ features: partial.features || [],
746
+ deployment: partial.deployment,
747
+ database: partial.database,
748
+ testing: partial.testing,
749
+ monorepo: partial.monorepo,
750
+ detectedBy,
751
+ detectionTime: Date.now() - this.detectionStartTime
752
+ };
753
+ }
754
+ }
755
+ exports.FrameworkDetector = FrameworkDetector;
756
+ /**
757
+ * Export a simple detection function for CLI usage
758
+ */
759
+ async function detectFramework(projectPath = '.') {
760
+ const detector = new FrameworkDetector(projectPath);
761
+ return detector.detect();
762
+ }
763
+ /**
764
+ * CLI Usage Example
765
+ */
766
+ if (require.main === module) {
767
+ detectFramework(process.argv[2] || '.').then(result => {
768
+ console.log('🏎️ Framework Detection Result:');
769
+ console.log(` Framework: ${result.framework} (${result.confidence}% confidence)`);
770
+ console.log(` Language: ${result.language || 'Unknown'}`);
771
+ console.log(` Ecosystem: ${result.ecosystem || 'Unknown'}`);
772
+ console.log(` Detected by: ${result.detectedBy}`);
773
+ console.log(` Detection time: ${result.detectionTime}ms`);
774
+ if (result.version) {
775
+ console.log(` Version: ${result.version}`);
776
+ }
777
+ if (result.features.length > 0) {
778
+ console.log(` Features: ${result.features.join(', ')}`);
779
+ }
780
+ });
781
+ }
782
+ //# sourceMappingURL=framework-detector.js.map