@l4yercak3/cli 1.3.2 → 2.0.0-alpha.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 (357) hide show
  1. package/README.md +10 -220
  2. package/dist/api/client.d.ts +12 -0
  3. package/dist/api/client.d.ts.map +1 -0
  4. package/dist/api/client.js +37 -0
  5. package/dist/api/client.js.map +1 -0
  6. package/dist/api/platform.d.ts +161 -0
  7. package/dist/api/platform.d.ts.map +1 -0
  8. package/dist/api/platform.js +70 -0
  9. package/dist/api/platform.js.map +1 -0
  10. package/dist/bin/sevenlayers.d.ts +3 -0
  11. package/dist/bin/sevenlayers.d.ts.map +1 -0
  12. package/dist/bin/sevenlayers.js +198 -0
  13. package/dist/bin/sevenlayers.js.map +1 -0
  14. package/dist/commands/agent/catalog.d.ts +5 -0
  15. package/dist/commands/agent/catalog.d.ts.map +1 -0
  16. package/dist/commands/agent/catalog.js +142 -0
  17. package/dist/commands/agent/catalog.js.map +1 -0
  18. package/dist/commands/agent/drift.d.ts +5 -0
  19. package/dist/commands/agent/drift.d.ts.map +1 -0
  20. package/dist/commands/agent/drift.js +113 -0
  21. package/dist/commands/agent/drift.js.map +1 -0
  22. package/dist/commands/agent/init.d.ts +5 -0
  23. package/dist/commands/agent/init.d.ts.map +1 -0
  24. package/dist/commands/agent/init.js +75 -0
  25. package/dist/commands/agent/init.js.map +1 -0
  26. package/dist/commands/agent/permissions.d.ts +5 -0
  27. package/dist/commands/agent/permissions.d.ts.map +1 -0
  28. package/dist/commands/agent/permissions.js +88 -0
  29. package/dist/commands/agent/permissions.js.map +1 -0
  30. package/dist/commands/agent/runner.d.ts +14 -0
  31. package/dist/commands/agent/runner.d.ts.map +1 -0
  32. package/dist/commands/agent/runner.js +59 -0
  33. package/dist/commands/agent/runner.js.map +1 -0
  34. package/dist/commands/agent/shared.d.ts +13 -0
  35. package/dist/commands/agent/shared.d.ts.map +1 -0
  36. package/dist/commands/agent/shared.js +31 -0
  37. package/dist/commands/agent/shared.js.map +1 -0
  38. package/dist/commands/agent/template.d.ts +5 -0
  39. package/dist/commands/agent/template.d.ts.map +1 -0
  40. package/dist/commands/agent/template.js +104 -0
  41. package/dist/commands/agent/template.js.map +1 -0
  42. package/dist/commands/app/connect.d.ts +7 -0
  43. package/dist/commands/app/connect.d.ts.map +1 -0
  44. package/dist/commands/app/connect.js +12 -0
  45. package/dist/commands/app/connect.js.map +1 -0
  46. package/dist/commands/app/init.d.ts +7 -0
  47. package/dist/commands/app/init.d.ts.map +1 -0
  48. package/dist/commands/app/init.js +12 -0
  49. package/dist/commands/app/init.js.map +1 -0
  50. package/dist/commands/app/link.d.ts +3 -0
  51. package/dist/commands/app/link.d.ts.map +1 -0
  52. package/dist/commands/app/link.js +92 -0
  53. package/dist/commands/app/link.js.map +1 -0
  54. package/dist/commands/app/pages.d.ts +15 -0
  55. package/dist/commands/app/pages.d.ts.map +1 -0
  56. package/dist/commands/app/pages.js +180 -0
  57. package/dist/commands/app/pages.js.map +1 -0
  58. package/dist/commands/app/register.d.ts +3 -0
  59. package/dist/commands/app/register.d.ts.map +1 -0
  60. package/dist/commands/app/register.js +120 -0
  61. package/dist/commands/app/register.js.map +1 -0
  62. package/dist/commands/app/remote.d.ts +14 -0
  63. package/dist/commands/app/remote.d.ts.map +1 -0
  64. package/dist/commands/app/remote.js +44 -0
  65. package/dist/commands/app/remote.js.map +1 -0
  66. package/dist/commands/app/setup.d.ts +3 -0
  67. package/dist/commands/app/setup.d.ts.map +1 -0
  68. package/dist/commands/app/setup.js +299 -0
  69. package/dist/commands/app/setup.js.map +1 -0
  70. package/dist/commands/app/shared.d.ts +9 -0
  71. package/dist/commands/app/shared.d.ts.map +1 -0
  72. package/dist/commands/app/shared.js +122 -0
  73. package/dist/commands/app/shared.js.map +1 -0
  74. package/dist/commands/app/sync.d.ts +7 -0
  75. package/dist/commands/app/sync.d.ts.map +1 -0
  76. package/dist/commands/app/sync.js +107 -0
  77. package/dist/commands/app/sync.js.map +1 -0
  78. package/dist/commands/booking/check.d.ts +3 -0
  79. package/dist/commands/booking/check.d.ts.map +1 -0
  80. package/dist/commands/booking/check.js +68 -0
  81. package/dist/commands/booking/check.js.map +1 -0
  82. package/dist/commands/booking/setup.d.ts +3 -0
  83. package/dist/commands/booking/setup.d.ts.map +1 -0
  84. package/dist/commands/booking/setup.js +95 -0
  85. package/dist/commands/booking/setup.js.map +1 -0
  86. package/dist/commands/booking/shared.d.ts +31 -0
  87. package/dist/commands/booking/shared.d.ts.map +1 -0
  88. package/dist/commands/booking/shared.js +112 -0
  89. package/dist/commands/booking/shared.js.map +1 -0
  90. package/dist/commands/booking/smoke.d.ts +3 -0
  91. package/dist/commands/booking/smoke.d.ts.map +1 -0
  92. package/dist/commands/booking/smoke.js +101 -0
  93. package/dist/commands/booking/smoke.js.map +1 -0
  94. package/dist/commands/cms/bind.d.ts +3 -0
  95. package/dist/commands/cms/bind.d.ts.map +1 -0
  96. package/dist/commands/cms/bind.js +212 -0
  97. package/dist/commands/cms/bind.js.map +1 -0
  98. package/dist/commands/cms/content.d.ts +40 -0
  99. package/dist/commands/cms/content.d.ts.map +1 -0
  100. package/dist/commands/cms/content.js +169 -0
  101. package/dist/commands/cms/content.js.map +1 -0
  102. package/dist/commands/cms/doctor.d.ts +3 -0
  103. package/dist/commands/cms/doctor.d.ts.map +1 -0
  104. package/dist/commands/cms/doctor.js +69 -0
  105. package/dist/commands/cms/doctor.js.map +1 -0
  106. package/dist/commands/cms/migrate.d.ts +3 -0
  107. package/dist/commands/cms/migrate.d.ts.map +1 -0
  108. package/dist/commands/cms/migrate.js +78 -0
  109. package/dist/commands/cms/migrate.js.map +1 -0
  110. package/dist/commands/cms/registry.d.ts +3 -0
  111. package/dist/commands/cms/registry.d.ts.map +1 -0
  112. package/dist/commands/cms/registry.js +161 -0
  113. package/dist/commands/cms/registry.js.map +1 -0
  114. package/dist/commands/cms/seed.d.ts +3 -0
  115. package/dist/commands/cms/seed.d.ts.map +1 -0
  116. package/dist/commands/cms/seed.js +102 -0
  117. package/dist/commands/cms/seed.js.map +1 -0
  118. package/dist/commands/cms/shared.d.ts +22 -0
  119. package/dist/commands/cms/shared.d.ts.map +1 -0
  120. package/dist/commands/cms/shared.js +82 -0
  121. package/dist/commands/cms/shared.js.map +1 -0
  122. package/dist/commands/doctor/target.d.ts +3 -0
  123. package/dist/commands/doctor/target.d.ts.map +1 -0
  124. package/dist/commands/doctor/target.js +46 -0
  125. package/dist/commands/doctor/target.js.map +1 -0
  126. package/dist/commands/env/list.d.ts +3 -0
  127. package/dist/commands/env/list.d.ts.map +1 -0
  128. package/dist/commands/env/list.js +28 -0
  129. package/dist/commands/env/list.js.map +1 -0
  130. package/dist/commands/env/set.d.ts +3 -0
  131. package/dist/commands/env/set.d.ts.map +1 -0
  132. package/dist/commands/env/set.js +36 -0
  133. package/dist/commands/env/set.js.map +1 -0
  134. package/dist/commands/env/use.d.ts +3 -0
  135. package/dist/commands/env/use.d.ts.map +1 -0
  136. package/dist/commands/env/use.js +15 -0
  137. package/dist/commands/env/use.js.map +1 -0
  138. package/dist/commands/legacy/connect.d.ts +3 -0
  139. package/dist/commands/legacy/connect.d.ts.map +1 -0
  140. package/dist/commands/legacy/connect.js +8 -0
  141. package/dist/commands/legacy/connect.js.map +1 -0
  142. package/dist/commands/legacy/pages.d.ts +3 -0
  143. package/dist/commands/legacy/pages.d.ts.map +1 -0
  144. package/dist/commands/legacy/pages.js +16 -0
  145. package/dist/commands/legacy/pages.js.map +1 -0
  146. package/dist/commands/legacy/spread.d.ts +3 -0
  147. package/dist/commands/legacy/spread.d.ts.map +1 -0
  148. package/dist/commands/legacy/spread.js +8 -0
  149. package/dist/commands/legacy/spread.js.map +1 -0
  150. package/dist/commands/legacy/sync.d.ts +3 -0
  151. package/dist/commands/legacy/sync.d.ts.map +1 -0
  152. package/dist/commands/legacy/sync.js +8 -0
  153. package/dist/commands/legacy/sync.js.map +1 -0
  154. package/dist/config/env-diff.d.ts +10 -0
  155. package/dist/config/env-diff.d.ts.map +1 -0
  156. package/dist/config/env-diff.js +24 -0
  157. package/dist/config/env-diff.js.map +1 -0
  158. package/dist/config/env-parser.d.ts +20 -0
  159. package/dist/config/env-parser.d.ts.map +1 -0
  160. package/dist/config/env-parser.js +70 -0
  161. package/dist/config/env-parser.js.map +1 -0
  162. package/dist/config/env-writer.d.ts +22 -0
  163. package/dist/config/env-writer.d.ts.map +1 -0
  164. package/dist/config/env-writer.js +172 -0
  165. package/dist/config/env-writer.js.map +1 -0
  166. package/dist/config/profile-store.d.ts +29 -0
  167. package/dist/config/profile-store.d.ts.map +1 -0
  168. package/dist/config/profile-store.js +257 -0
  169. package/dist/config/profile-store.js.map +1 -0
  170. package/dist/core/args.d.ts +11 -0
  171. package/dist/core/args.d.ts.map +1 -0
  172. package/dist/core/args.js +106 -0
  173. package/dist/core/args.js.map +1 -0
  174. package/dist/core/colors.d.ts +6 -0
  175. package/dist/core/colors.d.ts.map +1 -0
  176. package/dist/core/colors.js +29 -0
  177. package/dist/core/colors.js.map +1 -0
  178. package/dist/safety/target-guard.d.ts +16 -0
  179. package/dist/safety/target-guard.d.ts.map +1 -0
  180. package/dist/safety/target-guard.js +55 -0
  181. package/dist/safety/target-guard.js.map +1 -0
  182. package/dist/testing/booking-smoke.d.ts +17 -0
  183. package/dist/testing/booking-smoke.d.ts.map +1 -0
  184. package/dist/testing/booking-smoke.js +43 -0
  185. package/dist/testing/booking-smoke.js.map +1 -0
  186. package/dist/tests/agent-commands.test.d.ts +2 -0
  187. package/dist/tests/agent-commands.test.d.ts.map +1 -0
  188. package/dist/tests/agent-commands.test.js +180 -0
  189. package/dist/tests/agent-commands.test.js.map +1 -0
  190. package/dist/tests/agent-governance.test.d.ts +2 -0
  191. package/dist/tests/agent-governance.test.d.ts.map +1 -0
  192. package/dist/tests/agent-governance.test.js +233 -0
  193. package/dist/tests/agent-governance.test.js.map +1 -0
  194. package/dist/tests/app-commands.test.d.ts +2 -0
  195. package/dist/tests/app-commands.test.d.ts.map +1 -0
  196. package/dist/tests/app-commands.test.js +462 -0
  197. package/dist/tests/app-commands.test.js.map +1 -0
  198. package/dist/tests/booking-commands.test.d.ts +2 -0
  199. package/dist/tests/booking-commands.test.d.ts.map +1 -0
  200. package/dist/tests/booking-commands.test.js +204 -0
  201. package/dist/tests/booking-commands.test.js.map +1 -0
  202. package/dist/tests/booking-smoke.test.d.ts +2 -0
  203. package/dist/tests/booking-smoke.test.d.ts.map +1 -0
  204. package/dist/tests/booking-smoke.test.js +183 -0
  205. package/dist/tests/booking-smoke.test.js.map +1 -0
  206. package/dist/tests/cms-commands.test.d.ts +2 -0
  207. package/dist/tests/cms-commands.test.d.ts.map +1 -0
  208. package/dist/tests/cms-commands.test.js +254 -0
  209. package/dist/tests/cms-commands.test.js.map +1 -0
  210. package/dist/tests/cms-ops.test.d.ts +2 -0
  211. package/dist/tests/cms-ops.test.d.ts.map +1 -0
  212. package/dist/tests/cms-ops.test.js +125 -0
  213. package/dist/tests/cms-ops.test.js.map +1 -0
  214. package/dist/tests/env-writer.test.d.ts +2 -0
  215. package/dist/tests/env-writer.test.d.ts.map +1 -0
  216. package/dist/tests/env-writer.test.js +90 -0
  217. package/dist/tests/env-writer.test.js.map +1 -0
  218. package/dist/tests/profile-store.test.d.ts +2 -0
  219. package/dist/tests/profile-store.test.d.ts.map +1 -0
  220. package/dist/tests/profile-store.test.js +88 -0
  221. package/dist/tests/profile-store.test.js.map +1 -0
  222. package/dist/tests/target-guard.test.d.ts +2 -0
  223. package/dist/tests/target-guard.test.d.ts.map +1 -0
  224. package/dist/tests/target-guard.test.js +132 -0
  225. package/dist/tests/target-guard.test.js.map +1 -0
  226. package/dist/ui/logo.d.ts +2 -0
  227. package/dist/ui/logo.d.ts.map +1 -0
  228. package/dist/ui/logo.js +22 -0
  229. package/dist/ui/logo.js.map +1 -0
  230. package/package.json +17 -53
  231. package/.claude/settings.local.json +0 -36
  232. package/.cursor/rules.md +0 -203
  233. package/.eslintrc.js +0 -31
  234. package/CLAUDE.md +0 -100
  235. package/bin/cli.js +0 -116
  236. package/docs/ADDING_FRAMEWORK_DETECTORS.md +0 -391
  237. package/docs/ADDING_NEW_PROJECT_TYPE.md +0 -156
  238. package/docs/ARCHITECTURE_RELATIONSHIPS.md +0 -411
  239. package/docs/CLI_AUTHENTICATION.md +0 -214
  240. package/docs/CLI_PAGE_DETECTION_REQUIREMENTS.md +0 -519
  241. package/docs/CRM-PIPELINES-SEQUENCES-SPEC.md +0 -429
  242. package/docs/DETECTOR_ARCHITECTURE.md +0 -326
  243. package/docs/DEVELOPMENT.md +0 -194
  244. package/docs/IMPLEMENTATION_PHASES.md +0 -468
  245. package/docs/INTEGRATION_PATHS_ARCHITECTURE.md +0 -1543
  246. package/docs/OAUTH_CLARIFICATION.md +0 -258
  247. package/docs/OAUTH_SETUP_GUIDE_TEMPLATE.md +0 -211
  248. package/docs/PHASE_0_PROGRESS.md +0 -120
  249. package/docs/PHASE_1_COMPLETE.md +0 -366
  250. package/docs/PHASE_SUMMARY.md +0 -149
  251. package/docs/PLAN.md +0 -511
  252. package/docs/README.md +0 -56
  253. package/docs/STRIPE_INTEGRATION.md +0 -447
  254. package/docs/SUMMARY.md +0 -230
  255. package/docs/UPDATED_PLAN.md +0 -447
  256. package/docs/mcp_server/MCP_EXTENSION_GUIDE.md +0 -1313
  257. package/docs/mcp_server/MCP_SERVER_ARCHITECTURE.md +0 -1481
  258. package/docs/mcp_server/applicationOntology.ts +0 -817
  259. package/docs/mcp_server/cliApplications.ts +0 -639
  260. package/docs/mcp_server/crmOntology.ts +0 -1063
  261. package/docs/mcp_server/eventOntology.ts +0 -1183
  262. package/docs/mcp_server/formsOntology.ts +0 -1401
  263. package/docs/mcp_server/ontologySchemas.ts +0 -185
  264. package/docs/mcp_server/schema.ts +0 -250
  265. package/docs/microsass_production_machine/CLI_API_REFERENCE.md +0 -1197
  266. package/docs/microsass_production_machine/CLI_PRODUCT_VISION.md +0 -676
  267. package/docs/microsass_production_machine/CLI_REQUIREMENTS.md +0 -606
  268. package/docs/microsass_production_machine/CONNECTED_APPLICATIONS_SPEC.md +0 -390
  269. package/docs/microsass_production_machine/IMPLEMENTATION_ROADMAP.md +0 -725
  270. package/docs/microsass_production_machine/OBJECT_MAPPINGS.md +0 -808
  271. package/docs/microsass_production_machine/REFERENCE_IMPLEMENTATION.md +0 -532
  272. package/src/api/backend-client.js +0 -449
  273. package/src/commands/api-keys.js +0 -119
  274. package/src/commands/connect.js +0 -253
  275. package/src/commands/login.js +0 -332
  276. package/src/commands/logout.js +0 -30
  277. package/src/commands/mcp-server.js +0 -85
  278. package/src/commands/mcp-setup.js +0 -686
  279. package/src/commands/pages.js +0 -317
  280. package/src/commands/scaffold.js +0 -409
  281. package/src/commands/spread.js +0 -861
  282. package/src/commands/status.js +0 -62
  283. package/src/commands/sync.js +0 -169
  284. package/src/commands/upgrade.js +0 -48
  285. package/src/config/config-manager.js +0 -206
  286. package/src/detectors/api-client-detector.js +0 -85
  287. package/src/detectors/base-detector.js +0 -77
  288. package/src/detectors/database-detector.js +0 -245
  289. package/src/detectors/expo-detector.js +0 -166
  290. package/src/detectors/github-detector.js +0 -74
  291. package/src/detectors/index.js +0 -106
  292. package/src/detectors/mapping-suggestor.js +0 -119
  293. package/src/detectors/model-detector.js +0 -318
  294. package/src/detectors/nextjs-detector.js +0 -139
  295. package/src/detectors/oauth-detector.js +0 -122
  296. package/src/detectors/page-detector.js +0 -480
  297. package/src/detectors/registry.js +0 -121
  298. package/src/generators/api-client-generator.js +0 -223
  299. package/src/generators/api-only/client.js +0 -683
  300. package/src/generators/api-only/index.js +0 -96
  301. package/src/generators/api-only/types.js +0 -618
  302. package/src/generators/api-only/webhooks.js +0 -377
  303. package/src/generators/env-generator.js +0 -191
  304. package/src/generators/expo-auth-generator.js +0 -1009
  305. package/src/generators/gitignore-generator.js +0 -92
  306. package/src/generators/index.js +0 -166
  307. package/src/generators/manifest-generator.js +0 -154
  308. package/src/generators/mcp-guide-generator.js +0 -256
  309. package/src/generators/nextauth-generator.js +0 -247
  310. package/src/generators/oauth-guide-generator.js +0 -277
  311. package/src/generators/quickstart/components/index.js +0 -1699
  312. package/src/generators/quickstart/components-mobile/index.js +0 -1440
  313. package/src/generators/quickstart/database/convex.js +0 -1257
  314. package/src/generators/quickstart/database/index.js +0 -34
  315. package/src/generators/quickstart/database/supabase.js +0 -1132
  316. package/src/generators/quickstart/hooks/index.js +0 -1065
  317. package/src/generators/quickstart/index.js +0 -191
  318. package/src/generators/quickstart/pages/index.js +0 -1466
  319. package/src/generators/quickstart/screens/index.js +0 -1498
  320. package/src/logo.js +0 -116
  321. package/src/mcp/auth.js +0 -127
  322. package/src/mcp/registry/domains/applications.js +0 -516
  323. package/src/mcp/registry/domains/benefits.js +0 -798
  324. package/src/mcp/registry/domains/codegen.js +0 -894
  325. package/src/mcp/registry/domains/core.js +0 -324
  326. package/src/mcp/registry/domains/crm.js +0 -591
  327. package/src/mcp/registry/domains/events.js +0 -649
  328. package/src/mcp/registry/domains/forms.js +0 -696
  329. package/src/mcp/registry/index.js +0 -164
  330. package/src/mcp/server.js +0 -116
  331. package/src/utils/file-utils.js +0 -117
  332. package/src/utils/init-helpers.js +0 -243
  333. package/src/utils/prompt-utils.js +0 -195
  334. package/templates/CLAUDE.md +0 -86
  335. package/tests/api-client-detector.test.js +0 -214
  336. package/tests/api-client-generator.test.js +0 -176
  337. package/tests/backend-client.test.js +0 -640
  338. package/tests/base-detector.test.js +0 -101
  339. package/tests/commands/login.test.js +0 -143
  340. package/tests/commands/logout.test.js +0 -84
  341. package/tests/commands/status.test.js +0 -167
  342. package/tests/config-manager.test.js +0 -321
  343. package/tests/database-detector.test.js +0 -221
  344. package/tests/detector-index.test.js +0 -209
  345. package/tests/detector-registry.test.js +0 -93
  346. package/tests/env-generator.test.js +0 -278
  347. package/tests/expo-detector.test.js +0 -263
  348. package/tests/file-utils.test.js +0 -194
  349. package/tests/generators-index.test.js +0 -454
  350. package/tests/github-detector.test.js +0 -145
  351. package/tests/gitignore-generator.test.js +0 -109
  352. package/tests/logo.test.js +0 -96
  353. package/tests/nextauth-generator.test.js +0 -255
  354. package/tests/nextjs-detector.test.js +0 -235
  355. package/tests/oauth-detector.test.js +0 -264
  356. package/tests/oauth-guide-generator.test.js +0 -273
  357. package/tests/page-detector.test.js +0 -371
