lucy-cli 2.0.0-alpha.7 → 2.0.0-beta.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 (452) hide show
  1. package/.yarnrc.yml +0 -1
  2. package/dist/args.d.ts +1 -6
  3. package/dist/args.js +62 -7
  4. package/dist/args.js.map +1 -0
  5. package/dist/commands/checks.d.ts +7 -0
  6. package/dist/commands/checks.js +47 -0
  7. package/dist/commands/checks.js.map +1 -0
  8. package/dist/commands/cleanup.d.ts +4 -0
  9. package/dist/commands/cleanup.js +10 -0
  10. package/dist/commands/cleanup.js.map +1 -0
  11. package/dist/commands/copy.d.ts +6 -0
  12. package/dist/commands/copy.js +20 -0
  13. package/dist/commands/copy.js.map +1 -0
  14. package/dist/commands/edit.d.ts +10 -0
  15. package/dist/commands/edit.js +67 -0
  16. package/dist/commands/edit.js.map +1 -0
  17. package/dist/commands/exec.d.ts +7 -0
  18. package/dist/commands/exec.js +67 -0
  19. package/dist/commands/exec.js.map +1 -0
  20. package/dist/commands/git.d.ts +8 -0
  21. package/dist/commands/git.js +104 -0
  22. package/dist/commands/git.js.map +1 -0
  23. package/dist/commands/home.d.ts +4 -0
  24. package/dist/commands/home.js +18 -0
  25. package/dist/commands/home.js.map +1 -0
  26. package/dist/commands/install.d.ts +8 -0
  27. package/dist/commands/install.js +165 -0
  28. package/dist/commands/install.js.map +1 -0
  29. package/dist/commands/read.d.ts +6 -0
  30. package/dist/commands/read.js +40 -0
  31. package/dist/commands/read.js.map +1 -0
  32. package/dist/commands/write.d.ts +7 -0
  33. package/dist/commands/write.js +28 -0
  34. package/dist/commands/write.js.map +1 -0
  35. package/dist/commands.js +1 -0
  36. package/dist/commands.js.map +1 -0
  37. package/dist/config.d.ts +29 -7
  38. package/dist/config.js +90 -26
  39. package/dist/config.js.map +1 -0
  40. package/dist/error.d.ts +1 -9
  41. package/dist/error.js +1 -2
  42. package/dist/error.js.map +1 -0
  43. package/dist/helpers.d.ts +9 -0
  44. package/dist/helpers.js +83 -0
  45. package/dist/helpers.js.map +1 -0
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +77 -9
  48. package/dist/index.js.map +1 -0
  49. package/dist/init/blocks.d.ts +5 -0
  50. package/dist/init/blocks.js +62 -0
  51. package/dist/init/blocks.js.map +1 -0
  52. package/dist/init/cargo.d.ts +2 -0
  53. package/dist/init/cargo.js +21 -0
  54. package/dist/init/cargo.js.map +1 -0
  55. package/dist/init/expo.d.ts +5 -0
  56. package/dist/init/expo.js +52 -0
  57. package/dist/init/expo.js.map +1 -0
  58. package/dist/init/gitModules.d.ts +2 -0
  59. package/dist/init/gitModules.js +13 -0
  60. package/dist/init/gitModules.js.map +1 -0
  61. package/dist/init/index.d.ts +4 -0
  62. package/dist/init/index.js +77 -0
  63. package/dist/init/index.js.map +1 -0
  64. package/dist/init/monorepo.d.ts +4 -0
  65. package/dist/init/monorepo.js +48 -0
  66. package/dist/init/monorepo.js.map +1 -0
  67. package/dist/init/prepareVelo.d.ts +2 -0
  68. package/dist/init/prepareVelo.js +16 -0
  69. package/dist/init/prepareVelo.js.map +1 -0
  70. package/dist/init/tauri.d.ts +5 -0
  71. package/dist/init/tauri.js +32 -0
  72. package/dist/init/tauri.js.map +1 -0
  73. package/dist/init/templates.d.ts +5 -0
  74. package/dist/init/templates.js +93 -0
  75. package/dist/init/templates.js.map +1 -0
  76. package/dist/init/velo.d.ts +5 -0
  77. package/dist/init/velo.js +60 -0
  78. package/dist/init/velo.js.map +1 -0
  79. package/dist/policy.js +1 -0
  80. package/dist/policy.js.map +1 -0
  81. package/dist/prepare.js +1 -0
  82. package/dist/prepare.js.map +1 -0
  83. package/dist/runtime.d.ts +1 -1
  84. package/dist/runtime.js +1 -0
  85. package/dist/runtime.js.map +1 -0
  86. package/dist/schemas/gulp.d.ts +25 -0
  87. package/dist/schemas/gulp.js +8 -0
  88. package/dist/schemas/gulp.js.map +1 -0
  89. package/dist/schemas/index.d.ts +10 -0
  90. package/dist/schemas/index.js +9 -0
  91. package/dist/schemas/index.js.map +1 -0
  92. package/dist/schemas/lucy.d.ts +29 -0
  93. package/dist/schemas/lucy.js +42 -0
  94. package/dist/schemas/lucy.js.map +1 -0
  95. package/dist/schemas/tsconfig.js +2 -0
  96. package/dist/schemas/tsconfig.js.map +1 -0
  97. package/dist/schemas/types.d.ts +33 -0
  98. package/dist/schemas/types.js +5 -1
  99. package/dist/schemas/types.js.map +1 -0
  100. package/dist/states.js +1 -0
  101. package/dist/states.js.map +1 -0
  102. package/dist/tasks/Gulpfile.d.ts +4 -0
  103. package/dist/tasks/Gulpfile.js +111 -0
  104. package/dist/tasks/Gulpfile.js.map +1 -0
  105. package/dist/tasks/gulp/backend.d.ts +4 -0
  106. package/dist/tasks/gulp/backend.js +92 -0
  107. package/dist/tasks/gulp/backend.js.map +1 -0
  108. package/dist/tasks/gulp/checks.d.ts +4 -0
  109. package/dist/tasks/gulp/checks.js +202 -0
  110. package/dist/tasks/gulp/checks.js.map +1 -0
  111. package/dist/tasks/gulp/clean.d.ts +3 -0
  112. package/dist/tasks/gulp/clean.js +33 -0
  113. package/dist/tasks/gulp/clean.js.map +1 -0
  114. package/dist/tasks/gulp/copy.d.ts +3 -0
  115. package/dist/tasks/gulp/copy.js +34 -0
  116. package/dist/tasks/gulp/copy.js.map +1 -0
  117. package/dist/tasks/gulp/helpers.d.ts +3 -0
  118. package/dist/tasks/gulp/helpers.js +19 -0
  119. package/dist/tasks/gulp/helpers.js.map +1 -0
  120. package/dist/tasks/gulp/pages.d.ts +2 -0
  121. package/dist/tasks/gulp/pages.js +39 -0
  122. package/dist/tasks/gulp/pages.js.map +1 -0
  123. package/dist/tasks/gulp/pipeline.d.ts +1 -0
  124. package/dist/tasks/gulp/pipeline.js +29 -0
  125. package/dist/tasks/gulp/pipeline.js.map +1 -0
  126. package/dist/tasks/gulp/public.d.ts +3 -0
  127. package/dist/tasks/gulp/public.js +50 -0
  128. package/dist/tasks/gulp/public.js.map +1 -0
  129. package/dist/tasks/gulp/styles.d.ts +3 -0
  130. package/dist/tasks/gulp/styles.js +40 -0
  131. package/dist/tasks/gulp/styles.js.map +1 -0
  132. package/dist/tasks/gulp/templates.d.ts +2 -0
  133. package/dist/tasks/gulp/templates.js +45 -0
  134. package/dist/tasks/gulp/templates.js.map +1 -0
  135. package/dist/tasks/gulp/types.d.ts +4 -0
  136. package/dist/tasks/gulp/types.js +293 -0
  137. package/dist/tasks/gulp/types.js.map +1 -0
  138. package/dist/tasks/gulp/watchers.d.ts +3 -0
  139. package/dist/tasks/gulp/watchers.js +59 -0
  140. package/dist/tasks/gulp/watchers.js.map +1 -0
  141. package/dist/tasks/index.d.ts +4 -0
  142. package/dist/tasks/index.js +23 -0
  143. package/dist/tasks/index.js.map +1 -0
  144. package/dist/tasks/syncSettings.d.ts +3 -0
  145. package/dist/tasks/syncSettings.js +18 -0
  146. package/dist/tasks/syncSettings.js.map +1 -0
  147. package/dist/utils/index.js +2 -0
  148. package/dist/utils/index.js.map +1 -0
  149. package/dist/utils/logger.d.ts +17 -0
  150. package/dist/utils/logger.js +37 -0
  151. package/dist/utils/logger.js.map +1 -0
  152. package/dist/wix-sdk/check.d.ts +4 -0
  153. package/dist/wix-sdk/check.js +23 -0
  154. package/dist/wix-sdk/check.js.map +1 -0
  155. package/dist/wix-sdk/client.d.ts +10 -0
  156. package/dist/wix-sdk/client.js +18 -0
  157. package/dist/wix-sdk/client.js.map +1 -0
  158. package/dist/wix-sdk/index.d.ts +4 -0
  159. package/dist/wix-sdk/index.js +15 -0
  160. package/dist/wix-sdk/index.js.map +1 -0
  161. package/dist/wix-sdk/init.d.ts +4 -0
  162. package/dist/wix-sdk/init.js +51 -0
  163. package/dist/wix-sdk/init.js.map +1 -0
  164. package/dist/wix-sdk/run.d.ts +4 -0
  165. package/dist/wix-sdk/run.js +53 -0
  166. package/dist/wix-sdk/run.js.map +1 -0
  167. package/dist/wix-sync/client.d.ts +3 -0
  168. package/dist/wix-sync/client.js +5 -0
  169. package/dist/wix-sync/client.js.map +1 -0
  170. package/dist/wix-sync/export.d.ts +4 -0
  171. package/dist/wix-sync/export.js +15 -0
  172. package/dist/wix-sync/export.js.map +1 -0
  173. package/dist/wix-sync/import.d.ts +4 -0
  174. package/dist/wix-sync/import.js +26 -0
  175. package/dist/wix-sync/import.js.map +1 -0
  176. package/dist/wix-sync/index.d.ts +4 -0
  177. package/dist/wix-sync/index.js +35 -0
  178. package/dist/wix-sync/index.js.map +1 -0
  179. package/dist/wix-sync/init.d.ts +4 -0
  180. package/dist/wix-sync/init.js +74 -0
  181. package/dist/wix-sync/init.js.map +1 -0
  182. package/dist/wix-sync/is-alive.d.ts +4 -0
  183. package/dist/wix-sync/is-alive.js +23 -0
  184. package/dist/wix-sync/is-alive.js.map +1 -0
  185. package/dist/wix-sync/migrate.d.ts +4 -0
  186. package/dist/wix-sync/migrate.js +21 -0
  187. package/dist/wix-sync/migrate.js.map +1 -0
  188. package/dist/wix-sync/sync.d.ts +4 -0
  189. package/dist/wix-sync/sync.js +26 -0
  190. package/dist/wix-sync/sync.js.map +1 -0
  191. package/files/sync-data/data/test.csv +17 -0
  192. package/files/sync-data/files/lucy.jpg +0 -0
  193. package/files/sync-data/schema/test.json +11 -0
  194. package/files/templates/block[D]/files/.stylelintrc.js +8 -0
  195. package/files/templates/block[D]/lucy.json +9 -0
  196. package/files/templates/cargo[D]/files/.env +1 -0
  197. package/files/templates/cargo[D]/files/Cargo.toml +238 -0
  198. package/files/templates/cargo[D]/files/Makefile.toml +4 -0
  199. package/files/templates/cargo[D]/files/build/main.rs +35 -0
  200. package/files/templates/cargo[D]/files/config/beta.json +19 -0
  201. package/files/templates/cargo[D]/files/config/ci.json +15 -0
  202. package/files/templates/cargo[D]/files/config/default.json +71 -0
  203. package/files/templates/cargo[D]/files/config/development.json +10 -0
  204. package/files/templates/cargo[D]/files/config/produktion.json +5 -0
  205. package/files/templates/cargo[D]/files/config/stage.json +4 -0
  206. package/files/templates/cargo[D]/files/locales/todo.yml +3 -0
  207. package/files/templates/cargo[D]/files/public/index.html +1 -0
  208. package/files/templates/cargo[D]/lucy.json +15 -0
  209. package/files/templates/expo[D]/files/.stylelintrc.js +8 -0
  210. package/files/{expo → templates/expo[D]/files}/eas.json +9 -3
  211. package/files/templates/expo[D]/files/lib/data.ts +197 -0
  212. package/files/{expo → templates/expo[D]/files}/metro.config.js +6 -1
  213. package/files/templates/expo[D]/files/pnpm-workspace.yaml +3 -0
  214. package/files/templates/expo[D]/lucy.json +86 -0
  215. package/files/templates/monorepo[D]/files/.editorconfig +10 -0
  216. package/files/templates/monorepo[D]/files/.nvmrc +1 -0
  217. package/files/templates/monorepo[D]/files/.prettierignore +23 -0
  218. package/files/templates/monorepo[D]/files/.prettierrc.json +15 -0
  219. package/files/templates/monorepo[D]/files/.stylelintrc.js +8 -0
  220. package/files/templates/monorepo[D]/files/.yarnrc +1 -0
  221. package/files/templates/monorepo[D]/files/.yarnrc.yml +3 -0
  222. package/files/templates/monorepo[D]/files/README.md +109 -0
  223. package/files/templates/monorepo[D]/files/currents.config.ts +5 -0
  224. package/files/templates/monorepo[D]/files/nx.json +25 -0
  225. package/files/templates/monorepo[D]/files/pnpm-workspace.yaml +11 -0
  226. package/files/templates/monorepo[D]/files/tsconfig.json +6 -0
  227. package/files/templates/monorepo[D]/files/typedoc.json +25 -0
  228. package/files/templates/monorepo[D]/files/vitest.config.ts +27 -0
  229. package/files/templates/monorepo[D]/lucy.json +69 -0
  230. package/files/templates/tauri[D]/lucy.json +9 -0
  231. package/files/templates/velo[D]/files/.prettierignore +23 -0
  232. package/files/templates/velo[D]/files/.prettierrc.js +16 -0
  233. package/files/templates/velo[D]/lucy.json +137 -0
  234. package/old/Gulpfile.d.ts +34 -0
  235. package/old/Gulpfile.js +116 -0
  236. package/old/Gulpfile.js.map +1 -0
  237. package/old/gulp/backend.d.ts +3 -0
  238. package/old/gulp/backend.js +92 -0
  239. package/old/gulp/backend.js.map +1 -0
  240. package/old/gulp/checks.d.ts +3 -0
  241. package/old/gulp/checks.js +205 -0
  242. package/old/gulp/checks.js.map +1 -0
  243. package/old/gulp/clean.d.ts +3 -0
  244. package/old/gulp/clean.js +29 -0
  245. package/old/gulp/clean.js.map +1 -0
  246. package/old/gulp/copy.d.ts +2 -0
  247. package/old/gulp/copy.js +34 -0
  248. package/old/gulp/copy.js.map +1 -0
  249. package/old/gulp/helpers.d.ts +2 -0
  250. package/old/gulp/helpers.js +25 -0
  251. package/old/gulp/helpers.js.map +1 -0
  252. package/old/gulp/pages.d.ts +2 -0
  253. package/old/gulp/pages.js +37 -0
  254. package/old/gulp/pages.js.map +1 -0
  255. package/old/gulp/pipeline.d.ts +1 -0
  256. package/old/gulp/pipeline.js +29 -0
  257. package/old/gulp/pipeline.js.map +1 -0
  258. package/old/gulp/public.d.ts +2 -0
  259. package/old/gulp/public.js +50 -0
  260. package/old/gulp/public.js.map +1 -0
  261. package/old/gulp/styles.d.ts +2 -0
  262. package/old/gulp/styles.js +40 -0
  263. package/old/gulp/styles.js.map +1 -0
  264. package/old/gulp/templates.d.ts +2 -0
  265. package/old/gulp/templates.js +33 -0
  266. package/old/gulp/templates.js.map +1 -0
  267. package/old/gulp/types.d.ts +4 -0
  268. package/old/gulp/types.js +289 -0
  269. package/old/gulp/types.js.map +1 -0
  270. package/old/gulp/watchers.d.ts +9 -0
  271. package/old/gulp/watchers.js +59 -0
  272. package/old/gulp/watchers.js.map +1 -0
  273. package/old/helpers.d.ts +32 -0
  274. package/old/helpers.js +267 -0
  275. package/old/helpers.js.map +1 -0
  276. package/{src copy/helpers.ts → old/helpers.ts} +1 -1
  277. package/old/index.d.ts +59 -0
  278. package/old/index.js +288 -0
  279. package/old/index.js.map +1 -0
  280. package/old/init.d.ts +8 -0
  281. package/old/init.js +165 -0
  282. package/old/init.js.map +1 -0
  283. package/old/models.d.ts +37 -0
  284. package/old/models.js +2 -0
  285. package/old/models.js.map +1 -0
  286. package/old/prepare.d.ts +8 -0
  287. package/old/prepare.js +20 -0
  288. package/old/prepare.js.map +1 -0
  289. package/old/schemas/index.js +2 -0
  290. package/old/schemas/index.js.map +1 -0
  291. package/old/schemas/index.ts +0 -0
  292. package/old/schemas/types.d.ts +0 -0
  293. package/old/schemas/types.js +2 -0
  294. package/old/schemas/types.js.map +1 -0
  295. package/old/schemas/types.ts +0 -0
  296. package/old/sync.d.ts +2 -0
  297. package/old/sync.js +88 -0
  298. package/old/sync.js.map +1 -0
  299. package/package.json +18 -19
  300. package/patches/velo-sync+0.0.9.patch +13 -0
  301. package/src/args.ts +62 -17
  302. package/src/commands/checks.ts +51 -0
  303. package/src/commands/cleanup.ts +11 -0
  304. package/src/commands/copy.ts +28 -0
  305. package/src/commands/edit.ts +81 -0
  306. package/src/commands/exec.ts +69 -0
  307. package/src/commands/git.ts +113 -0
  308. package/src/commands/home.ts +22 -0
  309. package/src/commands/install.ts +249 -0
  310. package/src/commands/read.ts +45 -0
  311. package/src/commands/write.ts +45 -0
  312. package/src/config.ts +116 -35
  313. package/src/error.ts +1 -2
  314. package/src/helpers.ts +92 -0
  315. package/src/index.ts +88 -13
  316. package/src/init/blocks.ts +85 -0
  317. package/src/init/cargo.ts +25 -0
  318. package/src/init/expo.ts +69 -0
  319. package/src/init/gitModules.ts +15 -0
  320. package/src/init/index.ts +81 -0
  321. package/src/init/monorepo.ts +72 -0
  322. package/src/init/prepareVelo.ts +19 -0
  323. package/src/init/tauri.ts +42 -0
  324. package/src/init/templates.ts +98 -0
  325. package/src/init/velo.ts +65 -0
  326. package/src/runtime.ts +1 -0
  327. package/src/schemas/gulp.ts +31 -0
  328. package/src/schemas/index.ts +13 -1
  329. package/src/schemas/lucy.ts +43 -0
  330. package/src/schemas/types.ts +40 -0
  331. package/src/tasks/Gulpfile.ts +207 -0
  332. package/src/tasks/gulp/backend.ts +113 -0
  333. package/src/tasks/gulp/checks.ts +218 -0
  334. package/src/tasks/gulp/clean.ts +38 -0
  335. package/src/tasks/gulp/copy.ts +38 -0
  336. package/src/tasks/gulp/helpers.ts +18 -0
  337. package/src/tasks/gulp/pages.ts +43 -0
  338. package/src/tasks/gulp/pipeline.ts +31 -0
  339. package/src/tasks/gulp/public.ts +61 -0
  340. package/src/tasks/gulp/styles.ts +47 -0
  341. package/src/tasks/gulp/templates.ts +53 -0
  342. package/src/tasks/gulp/types.ts +310 -0
  343. package/src/tasks/gulp/watchers.ts +97 -0
  344. package/src/tasks/index.ts +24 -0
  345. package/src/tasks/syncSettings.ts +21 -0
  346. package/src/types.d.ts +1 -1
  347. package/src/utils/index.ts +0 -0
  348. package/src/utils/logger.ts +40 -0
  349. package/src/wix-sdk/check.ts +24 -0
  350. package/src/wix-sdk/client.ts +18 -0
  351. package/src/wix-sdk/index.ts +17 -0
  352. package/src/wix-sdk/init.ts +54 -0
  353. package/src/wix-sdk/run.ts +56 -0
  354. package/src/wix-sync/client.ts +6 -0
  355. package/src/wix-sync/export.ts +19 -0
  356. package/src/wix-sync/import.ts +27 -0
  357. package/src/wix-sync/index.ts +36 -0
  358. package/src/wix-sync/init.ts +77 -0
  359. package/src/wix-sync/is-alive.ts +25 -0
  360. package/src/wix-sync/migrate.ts +23 -0
  361. package/src/wix-sync/sync.ts +27 -0
  362. package/tsconfig.json +6 -5
  363. package/dist/init.d.ts +0 -4
  364. package/dist/init.js +0 -275
  365. package/dist/models.js +0 -1
  366. package/dist/params.d.ts +0 -7
  367. package/dist/params.js +0 -23
  368. package/files/expo/.env +0 -1
  369. package/files/expo/lib/data.ts +0 -48
  370. package/files/expo/lucy.json +0 -8
  371. package/src/init.ts +0 -392
  372. /package/dist/{models.d.ts → schemas/tsconfig.d.ts} +0 -0
  373. /package/{files/expo/components/.gitkeep → dist/utils/index.d.ts} +0 -0
  374. /package/files/{expo → templates/expo[D]/files}/.nvmrc +0 -0
  375. /package/files/{expo → templates/expo[D]/files}/.prettierignore +0 -0
  376. /package/files/{expo → templates/expo[D]/files}/.prettierrc.js +0 -0
  377. /package/files/{expo → templates/expo[D]/files}/.yarnrc +0 -0
  378. /package/files/{expo → templates/expo[D]/files}/.yarnrc.yml +0 -0
  379. /package/files/{expo → templates/expo[D]/files}/README.md +0 -0
  380. /package/files/{expo → templates/expo[D]/files}/assets/fonts/SpaceMono-Regular.ttf +0 -0
  381. /package/files/{expo → templates/expo[D]/files}/assets/images/adaptive-icon.png +0 -0
  382. /package/files/{expo → templates/expo[D]/files}/assets/images/favicon.png +0 -0
  383. /package/files/{expo → templates/expo[D]/files}/assets/images/icon.png +0 -0
  384. /package/files/{expo → templates/expo[D]/files}/assets/images/splash-icon.png +0 -0
  385. /package/files/{expo → templates/expo[D]/files}/babel.config.js +0 -0
  386. /package/files/{expo/components/ui → templates/expo[D]/files/components}/.gitkeep +0 -0
  387. /package/files/{velo/typescript/__mocks__ → templates/expo[D]/files/components/ui}/.gitkeep +0 -0
  388. /package/files/{expo → templates/expo[D]/files}/constants/theme.ts +0 -0
  389. /package/files/{expo → templates/expo[D]/files}/eslint.config.mjs +0 -0
  390. /package/files/{expo → templates/expo[D]/files}/global.css +0 -0
  391. /package/files/{expo → templates/expo[D]/files}/hooks/useColorScheme.ts +0 -0
  392. /package/files/{expo → templates/expo[D]/files}/index.ts +0 -0
  393. /package/files/{expo → templates/expo[D]/files}/lib/utils/index.ts +0 -0
  394. /package/files/{expo → templates/expo[D]/files}/lib/utils/polyfills.ts +0 -0
  395. /package/files/{expo → templates/expo[D]/files}/lib/wix/client.ts +0 -0
  396. /package/files/{expo → templates/expo[D]/files}/lib/wix/error.ts +0 -0
  397. /package/files/{expo → templates/expo[D]/files}/lib/wix/index.ts +0 -0
  398. /package/files/{expo → templates/expo[D]/files}/nativewind-env.d.ts +0 -0
  399. /package/files/{expo → templates/expo[D]/files}/scripts/reset-project.ts +0 -0
  400. /package/files/{expo → templates/expo[D]/files}/tailwind.config.js +0 -0
  401. /package/files/{expo → templates/expo[D]/files}/tsconfig.json +0 -0
  402. /package/files/{expo → templates/expo[D]/files}/types/reset.d.ts +0 -0
  403. /package/files/{velo → templates/velo[D]/files}/.gitmodules +0 -0
  404. /package/files/{velo → templates/velo[D]/files}/.madgerc +0 -0
  405. /package/files/{velo → templates/velo[D]/files}/.nvmrc +0 -0
  406. /package/files/{velo → templates/velo[D]/files}/.stylelintrc.js +0 -0
  407. /package/files/{velo → templates/velo[D]/files}/.yarnrc.yml +0 -0
  408. /package/files/{velo → templates/velo[D]/files}/currents.config.js +0 -0
  409. /package/files/{velo → templates/velo[D]/files}/cypress/e2e/base/base.cy.ts +0 -0
  410. /package/files/{velo → templates/velo[D]/files}/cypress/fixtures/example.json +0 -0
  411. /package/files/{velo → templates/velo[D]/files}/cypress/support/commands.ts +0 -0
  412. /package/files/{velo → templates/velo[D]/files}/cypress/support/e2e.ts +0 -0
  413. /package/files/{velo → templates/velo[D]/files}/cypress/tsconfig.json +0 -0
  414. /package/files/{velo → templates/velo[D]/files}/cypress.config.mjs +0 -0
  415. /package/files/{velo → templates/velo[D]/files}/eslint.config.mjs +0 -0
  416. /package/files/{velo → templates/velo[D]/files}/local.tsconfig.json +0 -0
  417. /package/files/{velo → templates/velo[D]/files}/typedoc.json +0 -0
  418. /package/files/{velo/typescript/pages → templates/velo[D]/files/typescript/__mocks__}/.gitkeep +0 -0
  419. /package/files/{velo → templates/velo[D]/files}/typescript/backend/data.ts +0 -0
  420. /package/files/{velo → templates/velo[D]/files}/typescript/backend/events.ts +0 -0
  421. /package/files/{velo → templates/velo[D]/files}/typescript/backend/http-functions.ts +0 -0
  422. /package/files/{velo → templates/velo[D]/files}/typescript/backend/lib/http-functions/sync.ts +0 -0
  423. /package/files/{velo → templates/velo[D]/files}/typescript/backend/permissions.json +0 -0
  424. /package/files/{velo/typescript/public → templates/velo[D]/files/typescript/pages}/.gitkeep +0 -0
  425. /package/files/{velo/typescript/styles → templates/velo[D]/files/typescript/public}/.gitkeep +0 -0
  426. /package/files/{velo → templates/velo[D]/files}/typescript/public/scss/app.scss +0 -0
  427. /package/files/{velo/typescript/styles/global.scss → templates/velo[D]/files/typescript/styles/.gitkeep} +0 -0
  428. /package/{src copy/schemas/index.ts → files/templates/velo[D]/files/typescript/styles/global.scss} +0 -0
  429. /package/files/{velo → templates/velo[D]/files}/typescript/tsconfig.json +0 -0
  430. /package/files/{velo → templates/velo[D]/files}/vitest.config.ts +0 -0
  431. /package/{src copy → old}/Gulpfile.ts +0 -0
  432. /package/{src copy → old}/gulp/backend.ts +0 -0
  433. /package/{src copy → old}/gulp/checks.ts +0 -0
  434. /package/{src copy → old}/gulp/clean.ts +0 -0
  435. /package/{src copy → old}/gulp/copy.ts +0 -0
  436. /package/{src copy → old}/gulp/helpers.ts +0 -0
  437. /package/{src copy → old}/gulp/pages.ts +0 -0
  438. /package/{src copy → old}/gulp/pipeline.ts +0 -0
  439. /package/{src copy → old}/gulp/public.ts +0 -0
  440. /package/{src copy → old}/gulp/styles.ts +0 -0
  441. /package/{src copy → old}/gulp/templates.ts +0 -0
  442. /package/{src copy → old}/gulp/types.ts +0 -0
  443. /package/{src copy → old}/gulp/watchers.ts +0 -0
  444. /package/{src copy → old}/index.ts +0 -0
  445. /package/{src copy → old}/init.ts +0 -0
  446. /package/{src copy → old}/models.ts +0 -0
  447. /package/{src copy → old}/prepare.ts +0 -0
  448. /package/{src copy/schemas/types.ts → old/schemas/index.d.ts} +0 -0
  449. /package/{src copy → old}/settings.json +0 -0
  450. /package/{src copy → old}/sync.ts +0 -0
  451. /package/{src copy → old}/types.d.ts +0 -0
  452. /package/src/{models.ts → schemas/tsconfig.ts} +0 -0
