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
@@ -1,9 +1,8 @@
1
1
  import gulp from 'gulp';
2
2
  import * as path from 'path';
3
- import { File } from '../Gulpfile.js';
4
3
  import replace from 'gulp-string-replace';
5
4
  import { logger } from '../../utils/logger.js';
6
-
5
+ import { File } from "../../schemas/gulp.js";
7
6
  export function setProdConfig() {
8
7
  const tag = process.env.GIT_TAG || 'development';
9
8
  const regexGit = /gitTag:\s*(.*),/g;
@@ -21,12 +20,12 @@ export function setProdConfig() {
21
20
  return path.join(`${outputDir}/constants`);
22
21
  }))
23
22
  .on('error', function (e: Error) {
24
- logger.error(' => Setting the git tag failed!');
25
- logger.error(` => Error: ${e.message}`);
23
+ logger.error('Setting the git tag failed!');
24
+ logger.error(`Error: ${e.message}`);
26
25
  this.emit('end');
27
26
  })
28
27
  .on('end', function() {
29
- logger.success(' => Setting the git tag succeeded!');
28
+ logger.success('Setting the git tag succeeded!');
30
29
  });
31
30
  }
32
31
  }
@@ -1,8 +1,8 @@
1
1
  import gulp from 'gulp';
2
2
  import * as path from 'path';
3
- import { TaskOptions } from '../Gulpfile.js';
4
3
  import swc from 'gulp-swc';
5
4
  import { logger } from '../../utils/logger.js';
5
+ import { TaskOptions } from '../../schemas/gulp.js';
6
6
 
7
7
  const swcOptions = {
8
8
  jsc: {
@@ -34,19 +34,19 @@ export function buildPublic(options: TaskOptions) {
34
34
  ])
35
35
  .pipe(swc(swcOptions))
36
36
  .on('error', function (e: Error) {
37
- logger.error(` => Build of Public files for ${folder} failed!`);
38
- logger.error(` => Error: ${e.message}`);
37
+ logger.error(`Build of Public files for ${folder} failed!`);
38
+ logger.error(`Error: ${e.message}`);
39
39
 
40
40
  this.emit('end');
41
41
  })
42
42
  .pipe(gulp.dest(path.join(outputDir, 'public')))
43
43
  .on('error', function (e: Error) {
44
- logger.error(` => Build of Public files for ${folder} failed!`);
45
- logger.error(` => Error: ${e.message}`);
44
+ logger.error(`Build of Public files for ${folder} failed!`);
45
+ logger.error(`Error: ${e.message}`);
46
46
  this.emit('end');
47
47
  })
48
48
  .on('end', function () {
49
- logger.success(` => Build of Public files for ${folder} succeeded!`);
49
+ logger.success(`Build of Public files for ${folder} succeeded!`);
50
50
  });
51
51
 
52
52
  // Register the task with Gulp
@@ -1,7 +1,7 @@
1
1
  import gulp from 'gulp';
2
2
  import chalk from 'chalk';
3
- import { TaskOptions } from '../Gulpfile.js';
4
3
  import { logger, orange } from '../../utils/logger.js';
4
+ import { TaskOptions } from '../../schemas/gulp.js';
5
5
 
6
6
  export function compileScss(options: TaskOptions) {
7
7
  const folders = ['typescript'];
@@ -11,35 +11,35 @@ export function compileScss(options: TaskOptions) {
11
11
  const buildWixScss = () => gulp.src(['typescript/styles/global.scss'], { allowEmpty: true })
12
12
  .pipe(sass().on('error', sass.logError))
13
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)}`);
14
+ logger.error(`Build of SCSS files for ${orange('global.scs')} failed!`);
15
+ logger.error(`Error: ${orange(e.message)}`);
16
16
  this.emit('end');
17
17
  })
18
18
  .pipe(gulp.dest(`${outputDir}/styles`))
19
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)}`);
20
+ logger.error(`Compiling of scss files for ${orange('global.scs')} failed!`);
21
+ logger.error(`Error: ${orange(e.message)}`);
22
22
  this.emit('end');
