lucy-cli 2.0.0-alpha.11 → 2.0.0-alpha.12

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 (464) hide show
  1. package/dist/Gulpfile.d.ts +35 -0
  2. package/dist/Gulpfile.js +132 -0
  3. package/dist/Gulpfile.js.map +1 -0
  4. package/dist/args.d.ts +1 -6
  5. package/dist/args.js +18 -5
  6. package/dist/args.js.map +1 -0
  7. package/dist/commands/checks.d.ts +7 -0
  8. package/dist/commands/checks.js +47 -0
  9. package/dist/commands/checks.js.map +1 -0
  10. package/dist/commands/cleanup copy.d.ts +4 -0
  11. package/dist/commands/cleanup copy.js +10 -0
  12. package/dist/commands/cleanup copy.js.map +1 -0
  13. package/dist/commands/cleanup.d.ts +4 -0
  14. package/dist/commands/cleanup.js +10 -0
  15. package/dist/commands/cleanup.js.map +1 -0
  16. package/dist/commands/copy.d.ts +5 -0
  17. package/dist/commands/copy.js +12 -0
  18. package/dist/commands/copy.js.map +1 -0
  19. package/dist/commands/edit.d.ts +10 -0
  20. package/dist/commands/edit.js +69 -0
  21. package/dist/commands/edit.js.map +1 -0
  22. package/dist/commands/exec copy.d.ts +3 -0
  23. package/dist/commands/exec copy.js +20 -0
  24. package/dist/commands/exec copy.js.map +1 -0
  25. package/dist/commands/exec.d.ts +5 -0
  26. package/dist/commands/exec.js +40 -0
  27. package/dist/commands/exec.js.map +1 -0
  28. package/dist/commands/git.d.ts +8 -0
  29. package/dist/commands/git.js +104 -0
  30. package/dist/commands/git.js.map +1 -0
  31. package/dist/commands/home.d.ts +4 -0
  32. package/dist/commands/home.js +18 -0
  33. package/dist/commands/home.js.map +1 -0
  34. package/dist/commands/install.d.ts +8 -0
  35. package/dist/commands/install.js +110 -0
  36. package/dist/commands/install.js.map +1 -0
  37. package/dist/commands/read.d.ts +5 -0
  38. package/dist/commands/read.js +34 -0
  39. package/dist/commands/read.js.map +1 -0
  40. package/dist/commands/write.d.ts +5 -0
  41. package/dist/commands/write.js +16 -0
  42. package/dist/commands/write.js.map +1 -0
  43. package/dist/commands.js +1 -0
  44. package/dist/commands.js.map +1 -0
  45. package/dist/config.d.ts +11 -6
  46. package/dist/config.js +40 -4
  47. package/dist/config.js.map +1 -0
  48. package/dist/error.d.ts +1 -9
  49. package/dist/error.js +1 -2
  50. package/dist/error.js.map +1 -0
  51. package/dist/gulp/backend.d.ts +3 -0
  52. package/dist/gulp/backend.js +92 -0
  53. package/dist/gulp/backend.js.map +1 -0
  54. package/dist/gulp/checks.d.ts +3 -0
  55. package/dist/gulp/checks.js +194 -0
  56. package/dist/gulp/checks.js.map +1 -0
  57. package/dist/gulp/clean.d.ts +3 -0
  58. package/dist/gulp/clean.js +33 -0
  59. package/dist/gulp/clean.js.map +1 -0
  60. package/dist/gulp/copy.d.ts +2 -0
  61. package/dist/gulp/copy.js +34 -0
  62. package/dist/gulp/copy.js.map +1 -0
  63. package/dist/gulp/helpers.d.ts +2 -0
  64. package/dist/gulp/helpers.js +21 -0
  65. package/dist/gulp/helpers.js.map +1 -0
  66. package/dist/gulp/pages.d.ts +2 -0
  67. package/dist/gulp/pages.js +39 -0
  68. package/dist/gulp/pages.js.map +1 -0
  69. package/dist/gulp/pipeline.d.ts +1 -0
  70. package/dist/gulp/pipeline.js +29 -0
  71. package/dist/gulp/pipeline.js.map +1 -0
  72. package/dist/gulp/public.d.ts +2 -0
  73. package/dist/gulp/public.js +50 -0
  74. package/dist/gulp/public.js.map +1 -0
  75. package/dist/gulp/styles.d.ts +2 -0
  76. package/dist/gulp/styles.js +40 -0
  77. package/dist/gulp/styles.js.map +1 -0
  78. package/dist/gulp/templates.d.ts +2 -0
  79. package/dist/gulp/templates.js +33 -0
  80. package/dist/gulp/templates.js.map +1 -0
  81. package/dist/gulp/types.d.ts +4 -0
  82. package/dist/gulp/types.js +289 -0
  83. package/dist/gulp/types.js.map +1 -0
  84. package/dist/gulp/watchers.d.ts +9 -0
  85. package/dist/gulp/watchers.js +57 -0
  86. package/dist/gulp/watchers.js.map +1 -0
  87. package/dist/helpers.js +1 -0
  88. package/dist/helpers.js.map +1 -0
  89. package/dist/index.js +38 -7
  90. package/dist/index.js.map +1 -0
  91. package/dist/init/blocks.d.ts +5 -0
  92. package/dist/init/blocks.js +60 -0
  93. package/dist/init/blocks.js.map +1 -0
  94. package/dist/init/cargo copy.d.ts +2 -0
  95. package/dist/init/cargo copy.js +16 -0
  96. package/dist/init/cargo copy.js.map +1 -0
  97. package/dist/init/cargo.d.ts +2 -0
  98. package/dist/init/cargo.js +19 -0
  99. package/dist/init/cargo.js.map +1 -0
  100. package/dist/init/expo copy.d.ts +5 -0
  101. package/dist/init/expo copy.js +48 -0
  102. package/dist/init/expo copy.js.map +1 -0
  103. package/dist/init/expo.d.ts +5 -0
  104. package/dist/init/expo.js +50 -0
  105. package/dist/init/expo.js.map +1 -0
  106. package/dist/init/gitModules.d.ts +2 -0
  107. package/dist/init/gitModules.js +13 -0
  108. package/dist/init/gitModules.js.map +1 -0
  109. package/dist/init/index.d.ts +4 -0
  110. package/dist/init/index.js +64 -0
  111. package/dist/init/index.js.map +1 -0
  112. package/dist/init/lucy.d.ts +1 -0
  113. package/dist/init/lucy.js +2 -0
  114. package/dist/init/monorepo copy.d.ts +4 -0
  115. package/dist/init/monorepo copy.js +28 -0
  116. package/dist/init/monorepo copy.js.map +1 -0
  117. package/dist/init/monorepo.d.ts +4 -0
  118. package/dist/init/monorepo.js +35 -0
  119. package/dist/init/monorepo.js.map +1 -0
  120. package/dist/init/prepare.d.ts +8 -0
  121. package/dist/init/prepare.js +20 -0
  122. package/dist/init/prepare.js.map +1 -0
  123. package/dist/init/prepareVelo.d.ts +2 -0
  124. package/dist/init/prepareVelo.js +16 -0
  125. package/dist/init/prepareVelo.js.map +1 -0
  126. package/dist/init/sync.d.ts +2 -0
  127. package/dist/init/sync.js +88 -0
  128. package/dist/init/sync.js.map +1 -0
  129. package/dist/init/tauri.d.ts +5 -0
  130. package/dist/init/tauri.js +29 -0
  131. package/dist/init/tauri.js.map +1 -0
  132. package/dist/init/templates.d.ts +5 -0
  133. package/dist/init/templates.js +94 -0
  134. package/dist/init/templates.js.map +1 -0
  135. package/dist/init/velo.d.ts +5 -0
  136. package/dist/init/velo.js +58 -0
  137. package/dist/init/velo.js.map +1 -0
  138. package/dist/init/write.d.ts +5 -0
  139. package/dist/init/write.js +15 -0
  140. package/dist/models.js +1 -0
  141. package/dist/models.js.map +1 -0
  142. package/dist/policy.js +1 -0
  143. package/dist/policy.js.map +1 -0
  144. package/dist/prepare.js +1 -0
  145. package/dist/prepare.js.map +1 -0
  146. package/dist/runtime.d.ts +1 -1
  147. package/dist/runtime.js +1 -0
  148. package/dist/runtime.js.map +1 -0
  149. package/dist/schemas/gulp.d.ts +16 -0
  150. package/dist/schemas/gulp.js +4 -0
  151. package/dist/schemas/gulp.js.map +1 -0
  152. package/dist/schemas/index.js +1 -0
  153. package/dist/schemas/index.js.map +1 -0
  154. package/dist/schemas/lucy.d.ts +26 -0
  155. package/dist/schemas/lucy.js +39 -0
  156. package/dist/schemas/lucy.js.map +1 -0
  157. package/dist/schemas/models.d.ts +37 -0
  158. package/dist/schemas/models.js +2 -0
  159. package/dist/schemas/models.js.map +1 -0
  160. package/dist/schemas/tsconfig.d.ts +37 -0
  161. package/dist/schemas/tsconfig.js +2 -0
  162. package/dist/schemas/tsconfig.js.map +1 -0
  163. package/dist/schemas/types.d.ts +15 -0
  164. package/dist/schemas/types.js +3 -1
  165. package/dist/schemas/types.js.map +1 -0
  166. package/dist/states.js +1 -0
  167. package/dist/states.js.map +1 -0
  168. package/dist/sync/index.js +2 -0
  169. package/dist/sync/index.js.map +1 -0
  170. package/dist/sync/sync.js +88 -0
  171. package/dist/sync/sync.js.map +1 -0
  172. package/dist/tasks/Gulpfile.d.ts +35 -0
  173. package/dist/tasks/Gulpfile.js +135 -0
  174. package/dist/tasks/Gulpfile.js.map +1 -0
  175. package/dist/tasks/gulp/backend.d.ts +3 -0
  176. package/dist/tasks/gulp/backend.js +92 -0
  177. package/dist/tasks/gulp/backend.js.map +1 -0
  178. package/dist/tasks/gulp/checks.d.ts +3 -0
  179. package/dist/tasks/gulp/checks.js +195 -0
  180. package/dist/tasks/gulp/checks.js.map +1 -0
  181. package/dist/tasks/gulp/clean.d.ts +3 -0
  182. package/dist/tasks/gulp/clean.js +33 -0
  183. package/dist/tasks/gulp/clean.js.map +1 -0
  184. package/dist/tasks/gulp/copy.d.ts +2 -0
  185. package/dist/tasks/gulp/copy.js +34 -0
  186. package/dist/tasks/gulp/copy.js.map +1 -0
  187. package/dist/tasks/gulp/helpers.d.ts +2 -0
  188. package/dist/tasks/gulp/helpers.js +21 -0
  189. package/dist/tasks/gulp/helpers.js.map +1 -0
  190. package/dist/tasks/gulp/pages.d.ts +2 -0
  191. package/dist/tasks/gulp/pages.js +39 -0
  192. package/dist/tasks/gulp/pages.js.map +1 -0
  193. package/dist/tasks/gulp/pipeline.d.ts +1 -0
  194. package/dist/tasks/gulp/pipeline.js +29 -0
  195. package/dist/tasks/gulp/pipeline.js.map +1 -0
  196. package/dist/tasks/gulp/public.d.ts +2 -0
  197. package/dist/tasks/gulp/public.js +50 -0
  198. package/dist/tasks/gulp/public.js.map +1 -0
  199. package/dist/tasks/gulp/styles.d.ts +2 -0
  200. package/dist/tasks/gulp/styles.js +40 -0
  201. package/dist/tasks/gulp/styles.js.map +1 -0
  202. package/dist/tasks/gulp/templates.d.ts +2 -0
  203. package/dist/tasks/gulp/templates.js +45 -0
  204. package/dist/tasks/gulp/templates.js.map +1 -0
  205. package/dist/tasks/gulp/types.d.ts +4 -0
  206. package/dist/tasks/gulp/types.js +300 -0
  207. package/dist/tasks/gulp/types.js.map +1 -0
  208. package/dist/tasks/gulp/watchers.d.ts +9 -0
  209. package/dist/tasks/gulp/watchers.js +57 -0
  210. package/dist/tasks/gulp/watchers.js.map +1 -0
  211. package/dist/tasks/index.d.ts +4 -0
  212. package/dist/tasks/index.js +25 -0
  213. package/dist/tasks/index.js.map +1 -0
  214. package/dist/tasks/sync.d.ts +2 -0
  215. package/dist/tasks/sync.js +88 -0
  216. package/dist/tasks/sync.js.map +1 -0
  217. package/dist/utils/index.js +2 -0
  218. package/dist/utils/index.js.map +1 -0
  219. package/dist/utils/install.js +1 -0
  220. package/dist/utils/logger.d.ts +17 -0
  221. package/dist/utils/logger.js +37 -0
  222. package/dist/utils/logger.js.map +1 -0
  223. package/files/templates/block[D]/files/.stylelintrc.js +8 -0
  224. package/files/templates/block[D]/lucy.json +8 -0
  225. package/files/templates/cargo[D]/files/.env +1 -0
  226. package/files/templates/cargo[D]/files/Cargo.toml +238 -0
  227. package/files/templates/cargo[D]/files/Makefile.toml +4 -0
  228. package/files/templates/cargo[D]/files/build/main.rs +35 -0
  229. package/files/templates/cargo[D]/files/config/beta.json +19 -0
  230. package/files/templates/cargo[D]/files/config/ci.json +15 -0
  231. package/files/templates/cargo[D]/files/config/default.json +71 -0
  232. package/files/templates/cargo[D]/files/config/development.json +10 -0
  233. package/files/templates/cargo[D]/files/config/produktion.json +5 -0
  234. package/files/templates/cargo[D]/files/config/stage.json +4 -0
  235. package/files/templates/cargo[D]/files/locales/todo.yml +3 -0
  236. package/files/templates/cargo[D]/files/public/index.html +1 -0
  237. package/files/templates/cargo[D]/lucy.json +14 -0
  238. package/files/templates/expo[D]/files/.stylelintrc.js +8 -0
  239. package/files/templates/expo[D]/lucy.json +81 -0
  240. package/files/templates/monorepo[D]/files/.nvmrc +1 -0
  241. package/files/templates/monorepo[D]/files/.prettierignore +23 -0
  242. package/files/templates/monorepo[D]/files/.prettierrc.json +15 -0
  243. package/files/templates/monorepo[D]/files/.stylelintrc.js +8 -0
  244. package/files/templates/monorepo[D]/files/.yarnrc +1 -0
  245. package/files/templates/monorepo[D]/files/.yarnrc.yml +3 -0
  246. package/files/templates/monorepo[D]/files/README.md +137 -0
  247. package/files/templates/monorepo[D]/files/currents.config.ts +5 -0
  248. package/files/templates/monorepo[D]/files/package.json +39 -0
  249. package/files/templates/monorepo[D]/files/turbo.json +34 -0
  250. package/files/templates/monorepo[D]/files/typedoc.json +25 -0
  251. package/files/templates/monorepo[D]/files/vitest.config.ts +27 -0
  252. package/files/templates/monorepo[D]/lucy.json +45 -0
  253. package/files/templates/tauri[D]/lucy.json +8 -0
  254. package/files/templates/velo[D]/files/.prettierignore +23 -0
  255. package/files/templates/velo[D]/files/.prettierrc.js +16 -0
  256. package/files/templates/velo[D]/files/typescript/__mocks__/.gitkeep +0 -0
  257. package/files/templates/velo[D]/files/typescript/backend/data.ts +0 -0
  258. package/files/templates/velo[D]/files/typescript/backend/events.ts +0 -0
  259. package/files/templates/velo[D]/files/typescript/pages/.gitkeep +0 -0
  260. package/files/templates/velo[D]/files/typescript/public/.gitkeep +0 -0
  261. package/files/templates/velo[D]/files/typescript/public/scss/app.scss +0 -0
  262. package/files/templates/velo[D]/files/typescript/styles/.gitkeep +0 -0
  263. package/files/templates/velo[D]/files/typescript/styles/global.scss +0 -0
  264. package/files/templates/velo[D]/lucy.json +136 -0
  265. package/old/Gulpfile.d.ts +34 -0
  266. package/old/Gulpfile.js +116 -0
  267. package/old/Gulpfile.js.map +1 -0
  268. package/old/gulp/backend.d.ts +3 -0
  269. package/old/gulp/backend.js +92 -0
  270. package/old/gulp/backend.js.map +1 -0
  271. package/old/gulp/checks.d.ts +3 -0
  272. package/old/gulp/checks.js +205 -0
  273. package/old/gulp/checks.js.map +1 -0
  274. package/old/gulp/clean.d.ts +3 -0
  275. package/old/gulp/clean.js +29 -0
  276. package/old/gulp/clean.js.map +1 -0
  277. package/old/gulp/copy.d.ts +2 -0
  278. package/old/gulp/copy.js +34 -0
  279. package/old/gulp/copy.js.map +1 -0
  280. package/old/gulp/helpers.d.ts +2 -0
  281. package/old/gulp/helpers.js +25 -0
  282. package/old/gulp/helpers.js.map +1 -0
  283. package/old/gulp/pages.d.ts +2 -0
  284. package/old/gulp/pages.js +37 -0
  285. package/old/gulp/pages.js.map +1 -0
  286. package/old/gulp/pipeline.d.ts +1 -0
  287. package/old/gulp/pipeline.js +29 -0
  288. package/old/gulp/pipeline.js.map +1 -0
  289. package/old/gulp/public.d.ts +2 -0
  290. package/old/gulp/public.js +50 -0
  291. package/old/gulp/public.js.map +1 -0
  292. package/old/gulp/styles.d.ts +2 -0
  293. package/old/gulp/styles.js +40 -0
  294. package/old/gulp/styles.js.map +1 -0
  295. package/old/gulp/templates.d.ts +2 -0
  296. package/old/gulp/templates.js +33 -0
  297. package/old/gulp/templates.js.map +1 -0
  298. package/old/gulp/types.d.ts +4 -0
  299. package/old/gulp/types.js +289 -0
  300. package/old/gulp/types.js.map +1 -0
  301. package/old/gulp/watchers.d.ts +9 -0
  302. package/old/gulp/watchers.js +59 -0
  303. package/old/gulp/watchers.js.map +1 -0
  304. package/old/helpers.d.ts +32 -0
  305. package/old/helpers.js +267 -0
  306. package/old/helpers.js.map +1 -0
  307. package/{src copy/helpers.ts → old/helpers.ts} +1 -1
  308. package/old/index.d.ts +59 -0
  309. package/old/index.js +288 -0
  310. package/old/index.js.map +1 -0
  311. package/old/init.d.ts +8 -0
  312. package/old/init.js +165 -0
  313. package/old/init.js.map +1 -0
  314. package/old/models.d.ts +37 -0
  315. package/old/models.js +2 -0
  316. package/old/models.js.map +1 -0
  317. package/old/prepare.d.ts +8 -0
  318. package/old/prepare.js +20 -0
  319. package/old/prepare.js.map +1 -0
  320. package/old/schemas/index.d.ts +0 -0
  321. package/old/schemas/index.js +2 -0
  322. package/old/schemas/index.js.map +1 -0
  323. package/old/schemas/index.ts +0 -0
  324. package/old/schemas/types.d.ts +0 -0
  325. package/old/schemas/types.js +2 -0
  326. package/old/schemas/types.js.map +1 -0
  327. package/old/schemas/types.ts +0 -0
  328. package/old/sync.d.ts +2 -0
  329. package/old/sync.js +88 -0
  330. package/old/sync.js.map +1 -0
  331. package/package.json +3 -6
  332. package/src/args.ts +18 -17
  333. package/src/commands/checks.ts +51 -0
  334. package/src/commands/cleanup.ts +11 -0
  335. package/src/commands/copy.ts +16 -0
  336. package/src/commands/edit.ts +83 -0
  337. package/src/commands/exec.ts +37 -0
  338. package/src/commands/git.ts +113 -0
  339. package/src/commands/home.ts +22 -0
  340. package/src/commands/install.ts +186 -0
  341. package/src/commands/read.ts +37 -0
  342. package/src/commands/write.ts +24 -0
  343. package/src/config.ts +50 -10
  344. package/src/error.ts +1 -2
  345. package/src/index.ts +45 -9
  346. package/src/init/blocks.ts +82 -0
  347. package/src/init/cargo.ts +22 -0
  348. package/src/init/expo.ts +66 -0
  349. package/src/init/gitModules.ts +15 -0
  350. package/src/init/index.ts +69 -0
  351. package/src/init/monorepo.ts +39 -0
  352. package/src/init/prepareVelo.ts +19 -0
  353. package/src/init/tauri.ts +40 -0
  354. package/src/init/templates.ts +99 -0
  355. package/src/init/velo.ts +62 -0
  356. package/src/runtime.ts +1 -0
  357. package/src/schemas/gulp.ts +23 -0
  358. package/src/schemas/lucy.ts +39 -0
  359. package/src/schemas/types.ts +20 -0
  360. package/src/sync/index.ts +0 -0
  361. package/src/sync/sync.ts +96 -0
  362. package/src/tasks/Gulpfile.ts +252 -0
  363. package/src/tasks/gulp/backend.ts +112 -0
  364. package/src/tasks/gulp/checks.ts +214 -0
  365. package/src/tasks/gulp/clean.ts +38 -0
  366. package/src/tasks/gulp/copy.ts +43 -0
  367. package/src/tasks/gulp/helpers.ts +25 -0
  368. package/src/tasks/gulp/pages.ts +43 -0
  369. package/src/tasks/gulp/pipeline.ts +32 -0
  370. package/src/tasks/gulp/public.ts +60 -0
  371. package/src/tasks/gulp/styles.ts +46 -0
  372. package/src/tasks/gulp/templates.ts +53 -0
  373. package/src/tasks/gulp/types.ts +317 -0
  374. package/src/tasks/gulp/watchers.ts +100 -0
  375. package/src/tasks/index.ts +32 -0
  376. package/src/types.d.ts +1 -1
  377. package/src/utils/index.ts +0 -0
  378. package/src/utils/logger.ts +40 -0
  379. package/tsconfig.json +6 -5
  380. package/files/expo/lucy.json +0 -8
  381. package/src/init.ts +0 -392
  382. /package/{files/expo/components/.gitkeep → .turbo/cookies/1.cookie} +0 -0
  383. /package/{files/expo/components/ui/.gitkeep → .turbo/cookies/2.cookie} +0 -0
  384. /package/{files/velo/.gitmodules → .turbo/cookies/3.cookie} +0 -0
  385. /package/{files/velo/typescript/__mocks__/.gitkeep → .turbo/cookies/4.cookie} +0 -0
  386. /package/{files/velo/typescript/backend/data.ts → .turbo/cookies/5.cookie} +0 -0
  387. /package/{files/velo/typescript/backend/events.ts → .turbo/daemon/ee24a4f4ab6aa3c0-turbo.log.2025-07-31} +0 -0
  388. /package/{files/velo/typescript/pages/.gitkeep → dist/sync/index.d.ts} +0 -0
  389. /package/{files/velo/typescript/public/.gitkeep → dist/sync/sync.d.ts} +0 -0
  390. /package/{files/velo/typescript/public/scss/app.scss → dist/utils/index.d.ts} +0 -0
  391. /package/{files/velo/typescript/styles/.gitkeep → dist/utils/install.d.ts} +0 -0
  392. /package/files/{expo → templates/expo[D]/files}/.nvmrc +0 -0
  393. /package/files/{expo → templates/expo[D]/files}/.prettierignore +0 -0
  394. /package/files/{expo → templates/expo[D]/files}/.prettierrc.js +0 -0
  395. /package/files/{expo → templates/expo[D]/files}/.yarnrc +0 -0
  396. /package/files/{expo → templates/expo[D]/files}/.yarnrc.yml +0 -0
  397. /package/files/{expo → templates/expo[D]/files}/README.md +0 -0
  398. /package/files/{expo → templates/expo[D]/files}/assets/fonts/SpaceMono-Regular.ttf +0 -0
  399. /package/files/{expo → templates/expo[D]/files}/assets/images/adaptive-icon.png +0 -0
  400. /package/files/{expo → templates/expo[D]/files}/assets/images/favicon.png +0 -0
  401. /package/files/{expo → templates/expo[D]/files}/assets/images/icon.png +0 -0
  402. /package/files/{expo → templates/expo[D]/files}/assets/images/splash-icon.png +0 -0
  403. /package/files/{expo → templates/expo[D]/files}/babel.config.js +0 -0
  404. /package/files/{velo/typescript/styles/global.scss → templates/expo[D]/files/components/.gitkeep} +0 -0
  405. /package/{src copy/schemas/index.ts → files/templates/expo[D]/files/components/ui/.gitkeep} +0 -0
  406. /package/files/{expo → templates/expo[D]/files}/constants/theme.ts +0 -0
  407. /package/files/{expo → templates/expo[D]/files}/eas.json +0 -0
  408. /package/files/{expo → templates/expo[D]/files}/eslint.config.mjs +0 -0
  409. /package/files/{expo → templates/expo[D]/files}/global.css +0 -0
  410. /package/files/{expo → templates/expo[D]/files}/hooks/useColorScheme.ts +0 -0
  411. /package/files/{expo → templates/expo[D]/files}/index.ts +0 -0
  412. /package/files/{expo → templates/expo[D]/files}/lib/data.ts +0 -0
  413. /package/files/{expo → templates/expo[D]/files}/lib/utils/index.ts +0 -0
  414. /package/files/{expo → templates/expo[D]/files}/lib/utils/polyfills.ts +0 -0
  415. /package/files/{expo → templates/expo[D]/files}/lib/wix/client.ts +0 -0
  416. /package/files/{expo → templates/expo[D]/files}/lib/wix/error.ts +0 -0
  417. /package/files/{expo → templates/expo[D]/files}/lib/wix/index.ts +0 -0
  418. /package/files/{expo → templates/expo[D]/files}/metro.config.js +0 -0
  419. /package/files/{expo → templates/expo[D]/files}/nativewind-env.d.ts +0 -0
  420. /package/files/{expo → templates/expo[D]/files}/scripts/reset-project.ts +0 -0
  421. /package/files/{expo → templates/expo[D]/files}/tailwind.config.js +0 -0
  422. /package/files/{expo → templates/expo[D]/files}/tsconfig.json +0 -0
  423. /package/files/{expo → templates/expo[D]/files}/types/reset.d.ts +0 -0
  424. /package/{src copy/schemas/types.ts → files/templates/velo[D]/files/.gitmodules} +0 -0
  425. /package/files/{velo → templates/velo[D]/files}/.madgerc +0 -0
  426. /package/files/{velo → templates/velo[D]/files}/.nvmrc +0 -0
  427. /package/files/{velo → templates/velo[D]/files}/.stylelintrc.js +0 -0
  428. /package/files/{velo → templates/velo[D]/files}/.yarnrc.yml +0 -0
  429. /package/files/{velo → templates/velo[D]/files}/currents.config.js +0 -0
  430. /package/files/{velo → templates/velo[D]/files}/cypress/e2e/base/base.cy.ts +0 -0
  431. /package/files/{velo → templates/velo[D]/files}/cypress/fixtures/example.json +0 -0
  432. /package/files/{velo → templates/velo[D]/files}/cypress/support/commands.ts +0 -0
  433. /package/files/{velo → templates/velo[D]/files}/cypress/support/e2e.ts +0 -0
  434. /package/files/{velo → templates/velo[D]/files}/cypress/tsconfig.json +0 -0
  435. /package/files/{velo → templates/velo[D]/files}/cypress.config.mjs +0 -0
  436. /package/files/{velo → templates/velo[D]/files}/eslint.config.mjs +0 -0
  437. /package/files/{velo → templates/velo[D]/files}/local.tsconfig.json +0 -0
  438. /package/files/{velo → templates/velo[D]/files}/typedoc.json +0 -0
  439. /package/files/{velo → templates/velo[D]/files}/typescript/backend/http-functions.ts +0 -0
  440. /package/files/{velo → templates/velo[D]/files}/typescript/backend/lib/http-functions/sync.ts +0 -0
  441. /package/files/{velo → templates/velo[D]/files}/typescript/backend/permissions.json +0 -0
  442. /package/files/{velo → templates/velo[D]/files}/typescript/tsconfig.json +0 -0
  443. /package/files/{velo → templates/velo[D]/files}/vitest.config.ts +0 -0
  444. /package/{src copy → old}/Gulpfile.ts +0 -0
  445. /package/{src copy → old}/gulp/backend.ts +0 -0
  446. /package/{src copy → old}/gulp/checks.ts +0 -0
  447. /package/{src copy → old}/gulp/clean.ts +0 -0
  448. /package/{src copy → old}/gulp/copy.ts +0 -0
  449. /package/{src copy → old}/gulp/helpers.ts +0 -0
  450. /package/{src copy → old}/gulp/pages.ts +0 -0
  451. /package/{src copy → old}/gulp/pipeline.ts +0 -0
  452. /package/{src copy → old}/gulp/public.ts +0 -0
  453. /package/{src copy → old}/gulp/styles.ts +0 -0
  454. /package/{src copy → old}/gulp/templates.ts +0 -0
  455. /package/{src copy → old}/gulp/types.ts +0 -0
  456. /package/{src copy → old}/gulp/watchers.ts +0 -0
  457. /package/{src copy → old}/index.ts +0 -0
  458. /package/{src copy → old}/init.ts +0 -0
  459. /package/{src copy → old}/models.ts +0 -0
  460. /package/{src copy → old}/prepare.ts +0 -0
  461. /package/{src copy → old}/settings.json +0 -0
  462. /package/{src copy → old}/sync.ts +0 -0
  463. /package/{src copy → old}/types.d.ts +0 -0
  464. /package/src/{models.ts → schemas/tsconfig.ts} +0 -0