package/old/sync.js ADDED
@@ -0,0 +1,88 @@
1
+ import chalk from "chalk";
2
+ import { green, orange, red } from "./index.js";
3
+ import readline from 'node:readline';
4
+ import veloAPI from 'velo-sync/dist/velo/velo-api.js';
5
+ import syncTask from 'velo-sync/dist/tasks/sync-task.js';
6
+ import { readConfig, saveConfig } from "./helpers.js";
7
+ import optimist from 'optimist';
8
+ import migrateFileCache from 'velo-sync/dist/tasks/migrate-files-cache-task.js';
9
+ function printUsage() {
10
+ console.log('Usage: ');
11
+ console.log('');
12
+ console.log('Commands:');
13
+ console.log(' init generates a config file for the import / export / sync process');
14
+ console.log(' is-alive tests the config and the connection to the site');
15
+ console.log(' sync runs the sync process');
16
+ console.log(' import runs an import process');
17
+ console.log(' migrate migrate existing nedb cache to sqlite cache (.upload-cache.db => .upload-cache.sqlite.db)');
18
+ }
19
+ function syncOrImportTask(importOnly) {
20
+ let argv = optimist
21
+ .usage(`Usage: $0 ${importOnly ? 'import' : 'sync'} -f <scv filename> -c <collection>`)
22
+ .demand('f')
23
+ .alias('f', 'filename')
24
+ .describe('f', 'csv filename to import')
25
+ .demand('c')
26
+ .describe('c', 'the name of the collection to import into')
27
+ .alias('c', 'collection')
28
+ .demand('s')
29
+ .describe('s', 'schema file describing the fields of the collection')
30
+ .alias('s', 'schema')
31
+ .describe('dry', 'dry-run that does not upload any data or files, and does not remove or update anything on the site')
32
+ .alias('dry', 'dryrun')
33
+ .parse(process.argv.slice(3));
34
+ let filename = argv.filename;
35
+ let collection = argv.collection;
36
+ let schema = argv.schema;
37
+ let dryrun = argv.dryrun;
38
+ //@ts-ignore
39
+ syncTask.default(filename, collection, schema, importOnly, dryrun);
40
+ }
41
+ export async function sync(moduleSettings, projectSettings) {
42
+ if (moduleSettings.args.includes('-h') || moduleSettings.args.includes('help'))
43
+ return printUsage();
44
+ if (moduleSettings.args.includes('init')) {
45
+ const rl = readline.createInterface({
46
+ input: process.stdin,
47
+ output: process.stdout,
48
+ terminal: true
49
+ });
50
+ async function askQuestion(query) {
51
+ return new Promise((resolve) => rl.question(query, (answer) => resolve(answer)));
52
+ }
53
+ console.log(chalk.yellow('hello to velo-sync init'));
54
+ let siteUrl = await askQuestion(orange('what is the url of the site homepage? '));
55
+ let secret = await askQuestion(orange('what is the velo-sync secret? '));
56
+ rl.close();
57
+ let config = { siteUrl, secret };
58
+ await saveConfig(config, moduleSettings.veloConfigName);
59
+ return console.log(chalk.green("🐕" + ' => config saved!'));
60
+ }
61
+ if (moduleSettings.args.includes('is-alive')) {
62
+ try {
63
+ let config = await readConfig(moduleSettings.veloConfigName);
64
+ console.log("🐕" + green(` => checking if the API for site ${chalk.greenBright(config.siteUrl)} is alive...`));
65
+ await veloAPI.isAlive(config);
66
+ return console.log(chalk.green("🐕" + ` => API of site ${chalk.greenBright(config.siteUrl)} is working and alive!!!`));
67
+ }
68
+ catch (e) {
69
+ if (e instanceof Error) {
70
+ return console.log((`💩 ${red.underline.bold("=> Failed to check endpoint")} ${orange(e.message)}`));
71
+ }
72
+ }
73
+ }
74
+ if (moduleSettings.args.includes('sync')) {
75
+ return syncOrImportTask(false);
76
+ }
77
+ if (moduleSettings.args.includes('import')) {
78
+ return syncOrImportTask(true);
79
+ }
80
+ if (moduleSettings.args.includes('export')) {
81
+ return console.log((`💩 ${red.underline.bold("=> Not implemented")}`));
82
+ }
83
+ if (moduleSettings.args.includes('migrate')) {
84
+ //@ts-ignore
85
+ migrateFileCache.default();
86
+ }
87
+ }
88
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAQ,KAAK,EAAkB,MAAM,EAAmB,GAAG,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,OAAO,OAAO,MAAM,iCAAiC,CAAC;AACtD,OAAO,QAAQ,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AACtE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,gBAAgB,MAAM,kDAAkD,CAAC;AAChF,SAAS,UAAU;IACf,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,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,IAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,YAAY;QACZ,gBAAgB,CAAC,OAAO,EAAE,CAAC;IAC/B,CAAC;AAEL,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "2.0.0-alpha.7",
4
+ "version": "2.0.0-beta.1",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
8
  "build": "tsc",
