lucy-cli 2.0.0-beta.13 → 2.0.0-beta.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 (172) hide show
  1. package/package.json +7 -2
  2. package/.cursorignore +0 -4
  3. package/.eslintrc.cjs +0 -96
  4. package/.github/funding.yml +0 -2
  5. package/.nvmrc +0 -1
  6. package/.stylelintrc.js +0 -8
  7. package/.wix/debug.log +0 -10
  8. package/.yarnrc.yml +0 -2
  9. package/files/sync-data/data/test.csv +0 -17
  10. package/files/sync-data/files/lucy.jpg +0 -0
  11. package/files/sync-data/schema/test.json +0 -11
  12. package/lucy.jpg +0 -0
  13. package/mitarbeiter-login.html +0 -188
  14. package/old/Gulpfile.d.ts +0 -34
  15. package/old/Gulpfile.js +0 -116
  16. package/old/Gulpfile.js.map +0 -1
  17. package/old/Gulpfile.ts +0 -231
  18. package/old/gulp/backend.d.ts +0 -3
  19. package/old/gulp/backend.js +0 -92
  20. package/old/gulp/backend.js.map +0 -1
  21. package/old/gulp/backend.ts +0 -109
  22. package/old/gulp/checks.d.ts +0 -3
  23. package/old/gulp/checks.js +0 -205
  24. package/old/gulp/checks.js.map +0 -1
  25. package/old/gulp/checks.ts +0 -228
  26. package/old/gulp/clean.d.ts +0 -3
  27. package/old/gulp/clean.js +0 -29
  28. package/old/gulp/clean.js.map +0 -1
  29. package/old/gulp/clean.ts +0 -33
  30. package/old/gulp/copy.d.ts +0 -2
  31. package/old/gulp/copy.js +0 -34
  32. package/old/gulp/copy.js.map +0 -1
  33. package/old/gulp/copy.ts +0 -42
  34. package/old/gulp/helpers.d.ts +0 -2
  35. package/old/gulp/helpers.js +0 -25
  36. package/old/gulp/helpers.js.map +0 -1
  37. package/old/gulp/helpers.ts +0 -26
  38. package/old/gulp/pages.d.ts +0 -2
  39. package/old/gulp/pages.js +0 -37
  40. package/old/gulp/pages.js.map +0 -1
  41. package/old/gulp/pages.ts +0 -40
  42. package/old/gulp/pipeline.d.ts +0 -1
  43. package/old/gulp/pipeline.js +0 -29
  44. package/old/gulp/pipeline.js.map +0 -1
  45. package/old/gulp/pipeline.ts +0 -31
  46. package/old/gulp/public.d.ts +0 -2
  47. package/old/gulp/public.js +0 -50
  48. package/old/gulp/public.js.map +0 -1
  49. package/old/gulp/public.ts +0 -59
  50. package/old/gulp/styles.d.ts +0 -2
  51. package/old/gulp/styles.js +0 -40
  52. package/old/gulp/styles.js.map +0 -1
  53. package/old/gulp/styles.ts +0 -46
  54. package/old/gulp/templates.d.ts +0 -2
  55. package/old/gulp/templates.js +0 -33
  56. package/old/gulp/templates.js.map +0 -1
  57. package/old/gulp/templates.ts +0 -39
  58. package/old/gulp/types.d.ts +0 -4
  59. package/old/gulp/types.js +0 -289
  60. package/old/gulp/types.js.map +0 -1
  61. package/old/gulp/types.ts +0 -311
  62. package/old/gulp/watchers.d.ts +0 -9
  63. package/old/gulp/watchers.js +0 -59
  64. package/old/gulp/watchers.js.map +0 -1
  65. package/old/gulp/watchers.ts +0 -105
  66. package/old/helpers.d.ts +0 -32
  67. package/old/helpers.js +0 -267
  68. package/old/helpers.js.map +0 -1
  69. package/old/helpers.ts +0 -307
  70. package/old/index.d.ts +0 -59
  71. package/old/index.js +0 -288
  72. package/old/index.js.map +0 -1
  73. package/old/index.ts +0 -379
  74. package/old/init.d.ts +0 -8
  75. package/old/init.js +0 -165
  76. package/old/init.js.map +0 -1
  77. package/old/init.ts +0 -183
  78. package/old/models.d.ts +0 -37
  79. package/old/models.js +0 -2
  80. package/old/models.js.map +0 -1
  81. package/old/models.ts +0 -35
  82. package/old/prepare.d.ts +0 -8
  83. package/old/prepare.js +0 -20
  84. package/old/prepare.js.map +0 -1
  85. package/old/prepare.ts +0 -24
  86. package/old/schemas/index.d.ts +0 -0
  87. package/old/schemas/index.js +0 -2
  88. package/old/schemas/index.js.map +0 -1
  89. package/old/schemas/index.ts +0 -0
  90. package/old/schemas/types.d.ts +0 -0
  91. package/old/schemas/types.js +0 -2
  92. package/old/schemas/types.js.map +0 -1
  93. package/old/schemas/types.ts +0 -0
  94. package/old/settings.json +0 -67
  95. package/old/sync.d.ts +0 -2
  96. package/old/sync.js +0 -88
  97. package/old/sync.js.map +0 -1
  98. package/old/sync.ts +0 -97
  99. package/old/types.d.ts +0 -8
  100. package/pnpm-workspace.yaml +0 -6
  101. package/settings/backend-settings.json +0 -19
  102. package/settings/master-settings.json +0 -20
  103. package/settings/page-settings.json +0 -21
  104. package/settings/public-settings.json +0 -22
  105. package/src/args.ts +0 -121
  106. package/src/commands/checks.ts +0 -51
  107. package/src/commands/cleanup.ts +0 -11
  108. package/src/commands/copy.ts +0 -29
  109. package/src/commands/edit.ts +0 -81
  110. package/src/commands/exec.ts +0 -73
  111. package/src/commands/git.ts +0 -152
  112. package/src/commands/home.ts +0 -20
  113. package/src/commands/install.ts +0 -269
  114. package/src/commands/read.ts +0 -45
  115. package/src/commands/write.ts +0 -45
  116. package/src/commands.ts +0 -21
  117. package/src/config.ts +0 -142
  118. package/src/error.ts +0 -3
  119. package/src/helpers.ts +0 -93
  120. package/src/index.ts +0 -113
  121. package/src/init/blocks.ts +0 -85
  122. package/src/init/cargo.ts +0 -25
  123. package/src/init/expo.ts +0 -69
  124. package/src/init/gitModules.ts +0 -15
  125. package/src/init/index.ts +0 -86
  126. package/src/init/monorepo.ts +0 -72
  127. package/src/init/prepareVelo.ts +0 -19
  128. package/src/init/tauri.ts +0 -42
  129. package/src/init/templates.ts +0 -98
  130. package/src/init/velo.ts +0 -66
  131. package/src/policy.ts +0 -6
  132. package/src/prepare.ts +0 -24
  133. package/src/runtime.ts +0 -21
  134. package/src/schemas/gulp.ts +0 -31
  135. package/src/schemas/index.ts +0 -17
  136. package/src/schemas/lucy.ts +0 -43
  137. package/src/schemas/tsconfig.ts +0 -35
  138. package/src/schemas/types.ts +0 -40
  139. package/src/settings.json +0 -67
  140. package/src/states.ts +0 -15
  141. package/src/tasks/Gulpfile.ts +0 -207
  142. package/src/tasks/gulp/backend.ts +0 -113
  143. package/src/tasks/gulp/checks.ts +0 -219
  144. package/src/tasks/gulp/clean.ts +0 -38
  145. package/src/tasks/gulp/copy.ts +0 -38
  146. package/src/tasks/gulp/helpers.ts +0 -18
  147. package/src/tasks/gulp/pages.ts +0 -43
  148. package/src/tasks/gulp/pipeline.ts +0 -31
  149. package/src/tasks/gulp/public.ts +0 -61
  150. package/src/tasks/gulp/styles.ts +0 -47
  151. package/src/tasks/gulp/templates.ts +0 -53
  152. package/src/tasks/gulp/types.ts +0 -310
  153. package/src/tasks/gulp/watchers.ts +0 -97
  154. package/src/tasks/index.ts +0 -24
  155. package/src/tasks/syncSettings.ts +0 -21
  156. package/src/types.d.ts +0 -8
  157. package/src/utils/index.ts +0 -0
  158. package/src/utils/logger.ts +0 -40
  159. package/src/wix-sdk/check.ts +0 -24
  160. package/src/wix-sdk/client.ts +0 -18
  161. package/src/wix-sdk/index.ts +0 -17
  162. package/src/wix-sdk/init.ts +0 -54
  163. package/src/wix-sdk/run.ts +0 -56
  164. package/src/wix-sync/client.ts +0 -6
  165. package/src/wix-sync/export.ts +0 -19
  166. package/src/wix-sync/import.ts +0 -27
  167. package/src/wix-sync/index.ts +0 -36
  168. package/src/wix-sync/init.ts +0 -77
  169. package/src/wix-sync/is-alive.ts +0 -25
  170. package/src/wix-sync/migrate.ts +0 -23
  171. package/src/wix-sync/sync.ts +0 -27
  172. package/tsconfig.json +0 -34