23
23
  })
24
24
  .on('end', function () {
25
- logger.success(` => Compiling of scss files for ${orange('global.scs')} succeeded!`);
25
+ logger.success(`Compiling of scss files for ${orange('global.scs')} succeeded!`);
26
26
  });
27
27
 
28
28
  const buildScss = () => gulp.src(['typescript/public/scss/app.scss'], { allowEmpty: true })
29
29
  .pipe(sass().on('error', sass.logError))
30
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)}`);
31
+ logger.error(`Build of SCSS files for ${orange('app.scss')} failed!`);
32
+ logger.error(`Error: ${orange(e.message)}`);
33
33
  this.emit('end');
34
34
  })
35
35
  .pipe(gulp.dest(`${outputDir}/public/css`))
36
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)}`);
37
+ logger.error(`Compiling of scss files for ${orange('app.scss')} failed!`);
38
+ logger.error(`Error: ${orange(e.message)}`);
39
39
  this.emit('end');
40
40
  })
41
41
  .on('end', function () {
42
- logger.success(` => Compiling of scss files for ${orange('app.scss')} succeeded!`);
42
+ logger.success(`Compiling of scss files for ${orange('app.scss')} succeeded!`);
43
43
  });
44
44
 
45
45
  return gulp.parallel(buildWixScss, buildScss);
@@ -1,5 +1,5 @@
1
1
  import gulp from 'gulp';
2
- import { File, TaskOptions } from '../Gulpfile.js';
2
+ import { File, TaskOptions } from '../../schemas/gulp.js';
3
3
  import exec from 'gulp-exec';
4
4
  import { logger, orange } from '../../utils/logger.js';
5
5
  import path from 'path';
@@ -35,12 +35,12 @@ export function previewTemplates(options: TaskOptions) {
35
35
  ])
36
36
  .pipe(exec((file: File) => `npx tsx --tsconfig ./local.tsconfig.json ${file.path}`, taskOpt))
37
37
  .on('error', function (e: Error) {
38
- logger.error(` => Render of Template for ${orange(folder)} failed!`);
39
- logger.error(` => Error: ${orange(e.message)}`);
38
+ logger.error(`Render of Template for ${orange(folder)} failed!`);
39
+ logger.error(`Error: ${orange(e.message)}`);
40
40
  this.emit('end');
41
41
  })
42
42
  .on('end', function () {
43
- logger.success(` => Render of Template for ${orange(folder)} succeeded!`);
43
+ logger.success(`Render of Template for ${orange(folder)} succeeded!`);
44
44
  });
45
45
 
46
46
  // Register the task with Gulp
@@ -1,6 +1,6 @@
1
1
  import gulp from 'gulp';
2
2
  import * as path from 'path';
3
- import { File, TaskOptions } from '../Gulpfile.js';
3
+ import { File, TaskOptions } from '../../schemas/gulp.js';
4
4
  import replace from 'gulp-string-replace';
5
5
  import flatmap from 'gulp-flatmap';
6
6
  import jeditor from 'gulp-json-editor';
