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,7 +1,7 @@
1
1
  import { Schema } from "effect/index";
2
- import { types } from "./types.js";
2
+ import { initTypes } from "./types.js";
3
3
 
4
- export const lucySettings = Schema.Struct({
4
+ export const lucySettings = Schema.mutable(Schema.Struct({
5
5
  modules: Schema.Record({
6
6
  key: Schema.String,
7
7
  value: Schema.Struct({
@@ -20,20 +20,21 @@ export const lucySettings = Schema.Struct({
20
20
  exclude: Schema.optional(Schema.Array(Schema.String)),
21
21
  }))),
22
22
  initialized: Schema.Boolean,
23
- type: Schema.Literal(...types),
24
- dependencies: Schema.Record({
23
+ type: Schema.Literal(...initTypes),
24
+ dependencies: Schema.mutable(Schema.Record({
25
25
  key: Schema.String,
26
26
  value: Schema.String,
27
- }),
28
- devDependencies: Schema.Record({
27
+ })),
28
+ devDependencies: Schema.mutable(Schema.Record({
29
29
  key: Schema.String,
30
30
  value: Schema.String,
31
- }),
31
+ })),
32
32
  scripts: Schema.Record({
33
33
  key: Schema.String,
34
34
  value: Schema.String,
35
35
  }),
36
36
  additionalCommands: Schema.optional(Schema.Array(Schema.Array(Schema.String))),
37
37
  additionalPkgProps: Schema.optional(Schema.Object),
38
- });
38
+ }));
39
+
39
40
  export type LucySettings = typeof lucySettings.Type;
@@ -1,12 +1,18 @@
1
- export const types = ["velo", "expo", "blocks", "monorepo", "tauri", "cargo", 'submodules'] as const;
2
- export const tasks = ["dev", "build", "build-prod", "build-pipeline"] as const;
1
+ export const initTypes = ["velo", "expo", "blocks", "monorepo", "tauri", "cargo", 'submodules', 'wix-sdk'] as const;
2
+ export const taskNames = ["dev", "build", "build-prod", "build-pipeline", "sync-settings"] as const;
3
+ export const syncActions = ["sync", "import", "init", "is-alive", "migrate", "export"] as const;
4
+ export const WixSDKActions = ["init", ""] as const;
5
+ export type Action = 'init' | 'open' | 'task' | 'wix-sync';
3
6
 
4
- export type Action = 'init' | 'open' | 'task';
7
+ export type SyncTaskType = (filename: string, collection: string, schemaFilename: string, importOnly: boolean, dryrun: boolean) => Promise<void>;
8
+ export type MigrateFileCache = () => Promise<void>;
5
9
 
6
10
  export type Actions = {
7
11
  action: Action;
8
- type?: typeof types[number];
9
- task?: typeof tasks[number];
12
+ initType?: typeof initTypes[number];
13
+ tasksName?: typeof taskNames[number];
14
+ syncAction?: typeof syncActions[number];
15
+ wixSDKAction?: typeof WixSDKActions[number];
10
16
  }
11
17
 
12
18
  export interface LucyArgs {
@@ -15,6 +21,18 @@ export interface LucyArgs {
15
21
  _: Action[];
16
22
  $0: string;
17
23
  // Arguments for the 'init' command
18
- type?: Actions['type'];
19
- task?: Actions['task'];
24
+ initType?: Actions['initType'];
25
+ tasksName?: Actions['tasksName'];
26
+ syncAction?: Actions['syncAction'];
27
+ wixSDKAction?: Actions['wixSDKAction'];
28
+ // wix-sync options
29
+ input?: string; // Alias for -f
30
+ collection?: string; // Alias for -c
31
+ schema?: string; // Alias for -s
32
+ d?: boolean;
20
33
  }
34
+
35
+ export interface VeloSyncConfig {
36
+ siteUrl: string;
37
+ secret: string;
38
+ }
@@ -22,231 +22,187 @@ import { addTypes, updateWixTypes } from './gulp/types.js';
22
22
  import { setProdConfig } from './gulp/pipeline.js';
23
23
  import { watchAll } from './gulp/watchers.js';
24
24
  import { getModulesSourcePaths } from './gulp/helpers.js';
25
- import { LucySettings } from '../schemas/lucy.js';
26
25
  import { logger } from '../utils/logger.js';
27
26
  import { Effect } from 'effect/index';
28
- import { ModuleSettings, ProjectSettings } from '../schemas/gulp.js';
29
- import { LucyConfig } from '../config.js';
27
+ import { Config } from '../config.js';
28
+ import { AppError } from '../error.js';
29
+ import { TaskOptions } from '../schemas/gulp.js';
30
30
 
31
31
  const sass = gulpSass(dartSass);
32
32
 
33
- export type TaskOptions = {
34
- moduleSettings?: ModuleSettings,
35
- projectSettings?: ProjectSettings
36
- enableIncrementalBuild: boolean;
37
- outputDir: string;
38
- sass: ReturnType<typeof gulpSass>;
39
- userHomeDir: string;
40
- replaceOptions: typeof replaceOptions;
41
- backendSettings: typeof backendSettings,
42
- masterSettings: typeof masterSettings,
43
- pageSettings: typeof pageSettings,
44
- publicSettings: typeof publicSettings,
45
- // modulesSync: Record<string, string> | undefined;
46
- modulesSourcePaths: string[];
47
- cwd: string;
48
- isWatching?: boolean;
49
- }
50
-
51
- export interface File {
52
- path: string;
53
- dirname: string;
54
- // other properties...
55
- }
56
-
57
- const outputDir = './src';
58
- const userHomeDir = os.homedir();
59
- const replaceOptions = {
60
- logs: {
61
- enabled: false
62
- }
63
- };
64
- export const taskOptions: TaskOptions = {
65
- enableIncrementalBuild: false,
66
- outputDir,
67
- sass,
68
- userHomeDir,
69
- pageSettings,
70
- publicSettings,
71
- backendSettings,
72
- masterSettings,
73
- replaceOptions,
74
- cwd: process.cwd(),
75
- // modulesSync: getModulesSync(),
76
- modulesSourcePaths: [],
77
- }
78
-
79
- const watchTaskOptions: TaskOptions = { ...taskOptions, isWatching: true };
80
-
81
- gulp.task('check-ts', gulp.parallel(
82
- checkTs(taskOptions),
83
- ));
84
-
85
- gulp.task('scss', gulp.parallel(
86
- compileScss(taskOptions),
87
- ));
88
-
89
- gulp.task('build-backend', gulp.parallel(
90
- buildBackend(taskOptions),
91
- buildBackendJSW(taskOptions),
92
- // buildBackendHTTP(taskOptions),
93
- ));
94
-
95
- gulp.task('build-public', gulp.parallel(
96
- buildPublic(taskOptions),
97
- ));
98
-
99
- gulp.task('preview-templates', gulp.parallel(
100
- previewTemplates(taskOptions),
101
- ));
102
-
103
- gulp.task('copy-files', gulp.parallel(
104
- copyFiles(taskOptions),
105
- ));
106
-
107
- gulp.task('test', function () {
108
- return shell.task(
109
- ['yarn test'],
110
- { ignoreErrors: true }
111
- )().then(() => {
112
- logger.success("Tests completed successfully.");
113
- }).catch(err => {
114
- logger.error("Error in test task!");
115
- });
116
- });
117
- gulp.task('test-ci', function () {
118
- return shell.task(
119
- ['yarn test --run'],
120
- { ignoreErrors: true }
121
- )().then(() => {
122
- logger.success("Tests completed successfully.");
123
- }).catch(err => {
124
- logger.error("Error in test task!");
125
- });
126
- });
127
-
128
- gulp.task('sync-types', shell.task([
129
- 'yarn postinstall',
130
- ]));
131
-
132
- gulp.task('fix-wixtypes', gulp.parallel(
133
- updateWixTypes(taskOptions)
134
- ));
135
-
136
- gulp.task('add-wix-types', function(done: gulp.TaskFunctionCallback) {
137
- return addTypes(taskOptions, done);
138
- });
139
-
140
- gulp.task('set-production', gulp.parallel(
141
- setProdConfig()
142
- ));
143
-
144
- gulp.task('start-wix', shell.task([
145
- 'yarn wix:dev',
146
- ]));
147
-
148
- gulp.task('gen-docs', shell.task([
149
- 'yarn docs',
150
- ]));
151
-
152
- gulp.task('fix-wix', gulp.series(
153
- cleanWix(),
154
- 'sync-types',
155
- 'fix-wixtypes',
156
- 'add-wix-types'
157
- ));
158
-
159
- gulp.task('build', gulp.parallel(
160
- 'build-backend',
161
- 'build-public',
162
- 'preview-templates',
163
- buildPages(taskOptions),
164
- compileScss(taskOptions),
165
- 'copy-files'
166
- )
167
- );
168
-
169
- gulp.task('build-pipeline', gulp.series(
170
- cleanSrc(taskOptions),
171
- 'set-production',
172
- 'check-ts',
173
- 'fix-wixtypes',
174
- 'add-wix-types',
175
- 'test-ci',
176
- 'build',
177
- ));
178
-
179
- gulp.task('build-prod', gulp.series(
180
- (done) => checkPages(true, false).then(() => done(), (err) => done(err)),
181
- cleanSrc(taskOptions),
182
- 'set-production',
183
- 'fix-wix',
184
- 'check-ts',
185
- 'test-ci',
186
- 'build-backend',
187
- 'build-public',
188
- buildPages(taskOptions),
189
- 'copy-files',
190
- compileScss(taskOptions),
191
- // 'gen-docs'
192
- ));
193
-
194
-
195
- gulp.task('start-dev-env', gulp.parallel(
196
- watchAll(watchTaskOptions),
197
- 'test',
198
- // 'start-wix',
199
- 'check-ts',
200
- (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
201
- ));
202
-
203
- gulp.task('dev', gulp.series(
204
- cleanSrc(taskOptions),
205
- 'fix-wix',
206
- 'build',
207
- 'start-dev-env',
208
- )
209
- );
210
-
211
- async function gulpTaskRunner(task: string) {
212
- return new Promise(function (resolve, reject) {
213
- gulp.series(task, (done) => {
214
- resolve(true);
215
- done();
216
- })(function (err) {
217
- if (err) {
218
- logger.error("Error starting tasks:", err);
219
- reject(err);
33
+ export const task_runGulp = Effect.gen(function* (_) {
34
+ const config = (yield* Config).config;
35
+ const task = config.action.tasksName || "dev";
36
+
37
+ const taskOptions: TaskOptions = {
38
+ enableIncrementalBuild: config.action.tasksName === 'dev' ? true : false,
39
+ outputDir: './src',
40
+ sass,
41
+ pageSettings,
42
+ publicSettings,
43
+ backendSettings,
44
+ masterSettings,
45
+ replaceOptions: {
46
+ logs: {
47
+ enabled: false
220
48
  }
49
+ },
50
+ cwd: process.cwd(),
51
+ modulesSourcePaths: yield* getModulesSourcePaths,
52
+ isWatching: config.action.tasksName === 'dev' ? true : false
53
+ };
54
+
55
+
56
+ logger.action(`Running task: ${task}`);
57
+
58
+ gulp.task('check-ts', gulp.parallel(
59
+ checkTs(taskOptions),
60
+ ));
61
+
62
+ gulp.task('scss', gulp.parallel(
63
+ compileScss(taskOptions),
64
+ ));
65
+
66
+ gulp.task('build-backend', gulp.parallel(
67
+ buildBackend(taskOptions),
68
+ buildBackendJSW(taskOptions),
69
+ // buildBackendHTTP(taskOptions),
70
+ ));
71
+
72
+ gulp.task('build-public', gulp.parallel(
73
+ buildPublic(taskOptions),
74
+ ));
75
+
76
+ gulp.task('preview-templates', gulp.parallel(
77
+ previewTemplates(taskOptions),
78
+ ));
79
+
80
+ gulp.task('copy-files', gulp.parallel(
81
+ copyFiles(taskOptions),
82
+ ));
83
+
84
+ gulp.task('test', function () {
85
+ return shell.task(
86
+ ['yarn test'],
87
+ { ignoreErrors: true }
88
+ )().then(() => {
89
+ logger.success("Tests completed successfully.");
90
+ }).catch(err => {
91
+ logger.error("Error in test task!");
221
92
  });
222
93
  });
223
- }
224
-
225
- export async function runTask(config: LucyConfig) {
226
- taskOptions.cwd = config.cwd;
227
- taskOptions.moduleSettings = {
228
- packageRoot: config.packageRoot,
229
- targetFolder: config.cwd,
230
- force: config.force,
231
- lucyConfigPath: join(config.cwd, "lucy.json"),
232
- packageJsonPath: join(config.cwd, "package.json"),
233
- settings: config.lucySettings,
234
- wixConfigPath: join(config.cwd, "wix.config.json"),
235
- veloConfigName: join(config.cwd, "jsconfig.json"),
236
- };
237
- taskOptions.modulesSourcePaths = getModulesSourcePaths(config);
238
- taskOptions.projectSettings = {
239
- modules: config.lucySettings.modules,
240
- lucySettings: config.lucySettings,
241
- packageJSON: config.packageJson,
242
- };
243
- const task = config.action.task || "dev";
244
- logger.action(`Running task: ${task} with options:`, taskOptions);
245
- try {
246
- await gulpTaskRunner(task || 'dev');
247
- } catch (err) {
248
- logger.error("Error starting tasks:", err);
249
- throw err;
250
- }
94
+ gulp.task('test-ci', function () {
95
+ return shell.task(
96
+ ['yarn test --run'],
97
+ { ignoreErrors: true }
98
+ )().then(() => {
99
+ logger.success("Tests completed successfully.");
100
+ }).catch(err => {
101
+ logger.error("Error in test task!");
102
+ });
103
+ });
104
+
105
+ gulp.task('sync-types', shell.task([
106
+ 'yarn postinstall',
107
+ ]));
108
+
109
+ gulp.task('fix-wix-types', gulp.parallel(
110
+ updateWixTypes(taskOptions)
111
+ ));
112
+
113
+ gulp.task('add-wix-types', function(done: gulp.TaskFunctionCallback) {
114
+ return addTypes(taskOptions, done);
115
+ });
116
+
117
+ gulp.task('set-production', gulp.parallel(
118
+ setProdConfig()
119
+ ));
120
+
121
+ gulp.task('start-wix', shell.task([
122
+ 'yarn wix:dev',
123
+ ]));
124
+
125
+ gulp.task('gen-docs', shell.task([
126
+ 'yarn docs',
127
+ ]));
128
+
129
+ gulp.task('fix-wix', gulp.series(
130
+ cleanWix(),
131
+ 'sync-types',
132
+ 'fix-wix-types',
133
+ 'add-wix-types'
134
+ ));
135
+
136
+ gulp.task('build', gulp.parallel(
137
+ 'build-backend',
138
+ 'build-public',
139
+ 'preview-templates',
140
+ buildPages(taskOptions),
141
+ compileScss(taskOptions),
142
+ 'copy-files'
143
+ )
144
+ );
145
+
146
+ gulp.task('build-pipeline', gulp.series(
147
+ cleanSrc(taskOptions),
148
+ 'set-production',
149
+ 'check-ts',
150
+ 'fix-wix-types',
151
+ 'add-wix-types',
152
+ 'test-ci',
153
+ 'build',
154
+ ));
155
+
156
+ gulp.task('build-prod', gulp.series(
157
+ (done) => checkPages(true, false).then(() => done(), (err) => done(err)),
158
+ cleanSrc(taskOptions),
159
+ 'set-production',
160
+ 'fix-wix',
161
+ 'check-ts',
162
+ 'test-ci',
163
+ 'build-backend',
164
+ 'build-public',
165
+ buildPages(taskOptions),
166
+ 'copy-files',
167
+ compileScss(taskOptions),
168
+ // 'gen-docs'
169
+ ));
170
+
171
+ gulp.task('start-dev-env', gulp.parallel(
172
+ watchAll(taskOptions),
173
+ 'test',
174
+ 'start-wix',
175
+ 'check-ts',
176
+ (done) => checkPages(false, config.force).then(() => done(), (err) => done(err)),
177
+ ));
178
+
179
+ gulp.task('dev', gulp.series(
180
+ cleanSrc(taskOptions),
181
+ 'fix-wix',
182
+ 'build',
183
+ 'start-dev-env',
184
+ )
185
+ );
186
+
187
+ yield* Effect.tryPromise({
188
+ try: () => {
189
+ return new Promise(function (resolve, reject) {
190
+ gulp.series(task, (done) => {
191
+ resolve(true);
192
+ done();
193
+ })(function (err) {
194
+ if (err) {
195
+ logger.error("Error starting tasks:", err);
196
+ reject(err);
197
+ }
198
+ });
199
+ });
200
+ },
201
+ catch: (e) => {
202
+ logger.error("Error starting tasks:", e);
203
+ return new AppError({ message: 'Error starting tasks', cause: e });
204
+ }
205
+ })
206
+
251
207
  logger.report("Task completed successfully:", task);
252
- }
208
+ });
@@ -1,9 +1,9 @@
1
1
  import gulp from 'gulp';
2
2
  import rename from 'gulp-rename';
3
3
  import * as path from 'path';
4
- import { TaskOptions } from '../Gulpfile.js';
5
4
  import swc from 'gulp-swc';
6
5
  import { logger } from '../../utils/logger.js';
6
+ import { TaskOptions } from '../../schemas/gulp.js';
7
7
 
8
8
  const swcOptions = {
9
9
  jsc: {
@@ -39,20 +39,20 @@ export function buildBackend(options: TaskOptions) {
39
39
  ])
40
40
  .pipe(swc(swcOptions))
41
41
  .on('error', function (e: Error) {
42
- logger.error(` => Build of Backend files for ${folder} failed!`);
43
- logger.error(` => Error: ${e.message}`);
42
+ logger.error(`Build of Backend files for ${folder} failed!`);
43
+ logger.error(`Error: ${e.message}`);
44
44
 
45
45
  this.emit('end');
46
46
  })
47
47
  .pipe(gulp.dest(path.join(outputDir, 'backend')))
48
48
  .on('error', function (e: Error) {
49
- logger.error(` => Build of Backend files for ${folder} failed!`);
50
- logger.error(` => Error: ${e.message}`);
49
+ logger.error(`Build of Backend files for ${folder} failed!`);
50
+ logger.error(`Error: ${e.message}`);
51
51
 
52
52
  this.emit('end');
53
53
  })
54
54
  .on('end', function () {
55
- logger.success(` => Build of Backend files for ${folder} succeeded!`);
55
+ logger.success(`Build of Backend files for ${folder} succeeded!`);
56
56
  });
57
57
 
58
58
  // Register the task with Gulp
@@ -85,21 +85,21 @@ export function buildBackendJSW(options: TaskOptions) {
85
85
  ])
86
86
  .pipe(swc(swcOptions))
87
87
  .on('error', function (e: Error) {
88
- logger.error(` => Build of JSW files for ${folder} failed!`);
89
- logger.error(` => Error: ${e.message}`);
88
+ logger.error(`Build of JSW files for ${folder} failed!`);
89
+ logger.error(`Error: ${e.message}`);
90
90
 
91
91
  this.emit('end');
92
92
  })
93
93
  .pipe(rename({ extname: '' }))
94
94
  .pipe(gulp.dest(path.join(outputDir, 'backend')))
95
95
  .on('error', function (e: Error) {
96
- logger.error(` => Build of JSW files for ${folder} failed!`);
97
- logger.error(` => Error: ${e.message}`);
96
+ logger.error(`Build of JSW files for ${folder} failed!`);
97
+ logger.error(`Error: ${e.message}`);
98
98
 
99
99
  this.emit('end');
100
100
  })
101
101
  .on('end', function () {
102
- logger.success(` => Build of JSW files for ${folder} succeeded!`);
102
+ logger.success(`Build of JSW files for ${folder} succeeded!`);
103
103
  });
104
104
 
105
105
  // Register the task with Gulp
@@ -4,8 +4,8 @@ import { glob } from 'glob';
4
4
  import * as path from 'path';
5
5
  import gulp from 'gulp';
6
6
  import ts from 'gulp-typescript';
7
- import { TaskOptions } from '../Gulpfile.js';
8
7
  import { blue, logger, red, yellow } from '../../utils/logger.js';
8
+ import { TaskOptions } from '../../schemas/gulp.js';
9
9
 
10
10
  // /**
11
11
  // * Extracts a match from a file
@@ -115,7 +115,8 @@ export async function checkPages(fail: boolean, force: boolean) {
115
115
  const obsoleteInTs = Array.from(tsPagesSet).filter((item: string) => !sourcePages.includes(item));
116
116
  if (missingInTs.length > 0){
117
117
  if(!force){
118
- logger.error('Missing pages in ts folder:', '\n', missingInTs);
118
+ const formattedList = missingInTs.map(page => ` • ${page}`).join('\n');
119
+ logger.error('Missing pages in ts folder::\n' + yellow(formattedList));
119
120
  }
120
121
  if(force) {
121
122
  for (const page of missingInTs) {
@@ -137,7 +138,7 @@ export async function checkPages(fail: boolean, force: boolean) {
137
138
  }
138
139
  }
139
140
  if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
140
- logger.info("All pages are in-sync!");
141
+ logger.success("All pages are in-sync!");
141
142
  } else if(fail){
142
143
  process.exit(1);
143
144
  };
@@ -1,7 +1,7 @@
1
1
  import gulp from 'gulp';
2
- import { TaskOptions } from '../Gulpfile.js';
3
2
  import clean from 'gulp-clean';
4
3
  import { logger } from '../../utils/logger.js';
4
+ import { TaskOptions } from '../../schemas/gulp.js';
5
5
 
6
6
  export function cleanWix() {
7
7
  return () => {
@@ -28,7 +28,7 @@ export function cleanSrc(options: TaskOptions) {
28
28
  .pipe(clean({ force: true }))
29
29
  .on('error', function (e: Error) {
30
30
  logger.error('Cleaning of output files failed!');
31
- logger.error(` => Error: ${e.message}`);
31
+ logger.error(`Error: ${e.message}`);
32
32
  this.emit('end');
33
33
  })
34
34
  .on('end', function() {
@@ -1,16 +1,12 @@
1
1
  import gulp from 'gulp';
2
- import { TaskOptions } from '../Gulpfile.js';
3
2
  import { logger } from '../../utils/logger.js';
3
+ import { TaskOptions } from '../../schemas/gulp.js';
4
4
 
5
5
  export function copyFiles(options: TaskOptions) {
6
6
  const folders = ['typescript', ...options.modulesSourcePaths];
7
-
8
- // Create tasks for each folder
9
7
  const tasks = folders.map((folder) => {
10
8
  const { outputDir} = options;
11
-
12
9
  const taskName = `copy-${folder}`; // Create a unique name for each task
13
-
14
10
  const task = () =>
15
11
  gulp.src([
16
12
  `${folder}/**/*`,
@@ -23,14 +19,12 @@ export function copyFiles(options: TaskOptions) {
23
19
  ])
24
20
  .pipe(gulp.dest(outputDir))
25
21
  .on('error', function (e: Error) {
26
- logger.error(` => Copy of files for ${folder} failed!`);
27
- logger.error(` => Error: ${e.message}`);
28
-
29
-
22
+ logger.error(`Copy of files for ${folder} failed!`);
23
+ logger.error(`Error: ${e.message}`);
30
24
  this.emit('end');
31
25
  })
32
26
  .on('end', function () {
33
- logger.success(` => Copy of files for ${folder} succeeded!`);
27
+ logger.success(`Copy of files for ${folder} succeeded!`);
34
28
  });
35
29
 
36
30
  // Register the task with Gulp
@@ -1,16 +1,9 @@
1
+ import { Effect } from 'effect/index';
2
+ import { Config } from '../../config.js';
1
3
 
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;
4
+ export const getModulesSourcePaths = Effect.gen(function* () {
5
+ const config = yield* Config
6
+ const data = config.config.lucySettings.modules;
14
7
  const paths: string[] = [];
15
8
  for (const module of Object.keys(data)) {
16
9
  if (!data[module].noCompile) {
@@ -22,4 +15,4 @@ export function getModulesSourcePaths(config: LucyConfig): string[] {
22
15
  }
23
16
  }
24
17
  return paths;
25
- }
18
+ });
@@ -1,8 +1,8 @@
1
1
  import gulp from 'gulp';
2
- import { TaskOptions } from '../Gulpfile.js';
3
2
  import * as path from 'path';
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: {