@l4yercak3/cli 1.3.2 → 2.0.0-alpha.1

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,1440 +0,0 @@
1
- /**
2
- * Mobile Component Generator
3
- * Generates React Native components for Expo/React Native projects
4
- */
5
-
6
- const fs = require('fs');
7
- const path = require('path');
8
- const { ensureDir, writeFileWithBackup, checkFileOverwrite } = require('../../../utils/file-utils');
9
-
10
- class MobileComponentGenerator {
11
- /**
12
- * Generate React Native components based on selected features
13
- * @param {Object} options - Generation options
14
- * @returns {Promise<Object>} - Generated file paths
15
- */
16
- async generate(options) {
17
- const { projectPath, features = [], isTypeScript } = options;
18
-
19
- const results = {};
20
-
21
- // Determine output directory for Expo
22
- let outputDir;
23
- if (fs.existsSync(path.join(projectPath, 'src'))) {
24
- outputDir = path.join(projectPath, 'src', 'components', 'l4yercak3');
25
- } else if (fs.existsSync(path.join(projectPath, 'app'))) {
26
- // Expo Router uses app/ directory
27
- outputDir = path.join(projectPath, 'components', 'l4yercak3');
28
- } else {
29
- outputDir = path.join(projectPath, 'components', 'l4yercak3');
30
- }
31
-
32
- ensureDir(outputDir);
33
-
34
- const ext = isTypeScript ? 'tsx' : 'jsx';
35
-
36
- // Generate CRM components
37
- if (features.includes('crm')) {
38
- results.contactList = await this.generateContactList(outputDir, ext, isTypeScript);
39
- results.contactCard = await this.generateContactCard(outputDir, ext, isTypeScript);
40
- }
41
-
42
- // Generate Events components
43
- if (features.includes('events')) {
44
- results.eventList = await this.generateEventList(outputDir, ext, isTypeScript);
45
- results.eventCard = await this.generateEventCard(outputDir, ext, isTypeScript);
46
- }
47
-
48
- // Generate Products components
49
- if (features.includes('products') || features.includes('checkout')) {
50
- results.productCard = await this.generateProductCard(outputDir, ext, isTypeScript);
51
- }
52
-
53
- // Generate component index
54
- results.index = await this.generateIndex(outputDir, ext, features);
55
-
56
- return results;
57
- }
58
-
59
- async generateContactList(outputDir, ext, isTypeScript) {
60
- const outputPath = path.join(outputDir, `ContactList.${ext}`);
61
-
62
- const action = await checkFileOverwrite(outputPath);
63
- if (action === 'skip') {
64
- return null;
65
- }
66
-
67
- const content = isTypeScript
68
- ? this.getContactListTS()
69
- : this.getContactListJS();
70
-
71
- return writeFileWithBackup(outputPath, content, action);
72
- }
73
-
74
- getContactListTS() {
75
- return `/**
76
- * ContactList Component (React Native)
77
- * Displays a searchable list of contacts
78
- * Auto-generated by @l4yercak3/cli
79
- */
80
-
81
- import React, { useState } from 'react';
82
- import {
83
- View,
84
- FlatList,
85
- TextInput,
86
- ActivityIndicator,
87
- StyleSheet,
88
- RefreshControl,
89
- } from 'react-native';
90
- import { useContacts } from '../lib/l4yercak3/hooks/use-contacts';
91
- import { ContactCard } from './ContactCard';
92
- import type { Contact } from '../lib/l4yercak3/types';
93
-
94
- interface ContactListProps {
95
- onSelect?: (contact: Contact) => void;
96
- }
97
-
98
- export function ContactList({ onSelect }: ContactListProps) {
99
- const [search, setSearch] = useState('');
100
- const [refreshing, setRefreshing] = useState(false);
101
-
102
- const { data, isLoading, error, refetch } = useContacts({
103
- search: search || undefined,
104
- });
105
-
106
- const contacts = data?.contacts || [];
107
-
108
- const handleRefresh = async () => {
109
- setRefreshing(true);
110
- await refetch();
111
- setRefreshing(false);
112
- };
113
-
114
- if (isLoading && !refreshing) {
115
- return (
116
- <View style={styles.centered}>
117
- <ActivityIndicator size="large" color="#3B82F6" />
118
- </View>
119
- );
120
- }
121
-
122
- if (error) {
123
- return (
124
- <View style={styles.errorContainer}>
125
- <Text style={styles.errorText}>Failed to load contacts</Text>
126
- </View>
127
- );
128
- }
129
-
130
- return (
131
- <View style={styles.container}>
132
- <TextInput
133
- style={styles.searchInput}
134
- placeholder="Search contacts..."
135
- value={search}
136
- onChangeText={setSearch}
137
- placeholderTextColor="#9CA3AF"
138
- />
139
-
140
- <FlatList
141
- data={contacts}
142
- keyExtractor={(item) => item.id}
143
- renderItem={({ item }) => (
144
- <ContactCard
145
- contact={item}
146
- onPress={() => onSelect?.(item)}
147
- />
148
- )}
149
- refreshControl={
150
- <RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
151
- }
152
- contentContainerStyle={styles.list}
153
- ListEmptyComponent={
154
- <View style={styles.emptyContainer}>
155
- <Text style={styles.emptyText}>No contacts found</Text>
156
- </View>
157
- }
158
- />
159
- </View>
160
- );
161
- }
162
-
163
- const styles = StyleSheet.create({
164
- container: {
165
- flex: 1,
166
- backgroundColor: '#F9FAFB',
167
- },
168
- centered: {
169
- flex: 1,
170
- justifyContent: 'center',
171
- alignItems: 'center',
172
- },
173
- searchInput: {
174
- backgroundColor: '#FFFFFF',
175
- paddingHorizontal: 16,
176
- paddingVertical: 12,
177
- borderBottomWidth: 1,
178
- borderBottomColor: '#E5E7EB',
179
- fontSize: 16,
180
- },
181
- list: {
182
- padding: 16,
183
- },
184
- errorContainer: {
185
- flex: 1,
186
- justifyContent: 'center',
187
- alignItems: 'center',
188
- padding: 16,
189
- },
190
- errorText: {
191
- color: '#EF4444',
192
- fontSize: 16,
193
- },
194
- emptyContainer: {
195
- padding: 32,
196
- alignItems: 'center',
197
- },
198
- emptyText: {
199
- color: '#6B7280',
200
- fontSize: 16,
201
- },
202
- });
203
- `;
204
- }
205
-
206
- getContactListJS() {
207
- return `/**
208
- * ContactList Component (React Native)
209
- * Displays a searchable list of contacts
210
- * Auto-generated by @l4yercak3/cli
211
- */
212
-
213
- import React, { useState } from 'react';
214
- import {
215
- View,
216
- FlatList,
217
- TextInput,
218
- Text,
219
- ActivityIndicator,
220
- StyleSheet,
221
- RefreshControl,
222
- } from 'react-native';
223
- import { useContacts } from '../lib/l4yercak3/hooks/use-contacts';
224
- import { ContactCard } from './ContactCard';
225
-
226
- export function ContactList({ onSelect }) {
227
- const [search, setSearch] = useState('');
228
- const [refreshing, setRefreshing] = useState(false);
229
-
230
- const { data, isLoading, error, refetch } = useContacts({
231
- search: search || undefined,
232
- });
233
-
234
- const contacts = data?.contacts || [];
235
-
236
- const handleRefresh = async () => {
237
- setRefreshing(true);
238
- await refetch();
239
- setRefreshing(false);
240
- };
241
-
242
- if (isLoading && !refreshing) {
243
- return (
244
- <View style={styles.centered}>
245
- <ActivityIndicator size="large" color="#3B82F6" />
246
- </View>
247
- );
248
- }
249
-
250
- if (error) {
251
- return (
252
- <View style={styles.errorContainer}>
253
- <Text style={styles.errorText}>Failed to load contacts</Text>
254
- </View>
255
- );
256
- }
257
-
258
- return (
259
- <View style={styles.container}>
260
- <TextInput
261
- style={styles.searchInput}
262
- placeholder="Search contacts..."
263
- value={search}
264
- onChangeText={setSearch}
265
- placeholderTextColor="#9CA3AF"
266
- />
267
-
268
- <FlatList
269
- data={contacts}
270
- keyExtractor={(item) => item.id}
271
- renderItem={({ item }) => (
272
- <ContactCard
273
- contact={item}
274
- onPress={() => onSelect?.(item)}
275
- />
276
- )}
277
- refreshControl={
278
- <RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
279
- }
280
- contentContainerStyle={styles.list}
281
- ListEmptyComponent={
282
- <View style={styles.emptyContainer}>
283
- <Text style={styles.emptyText}>No contacts found</Text>
284
- </View>
285
- }
286
- />
287
- </View>
288
- );
289
- }
290
-
291
- const styles = StyleSheet.create({
292
- container: {
293
- flex: 1,
294
- backgroundColor: '#F9FAFB',
295
- },
296
- centered: {
297
- flex: 1,
298
- justifyContent: 'center',
299
- alignItems: 'center',
300
- },
301
- searchInput: {
302
- backgroundColor: '#FFFFFF',
303
- paddingHorizontal: 16,
304
- paddingVertical: 12,
305
- borderBottomWidth: 1,
306
- borderBottomColor: '#E5E7EB',
307
- fontSize: 16,
308
- },
309
- list: {
310
- padding: 16,
311
- },
312
- errorContainer: {
313
- flex: 1,
314
- justifyContent: 'center',
315
- alignItems: 'center',
316
- padding: 16,
317
- },
318
- errorText: {
319
- color: '#EF4444',
320
- fontSize: 16,
321
- },
322
- emptyContainer: {
323
- padding: 32,
324
- alignItems: 'center',
325
- },
326
- emptyText: {
327
- color: '#6B7280',
328
- fontSize: 16,
329
- },
330
- });
331
- `;
332
- }
333
-
334
- async generateContactCard(outputDir, ext, isTypeScript) {
335
- const outputPath = path.join(outputDir, `ContactCard.${ext}`);
336
-
337
- const action = await checkFileOverwrite(outputPath);
338
- if (action === 'skip') {
339
- return null;
340
- }
341
-
342
- const content = isTypeScript
343
- ? this.getContactCardTS()
344
- : this.getContactCardJS();
345
-
346
- return writeFileWithBackup(outputPath, content, action);
347
- }
348
-
349
- getContactCardTS() {
350
- return `/**
351
- * ContactCard Component (React Native)
352
- * Displays a single contact in a card format
353
- * Auto-generated by @l4yercak3/cli
354
- */
355
-
356
- import React from 'react';
357
- import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
358
- import type { Contact } from '../lib/l4yercak3/types';
359
-
360
- interface ContactCardProps {
361
- contact: Contact;
362
- onPress?: () => void;
363
- }
364
-
365
- export function ContactCard({ contact, onPress }: ContactCardProps) {
366
- const initials = \`\${contact.firstName?.[0] || ''}\${contact.lastName?.[0] || ''}\`.toUpperCase();
367
-
368
- return (
369
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
370
- <View style={styles.avatar}>
371
- <Text style={styles.avatarText}>{initials || '?'}</Text>
372
- </View>
373
-
374
- <View style={styles.info}>
375
- <Text style={styles.name} numberOfLines={1}>
376
- {contact.firstName} {contact.lastName}
377
- </Text>
378
- {contact.email && (
379
- <Text style={styles.email} numberOfLines={1}>
380
- {contact.email}
381
- </Text>
382
- )}
383
- </View>
384
-
385
- {contact.tags && contact.tags.length > 0 && (
386
- <View style={styles.tags}>
387
- {contact.tags.slice(0, 2).map((tag) => (
388
- <View key={tag} style={styles.tag}>
389
- <Text style={styles.tagText}>{tag}</Text>
390
- </View>
391
- ))}
392
- </View>
393
- )}
394
- </TouchableOpacity>
395
- );
396
- }
397
-
398
- const styles = StyleSheet.create({
399
- card: {
400
- flexDirection: 'row',
401
- alignItems: 'center',
402
- backgroundColor: '#FFFFFF',
403
- padding: 16,
404
- borderRadius: 12,
405
- marginBottom: 12,
406
- shadowColor: '#000',
407
- shadowOffset: { width: 0, height: 1 },
408
- shadowOpacity: 0.05,
409
- shadowRadius: 2,
410
- elevation: 2,
411
- },
412
- avatar: {
413
- width: 48,
414
- height: 48,
415
- borderRadius: 24,
416
- backgroundColor: '#DBEAFE',
417
- justifyContent: 'center',
418
- alignItems: 'center',
419
- },
420
- avatarText: {
421
- color: '#3B82F6',
422
- fontSize: 18,
423
- fontWeight: '600',
424
- },
425
- info: {
426
- flex: 1,
427
- marginLeft: 12,
428
- },
429
- name: {
430
- fontSize: 16,
431
- fontWeight: '600',
432
- color: '#111827',
433
- },
434
- email: {
435
- fontSize: 14,
436
- color: '#6B7280',
437
- marginTop: 2,
438
- },
439
- tags: {
440
- flexDirection: 'row',
441
- gap: 4,
442
- },
443
- tag: {
444
- backgroundColor: '#F3F4F6',
445
- paddingHorizontal: 8,
446
- paddingVertical: 4,
447
- borderRadius: 12,
448
- },
449
- tagText: {
450
- fontSize: 12,
451
- color: '#6B7280',
452
- },
453
- });
454
- `;
455
- }
456
-
457
- getContactCardJS() {
458
- return `/**
459
- * ContactCard Component (React Native)
460
- * Displays a single contact in a card format
461
- * Auto-generated by @l4yercak3/cli
462
- */
463
-
464
- import React from 'react';
465
- import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
466
-
467
- export function ContactCard({ contact, onPress }) {
468
- const initials = \`\${contact.firstName?.[0] || ''}\${contact.lastName?.[0] || ''}\`.toUpperCase();
469
-
470
- return (
471
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
472
- <View style={styles.avatar}>
473
- <Text style={styles.avatarText}>{initials || '?'}</Text>
474
- </View>
475
-
476
- <View style={styles.info}>
477
- <Text style={styles.name} numberOfLines={1}>
478
- {contact.firstName} {contact.lastName}
479
- </Text>
480
- {contact.email && (
481
- <Text style={styles.email} numberOfLines={1}>
482
- {contact.email}
483
- </Text>
484
- )}
485
- </View>
486
-
487
- {contact.tags && contact.tags.length > 0 && (
488
- <View style={styles.tags}>
489
- {contact.tags.slice(0, 2).map((tag) => (
490
- <View key={tag} style={styles.tag}>
491
- <Text style={styles.tagText}>{tag}</Text>
492
- </View>
493
- ))}
494
- </View>
495
- )}
496
- </TouchableOpacity>
497
- );
498
- }
499
-
500
- const styles = StyleSheet.create({
501
- card: {
502
- flexDirection: 'row',
503
- alignItems: 'center',
504
- backgroundColor: '#FFFFFF',
505
- padding: 16,
506
- borderRadius: 12,
507
- marginBottom: 12,
508
- shadowColor: '#000',
509
- shadowOffset: { width: 0, height: 1 },
510
- shadowOpacity: 0.05,
511
- shadowRadius: 2,
512
- elevation: 2,
513
- },
514
- avatar: {
515
- width: 48,
516
- height: 48,
517
- borderRadius: 24,
518
- backgroundColor: '#DBEAFE',
519
- justifyContent: 'center',
520
- alignItems: 'center',
521
- },
522
- avatarText: {
523
- color: '#3B82F6',
524
- fontSize: 18,
525
- fontWeight: '600',
526
- },
527
- info: {
528
- flex: 1,
529
- marginLeft: 12,
530
- },
531
- name: {
532
- fontSize: 16,
533
- fontWeight: '600',
534
- color: '#111827',
535
- },
536
- email: {
537
- fontSize: 14,
538
- color: '#6B7280',
539
- marginTop: 2,
540
- },
541
- tags: {
542
- flexDirection: 'row',
543
- gap: 4,
544
- },
545
- tag: {
546
- backgroundColor: '#F3F4F6',
547
- paddingHorizontal: 8,
548
- paddingVertical: 4,
549
- borderRadius: 12,
550
- },
551
- tagText: {
552
- fontSize: 12,
553
- color: '#6B7280',
554
- },
555
- });
556
- `;
557
- }
558
-
559
- async generateEventList(outputDir, ext, isTypeScript) {
560
- const outputPath = path.join(outputDir, `EventList.${ext}`);
561
-
562
- const action = await checkFileOverwrite(outputPath);
563
- if (action === 'skip') {
564
- return null;
565
- }
566
-
567
- const content = isTypeScript
568
- ? this.getEventListTS()
569
- : this.getEventListJS();
570
-
571
- return writeFileWithBackup(outputPath, content, action);
572
- }
573
-
574
- getEventListTS() {
575
- return `/**
576
- * EventList Component (React Native)
577
- * Displays a list of events with filtering
578
- * Auto-generated by @l4yercak3/cli
579
- */
580
-
581
- import React, { useState } from 'react';
582
- import {
583
- View,
584
- FlatList,
585
- Text,
586
- TouchableOpacity,
587
- ActivityIndicator,
588
- StyleSheet,
589
- RefreshControl,
590
- } from 'react-native';
591
- import { useEvents } from '../lib/l4yercak3/hooks/use-events';
592
- import { EventCard } from './EventCard';
593
- import type { Event } from '../lib/l4yercak3/types';
594
-
595
- interface EventListProps {
596
- onSelect?: (event: Event) => void;
597
- }
598
-
599
- export function EventList({ onSelect }: EventListProps) {
600
- const [statusFilter, setStatusFilter] = useState<'upcoming' | 'past' | 'all'>('upcoming');
601
- const [refreshing, setRefreshing] = useState(false);
602
-
603
- const { data, isLoading, error, refetch } = useEvents({
604
- status: statusFilter,
605
- });
606
-
607
- const events = data?.events || [];
608
-
609
- const handleRefresh = async () => {
610
- setRefreshing(true);
611
- await refetch();
612
- setRefreshing(false);
613
- };
614
-
615
- if (isLoading && !refreshing) {
616
- return (
617
- <View style={styles.centered}>
618
- <ActivityIndicator size="large" color="#3B82F6" />
619
- </View>
620
- );
621
- }
622
-
623
- return (
624
- <View style={styles.container}>
625
- {/* Filter Tabs */}
626
- <View style={styles.tabs}>
627
- {(['upcoming', 'past', 'all'] as const).map((status) => (
628
- <TouchableOpacity
629
- key={status}
630
- style={[styles.tab, statusFilter === status && styles.tabActive]}
631
- onPress={() => setStatusFilter(status)}
632
- >
633
- <Text style={[styles.tabText, statusFilter === status && styles.tabTextActive]}>
634
- {status.charAt(0).toUpperCase() + status.slice(1)}
635
- </Text>
636
- </TouchableOpacity>
637
- ))}
638
- </View>
639
-
640
- <FlatList
641
- data={events}
642
- keyExtractor={(item) => item.id}
643
- renderItem={({ item }) => (
644
- <EventCard
645
- event={item}
646
- onPress={() => onSelect?.(item)}
647
- />
648
- )}
649
- refreshControl={
650
- <RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
651
- }
652
- contentContainerStyle={styles.list}
653
- ListEmptyComponent={
654
- <View style={styles.emptyContainer}>
655
- <Text style={styles.emptyText}>No events found</Text>
656
- </View>
657
- }
658
- />
659
- </View>
660
- );
661
- }
662
-
663
- const styles = StyleSheet.create({
664
- container: {
665
- flex: 1,
666
- backgroundColor: '#F9FAFB',
667
- },
668
- centered: {
669
- flex: 1,
670
- justifyContent: 'center',
671
- alignItems: 'center',
672
- },
673
- tabs: {
674
- flexDirection: 'row',
675
- padding: 16,
676
- gap: 8,
677
- },
678
- tab: {
679
- paddingHorizontal: 16,
680
- paddingVertical: 8,
681
- borderRadius: 20,
682
- backgroundColor: '#F3F4F6',
683
- },
684
- tabActive: {
685
- backgroundColor: '#3B82F6',
686
- },
687
- tabText: {
688
- fontSize: 14,
689
- color: '#6B7280',
690
- fontWeight: '500',
691
- },
692
- tabTextActive: {
693
- color: '#FFFFFF',
694
- },
695
- list: {
696
- padding: 16,
697
- paddingTop: 0,
698
- },
699
- emptyContainer: {
700
- padding: 32,
701
- alignItems: 'center',
702
- },
703
- emptyText: {
704
- color: '#6B7280',
705
- fontSize: 16,
706
- },
707
- });
708
- `;
709
- }
710
-
711
- getEventListJS() {
712
- return `/**
713
- * EventList Component (React Native)
714
- * Displays a list of events with filtering
715
- * Auto-generated by @l4yercak3/cli
716
- */
717
-
718
- import React, { useState } from 'react';
719
- import {
720
- View,
721
- FlatList,
722
- Text,
723
- TouchableOpacity,
724
- ActivityIndicator,
725
- StyleSheet,
726
- RefreshControl,
727
- } from 'react-native';
728
- import { useEvents } from '../lib/l4yercak3/hooks/use-events';
729
- import { EventCard } from './EventCard';
730
-
731
- export function EventList({ onSelect }) {
732
- const [statusFilter, setStatusFilter] = useState('upcoming');
733
- const [refreshing, setRefreshing] = useState(false);
734
-
735
- const { data, isLoading, error, refetch } = useEvents({
736
- status: statusFilter,
737
- });
738
-
739
- const events = data?.events || [];
740
-
741
- const handleRefresh = async () => {
742
- setRefreshing(true);
743
- await refetch();
744
- setRefreshing(false);
745
- };
746
-
747
- if (isLoading && !refreshing) {
748
- return (
749
- <View style={styles.centered}>
750
- <ActivityIndicator size="large" color="#3B82F6" />
751
- </View>
752
- );
753
- }
754
-
755
- return (
756
- <View style={styles.container}>
757
- {/* Filter Tabs */}
758
- <View style={styles.tabs}>
759
- {['upcoming', 'past', 'all'].map((status) => (
760
- <TouchableOpacity
761
- key={status}
762
- style={[styles.tab, statusFilter === status && styles.tabActive]}
763
- onPress={() => setStatusFilter(status)}
764
- >
765
- <Text style={[styles.tabText, statusFilter === status && styles.tabTextActive]}>
766
- {status.charAt(0).toUpperCase() + status.slice(1)}
767
- </Text>
768
- </TouchableOpacity>
769
- ))}
770
- </View>
771
-
772
- <FlatList
773
- data={events}
774
- keyExtractor={(item) => item.id}
775
- renderItem={({ item }) => (
776
- <EventCard
777
- event={item}
778
- onPress={() => onSelect?.(item)}
779
- />
780
- )}
781
- refreshControl={
782
- <RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
783
- }
784
- contentContainerStyle={styles.list}
785
- ListEmptyComponent={
786
- <View style={styles.emptyContainer}>
787
- <Text style={styles.emptyText}>No events found</Text>
788
- </View>
789
- }
790
- />
791
- </View>
792
- );
793
- }
794
-
795
- const styles = StyleSheet.create({
796
- container: {
797
- flex: 1,
798
- backgroundColor: '#F9FAFB',
799
- },
800
- centered: {
801
- flex: 1,
802
- justifyContent: 'center',
803
- alignItems: 'center',
804
- },
805
- tabs: {
806
- flexDirection: 'row',
807
- padding: 16,
808
- gap: 8,
809
- },
810
- tab: {
811
- paddingHorizontal: 16,
812
- paddingVertical: 8,
813
- borderRadius: 20,
814
- backgroundColor: '#F3F4F6',
815
- },
816
- tabActive: {
817
- backgroundColor: '#3B82F6',
818
- },
819
- tabText: {
820
- fontSize: 14,
821
- color: '#6B7280',
822
- fontWeight: '500',
823
- },
824
- tabTextActive: {
825
- color: '#FFFFFF',
826
- },
827
- list: {
828
- padding: 16,
829
- paddingTop: 0,
830
- },
831
- emptyContainer: {
832
- padding: 32,
833
- alignItems: 'center',
834
- },
835
- emptyText: {
836
- color: '#6B7280',
837
- fontSize: 16,
838
- },
839
- });
840
- `;
841
- }
842
-
843
- async generateEventCard(outputDir, ext, isTypeScript) {
844
- const outputPath = path.join(outputDir, `EventCard.${ext}`);
845
-
846
- const action = await checkFileOverwrite(outputPath);
847
- if (action === 'skip') {
848
- return null;
849
- }
850
-
851
- const content = isTypeScript
852
- ? this.getEventCardTS()
853
- : this.getEventCardJS();
854
-
855
- return writeFileWithBackup(outputPath, content, action);
856
- }
857
-
858
- getEventCardTS() {
859
- return `/**
860
- * EventCard Component (React Native)
861
- * Displays a single event in a card format
862
- * Auto-generated by @l4yercak3/cli
863
- */
864
-
865
- import React from 'react';
866
- import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
867
- import type { Event } from '../lib/l4yercak3/types';
868
-
869
- interface EventCardProps {
870
- event: Event;
871
- onPress?: () => void;
872
- }
873
-
874
- export function EventCard({ event, onPress }: EventCardProps) {
875
- const startDate = event.startDate ? new Date(event.startDate) : null;
876
-
877
- const formatDate = (date: Date) => {
878
- return date.toLocaleDateString('en-US', {
879
- weekday: 'short',
880
- month: 'short',
881
- day: 'numeric',
882
- });
883
- };
884
-
885
- const formatTime = (date: Date) => {
886
- return date.toLocaleTimeString('en-US', {
887
- hour: 'numeric',
888
- minute: '2-digit',
889
- });
890
- };
891
-
892
- const getStatusColor = (status: string) => {
893
- switch (status) {
894
- case 'published':
895
- return { bg: '#D1FAE5', text: '#047857' };
896
- case 'draft':
897
- return { bg: '#F3F4F6', text: '#6B7280' };
898
- default:
899
- return { bg: '#FEE2E2', text: '#DC2626' };
900
- }
901
- };
902
-
903
- const statusColors = getStatusColor(event.status);
904
-
905
- return (
906
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
907
- <View style={styles.content}>
908
- {/* Date Badge */}
909
- {startDate && (
910
- <View style={styles.dateBadge}>
911
- <Text style={styles.dateDay}>{startDate.getDate()}</Text>
912
- <Text style={styles.dateMonth}>
913
- {startDate.toLocaleDateString('en-US', { month: 'short' })}
914
- </Text>
915
- </View>
916
- )}
917
-
918
- {/* Event Info */}
919
- <View style={styles.info}>
920
- <Text style={styles.name} numberOfLines={2}>{event.name}</Text>
921
- {startDate && (
922
- <Text style={styles.time}>{formatDate(startDate)} • {formatTime(startDate)}</Text>
923
- )}
924
- {event.location && (
925
- <Text style={styles.location} numberOfLines={1}>{event.location}</Text>
926
- )}
927
- </View>
928
-
929
- {/* Status Badge */}
930
- <View style={[styles.status, { backgroundColor: statusColors.bg }]}>
931
- <Text style={[styles.statusText, { color: statusColors.text }]}>
932
- {event.status}
933
- </Text>
934
- </View>
935
- </View>
936
- </TouchableOpacity>
937
- );
938
- }
939
-
940
- const styles = StyleSheet.create({
941
- card: {
942
- backgroundColor: '#FFFFFF',
943
- borderRadius: 12,
944
- marginBottom: 12,
945
- shadowColor: '#000',
946
- shadowOffset: { width: 0, height: 1 },
947
- shadowOpacity: 0.05,
948
- shadowRadius: 2,
949
- elevation: 2,
950
- },
951
- content: {
952
- flexDirection: 'row',
953
- padding: 16,
954
- alignItems: 'flex-start',
955
- },
956
- dateBadge: {
957
- width: 56,
958
- alignItems: 'center',
959
- marginRight: 12,
960
- },
961
- dateDay: {
962
- fontSize: 24,
963
- fontWeight: '700',
964
- color: '#3B82F6',
965
- },
966
- dateMonth: {
967
- fontSize: 12,
968
- color: '#6B7280',
969
- textTransform: 'uppercase',
970
- },
971
- info: {
972
- flex: 1,
973
- },
974
- name: {
975
- fontSize: 16,
976
- fontWeight: '600',
977
- color: '#111827',
978
- marginBottom: 4,
979
- },
980
- time: {
981
- fontSize: 14,
982
- color: '#6B7280',
983
- },
984
- location: {
985
- fontSize: 14,
986
- color: '#6B7280',
987
- marginTop: 2,
988
- },
989
- status: {
990
- paddingHorizontal: 8,
991
- paddingVertical: 4,
992
- borderRadius: 12,
993
- },
994
- statusText: {
995
- fontSize: 12,
996
- fontWeight: '500',
997
- textTransform: 'capitalize',
998
- },
999
- });
1000
- `;
1001
- }
1002
-
1003
- getEventCardJS() {
1004
- return `/**
1005
- * EventCard Component (React Native)
1006
- * Displays a single event in a card format
1007
- * Auto-generated by @l4yercak3/cli
1008
- */
1009
-
1010
- import React from 'react';
1011
- import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
1012
-
1013
- export function EventCard({ event, onPress }) {
1014
- const startDate = event.startDate ? new Date(event.startDate) : null;
1015
-
1016
- const formatDate = (date) => {
1017
- return date.toLocaleDateString('en-US', {
1018
- weekday: 'short',
1019
- month: 'short',
1020
- day: 'numeric',
1021
- });
1022
- };
1023
-
1024
- const formatTime = (date) => {
1025
- return date.toLocaleTimeString('en-US', {
1026
- hour: 'numeric',
1027
- minute: '2-digit',
1028
- });
1029
- };
1030
-
1031
- const getStatusColor = (status) => {
1032
- switch (status) {
1033
- case 'published':
1034
- return { bg: '#D1FAE5', text: '#047857' };
1035
- case 'draft':
1036
- return { bg: '#F3F4F6', text: '#6B7280' };
1037
- default:
1038
- return { bg: '#FEE2E2', text: '#DC2626' };
1039
- }
1040
- };
1041
-
1042
- const statusColors = getStatusColor(event.status);
1043
-
1044
- return (
1045
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
1046
- <View style={styles.content}>
1047
- {/* Date Badge */}
1048
- {startDate && (
1049
- <View style={styles.dateBadge}>
1050
- <Text style={styles.dateDay}>{startDate.getDate()}</Text>
1051
- <Text style={styles.dateMonth}>
1052
- {startDate.toLocaleDateString('en-US', { month: 'short' })}
1053
- </Text>
1054
- </View>
1055
- )}
1056
-
1057
- {/* Event Info */}
1058
- <View style={styles.info}>
1059
- <Text style={styles.name} numberOfLines={2}>{event.name}</Text>
1060
- {startDate && (
1061
- <Text style={styles.time}>{formatDate(startDate)} • {formatTime(startDate)}</Text>
1062
- )}
1063
- {event.location && (
1064
- <Text style={styles.location} numberOfLines={1}>{event.location}</Text>
1065
- )}
1066
- </View>
1067
-
1068
- {/* Status Badge */}
1069
- <View style={[styles.status, { backgroundColor: statusColors.bg }]}>
1070
- <Text style={[styles.statusText, { color: statusColors.text }]}>
1071
- {event.status}
1072
- </Text>
1073
- </View>
1074
- </View>
1075
- </TouchableOpacity>
1076
- );
1077
- }
1078
-
1079
- const styles = StyleSheet.create({
1080
- card: {
1081
- backgroundColor: '#FFFFFF',
1082
- borderRadius: 12,
1083
- marginBottom: 12,
1084
- shadowColor: '#000',
1085
- shadowOffset: { width: 0, height: 1 },
1086
- shadowOpacity: 0.05,
1087
- shadowRadius: 2,
1088
- elevation: 2,
1089
- },
1090
- content: {
1091
- flexDirection: 'row',
1092
- padding: 16,
1093
- alignItems: 'flex-start',
1094
- },
1095
- dateBadge: {
1096
- width: 56,
1097
- alignItems: 'center',
1098
- marginRight: 12,
1099
- },
1100
- dateDay: {
1101
- fontSize: 24,
1102
- fontWeight: '700',
1103
- color: '#3B82F6',
1104
- },
1105
- dateMonth: {
1106
- fontSize: 12,
1107
- color: '#6B7280',
1108
- textTransform: 'uppercase',
1109
- },
1110
- info: {
1111
- flex: 1,
1112
- },
1113
- name: {
1114
- fontSize: 16,
1115
- fontWeight: '600',
1116
- color: '#111827',
1117
- marginBottom: 4,
1118
- },
1119
- time: {
1120
- fontSize: 14,
1121
- color: '#6B7280',
1122
- },
1123
- location: {
1124
- fontSize: 14,
1125
- color: '#6B7280',
1126
- marginTop: 2,
1127
- },
1128
- status: {
1129
- paddingHorizontal: 8,
1130
- paddingVertical: 4,
1131
- borderRadius: 12,
1132
- },
1133
- statusText: {
1134
- fontSize: 12,
1135
- fontWeight: '500',
1136
- textTransform: 'capitalize',
1137
- },
1138
- });
1139
- `;
1140
- }
1141
-
1142
- async generateProductCard(outputDir, ext, isTypeScript) {
1143
- const outputPath = path.join(outputDir, `ProductCard.${ext}`);
1144
-
1145
- const action = await checkFileOverwrite(outputPath);
1146
- if (action === 'skip') {
1147
- return null;
1148
- }
1149
-
1150
- const content = isTypeScript
1151
- ? this.getProductCardTS()
1152
- : this.getProductCardJS();
1153
-
1154
- return writeFileWithBackup(outputPath, content, action);
1155
- }
1156
-
1157
- getProductCardTS() {
1158
- return `/**
1159
- * ProductCard Component (React Native)
1160
- * Displays a single product in a card format
1161
- * Auto-generated by @l4yercak3/cli
1162
- */
1163
-
1164
- import React from 'react';
1165
- import { View, Text, Image, TouchableOpacity, StyleSheet } from 'react-native';
1166
- import type { Product } from '../lib/l4yercak3/types';
1167
-
1168
- interface ProductCardProps {
1169
- product: Product;
1170
- onPress?: () => void;
1171
- onAddToCart?: (product: Product) => void;
1172
- }
1173
-
1174
- export function ProductCard({ product, onPress, onAddToCart }: ProductCardProps) {
1175
- const formatPrice = (price: number) => {
1176
- return new Intl.NumberFormat('en-US', {
1177
- style: 'currency',
1178
- currency: 'USD',
1179
- }).format(price / 100);
1180
- };
1181
-
1182
- return (
1183
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
1184
- {/* Image */}
1185
- {product.imageUrl ? (
1186
- <Image source={{ uri: product.imageUrl }} style={styles.image} />
1187
- ) : (
1188
- <View style={styles.imagePlaceholder}>
1189
- <Text style={styles.imagePlaceholderText}>No image</Text>
1190
- </View>
1191
- )}
1192
-
1193
- {/* Content */}
1194
- <View style={styles.content}>
1195
- <Text style={styles.name} numberOfLines={2}>{product.name}</Text>
1196
- {product.description && (
1197
- <Text style={styles.description} numberOfLines={2}>
1198
- {product.description}
1199
- </Text>
1200
- )}
1201
-
1202
- <View style={styles.footer}>
1203
- <Text style={styles.price}>{formatPrice(product.price)}</Text>
1204
- {onAddToCart && (
1205
- <TouchableOpacity
1206
- style={styles.addButton}
1207
- onPress={() => onAddToCart(product)}
1208
- >
1209
- <Text style={styles.addButtonText}>Add</Text>
1210
- </TouchableOpacity>
1211
- )}
1212
- </View>
1213
- </View>
1214
- </TouchableOpacity>
1215
- );
1216
- }
1217
-
1218
- const styles = StyleSheet.create({
1219
- card: {
1220
- backgroundColor: '#FFFFFF',
1221
- borderRadius: 12,
1222
- overflow: 'hidden',
1223
- shadowColor: '#000',
1224
- shadowOffset: { width: 0, height: 1 },
1225
- shadowOpacity: 0.05,
1226
- shadowRadius: 2,
1227
- elevation: 2,
1228
- },
1229
- image: {
1230
- width: '100%',
1231
- height: 160,
1232
- resizeMode: 'cover',
1233
- },
1234
- imagePlaceholder: {
1235
- width: '100%',
1236
- height: 160,
1237
- backgroundColor: '#F3F4F6',
1238
- justifyContent: 'center',
1239
- alignItems: 'center',
1240
- },
1241
- imagePlaceholderText: {
1242
- color: '#9CA3AF',
1243
- fontSize: 14,
1244
- },
1245
- content: {
1246
- padding: 12,
1247
- },
1248
- name: {
1249
- fontSize: 16,
1250
- fontWeight: '600',
1251
- color: '#111827',
1252
- },
1253
- description: {
1254
- fontSize: 14,
1255
- color: '#6B7280',
1256
- marginTop: 4,
1257
- },
1258
- footer: {
1259
- flexDirection: 'row',
1260
- justifyContent: 'space-between',
1261
- alignItems: 'center',
1262
- marginTop: 12,
1263
- },
1264
- price: {
1265
- fontSize: 18,
1266
- fontWeight: '700',
1267
- color: '#111827',
1268
- },
1269
- addButton: {
1270
- backgroundColor: '#3B82F6',
1271
- paddingHorizontal: 16,
1272
- paddingVertical: 8,
1273
- borderRadius: 8,
1274
- },
1275
- addButtonText: {
1276
- color: '#FFFFFF',
1277
- fontSize: 14,
1278
- fontWeight: '600',
1279
- },
1280
- });
1281
- `;
1282
- }
1283
-
1284
- getProductCardJS() {
1285
- return `/**
1286
- * ProductCard Component (React Native)
1287
- * Displays a single product in a card format
1288
- * Auto-generated by @l4yercak3/cli
1289
- */
1290
-
1291
- import React from 'react';
1292
- import { View, Text, Image, TouchableOpacity, StyleSheet } from 'react-native';
1293
-
1294
- export function ProductCard({ product, onPress, onAddToCart }) {
1295
- const formatPrice = (price) => {
1296
- return new Intl.NumberFormat('en-US', {
1297
- style: 'currency',
1298
- currency: 'USD',
1299
- }).format(price / 100);
1300
- };
1301
-
1302
- return (
1303
- <TouchableOpacity style={styles.card} onPress={onPress} activeOpacity={0.7}>
1304
- {/* Image */}
1305
- {product.imageUrl ? (
1306
- <Image source={{ uri: product.imageUrl }} style={styles.image} />
1307
- ) : (
1308
- <View style={styles.imagePlaceholder}>
1309
- <Text style={styles.imagePlaceholderText}>No image</Text>
1310
- </View>
1311
- )}
1312
-
1313
- {/* Content */}
1314
- <View style={styles.content}>
1315
- <Text style={styles.name} numberOfLines={2}>{product.name}</Text>
1316
- {product.description && (
1317
- <Text style={styles.description} numberOfLines={2}>
1318
- {product.description}
1319
- </Text>
1320
- )}
1321
-
1322
- <View style={styles.footer}>
1323
- <Text style={styles.price}>{formatPrice(product.price)}</Text>
1324
- {onAddToCart && (
1325
- <TouchableOpacity
1326
- style={styles.addButton}
1327
- onPress={() => onAddToCart(product)}
1328
- >
1329
- <Text style={styles.addButtonText}>Add</Text>
1330
- </TouchableOpacity>
1331
- )}
1332
- </View>
1333
- </View>
1334
- </TouchableOpacity>
1335
- );
1336
- }
1337
-
1338
- const styles = StyleSheet.create({
1339
- card: {
1340
- backgroundColor: '#FFFFFF',
1341
- borderRadius: 12,
1342
- overflow: 'hidden',
1343
- shadowColor: '#000',
1344
- shadowOffset: { width: 0, height: 1 },
1345
- shadowOpacity: 0.05,
1346
- shadowRadius: 2,
1347
- elevation: 2,
1348
- },
1349
- image: {
1350
- width: '100%',
1351
- height: 160,
1352
- resizeMode: 'cover',
1353
- },
1354
- imagePlaceholder: {
1355
- width: '100%',
1356
- height: 160,
1357
- backgroundColor: '#F3F4F6',
1358
- justifyContent: 'center',
1359
- alignItems: 'center',
1360
- },
1361
- imagePlaceholderText: {
1362
- color: '#9CA3AF',
1363
- fontSize: 14,
1364
- },
1365
- content: {
1366
- padding: 12,
1367
- },
1368
- name: {
1369
- fontSize: 16,
1370
- fontWeight: '600',
1371
- color: '#111827',
1372
- },
1373
- description: {
1374
- fontSize: 14,
1375
- color: '#6B7280',
1376
- marginTop: 4,
1377
- },
1378
- footer: {
1379
- flexDirection: 'row',
1380
- justifyContent: 'space-between',
1381
- alignItems: 'center',
1382
- marginTop: 12,
1383
- },
1384
- price: {
1385
- fontSize: 18,
1386
- fontWeight: '700',
1387
- color: '#111827',
1388
- },
1389
- addButton: {
1390
- backgroundColor: '#3B82F6',
1391
- paddingHorizontal: 16,
1392
- paddingVertical: 8,
1393
- borderRadius: 8,
1394
- },
1395
- addButtonText: {
1396
- color: '#FFFFFF',
1397
- fontSize: 14,
1398
- fontWeight: '600',
1399
- },
1400
- });
1401
- `;
1402
- }
1403
-
1404
- async generateIndex(outputDir, ext, features) {
1405
- const outputPath = path.join(outputDir, `index.${ext === 'tsx' ? 'ts' : 'js'}`);
1406
-
1407
- const action = await checkFileOverwrite(outputPath);
1408
- if (action === 'skip') {
1409
- return null;
1410
- }
1411
-
1412
- const exports = [];
1413
-
1414
- if (features.includes('crm')) {
1415
- exports.push("export { ContactList } from './ContactList';");
1416
- exports.push("export { ContactCard } from './ContactCard';");
1417
- }
1418
-
1419
- if (features.includes('events')) {
1420
- exports.push("export { EventList } from './EventList';");
1421
- exports.push("export { EventCard } from './EventCard';");
1422
- }
1423
-
1424
- if (features.includes('products') || features.includes('checkout')) {
1425
- exports.push("export { ProductCard } from './ProductCard';");
1426
- }
1427
-
1428
- const content = `/**
1429
- * L4YERCAK3 React Native Components
1430
- * Auto-generated by @l4yercak3/cli
1431
- */
1432
-
1433
- ${exports.join('\n')}
1434
- `;
1435
-
1436
- return writeFileWithBackup(outputPath, content, action);
1437
- }
1438
- }
1439
-
1440
- module.exports = new MobileComponentGenerator();