10
- "dev": "tsc -w"
9
+ "dev": "tsc -w",
10
+ "postinstall": "patch-package"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
@@ -36,14 +36,17 @@
36
36
  "@effect/platform-node": "^0.94.0",
37
37
  "@swc/core": "^1.9.3",
38
38
  "@wix/cli": "^1.0.83",
39
+ "@wix/data": "^1.0.270",
39
40
  "@wix/eslint-plugin-cli": "^1.0.1",
41
+ "@wix/sdk": "^1.15.26",
42
+ "@wix/sites": "^1.0.24",
40
43
  "chalk": "^5.3.0",
41
44
  "effect": "^3.17.1",
42
45
  "enquirer": "^2.4.1",
43
46
  "glob": "11.0.3",
44
47
  "gulp": "5.0.1",
45
48
  "gulp-clean": "^0.4.0",
46
- "gulp-cli": "3.0.0",
49
+ "gulp-cli": "3.1.0",
47
50
  "gulp-concat": "^2.6.1",
48
51
  "gulp-exec": "^5.0.0",
49
52
  "gulp-flatmap": "^1.0.2",
@@ -62,22 +65,22 @@
62
65
  "gulp-typescript": "5.0.1",
63
66
  "gulp-wait": "^0.0.2",
64
67
  "jest": "30.0.5",