@@ -0,0 +1,83 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { Config } 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 config = yield* Config;
58
+ const fs = yield* FileSystem.FileSystem;
59
+ const path = yield* Path.Path;
60
+ const lucyRaw = yield* fs.readFileString(path.join(config.config.cwd, 'lucy.json'));
61
+ const lucyJSON = (yield* Schema.decodeUnknown(JsonSchema)(lucyRaw)) as any;
62
+ lucyJSON.initialized = true;
63
+
64
+ yield* fs.writeFileString(path.join(config.config.cwd, 'lucy.json'), JSON.stringify(lucyJSON, null, 2));
65
+ })
66
+
67
+ export const stringReplace = (filePath: string, keys: string[], values: string[]) => {
68
+ return Effect.gen(function*() {
69
+ const fs = yield* FileSystem.FileSystem;
70
+ let modifiedContent: string = '';
71
+
72
+ logger.action(`Replacing ${keys} with ${values} in ${filePath}`);
73
+ const data = yield* fs.readFileString(filePath, 'utf8');
74
+ for (const key of keys){
75
+ const index = keys.indexOf(key);
76
+ const value = values[index];
77
+ const regex = new RegExp(`${key}`, 'g');
78
+ modifiedContent = data.replace(regex, `${value}`);
79
+ }
80
+ yield* fs.writeFileString(filePath, modifiedContent);
81
+ logger.info(`Updated file ${filePath}`);
82
+ })
83
+ }
@@ -0,0 +1,37 @@
1
+ import { Effect } 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
+
7
+ export const execCommand = Effect.gen(function*() {
8
+ const config = yield* Config;
9
+ const cmds = config.config.lucySettings.additionalCommands ?? [];
10
+ logger.info("Executing additional commands...", cmds);
11
+ if (cmds.length > 0) {
12
+ logger.info("Executing additional commands");
13
+ yield *
14
+ Effect.all([
15
+ ...cmds.map((cmd) => {
16
+ return Command.make(cmd[0], ...cmd.slice(1))
17
+ .pipe()
18
+ .pipe(Command.stdout("inherit"), Command.exitCode);
19
+ }),
20
+ ]);
21
+ }
22
+ })
23
+
24
+ export const open = Effect.scoped(Effect.gen(function*() {
25
+ const config = yield* Config;
26
+ const fs = yield* FileSystem.FileSystem
27
+ console.log("Opening Lucy home directory:", config.config.lucyHome);
28
+ let command: ReturnType<typeof Command.make>;
29
+ switch (process.platform) {
30
+ case 'darwin': command = Command.make('open', config.config.lucyHome); break;
31
+ case 'win32': command = Command.make('start', config.config.lucyHome); break;
32
+ default: command = Command.make('xdg-open', config.config.lucyHome); break;
33
+ }
34
+
35
+ command.pipe().pipe(Command.stdout("inherit"), Command.exitCode);
36
+ yield* command.pipe().pipe(Command.stdout("inherit"), Command.exitCode);
37
+ }))
@@ -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.defaultModuleBasePath, 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
+ })
@@ -0,0 +1,22 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { FileSystem } from "@effect/platform"
4
+ import { logger, orange } from "../utils/logger.js";
5
+ import path, { join } from 'path';
6
+
7
+ export const createLucyHome = () => {
8
+ return Effect.gen(function*() {
9
+ const config = yield* Config
10
+ const fs = yield* FileSystem.FileSystem
11
+
12
+ if(!(yield* fs.exists(config.config.lucyHome))) {
13
+ logger.action(`Creating Lucy home directory at ${orange(config.config.lucyHome)}`);
14
+ yield* fs.makeDirectory(config.config.lucyHome, { recursive: true });
15
+ }
16
+ const templateFiles = yield* fs.readDirectory(config.config.filesFolder)
17
+ yield* Effect.forEach(
18
+ templateFiles,
19
+ (file) => fs.copy(path.join(config.config.filesFolder, file), path.join(config.config.lucyHome, file), { overwrite: true })
20
+ )
21
+ });
22
+ }
@@ -0,0 +1,186 @@
1
+ import { Command } from "@effect/platform/index";
2
+ import { Effect, Schedule } from "effect/index";
3
+ import { Config } from "../config.js";
4
+ import { logger } from "../utils/logger.js";
5
+ import { CommandExecutor, ExitCode } from "@effect/platform/CommandExecutor";
6
+ import { PlatformError } from "@effect/platform/Error";
7
+
8
+ export const installPackages = Effect.gen(function*() {
9
+ const config = yield* Config;
10
+
11
+ const pkgs: string[] = []
12
+ for (const [key, value] of Object.entries(config.config.lucySettings.dependencies)) {
13
+ if (value.length > 0) {
14
+ pkgs.push(`${key}@${value}`);
15
+ continue
16
+ }
17
+ pkgs.push(key);
18
+ }
19
+ const devPkgs: string[] = []
20
+ for (const [key, value] of Object.entries(config.config.lucySettings.devDependencies)) {
21
+ if (value.length > 0) {
22
+ devPkgs.push(`${key}@${value}`);
23
+ continue
24
+ }
25
+ devPkgs.push(key);
26
+ }
27
+
28
+
29
+ logger.info("Installing dependencies");
30
+ const yarn = Command.make(
31
+ "yarn",
32
+ "add",
33
+ ...pkgs,
34
+ ).pipe(
35
+ Command.stdout("inherit"), // Stream stdout to process.stdout
36
+ Command.exitCode // Get the exit code
37
+ )
38
+ logger.info("Installing dev dependencies");
39
+ const yarnDev = Command.make(
40
+ "yarn",
41
+ "add",
42
+ "-D",
43
+ ...devPkgs,
44
+ ).pipe(
45
+ Command.stdout("inherit"), // Stream stdout to process.stdout
46
+ Command.exitCode // Get the exit code
47
+ )
48
+
49
+ if ((yield* yarn) !== 0) {
50
+ return logger.error("Failed to install dependencies. Please check the error message above.");
51
+ }
52
+ if ((yield* yarnDev) !== 0) {
53
+ return logger.error("Failed to install dev dependencies. Please check the error message above.");
54
+ }
55
+ })
56
+
57
+ export const runYarn = Effect.gen(function*() {
58
+ const yarnDev = Command.make(
59
+ "yarn",
60
+ ).pipe(
61
+ Command.stdout("inherit"), // Stream stdout to process.stdout
62
+ Command.exitCode // Get the exit code
63
+ )
64
+ yield* yarnDev;
65
+ })
66
+
67
+ export const yarnSetVersion = Effect.gen(function*() {
68
+ const yarnDev = Command.make(
69
+ "yarn",
70
+ "set",
71
+ "version",
72
+ "berry",
73
+ ).pipe(
74
+ Command.stdout("inherit"), // Stream stdout to process.stdout
75
+ Command.exitCode // Get the exit code
76
+ )
77
+ yield* yarnDev;
78
+ })
79
+ export const installVeloPackages = Effect.gen(function*() {
80
+ const config = yield* Config;
81
+ const simpleSchedule = Schedule.tapOutput(
82
+ Schedule.fromDelays(50, 100, 200, 400, 800, 1600, 3200),
83
+ (n, ) => Effect.succeed(logger.warning(`Failed to install WIX package. Retrying...`))
84
+ );
85
+
86
+ const pkgs: string[] = []
87
+ for (const [key, value] of Object.entries(config.config.lucySettings.dependencies)) {
88
+ if (value.length > 0) {
89
+ pkgs.push(`${key}@${value}`);
90
+ continue
91
+ }
92
+ pkgs.push(key);
93
+ }
94
+
95
+ const wixPkgs: Effect.Effect<ExitCode, PlatformError, CommandExecutor>[] = []
96
+ const wixInstall = (cmd: Effect.Effect<ExitCode, PlatformError, CommandExecutor>) => Effect.gen(function*() {
97
+ const code = yield* Effect.retryOrElse(
98
+ Effect.gen(function*() {
99
+ const code = yield* cmd;
100
+ if (code !== 0) {
101
+ return yield* Effect.fail(code);
102
+ }
103
+ return yield* Effect.succeed(code);
104
+ }),
105
+ simpleSchedule,
106
+ () => Effect.succeed(0 as ExitCode)
107
+ )
108
+ if (code !== 0) {
109
+ logger.error("Failed to install WIX package.");
110
+ }
111
+ return code;
112
+ })
113
+
114
+ for (const [key, value] of Object.entries(config.config.lucySettings.dependencies)) {
115
+ if (value.length > 0) {
116
+ wixPkgs.push(
117
+ wixInstall(
118
+ Command.make(
119
+ "wix",
120
+ "install",
121
+ `${key}@${value}`
122
+ ).pipe(
123
+ Command.stdout("inherit"),
124
+ Command.exitCode
125
+ )
126
+ )
127
+ )
128
+ continue
129
+ }
130
+ wixPkgs.push(
131
+ wixInstall(
132
+ Command.make(
133
+ "wix",
134
+ "install",
135
+ `${key}`
136
+ ).pipe(
137
+ Command.stdout("inherit"),
138
+ Command.exitCode
139
+ ),
140
+ ))
141
+ }
142
+
143
+ const devPkgs: string[] = []
144
+ for (const [key, value] of Object.entries(config.config.lucySettings.devDependencies)) {
145
+ if (value.length > 0) {
146
+ devPkgs.push(`${key}@${value}`);
147
+ continue
148
+ }
149
+ devPkgs.push(key);
150
+ }
151
+
152
+ const yarn = Command.make(
153
+ "yarn",
154
+ "add",
155
+ ...pkgs,
156
+ ).pipe(
157
+ Command.stdout("inherit"), // Stream stdout to process.stdout
158
+ Command.exitCode // Get the exit code
159
+ )
160
+ const yarnDev = Command.make(
161
+ "yarn",
162
+ "add",
163
+ "-D",
164
+ ...devPkgs,
165
+ ).pipe(
166
+ Command.stdout("inherit"), // Stream stdout to process.stdout
167
+ Command.exitCode // Get the exit code
168
+ )
169
+
170
+ logger.info("Installing dependencies with wix...");
171
+ const status = yield* Effect.all([...wixPkgs], { concurrency: 15});
172
+ if(status.every((s) => s !== 0)) {
173
+ return logger.error("Failed to install WIX dependencies. Please check the error message above.");
174
+ }
175
+
176
+ logger.info("Installing dependencies");
177
+ if ((yield* yarn) !== 0) {
178
+ return logger.error("Failed to install dependencies. Please check the error message above.");
179
+ }
180
+
181
+ logger.info("Installing dev dependencies");
182
+ if ((yield* yarnDev) !== 0) {
183
+ return logger.error("Failed to install dev dependencies. Please check the error message above.");
184
+ }
185
+
186
+ })
@@ -0,0 +1,37 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { FileSystem, Path } from "@effect/platform"
3
+ import { Config } from "../config.js";
4
+ import { JsonSchema } from "../schemas/index.js";
5
+ import { lucySettings } from "../schemas/lucy.js";
6
+ import { logger } from "../utils/logger.js";
7
+
8
+ export const readPackageJson = Effect.gen(function* () {
9
+ const config = yield* Config;
10
+ const fs = yield* FileSystem.FileSystem;
11
+ const path = yield* Path.Path;
12
+
13
+ const packageJsonPath = path.join(config.config.cwd, "package.json")
14
+ const packageJsonRaw = yield* fs.readFile(packageJsonPath)
15
+ config.config.packageJson = yield* Schema.decodeUnknown(JsonSchema)(packageJsonRaw.toString());
16
+ })
17
+
18
+ export const readLucyJsonFromTemplate = Effect.gen(function* () {
19
+ const config = yield* Config;
20
+ const fs = yield* FileSystem.FileSystem;
21
+ const path = yield* Path.Path;
22
+
23
+ const lucyJsonPath = path.join(config.config.templateDir, "lucy.json")
24
+ const lucyRaw = yield* fs.readFileString(lucyJsonPath, 'utf-8');
25
+ const lucySettingsJSON = yield* Schema.decodeUnknown(JsonSchema)(lucyRaw);
26
+ const lucySetting = yield* Schema.decodeUnknown(lucySettings)(lucySettingsJSON)
27
+ if(config.config.lucySettings.initialized) {
28
+ if(config.config.force) {
29
+ logger.warning(`lucy.json already exists in the template directory, but 'force' is set. Overwriting...`);
30
+ config.config.lucySettings = lucySetting;
31
+ return;
32
+ }
33
+ logger.warning(`lucy.json already exists in the template directory. Skipping reading lucy.json from template.`);
34
+ return;
35
+ }
36
+ config.config.lucySettings = lucySetting;
37
+ })
@@ -0,0 +1,24 @@
1
+ import { Effect } from "effect/index";
2
+ import { Command, FileSystem, Path } from "@effect/platform"
3
+ import { Config } from "../config.js";
4
+
5
+ export const writeLucySettings = Effect.gen(function* (_) {
6
+ const fs = yield* FileSystem.FileSystem;
7
+ const path = yield* Path.Path;
8
+ const config = yield* Config;
9
+
10
+ yield* fs.writeFileString(
11
+ path.join(config.config.cwd, "lucy.json"),
12
+ JSON.stringify(config.config.lucySettings, null, 2)
13
+ );
14
+ })
15
+
16
+ export const writePackageJson = Effect.gen(function* (_) {
17
+ const fs = yield* FileSystem.FileSystem;
18
+ const path = yield* Path.Path;
19
+ const config = yield* Config;
20
+ yield* fs.writeFileString(
21
+ path.join(config.config.cwd, "package.json"),
22
+ JSON.stringify(config.config.packageJson, null, 2)
23
+ );
24
+ })
package/src/config.ts CHANGED
@@ -1,27 +1,36 @@
1
- import { Context, Layer } from "effect"
1
+ import { Context, Layer, Schema } from "effect"
2
2
  import { get_args } from "./args.js";
