lucy-cli 2.0.0-alpha.9 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (453) hide show
  1. package/.yarnrc.yml +0 -1
  2. package/README.md +117 -102
  3. package/dist/args.d.ts +1 -6
  4. package/dist/args.js +103 -7
  5. package/dist/args.js.map +1 -0
  6. package/dist/commands/checks.d.ts +7 -0
  7. package/dist/commands/checks.js +47 -0
  8. package/dist/commands/checks.js.map +1 -0
  9. package/dist/commands/cleanup.d.ts +4 -0
  10. package/dist/commands/cleanup.js +10 -0
  11. package/dist/commands/cleanup.js.map +1 -0
  12. package/dist/commands/copy.d.ts +6 -0
  13. package/dist/commands/copy.js +20 -0
  14. package/dist/commands/copy.js.map +1 -0
  15. package/dist/commands/edit.d.ts +10 -0
  16. package/dist/commands/edit.js +67 -0
  17. package/dist/commands/edit.js.map +1 -0
  18. package/dist/commands/exec.d.ts +7 -0
  19. package/dist/commands/exec.js +67 -0
  20. package/dist/commands/exec.js.map +1 -0
  21. package/dist/commands/git.d.ts +8 -0
  22. package/dist/commands/git.js +104 -0
  23. package/dist/commands/git.js.map +1 -0
  24. package/dist/commands/home.d.ts +4 -0
  25. package/dist/commands/home.js +18 -0
  26. package/dist/commands/home.js.map +1 -0
  27. package/dist/commands/install.d.ts +8 -0
  28. package/dist/commands/install.js +165 -0
  29. package/dist/commands/install.js.map +1 -0
  30. package/dist/commands/read.d.ts +6 -0
  31. package/dist/commands/read.js +40 -0
  32. package/dist/commands/read.js.map +1 -0
  33. package/dist/commands/write.d.ts +7 -0
  34. package/dist/commands/write.js +28 -0
  35. package/dist/commands/write.js.map +1 -0
  36. package/dist/commands.js +1 -0
  37. package/dist/commands.js.map +1 -0
  38. package/dist/config.d.ts +29 -7
  39. package/dist/config.js +90 -26
  40. package/dist/config.js.map +1 -0
  41. package/dist/error.d.ts +1 -9
  42. package/dist/error.js +1 -2
  43. package/dist/error.js.map +1 -0
  44. package/dist/helpers.d.ts +9 -0
  45. package/dist/helpers.js +83 -0
  46. package/dist/helpers.js.map +1 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +77 -9
  49. package/dist/index.js.map +1 -0
  50. package/dist/init/blocks.d.ts +5 -0
  51. package/dist/init/blocks.js +62 -0
  52. package/dist/init/blocks.js.map +1 -0
  53. package/dist/init/cargo.d.ts +2 -0
  54. package/dist/init/cargo.js +21 -0
  55. package/dist/init/cargo.js.map +1 -0
  56. package/dist/init/expo.d.ts +5 -0
  57. package/dist/init/expo.js +52 -0
  58. package/dist/init/expo.js.map +1 -0
  59. package/dist/init/gitModules.d.ts +2 -0
  60. package/dist/init/gitModules.js +13 -0
  61. package/dist/init/gitModules.js.map +1 -0
  62. package/dist/init/index.d.ts +4 -0
  63. package/dist/init/index.js +77 -0
  64. package/dist/init/index.js.map +1 -0
  65. package/dist/init/monorepo.d.ts +4 -0
  66. package/dist/init/monorepo.js +48 -0
  67. package/dist/init/monorepo.js.map +1 -0
  68. package/dist/init/prepareVelo.d.ts +2 -0
  69. package/dist/init/prepareVelo.js +16 -0
  70. package/dist/init/prepareVelo.js.map +1 -0
  71. package/dist/init/tauri.d.ts +5 -0
  72. package/dist/init/tauri.js +32 -0
  73. package/dist/init/tauri.js.map +1 -0
  74. package/dist/init/templates.d.ts +5 -0
  75. package/dist/init/templates.js +93 -0
  76. package/dist/init/templates.js.map +1 -0
  77. package/dist/init/velo.d.ts +5 -0
  78. package/dist/init/velo.js +60 -0
  79. package/dist/init/velo.js.map +1 -0
  80. package/dist/policy.js +1 -0
  81. package/dist/policy.js.map +1 -0
  82. package/dist/prepare.js +1 -0
  83. package/dist/prepare.js.map +1 -0
  84. package/dist/runtime.d.ts +1 -1
  85. package/dist/runtime.js +1 -0
  86. package/dist/runtime.js.map +1 -0
  87. package/dist/schemas/gulp.d.ts +25 -0
  88. package/dist/schemas/gulp.js +8 -0
  89. package/dist/schemas/gulp.js.map +1 -0
  90. package/dist/schemas/index.d.ts +10 -0
  91. package/dist/schemas/index.js +9 -0
  92. package/dist/schemas/index.js.map +1 -0
  93. package/dist/schemas/lucy.d.ts +29 -0
  94. package/dist/schemas/lucy.js +42 -0
  95. package/dist/schemas/lucy.js.map +1 -0
  96. package/dist/schemas/tsconfig.js +2 -0
  97. package/dist/schemas/tsconfig.js.map +1 -0
  98. package/dist/schemas/types.d.ts +33 -0
  99. package/dist/schemas/types.js +5 -1
  100. package/dist/schemas/types.js.map +1 -0
  101. package/dist/states.js +1 -0
  102. package/dist/states.js.map +1 -0
  103. package/dist/tasks/Gulpfile.d.ts +4 -0
  104. package/dist/tasks/Gulpfile.js +111 -0
  105. package/dist/tasks/Gulpfile.js.map +1 -0
  106. package/dist/tasks/gulp/backend.d.ts +4 -0
  107. package/dist/tasks/gulp/backend.js +92 -0
  108. package/dist/tasks/gulp/backend.js.map +1 -0
  109. package/dist/tasks/gulp/checks.d.ts +4 -0
  110. package/dist/tasks/gulp/checks.js +202 -0
  111. package/dist/tasks/gulp/checks.js.map +1 -0
  112. package/dist/tasks/gulp/clean.d.ts +3 -0
  113. package/dist/tasks/gulp/clean.js +33 -0
  114. package/dist/tasks/gulp/clean.js.map +1 -0
  115. package/dist/tasks/gulp/copy.d.ts +3 -0
  116. package/dist/tasks/gulp/copy.js +34 -0
  117. package/dist/tasks/gulp/copy.js.map +1 -0
  118. package/dist/tasks/gulp/helpers.d.ts +3 -0
  119. package/dist/tasks/gulp/helpers.js +19 -0
  120. package/dist/tasks/gulp/helpers.js.map +1 -0
  121. package/dist/tasks/gulp/pages.d.ts +2 -0
  122. package/dist/tasks/gulp/pages.js +39 -0
  123. package/dist/tasks/gulp/pages.js.map +1 -0
  124. package/dist/tasks/gulp/pipeline.d.ts +1 -0
  125. package/dist/tasks/gulp/pipeline.js +29 -0
  126. package/dist/tasks/gulp/pipeline.js.map +1 -0
  127. package/dist/tasks/gulp/public.d.ts +3 -0
  128. package/dist/tasks/gulp/public.js +50 -0
  129. package/dist/tasks/gulp/public.js.map +1 -0
  130. package/dist/tasks/gulp/styles.d.ts +3 -0
  131. package/dist/tasks/gulp/styles.js +40 -0
  132. package/dist/tasks/gulp/styles.js.map +1 -0
  133. package/dist/tasks/gulp/templates.d.ts +2 -0
  134. package/dist/tasks/gulp/templates.js +45 -0
  135. package/dist/tasks/gulp/templates.js.map +1 -0
  136. package/dist/tasks/gulp/types.d.ts +4 -0
  137. package/dist/tasks/gulp/types.js +293 -0
  138. package/dist/tasks/gulp/types.js.map +1 -0
  139. package/dist/tasks/gulp/watchers.d.ts +3 -0
  140. package/dist/tasks/gulp/watchers.js +59 -0
  141. package/dist/tasks/gulp/watchers.js.map +1 -0
  142. package/dist/tasks/index.d.ts +4 -0
  143. package/dist/tasks/index.js +23 -0
  144. package/dist/tasks/index.js.map +1 -0
  145. package/dist/tasks/syncSettings.d.ts +3 -0
  146. package/dist/tasks/syncSettings.js +18 -0
  147. package/dist/tasks/syncSettings.js.map +1 -0
  148. package/dist/utils/index.js +2 -0
  149. package/dist/utils/index.js.map +1 -0
  150. package/dist/utils/logger.d.ts +17 -0
  151. package/dist/utils/logger.js +37 -0
  152. package/dist/utils/logger.js.map +1 -0
  153. package/dist/wix-sdk/check.d.ts +4 -0
  154. package/dist/wix-sdk/check.js +23 -0
  155. package/dist/wix-sdk/check.js.map +1 -0
  156. package/dist/wix-sdk/client.d.ts +10 -0
  157. package/dist/wix-sdk/client.js +18 -0
  158. package/dist/wix-sdk/client.js.map +1 -0
  159. package/dist/wix-sdk/index.d.ts +4 -0
  160. package/dist/wix-sdk/index.js +15 -0
  161. package/dist/wix-sdk/index.js.map +1 -0
  162. package/dist/wix-sdk/init.d.ts +4 -0
  163. package/dist/wix-sdk/init.js +51 -0
  164. package/dist/wix-sdk/init.js.map +1 -0
  165. package/dist/wix-sdk/run.d.ts +4 -0
  166. package/dist/wix-sdk/run.js +53 -0
  167. package/dist/wix-sdk/run.js.map +1 -0
  168. package/dist/wix-sync/client.d.ts +3 -0
  169. package/dist/wix-sync/client.js +5 -0
  170. package/dist/wix-sync/client.js.map +1 -0
  171. package/dist/wix-sync/export.d.ts +4 -0
  172. package/dist/wix-sync/export.js +15 -0
  173. package/dist/wix-sync/export.js.map +1 -0
  174. package/dist/wix-sync/import.d.ts +4 -0
  175. package/dist/wix-sync/import.js +26 -0
  176. package/dist/wix-sync/import.js.map +1 -0
  177. package/dist/wix-sync/index.d.ts +4 -0
  178. package/dist/wix-sync/index.js +35 -0
  179. package/dist/wix-sync/index.js.map +1 -0
  180. package/dist/wix-sync/init.d.ts +4 -0
  181. package/dist/wix-sync/init.js +74 -0
  182. package/dist/wix-sync/init.js.map +1 -0
  183. package/dist/wix-sync/is-alive.d.ts +4 -0
  184. package/dist/wix-sync/is-alive.js +23 -0
  185. package/dist/wix-sync/is-alive.js.map +1 -0
  186. package/dist/wix-sync/migrate.d.ts +4 -0
  187. package/dist/wix-sync/migrate.js +21 -0
  188. package/dist/wix-sync/migrate.js.map +1 -0
  189. package/dist/wix-sync/sync.d.ts +4 -0
  190. package/dist/wix-sync/sync.js +26 -0
  191. package/dist/wix-sync/sync.js.map +1 -0
  192. package/files/sync-data/data/test.csv +17 -0
  193. package/files/sync-data/files/lucy.jpg +0 -0
  194. package/files/sync-data/schema/test.json +11 -0
  195. package/files/templates/block[D]/files/.stylelintrc.js +8 -0
  196. package/files/templates/block[D]/lucy.json +9 -0
  197. package/files/templates/cargo[D]/files/.env +1 -0
  198. package/files/templates/cargo[D]/files/Cargo.toml +238 -0
  199. package/files/templates/cargo[D]/files/Makefile.toml +4 -0
  200. package/files/templates/cargo[D]/files/build/main.rs +35 -0
  201. package/files/templates/cargo[D]/files/config/beta.json +19 -0
  202. package/files/templates/cargo[D]/files/config/ci.json +15 -0
  203. package/files/templates/cargo[D]/files/config/default.json +71 -0
  204. package/files/templates/cargo[D]/files/config/development.json +10 -0
  205. package/files/templates/cargo[D]/files/config/produktion.json +5 -0
  206. package/files/templates/cargo[D]/files/config/stage.json +4 -0
  207. package/files/templates/cargo[D]/files/locales/todo.yml +3 -0
  208. package/files/templates/cargo[D]/files/public/index.html +1 -0
  209. package/files/templates/cargo[D]/lucy.json +15 -0
  210. package/files/templates/expo[D]/files/.stylelintrc.js +8 -0
  211. package/files/{expo → templates/expo[D]/files}/eas.json +9 -3
  212. package/files/templates/expo[D]/files/lib/data.ts +197 -0
  213. package/files/{expo → templates/expo[D]/files}/metro.config.js +6 -0
  214. package/files/templates/expo[D]/files/pnpm-workspace.yaml +3 -0
  215. package/files/templates/expo[D]/lucy.json +86 -0
  216. package/files/templates/monorepo[D]/files/.editorconfig +10 -0
  217. package/files/templates/monorepo[D]/files/.nvmrc +1 -0
  218. package/files/templates/monorepo[D]/files/.prettierignore +23 -0
  219. package/files/templates/monorepo[D]/files/.prettierrc.json +15 -0
  220. package/files/templates/monorepo[D]/files/.stylelintrc.js +8 -0
  221. package/files/templates/monorepo[D]/files/.yarnrc +1 -0
  222. package/files/templates/monorepo[D]/files/.yarnrc.yml +3 -0
  223. package/files/templates/monorepo[D]/files/README.md +109 -0
  224. package/files/templates/monorepo[D]/files/currents.config.ts +5 -0
  225. package/files/templates/monorepo[D]/files/nx.json +25 -0
  226. package/files/templates/monorepo[D]/files/pnpm-workspace.yaml +11 -0
  227. package/files/templates/monorepo[D]/files/tsconfig.json +6 -0
  228. package/files/templates/monorepo[D]/files/typedoc.json +25 -0
  229. package/files/templates/monorepo[D]/files/vitest.config.ts +27 -0
  230. package/files/templates/monorepo[D]/lucy.json +69 -0
  231. package/files/templates/tauri[D]/lucy.json +9 -0
  232. package/files/templates/velo[D]/files/.prettierignore +23 -0
  233. package/files/templates/velo[D]/files/.prettierrc.js +16 -0
  234. package/files/templates/velo[D]/lucy.json +137 -0
  235. package/lucy.jpg +0 -0
  236. package/old/Gulpfile.d.ts +34 -0
  237. package/old/Gulpfile.js +116 -0
  238. package/old/Gulpfile.js.map +1 -0
  239. package/old/gulp/backend.d.ts +3 -0
  240. package/old/gulp/backend.js +92 -0
  241. package/old/gulp/backend.js.map +1 -0
  242. package/old/gulp/checks.d.ts +3 -0
  243. package/old/gulp/checks.js +205 -0
  244. package/old/gulp/checks.js.map +1 -0
  245. package/old/gulp/clean.d.ts +3 -0
  246. package/old/gulp/clean.js +29 -0
  247. package/old/gulp/clean.js.map +1 -0
  248. package/old/gulp/copy.d.ts +2 -0
  249. package/old/gulp/copy.js +34 -0
  250. package/old/gulp/copy.js.map +1 -0
  251. package/old/gulp/helpers.d.ts +2 -0
  252. package/old/gulp/helpers.js +25 -0
  253. package/old/gulp/helpers.js.map +1 -0
  254. package/old/gulp/pages.d.ts +2 -0
  255. package/old/gulp/pages.js +37 -0
  256. package/old/gulp/pages.js.map +1 -0
  257. package/old/gulp/pipeline.d.ts +1 -0
  258. package/old/gulp/pipeline.js +29 -0
  259. package/old/gulp/pipeline.js.map +1 -0
  260. package/old/gulp/public.d.ts +2 -0
  261. package/old/gulp/public.js +50 -0
  262. package/old/gulp/public.js.map +1 -0
  263. package/old/gulp/styles.d.ts +2 -0
  264. package/old/gulp/styles.js +40 -0
  265. package/old/gulp/styles.js.map +1 -0
  266. package/old/gulp/templates.d.ts +2 -0
  267. package/old/gulp/templates.js +33 -0
  268. package/old/gulp/templates.js.map +1 -0
  269. package/old/gulp/types.d.ts +4 -0
  270. package/old/gulp/types.js +289 -0
  271. package/old/gulp/types.js.map +1 -0
  272. package/old/gulp/watchers.d.ts +9 -0
  273. package/old/gulp/watchers.js +59 -0
  274. package/old/gulp/watchers.js.map +1 -0
  275. package/old/helpers.d.ts +32 -0
  276. package/old/helpers.js +267 -0
  277. package/old/helpers.js.map +1 -0
  278. package/{src copy/helpers.ts → old/helpers.ts} +1 -1
  279. package/old/index.d.ts +59 -0
  280. package/old/index.js +288 -0
  281. package/old/index.js.map +1 -0
  282. package/old/init.d.ts +8 -0
  283. package/old/init.js +165 -0
  284. package/old/init.js.map +1 -0
  285. package/old/models.d.ts +37 -0
  286. package/old/models.js +2 -0
  287. package/old/models.js.map +1 -0
  288. package/old/prepare.d.ts +8 -0
  289. package/old/prepare.js +20 -0
  290. package/old/prepare.js.map +1 -0
  291. package/old/schemas/index.js +2 -0
  292. package/old/schemas/index.js.map +1 -0
  293. package/old/schemas/index.ts +0 -0
  294. package/old/schemas/types.d.ts +0 -0
  295. package/old/schemas/types.js +2 -0
  296. package/old/schemas/types.js.map +1 -0
  297. package/old/schemas/types.ts +0 -0
  298. package/old/sync.d.ts +2 -0
  299. package/old/sync.js +88 -0
  300. package/old/sync.js.map +1 -0
  301. package/package.json +18 -19
  302. package/patches/velo-sync+0.0.9.patch +13 -0
  303. package/src/args.ts +103 -17
  304. package/src/commands/checks.ts +51 -0
  305. package/src/commands/cleanup.ts +11 -0
  306. package/src/commands/copy.ts +28 -0
  307. package/src/commands/edit.ts +81 -0
  308. package/src/commands/exec.ts +69 -0
  309. package/src/commands/git.ts +113 -0
  310. package/src/commands/home.ts +22 -0
  311. package/src/commands/install.ts +249 -0
  312. package/src/commands/read.ts +45 -0
  313. package/src/commands/write.ts +45 -0
  314. package/src/config.ts +116 -35
  315. package/src/error.ts +1 -2
  316. package/src/helpers.ts +92 -0
  317. package/src/index.ts +88 -13
  318. package/src/init/blocks.ts +85 -0
  319. package/src/init/cargo.ts +25 -0
  320. package/src/init/expo.ts +69 -0
  321. package/src/init/gitModules.ts +15 -0
  322. package/src/init/index.ts +81 -0
  323. package/src/init/monorepo.ts +72 -0
  324. package/src/init/prepareVelo.ts +19 -0
  325. package/src/init/tauri.ts +42 -0
  326. package/src/init/templates.ts +98 -0
  327. package/src/init/velo.ts +65 -0
  328. package/src/runtime.ts +1 -0
  329. package/src/schemas/gulp.ts +31 -0
  330. package/src/schemas/index.ts +13 -1
  331. package/src/schemas/lucy.ts +43 -0
  332. package/src/schemas/types.ts +40 -0
  333. package/src/tasks/Gulpfile.ts +207 -0
  334. package/src/tasks/gulp/backend.ts +113 -0
  335. package/src/tasks/gulp/checks.ts +218 -0
  336. package/src/tasks/gulp/clean.ts +38 -0
  337. package/src/tasks/gulp/copy.ts +38 -0
  338. package/src/tasks/gulp/helpers.ts +18 -0
  339. package/src/tasks/gulp/pages.ts +43 -0
  340. package/src/tasks/gulp/pipeline.ts +31 -0
  341. package/src/tasks/gulp/public.ts +61 -0
  342. package/src/tasks/gulp/styles.ts +47 -0
  343. package/src/tasks/gulp/templates.ts +53 -0
  344. package/src/tasks/gulp/types.ts +310 -0
  345. package/src/tasks/gulp/watchers.ts +97 -0
  346. package/src/tasks/index.ts +24 -0
  347. package/src/tasks/syncSettings.ts +21 -0
  348. package/src/types.d.ts +1 -1
  349. package/src/utils/index.ts +0 -0
  350. package/src/utils/logger.ts +40 -0
  351. package/src/wix-sdk/check.ts +24 -0
  352. package/src/wix-sdk/client.ts +18 -0
  353. package/src/wix-sdk/index.ts +17 -0
  354. package/src/wix-sdk/init.ts +54 -0
  355. package/src/wix-sdk/run.ts +56 -0
  356. package/src/wix-sync/client.ts +6 -0
  357. package/src/wix-sync/export.ts +19 -0
  358. package/src/wix-sync/import.ts +27 -0
  359. package/src/wix-sync/index.ts +36 -0
  360. package/src/wix-sync/init.ts +77 -0
  361. package/src/wix-sync/is-alive.ts +25 -0
  362. package/src/wix-sync/migrate.ts +23 -0
  363. package/src/wix-sync/sync.ts +27 -0
  364. package/tsconfig.json +6 -5
  365. package/dist/init.d.ts +0 -4
  366. package/dist/init.js +0 -275
  367. package/dist/models.js +0 -1
  368. package/dist/params.d.ts +0 -7
  369. package/dist/params.js +0 -23
  370. package/files/expo/lib/data.ts +0 -48
  371. package/files/expo/lucy.json +0 -8
  372. package/src/init.ts +0 -392
  373. /package/dist/{models.d.ts → schemas/tsconfig.d.ts} +0 -0
  374. /package/{files/expo/components/.gitkeep → dist/utils/index.d.ts} +0 -0
  375. /package/files/{expo → templates/expo[D]/files}/.nvmrc +0 -0
  376. /package/files/{expo → templates/expo[D]/files}/.prettierignore +0 -0
  377. /package/files/{expo → templates/expo[D]/files}/.prettierrc.js +0 -0
  378. /package/files/{expo → templates/expo[D]/files}/.yarnrc +0 -0
  379. /package/files/{expo → templates/expo[D]/files}/.yarnrc.yml +0 -0
  380. /package/files/{expo → templates/expo[D]/files}/README.md +0 -0
  381. /package/files/{expo → templates/expo[D]/files}/assets/fonts/SpaceMono-Regular.ttf +0 -0
  382. /package/files/{expo → templates/expo[D]/files}/assets/images/adaptive-icon.png +0 -0
  383. /package/files/{expo → templates/expo[D]/files}/assets/images/favicon.png +0 -0
  384. /package/files/{expo → templates/expo[D]/files}/assets/images/icon.png +0 -0
  385. /package/files/{expo → templates/expo[D]/files}/assets/images/splash-icon.png +0 -0
  386. /package/files/{expo → templates/expo[D]/files}/babel.config.js +0 -0
  387. /package/files/{expo/components/ui → templates/expo[D]/files/components}/.gitkeep +0 -0
  388. /package/files/{velo/typescript/__mocks__ → templates/expo[D]/files/components/ui}/.gitkeep +0 -0
  389. /package/files/{expo → templates/expo[D]/files}/constants/theme.ts +0 -0
  390. /package/files/{expo → templates/expo[D]/files}/eslint.config.mjs +0 -0
  391. /package/files/{expo → templates/expo[D]/files}/global.css +0 -0
  392. /package/files/{expo → templates/expo[D]/files}/hooks/useColorScheme.ts +0 -0
  393. /package/files/{expo → templates/expo[D]/files}/index.ts +0 -0
  394. /package/files/{expo → templates/expo[D]/files}/lib/utils/index.ts +0 -0
  395. /package/files/{expo → templates/expo[D]/files}/lib/utils/polyfills.ts +0 -0
  396. /package/files/{expo → templates/expo[D]/files}/lib/wix/client.ts +0 -0
  397. /package/files/{expo → templates/expo[D]/files}/lib/wix/error.ts +0 -0
  398. /package/files/{expo → templates/expo[D]/files}/lib/wix/index.ts +0 -0
  399. /package/files/{expo → templates/expo[D]/files}/nativewind-env.d.ts +0 -0
  400. /package/files/{expo → templates/expo[D]/files}/scripts/reset-project.ts +0 -0
  401. /package/files/{expo → templates/expo[D]/files}/tailwind.config.js +0 -0
  402. /package/files/{expo → templates/expo[D]/files}/tsconfig.json +0 -0
  403. /package/files/{expo → templates/expo[D]/files}/types/reset.d.ts +0 -0
  404. /package/files/{velo → templates/velo[D]/files}/.gitmodules +0 -0
  405. /package/files/{velo → templates/velo[D]/files}/.madgerc +0 -0
  406. /package/files/{velo → templates/velo[D]/files}/.nvmrc +0 -0
  407. /package/files/{velo → templates/velo[D]/files}/.stylelintrc.js +0 -0
  408. /package/files/{velo → templates/velo[D]/files}/.yarnrc.yml +0 -0
  409. /package/files/{velo → templates/velo[D]/files}/currents.config.js +0 -0
  410. /package/files/{velo → templates/velo[D]/files}/cypress/e2e/base/base.cy.ts +0 -0
  411. /package/files/{velo → templates/velo[D]/files}/cypress/fixtures/example.json +0 -0
  412. /package/files/{velo → templates/velo[D]/files}/cypress/support/commands.ts +0 -0
  413. /package/files/{velo → templates/velo[D]/files}/cypress/support/e2e.ts +0 -0
  414. /package/files/{velo → templates/velo[D]/files}/cypress/tsconfig.json +0 -0
  415. /package/files/{velo → templates/velo[D]/files}/cypress.config.mjs +0 -0
  416. /package/files/{velo → templates/velo[D]/files}/eslint.config.mjs +0 -0
  417. /package/files/{velo → templates/velo[D]/files}/local.tsconfig.json +0 -0
  418. /package/files/{velo → templates/velo[D]/files}/typedoc.json +0 -0
  419. /package/files/{velo/typescript/pages → templates/velo[D]/files/typescript/__mocks__}/.gitkeep +0 -0
  420. /package/files/{velo → templates/velo[D]/files}/typescript/backend/data.ts +0 -0
  421. /package/files/{velo → templates/velo[D]/files}/typescript/backend/events.ts +0 -0
  422. /package/files/{velo → templates/velo[D]/files}/typescript/backend/http-functions.ts +0 -0
  423. /package/files/{velo → templates/velo[D]/files}/typescript/backend/lib/http-functions/sync.ts +0 -0
  424. /package/files/{velo → templates/velo[D]/files}/typescript/backend/permissions.json +0 -0
  425. /package/files/{velo/typescript/public → templates/velo[D]/files/typescript/pages}/.gitkeep +0 -0
  426. /package/files/{velo/typescript/styles → templates/velo[D]/files/typescript/public}/.gitkeep +0 -0
  427. /package/files/{velo → templates/velo[D]/files}/typescript/public/scss/app.scss +0 -0
  428. /package/files/{velo/typescript/styles/global.scss → templates/velo[D]/files/typescript/styles/.gitkeep} +0 -0
  429. /package/{src copy/schemas/index.ts → files/templates/velo[D]/files/typescript/styles/global.scss} +0 -0
  430. /package/files/{velo → templates/velo[D]/files}/typescript/tsconfig.json +0 -0
  431. /package/files/{velo → templates/velo[D]/files}/vitest.config.ts +0 -0
  432. /package/{src copy → old}/Gulpfile.ts +0 -0
  433. /package/{src copy → old}/gulp/backend.ts +0 -0
  434. /package/{src copy → old}/gulp/checks.ts +0 -0
  435. /package/{src copy → old}/gulp/clean.ts +0 -0
  436. /package/{src copy → old}/gulp/copy.ts +0 -0
  437. /package/{src copy → old}/gulp/helpers.ts +0 -0
  438. /package/{src copy → old}/gulp/pages.ts +0 -0
  439. /package/{src copy → old}/gulp/pipeline.ts +0 -0
  440. /package/{src copy → old}/gulp/public.ts +0 -0
  441. /package/{src copy → old}/gulp/styles.ts +0 -0
  442. /package/{src copy → old}/gulp/templates.ts +0 -0
  443. /package/{src copy → old}/gulp/types.ts +0 -0
  444. /package/{src copy → old}/gulp/watchers.ts +0 -0
  445. /package/{src copy → old}/index.ts +0 -0
  446. /package/{src copy → old}/init.ts +0 -0
  447. /package/{src copy → old}/models.ts +0 -0
  448. /package/{src copy → old}/prepare.ts +0 -0
  449. /package/{src copy/schemas/types.ts → old/schemas/index.d.ts} +0 -0
  450. /package/{src copy → old}/settings.json +0 -0
  451. /package/{src copy → old}/sync.ts +0 -0
  452. /package/{src copy → old}/types.d.ts +0 -0
  453. /package/src/{models.ts → schemas/tsconfig.ts} +0 -0