package/old/gulp/types.ts DELETED
@@ -1,311 +0,0 @@
1
- import gulp from 'gulp';
2
- import * as path from 'path';
3
- import { File, TaskOptions } from '../Gulpfile';
4
- import replace from 'gulp-string-replace';
5
- import foreach from 'gulp-foreach';
6
- import flatmap from 'gulp-flatmap';
7
- import jeditor from 'gulp-json-editor';
8
- import merge from 'merge-stream';
9
- import * as insert from 'gulp-insert';
10
- import { blue, orange, red, yellow } from '../index.js';
11
- import tap from 'gulp-tap';
12
- import { TSConfig } from '../models';
13
-
14
- export function updateWixTypes(options: TaskOptions) {
15
- return () => {
16
- const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
17
- let count = 0;
18
-
19
- const modules: Record<string, string> = Object.assign({}, options.projectSettings?.modules, options.projectSettings?.lucySettings?.modules);
20
-
21
- let localModules: Record<string, string> | undefined = undefined;
22
- if(options.projectSettings?.lucySettings) {
23
- localModules = options.projectSettings.lucySettings.modules as unknown as Record<string, string>;
24
- }
25
- // Add module to publicSettings
26
- publicSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
27
- publicSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
28
- publicSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
29
- publicSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
30
- publicSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
31
- publicSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
32
- publicSettings.compilerOptions.paths['public/*'] = [ "../../../typescript/public/*.ts" ] as never;
33
- publicSettings.include = [
34
- "../../../typescript/public/**/*",
35
- "../../../typescript/__mocks__/**/*",
36
- // "../../../typescript/backend/**/*.jsw.ts",
37
- // "../../../typescript/backend/**/*.web.ts",
38
- // "../../../typescript/backend/**/*.web"
39
- ] as never;
40
-
41
- // Add module to backendSettings
42
- backendSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
43
- backendSettings.compilerOptions.paths['types/*'] = [ `../../../typescript/types/*` ] as never;
44
- backendSettings.include = [
45
- "../../../typescript/backend/**/*",
46
- "../../../typescript/__mocks__/**/*",
47
- // "../../../typescript/backend/**/*.jsw.ts",
48
- // "../../../typescript/backend/**/*.web.ts",
49
- // "../../../typescript/backend/**/*.web"
50
- ] as never;
51
- // Add module to masterSettings
52
- masterSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
53
- masterSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
54
- masterSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
55
- masterSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
56
- masterSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
57
- masterSettings.include = [
58
- "../../../typescript/public/**/*",
59
- "../../../typescript/__mocks__/**/*",
60
- // "../../../typescript/backend/**/*.jsw.ts",
61
- // "../../../typescript/backend/**/*.web.ts",
62
- // "../../../typescript/backend/**/*.web"
63
- ] as never;
64
- // Add module to pageSettings
65
- pageSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
66
- pageSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
67
- pageSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
68
- pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
69
- pageSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
70
- pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
71
- pageSettings.include = [
72
- "../../../typescript/public/**/*",
73
- "../../../typescript/__mocks__/**/*",
74
- // "../../../typescript/backend/**/*.jsw.ts",
75
- // "../../../typescript/backend/**/*.web.ts",
76
- // "../../../typescript/backend/**/*.web"
77
- ] as never;
78
-
79
- if (modules) {
80
- for (const [name] of Object.entries(modules)) {
81
- // Add module to publicSettings
82
- publicSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
83
- publicSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
84
- publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
85
- publicSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
86
- publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
87
- publicSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` as never ]);
88
- publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
89
- publicSettings.include.push(...[
90
- `../../../${name}/public/**/*`,
91
- `../../../${name}__mocks__/**/*`,
92
- // `../../../${name}/backend/**/*.jsw.ts`,
93
- // `../../../${name}/backend/**/*.web.ts`,
94
- // `../../../${name}/backend/**/*.web`
95
- ] as never[]);
96
- // Add module to backendSettings
97
- backendSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
98
- backendSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
99
- backendSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` ] as never[]);
100
- backendSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
101
- backendSettings.include.push(...[
102
- `../../../${name}/public/**/*`,
103
- `../../../${name}__mocks__/**/*`,
104
- `../../../${name}/backend/**/*`,
105
- // `../../../${name}/backend/**/*.jsw.ts`,
106
- // `../../../${name}/backend/**/*.web.ts`,
107
- // `../../../${name}/backend/**/*.web`
108
- ] as never[]);
109
- // Add module to masterSettings
110
- masterSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
111
- masterSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
112
- masterSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
113
- masterSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
114
- masterSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
115
- masterSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
116
- masterSettings.include.push(...[
117
- `../../../${name}/public/**/*`,
118
- `../../../${name}__mocks__/**/*`,
119
- // `../../../${name}/backend/**/*.jsw.ts`,
120
- // `../../../${name}/backend/**/*.web.ts`,
121
- // `../../../${name}/backend/**/*.web`
122
- ] as never[]);
123
- // Add module to pageSettings
124
- pageSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
125
- pageSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
126
- pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
127
- pageSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
128
- pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
129
- pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
130
- pageSettings.include.push(...[
131
- `../../../${name}/public/**/*`,
132
- `../../../${name}__mocks__/**/*`,
133
- // `../../../${name}/backend/**/*.jsw.ts`,
134
- // `../../../${name}/backend/**/*.web.ts`,
135
- // `../../../${name}/backend/**/*.web`
136
- ] as never[]);
137
- }
138
- }
139
-
140
- return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/**/*'])
141
- .pipe(flatmap(function(stream: NodeJS.ReadableStream, file: File) {
142
- count ++;
143
- if (file.dirname.endsWith('public')) {
144
- return stream.pipe(jeditor(publicSettings))
145
- .pipe(jeditor((json: any) => cleanTsConfig(json)))
146
- .pipe(jeditor((json: any) => processJson(json)))
147
- .pipe(replace('"../backend.d.ts",', '', replaceOptions))
148
- .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
149
- }
150
- if (file.dirname.endsWith('backend')) {
151
- return stream.pipe(jeditor(backendSettings))
152
- .pipe(jeditor((json: any) => cleanTsConfig(json)))
153
- .pipe(jeditor((json: any) => processJson(json)))
154
- };
155
- if (file.dirname.endsWith('masterPage')) {
156
- return stream.pipe(jeditor(masterSettings))
157
- .pipe(jeditor((json: any) => cleanTsConfig(json)))
158
- .pipe(jeditor((json: any) => processJson(json)))
159
- .pipe(replace('"../backend.d.ts",', '', replaceOptions))
160
- .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
161
- };
162
-
163
- return stream.pipe(jeditor(pageSettings))
164
- .pipe(jeditor((json: any) => cleanTsConfig(json)))
165
- .pipe(jeditor((json: any) => processJson(json)))
166
- .pipe(replace('"../backend.d.ts",', '', replaceOptions))
167
- .pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
168
- }))
169
- .pipe(replace('masterPage.masterPage.js', 'masterPage.ts', replaceOptions))
170
- .pipe(replace('/src/', '/typescript/', replaceOptions))
171
- .pipe(replace('.js"', '.ts"', replaceOptions))
172
- .pipe(tap(function(file) { // tap into the stream to log the output
173
- // console.debug(file.contents?.toString() ?? 'no content'); TODO: Uncomment when needed
174
- }))
175
- .pipe(gulp.dest((file: File) => {
176
- const filePath = file.dirname;
177
- const outputDir = path.dirname(filePath);
178
-
179
- return path.join(outputDir);
180
- }))
181
- .on('error', function (e: Error) {
182
- console.log("💩" + red.underline.bold('Modification of WIX configs failed!'));
183
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
184
- this.emit('end');
185
- })
186
- .on('end', function() { console.log("🐶" + blue.underline(`Modification of ${yellow(count)} WIX configs succeeded!`)); });
187
- }
188
- }
189
-
190
- export function addTypes(options: TaskOptions, done: gulp.TaskFunctionCallback): NodeJS.ReadWriteStream {
191
- const { replaceOptions } = options;
192
-
193
- // Regex to match keywords at the beginning of a line, capturing any leading whitespace.
194
- // The 'm' flag is for multiline matching (^ matches start of line).
195
- // The 'g' flag is for global matching (replace all instances).
196
- const interfaceRegex = /^(\s*)interface\s/gm;
197
- const enumRegex = /^(\s*)enum\s/gm;
198
- const typeRegex = /^(\s*)type\s/gm;
199
-
200
- const exportTypes = gulp.src(['./.wix/types/wix-code-types/dist/types/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
201
- // The replacement string '$1export...' uses the captured whitespace to preserve indentation.
202
- .pipe(replace(interfaceRegex, 'export interface ', replaceOptions))
203
- .pipe(replace(enumRegex, 'export enum ', replaceOptions))
204
- .pipe(replace(typeRegex, 'export type ', replaceOptions))
205
- .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'));
206
-
207
- const exportTypesBeta = gulp.src(['./.wix/types/wix-code-types/dist/types/beta/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/beta/common/$w.d.ts'])
208
- .pipe(replace(interfaceRegex, '$1export interface ', replaceOptions))
209
- .pipe(replace(enumRegex, 'export enum ', replaceOptions))
210
- .pipe(replace(typeRegex, 'export type ', replaceOptions))
211
- .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/beta/common/'));
212
-
213
- const processCommon = gulp.src(['./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
214
- .pipe(insert.prepend("import '@total-typescript/ts-reset';\n"))
215
- .pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'));
216
-
217
- return merge(
218
- processCommon,
219
- exportTypesBeta,
220
- exportTypes,
221
- )
222
- .on('error', function(e: Error) {
223
- console.log("💩" + red.underline.bold(' => Updating WIX failed!'));
224
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
225
- this.emit('end');
226
- done();
227
- })
228
- .on('end', function() {
229
- console.log("🐶" + blue.underline(' => Updating WIX succeeded!'));
230
- done();
231
- });
232
- };
233
-
234
- function makeHashable(obj: any): any {
235
- if (Array.isArray(obj)) {
236
- return obj.map(makeHashable);
237
- } else if (obj && typeof obj === 'object') {
238
- const sortedKeys = Object.keys(obj).sort();
239
- const result: any = {};
240
- for (const key of sortedKeys) {
241
- result[key] = makeHashable(obj[key]);
242
- }
243
- return result;
244
- } else {
245
- return obj;
246
- }
247
- }
248
-
249
- function removeDuplicatesFromArray(arr: any[]): any[] {
250
- const seen = new Set<string>();
251
- const newArr: any[] = [];
252
-
253
- for (const item of arr) {
254
- const processedItem = processJson(item); // Recursively process the item
255
- const hashableItem = makeHashable(processedItem);
256
- const serializedItem = JSON.stringify(hashableItem);
257
-
258
- if (!seen.has(serializedItem)) {
259
- seen.add(serializedItem);
260
- newArr.push(processedItem);
261
- }
262
- }
263
- return newArr;
264
- }
265
-
266
- function processJson(obj: any): any {
267
- if (Array.isArray(obj)) {
268
- // Process arrays and remove duplicate items
269
- const uniqueArray = removeDuplicatesFromArray(obj);
270
- return uniqueArray.length > 0 ? uniqueArray : undefined; // Remove empty arrays
271
- } else if (obj && typeof obj === 'object') {
272
- // Process objects, ensuring keys are unique
273
- const result: any = {};
274
- const seenKeys = new Set<string>();
275
-
276
- for (const key in obj) {
277
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
278
- if (!seenKeys.has(key)) {
279
- const processedValue = processJson(obj[key]);
280
- if (processedValue !== undefined) { // Remove keys with undefined values
281
- seenKeys.add(key);
282
- result[key] = processedValue;
283
- }
284
- }
285
- }
286
- }
287
-
288
- // If all keys were empty or undefined, return undefined
289
- return Object.keys(result).length > 0 ? result : undefined;
290
- } else {
291
- // Return primitive values as-is
292
- return obj;
293
- }
294
- }
295
-
296
- function cleanTsConfig(json: TSConfig): TSConfig {
297
- // const paths: Record<string, string[]> = {};
298
- if (json.compilerOptions?.paths) {
299
- for (const [key, value] of Object.entries(json.compilerOptions.paths)) {
300
- const uniquePaths = new Set(value);
301
- json.compilerOptions.paths[key] = Array.from(uniquePaths);
302
- // paths[key] = Array.from(uniquePaths);
303
- }
304
- // json.compilerOptions.paths = paths;
305
- }
306
- json.include = Array.from(new Set(json.include));
307
- json.exclude = Array.from(new Set(json.exclude));
308
- json.files = Array.from(new Set(json.files));
309
-
310
- return json;
311
- }
@@ -1,9 +0,0 @@
1
- import { TaskOptions } from '../Gulpfile.js';
2
- export declare function watchSCSS(): import("fs").FSWatcher;
3
- export declare function watchBackend(): import("fs").FSWatcher;
4
- export declare function watchPublic(): import("fs").FSWatcher;
5
- export declare function watchPages(): import("fs").FSWatcher;
6
- export declare function watchFiles(): import("fs").FSWatcher;
7
- export declare function watchTemplates(): import("fs").FSWatcher;
8
- export declare function watchTypes(): import("fs").FSWatcher;
9
- export declare function watchAll(options: TaskOptions): import("undertaker").TaskFunction;
@@ -1,59 +0,0 @@
1
- import gulp from 'gulp';
2
- import { green } from '../index.js';
3
- import { buildBackend } from './backend.js';
4
- import { buildPublic } from './public.js';
5
- import { buildPages } from './pages.js';
6
- import { copyFiles } from './copy.js';
7
- import { previewTemplates } from './templates.js';
8
- import { checkTs } from './checks.js';
9
- let taskOptions;
10
- export function watchSCSS() {
11
- return gulp.watch([
12
- '*/styles/**/*.scss'
13
- ], gulp.parallel('scss'));
14
- }
15
- export function watchBackend() {
16
- return gulp.watch([
17
- '*/backend/**/*.ts',
18
- '*/backend/**/*.tsx',
19
- '!*/backend/**/*.jsw.ts',
20
- '!src/**/**',
21
- ], gulp.parallel(checkTs(taskOptions), buildBackend(taskOptions)));
22
- }
23
- export function watchPublic() {
24
- return gulp.watch([
25
- '*/public/**/*.ts',
26
- '*/public/**/*.tsx',
27
- ], gulp.parallel(checkTs(taskOptions), buildPublic(taskOptions)));
28
- }
29
- export function watchPages() {
30
- return gulp.watch('typescript/pages/**/*.ts', gulp.parallel(checkTs(taskOptions), buildPages(taskOptions)));
31
- }
32
- export function watchFiles() {
33
- return gulp.watch([
34
- '*/backend/**/*',
35
- '*/public/**/*',
36
- '*/pages/**/*',
37
- '!*/**/*.ts',
38
- '!*/**/*.tsx',
39
- ], gulp.parallel(copyFiles(taskOptions)));
40
- }
41
- export function watchTemplates() {
42
- return gulp.watch([
43
- '*/backend/templates/**/*.tsx',
44
- '*/backend/templates/data/*.json',
45
- '!*/backend/templates/render.ts',
46
- ], gulp.parallel(previewTemplates(taskOptions), checkTs(taskOptions)));
47
- }
48
- export function watchTypes() {
49
- return gulp.watch([
50
- './.wix/types/**/*.d.ts',
51
- '!./.wix/types/wix-code-types'
52
- ], gulp.series('fix-wixtypes'));
53
- }
54
- export function watchAll(options) {
55
- taskOptions = options;
56
- console.log("🐕" + green.underline.bold(' => Adding watchers...'));
57
- return gulp.parallel(watchSCSS, watchBackend, watchPublic, watchPages, watchFiles, watchTemplates, watchTypes);
58
- }
59
- //# sourceMappingURL=watchers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"watchers.js","sourceRoot":"","sources":["watchers.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAc,OAAO,EAAE,MAAM,aAAa,CAAC;AAGlD,IAAI,WAAwB,CAAC;AAE7B,MAAM,UAAU,SAAS;IACrB,OAAO,IAAI,CAAC,KAAK,CAAC;QACd,oBAAoB;KACvB,EACG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CACxB,CAAC;AACN,CAAC;AAED,MAAM,UAAU,YAAY;IACxB,OAAQ,IAAI,CAAC,KAAK,CAAC;QACrB,mBAAmB;QACnB,oBAAoB;QACd,wBAAwB;QACxB,YAAY;KAClB,EAAE,IAAI,CAAC,QAAQ,CACT,OAAO,CAAC,WAAW,CAAC,EACpB,YAAY,CAAC,WAAW,CAAC,CAI5B,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,WAAW;IACvB,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,kBAAkB;QAClB,mBAAmB;KACnB,EAAE,IAAI,CAAC,QAAQ,CACT,OAAO,CAAC,WAAW,CAAC,EACpB,WAAW,CAAC,WAAW,CAAC,CAI3B,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,UAAU;IACtB,OAAQ,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAC7C,IAAI,CAAC,QAAQ,CACT,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,CAAC,WAAW,CAAC,CACtB,CACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU;IACtB,OAAQ,IAAI,CAAC,KAAK,CAAC;QACrB,gBAAgB;QAChB,eAAe;QACf,cAAc;QACd,YAAY;QACN,aAAa;KACnB,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,cAAc;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,8BAA8B;QAC9B,iCAAiC;QACjC,gCAAgC;KAChC,EAAE,IAAI,CAAC,QAAQ,CACT,gBAAgB,CAAC,WAAW,CAAC,EAC7B,OAAO,CAAC,WAAW,CAAC,CACnB,CACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU;IACtB,OAAO,IAAI,CAAC,KAAK,CAAC;QACd,wBAAwB;QACxB,8BAA8B;KACjC,EACD,IAAI,CAAC,MAAM,CACP,cAAc,CACb,CACJ,CAAC;AACN,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAoB;IACzC,WAAW,GAAG,OAAO,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAEnE,OAAO,IAAI,CAAC,QAAQ,CAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,CACb,CAAC;AACN,CAAC"}
@@ -1,105 +0,0 @@
1
- import gulp from 'gulp';
2
- import { TaskOptions } from '../Gulpfile.js';
3
- import { green } from '../index.js';
4
- import { buildBackend, buildBackendJSW } from './backend.js';
5
- import { buildPublic } from './public.js';
6
- import { buildPages } from './pages.js';
7
- import { copyFiles } from './copy.js';
8
- import { previewTemplates } from './templates.js';
9
- import { checkPages, checkTs } from './checks.js';
10
- import shell from 'gulp-shell';
11
-
12
- let taskOptions: TaskOptions;
13
-
14
- export function watchSCSS() {
15
- return gulp.watch([
16
- '*/styles/**/*.scss'
17
- ],
18
- gulp.parallel('scss')
19
- );
20
- }
21
-
22
- export function watchBackend() {
23
- return gulp.watch([
24
- '*/backend/**/*.ts',
25
- '*/backend/**/*.tsx',
26
- '!*/backend/**/*.jsw.ts',
27
- '!src/**/**',
28
- ], gulp.parallel(
29
- checkTs(taskOptions),
30
- buildBackend(taskOptions),
31
- // shell.task([
32
- // 'yarn docs',
33
- // ])
34
- ));
35
- }
36
-
37
- export function watchPublic() {
38
- return gulp.watch([
39
- '*/public/**/*.ts',
40
- '*/public/**/*.tsx',
41
- ], gulp.parallel(
42
- checkTs(taskOptions),
43
- buildPublic(taskOptions),
44
- // shell.task([
45
- // 'yarn docs',
46
- // ])
47
- ));
48
- }
49
-
50
- export function watchPages() {
51
- return gulp.watch('typescript/pages/**/*.ts',
52
- gulp.parallel(
53
- checkTs(taskOptions),
54
- buildPages(taskOptions),
55
- )
56
- );
57
- }
58
-
59
- export function watchFiles() {
60
- return gulp.watch([
61
- '*/backend/**/*',
62
- '*/public/**/*',
63
- '*/pages/**/*',
64
- '!*/**/*.ts',
65
- '!*/**/*.tsx',
66
- ], gulp.parallel(copyFiles(taskOptions)));
67
- }
68
-
69
- export function watchTemplates() {
70
- return gulp.watch([
71
- '*/backend/templates/**/*.tsx',
72
- '*/backend/templates/data/*.json',
73
- '!*/backend/templates/render.ts',
74
- ], gulp.parallel(
75
- previewTemplates(taskOptions),
76
- checkTs(taskOptions),
77
- )
78
- );
79
- }
80
-
81
- export function watchTypes() {
82
- return gulp.watch([
83
- './.wix/types/**/*.d.ts',
84
- '!./.wix/types/wix-code-types'
85
- ],
86
- gulp.series(
87
- 'fix-wixtypes'
88
- )
89
- );
90
- }
91
-
92
- export function watchAll(options: TaskOptions) {
93
- taskOptions = options;
94
- console.log("🐕" + green.underline.bold(' => Adding watchers...'));
95
-
96
- return gulp.parallel(
97
- watchSCSS,
98
- watchBackend,
99
- watchPublic,
100
- watchPages,
101
- watchFiles,
102
- watchTemplates,
103
- watchTypes,
104
- );
105
- }
package/old/helpers.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import { LucySettings, ModuleSettings, ProjectSettings } from './index.js';
2
- export declare function installPackages(wixPackages: Record<string, string>, devPackages: Record<string, string>, cwd: string, locked: boolean): Promise<void>;
3
- export declare function gitInit(cwd: string, modules: LucySettings['modules'] | undefined, force: boolean): Promise<void>;
4
- export declare function runGulp(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string): Promise<void>;
5
- /**
6
- * Clean up and run a command before exiting the process.
7
- */
8
- export declare function cleanupWatchers(): void;
9
- /**
10
- * Kill all processes matching a specific substring in their command, with a fallback for Windows.
11
- * @param {string} processPattern - The substring to match (e.g., "wix:dev" or "@wix/cli/bin/wix.cjs").
12
- */
13
- export declare function killAllProcesses(processPattern: string): void;
14
- export interface VeloSyncConfig {
15
- siteUrl: string;
16
- secret: string;
17
- }
18
- export declare function saveConfig(config: VeloSyncConfig, file: string): Promise<void>;
19
- export declare function readConfig(file: string): Promise<VeloSyncConfig>;
20
- export declare function createTemplateFolder(moduleSettings: ModuleSettings): Promise<void>;
21
- export type PackageJson = {
22
- dependencies?: Record<string, string>;
23
- devDependencies?: Record<string, string>;
24
- [key: string]: any;
25
- };
26
- /**
27
- * Updates a lucy.json file with dependencies from a package.json file.
28
- * It replaces 'wixPackages' with 'dependencies' and 'devPackages' with 'devDependencies'.
29
- * @param {string} packageJsonPath - Path to the package.json file.
30
- * @param {string} lucyConfigPath - Path to the lucy.json file.
31
- */
32
- export declare function updateLucyConfigFromPackageJson(packageJsonPath: string, lucyConfigPath: string): Promise<void>;