65
- "merge-stream": "^2.0.0",
66
68
  "merge2": "^1.4.1",
67
69
  "optimist": "^0.6.1",
70
+ "patch-package": "^8.0.0",
68
71
  "prettier": "^3.0.3",
69
72
  "sass": "^1.65.1",
70
73
  "simple-git": "^3.20.0",
71
74
  "ts-jest": "^29.1.1",
72
75
  "ts-node": "^10.9.1",
73
- "typedoc": "0.26.11",
74
- "typescript": "^5.6.3",
76
+ "typedoc": "0.28.9",
77
+ "typescript": "5.9.2",
75
78
  "velo-sync": "^0.0.9",
76
79
  "yargs": "^18.0.0"
77
80
  },
78
81
  "devDependencies": {
79
82
  "@types/fs-extra": "^11.0.4",
80
- "@types/glob": "9.0.0",
83
+ "@types/glob": "8.1.0",
81
84
  "@types/gulp": "^4.0.17",
82
85
  "@types/gulp-concat": "^0.0.37",
83
86
  "@types/gulp-insert": "^0.5.13",
@@ -87,21 +90,17 @@
87
90
  "@types/gulp-sass": "^5.0.4",
88
91
  "@types/gulp-tap": "^1.0.5",
89
92
  "@types/jest": "30.0.0",
90
- "@types/merge-stream": "2.0.0",
91
93
  "@types/merge2": "^1.4.4",
92
94
  "@types/optimist": "^0.0.33",
93
95
  "@types/yargs": "^17.0.33",
94
- "@typescript-eslint/eslint-plugin": "8.14.0",
95
- "@typescript-eslint/parser": "8.14.0",
96
- "@typescript-eslint/utils": "8.14.0",
97
- "eslint": "9.14.0",
96
+ "@typescript-eslint/eslint-plugin": "8.39.0",
97
+ "@typescript-eslint/parser": "8.39.0",
98
+ "@typescript-eslint/utils": "8.39.0",
99
+ "eslint": "9.32.0",
98
100
  "eslint-plugin-import": "^2.27.5",
99
- "eslint-plugin-jsdoc": "51.4.1",
101
+ "eslint-plugin-jsdoc": "52.0.4",
100
102
  "eslint-plugin-named-import-spacing": "^1.0.3",
101
103
  "eslint-plugin-simple-import-sort": "12.1.1",
102
- "i": "^0.3.7",
103
- "npm": "^11.0.0",
104
- "ts-node": "^10.9.1"
105
- },
106
- "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
104
+ "ts-node": "10.9.2"
105
+ }
107
106
  }
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/velo-sync/dist/tasks/sync-task.js b/node_modules/velo-sync/dist/tasks/sync-task.js
2
+ index bf9e91c..9a351ec 100644
3
+ --- a/node_modules/velo-sync/dist/tasks/sync-task.js
4
+ +++ b/node_modules/velo-sync/dist/tasks/sync-task.js
5
+ @@ -30,7 +30,7 @@ exports.default = syncTask;
6
+ function runImport(filename, collection, schemaFilename, importOnly, dryrun) {
7
+ return new Promise(async (resolve) => {
8
+ let stats = new statistics_1.LoggingStatistics();
9
+ - let config = await config_1.readConfig('config.json');
10
+ + let config = await config_1.readConfig('wix-sync.json');
11
+ let schema = await schema_1.readSchema(schemaFilename);
12
+ let loggerRejectsReporter = new rejects_reporter_1.LoggerRejectsReporter(stats);
13
+ let uploadFileCache = new SQLiteFileUploadCache_1.SQLiteFileUploadCache('./.upload-cache.sqlite.db');
package/src/args.ts CHANGED
@@ -1,36 +1,81 @@
1
1
  import yargs from "yargs";
2
2
  import { hideBin } from "yargs/helpers";
3
+ import { initTypes, LucyArgs, taskNames, syncActions } from "./schemas/types.js";
4
+ import { createRequire } from "node:module";
3
5
 
4
- // It's a good practice to define an interface for your arguments
5
- // for type safety throughout your application.
6
- export interface LucyArgs {
7
- [x: string]: unknown;
8
- // This will hold the command used, e.g., 'init'
9
- _: (string | number)[];
10
- $0: string;
11
- // Arguments for the 'init' command
12
- type?: 'velo' | 'expo' | 'blocks';
13
- }
6
+ const require = createRequire(import.meta.url);
7
+ const pkg = require("../package.json");
14
8
 
15
9
  export async function get_args(): Promise<LucyArgs> {
16
10
  const argv = await yargs(hideBin(process.argv))
17
11
  .usage('Usage: $0 <command> [options]')
18
- .command('init <type>', 'Initialize a new Lucy project', (yargs) => {
19
- return yargs.positional('type', {
12
+ .command('init <initType>', 'Initialize a new Lucy project', (yargs) => {
13
+ return yargs.positional('initType', {
20
14
  describe: 'The type of project to initialize',
21
- choices: ['velo', 'expo', 'blocks'] as const,
22
- demandOption: true, // Makes this positional argument required
15
+ choices: initTypes,
16
+ demandOption: true,
17
+ })
18
+ }).option('force', {
19
+ alias: 'f',
20
+ type: 'boolean',
21
+ description: 'Run with force'
22
+ })
23
+ .command('open', 'Open the Lucy home directory')
24
+ .command('task <tasksName>', 'Run a task', (yargs) => {
25
+ return yargs.positional('tasksName', {
26
+ describe: 'The task to run',
27
+ choices: taskNames,
28
+ demandOption: true,
29
+ })
30
+ })
31
+ .command('wix-sync <syncAction>', 'Run a velo-sync action', (yargs) => {
32
+ return yargs.positional("syncAction", {
33
+ describe: "The velo-sync action to run",
34
+ choices: syncActions,
35
+ demandOption: true,
36
+ })
37
+ .option('input', {
38
+ alias: 'i',
39
+ type: 'string',
40
+ describe: 'The CSV file to import',
41
+ demandOption: false,
42
+ })
43
+ .option('c', {
44
+ alias: 'collection',
45
+ type: 'string',
46
+ describe: 'The name of the collection to import data into',
47
+ demandOption: false,
48
+ })
49
+ .option('s', {
50
+ alias: 'schema',
51
+ type: 'string',
52
+ describe: 'The schema file',
53
+ demandOption: false,
54
+ })
55
+ .option('d', {
56
+ type: 'boolean',
57
+ describe: 'Run in dry-run mode',
58
+ demandOption: false,
59
+ });
60
+ })
61
+ .command('wix-sdk <wixSDKAction>', 'Run a velo-sync action', (yargs) => {
62
+ return yargs.positional("wixSDKAction", {
63
+ describe: "The velo-sync action to run",
64
+ choices: syncActions,
65
+ demandOption: true,
23
66
  });
24
67
  })
25
- // Enforce that a command must be provided (e.g., 'init')
26
68
  .demandCommand(1, 'You need to provide a command. Use --help for a list of commands.')
69
+ .version('v', 'Show version number', pkg.version)
70
+ .alias('v', 'version')
27
71
  .help()
28
72
  .alias('h', 'help')
29
73
  .strict()
30
- .wrap(yargs().terminalWidth()) // Wrap help text to terminal width
31
- .epilogue('For more information, visit https://github.com/your-repo/wix-lucy-cli') // Example of a relevant epilogue
74
+ .wrap(yargs().terminalWidth())
75
+ .epilogue('For more information, visit https://github.com/your-repo/wix-lucy-cli')
32
76
  .parseAsync();
33
77
 
34
78
  // The cast is now safer with the defined interface.
79
+
35
80
  return argv as LucyArgs;
36
81
  }
@@ -0,0 +1,51 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { FileSystem, Path } from "@effect/platform"
3
+ import { Config, lucyJsonName } from "../config.js";
4
+ import { logger } from "../utils/logger.js";
5
+ import { AppError } from "../error.js";
6
+ import { JsonSchema } from "../schemas/index.js";
7
+
8
+ export const isDirectoryClean =(excludes: string[] = []) => {
9
+ return Effect.gen(function*() {
10
+ const fs = yield* FileSystem.FileSystem;
11
+ const config = yield* Config;
12
+
13
+ const files = yield* fs.readDirectory(config.config.cwd);
14
+ const allExcludes = [...excludes, '.git', lucyJsonName];
15
+ const filteredFiles = files.filter(file => !allExcludes.includes(file));
16
+
17
+ return filteredFiles.length > 0 ? false : true;
18
+ });
19
+ }
20
+
21
+ export const checkForDirty = (excludes: string[] = []) => {
22
+ return Effect.gen(function*() {
23
+ const config = yield* Config;
24
+ const clean = yield* isDirectoryClean(excludes);
25
+ if(!clean && !config.config.force) {
26
+ logger.alert("The current directory is not empty. Please run this command in an empty directory.")
27
+ yield* Effect.fail(new AppError({ message: "Directory is not clean", cause: new Error("Directory is not clean") }));
28
+ return;
29
+ }
30
+ if(config.config.lucySettings.initialized && !config.config.force) {
31
+ logger.alert("Lucy is already initialized in this directory. Use --force to reinitialize.")
32
+ yield* Effect.fail(new AppError({ message: "Lucy is already initialized in this directory", cause: new Error("Lucy is already initialized in this directory") }));
33
+ return;
34
+ }
35
+
36
+ if ((!clean && config.config.force) || (config.config.lucySettings.initialized && config.config.force)) logger.alert("Forced initialization!")
37
+ });
38
+ }
39
+ export const checkForVelo = () => {
40
+ return Effect.gen(function*() {
41
+ const config = yield* Config;
42
+ const fs = yield* FileSystem.FileSystem;
43
+ const path = yield* Path.Path;
44
+
45
+ const wixConfigPath = path.join(config.config.cwd, 'wix.config.json');
46
+ const wixConfigRaw = yield* fs.readFileString(wixConfigPath);
47
+ const wixConfigJSON =( yield* Schema.decodeUnknown(JsonSchema)(wixConfigRaw)) as any;
48
+
49
+ if(!(wixConfigJSON.siteId)) return yield* Effect.fail(new AppError({ message: "This directory is not a Velo project. Please run this command in a Velo project directory.", cause: new Error("Not a Velo project") }));
50
+ });
51
+ }
@@ -0,0 +1,11 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { FileSystem, Path } from "@effect/platform"
4
+
5
+ export const cleanup = Effect.gen(function* () {
6
+ const config = yield* Config;
7
+ const fs = yield* FileSystem.FileSystem;
8
+ const path = yield* Path.Path;
9
+
10
+ yield* fs.remove(path.join(config.config.cwd, "package-lock.json"), { force: true })
11
+ });
@@ -0,0 +1,28 @@
1
+ import { Effect } from "effect/index";
2
+ import { Path } from "@effect/platform"
3
+ import { FileSystem } from "@effect/platform"
4
+ import { Config, syncDataName, syncFilesSource } from "../config.js";
5
+
6
+ export const copyTemplateFiles = Effect.gen(function*() {
7
+ const fs = yield* FileSystem.FileSystem;
8
+ const config = yield* Config;
9
+ const path = yield * Path.Path;
10
+
11
+ const templateFiles = yield* fs.readDirectory(config.config.templateFiles)
12
+ yield* Effect.forEach(
13
+ templateFiles,
14
+ (file) => fs.copy(path.join(config.config.templateFiles, file), path.join(config.config.cwd, file), { overwrite: true })
15
+ )
16
+ })
17
+ export const copySyncFiles = Effect.gen(function*() {
18
+ const fs = yield* FileSystem.FileSystem;
19
+ const config = yield* Config;
20
+ const path = yield * Path.Path;
21
+
22
+ const synDataFiles = yield* fs.readDirectory(syncFilesSource)
23
+ yield* fs.makeDirectory(path.join(config.config.cwd, syncDataName));
24
+ yield* Effect.forEach(
25
+ synDataFiles,
26
+ (file) => fs.copy(path.join(syncFilesSource, file), path.join(config.config.cwd, syncDataName, file), { overwrite: true })
27
+ )
28
+ })
@@ -0,0 +1,81 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { Config, lucyJsonPath } from "../config.js";
3
+ import { FileSystem, Path } from "@effect/platform"
4
+ import { logger } from "../utils/logger.js";
5
+ import { JsonSchema } from "../schemas/index.js";
6
+ import { LucySettings } from "../schemas/lucy.js";
7
+
8
+ export const editJson = (json: any, keys: string[], values: string[] | Object[]) => {
9
+ return Effect.gen(function*() {
10
+ const config = yield* Config;
11
+
12
+ for (const key of keys){
13
+ const index = keys.indexOf(key);
14
+ const value = values[index];
15
+ json[key] = value;
16
+ }
17
+ })
18
+ }
19
+
20
+ export const mergeLucySettings2PackageJson = Effect.gen(function*() {
21
+ const config = yield* Config;
22
+ const lucySettings = config.config.lucySettings;
23
+ const packageJson = config.config.packageJson;
24
+
25
+ if (Object.keys(lucySettings.scripts).length > 0) {
26
+ yield* editJson(packageJson, ['scripts'], [{...packageJson.scripts, ...lucySettings.scripts}]);
27
+ }
28
+ })
29
+
30
+ export const setModule = Effect.gen(function*() {
31
+ const config = yield* Config;
32
+ const lucySettings = config.config.lucySettings;
33
+ const packageJson = config.config.packageJson;
34
+
35
+ yield* editJson(packageJson, ['type'], ['module']);
36
+ })
37
+
38
+ export const mergeAdditions = Effect.gen(function*() {
39
+ const config = yield* Config;
40
+ const lucySettings = config.config.lucySettings;
41
+ const packageJson = config.config.packageJson;
42
+
43
+ config.config.packageJson = {
44
+ ...packageJson,
45
+ ...lucySettings.additionalPkgProps,
46
+ }
47
+ })
48
+
49
+ export const setProjectName = Effect.gen(function*() {
50
+ const config = yield* Config;
51
+ const packageJson = config.config.packageJson;
52
+
53
+ yield * editJson(packageJson, ["name"], [config.config.projectName]);
54
+ })
55
+
56
+ export const setInitialized = Effect.gen(function*() {
57
+ const fs = yield* FileSystem.FileSystem;
58
+ const lucyRaw = yield* fs.readFileString(lucyJsonPath);
59
+ const lucyJSON = (yield* Schema.decodeUnknown(JsonSchema)(lucyRaw)) as any;
60
+ lucyJSON.initialized = true;
61
+
62
+ yield* fs.writeFileString(lucyJsonPath, JSON.stringify(lucyJSON, null, 2));
63
+ })
64
+
65
+ export const stringReplace = (filePath: string, keys: string[], values: string[]) => {
66
+ return Effect.gen(function*() {
67
+ const fs = yield* FileSystem.FileSystem;
68
+ let modifiedContent: string = '';
69
+
70
+ logger.action(`Replacing ${keys} with ${values} in ${filePath}`);
71
+ const data = yield* fs.readFileString(filePath, 'utf8');
72
+ for (const key of keys){
73
+ const index = keys.indexOf(key);
74
+ const value = values[index];
75
+ const regex = new RegExp(`${key}`, 'g');
76
+ modifiedContent = data.replace(regex, `${value}`);
77
+ }
78
+ yield* fs.writeFileString(filePath, modifiedContent);
79
+ logger.info(`Updated file ${filePath}`);
80
+ })
81
+ }
@@ -0,0 +1,69 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { Command } from "@effect/platform/index";
4
+ import { logger } from "../utils/logger.js";
5
+ import { FileSystem } from "@effect/platform"
6
+ import Enquirer from "enquirer";
7
+ import { AppError } from "../error.js";
8
+
9
+ export const execCommand = Effect.gen(function*() {
10
+ const config = yield* Config;
11
+ const cmds = config.config.lucySettings.additionalCommands ?? [];
12
+ logger.info("Executing additional commands...", cmds);
13
+ if (cmds.length > 0) {
14
+ logger.info("Executing additional commands");
15
+ yield *
16
+ Effect.all([
17
+ ...cmds.map((cmd) => {
18
+ return Command.make(cmd[0], ...cmd.slice(1))
19
+ .pipe()
20
+ .pipe(Command.stdout("inherit"), Command.stderr("inherit"), Command.exitCode);
21
+ }),
22
+ ]);
23
+ }
24
+ })
25
+
26
+ export const open = Effect.scoped(Effect.gen(function*() {
27
+ const config = yield* Config;
28
+ const fs = yield* FileSystem.FileSystem
29
+ console.log("Opening Lucy home directory:", config.config.lucyHome);
30
+ let command: ReturnType<typeof Command.make>;
31
+ switch (process.platform) {
32
+ case 'darwin': command = Command.make('open', config.config.lucyHome); break;
33
+ case 'win32': command = Command.make('start', config.config.lucyHome); break;
34
+ default: command = Command.make('xdg-open', config.config.lucyHome); break;
35
+ }
36
+
37
+ command.pipe().pipe(Command.stdout("inherit"), Command.stderr("inherit"), Command.exitCode);
38
+ yield* command.pipe().pipe(Command.stdout("inherit"), Command.stderr("inherit"), Command.exitCode);
39
+ }))
40
+
41
+ export const openVSCode = Effect.gen(function*() {
42
+ const config = yield* Config;
43
+ const open = Command.make(
44
+ "code",
45
+ config.config.cwd,
46
+ ).pipe(
47
+ Command.stdout("inherit"), // Stream stdout to process.stdout
48
+ Command.stderr("inherit"), // Stream stderr to process.stderr
49
+ Command.exitCode // Get the exit code
50
+ )
51
+ const overwriteQuestion = new Enquirer();
52
+ const openVScodeQuestion = yield* Effect.tryPromise({
53
+ try: () => overwriteQuestion.prompt({
54
+ type: 'confirm',
55
+ name: 'openVSCode',
56
+ message: `Do you want to open the project in VSCode?`,
57
+ }),
58
+ catch: (e) => {
59
+ return new AppError({
60
+ cause: e,
61
+ message: "Error opening VSCode",
62
+ });
63
+ }
64
+ })
65
+ const choice = yield* Schema.decodeUnknown(Schema.Struct({ openVSCode: Schema.Boolean }))(openVScodeQuestion);
66
+ if (choice.openVSCode) {
67
+ yield* open
68
+ }
69
+ })
@@ -0,0 +1,113 @@
1
+ import { Effect } from 'effect/index';
2
+ import { simpleGit, SimpleGit } from 'simple-git';
3
+ import { Config } from '../config.js';
4
+ import { AppError } from '../error.js';
5
+ import { logger } from '../utils/logger.js';
6
+ import { FileSystem, Path } from "@effect/platform"
7
+
8
+ export const isSubmoduleRegistered = (git: SimpleGit, submoduleName: string) => Effect.gen(function* () {
9
+ const value = yield* Effect.tryPromise({
10
+ try: () => git.getConfig(`submodule.${submoduleName}.url`),
11
+ catch: (error) => {
12
+ return new AppError({
13
+ cause: error,
14
+ message: "Failed to get submodule url",
15
+ });
16
+ }
17
+ })
18
+ return !!value.value;
19
+ })
20
+
21
+ export const gitInit = (update: boolean = false) => Effect.gen(function* () {
22
+ const config = yield* Config;
23
+ const git = simpleGit({ baseDir: config.config.cwd });
24
+ const path = yield * Path.Path;
25
+
26
+ const isGit = yield* Effect.tryPromise({
27
+ try: () => git.checkIsRepo(),
28
+ catch: (error) => {
29
+ return new AppError({
30
+ cause: error,
31
+ message: "Failed to check if the directory is a git repository",
32
+ });
33
+ }
34
+ })
35
+
36
+ if(!isGit) {
37
+ yield* Effect.tryPromise({
38
+ try: () => git.init(),
39
+ catch: (error) => {
40
+ return new AppError({
41
+ cause: error,
42
+ message: "Failed to initialize git repository",
43
+ });
44
+ }
45
+ })
46
+ }
47
+
48
+ if (!config.config.lucySettings.modules) {
49
+ logger.alert('No submodules defined in settings, skipping.');
50
+ return;
51
+ }
52
+ yield* initSubmodules(update);
53
+ })
54
+
55
+ export const initSubmodules = (update: boolean = false) => Effect.gen(function* () {
56
+ const config = yield* Config;
57
+ const git = simpleGit({ baseDir: config.config.cwd });
58
+ const path = yield* Path.Path;
59
+ const fs = yield* FileSystem.FileSystem;
60
+ const gitmodulesPath = path.join(config.config.cwd, ".gitmodules");
61
+
62
+ for (const [name, repo] of Object.entries(config.config.lucySettings.modules)) {
63
+ logger.action(`Processing submodule ${name}`);
64
+ const clonePath = repo.path || path.join(config.config.lucySettings.defaultModulePath ?? '', name);
65
+
66
+ const isRegistered = yield* isSubmoduleRegistered(git, clonePath);
67
+ const isConfiguredInFile = (yield* fs.exists(gitmodulesPath)) && (yield* fs.readFileString(gitmodulesPath, 'utf-8')).includes(`[submodule "${clonePath}"]`);
68
+
69
+ if (!isConfiguredInFile || config.config.force) {
70
+ logger.action(`Adding/updating submodule ${name} at ${clonePath}...`);
71
+ // If git already has a config entry, we must use --force to repair it.
72
+ const submoduleArgs = () => {
73
+ if (update) {
74
+ return ['add', '--force', repo.source, clonePath];
75
+ }
76
+ return ['add', ...(config.config.force || isRegistered ? ['--force'] : []), repo.source, clonePath];
77
+ }
78
+ // await git.subModule(submoduleArgs);
79
+ yield* Effect.tryPromise({
80
+ try: () => git.subModule(submoduleArgs()),
81
+ catch: (error) => {
82
+ return new AppError({
83
+ cause: error,
84
+ message: "Failed to add submodule",
85
+ });
86
+ }
87
+ })
88
+ } else {
89
+ logger.alert(`Submodule ${name} at ${clonePath} already registered. Skipping add.`);
90
+ }
91
+
92
+ yield* Effect.tryPromise({
93
+ try: () => git.submoduleUpdate(['--init', '--recursive', clonePath]),
94
+ catch: (error) => {
95
+ return new AppError({
96
+ cause: error,
97
+ message: "Failed to update submodule",
98
+ });
99
+ }
100
+ })
101
+ yield* Effect.tryPromise({
102
+ try: () => simpleGit({ baseDir: path.join(config.config.cwd, clonePath) }).checkout(repo.branch),
103
+ catch: (error) => {
104
+ return new AppError({
105
+ cause: error,
106
+ message: `Failed to checkout submodule ${repo} branch ${repo.branch}`,
107
+ });
108
+ }
109
+ })
110
+ }
111
+ logger.success("All modules processed!");
112
+
113
+ })