package/old/helpers.js ADDED
@@ -0,0 +1,267 @@
1
+ import chalk from 'chalk';
2
+ import { simpleGit } from 'simple-git';
3
+ import { spawnSync, exec } from 'child_process';
4
+ // https://www.sergevandenoever.nl/run-gulp4-tasks-programatically-from-node/
5
+ import path, { join } from 'path';
6
+ import { fileURLToPath } from 'url';
7
+ import os from 'os';
8
+ import fs, { mkdirSync } from 'fs';
9
+ import fse from 'fs-extra';
10
+ import { writeFile } from 'fs/promises';
11
+ import { blue, green, orange, red, yellow, magenta } from './index.js';
12
+ export async function installPackages(wixPackages, devPackages, cwd, locked) {
13
+ if (locked)
14
+ console.log("🐕" + blue.underline(` => Installing & version locked packages!`));
15
+ const wixPackageNames = Object.keys(wixPackages);
16
+ const wixPackageVersions = Object.values(wixPackages);
17
+ const wixPackageNamesAndVersions = wixPackageNames.map((name, index) => `${name}@${wixPackageVersions[index]}`);
18
+ const devPackageNames = Object.keys(devPackages);
19
+ const devPackageVersions = Object.values(devPackages);
20
+ const devPackageNamesAndVersions = devPackageNames.map((name, index) => `${name}@${devPackageVersions[index]}`);
21
+ let success = true;
22
+ // Dev packages are installed all at once with yarn.
23
+ if (devPackageNames.length > 0) {
24
+ console.log(`🐕 => Installing dev packages with yarn...`);
25
+ const packagesToInstall = locked ? devPackageNamesAndVersions.join(' ') : devPackageNames.join(' ');
26
+ const yarnAdd = `yarn add -D ${packagesToInstall}`;
27
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
28
+ if (yarnRes.error) {
29
+ success = false;
30
+ console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
31
+ }
32
+ else {
33
+ console.log("🐕" + blue.underline(` => Dev packages installed!`));
34
+ }
35
+ }
36
+ // Packages are installed all at once with yarn.
37
+ if (wixPackageNames.length > 0) {
38
+ console.log(`🐕 => Installing packages with yarn...`);
39
+ const packagesToInstall = locked ? wixPackageNamesAndVersions.join(' ') : wixPackageNames.join(' ');
40
+ const yarnAdd = `yarn add ${packagesToInstall}`;
41
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
42
+ if (yarnRes.error) {
43
+ success = false;
44
+ console.log((`💩 ${red.underline.bold("=> Failed to install packages =>")} ${orange(yarnRes.error.message)}`));
45
+ }
46
+ else {
47
+ console.log("🐕" + blue.underline(` => Packages installed!`));
48
+ }
49
+ }
50
+ // Wix packages are installed one by one.
51
+ if (wixPackageNames.length > 0) {
52
+ wixPackageNames.forEach((name, index) => {
53
+ console.log(`🐕 => Installing wix package ${orange(name)}`);
54
+ const wixInstall = locked ? `wix install ${wixPackageNamesAndVersions[index]}` : `wix install ${name}`;
55
+ const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
56
+ if (wixres.error) {
57
+ console.log((`💩 ${red.underline.bold("=> Failed to install wix package =>")} ${orange(wixres.error.message)}`));
58
+ success = false;
59
+ }
60
+ else {
61
+ console.log("🐕" + blue.underline(` => Wix package ${orange(name)} installed!`));
62
+ }
63
+ });
64
+ }
65
+ if (success) {
66
+ console.log("🐕" + blue.underline(` => All Packages installed!`));
67
+ }
68
+ else {
69
+ console.log("🐕" + red.underline(` => Some packages failed to install!`));
70
+ }
71
+ }
72
+ async function isSubmoduleRegistered(git, submoduleName) {
73
+ try {
74
+ const urlConfig = await git.getConfig(`submodule.${submoduleName}.url`);
75
+ return !!urlConfig.value;
76
+ }
77
+ catch (e) {
78
+ // simple-git throws an error if the config key doesn't exist
79
+ return false;
80
+ }
81
+ }
82
+ export async function gitInit(cwd, modules, force) {
83
+ const git = simpleGit({ baseDir: cwd });
84
+ if (!(await git.checkIsRepo())) {
85
+ console.log(chalk.yellow('Project is not a git repository. Initializing...'));
86
+ await git.init();
87
+ }
88
+ if (!modules) {
89
+ console.log(chalk.yellow('No submodules defined in settings, skipping.'));
90
+ return;
91
+ }
92
+ const dotGitmodulesPath = path.join(cwd, '.gitmodules');
93
+ for (const [name, repo] of Object.entries(modules)) {
94
+ console.log(chalk.green.underline.bold(`Processing submodule ${name}`));
95
+ const clonePath = repo.path || name;
96
+ try {
97
+ const isRegistered = await isSubmoduleRegistered(git, clonePath);
98
+ // Check that .gitmodules exists AND contains the entry for this specific submodule.
99
+ const isConfiguredInFile = fs.existsSync(dotGitmodulesPath) &&
100
+ fs.readFileSync(dotGitmodulesPath, 'utf-8').includes(`[submodule "${clonePath}"]`);
101
+ // Add/repair if not configured in .gitmodules, or if forced by the user.
102
+ if (!isConfiguredInFile || force) {
103
+ console.log(`🐕 ${blue.underline(`Adding/updating submodule ${name} at ${clonePath}...`)}`);
104
+ // If git already has a config entry, we must use --force to repair it.
105
+ const submoduleArgs = ['add', ...(force || isRegistered ? ['--force'] : []), repo.url, clonePath];
106
+ await git.subModule(submoduleArgs);
107
+ }
108
+ else {
109
+ console.log(`🐕 ${blue.underline(`Submodule ${name} at ${clonePath} already registered. Skipping add.`)}`);
110
+ }
111
+ await git.submoduleUpdate(['--init', '--recursive', clonePath]);
112
+ await simpleGit({ baseDir: path.join(cwd, clonePath) }).checkout(repo.branch);
113
+ }
114
+ catch (err) {
115
+ console.log((`💩 ${red.underline.bold(`=> Command failed for submodule ${name} =>`)} ${orange(err)}`));
116
+ }
117
+ }
118
+ console.log("🐶" + green.underline(' => All modules processed!'));
119
+ }
120
+ export async function runGulp(moduleSettings, projectSettings, task) {
121
+ // Get the directory name of the current module
122
+ const __filename = fileURLToPath(import.meta.url);
123
+ const __dirname = path.dirname(__filename);
124
+ // Resolve the path to the Gulpfile
125
+ const gulpfilePath = path.resolve(__dirname, 'Gulpfile.js');
126
+ // Dynamically import the Gulpfile
127
+ const gulpfile = await import(`file://${gulpfilePath}`);
128
+ // Check if 'dev' task exists
129
+ gulpfile.runTask(task, moduleSettings, projectSettings);
130
+ }
131
+ /**
132
+ * Clean up and run a command before exiting the process.
133
+ */
134
+ export function cleanupWatchers() {
135
+ console.log(`🧹 ${magenta.underline('Cleaning up Watchman watchers...')}`);
136
+ const cwd = process.cwd();
137
+ const command = `watchman watch-del "${cwd}"`; // Adjust for Windows paths
138
+ exec(command, (error, stdout, stderr) => {
139
+ if (error) {
140
+ console.error(`💩 ${red.underline('Failed to run cleanup:')} ${orange(error.message)}`);
141
+ return;
142
+ }
143
+ if (stderr) {
144
+ console.error(`⚠️ ${yellow.underline('Watchman stderr:')} ${stderr}`);
145
+ }
146
+ console.log(`✅ ${green.underline('Watchman cleanup success:')} ${stdout}`);
147
+ });
148
+ }
149
+ /**
150
+ * Kill all processes matching a specific substring in their command, with a fallback for Windows.
151
+ * @param {string} processPattern - The substring to match (e.g., "wix:dev" or "@wix/cli/bin/wix.cjs").
152
+ */
153
+ export function killAllProcesses(processPattern) {
154
+ const isWindows = os.platform() === 'win32';
155
+ const command = isWindows
156
+ ? `tasklist /FI "IMAGENAME eq node.exe" /FO CSV | findstr "${processPattern}"` // Adjust for Node.js processes
157
+ : `ps -eo pid,command | grep "${processPattern}" | grep -v grep`;
158
+ exec(command, (error, stdout, stderr) => {
159
+ if (error) {
160
+ console.error(`💩 ${red.underline('Failed to find processes:')} ${orange(error.message)}`);
161
+ return;
162
+ }
163
+ if (stderr) {
164
+ console.error(`⚠️ ${yellow.underline('Error output:')} ${stderr}`);
165
+ }
166
+ if (!stdout.trim()) {
167
+ console.log(`ℹ️ ${blue.underline(`No processes found matching pattern:`)} ${orange(processPattern)}`);
168
+ return;
169
+ }
170
+ console.log(`📝 ${magenta.underline('Found matching processes:')}\n${stdout}`);
171
+ const lines = stdout.trim().split('\n');
172
+ const pids = isWindows
173
+ ? lines.map(line => line.match(/"(\d+)"/)?.[1]) // Extract PID from Windows tasklist output
174
+ : lines.map(line => line.trim().split(/\s+/)[0]).filter(pid => !isNaN(Number(pid)));
175
+ pids.forEach(pid => {
176
+ if (!pid)
177
+ return;
178
+ try {
179
+ const killCommand = isWindows
180
+ ? `taskkill /PID ${pid} /T /F` // Forcefully terminate the process on Windows
181
+ : `kill -SIGTERM ${pid}`;
182
+ exec(killCommand, (killError) => {
183
+ if (killError) {
184
+ console.error(`⚠️ ${yellow.underline('Failed to kill process with PID')} ${orange(pid)}: ${red(killError.message)}`);
185
+ }
186
+ else {
187
+ console.log(`✅ ${green.underline('Killed process with PID:')} ${orange(pid)}`);
188
+ }
189
+ });
190
+ // Schedule SIGKILL fallback for non-Windows platforms
191
+ if (!isWindows) {
192
+ setTimeout(() => {
193
+ try {
194
+ process.kill(parseInt(pid, 10), 'SIGKILL');
195
+ console.log(`🔪 ${red.underline('Sent SIGKILL to process with PID:')} ${orange(pid)} (fallback).`);
196
+ }
197
+ catch (killError) {
198
+ if (killError.code === 'ESRCH') {
199
+ console.log(`✅ ${green.underline('Process with PID')} ${orange(pid)} ${green.underline('already terminated.')}`);
200
+ }
201
+ else {
202
+ console.error(`⚠️ ${yellow.underline('Failed to send SIGKILL to process with PID')} ${orange(pid)}: ${red(killError.message)}`);
203
+ }
204
+ }
205
+ }, 10000);
206
+ }
207
+ }
208
+ catch (err) {
209
+ console.error(`⚠️ ${yellow.underline('Failed to kill process with PID')} ${orange(pid)}: ${red(err.message)}`);
210
+ }
211
+ });
212
+ });
213
+ }
214
+ export async function saveConfig(config, file) {
215
+ await fs.promises.writeFile(file, JSON.stringify(config));
216
+ }
217
+ export async function readConfig(file) {
218
+ let content = await fs.promises.readFile(file, 'utf-8');
219
+ return JSON.parse(content);
220
+ }
221
+ export async function createTemplateFolder(moduleSettings) {
222
+ const templatesPath = join(os.homedir(), '.lucy-cli');
223
+ try {
224
+ mkdirSync(templatesPath);
225
+ const defaultTemplatePath = join(templatesPath, 'default');
226
+ mkdirSync(defaultTemplatePath);
227
+ const sourceFilesPath = join(moduleSettings.packageRoot, 'files');
228
+ const defaultTemplateFilesPath = join(defaultTemplatePath, 'files');
229
+ await fse.copy(sourceFilesPath, defaultTemplateFilesPath);
230
+ const defaultTemplateSettingsPath = join(defaultTemplatePath, 'settings.json');
231
+ await writeFile(defaultTemplateSettingsPath, JSON.stringify(moduleSettings.settings, null, 2));
232
+ console.log(green('✅ Default template created successfully!'));
233
+ }
234
+ catch (e) {
235
+ console.log((`💩 ${red.underline.bold("=> Error creating default template =>")} ${orange(e)}`));
236
+ return;
237
+ }
238
+ }
239
+ /**
240
+ * Updates a lucy.json file with dependencies from a package.json file.
241
+ * It replaces 'wixPackages' with 'dependencies' and 'devPackages' with 'devDependencies'.
242
+ * @param {string} packageJsonPath - Path to the package.json file.
243
+ * @param {string} lucyConfigPath - Path to the lucy.json file.
244
+ */
245
+ export async function updateLucyConfigFromPackageJson(packageJsonPath, lucyConfigPath) {
246
+ try {
247
+ console.log(`🐕 Reading package definitions from ${orange(packageJsonPath)}...`);
248
+ const pkgJsonContent = await fs.promises.readFile(packageJsonPath, 'utf-8');
249
+ const packageJson = JSON.parse(pkgJsonContent);
250
+ console.log(`🐕 Reading Lucy configuration from ${orange(lucyConfigPath)}...`);
251
+ const lucyConfigContent = await fs.promises.readFile(lucyConfigPath, 'utf-8');
252
+ const lucyConfig = JSON.parse(lucyConfigContent);
253
+ const { dependencies = {}, devDependencies = {} } = packageJson;
254
+ // Note: `wixPackages` are installed using `wix install`. If your `dependencies`
255
+ // contain packages that are not Wix packages, `lucy-cli install` might fail.
256
+ lucyConfig.wixPackages = dependencies;
257
+ lucyConfig.devPackages = devDependencies;
258
+ console.log(`🐕 Writing updated configuration to ${orange(lucyConfigPath)}...`);
259
+ await fs.promises.writeFile(lucyConfigPath, JSON.stringify(lucyConfig, null, 2));
260
+ console.log(green.underline('✅ Lucy configuration updated successfully!'));
261
+ }
262
+ catch (error) {
263
+ console.error(`💩 ${red.underline.bold('=> Error updating lucy.json from package.json:')} ${orange(error.message)}`);
264
+ throw error; // re-throw to allow caller to handle
265
+ }
266
+ }
267
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAChD,6EAA6E;AAC7E,OAAO,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,GAAG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B,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,gDAAgD,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrH,MAAM,KAAK,CAAC,CAAC,qCAAqC;IACtD,CAAC;AACL,CAAC"}
@@ -4,7 +4,7 @@ import { spawnSync, exec } from 'child_process';
4
4
  // https://www.sergevandenoever.nl/run-gulp4-tasks-programatically-from-node/
