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

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 (253) hide show
  1. package/.turbo/cookies/7.cookie +0 -0
  2. package/.turbo/cookies/8.cookie +0 -0
  3. package/.turbo/daemon/ee24a4f4ab6aa3c0-turbo.log.2025-08-01 +0 -0
  4. package/.turbo/daemon/ee24a4f4ab6aa3c0-turbo.log.2025-08-02 +0 -0
  5. package/dist/args.js +47 -7
  6. package/dist/args.js.map +1 -1
  7. package/dist/commands/checks.d.ts +1 -1
  8. package/dist/commands/checks.js +2 -2
  9. package/dist/commands/checks.js.map +1 -1
  10. package/dist/commands/copy.d.ts +1 -0
  11. package/dist/commands/copy.js +9 -1
  12. package/dist/commands/copy.js.map +1 -1
  13. package/dist/commands/edit.d.ts +1 -1
  14. package/dist/commands/edit.js +3 -3
  15. package/dist/commands/edit.js.map +1 -1
  16. package/dist/commands/exec.d.ts +1 -1
  17. package/dist/commands/files.d.ts +7 -0
  18. package/dist/commands/files.js +28 -0
  19. package/dist/commands/files.js.map +1 -0
  20. package/dist/commands/read.d.ts +3 -2
  21. package/dist/commands/read.js +14 -7
  22. package/dist/commands/read.js.map +1 -1
  23. package/dist/commands/write.d.ts +2 -0
  24. package/dist/commands/write.js +15 -3
  25. package/dist/commands/write.js.map +1 -1
  26. package/dist/config.d.ts +20 -2
  27. package/dist/config.js +84 -57
  28. package/dist/config.js.map +1 -1
  29. package/dist/helpers.d.ts +9 -0
  30. package/dist/helpers.js +86 -0
  31. package/dist/helpers.js.map +1 -1
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +42 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/init/blocks.d.ts +1 -1
  36. package/dist/init/blocks.js +2 -2
  37. package/dist/init/blocks.js.map +1 -1
  38. package/dist/init/cargo.d.ts +1 -1
  39. package/dist/init/expo.d.ts +1 -1
  40. package/dist/init/gitModules.d.ts +1 -1
  41. package/dist/init/index.d.ts +1 -1
  42. package/dist/init/index.js +45 -47
  43. package/dist/init/index.js.map +1 -1
  44. package/dist/init/monorepo.d.ts +1 -1
  45. package/dist/init/prepareVelo.d.ts +1 -1
  46. package/dist/init/tauri.d.ts +1 -1
  47. package/dist/init/templates.d.ts +1 -1
  48. package/dist/init/templates.js +11 -12
  49. package/dist/init/templates.js.map +1 -1
  50. package/dist/init/velo.d.ts +1 -1
  51. package/dist/runtime.d.ts +1 -1
  52. package/dist/schemas/gulp.d.ts +25 -15
  53. package/dist/schemas/gulp.js +4 -0
  54. package/dist/schemas/gulp.js.map +1 -1
  55. package/dist/schemas/index.d.ts +10 -0
  56. package/dist/schemas/index.js +8 -0
  57. package/dist/schemas/index.js.map +1 -1
  58. package/dist/schemas/lucy.d.ts +5 -5
  59. package/dist/schemas/lucy.js +8 -8
  60. package/dist/schemas/lucy.js.map +1 -1
  61. package/dist/schemas/types.d.ts +23 -7
  62. package/dist/schemas/types.js +4 -2
  63. package/dist/schemas/types.js.map +1 -1
  64. package/dist/sync/sync.d.ts +3 -0
  65. package/dist/sync/sync.js +91 -87
  66. package/dist/sync/sync.js.map +1 -1
  67. package/dist/tasks/Gulpfile.d.ts +4 -35
  68. package/dist/tasks/Gulpfile.js +81 -104
  69. package/dist/tasks/Gulpfile.js.map +1 -1
  70. package/dist/tasks/gitModules.d.ts +2 -0
  71. package/dist/tasks/gitModules.js +13 -0
  72. package/dist/tasks/gitModules.js.map +1 -0
  73. package/dist/tasks/gulp/backend.d.ts +1 -1
  74. package/dist/tasks/gulp/backend.js +10 -10
  75. package/dist/tasks/gulp/backend.js.map +1 -1
  76. package/dist/tasks/gulp/checks.d.ts +1 -1
  77. package/dist/tasks/gulp/checks.js +3 -2
  78. package/dist/tasks/gulp/checks.js.map +1 -1
  79. package/dist/tasks/gulp/clean.d.ts +1 -1
  80. package/dist/tasks/gulp/clean.js +1 -1
  81. package/dist/tasks/gulp/clean.js.map +1 -1
  82. package/dist/tasks/gulp/copy.d.ts +1 -1
  83. package/dist/tasks/gulp/copy.js +3 -4
  84. package/dist/tasks/gulp/copy.js.map +1 -1
  85. package/dist/tasks/gulp/helpers.d.ts +3 -2
  86. package/dist/tasks/gulp/helpers.js +6 -8
  87. package/dist/tasks/gulp/helpers.js.map +1 -1
  88. package/dist/tasks/gulp/pages.d.ts +1 -1
  89. package/dist/tasks/gulp/pages.js.map +1 -1
  90. package/dist/tasks/gulp/pipeline.js +3 -3
  91. package/dist/tasks/gulp/pipeline.js.map +1 -1
  92. package/dist/tasks/gulp/public.d.ts +1 -1
  93. package/dist/tasks/gulp/public.js +5 -5
  94. package/dist/tasks/gulp/public.js.map +1 -1
  95. package/dist/tasks/gulp/styles.d.ts +1 -1
  96. package/dist/tasks/gulp/styles.js +10 -10
  97. package/dist/tasks/gulp/styles.js.map +1 -1
  98. package/dist/tasks/gulp/templates.d.ts +1 -1
  99. package/dist/tasks/gulp/templates.js +3 -3
  100. package/dist/tasks/gulp/templates.js.map +1 -1
  101. package/dist/tasks/gulp/types.d.ts +1 -1
  102. package/dist/tasks/gulp/types.js +61 -68
  103. package/dist/tasks/gulp/types.js.map +1 -1
  104. package/dist/tasks/gulp/watchers.d.ts +1 -8
  105. package/dist/tasks/gulp/watchers.js +48 -46
  106. package/dist/tasks/gulp/watchers.js.map +1 -1
  107. package/dist/tasks/index.d.ts +1 -1
  108. package/dist/tasks/index.js +19 -21
  109. package/dist/tasks/index.js.map +1 -1
  110. package/dist/tasks/syncPkg.d.ts +3 -0
  111. package/dist/tasks/syncPkg.js +13 -0
  112. package/dist/tasks/syncPkg.js.map +1 -0
  113. package/dist/tasks/syncSettings.d.ts +3 -0
  114. package/dist/tasks/syncSettings.js +18 -0
  115. package/dist/tasks/syncSettings.js.map +1 -0
  116. package/dist/wix-sdk/check.d.ts +4 -0
  117. package/dist/wix-sdk/check.js +23 -0
  118. package/dist/wix-sdk/check.js.map +1 -0
  119. package/dist/wix-sdk/client.d.ts +10 -0
  120. package/dist/wix-sdk/client.js +18 -0
  121. package/dist/wix-sdk/client.js.map +1 -0
  122. package/dist/wix-sdk/import.d.ts +1 -0
  123. package/{src/sync/sync.ts → dist/wix-sdk/import.js} +12 -20
  124. package/dist/wix-sdk/import.js.map +1 -0
  125. package/dist/wix-sdk/index.d.ts +4 -0
  126. package/dist/wix-sdk/index.js +15 -0
  127. package/dist/wix-sdk/index.js.map +1 -0
  128. package/dist/wix-sdk/init copy.d.ts +4 -0
  129. package/dist/wix-sdk/init copy.js +51 -0
  130. package/dist/wix-sdk/init copy.js.map +1 -0
  131. package/dist/wix-sdk/init.d.ts +4 -0
  132. package/dist/wix-sdk/init.js +51 -0
  133. package/dist/wix-sdk/init.js.map +1 -0
  134. package/dist/wix-sdk/is-allive.d.ts +4 -0
  135. package/dist/wix-sdk/is-allive.js +37 -0
  136. package/dist/wix-sdk/is-allive.js.map +1 -0
  137. package/dist/wix-sdk/run.d.ts +4 -0
  138. package/dist/wix-sdk/run.js +53 -0
  139. package/dist/wix-sdk/run.js.map +1 -0
  140. package/dist/wix-sdk/sync copy.d.ts +1 -0
  141. package/dist/wix-sdk/sync copy.js +88 -0
  142. package/dist/wix-sdk/sync copy.js.map +1 -0
  143. package/dist/wix-sdk/sync.d.ts +1 -0
  144. package/dist/wix-sdk/sync.js +88 -0
  145. package/dist/wix-sdk/sync.js.map +1 -0
  146. package/dist/wix-sdk/wix_sdk_check.d.ts +4 -0
  147. package/dist/wix-sdk/wix_sdk_check.js +37 -0
  148. package/dist/wix-sdk/wix_sdk_check.js.map +1 -0
  149. package/dist/wix-sync/client.d.ts +3 -0
  150. package/dist/wix-sync/client.js +5 -0
  151. package/dist/wix-sync/client.js.map +1 -0
  152. package/dist/wix-sync/export copy.d.ts +4 -0
  153. package/dist/wix-sync/export copy.js +21 -0
  154. package/dist/wix-sync/export copy.js.map +1 -0
  155. package/dist/wix-sync/export.d.ts +4 -0
  156. package/dist/wix-sync/export.js +15 -0
  157. package/dist/wix-sync/export.js.map +1 -0
  158. package/dist/wix-sync/import copy.d.ts +4 -0
  159. package/dist/wix-sync/import copy.js +21 -0
  160. package/dist/wix-sync/import copy.js.map +1 -0
  161. package/dist/wix-sync/import.d.ts +4 -0
  162. package/dist/wix-sync/import.js +26 -0
  163. package/dist/wix-sync/import.js.map +1 -0
  164. package/dist/wix-sync/index.d.ts +4 -0
  165. package/dist/wix-sync/index.js +35 -0
  166. package/dist/wix-sync/index.js.map +1 -0
  167. package/dist/wix-sync/init copy.d.ts +4 -0
  168. package/dist/wix-sync/init copy.js +54 -0
  169. package/dist/wix-sync/init copy.js.map +1 -0
  170. package/dist/wix-sync/init.d.ts +4 -0
  171. package/dist/wix-sync/init.js +74 -0
  172. package/dist/wix-sync/init.js.map +1 -0
  173. package/dist/wix-sync/is-alive.d.ts +4 -0
  174. package/dist/wix-sync/is-alive.js +23 -0
  175. package/dist/wix-sync/is-alive.js.map +1 -0
  176. package/dist/wix-sync/is-allive copy.d.ts +4 -0
  177. package/dist/wix-sync/is-allive copy.js +23 -0
  178. package/dist/wix-sync/is-allive copy.js.map +1 -0
  179. package/dist/wix-sync/is-allive.d.ts +4 -0
  180. package/dist/wix-sync/is-allive.js +23 -0
  181. package/dist/wix-sync/is-allive.js.map +1 -0
  182. package/dist/wix-sync/migrate.d.ts +4 -0
  183. package/dist/wix-sync/migrate.js +21 -0
  184. package/dist/wix-sync/migrate.js.map +1 -0
  185. package/dist/wix-sync/sync-od.d.ts +0 -0
  186. package/dist/wix-sync/sync-od.js +100 -0
  187. package/dist/wix-sync/sync-od.js.map +1 -0
  188. package/dist/wix-sync/sync.d.ts +4 -0
  189. package/dist/wix-sync/sync.js +26 -0
  190. package/dist/wix-sync/sync.js.map +1 -0
  191. package/dist/wix-sync/sync2.d.ts +4 -0
  192. package/dist/wix-sync/sync2.js +25 -0
  193. package/dist/wix-sync/sync2.js.map +1 -0
  194. package/dist/wix-sync copy/index.d.ts +4 -0
  195. package/dist/wix-sync copy/index.js +17 -0
  196. package/dist/wix-sync copy/index.js.map +1 -0
  197. package/dist/wix-sync copy/init.d.ts +4 -0
  198. package/dist/wix-sync copy/init.js +58 -0
  199. package/dist/wix-sync copy/init.js.map +1 -0
  200. package/dist/wix-sync copy/is-allive.d.ts +4 -0
  201. package/dist/wix-sync copy/is-allive.js +36 -0
  202. package/dist/wix-sync copy/is-allive.js.map +1 -0
  203. package/dist/wix-sync copy/sync.d.ts +1 -0
  204. package/dist/wix-sync copy/sync.js +88 -0
  205. package/dist/wix-sync copy/sync.js.map +1 -0
  206. package/files/sync-data/data/test.csv +17 -0
  207. package/files/sync-data/schema/test.json +11 -0
  208. package/package.json +5 -2
  209. package/src/args.ts +47 -7
  210. package/src/commands/checks.ts +2 -2
  211. package/src/commands/copy.ts +13 -1
  212. package/src/commands/edit.ts +3 -3
  213. package/src/commands/read.ts +17 -8
  214. package/src/commands/write.ts +25 -4
  215. package/src/config.ts +106 -65
  216. package/src/helpers.ts +90 -0
  217. package/src/index.ts +49 -9
  218. package/src/init/blocks.ts +2 -2
  219. package/src/init/index.ts +45 -51
  220. package/src/init/templates.ts +11 -12
  221. package/src/schemas/gulp.ts +24 -15
  222. package/src/schemas/index.ts +12 -1
  223. package/src/schemas/lucy.ts +9 -8
  224. package/src/schemas/types.ts +25 -7
  225. package/src/tasks/Gulpfile.ts +175 -219
  226. package/src/tasks/gulp/backend.ts +11 -11
  227. package/src/tasks/gulp/checks.ts +4 -3
  228. package/src/tasks/gulp/clean.ts +2 -2
  229. package/src/tasks/gulp/copy.ts +4 -10
  230. package/src/tasks/gulp/helpers.ts +6 -13
  231. package/src/tasks/gulp/pages.ts +1 -1
  232. package/src/tasks/gulp/pipeline.ts +4 -5
  233. package/src/tasks/gulp/public.ts +6 -6
  234. package/src/tasks/gulp/styles.ts +11 -11
  235. package/src/tasks/gulp/templates.ts +4 -4
  236. package/src/tasks/gulp/types.ts +62 -69
  237. package/src/tasks/gulp/watchers.ts +77 -81
  238. package/src/tasks/index.ts +21 -27
  239. package/src/tasks/syncSettings.ts +21 -0
  240. package/src/wix-sdk/check.ts +24 -0
  241. package/src/wix-sdk/client.ts +18 -0
  242. package/src/wix-sdk/index.ts +17 -0
  243. package/src/wix-sdk/init.ts +54 -0
  244. package/src/wix-sdk/run.ts +56 -0
  245. package/src/wix-sync/client.ts +6 -0
  246. package/src/wix-sync/export.ts +19 -0
  247. package/src/wix-sync/import.ts +27 -0
  248. package/src/wix-sync/index.ts +36 -0
  249. package/src/wix-sync/init.ts +77 -0
  250. package/src/wix-sync/is-alive.ts +25 -0
  251. package/src/wix-sync/migrate.ts +23 -0
  252. package/src/wix-sync/sync.ts +27 -0
  253. /package/{src/sync/index.ts → .turbo/cookies/6.cookie} +0 -0
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ export declare const sync: Effect.Effect<undefined, AppError, Config>;
@@ -0,0 +1,25 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ import { logger } from "../utils/logger.js";
5
+ export const sync = Effect.gen(function* (_) {
6
+ const config = yield* Config;
7
+ const veloSyncSettings = config.config.veloSyncSettings;
8
+ if (!veloSyncSettings)
9
+ return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
10
+ logger.action(`Checking if the API for site ${veloSyncSettings.siteUrl} is alive...`);
11
+ let filename = config.config.veloSyncArguments?.file || '';
12
+ let collection = config.config.veloSyncArguments?.collection || '';
13
+ let schema = config.config.veloSyncArguments?.schema || '';
14
+ let dryrun = config.config.veloSyncArguments?.dry || false;
15
+ let importOnly = true;
16
+ const res = yield* Effect.tryPromise({
17
+ try: () => runSyncTask(filename, collection, schema, importOnly, dryrun),
18
+ catch: (e) => {
19
+ return new AppError({ cause: e, message: 'Error checking if the API is alive' });
20
+ }
21
+ });
22
+ logger.success(`API for site ${veloSyncSettings.siteUrl} is alive and working!`);
23
+ return;
24
+ });
25
+ //# sourceMappingURL=sync2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync2.js","sourceRoot":"","sources":["../../src/wix-sync/sync2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;IAC7B,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACxD,IAAI,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9J,MAAM,CAAC,MAAM,CAAC,gCAAgC,gBAAgB,CAAC,OAAO,cAAc,CAAC,CAAC;IACtF,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,IAAI,EAAE,CAAC;IAC3D,IAAI,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;IACnE,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,IAAI,EAAE,CAAC;IAC3D,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,IAAI,KAAK,CAAC;IAC3D,IAAI,UAAU,GAAG,IAAI,CAAA;IACrB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;QACjC,GAAG,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC;QACxE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;YACT,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC,CAAC;QACrF,CAAC;KACJ,CAAC,CAAA;IAEF,MAAM,CAAC,OAAO,CAAC,gBAAgB,gBAAgB,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACjF,OAAM;AACV,CAAC,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ export declare const wix_sync: () => Effect.Effect<void, AppError | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, Config | import("@effect/platform/FileSystem").FileSystem | import("@effect/platform/Path").Path>;
@@ -0,0 +1,17 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ import { wix_sync_init } from "./init.js";
5
+ export const wix_sync = () => {
6
+ return Effect.gen(function* (_) {
7
+ const config = yield* Config;
8
+ if (config.config.action.syncAction === undefined) {
9
+ return yield* Effect.fail(new AppError({ message: "No sync action provided", cause: new Error("No sync action provided") }));
10
+ }
11
+ if (config.config.action.syncAction === 'init') {
12
+ return yield* wix_sync_init;
13
+ }
14
+ yield* Effect.fail(new AppError({ message: `Unsupported sync action type: ${config.config.action.syncAction}`, cause: new Error(`Unsupported action type: ${config.config.action.syncAction}`) }));
15
+ });
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wix-sync copy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IACzB,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;QAC7B,IAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAC;QACjI,CAAC;QAED,IAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,KAAK,MAAM,EAC7C,CAAC;YACG,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC;QAChC,CAAC;QACD,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,EAAE,OAAO,EAAE,iCAAiC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,4BAA4B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvM,CAAC,CAAC,CAAA;AACN,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ export declare const wix_sync_init: Effect.Effect<void, AppError | import("effect/ParseResult").ParseError | import("@effect/platform/Error").PlatformError, Config | import("@effect/platform/FileSystem").FileSystem | import("@effect/platform/Path").Path>;
@@ -0,0 +1,58 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import Enquirer from "enquirer";
4
+ import { AppError } from "../error.js";
5
+ import { writeVeloSyncSettings } from "../commands/write.js";
6
+ import { veloSyncSettings } from "../schemas/index.js";
7
+ import { logger } from "../utils/logger.js";
8
+ import { wix_sync_alive } from "./is-allive.js";
9
+ export const wix_sync_init = Effect.gen(function* (_) {
10
+ const config = yield* Config;
11
+ const prompter = new Enquirer();
12
+ const choice = yield* Effect.tryPromise({
13
+ try: () => prompter.prompt([
14
+ {
15
+ type: 'input',
16
+ name: 'siteUrl',
17
+ message: 'Enter a project URL',
18
+ initial: config.config.veloSyncSettings?.siteUrl || 'https://example.com',
19
+ validate: (value) => {
20
+ const urlPattern = /^https:\/\/[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(\/[^\s]*)?$/;
21
+ if (!value.trim())
22
+ return 'Project URL cannot be empty';
23
+ if (!urlPattern.test(value.trim()))
24
+ return 'URL must be in the format https://domain.com';
25
+ return true;
26
+ }
27
+ },
28
+ {
29
+ type: 'input',
30
+ name: 'secret',
31
+ message: 'Enter the velo-sync secret',
32
+ initial: config.config.veloSyncSettings?.secret || 'secret',
33
+ validate: (value) => value.trim() !== '' ? true : 'Secret cannot be empty'
34
+ }
35
+ ]),
36
+ catch: (e) => {
37
+ return new AppError({ cause: e, message: 'Error initializing velo-sync settings' });
38
+ }
39
+ });
40
+ config.config.veloSyncSettings = yield* Schema.decodeUnknown(veloSyncSettings)(choice);
41
+ yield* writeVeloSyncSettings;
42
+ const question = new Enquirer();
43
+ const verify = yield* Effect.tryPromise({
44
+ try: () => question.prompt({
45
+ type: 'confirm',
46
+ name: 'verify',
47
+ message: 'Do you want to verify the velo-sync settings?',
48
+ }),
49
+ catch: (e) => {
50
+ return new AppError({ cause: e, message: 'Error selecting template' });
51
+ }
52
+ });
53
+ const verifySync = yield* Schema.decodeUnknown(Schema.Struct({ verify: Schema.Boolean }))(verify);
54
+ if (verifySync.verify)
55
+ yield* wix_sync_alive;
56
+ logger.success(`Velo-sync settings initialized successfully!`);
57
+ });
58
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/wix-sync copy/init.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,4 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ export declare const wix_sync_alive: Effect.Effect<undefined, AppError, Config>;
@@ -0,0 +1,36 @@
1
+ import { Effect } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import Enquirer from "enquirer";
4
+ import { AppError } from "../error.js";
5
+ import { logger } from "../utils/logger.js";
6
+ import veloAPI from 'velo-sync/dist/velo/velo-api.js';
7
+ export const wix_sync_alive = Effect.gen(function* (_) {
8
+ const config = yield* Config;
9
+ const prompter = new Enquirer();
10
+ const veloSyncSettings = config.config.veloSyncSettings;
11
+ if (!veloSyncSettings)
12
+ return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
13
+ logger.action(`Checking if the API for site ${veloSyncSettings.siteUrl} is alive...`);
14
+ const res = yield* Effect.tryPromise({
15
+ try: () => veloAPI.isAlive(veloSyncSettings),
16
+ catch: (e) => {
17
+ return new AppError({ cause: e, message: 'Error checking if the API is alive' });
18
+ }
19
+ });
20
+ logger.success(`API for site ${veloSyncSettings.siteUrl} is alive and working!`);
21
+ return;
22
+ });
23
+ // if(moduleSettings.args.includes('is-alive')) {
24
+ // try {
25
+ // let config = await readConfig(moduleSettings.veloConfigName);
26
+ // console.log("🐕" + green(` => checking if the API for site ${chalk.greenBright(config.siteUrl)} is alive...`));
27
+ // await veloAPI.isAlive(config);
28
+ // return console.log(chalk.green("🐕" + ` => API of site ${chalk.greenBright(config.siteUrl)} is working and alive!!!`));
29
+ // }
30
+ // catch (e) {
31
+ // if(e instanceof Error) {
32
+ // return console.log((`💩 ${red.underline.bold("=> Failed to check endpoint")} ${orange(e.message)}`));
33
+ // }
34
+ // }
35
+ // }
36
+ //# sourceMappingURL=is-allive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-allive.js","sourceRoot":"","sources":["../../src/wix-sync copy/is-allive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,OAAO,MAAM,iCAAiC,CAAC;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC;IAC7B,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACxD,IAAI,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,EAAE,OAAO,EAAE,8BAA8B,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9J,MAAM,CAAC,MAAM,CAAC,gCAAgC,gBAAgB,CAAC,OAAO,cAAc,CAAC,CAAC;IAEtF,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;QACjC,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC5C,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;YACT,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC,CAAC;QACrF,CAAC;KACJ,CAAC,CAAA;IAEF,MAAM,CAAC,OAAO,CAAC,gBAAgB,gBAAgB,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACjF,OAAM;AACV,CAAC,CAAC,CAAA;AAEF,qDAAqD;AACrD,gBAAgB;AAChB,4EAA4E;AAC5E,8HAA8H;AAC9H,6CAA6C;AAC7C,sIAAsI;AACtI,YAAY;AACZ,sBAAsB;AACtB,wCAAwC;AACxC,wHAAwH;AACxH,gBAAgB;AAChB,YAAY;AACZ,QAAQ"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,88 @@
1
+ export {};
2
+ // function printUsage() {
3
+ // console.log('Usage: ');
4
+ // console.log('');
5
+ // console.log('Commands:');
6
+ // console.log(' init generates a config file for the import / export / sync process');
7
+ // console.log(' is-alive tests the config and the connection to the site');
8
+ // console.log(' sync runs the sync process');
9
+ // console.log(' import runs an import process');
10
+ // console.log(' migrate migrate existing nedb cache to sqlite cache (.upload-cache.db => .upload-cache.sqlite.db)');
11
+ // }
12
+ // function syncOrImportTask(importOnly: boolean) {
13
+ // let argv = optimist
14
+ // .usage(`Usage: $0 ${importOnly ? 'import' : 'sync'} -f <scv filename> -c <collection>`)
15
+ // .demand('f')
16
+ // .alias('f', 'filename')
17
+ // .describe('f', 'csv filename to import')
18
+ // .demand('c')
19
+ // .describe('c', 'the name of the collection to import into')
20
+ // .alias('c', 'collection')
21
+ // .demand('s')
22
+ // .describe('s', 'schema file describing the fields of the collection')
23
+ // .alias('s', 'schema')
24
+ // .describe('dry', 'dry-run that does not upload any data or files, and does not remove or update anything on the site')
25
+ // .alias('dry', 'dryrun')
26
+ // .parse(process.argv.slice(3));
27
+ // let filename = argv.filename;
28
+ // let collection = argv.collection;
29
+ // let schema = argv.schema;
30
+ // let dryrun = argv.dryrun;
31
+ // //@ts-ignore
32
+ // syncTask.default(filename, collection, schema, importOnly, dryrun);
33
+ // }
34
+ // // syncTask.default(filename, collection, schema, importOnly, dryrun);
35
+ // let siteUrl = await askQuestion(orange('what is the url of the site homepage? '));
36
+ // let secret = await askQuestion(orange('what is the velo-sync secret? '));
37
+ // rl.close();
38
+ // let config: VeloSyncConfig = { siteUrl, secret };
39
+ // await saveConfig(config, moduleSettings.veloConfigName);
40
+ // return console.log(chalk.green("🐕" + ' => config saved!'));
41
+ // })
42
+ // }
43
+ // if(moduleSettings.args.includes('-h') || moduleSettings.args.includes('help')) return printUsage();
44
+ // if(moduleSettings.args.includes('init')) {
45
+ // const rl = readline.createInterface({
46
+ // input: process.stdin,
47
+ // output: process.stdout,
48
+ // terminal: true
49
+ // });
50
+ // async function askQuestion(query: string):Promise<string> {
51
+ // return new Promise((resolve) => rl.question(query, (answer) => resolve(answer)));
52
+ // }
53
+ // console.log(chalk.yellow('hello to velo-sync init'));
54
+ // let siteUrl = await askQuestion(orange('what is the url of the site homepage? '));
55
+ // let secret = await askQuestion(orange('what is the velo-sync secret? '));
56
+ // rl.close();
57
+ // let config: VeloSyncConfig = { siteUrl, secret };
58
+ // await saveConfig(config, moduleSettings.veloConfigName);
59
+ // return console.log(chalk.green("🐕" + ' => config saved!'));
60
+ // }
61
+ // if(moduleSettings.args.includes('is-alive')) {
62
+ // try {
63
+ // let config = await readConfig(moduleSettings.veloConfigName);
64
+ // console.log("🐕" + green(` => checking if the API for site ${chalk.greenBright(config.siteUrl)} is alive...`));
65
+ // await veloAPI.isAlive(config);
66
+ // return console.log(chalk.green("🐕" + ` => API of site ${chalk.greenBright(config.siteUrl)} is working and alive!!!`));
67
+ // }
68
+ // catch (e) {
69
+ // if(e instanceof Error) {
70
+ // return console.log((`💩 ${red.underline.bold("=> Failed to check endpoint")} ${orange(e.message)}`));
71
+ // }
72
+ // }
73
+ // }
74
+ // if(moduleSettings.args.includes('sync')) {
75
+ // return syncOrImportTask(false);
76
+ // }
77
+ // if(moduleSettings.args.includes('import')) {
78
+ // return syncOrImportTask(true);
79
+ // }
80
+ // if(moduleSettings.args.includes('export')) {
81
+ // return console.log((`💩 ${red.underline.bold("=> Not implemented")}`));
82
+ // }
83
+ // if(moduleSettings.args.includes('migrate')) {
84
+ // //@ts-ignore
85
+ // migrateFileCache.default();
86
+ // }
87
+ // }
88
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/wix-sync copy/sync.ts"],"names":[],"mappings":";AAYA,0BAA0B;AAC1B,+BAA+B;AAC/B,uBAAuB;AACvB,gCAAgC;AAChC,qGAAqG;AACrG,sFAAsF;AACtF,4DAA4D;AAC5D,6DAA6D;AAC7D,gIAAgI;AAChI,IAAI;AAEJ,mDAAmD;AACnD,0BAA0B;AAC1B,kGAAkG;AAClG,uBAAuB;AACvB,kCAAkC;AAClC,mDAAmD;AACnD,uBAAuB;AACvB,sEAAsE;AACtE,oCAAoC;AACpC,uBAAuB;AACvB,gFAAgF;AAChF,gCAAgC;AAChC,iIAAiI;AACjI,kCAAkC;AAClC,yCAAyC;AACzC,oCAAoC;AACpC,wCAAwC;AACxC,gCAAgC;AAChC,gCAAgC;AAChC,mBAAmB;AACnB,0EAA0E;AAC1E,IAAI;AACJ,yEAAyE;AAEjE,6FAA6F;AACrG,oFAAoF;AACpF,sBAAsB;AACtB,4DAA4D;AAC5D,mEAAmE;AACnE,uEAAuE;AAEnE,OAAO;AACX,IAAI;AACJ,0GAA0G;AAC1G,iDAAiD;AACjD,gDAAgD;AAChD,oCAAoC;AACpC,sCAAsC;AACtC,6BAA6B;AAC7B,cAAc;AAEd,sEAAsE;AACtE,gGAAgG;AAChG,YAAY;AAEZ,gEAAgE;AAChE,6FAA6F;AAC7F,oFAAoF;AACpF,sBAAsB;AACtB,4DAA4D;AAC5D,mEAAmE;AACnE,uEAAuE;AACvE,KAAK;AAEL,qDAAqD;AACrD,gBAAgB;AAChB,4EAA4E;AAC5E,8HAA8H;AAC9H,6CAA6C;AAC7C,sIAAsI;AACtI,YAAY;AACZ,sBAAsB;AACtB,wCAAwC;AACxC,wHAAwH;AACxH,gBAAgB;AAChB,YAAY;AACZ,QAAQ;AACR,iDAAiD;AACjD,0CAA0C;AAC1C,QAAQ;AAER,mDAAmD;AACnD,yCAAyC;AACzC,QAAQ;AAER,mDAAmD;AACnD,kFAAkF;AAClF,QAAQ;AAER,oDAAoD;AACpD,uBAAuB;AACvB,sCAAsC;AACtC,QAAQ;AAER,IAAI"}
@@ -0,0 +1,17 @@
1
+ Image,Artist,Location,Description,ID,Name
2
+ wix:image://v1/596320_525e18eaa2ce459a94dd3b812a7db930~mv2.jpg/BenWilson_chewing_gum_issa_23.jpg#originWidth=634&originHeight=436,c1c03e11-024b-4dad-a689-1c3610913b9b,London Bridge,,0451962b-9cd2-4fe2-aa24-f7973d073d75,Little Mermaid
3
+ wix:image://v1/fc7570_846eb609b9d640d184345e6309f8768c~mv2.jpg/%20Shop%20till%20you%20drop%20%20%20.JPG#originWidth=1600&originHeight=1067,50072d76-8368-42f7-99ee-0e9296029d75, Bruton Street,"Also known as the “Falling Shopper”, the mural is located on Bruton Lane on the side of a large office building in the heart of the West End district. The piece is over two storeys up and represents a woman falling with a trolley from the top of a building. Banksy’s aim was to point out the dangers of consumerism. The mural was painted in November 2011 in broad daylight. A scaffolding and a tarpaulin were used to make sure nobody caught the artist red-handed. “Shop Till You Drop” is still visible and quite damaged.",0560c783-f374-44f6-b318-908d6de77816, Shop Till You Drop
4
+ wix:image://v1/596320_f0681085ac544bea9527272059955ba2~mv2.jpg/46600548_595929587504016_290259145196053.jpg#originWidth=1080&originHeight=1080,777a0f48-b2ff-421e-a435-739081cf05ba,King John Court,,0a910c5e-cf3c-4d92-b911-8db7819296f1,Artemis
5
+ wix:image://v1/596320_65dfa944076d44a9a945868d7702331b~mv2.jpeg/IMG_6611.jpeg#originWidth=1000&originHeight=750,59430c6f-11f4-49c5-a7f5-19b855d2b5f3,Shoreditch Underground,,0b75e1d7-073c-44ae-b965-a1fa6bb2c15a,Hey Baby
6
+ wix:image://v1/fc7570_dfbf8d18bf2f4d8db98a48b65e491d78~mv2.jpg/Banksy-There-is-Always-Hope.jpg#originWidth=1500&originHeight=1076,50072d76-8368-42f7-99ee-0e9296029d75,South Bank,"Arguably Banksy’s most iconic piece, it appeared in South Bank, London in around 2002. The words ‘There Is Always Hope’ are written just behind a young girl, who can be seen reaching for a balloon in the shape of a heart. Intense debate has raged on over the years regarding the true meaning of this stencil, with a variety of ideas involving love, innocence and – obviously – hope",1c138979-d640-4d53-b390-187a4196db5f,There Is Always Hope
7
+ wix:image://v1/596320_a2535724be2c4376b382260f10d7f069~mv2.jpg/BaltimoreBorn.jpg#originWidth=1080&originHeight=827,777a0f48-b2ff-421e-a435-739081cf05ba,Old Street,,297516b7-3389-49ae-b1c7-14a28b4ba76b,Baltimore Born
8
+ wix:image://v1/fc7570_221a6ef024794bb69a43a208225643bd~mv2.jpg/street-art-in-london-banksy-graffiti-pai.jpg#originWidth=640&originHeight=428,50072d76-8368-42f7-99ee-0e9296029d75,Portobello Road Market," This piece can be found beside Regent’s Canal tunnel and under the London Transport Police Headquarters in Camden. The mural, painted in 2009, represents a city worker covering the work of another graffiti artist painted in 1985 with grey wallpaper. This wall became the battleground of a graffiti war between Banksy and the deceased London graffiti legend King Robbo. Shortly after, Robbo struck back and covered Banksy’s piece on the pretext that he broke the underground code of conduct. The wall undergone eight other modifications from both artists. The feud stopped when King Robbo was hospitalised for life-threatening head injuries. When Banksy heard about King Robbo’s serious health condition, he painted an ode to Robbo’s original graffiti piece. As a tribute to Robbo, the mural was restored to its original form with slight changes.",414c339e-0300-44b9-b8a4-376d8f0acbca, Graffiti Painter
9
+ wix:image://v1/596320_057219a2167d4b6dbdac4ffc8bf70012~mv2.jpg/G.%20Davis%20is%20Innocent%20OK.jpg#originWidth=1200&originHeight=800,777a0f48-b2ff-421e-a435-739081cf05ba,Sclater Street,,63d5d8d0-3939-4c68-b641-8e93e7bc61f5,G. Davis is Innocent OK
10
+ wix:image://v1/fc7570_d259e3c970094cb3a2cdec0c8e28eb93~mv2.png/Screenshot%20at%20Mar%2005%2011-13-56.png#originWidth=1702&originHeight=1176,50072d76-8368-42f7-99ee-0e9296029d75,Rivington Street Shoreditch,"Banksy’s mural is located on Essex Road, North London. Painted in 2008 on the side of a pharmacy, Banksy’s work depicts a group of three children pledging their allegiance to the British supermarket chain Tesco. One of them is raising a flag composed by a Tesco carrier bag. Even though it was quickly covered in perspex, “Very Little Help” has been vandalised on several occasions and it is currently partially damaged. The flag has been painted over and replaced with a tag from Robbo.",696f7b91-cd61-4a6c-a5f8-06fe1e916354,Tesco Kids
11
+ wix:image://v1/596320_e970850a978147cf89d49d62e0442736~mv2.jpg/ad2dd_Jose-Mendez-1.jpg#originWidth=470&originHeight=470,59430c6f-11f4-49c5-a7f5-19b855d2b5f3,Shoreditch,,6d779be3-bc57-49e0-b1a7-291d9429bbf8,Happy Walk
12
+ wix:image://v1/596320_25360281cc7e491bb4870bd5d32e909f~mv2.jpg/Garden+Of+Desire6+WEB.jpg#originWidth=709&originHeight=653,59430c6f-11f4-49c5-a7f5-19b855d2b5f3,Shoreditch,,7242d0da-73b7-431e-abaa-7efc18fa56f0,Garden of Desire
13
+ wix:image://v1/596320_c29d9c5caa03466ebe86d216f0c652f1~mv2.jpg/ben-wilson8_orig.jpg#originWidth=796&originHeight=800,c1c03e11-024b-4dad-a689-1c3610913b9b,London Bridge,,7bd23aac-2bce-4a69-8907-69152838ba82,London Sky
14
+ wix:image://v1/596320_1f2d833d379047579240f9f0e9c1ddad~mv2.jpg/1.jpg#originWidth=1000&originHeight=1000,59430c6f-11f4-49c5-a7f5-19b855d2b5f3,Shoreditch,,aed627a9-47da-404d-96ee-42e042eb6602,Red Gallery Window
15
+ wix:image://v1/596320_e8f7ee11aaa9428bb25233cf1304cb54~mv2.jpg/fingercrossed.jpg#originWidth=640&originHeight=640,777a0f48-b2ff-421e-a435-739081cf05ba,Brick Lane,,c1ba82f3-fd79-4860-87ce-d894c15c98fb,Fingers Crossed
16
+ wix:image://v1/596320_44bc2bdb102a48f3ae6e596bb2d2806c~mv2.jpg/tn_IMG_5069.jpg#originWidth=555&originHeight=740,c1c03e11-024b-4dad-a689-1c3610913b9b,London Bridge,,c2e3c665-664b-4797-a91f-f59559497ad2,I'll Quit Tomorrow
17
+ wix:image://v1/596320_1e8978648f0e4e56b79712f03ff80fa7~mv2.jpg/tn_IMG_0369-001.jpg#originWidth=864&originHeight=837,c1c03e11-024b-4dad-a689-1c3610913b9b,Old Street,,d5e474f2-7faf-47be-9702-27cbab81d0e7,BW Face
@@ -0,0 +1,11 @@
1
+ {
2
+ "keyField": "ID",
3
+ "fields": {
4
+ "Image": "Image",
5
+ "Artist": "Reference",
6
+ "Location": "string",
7
+ "Description": "string",
8
+ "ID": "string",
9
+ "Name": "string"
10
+ }
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "2.0.0-alpha.12",
4
+ "version": "2.0.0-alpha.14",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -36,7 +36,10 @@
36
36
  "@effect/platform-node": "^0.94.0",
37
37
  "@swc/core": "^1.9.3",
38
38
  "@wix/cli": "^1.0.83",
39
+ "@wix/data": "^1.0.270",
39
40
  "@wix/eslint-plugin-cli": "^1.0.1",
41
+ "@wix/sdk": "^1.15.26",
42
+ "@wix/sites": "^1.0.24",
40
43
  "chalk": "^5.3.0",
41
44
  "effect": "^3.17.1",
42
45
  "enquirer": "^2.4.1",
@@ -71,7 +74,7 @@
71
74
  "ts-node": "^10.9.1",
72
75
  "typedoc": "0.28.8",
73
76
  "typescript": "^5.6.3",
74
- "velo-sync": "^0.0.9",
77
+ "velo-sync": "patch:velo-sync@npm%3A0.0.9#~/.yarn/patches/velo-sync-npm-0.0.9-6a8db40266.patch",
75
78
  "yargs": "^18.0.0"
76
79
  },
77
80
  "devDependencies": {
package/src/args.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  import yargs from "yargs";
2
2
  import { hideBin } from "yargs/helpers";
3
- import { LucyArgs, tasks, types } from "./schemas/types.js";
3
+ import { initTypes, LucyArgs, taskNames, syncActions } from "./schemas/types.js";
4
+ import pkg from "../package.json" assert { type: "json" };
4
5
 
5
6
  export async function get_args(): Promise<LucyArgs> {
6
7
  const argv = await yargs(hideBin(process.argv))
7
8
  .usage('Usage: $0 <command> [options]')
8
- .command('init <type>', 'Initialize a new Lucy project', (yargs) => {
9
- return yargs.positional('type', {
9
+ .command('init <initType>', 'Initialize a new Lucy project', (yargs) => {
10
+ return yargs.positional('initType', {
10
11
  describe: 'The type of project to initialize',
11
- choices: types,
12
+ choices: initTypes,
12
13
  demandOption: true,
13
14
  })
14
15
  }).option('force', {
@@ -17,14 +18,53 @@ export async function get_args(): Promise<LucyArgs> {
17
18
  description: 'Run with force'
18
19
  })
19
20
  .command('open', 'Open the Lucy home directory')
20
- .command('task <task>', 'Run a task', (yargs) => {
21
- return yargs.positional('task', {
21
+ .command('task <tasksName>', 'Run a task', (yargs) => {
22
+ return yargs.positional('tasksName', {
22
23
  describe: 'The task to run',
23
- choices: tasks,
24
+ choices: taskNames,
24
25
  demandOption: true,
25
26
  })
26
27
  })
28
+ .command('wix-sync <syncAction>', 'Run a velo-sync action', (yargs) => {
29
+ return yargs.positional("syncAction", {
30
+ describe: "The velo-sync action to run",
31
+ choices: syncActions,
32
+ demandOption: true,
33
+ })
34
+ .option('input', {
35
+ alias: 'i',
36
+ type: 'string',
37
+ describe: 'The CSV file to import',
38
+ demandOption: false,
39
+ })
40
+ .option('c', {
41
+ alias: 'collection',
42
+ type: 'string',
43
+ describe: 'The name of the collection to import data into',
44
+ demandOption: false,
45
+ })
46
+ .option('s', {
47
+ alias: 'schema',
48
+ type: 'string',
49
+ describe: 'The schema file',
50
+ demandOption: false,
51
+ })
52
+ .option('d', {
53
+ type: 'boolean',
54
+ describe: 'Run in dry-run mode',
55
+ demandOption: false,
56
+ });
57
+ })
58
+ .command('wix-sdk <wixSDKAction>', 'Run a velo-sync action', (yargs) => {
59
+ return yargs.positional("wixSDKAction", {
60
+ describe: "The velo-sync action to run",
61
+ choices: syncActions,
62
+ demandOption: true,
63
+ });
64
+ })
27
65
  .demandCommand(1, 'You need to provide a command. Use --help for a list of commands.')
66
+ .version('v', 'Show version number', pkg.version)
67
+ .alias('v', 'version')
28
68
  .help()
29
69
  .alias('h', 'help')
30
70
  .strict()
@@ -1,6 +1,6 @@
1
1
  import { Effect, Schema } from "effect/index";
2
2
  import { Command, FileSystem, Path } from "@effect/platform"
3
- import { Config } from "../config.js";
3
+ import { Config, lucyJsonName } from "../config.js";
4
4
  import { logger } from "../utils/logger.js";
5
5
  import { AppError } from "../error.js";
6
6
  import { JsonSchema } from "../schemas/index.js";
@@ -11,7 +11,7 @@ export const isDirectoryClean =(excludes: string[] = []) => {
11
11
  const config = yield* Config;
12
12
 
13
13
  const files = yield* fs.readDirectory(config.config.cwd);
14
- const allExcludes = [...excludes, '.git', 'lucy.json'];
14
+ const allExcludes = [...excludes, '.git', lucyJsonName];
15
15
  const filteredFiles = files.filter(file => !allExcludes.includes(file));
16
16
 
17
17
  return filteredFiles.length > 0 ? false : true;
@@ -1,7 +1,7 @@
1
1
  import { Effect } from "effect/index";
2
2
  import { Path } from "@effect/platform"
3
3
  import { FileSystem } from "@effect/platform"
4
- import { Config } from "../config.js";
4
+ import { Config, syncDataName, syncFilesSource } from "../config.js";
5
5
 
6
6
  export const copyTemplateFiles = Effect.gen(function*() {
7
7
  const fs = yield* FileSystem.FileSystem;
@@ -13,4 +13,16 @@ export const copyTemplateFiles = Effect.gen(function*() {
13
13
  templateFiles,
14
14
  (file) => fs.copy(path.join(config.config.templateFiles, file), path.join(config.config.cwd, file), { overwrite: true })
15
15
  )
16
+ })
17
+ export const copySyncFiles = Effect.gen(function*() {
18
+ const fs = yield* FileSystem.FileSystem;
19
+ const config = yield* Config;
20
+ const path = yield * Path.Path;
21
+
22
+ const synDataFiles = yield* fs.readDirectory(syncFilesSource)
23
+ yield* fs.makeDirectory(path.join(config.config.cwd, syncDataName));
24
+ yield* Effect.forEach(
25
+ synDataFiles,
26
+ (file) => fs.copy(path.join(syncFilesSource, file), path.join(config.config.cwd, syncDataName, file), { overwrite: true })
27
+ )
16
28
  })
@@ -1,5 +1,5 @@
1
1
  import { Effect, Schema } from "effect/index";
2
- import { Config } from "../config.js";
2
+ import { Config, lucyJsonPath } from "../config.js";
3
3
  import { FileSystem, Path } from "@effect/platform"
4
4
  import { logger } from "../utils/logger.js";
5
5
  import { JsonSchema } from "../schemas/index.js";
@@ -57,11 +57,11 @@ export const setInitialized = Effect.gen(function*() {
57
57
  const config = yield* Config;
58
58
  const fs = yield* FileSystem.FileSystem;
59
59
  const path = yield* Path.Path;
60
- const lucyRaw = yield* fs.readFileString(path.join(config.config.cwd, 'lucy.json'));
60
+ const lucyRaw = yield* fs.readFileString(lucyJsonPath);
61
61
  const lucyJSON = (yield* Schema.decodeUnknown(JsonSchema)(lucyRaw)) as any;
62
62
  lucyJSON.initialized = true;
63
63
 
64
- yield* fs.writeFileString(path.join(config.config.cwd, 'lucy.json'), JSON.stringify(lucyJSON, null, 2));
64
+ yield* fs.writeFileString(lucyJsonPath, JSON.stringify(lucyJSON, null, 2));
65
65
  })
66
66
 
67
67
  export const stringReplace = (filePath: string, keys: string[], values: string[]) => {
@@ -1,7 +1,7 @@
1
1
  import { Effect, Schema } from "effect/index";
2
2
  import { FileSystem, Path } from "@effect/platform"
3
- import { Config } from "../config.js";
4
- import { JsonSchema } from "../schemas/index.js";
3
+ import { Config, lucyJsonName, lucyJsonPath, packageJsonPath, veloSyncJsonPath } from "../config.js";
4
+ import { JsonSchema, veloSyncSettings } from "../schemas/index.js";
5
5
  import { lucySettings } from "../schemas/lucy.js";
6
6
  import { logger } from "../utils/logger.js";
7
7
 
@@ -10,7 +10,6 @@ export const readPackageJson = Effect.gen(function* () {
10
10
  const fs = yield* FileSystem.FileSystem;
11
11
  const path = yield* Path.Path;
12
12
 
13
- const packageJsonPath = path.join(config.config.cwd, "package.json")
14
13
  const packageJsonRaw = yield* fs.readFile(packageJsonPath)
15
14
  config.config.packageJson = yield* Schema.decodeUnknown(JsonSchema)(packageJsonRaw.toString());
16
15
  })
@@ -20,18 +19,28 @@ export const readLucyJsonFromTemplate = Effect.gen(function* () {
20
19
  const fs = yield* FileSystem.FileSystem;
21
20
  const path = yield* Path.Path;
22
21
 
23
- const lucyJsonPath = path.join(config.config.templateDir, "lucy.json")
24
- const lucyRaw = yield* fs.readFileString(lucyJsonPath, 'utf-8');
22
+ const lucyRaw = yield* fs.readFileString(lucyJsonPath);
25
23
  const lucySettingsJSON = yield* Schema.decodeUnknown(JsonSchema)(lucyRaw);
26
24
  const lucySetting = yield* Schema.decodeUnknown(lucySettings)(lucySettingsJSON)
25
+
27
26
  if(config.config.lucySettings.initialized) {
28
27
  if(config.config.force) {
29
- logger.warning(`lucy.json already exists in the template directory, but 'force' is set. Overwriting...`);
28
+ logger.warning(`${lucyJsonName} already exists in the template directory, but 'force' is set. Overwriting...`);
30
29
  config.config.lucySettings = lucySetting;
31
30
  return;
32
31
  }
33
- logger.warning(`lucy.json already exists in the template directory. Skipping reading lucy.json from template.`);
32
+ logger.warning(`${lucyJsonName} already exists in the template directory. Skipping reading ${lucyJsonName} from template.`);
34
33
  return;
35
34
  }
36
35
  config.config.lucySettings = lucySetting;
37
- })
36
+ })
37
+
38
+ export const readVeloSyncSettings = Effect.gen(function* () {
39
+ const config = yield* Config;
40
+ const fs = yield* FileSystem.FileSystem;
41
+ const path = yield* Path.Path;
42
+ if (yield* fs.exists(veloSyncJsonPath)) {
43
+ const snyConfigRaw = yield* fs.readFileString(veloSyncJsonPath)
44
+ config.config.veloSyncSettings = yield* Schema.decodeUnknown(veloSyncSettings)(snyConfigRaw);
45
+ }
46
+ });
@@ -1,6 +1,6 @@
1
1
  import { Effect } from "effect/index";
2
2
  import { Command, FileSystem, Path } from "@effect/platform"
3
- import { Config } from "../config.js";
3
+ import { Config, lucyJsonPath, packageJsonPath, veloSyncJsonPath, wixSDKSettingsJsonPath } from "../config.js";
4
4
 
5
5
  export const writeLucySettings = Effect.gen(function* (_) {
6
6
  const fs = yield* FileSystem.FileSystem;
@@ -8,7 +8,7 @@ export const writeLucySettings = Effect.gen(function* (_) {
8
8
  const config = yield* Config;
9
9
 
10
10
  yield* fs.writeFileString(
11
- path.join(config.config.cwd, "lucy.json"),
11
+ lucyJsonPath,
12
12
  JSON.stringify(config.config.lucySettings, null, 2)
13
13
  );
14
14
  })
@@ -18,7 +18,28 @@ export const writePackageJson = Effect.gen(function* (_) {
18
18
  const path = yield* Path.Path;
19
19
  const config = yield* Config;
20
20
  yield* fs.writeFileString(
21
- path.join(config.config.cwd, "package.json"),
21
+ packageJsonPath,
22
22
  JSON.stringify(config.config.packageJson, null, 2)
23
23
  );
24
- })
24
+ })
25
+
26
+ export const writeVeloSyncSettings = Effect.gen(function* () {
27
+ const config = yield* Config;
28
+ const fs = yield* FileSystem.FileSystem;
29
+ const path = yield* Path.Path;
30
+ yield* fs.writeFileString(
31
+ veloSyncJsonPath,
32
+ JSON.stringify(config.config.veloSyncSettings, null, 2)
33
+ );
34
+ });
35
+
36
+ export const writeWixSDKSettings = Effect.gen(function* () {
37
+ const config = yield* Config;
38
+ const fs = yield* FileSystem.FileSystem;
39
+ const path = yield* Path.Path;
40
+ yield* fs.writeFileString(
41
+ wixSDKSettingsJsonPath,
42
+ JSON.stringify(config.config.wixSDKSettings, null, 2)
43
+ );
44
+ });
45
+