@@ -1,326 +0,0 @@
1
- # Project Detector Architecture
2
-
3
- ## Overview
4
-
5
- The CLI uses a **plugin-based detector system** that can identify different project types (Next.js, React, Vue, Svelte, etc.) and generate appropriate boilerplate for each.
6
-
7
- ## Design Principles
8
-
9
- 1. **Extensibility**: Easy to add new project types without modifying core code
10
- 2. **Separation of Concerns**: Detectors detect, generators generate
11
- 3. **Type Safety**: Each project type has its own detector and generator
12
- 4. **Graceful Degradation**: CLI works even if project type isn't fully supported
13
-
14
- ---
15
-
16
- ## Architecture
17
-
18
- ### 1. Base Detector Interface
19
-
20
- All project detectors implement a common interface:
21
-
22
- ```javascript
23
- {
24
- name: string, // e.g., "nextjs", "react", "vue"
25
- priority: number, // Detection priority (higher = checked first)
26
- detect(projectPath): {
27
- detected: boolean, // Is this project type?
28
- confidence: number, // 0-1, how confident are we?
29
- metadata: object, // Type-specific metadata
30
- }
31
- }
32
- ```
33
-
34
- ### 2. Detector Registry
35
-
36
- Detectors are registered in a central registry:
37
-
38
- ```javascript
39
- // src/detectors/registry.js
40
- const detectors = [
41
- require('./nextjs-detector'),
42
- require('./react-detector'), // Future
43
- require('./vue-detector'), // Future
44
- // ... more detectors
45
- ];
46
- ```
47
-
48
- ### 3. Detection Flow
49
-
50
- ```
51
- 1. User runs `l4yercak3 spread`
52
- 2. CLI scans project directory
53
- 3. Runs all detectors (sorted by priority)
54
- 4. First detector with confidence > 0.8 wins
55
- 5. If no match, prompt user to select type
56
- 6. Use matched detector's metadata for generation
57
- ```
58
-
59
- ### 4. Generator Mapping
60
-
61
- Each project type maps to specific generators:
62
-
63
- ```javascript
64
- {
65
- nextjs: {
66
- generators: ['api-client', 'nextauth', 'env'],
67
- supportedFeatures: ['oauth', 'stripe', 'crm', 'projects', 'invoices']
68
- },
69
- react: {
70
- generators: ['api-client', 'env'],
71
- supportedFeatures: ['oauth', 'crm', 'projects'] // No NextAuth
72
- },
73
- vue: {
74
- generators: ['api-client', 'env'],
75
- supportedFeatures: ['oauth', 'crm', 'projects']
76
- }
77
- }
78
- ```
79
-
80
- ---
81
-
82
- ## Current Implementation (MVP)
83
-
84
- ### Phase 1: Next.js Only
85
-
86
- - ✅ `nextjs-detector.js` - Detects Next.js projects
87
- - ✅ `github-detector.js` - Detects Git/GitHub (framework-agnostic)
88
- - ✅ `api-client-detector.js` - Detects existing API clients (framework-agnostic)
89
-
90
- **Current Flow:**
91
- - If Next.js detected → Full feature support
92
- - If not Next.js → Warn user, but still allow basic setup
93
-
94
- ### Future: Multi-Framework Support
95
-
96
- When adding new frameworks:
97
-
98
- 1. **Create Detector** (`src/detectors/react-detector.js`)
99
- ```javascript
100
- class ReactDetector {
101
- name = 'react';
102
- priority = 50; // Lower than Next.js (100)
103
-
104
- detect(projectPath) {
105
- // Check for React-specific files
106
- return {
107
- detected: hasReact,
108
- confidence: 0.9,
109
- metadata: { version, hasTypeScript, ... }
110
- };
111
- }
112
- }
113
- ```
114
-
115
- 2. **Register Detector** (`src/detectors/registry.js`)
116
- ```javascript
117
- const detectors = [
118
- require('./nextjs-detector'),
119
- require('./react-detector'), // Add here
120
- ];
121
- ```
122
-
123
- 3. **Create Generators** (if needed)
124
- - React might need different OAuth setup (no NextAuth)
125
- - React might need different file structure
126
- - API client generator can be shared
127
-
128
- 4. **Update Feature Matrix** (`src/generators/feature-matrix.js`)
129
- ```javascript
130
- {
131
- react: {
132
- oauth: 'manual', // No NextAuth, manual setup
133
- stripe: 'full',
134
- crm: 'full',
135
- }
136
- }
137
- ```
138
-
139
- ---
140
-
141
- ## Detector Interface Specification
142
-
143
- ### Required Methods
144
-
145
- ```javascript
146
- class BaseDetector {
147
- /**
148
- * Unique identifier for this project type
149
- */
150
- get name() {
151
- return 'project-type';
152
- }
153
-
154
- /**
155
- * Detection priority (higher = checked first)
156
- * Range: 0-100
157
- */
158
- get priority() {
159
- return 50;
160
- }
161
-
162
- /**
163
- * Detect if project matches this type
164
- * @param {string} projectPath - Path to project directory
165
- * @returns {object} Detection result
166
- */
167
- detect(projectPath) {
168
- return {
169
- detected: boolean, // Is this the project type?
170
- confidence: number, // 0-1, how sure are we?
171
- metadata: { // Type-specific info
172
- version: string,
173
- hasTypeScript: boolean,
174
- // ... more metadata
175
- }
176
- };
177
- }
178
-
179
- /**
180
- * Get supported features for this project type
181
- * @returns {object} Feature support matrix
182
- */
183
- getSupportedFeatures() {
184
- return {
185
- oauth: boolean | 'manual', // true = full support, 'manual' = guide only, false = not supported
186
- stripe: boolean,
187
- crm: boolean,
188
- projects: boolean,
189
- invoices: boolean,
190
- };
191
- }
192
-
193
- /**
194
- * Get available generators for this project type
195
- * @returns {string[]} List of generator names
196
- */
197
- getAvailableGenerators() {
198
- return ['api-client', 'env'];
199
- }
200
- }
201
- ```
202
-
203
- ---
204
-
205
- ## Generator Interface Specification
206
-
207
- Generators are framework-agnostic where possible, but can be framework-specific when needed.
208
-
209
- ### Shared Generators (Work for all frameworks)
210
-
211
- - `api-client-generator.js` - Generates API client (framework-agnostic)
212
- - `env-generator.js` - Generates `.env.local.example` (framework-agnostic)
213
-
214
- ### Framework-Specific Generators
215
-
216
- - `nextauth-generator.js` - Next.js only (NextAuth.js)
217
- - `react-auth-generator.js` - React only (manual OAuth)
218
- - `vue-auth-generator.js` - Vue only (manual OAuth)
219
-
220
- ---
221
-
222
- ## Detection Priority System
223
-
224
- Detectors run in priority order. First match wins (if confidence > 0.8).
225
-
226
- **Priority Levels:**
227
- - **100**: Very specific frameworks (Next.js, Nuxt, SvelteKit)
228
- - **75**: Framework with build tool (Vite + React, Webpack + Vue)
229
- - **50**: Pure frameworks (React, Vue, Svelte)
230
- - **25**: Generic JavaScript/TypeScript projects
231
-
232
- **Example:**
233
- ```
234
- Next.js (100) → Detected first
235
- React + Vite (75) → Only checked if Next.js not detected
236
- React (50) → Only checked if above not detected
237
- Generic JS (25) → Fallback
238
- ```
239
-
240
- ---
241
-
242
- ## Adding a New Project Type
243
-
244
- ### Step-by-Step Guide
245
-
246
- 1. **Create Detector** (`src/detectors/myframework-detector.js`)
247
- ```javascript
248
- const BaseDetector = require('./base-detector');
249
-
250
- class MyFrameworkDetector extends BaseDetector {
251
- get name() { return 'myframework'; }
252
- get priority() { return 50; }
253
-
254
- detect(projectPath) {
255
- // Detection logic
256
- return {
257
- detected: true,
258
- confidence: 0.9,
259
- metadata: { version: '1.0.0' }
260
- };
261
- }
262
-
263
- getSupportedFeatures() {
264
- return {
265
- oauth: 'manual',
266
- stripe: true,
267
- crm: true,
268
- projects: true,
269
- invoices: false,
270
- };
271
- }
272
- }
273
-
274
- module.exports = new MyFrameworkDetector();
275
- ```
276
-
277
- 2. **Register Detector** (`src/detectors/registry.js`)
278
- ```javascript
279
- const detectors = [
280
- require('./nextjs-detector'),
281
- require('./myframework-detector'), // Add here
282
- ];
283
- ```
284
-
285
- 3. **Create Generators** (if needed)
286
- - Check if existing generators work
287
- - Create framework-specific generators if needed
288
-
289
- 4. **Test**
290
- - Run `l4yercak3 spread` in a MyFramework project
291
- - Verify detection works
292
- - Verify generation works
293
-
294
- ---
295
-
296
- ## Current Status
297
-
298
- ### ✅ Implemented (Phase 1)
299
- - Next.js detector (full support)
300
- - GitHub detector (framework-agnostic)
301
- - API client detector (framework-agnostic)
302
- - Basic registry system
303
-
304
- ### 🚧 Future (Phase 4+)
305
- - React detector
306
- - Vue detector
307
- - Svelte detector
308
- - Generic JavaScript/TypeScript detector
309
- - Framework-specific generators
310
-
311
- ---
312
-
313
- ## Benefits of This Architecture
314
-
315
- 1. **Easy to Extend**: Add new detectors without touching core code
316
- 2. **Type Safety**: Each framework has its own detection logic
317
- 3. **Feature Gating**: Can disable features per framework
318
- 4. **Graceful Degradation**: Works even if framework not fully supported
319
- 5. **Maintainable**: Clear separation between detection and generation
320
-
321
- ---
322
-
323
- **Last Updated:** 2025-01-14
324
- **Status:** Phase 1 (Next.js only)
325
- **Next:** Ready for multi-framework support when needed
326
-
@@ -1,194 +0,0 @@
1
- # Development Guide
2
-
3
- ## Quick Start
4
-
5
- ```bash
6
- # Install dependencies
7
- npm install
8
-
9
- # Run the CLI locally
10
- npm start
11
-
12
- # Or link globally for testing
13
- npm link
14
- l4yercak3
15
- ```
16
-
17
- ## Development Standards
18
-
19
- ### Quality Checks
20
-
21
- Before committing, always run:
22
-
23
- ```bash
24
- npm run verify
25
- ```
26
-
27
- This runs:
28
- - ✅ Linting (`npm run lint`)
29
- - ✅ Type checking (`npm run type-check`)
30
- - ✅ Build verification (`npm run build`)
31
-
32
- ### Individual Commands
33
-
34
- ```bash
35
- # Lint code
36
- npm run lint
37
-
38
- # Fix linting issues automatically
39
- npm run lint:fix
40
-
41
- # Check types
42
- npm run type-check
43
-
44
- # Verify build
45
- npm run build
46
- ```
47
-
48
- ## Project Structure
49
-
50
- ```
51
- l4yercak3-cli/
52
- ├── .cursor/
53
- │ └── rules.md # Development rules for Cursor AI
54
- ├── bin/
55
- │ └── cli.js # CLI entry point
56
- ├── src/
57
- │ └── logo.js # Logo display module
58
- ├── .eslintrc.js # ESLint configuration
59
- ├── .gitignore # Git ignore rules
60
- ├── package.json # Package configuration
61
- ├── PLAN.md # Strategic plan document
62
- ├── README.md # User documentation
63
- └── DEVELOPMENT.md # This file
64
- ```
65
-
66
- ## Adding New Features
67
-
68
- ### 1. Create Feature Branch
69
- ```bash
70
- git checkout -b feature/your-feature-name
71
- ```
72
-
73
- ### 2. Implement Feature
74
- - Follow code standards in `.cursor/rules.md`
75
- - Add JSDoc comments
76
- - Keep functions small and focused
77
-
78
- ### 3. Test Locally
79
- ```bash
80
- npm link
81
- # Test in a real project
82
- cd ~/Development/test-project
83
- l4yercak3 your-command
84
- ```
85
-
86
- ### 4. Run Quality Checks
87
- ```bash
88
- npm run verify
89
- ```
90
-
91
- ### 5. Commit and Push
92
- ```bash
93
- git add .
94
- git commit -m "feat: add your feature"
95
- git push origin feature/your-feature-name
96
- ```
97
-
98
- ## Code Style
99
-
100
- ### JavaScript/Node.js
101
- - Use CommonJS (`require`/`module.exports`)
102
- - Use async/await for async operations
103
- - Handle errors with try/catch
104
- - Use meaningful variable names
105
-
106
- ### Example
107
- ```javascript
108
- const chalk = require('chalk');
109
-
110
- async function doSomething() {
111
- try {
112
- console.log(chalk.green('Success!'));
113
- } catch (error) {
114
- console.error(chalk.red('Error:'), error.message);
115
- }
116
- }
117
- ```
118
-
119
- ## Testing
120
-
121
- ### Manual Testing
122
- 1. Link package: `npm link`
123
- 2. Test in example project
124
- 3. Verify all features work
125
- 4. Check error handling
126
-
127
- ### Example Projects
128
- - `~/Development/l4yercak3-landing`
129
- - `~/Development/freelancer-client-portal`
130
-
131
- ## Publishing
132
-
133
- ### Before Publishing
134
- 1. Update version in `package.json`
135
- 2. Update CHANGELOG.md (if exists)
136
- 3. Run `npm run verify`
137
- 4. Test installation: `npm pack` then `npm install -g *.tgz`
138
-
139
- ### Publishing Steps
140
- ```bash
141
- # Login to npm (if needed)
142
- npm login
143
-
144
- # Publish
145
- npm publish --access public
146
- ```
147
-
148
- ### Version Management
149
- ```bash
150
- # Patch version (1.0.0 → 1.0.1)
151
- npm version patch
152
-
153
- # Minor version (1.0.0 → 1.1.0)
154
- npm version minor
155
-
156
- # Major version (1.0.0 → 2.0.0)
157
- npm version major
158
- ```
159
-
160
- ## Troubleshooting
161
-
162
- ### Command Not Found After `npm link`
163
- ```bash
164
- # Check executable permissions
165
- chmod +x bin/cli.js
166
-
167
- # Verify npm bin path
168
- npm bin -g
169
-
170
- # Try unlinking and relinking
171
- npm unlink
172
- npm link
173
- ```
174
-
175
- ### Linting Errors
176
- ```bash
177
- # Auto-fix what can be fixed
178
- npm run lint:fix
179
-
180
- # Check specific file
181
- npx eslint bin/cli.js
182
- ```
183
-
184
- ### Build Errors
185
- - Check Node.js version: `node --version` (should be >=14)
186
- - Verify package.json structure
187
- - Check for syntax errors
188
-
189
- ## Resources
190
-
191
- - [Plan Document](./PLAN.md) - Strategic plan and roadmap
192
- - [Development Rules](./.cursor/rules.md) - Detailed coding standards
193
- - [README](./README.md) - User documentation
194
-