5
5
  import path, { join } from 'path';
6
6
  import { fileURLToPath } from 'url';
7
- import { LucySettings, ModuleSettings, ProjectSettings } from '.';
7
+ import { LucySettings, ModuleSettings, ProjectSettings } from './index.js';
8
8
  import os from 'os';
9
9
  import fs, { mkdirSync } from 'fs';
10
10
  import fse from 'fs-extra';
package/old/index.d.ts ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node --no-warnings
2
+ export type ModulesSettings = {
3
+ packageRoot: string;
4
+ targetFolder: string;
5
+ args: string[];
6
+ settings: LucySettings;
7
+ };
8
+ export type LucySettings = {
9
+ modules: {
10
+ [libName: string]: {
11
+ url: string;
12
+ branch: string;
13
+ path?: string;
14
+ noCompile?: boolean;
15
+ };
16
+ };
17
+ wixSettings: {
18
+ compilerOptions: {
19
+ composite: boolean;
20
+ noEmit: boolean;
21
+ lib: string[];
22
+ jsx: string;
23
+ };
24
+ exclude: string[];
25
+ };
26
+ initialized: boolean;
27
+ wixPackages: {
28
+ [packageName: string]: string;
29
+ };
30
+ devPackages: {
31
+ [packageName: string]: string;
32
+ };
33
+ scripts: {
34
+ [commandName: string]: string;
35
+ };
36
+ };
37
+ export type ModuleSettings = {
38
+ packageRoot: string;
39
+ targetFolder: string;
40
+ args: string[];
41
+ wixConfigPath: string;
42
+ lucyConfigPath: string;
43
+ packageJsonPath: string;
44
+ settings: LucySettings;
45
+ lockVersion: boolean;
46
+ force: boolean;
47
+ veloConfigName: string;
48
+ };
49
+ export type ProjectSettings = {
50
+ modules?: Record<string, string>;
51
+ lucySettings?: LucySettings;
52
+ packageJSON?: Record<string, any>;
53
+ };
54
+ export declare const orange: import("chalk").ChalkInstance;
55
+ export declare const blue: import("chalk").ChalkInstance;
56
+ export declare const green: import("chalk").ChalkInstance;
57
+ export declare const red: import("chalk").ChalkInstance;
58
+ export declare const yellow: import("chalk").ChalkInstance;
59
+ export declare const magenta: import("chalk").ChalkInstance;
package/old/index.js ADDED
@@ -0,0 +1,288 @@
1
+ #!/usr/bin/env node --no-warnings
2
+ import { dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { existsSync } from 'fs';
5
+ import chalk from 'chalk';
6
+ import settings from './settings.json' with { type: "json" };
7
+ ;
8
+ import projectPackageJSON from '../package.json' with { type: "json" };
9
+ ;
10
+ import { join } from 'path';
11
+ import fs from 'fs/promises';
12
+ import { init } from './init.js';
13
+ import { sync } from './sync.js';
14
+ import { runGulp, installPackages, killAllProcesses, cleanupWatchers, createTemplateFolder, updateLucyConfigFromPackageJson } from './helpers.js';
15
+ import { prepare } from './prepare.js';
16
+ import { spawn, spawnSync } from 'child_process';
17
+ import os from 'os';
18
+ export const orange = chalk.hex('#FFA500');
19
+ export const blue = chalk.blueBright;
20
+ export const green = chalk.greenBright;
21
+ export const red = chalk.redBright;
22
+ export const yellow = chalk.yellow;
23
+ export const magenta = chalk.magentaBright;
24
+ // eslint-disable-next-line @typescript-eslint/naming-convention
25
+ const __filename = fileURLToPath(import.meta.url);
26
+ // eslint-disable-next-line @typescript-eslint/naming-convention
27
+ const __dirname = dirname(__filename);
28
+ // const cwd = process.cwd();
29
+ // const command = `watchman watch-del '${cwd}'`;
30
+ // killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
31
+ // killAllProcesses('wix:dev');
32
+ process.on('exit', (code) => {
33
+ killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
34
+ killAllProcesses('wix:dev');
35
+ cleanupWatchers();
36
+ console.log(`🚪 ${magenta.underline('Process exiting with code:')} ${orange(code)}`);
37
+ });
38
+ process.on('SIGINT', () => {
39
+ console.log(`🐕 ${green.underline('Received Ctrl+C (SIGINT), cleaning up...')}`);
40
+ killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
41
+ killAllProcesses('wix:dev');
42
+ cleanupWatchers();
43
+ process.exit(); // Exit explicitly after handling
44
+ });
45
+ process.on('SIGTERM', () => {
46
+ console.log(`🛑 ${red.underline('Received termination signal (SIGTERM), cleaning up...')}`);
47
+ killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
48
+ killAllProcesses('wix:dev');
49
+ cleanupWatchers();
50
+ process.exit(); // Exit explicitly after handling
51
+ });
52
+ process.on('uncaughtException', (error) => {
53
+ console.error(`💥 ${red.underline('Uncaught Exception:')}`, error);
54
+ killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
55
+ killAllProcesses('wix:dev');
56
+ cleanupWatchers();
57
+ process.exit(1); // Exit with an error code
58
+ });
59
+ process.on('unhandledRejection', (reason, promise) => {
60
+ console.error(`🚨 ${yellow.underline('Unhandled Rejection at:')} ${orange(promise)}`);
61
+ console.error(`🚨 ${red.underline('Reason:')} ${reason}`);
62
+ cleanupWatchers();
63
+ killAllProcesses('@wix/cli/bin/wix.cjs'); // Matches processes running the Wix CLI
64
+ killAllProcesses('wix:dev');
65
+ cleanupWatchers();
66
+ process.exit(1); // Exit with an error code
67
+ });
68
+ /**
69
+ * Main function
70
+ * @returns {Promise<void>}
71
+ */
72
+ async function main() {
73
+ // INFO: Module settings
74
+ const moduleSettings = {
75
+ packageRoot: dirname(__dirname),
76
+ targetFolder: process.cwd(),
77
+ args: process.argv.slice(2),
78
+ settings,
79
+ wixConfigPath: join(process.cwd(), 'wix.config.json'),
80
+ lucyConfigPath: join(process.cwd(), 'lucy.json'),
81
+ packageJsonPath: join(process.cwd(), 'package.json'),
82
+ force: false,
83
+ lockVersion: false,
84
+ veloConfigName: 'config.json'
85
+ };
86
+ let projectSettings = {};
87
+ if (moduleSettings.args.includes('version') || moduleSettings.args.includes('-v')) {
88
+ console.log("🐾" + blue.bold(` => ${projectPackageJSON.version}`));
89
+ return;
90
+ }
91
+ if (moduleSettings.args.includes('templates')) {
92
+ const templatesPath = join(os.homedir(), '.lucy-cli');
93
+ if (!existsSync(templatesPath)) {
94
+ console.log((`💩 ${red.underline.bold("=> Lucy templates folder not found at =>")} ${orange(templatesPath)}`));
95
+ console.log(chalk.yellow('🐕 Creating templates folder with default template...'));
96
+ await createTemplateFolder(moduleSettings);
97
+ }
98
+ console.log(`🐕 ${blue.underline('Opening templates folder at:')} ${orange(templatesPath)}`);
99
+ let command;
100
+ switch (process.platform) {
101
+ case 'darwin':
102
+ command = 'open';
103
+ break;
104
+ case 'win32':
105
+ command = 'start';
106
+ break;
107
+ default:
108
+ command = 'xdg-open';
109
+ break;
110
+ }
111
+ const child = spawn(command, [templatesPath], { detached: true, stdio: 'ignore' });
112
+ child.on('error', (err) => {
113
+ console.error(`💩 ${red.underline.bold('Failed to open folder:')} ${orange(err.message)}`);
114
+ });
115
+ child.unref();
116
+ return;
117
+ }
118
+ // Run velo sync
119
+ if (moduleSettings.args.includes('velo-sync')) {
120
+ await sync(moduleSettings, projectSettings);
121
+ return;
122
+ }
123
+ if (moduleSettings.args.includes('help') || moduleSettings.args.includes('-h')) {
124
+ console.log("🦮 " + green.underline.bold(' => Lucy CLI Help'));
125
+ console.log("Usage: lucy-cli <command> [options]");
126
+ console.log("\nCommands:");
127
+ console.log("🦮 " + magenta.bold('init') + " : Initializes caontaining a WIX project to enable full TS support");
128
+ console.log("🦮 " + magenta.bold('dev') + " : Starts the development environment. This includes setting up any required services for local development.");
129
+ console.log("🦮 " + magenta.bold('build-prod') + " : Builds the project in production mode, optimizing files for deployment.");
130
+ console.log("🦮 " + magenta.bold('prepare') + " : Prepares the project by installing packages & initializing git modules, configured in lucy.json");
131
+ console.log("🦮 " + magenta.bold('velo-sync') + " : Synchronizes wix collections(velo-sync -h for help)");
132
+ console.log("🦮 " + magenta.bold('install') + " : Installs all Wix npm packages listed in the 'lucy.json' file in the project directory.");
133
+ console.log("🦮 " + magenta.bold('fix') + " : Runs a fix command to resolve common issues in development or production settings.");
134
+ console.log("🦮 " + magenta.bold('docs') + " : Generates documentation for the project.");
135
+ console.log("🦮 " + magenta.bold('cypress') + " : Starts the cypress test runner.");
136
+ console.log("🦮 " + magenta.bold('templates') + " : Opens the Lucy CLI templates folder.");
137
+ console.log("🦮 " + magenta.bold('sync-pkgs') + " : Syncs dependencies from package.json to lucy.json.");
138
+ console.log("🦮 " + magenta.bold('e2e') + " : Starts the cypress test runner in CI mode. first argument is the key second is the build id <e2e <somekey <someID>");
139
+ console.log("\nOptions:");
140
+ console.log("🦮 " + magenta.bold('-h, help') + " : Displays this help message.");
141
+ console.log("🦮 " + magenta.bold('-v, version') + " : Displays the current version of Lucy CLI as defined in the project’s package.json.");
142
+ console.log("🦮 " + magenta.bold('-f, force') + " : Forces specific commands to execute even if they may lead to potential issues.");
143
+ console.log(" Used for functions like deleting obsolete pages or initializing missing components.");
144
+ console.log("🦮 " + magenta.bold('-l') + " : Locks package versions to those specified in the configuration file lucy.json");
145
+ console.log("\nExamples:");
146
+ console.log("🦮 " + magenta.bold('lucy-cli init') + " : Initializes a new Wix project.");
147
+ console.log("🦮 " + magenta.bold('lucy-cli dev') + " : Starts the development environment.");
148
+ console.log("🦮 " + magenta.bold('lucy-cli sync') + " : Synchronizes database and settings.");
149
+ console.log("🦮 " + magenta.bold('lucy-cli install') + " : Installs all Wix npm packages from 'lucy.json'.");
150
+ console.log("🦮 " + magenta.bold('lucy-cli dev -f') + " : Starts the dev environment with forced settings.");
151
+ console.log("🦮 " + magenta.bold('lucy-cli install -l') + " : Installs Wix npm packages, respecting locked versions specified in the configuration.");
152
+ return;
153
+ }
154
+ if (!existsSync(moduleSettings.wixConfigPath)) {
155
+ console.log((`💩 ${red.underline.bold("=> This is not a WIX project =>")} ${orange(moduleSettings.targetFolder)}`));
156
+ return;
157
+ }
158
+ //INFO: Collect project settings
159
+ if (moduleSettings.args.includes('-f'))
160
+ moduleSettings.force = true;
161
+ if (moduleSettings.args.includes('-l'))
162
+ moduleSettings.lockVersion = true;
163
+ if (existsSync(moduleSettings.packageJsonPath)) {
164
+ const packageJSONraw = await fs.readFile(join(moduleSettings.packageJsonPath), 'utf8');
165
+ try {
166
+ projectSettings.packageJSON = JSON.parse(packageJSONraw);
167
+ if (moduleSettings.force) {
168
+ console.log("❗️" + red.underline(' => Forcing'));
169
+ moduleSettings.force = true;
170
+ }
171
+ }
172
+ catch (parseError) {
173
+ console.log((`💩 ${red.underline.bold("=> Error parsing package.json =>")} ${orange(parseError)}`));
174
+ return;
175
+ }
176
+ }
177
+ if (existsSync(moduleSettings.lucyConfigPath)) {
178
+ try {
179
+ const data = await fs.readFile(moduleSettings.lucyConfigPath, 'utf8');
180
+ projectSettings.lucySettings = JSON.parse(data);
181
+ }
182
+ catch (parseError) {
183
+ console.log((`💩 ${red.underline.bold("=> Error parsing Lucy.json =>")} ${orange(parseError)}`));
184
+ }
185
+ }
186
+ else {
187
+ if (!moduleSettings.args.includes('init')) {
188
+ return console.log(yellow.underline.bold('🐶 => Project not Initialized! Please initialize using "lucy-cli init"'));
189
+ }
190
+ ;
191
+ }
192
+ if (!projectSettings.lucySettings?.initialized) {
193
+ if (!moduleSettings.args.includes('init')) {
194
+ return console.log(yellow.underline.bold('🐶 => Project not Initialized! Please initialize using "lucy-cli init"'));
195
+ }
196
+ }
197
+ if (moduleSettings.args.includes('-l'))
198
+ moduleSettings.lockVersion = true;
199
+ console.log("🐕" + magenta.underline(' => Lucy CLI => RUNNING: ' + orange('Press Ctrl+C to stop.')));
200
+ // INFO: Run commands
201
+ if (moduleSettings.args.includes('init')) {
202
+ if (projectSettings.lucySettings?.initialized && !moduleSettings.force) {
203
+ console.log((`💩 ${red.underline.bold("=> This project is already initialized =>")} ${orange(moduleSettings.targetFolder)}`));
204
+ console.log("🐕" + magenta.underline(' => Use -f to force initialization'));
205
+ return;
206
+ }
207
+ console.log("🐕" + magenta.underline(' => Initializing project'));
208
+ init(moduleSettings, projectSettings);
209
+ return;
210
+ }
211
+ if (moduleSettings.args.includes('docs')) {
212
+ const res = spawnSync('yarn docs', { shell: true, stdio: 'inherit' });
213
+ if (res.error) {
214
+ return console.log((`💩 ${red.underline.bold("=> Failed to Docs generated => ")} ${orange(res.error.message)}`));
215
+ }
216
+ return console.log("🐕" + blue.underline(` => Docs generated!`));
217
+ }
218
+ if (moduleSettings.args.includes('cypress')) {
219
+ const res = spawnSync('yarn cypress', { shell: true, stdio: 'inherit' });
220
+ if (res.error) {
221
+ return console.log((`💩 ${red.underline.bold("=> Failed to start cypress => ")} ${orange(res.error.message)}`));
222
+ }
223
+ return console.log("🐕" + blue.underline(` => Started Cypress`));
224
+ }
225
+ if (moduleSettings.args.includes('e2e')) {
226
+ // Extract arguments
227
+ const e2eIndex = moduleSettings.args.indexOf('e2e');
228
+ const key = moduleSettings.args[e2eIndex + 1];
229
+ const buildId = moduleSettings.args[e2eIndex + 2];
230
+ // Validate that both arguments are provided
231
+ if (!key && !buildId) {
232
+ console.log(`💩 ${red.underline.bold("=> Missing required arguments:")} ${orange("key")} and ${orange("build ID")}`);
233
+ process.exit(1);
234
+ }
235
+ // Run Cypress with the provided arguments
236
+ const res = spawnSync(`yarn e2e --key ${key} --ci-build-id ${buildId}`, { shell: true, stdio: 'inherit' });
237
+ if (res.error) {
238
+ console.log(`💩 ${red.underline.bold("=> Failed to start Cypress =>")} ${orange(res.error.message)}`);
239
+ process.exit(1);
240
+ }
241
+ return console.log("🐕 " + blue.underline(`=> Started Cypress successfully`));
242
+ }
243
+ if (moduleSettings.args.includes('prepare')) {
244
+ await prepare(moduleSettings, projectSettings);
245
+ return;
246
+ }
247
+ if (moduleSettings.args.includes('install')) {
248
+ if (!projectSettings.lucySettings?.initialized) {
249
+ console.log((`💩 ${red.underline.bold("=> This project is not initialized =>")} ${orange(moduleSettings.targetFolder)}`));
250
+ console.log("🐕" + magenta.underline(' => Use init to initialize'));
251
+ return;
252
+ }
253
+ await installPackages(projectSettings.lucySettings.wixPackages, projectSettings.lucySettings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
254
+ return;
255
+ }
256
+ if (moduleSettings.args.includes('dev')) {
257
+ runGulp(moduleSettings, projectSettings, 'dev');
258
+ return;
259
+ }
260
+ if (moduleSettings.args.includes('build-prod')) {
261
+ runGulp(moduleSettings, projectSettings, 'build-prod');
262
+ return;
263
+ }
264
+ if (moduleSettings.args.includes('fix')) {
265
+ runGulp(moduleSettings, projectSettings, 'fix-wix');
266
+ return;
267
+ }
268
+ if (moduleSettings.args.includes('sync-pkgs')) {
269
+ console.log("🐕" + magenta.underline(' => Syncing package.json with lucy.json'));
270
+ if (!existsSync(moduleSettings.packageJsonPath)) {
271
+ console.log((`💩 ${red.underline.bold("=> package.json not found at =>")} ${orange(moduleSettings.packageJsonPath)}`));
272
+ return;
273
+ }
274
+ if (!existsSync(moduleSettings.lucyConfigPath)) {
275
+ console.log((`💩 ${red.underline.bold("=> lucy.json not found at =>")} ${orange(moduleSettings.lucyConfigPath)}`));
276
+ return;
277
+ }
278
+ await updateLucyConfigFromPackageJson(moduleSettings.packageJsonPath, moduleSettings.lucyConfigPath);
279
+ return;
280
+ }
281
+ console.log("🐕" + blue.underline.bold(' => Running dev'));
282
+ runGulp(moduleSettings, projectSettings, 'dev');
283
+ }
284
+ main().catch((error) => {
285
+ console.error("Error:", error);
286
+ process.exit(1);
287
+ });
288
+ //# sourceMappingURL=index.js.map