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,38 @@
1
+ import gulp from 'gulp';
2
+ import { TaskOptions } from '../Gulpfile.js';
3
+ import clean from 'gulp-clean';
4
+ import { logger } from '../../utils/logger.js';
5
+
6
+ export function cleanWix() {
7
+ return () => {
8
+ return gulp.src('./.wix', { read: false, allowEmpty: true })
9
+ .pipe(clean({ force: true }))
10
+ .on('error', function (e: Error) {
11
+ logger.error('Cleaning of .wix failed!');
12
+ logger.error(`Error: ${e.message}`);
13
+
14
+
15
+ this.emit('end');
16
+ })
17
+ .on('end', function() {
18
+ logger.success("Cleaning of .wix succeeded!");
19
+ });
20
+ }
21
+ }
22
+
23
+ export function cleanSrc(options: TaskOptions) {
24
+ const { outputDir } = options;
25
+
26
+ return () => {
27
+ return gulp.src([`${outputDir}/pages`, `${outputDir}/public`, `${outputDir}/backend`], { read: false, allowEmpty: true })
28
+ .pipe(clean({ force: true }))
29
+ .on('error', function (e: Error) {
30
+ logger.error('Cleaning of output files failed!');
31
+ logger.error(` => Error: ${e.message}`);
32
+ this.emit('end');
33
+ })
34
+ .on('end', function() {
35
+ logger.success('Cleaning of .src succeeded!');
36
+ });
37
+ }
38
+ }
@@ -0,0 +1,43 @@
1
+ import gulp from 'gulp';
2
+ import { TaskOptions } from '../Gulpfile.js';
3
+ import { logger } from '../../utils/logger.js';
4
+
5
+ export function copyFiles(options: TaskOptions) {
6
+ const folders = ['typescript', ...options.modulesSourcePaths];
7
+
8
+ // Create tasks for each folder
9
+ const tasks = folders.map((folder) => {
10
+ const { outputDir} = options;
11
+
12
+ const taskName = `copy-${folder}`; // Create a unique name for each task
13
+
14
+ const task = () =>
15
+ gulp.src([
16
+ `${folder}/**/*`,
17
+ `!${folder}/*tsconfig.json`,
18
+ `!${folder}/**/*.ts`,
19
+ `!${folder}/**/*.tsx`,
20
+ `!${folder}/types/**/**`,
21
+ `!${folder}/__mocks__/**/**`,
22
+ `!${folder}/styles/**`,
23
+ ])
24
+ .pipe(gulp.dest(outputDir))
25
+ .on('error', function (e: Error) {
26
+ logger.error(` => Copy of files for ${folder} failed!`);
27
+ logger.error(` => Error: ${e.message}`);
28
+
29
+
30
+ this.emit('end');
31
+ })
32
+ .on('end', function () {
33
+ logger.success(` => Copy of files for ${folder} succeeded!`);
34
+ });
35
+
36
+ // Register the task with Gulp
37
+ Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
38
+ return task;
39
+ });
40
+
41
+ // Run all tasks in parallel
42
+ return gulp.parallel(...tasks);
43
+ }
@@ -0,0 +1,25 @@
1
+
2
+ // import * as path from 'path';
3
+ // import * as fs from 'fs';
4
+ import { LucyConfig } from '../../config.js';
5
+
6
+ // export function getModulesSync(): Record<string, string> | undefined {
7
+ // const absolutePath = path.resolve('./lucy.json');
8
+ // const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
9
+ // return JSON.parse(fileContent).modules;
10
+ // }
11
+
12
+ export function getModulesSourcePaths(config: LucyConfig): string[] {
13
+ const data = config.lucySettings.modules;
14
+ const paths: string[] = [];
15
+ for (const module of Object.keys(data)) {
16
+ if (!data[module].noCompile) {
17
+ if (data[module].path) {
18
+ paths.push(data[module].path);
19
+ } else {
20
+ paths.push(module);
21
+ }
22
+ }
23
+ }
24
+ return paths;
25
+ }
@@ -0,0 +1,43 @@
1
+ import gulp from 'gulp';
2
+ import { TaskOptions } from '../Gulpfile.js';
3
+ import * as path from 'path';
4
+ import swc from 'gulp-swc';
5
+ import { logger } from '../../utils/logger.js';
6
+
7
+ const swcOptions = {
8
+ jsc: {
9
+ target: 'es2020',
10
+ parser: {
11
+ syntax: "typescript",
12
+ tsx: true,
13
+ },
14
+ preserveAllComments: false,
15
+ minify: {
16
+ compress: true // equivalent to {}
17
+ }
18
+ },
19
+ };
20
+
21
+ export function buildPages(options: TaskOptions) {
22
+ const { outputDir} = options;
23
+
24
+ return () => {
25
+ return gulp.src('typescript/pages/*.ts')
26
+ .pipe(swc(swcOptions))
27
+ .on('error', function (e: Error) {
28
+ logger.error('Build of Pages files failed!');
29
+ logger.error(`Error: ${e.message}`);
30
+
31
+ this.emit('end');
32
+ })
33
+ .pipe(gulp.dest(path.join(outputDir, 'pages')))
34
+ .on('error', function (e: Error) {
35
+ logger.error('Build of Pages TS files failed!');
36
+ logger.error(`Error: ${e.message}`);
37
+ this.emit('end');
38
+ })
39
+ .on('end', function() {
40
+ logger.success('Build of Pages TS files succeeded!');
41
+ });
42
+ };
43
+ }
@@ -0,0 +1,32 @@
1
+ import gulp from 'gulp';
2
+ import * as path from 'path';
3
+ import { File } from '../Gulpfile.js';
4
+ import replace from 'gulp-string-replace';
5
+ import { logger } from '../../utils/logger.js';
6
+
7
+ export function setProdConfig() {
8
+ const tag = process.env.GIT_TAG || 'development';
9
+ const regexGit = /gitTag:\s*(.*),/g;
10
+ const regexDev = /devMode:\s*(.*),/g;
11
+
12
+ return () => {
13
+ return gulp
14
+ .src(['./typescript/public/constants/env.ts'])
15
+ .pipe(replace(regexGit, `gitTag: '${tag}',`))
16
+ .pipe(replace(regexDev, `devMode: false,`))
17
+ .pipe(gulp.dest((file: File) => {
18
+ const filePath = file.dirname;
19
+ const outputDir = path.dirname(filePath);
20
+
21
+ return path.join(`${outputDir}/constants`);
22
+ }))
23
+ .on('error', function (e: Error) {
24
+ logger.error(' => Setting the git tag failed!');
25
+ logger.error(` => Error: ${e.message}`);
26
+ this.emit('end');
27
+ })
28
+ .on('end', function() {
29
+ logger.success(' => Setting the git tag succeeded!');
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,60 @@
1
+ import gulp from 'gulp';
2
+ import * as path from 'path';
3
+ import { TaskOptions } from '../Gulpfile.js';
4
+ import swc from 'gulp-swc';
5
+ import { logger } from '../../utils/logger.js';
6
+
7
+ const swcOptions = {
8
+ jsc: {
9
+ target: 'es2020',
10
+ parser: {
11
+ syntax: "typescript",
12
+ tsx: true,
13
+ },
14
+ preserveAllComments: false,
15
+ minify: {
16
+ compress: true // equivalent to {}
17
+ }
18
+ },
19
+ };
20
+
21
+ export function buildPublic(options: TaskOptions) {
22
+ const folders = ['typescript', ...options.modulesSourcePaths];
23
+
24
+ const { outputDir } = options;
25
+
26
+ // Create tasks for each folder
27
+ const tasks = folders.map((folder) => {
28
+ const taskName = `build_Public-${folder}`; // Create a unique name for each task
29
+
30
+ const task = () =>
31
+ gulp.src([
32
+ `${folder}/public/**/*.ts`,
33
+ `${folder}/public/**/*.tsx`,
34
+ ])
35
+ .pipe(swc(swcOptions))
36
+ .on('error', function (e: Error) {
37
+ logger.error(` => Build of Public files for ${folder} failed!`);
38
+ logger.error(` => Error: ${e.message}`);
39
+
40
+ this.emit('end');
41
+ })
42
+ .pipe(gulp.dest(path.join(outputDir, 'public')))
43
+ .on('error', function (e: Error) {
44
+ logger.error(` => Build of Public files for ${folder} failed!`);
45
+ logger.error(` => Error: ${e.message}`);
46
+ this.emit('end');
47
+ })
48
+ .on('end', function () {
49
+ logger.success(` => Build of Public files for ${folder} succeeded!`);
50
+ });
51
+
52
+ // Register the task with Gulp
53
+ Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
54
+ return task;
55
+ });
56
+
57
+ // Run all tasks in parallel
58
+ return gulp.parallel(...tasks);
59
+ }
60
+
@@ -0,0 +1,46 @@
1
+ import gulp from 'gulp';
2
+ import chalk from 'chalk';
3
+ import { TaskOptions } from '../Gulpfile.js';
4
+ import { logger, orange } from '../../utils/logger.js';
5
+
6
+ export function compileScss(options: TaskOptions) {
7
+ const folders = ['typescript'];
8
+
9
+ const { sass, outputDir} = options;
10
+
11
+ const buildWixScss = () => gulp.src(['typescript/styles/global.scss'], { allowEmpty: true })
12
+ .pipe(sass().on('error', sass.logError))
13
+ .on('error', function (e: Error) {
14
+ logger.error(` => Build of SCSS files for ${orange('global.scs')} failed!`);
15
+ logger.error(` => Error: ${orange(e.message)}`);
16
+ this.emit('end');
17
+ })
18
+ .pipe(gulp.dest(`${outputDir}/styles`))
19
+ .on('error', function (e: Error) {
20
+ logger.error(` => Compiling of scss files for ${orange('global.scs')} failed!`);
21
+ logger.error(` => Error: ${orange(e.message)}`);
22
+ this.emit('end');
23
+ })
24
+ .on('end', function () {
25
+ logger.success(` => Compiling of scss files for ${orange('global.scs')} succeeded!`);
26
+ });
27
+
28
+ const buildScss = () => gulp.src(['typescript/public/scss/app.scss'], { allowEmpty: true })
29
+ .pipe(sass().on('error', sass.logError))
30
+ .on('error', function (e: Error) {
31
+ logger.error(` => Build of SCSS files for ${orange('app.scss')} failed!`);
32
+ logger.error(` => Error: ${orange(e.message)}`);
33
+ this.emit('end');
34
+ })
35
+ .pipe(gulp.dest(`${outputDir}/public/css`))
36
+ .on('error', function (e: Error) {
37
+ logger.error(` => Compiling of scss files for ${orange('app.scss')} failed!`);
38
+ logger.error(` => Error: ${orange(e.message)}`);
39
+ this.emit('end');
40
+ })
41
+ .on('end', function () {
42
+ logger.success(` => Compiling of scss files for ${orange('app.scss')} succeeded!`);
43
+ });
44
+
45
+ return gulp.parallel(buildWixScss, buildScss);
46
+ }
@@ -0,0 +1,53 @@
1
+ import gulp from 'gulp';
2
+ import { File, TaskOptions } from '../Gulpfile.js';
3
+ import exec from 'gulp-exec';
4
+ import { logger, orange } from '../../utils/logger.js';
5
+ import path from 'path';
6
+ import fs from 'fs';
7
+
8
+ export function previewTemplates(options: TaskOptions) {
9
+ const allFolders = ['typescript', ...options.modulesSourcePaths];
10
+
11
+ // Filter folders to only include those that have a 'backend/templates' directory
12
+ const foldersWithTemplates = allFolders.filter(folder => {
13
+ const templateDir = path.join(folder, 'backend', 'templates');
14
+ return fs.existsSync(templateDir);
15
+ });
16
+
17
+ if (foldersWithTemplates.length === 0) {
18
+ logger.info("No template folders found to preview.");
19
+ // Return a Gulp task that does nothing.
20
+ return (done: () => void) => done();
21
+ }
22
+
23
+ const taskOpt = {
24
+ continueOnError: true,
25
+ };
26
+
27
+ // Create tasks for each folder that has a template directory
28
+ const tasks = foldersWithTemplates.map((folder) => {
29
+ const taskName = `render_templates-${folder}`;
30
+ const task = () =>
31
+ gulp.src([
32
+ `${folder}/backend/templates/**/*.tsx`,
33
+ `${folder}/backend/templates/data/*.json`,
34
+ `!${folder}/backend/templates/render.ts`,
35
+ ])
36
+ .pipe(exec((file: File) => `npx tsx --tsconfig ./local.tsconfig.json ${file.path}`, taskOpt))
37
+ .on('error', function (e: Error) {
38
+ logger.error(` => Render of Template for ${orange(folder)} failed!`);
39
+ logger.error(` => Error: ${orange(e.message)}`);
40
+ this.emit('end');
41
+ })
42
+ .on('end', function () {
43
+ logger.success(` => Render of Template for ${orange(folder)} succeeded!`);
44
+ });
45
+
46
+ // Register the task with Gulp
47
+ Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
48
+ return task;
49
+ });
50
+
51
+ // Run all tasks in parallel
52
+ return gulp.parallel(...tasks);
53
+ }
@@ -0,0 +1,317 @@
1
+ import gulp from 'gulp';
2
+ import * as path from 'path';
3
+ import { File, TaskOptions } from '../Gulpfile.js';
4
+ import replace from 'gulp-string-replace';
5
+ import flatmap from 'gulp-flatmap';
6
+ import jeditor from 'gulp-json-editor';
7
+ import * as insert from 'gulp-insert';
8
+ import tap from 'gulp-tap';
9
+ import { TSConfig } from '../../schemas/tsconfig.js';
10
+ import { logger, orange, yellow } from '../../utils/logger.js';
11
+
12
+ export function updateWixTypes(options: TaskOptions) {
13
+ return () => {
14
+ const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
15
+ let count = 0;
16
+
17
+ const modules: Record<string, string> = Object.assign({}, options.projectSettings?.modules, options.projectSettings?.lucySettings?.modules);
18
+
19
+ let localModules: Record<string, string> | undefined = undefined;
20
+ if(options.projectSettings?.lucySettings) {
21
+ localModules = options.projectSettings.lucySettings.modules as unknown as Record<string, string>;
22
+ }
23
+ // Add module to publicSettings
24
+ publicSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
25
+ publicSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
26
+ publicSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
27
+ publicSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
28
+ publicSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
29
+ publicSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
30
+ publicSettings.compilerOptions.paths['public/*'] = [ "../../../typescript/public/*.ts" ] as never;
31
+ publicSettings.include = [
32
+ "../../../typescript/public/**/*",
33
+ "../../../typescript/__mocks__/**/*",
34
+ // "../../../typescript/backend/**/*.jsw.ts",
35
+ // "../../../typescript/backend/**/*.web.ts",
36
+ // "../../../typescript/backend/**/*.web"
37
+ ] as never;
38
+
39
+ // Add module to backendSettings
40
+ backendSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
41
+ backendSettings.compilerOptions.paths['types/*'] = [ `../../../typescript/types/*` ] as never;
42
+ backendSettings.include = [
43
+ "../../../typescript/backend/**/*",
44
+ "../../../typescript/__mocks__/**/*",
45
+ // "../../../typescript/backend/**/*.jsw.ts",
46
+ // "../../../typescript/backend/**/*.web.ts",
47
+ // "../../../typescript/backend/**/*.web"
48
+ ] as never;
49
+ // Add module to masterSettings
50
+ masterSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
51
+ masterSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
52
+ masterSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
53
+ masterSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
54
+ masterSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
55
+ masterSettings.include = [
56
+ "../../../typescript/public/**/*",
57
+ "../../../typescript/__mocks__/**/*",
58
+ // "../../../typescript/backend/**/*.jsw.ts",
59
+ // "../../../typescript/backend/**/*.web.ts",
60
+ // "../../../typescript/backend/**/*.web"
61
+ ] as never;
62
+ // Add module to pageSettings
63
+ pageSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
64
+ pageSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
65
+ pageSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
66
+ pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
67
+ pageSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
68
+ pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
69
+ pageSettings.include = [
70
+ "../../../typescript/public/**/*",
71
+ "../../../typescript/__mocks__/**/*",
72
+ // "../../../typescript/backend/**/*.jsw.ts",
73
+ // "../../../typescript/backend/**/*.web.ts",
74
+ // "../../../typescript/backend/**/*.web"
75
+ ] as never;
76
+
77
+ if (modules) {
78
+ for (const [name] of Object.entries(modules)) {
79
+ // Add module to publicSettings
80
+ publicSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
81
+ publicSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
82
+ publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
83
+ publicSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
84
+ publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
85
+ publicSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` as never ]);
86
+ publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
87
+ publicSettings.include.push(...[
88
+ `../../../${name}/public/**/*`,
89
+ `../../../${name}__mocks__/**/*`,
90
+ // `../../../${name}/backend/**/*.jsw.ts`,
91
+ // `../../../${name}/backend/**/*.web.ts`,
92
+ // `../../../${name}/backend/**/*.web`
93
+ ] as never[]);
94
+ // Add module to backendSettings
95
+ backendSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
96
+ backendSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
97
+ backendSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` ] as never[]);
98
+ backendSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
99
+ backendSettings.include.push(...[
100
+ `../../../${name}/public/**/*`,
101
+ `../../../${name}__mocks__/**/*`,
102
+ `../../../${name}/backend/**/*`,
103
+ // `../../../${name}/backend/**/*.jsw.ts`,
104
+ // `../../../${name}/backend/**/*.web.ts`,
105
+ // `../../../${name}/backend/**/*.web`
106
+ ] as never[]);
107
+ // Add module to masterSettings
108
+ masterSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
109
+ masterSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
110
+ masterSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
111
+ masterSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
112
+ masterSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
113
+ masterSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
114
+ masterSettings.include.push(...[
115
+ `../../../${name}/public/**/*`,
116
+ `../../../${name}__mocks__/**/*`,
117
+ // `../../../${name}/backend/**/*.jsw.ts`,
118
+ // `../../../${name}/backend/**/*.web.ts`,
119
+ // `../../../${name}/backend/**/*.web`
120
+ ] as never[]);
121
+ // Add module to pageSettings
122
+ pageSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
123
+ pageSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
124
+ pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
125
+ pageSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
126
+ pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
127
+ pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
128
+ pageSettings.include.push(...[
129
+ `../../../${name}/public/**/*`,
130
+ `../../../${name}__mocks__/**/*`,
131
+ // `../../../${name}/backend/**/*.jsw.ts`,
132
+ // `../../../${name}/backend/**/*.web.ts`,
133
+ // `../../../${name}/backend/**/*.web`
134
+ ] as never[]);
135
+ }
136
+ }
137
+
138
+ return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/**/*'])
139
+ .pipe(flatmap(function(stream: NodeJS.ReadableStream, file: File) {
140
+ count ++;
141
+ if (file.dirname.endsWith('public')) {
142
+ return stream.pipe(jeditor(publicSettings))
143
+ .pipe(jeditor((json: any) => cleanTsConfig(json)))
144
+ .pipe(jeditor((json: any) => processJson(json)))
145
+ .pipe(replace('"../backend.d.ts",', '', replaceOptions))
146
+ .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
147
+ }
148
+ if (file.dirname.endsWith('backend')) {
149
+ return stream.pipe(jeditor(backendSettings))
150
+ .pipe(jeditor((json: any) => cleanTsConfig(json)))
151
+ .pipe(jeditor((json: any) => processJson(json)))
152
+ };
153
+ if (file.dirname.endsWith('masterPage')) {
154
+ return stream.pipe(jeditor(masterSettings))
155
+ .pipe(jeditor((json: any) => cleanTsConfig(json)))
156
+ .pipe(jeditor((json: any) => processJson(json)))
157
+ .pipe(replace('"../backend.d.ts",', '', replaceOptions))
158
+ .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
159
+ };
160
+
161
+ return stream.pipe(jeditor(pageSettings))
162
+ .pipe(jeditor((json: any) => cleanTsConfig(json)))
163
+ .pipe(jeditor((json: any) => processJson(json)))
164
+ .pipe(replace('"../backend.d.ts",', '', replaceOptions))
165
+ .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
166
+ }))
167
+ .pipe(replace('masterPage.masterPage.js', 'masterPage.ts', replaceOptions))
168
+ .pipe(replace('/src/', '/typescript/', replaceOptions))
169
+ .pipe(replace('.js"', '.ts"', replaceOptions))
170
+ .pipe(tap(function(file) { // tap into the stream to log the output
171
+ // console.debug(file.contents?.toString() ?? 'no content'); TODO: Uncomment when needed
172
+ }))
173
+ .pipe(gulp.dest((file: File) => {
174
+ const filePath = file.dirname;
175
+ const outputDir = path.dirname(filePath);
176
+
177
+ return path.join(outputDir);
178
+ }))
179
+ .on('error', function (e: Error) {
180
+ logger.error('Modification of WIX configs failed!');
181
+ logger.error(` => Error: ${orange(e.message)}`);
182
+ this.emit('end');
183
+ })
184
+ .on('end', function() { logger.success(`Modification of ${yellow(count)} WIX configs succeeded!`); });
185
+ }
186
+ }
187
+
188
+ export function addTypes(options: TaskOptions, done: gulp.TaskFunctionCallback) {
189
+ const { replaceOptions } = options;
190
+
191
+ // Regex to match keywords at the beginning of a line, capturing any leading whitespace.
192
+ // The 'm' flag is for multiline matching (^ matches start of line).
193
+ // The 'g' flag is for global matching (replace all instances).
194
+ const interfaceRegex = /^(\s*)interface\s/gm;
195
+ const enumRegex = /^(\s*)enum\s/gm;
196
+ const typeRegex = /^(\s*)type\s/gm;
197
+
198
+ const streams = [
199
+ // Stream for common types
200
+ gulp.src(['./.wix/types/wix-code-types/dist/types/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
201
+ .pipe(replace(interfaceRegex, 'export interface ', replaceOptions))
202
+ .pipe(replace(enumRegex, 'export enum ', replaceOptions))
203
+ .pipe(replace(typeRegex, 'export type ', replaceOptions))
204
+ .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/')),
205
+
206
+ // Stream for beta types
207
+ gulp.src(['./.wix/types/wix-code-types/dist/types/beta/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/beta/common/$w.d.ts'])
208
+ .pipe(replace(interfaceRegex, 'export interface ', replaceOptions))
209
+ .pipe(replace(enumRegex, 'export enum ', replaceOptions))
210
+ .pipe(replace(typeRegex, 'export type ', replaceOptions))
211
+ .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/beta/common/')),
212
+
213
+ // Stream for processing $w.d.ts
214
+ gulp.src(['./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
215
+ .pipe(insert.prepend("import '@total-typescript/ts-reset';\n"))
216
+ .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'))
217
+ ];
218
+
219
+ let completedStreams = 0;
220
+ let hasErrored = false;
221
+
222
+ streams.forEach(stream => {
223
+ stream.on('end', () => {
224
+ completedStreams++;
225
+ if (completedStreams === streams.length && !hasErrored) {
226
+ logger.success(' => Updating WIX succeeded!');
227
+ done();
228
+ }
229
+ });
230
+ stream.on('error', (e: Error) => {
231
+ if (!hasErrored) {
232
+ hasErrored = true;
233
+ logger.error(' => Updating WIX failed!');
234
+ logger.error(` => Error: ${orange(e.message)}`);
235
+ done(e);
236
+ }
237
+ });
238
+ });
239
+ };
240
+ function makeHashable(obj: any): any {
241
+ if (Array.isArray(obj)) {
242
+ return obj.map(makeHashable);
243
+ } else if (obj && typeof obj === 'object') {
244
+ const sortedKeys = Object.keys(obj).sort();
245
+ const result: any = {};
246
+ for (const key of sortedKeys) {
247
+ result[key] = makeHashable(obj[key]);
248
+ }
249
+ return result;
250
+ } else {
251
+ return obj;
252
+ }
253
+ }
254
+
255
+ function removeDuplicatesFromArray(arr: any[]): any[] {
256
+ const seen = new Set<string>();
257
+ const newArr: any[] = [];
258
+
259
+ for (const item of arr) {
260
+ const processedItem = processJson(item); // Recursively process the item
261
+ const hashableItem = makeHashable(processedItem);
262
+ const serializedItem = JSON.stringify(hashableItem);
263
+
264
+ if (!seen.has(serializedItem)) {
265
+ seen.add(serializedItem);
266
+ newArr.push(processedItem);
267
+ }
268
+ }
269
+ return newArr;
270
+ }
271
+
272
+ function processJson(obj: any): any {
273
+ if (Array.isArray(obj)) {
274
+ // Process arrays and remove duplicate items
275
+ const uniqueArray = removeDuplicatesFromArray(obj);
276
+ return uniqueArray.length > 0 ? uniqueArray : undefined; // Remove empty arrays
277
+ } else if (obj && typeof obj === 'object') {
278
+ // Process objects, ensuring keys are unique
279
+ const result: any = {};
280
+ const seenKeys = new Set<string>();
281
+
282
+ for (const key in obj) {
283
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
284
+ if (!seenKeys.has(key)) {
285
+ const processedValue = processJson(obj[key]);
286
+ if (processedValue !== undefined) { // Remove keys with undefined values
287
+ seenKeys.add(key);
288
+ result[key] = processedValue;
289
+ }
290
+ }
291
+ }
292
+ }
293
+
294
+ // If all keys were empty or undefined, return undefined
295
+ return Object.keys(result).length > 0 ? result : undefined;
296
+ } else {
297
+ // Return primitive values as-is
298
+ return obj;
299
+ }
300
+ }
301
+
302
+ function cleanTsConfig(json: TSConfig): TSConfig {
303
+ // const paths: Record<string, string[]> = {};
304
+ if (json.compilerOptions?.paths) {
305
+ for (const [key, value] of Object.entries(json.compilerOptions.paths)) {
306
+ const uniquePaths = new Set(value);
307
+ json.compilerOptions.paths[key] = Array.from(uniquePaths);
308
+ // paths[key] = Array.from(uniquePaths);
309
+ }
310
+ // json.compilerOptions.paths = paths;
311
+ }
312
+ json.include = Array.from(new Set(json.include));
313
+ json.exclude = Array.from(new Set(json.exclude));
314
+ json.files = Array.from(new Set(json.files));
315
+
316
+ return json;
317
+ }