@@ -14,12 +14,7 @@ export function updateWixTypes(options: TaskOptions) {
14
14
  const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
15
15
  let count = 0;
16
16
 
17
- const modules: Record<string, string> = Object.assign({}, options.projectSettings?.modules, options.projectSettings?.lucySettings?.modules);
18
17
 
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
18
  // Add module to publicSettings
24
19
  publicSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
25
20
  publicSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
@@ -74,65 +69,63 @@ export function updateWixTypes(options: TaskOptions) {
74
69
  // "../../../typescript/backend/**/*.web"
75
70
  ] as never;
76
71
 
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
- }
72
+ for (const name of options.modulesSourcePaths) {
73
+ // Add module to publicSettings
74
+ publicSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
75
+ publicSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
76
+ publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
77
+ publicSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
78
+ publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
79
+ publicSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` as never ]);
80
+ publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
81
+ publicSettings.include.push(...[
82
+ `../../../${name}/public/**/*`,
83
+ `../../../${name}__mocks__/**/*`,
84
+ // `../../../${name}/backend/**/*.jsw.ts`,
85
+ // `../../../${name}/backend/**/*.web.ts`,
86
+ // `../../../${name}/backend/**/*.web`
87
+ ] as never[]);
88
+ // Add module to backendSettings
89
+ backendSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
90
+ backendSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
91
+ backendSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` ] as never[]);
92
+ backendSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
93
+ backendSettings.include.push(...[
94
+ `../../../${name}/public/**/*`,
95
+ `../../../${name}__mocks__/**/*`,
96
+ `../../../${name}/backend/**/*`,
97
+ // `../../../${name}/backend/**/*.jsw.ts`,
98
+ // `../../../${name}/backend/**/*.web.ts`,
99
+ // `../../../${name}/backend/**/*.web`
100
+ ] as never[]);
101
+ // Add module to masterSettings
102
+ masterSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
103
+ masterSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
104
+ masterSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
105
+ masterSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
106
+ masterSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
107
+ masterSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
108
+ masterSettings.include.push(...[
109
+ `../../../${name}/public/**/*`,
110
+ `../../../${name}__mocks__/**/*`,
111
+ // `../../../${name}/backend/**/*.jsw.ts`,
112
+ // `../../../${name}/backend/**/*.web.ts`,
113
+ // `../../../${name}/backend/**/*.web`
114
+ ] as never[]);
115
+ // Add module to pageSettings
116
+ pageSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
117
+ pageSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
118
+ pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
119
+ pageSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
120
+ pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
121
+ pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
122
+ pageSettings.include.push(...[
123
+ `../../../${name}/public/**/*`,
124
+ `../../../${name}__mocks__/**/*`,
125
+ // `../../../${name}/backend/**/*.jsw.ts`,
126
+ // `../../../${name}/backend/**/*.web.ts`,
127
+ // `../../../${name}/backend/**/*.web`
128
+ ] as never[]);
136
129
  }
137
130
 
138
131
  return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/**/*'])
@@ -178,7 +171,7 @@ export function updateWixTypes(options: TaskOptions) {
178
171
  }))
179
172
  .on('error', function (e: Error) {
180
173
  logger.error('Modification of WIX configs failed!');
181
- logger.error(` => Error: ${orange(e.message)}`);
174
+ logger.error(`Error: ${orange(e.message)}`);
182
175
  this.emit('end');
183
176
  })
184
177
  .on('end', function() { logger.success(`Modification of ${yellow(count)} WIX configs succeeded!`); });
@@ -223,15 +216,15 @@ export function addTypes(options: TaskOptions, done: gulp.TaskFunctionCallback)
223
216
  stream.on('end', () => {
224
217
  completedStreams++;
225
218
  if (completedStreams === streams.length && !hasErrored) {
226
- logger.success(' => Updating WIX succeeded!');
219
+ logger.success('Updating WIX succeeded!');
227
220
  done();
228
221
  }
229
222
  });
230
223
  stream.on('error', (e: Error) => {
231
224
  if (!hasErrored) {
232
225
  hasErrored = true;
233
- logger.error(' => Updating WIX failed!');
234
- logger.error(` => Error: ${orange(e.message)}`);
226
+ logger.error('Updating WIX failed!');
227
+ logger.error(`Error: ${orange(e.message)}`);
235
228
  done(e);
236
229
  }
237
230
  });
@@ -1,93 +1,89 @@
1
1
  import gulp from 'gulp';
2
- import { TaskOptions } from '../Gulpfile.js';
3
- import { buildBackend, buildBackendJSW } from './backend.js';
2
+ import { buildBackend } from './backend.js';
4
3
  import { buildPublic } from './public.js';