3
3
  import { dirname, join } from "path";
4
4
  import { fileURLToPath } from "url";
5
5
  import { readFileSync, existsSync } from "fs";
6
- type Action = 'init';
6
+ import { lucySettings, LucySettings } from "./schemas/lucy.js";
7
+ import { logger } from "./utils/logger.js";
8
+ import os from 'os';
9
+ import { Action, Actions } from "./schemas/types.js";
7
10
 
8
- type Actions = {
9
- action: Action;
10
- type: 'velo' | 'expo' | 'blocks' | undefined;
11
- }
12
11
  export class Config extends Context.Tag("Config")<
13
12
  Config,
14
13
  {
15
14
  readonly config: {
16
15
  readonly action: Actions;
16
+ readonly force: boolean;
17
17
  readonly cwd: string;
18
18
  readonly packageRoot: string;
19
19
  readonly filesFolder: string;
20
- readonly packageJson: any;
20
+ packageJson: any;
21
+ lucySettings: LucySettings;
22
+ readonly lucyHome: string;
23
+ templateDir: string;
24
+ templateFiles: string;
25
+ projectName: string;
26
+ defaultModuleBasePath: string;
21
27
  }
22
28
  }
23
29
  >() {}
24
30
 
31
+ // or, if you want just the inner config object:
32
+ export type LucyConfig = typeof Config.Service["config"];
33
+
25
34
  // In an ES module, `__dirname` is not available by default.