5
4
  import { buildPages } from './pages.js';
6
5
  import { copyFiles } from './copy.js';
7
6
  import { previewTemplates } from './templates.js';
8
7
  import { checkTs } from './checks.js';
9
- let taskOptions: TaskOptions;
8
+ import { TaskOptions } from '../../schemas/gulp.js';
10
9
 
11
- export function watchSCSS() {
12
- return gulp.watch([
13
- '*/styles/**/*.scss'
14
- ],
15
- gulp.parallel('scss')
16
- );
17
- }
18
-
19
- export function watchBackend() {
20
- return gulp.watch([
21
- '*/backend/**/*.ts',
22
- '*/backend/**/*.tsx',
23
- '!*/backend/**/*.jsw.ts',
24
- '!src/**/**',
25
- ], gulp.parallel(
26
- checkTs(taskOptions),
27
- buildBackend(taskOptions),
28
- // shell.task([
29
- // 'yarn docs',
30
- // ])
31
- ));
32
- }
33
-
34
- export function watchPublic() {
35
- return gulp.watch([
36
- '*/public/**/*.ts',
37
- '*/public/**/*.tsx',
38
- ], gulp.parallel(
39
- checkTs(taskOptions),
40
- buildPublic(taskOptions),
41
- // shell.task([
42
- // 'yarn docs',
43
- // ])
44
- ));
45
- }
46
-
47
- export function watchPages() {
48
- return gulp.watch('typescript/pages/**/*.ts',
49
- gulp.parallel(
50
- checkTs(taskOptions),
51
- buildPages(taskOptions),
52
- )
53
- );
54
- }
55
-
56
- export function watchFiles() {
57
- return gulp.watch([
58
- '*/backend/**/*',
59
- '*/public/**/*',
60
- '*/pages/**/*',
61
- '!*/**/*.ts',
62
- '!*/**/*.tsx',
63
- ], gulp.parallel(copyFiles(taskOptions)));
64
- }
65
-
66
- export function watchTemplates() {
67
- return gulp.watch([
68
- '*/backend/templates/**/*.tsx',
69
- '*/backend/templates/data/*.json',
70
- '!*/backend/templates/render.ts',
71
- ], gulp.parallel(
72
- previewTemplates(taskOptions),
73
- checkTs(taskOptions),
74
- )
75
- );
76
- }
10
+ export function watchAll(options: TaskOptions) {
11
+ function watchSCSS() {
12
+ return gulp.watch([
13
+ '*/styles/**/*.scss'
14
+ ],
15
+ gulp.parallel('scss')
16
+ );
17
+ }
77
18
 
78
- export function watchTypes() {
79
- return gulp.watch([
80
- './.wix/types/**/*.d.ts',
81
- '!./.wix/types/wix-code-types'
82
- ],
83
- gulp.series(
84
- 'fix-wixtypes'
85
- )
86
- );
87
- }
19
+ function watchBackend() {
20
+ return gulp.watch([
21
+ '*/backend/**/*.ts',
22
+ '*/backend/**/*.tsx',
23
+ '!*/backend/**/*.jsw.ts',
24
+ '!src/**/*',
25
+ ], gulp.parallel(
26
+ checkTs(options),
27
+ buildBackend(options),
28
+ ));
29
+ }
88
30
 
89
- export function watchAll(options: TaskOptions) {
90
- taskOptions = options;
31
+ function watchPublic() {
32
+ return gulp.watch([
33
+ '*/public/**/*.ts',
34
+ '*/public/**/*.tsx',
35
+ '!src/**/*',
36
+ ], gulp.parallel(
37
+ checkTs(options),
38
+ buildPublic(options),
39
+ ));
40
+ }
41
+
42
+ function watchPages() {
43
+ return gulp.watch(['typescript/pages/**/*.ts', '!src/**/*',],
44
+ gulp.parallel(
45
+ checkTs(options),
46
+ buildPages(options),
47
+ )
48
+ );
49
+ }
50
+
51
+ function watchFiles() {
52
+ return gulp.watch([
53
+ '*/backend/**/*',
54
+ '*/public/**/*',
55
+ '*/pages/**/*',
56
+ '!*/**/*.ts',
57
+ '!*/**/*.tsx',
58
+ '!src/**/*',
59
+ ], gulp.parallel(copyFiles(options)));
60
+ }
61
+
62
+ function watchTemplates() {
63
+ return gulp.watch([
64
+ '*/backend/templates/**/*.tsx',
65
+ '*/backend/templates/data/*.json',
66
+ '!*/backend/templates/render.ts',
67
+ '!src/**/*',
68
+ ], gulp.parallel(
69
+ previewTemplates(options),
70
+ checkTs(options),
71
+ )
72
+ );
73
+ }
74
+
75
+ function watchTypes() {
76
+ return gulp.watch([
77
+ './.wix/types/**/*.d.ts',
78
+ '!./.wix/types/wix-code-types',
79
+ '!src/**/*',
80
+ ],
81
+ gulp.series(
82
+ 'fix-wix-types'
83
+ )
84
+ );
85
+ }
86
+
91
87
  return gulp.parallel(
92
88
  watchSCSS,
93
89
  watchBackend,
@@ -1,32 +1,26 @@
1
1
  import { Effect, Schema } from "effect/index"
2
2
  import { Config } from "../config.js";
3
- import Enquirer from "enquirer";
4
3
  import { AppError } from "../error.js";
5
- import { createLucyHome } from "../commands/home.js";
6
- import { readLucyJsonFromTemplate } from "../commands/read.js";
7
- import { runTask } from "./Gulpfile.js";
4
+ import { task_runGulp } from "./Gulpfile.js";
5
+ import { task_syncSettings } from "./syncSettings.js";
6
+ import { setNeedsCleanup } from "../index.js";
8
7
 
9
8
 
10
- export const tasks = () => {
11
- return Effect.gen(function* (_) {
12
- const config = yield* Config;
13
- if(config.config.action.task === undefined) {
14
- return yield* Effect.fail(new AppError({ message: "No action task provided", cause: new Error("No action task provided") }));
15
- }
16
-
17
- if(
18
- config.config.action.task === 'dev'
19
- || config.config.action.task === 'build'
20
- || config.config.action.task === 'build-prod'
21
- || config.config.action.task === 'build-pipeline'
22
- ) {
23
- return yield* Effect.tryPromise({
24
- try: () => runTask(config.config),
25
- catch: (err: any) => {
26
- return new AppError({ message: err.message, cause: err });
27
- }
28
- });
29
- }
30
- yield* Effect.fail(new AppError({ message: `Unsupported action type: ${config.config.action.type}`, cause: new Error(`Unsupported action type: ${config.config.action.type}`) }));
31
- })
32
- }
9
+ export const tasks = Effect.gen(function* (_) {
10
+ const config = yield* Config;
11
+ if(config.config.action.tasksName === undefined) {
12
+ return yield* Effect.fail(new AppError({ message: "No task name provided", cause: new Error("No task name provided") }));
13
+ }
14
+ if(
15
+ config.config.action.tasksName === 'dev'
16
+ || config.config.action.tasksName === 'build'
17
+ || config.config.action.tasksName === 'build-prod'
18
+ || config.config.action.tasksName === 'build-pipeline'
19
+ )
20
+ {
21
+ setNeedsCleanup(true);
22
+ return yield* task_runGulp;
23
+ }
24
+ if(config.config.action.tasksName === 'sync-settings') return yield* task_syncSettings;
25
+ yield* Effect.fail(new AppError({ message: `Unsupported task type: ${config.config.action.tasksName}`, cause: new Error(`Unsupported task type: ${config.config.action.tasksName}`) }));
26
+ })
@@ -0,0 +1,21 @@
1
+ import { Effect } from "effect/index"
2
+ import { logger } from "../utils/logger.js";
3
+ import { Config } from "../config.js";
4
+ import { writeLucySettings } from "../commands/write.js";
5
+
6
+ export const task_syncSettings = Effect.gen(function*() {
7
+ const config = yield* Config;
8
+ logger.action("Syncing settings...");
9
+ if(config.config.lucySettings.initialized){
10
+ config.config.lucySettings.dependencies = config.config.packageJson.dependencies
11
+ config.config.lucySettings.devDependencies = config.config.packageJson.devDependencies
12
+ config.config.lucySettings.scripts = config.config.packageJson.scripts;
13
+ yield* writeLucySettings;
14
+
15
+ logger.success("Settings synced successfully.");
16
+ return;
17
+ }
18
+
19
+ logger.error("Lucy settings are not initialized. Please run 'lucy init' first.");
20
+ })
21
+
@@ -0,0 +1,24 @@
1
+ import { Effect, Schema } from "effect/index";
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ import { logger } from "../utils/logger.js";
5
+ import { createSDKClient } from "./client.js";
6
+
7
+ export const wix_sdk_check = Effect.gen(function* (_) {
8
+ const config = yield* Config;
9
+ const wixSDKSettings = config.config.wixSDKSettings;
10
+ if (!wixSDKSettings) return yield* Effect.fail(new AppError({ message: 'Wix SDK settings not found', cause: new Error('Wix SDK settings not found') }));
11
+ const client = yield* createSDKClient;
12
+
13
+ logger.action(`Checking if the SDK is working`);
14
+
15
+ const res = yield* Effect.tryPromise({
16
+ try: () => client.sites.countSites(),
17
+ catch: (e) => {
18
+ return new AppError({ cause: e, message: 'Error checking if the SDK is working' });
19
+ }
20
+ })
21
+ if(res.count) {
22
+ return logger.success(`SDK for site ${wixSDKSettings.siteId} is alive and working!`);
23
+ }
24
+ })
@@ -0,0 +1,18 @@
1
+ import { items, collections } from '@wix/data';
2
+ import { sites } from "@wix/sites";
3
+ import { createClient, ApiKeyStrategy } from '@wix/sdk';
4
+ import { Effect } from 'effect/index';
5
+ import { Config } from '../config.js';
6
+ import { AppError } from '../error.js';
7
+
8
+ export const createSDKClient = Effect.gen(function* (_) {
9
+ const config = yield* Config;
10
+ const wixSDKSettings = config.config.wixSDKSettings;
11
+ if (wixSDKSettings) {
12
+ return createClient({
13
+ modules: { items, collections, sites },
14
+ auth: ApiKeyStrategy(wixSDKSettings),
15
+ });
16
+ }
17
+ return yield* Effect.fail(new AppError({ message: "No API key provided", cause: new Error("No API key provided") }));
18
+ });
@@ -0,0 +1,17 @@
1
+ import { Effect, Schema } from "effect/index"
2
+ import { Config } from "../config.js";
3
+ import { AppError } from "../error.js";
4
+ import { wix_sdk_init } from "./init.js";
5
+
6
+
7
+ export const wix_sdk = Effect.gen(function* (_) {
8
+ const config = yield* Config;
9
+ if(config.config.action.wixSDKAction === undefined) {
10
+ return yield* Effect.fail(new AppError({ message: "No wix-sdk action provided", cause: new Error("No wix-sdk action provided") }));
11
+ }
12
+ if(config.config.action.wixSDKAction === 'init')
13
+ {
14
+ return yield* wix_sdk_init;
15
+ }
16
+ yield* Effect.fail(new AppError({ message: `Unsupported wix-sdk action type: ${config.config.action.syncAction}`, cause: new Error(`Unsupported wix-sdk action type: ${config.config.action.syncAction}`) }));
17
+ })