26
35
  // We can replicate it using `import.meta.url`.
27
36
  const __filename = fileURLToPath(import.meta.url);
@@ -34,14 +43,30 @@ const packageRoot = join(__dirname, "..");
34
43
 
35
44
  export const ConfigLayer = (args: Awaited<ReturnType<typeof get_args>>) => {
36
45
  let packageJson = '{}';
46
+ let lucyJson: LucySettings | undefined = undefined;
37
47
  const packageJsonPath = join(process.cwd(), 'package.json');
48
+ const lucyJsonPath = join(process.cwd(), 'lucy.json');
38
49
  try {
39
50
  if (existsSync(packageJsonPath)) {
40
51
  const raw = readFileSync(packageJsonPath, 'utf-8');
41
52
  packageJson = JSON.parse(raw);
42
53
  }
43
54
  } catch (error) {
44
- console.error("Error reading package.json:", error);
55
+ logger.error("Error reading package.json:", error);
56
+ }
57
+ try {
58
+ if (existsSync(lucyJsonPath)) {
59
+ const raw = readFileSync(lucyJsonPath, 'utf-8');
60
+ lucyJson = Schema.decodeUnknownSync(lucySettings)(JSON.parse(raw));
61
+ }
62
+ } catch (error) {
63
+ logger.error("Error reading lucy.json:", error);
64
+ }
65
+ const defaultModulePath = () => {
66
+ if (args.type === 'monorepo') {
67
+ return join('packages');
68
+ }
69
+ return '';
45
70
  }
46
71
  return Layer.succeed(
47
72
  Config,
@@ -49,12 +74,27 @@ export const ConfigLayer = (args: Awaited<ReturnType<typeof get_args>>) => {
49
74
  config: {
50
75
  action: {
51
76
  type: args.type,
52
- action: args._[0] as Action
77
+ action: args._[0],
78
+ task: args.task,
53
79
  },
80
+ force: args.force === true ? true : false,
54
81
  cwd: process.cwd(),
82
+ projectName: process.cwd().split('/').pop() || 'lucy-project',
55
83
  packageRoot: packageRoot,
56
84
  filesFolder: join(packageRoot, 'files'),
57
- packageJson
85
+ packageJson,
86
+ lucyHome: join(os.homedir(), '.lucy-cli'),
87
+ lucySettings: lucyJson || {
88
+ modules: {},
89
+ devDependencies: {},
90
+ dependencies: {},
91
+ scripts: {},
92
+ initialized: false,
93
+ type: args.type || 'velo',
94
+ },
95
+ templateFiles: '',
96
+ templateDir: '',
97
+ defaultModuleBasePath: defaultModulePath(),
58
98
  }
59
99
  })
60
100
  );
package/src/error.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import { Data } from "effect";
2
2
 
3
- export class AppError extends Data.TaggedError('AppError')<{cause: Error, message: string}> {}
4
- export class ScaleError extends Data.TaggedError('ScaleError')<{cause: Error, message: string}> {}
3
+ export class AppError extends Data.TaggedError('AppError')<{cause: unknown, message: string}> {}