lucy-cli 2.0.0-beta.12 → 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 (184) hide show
  1. package/dist/commands/git.d.ts +3 -3
  2. package/dist/commands/home.d.ts +1 -1
  3. package/dist/init/cargo.d.ts +1 -1
  4. package/dist/init/gitModules.d.ts +1 -1
  5. package/dist/init/index.d.ts +1 -1
  6. package/dist/init/index.js +0 -2
  7. package/dist/init/index.js.map +1 -1
  8. package/dist/init/monorepo.d.ts +1 -1
  9. package/dist/init/prepareVelo.d.ts +1 -1
  10. package/dist/init/tauri.d.ts +1 -1
  11. package/dist/init/templates.d.ts +1 -1
  12. package/dist/init/velo.d.ts +1 -1
  13. package/package.json +8 -2
  14. package/.cursorignore +0 -4
  15. package/.eslintrc.cjs +0 -96
  16. package/.github/funding.yml +0 -2
  17. package/.nvmrc +0 -1
  18. package/.stylelintrc.js +0 -8
  19. package/.wix/debug.log +0 -10
  20. package/.yarnrc.yml +0 -2
  21. package/files/sync-data/data/test.csv +0 -17
  22. package/files/sync-data/files/lucy.jpg +0 -0
  23. package/files/sync-data/schema/test.json +0 -11
  24. package/lucy.jpg +0 -0
  25. package/mitarbeiter-login.html +0 -188
  26. package/old/Gulpfile.d.ts +0 -34
  27. package/old/Gulpfile.js +0 -116
  28. package/old/Gulpfile.js.map +0 -1
  29. package/old/Gulpfile.ts +0 -231
  30. package/old/gulp/backend.d.ts +0 -3
  31. package/old/gulp/backend.js +0 -92
  32. package/old/gulp/backend.js.map +0 -1
  33. package/old/gulp/backend.ts +0 -109
  34. package/old/gulp/checks.d.ts +0 -3
  35. package/old/gulp/checks.js +0 -205
  36. package/old/gulp/checks.js.map +0 -1
  37. package/old/gulp/checks.ts +0 -228
  38. package/old/gulp/clean.d.ts +0 -3
  39. package/old/gulp/clean.js +0 -29
  40. package/old/gulp/clean.js.map +0 -1
  41. package/old/gulp/clean.ts +0 -33
  42. package/old/gulp/copy.d.ts +0 -2
  43. package/old/gulp/copy.js +0 -34
  44. package/old/gulp/copy.js.map +0 -1
  45. package/old/gulp/copy.ts +0 -42
  46. package/old/gulp/helpers.d.ts +0 -2
  47. package/old/gulp/helpers.js +0 -25
  48. package/old/gulp/helpers.js.map +0 -1
  49. package/old/gulp/helpers.ts +0 -26
  50. package/old/gulp/pages.d.ts +0 -2
  51. package/old/gulp/pages.js +0 -37
  52. package/old/gulp/pages.js.map +0 -1
  53. package/old/gulp/pages.ts +0 -40
  54. package/old/gulp/pipeline.d.ts +0 -1
  55. package/old/gulp/pipeline.js +0 -29
  56. package/old/gulp/pipeline.js.map +0 -1
  57. package/old/gulp/pipeline.ts +0 -31
  58. package/old/gulp/public.d.ts +0 -2
  59. package/old/gulp/public.js +0 -50
  60. package/old/gulp/public.js.map +0 -1
  61. package/old/gulp/public.ts +0 -59
  62. package/old/gulp/styles.d.ts +0 -2
  63. package/old/gulp/styles.js +0 -40
  64. package/old/gulp/styles.js.map +0 -1
  65. package/old/gulp/styles.ts +0 -46
  66. package/old/gulp/templates.d.ts +0 -2
  67. package/old/gulp/templates.js +0 -33
  68. package/old/gulp/templates.js.map +0 -1
  69. package/old/gulp/templates.ts +0 -39
  70. package/old/gulp/types.d.ts +0 -4
  71. package/old/gulp/types.js +0 -289
  72. package/old/gulp/types.js.map +0 -1
  73. package/old/gulp/types.ts +0 -311
  74. package/old/gulp/watchers.d.ts +0 -9
  75. package/old/gulp/watchers.js +0 -59
  76. package/old/gulp/watchers.js.map +0 -1
  77. package/old/gulp/watchers.ts +0 -105
  78. package/old/helpers.d.ts +0 -32
  79. package/old/helpers.js +0 -267
  80. package/old/helpers.js.map +0 -1
  81. package/old/helpers.ts +0 -307
  82. package/old/index.d.ts +0 -59
  83. package/old/index.js +0 -288
  84. package/old/index.js.map +0 -1
  85. package/old/index.ts +0 -379
  86. package/old/init.d.ts +0 -8
  87. package/old/init.js +0 -165
  88. package/old/init.js.map +0 -1
  89. package/old/init.ts +0 -183
  90. package/old/models.d.ts +0 -37
  91. package/old/models.js +0 -2
  92. package/old/models.js.map +0 -1
  93. package/old/models.ts +0 -35
  94. package/old/prepare.d.ts +0 -8
  95. package/old/prepare.js +0 -20
  96. package/old/prepare.js.map +0 -1
  97. package/old/prepare.ts +0 -24
  98. package/old/schemas/index.d.ts +0 -0
  99. package/old/schemas/index.js +0 -2
  100. package/old/schemas/index.js.map +0 -1
  101. package/old/schemas/index.ts +0 -0
  102. package/old/schemas/types.d.ts +0 -0
  103. package/old/schemas/types.js +0 -2
  104. package/old/schemas/types.js.map +0 -1
  105. package/old/schemas/types.ts +0 -0
  106. package/old/settings.json +0 -67
  107. package/old/sync.d.ts +0 -2
  108. package/old/sync.js +0 -88
  109. package/old/sync.js.map +0 -1
  110. package/old/sync.ts +0 -97
  111. package/old/types.d.ts +0 -8
  112. package/pnpm-workspace.yaml +0 -6
  113. package/settings/backend-settings.json +0 -19
  114. package/settings/master-settings.json +0 -20
  115. package/settings/page-settings.json +0 -21
  116. package/settings/public-settings.json +0 -22
  117. package/src/args.ts +0 -121
  118. package/src/commands/checks.ts +0 -51
  119. package/src/commands/cleanup.ts +0 -11
  120. package/src/commands/copy.ts +0 -29
  121. package/src/commands/edit.ts +0 -81
  122. package/src/commands/exec.ts +0 -73
  123. package/src/commands/git.ts +0 -152
  124. package/src/commands/home.ts +0 -20
  125. package/src/commands/install.ts +0 -269
  126. package/src/commands/read.ts +0 -45
  127. package/src/commands/write.ts +0 -45
  128. package/src/commands.ts +0 -21
  129. package/src/config.ts +0 -142
  130. package/src/error.ts +0 -3
  131. package/src/helpers.ts +0 -93
  132. package/src/index.ts +0 -113
  133. package/src/init/blocks.ts +0 -85
  134. package/src/init/cargo.ts +0 -25
  135. package/src/init/expo.ts +0 -69
  136. package/src/init/gitModules.ts +0 -15
  137. package/src/init/index.ts +0 -88
  138. package/src/init/monorepo.ts +0 -72
  139. package/src/init/prepareVelo.ts +0 -19
  140. package/src/init/tauri.ts +0 -42
  141. package/src/init/templates.ts +0 -98
  142. package/src/init/velo.ts +0 -66
  143. package/src/policy.ts +0 -6
  144. package/src/prepare.ts +0 -24
  145. package/src/runtime.ts +0 -21
  146. package/src/schemas/gulp.ts +0 -31
  147. package/src/schemas/index.ts +0 -17
  148. package/src/schemas/lucy.ts +0 -43
  149. package/src/schemas/tsconfig.ts +0 -35
  150. package/src/schemas/types.ts +0 -40
  151. package/src/settings.json +0 -67
  152. package/src/states.ts +0 -15
  153. package/src/tasks/Gulpfile.ts +0 -207
  154. package/src/tasks/gulp/backend.ts +0 -113
  155. package/src/tasks/gulp/checks.ts +0 -219
  156. package/src/tasks/gulp/clean.ts +0 -38
  157. package/src/tasks/gulp/copy.ts +0 -38
  158. package/src/tasks/gulp/helpers.ts +0 -18
  159. package/src/tasks/gulp/pages.ts +0 -43
  160. package/src/tasks/gulp/pipeline.ts +0 -31
  161. package/src/tasks/gulp/public.ts +0 -61
  162. package/src/tasks/gulp/styles.ts +0 -47
  163. package/src/tasks/gulp/templates.ts +0 -53
  164. package/src/tasks/gulp/types.ts +0 -310
  165. package/src/tasks/gulp/watchers.ts +0 -97
  166. package/src/tasks/index.ts +0 -24
  167. package/src/tasks/syncSettings.ts +0 -21
  168. package/src/types.d.ts +0 -8
  169. package/src/utils/index.ts +0 -0
  170. package/src/utils/logger.ts +0 -40
  171. package/src/wix-sdk/check.ts +0 -24
  172. package/src/wix-sdk/client.ts +0 -18
  173. package/src/wix-sdk/index.ts +0 -17
  174. package/src/wix-sdk/init.ts +0 -54
  175. package/src/wix-sdk/run.ts +0 -56
  176. package/src/wix-sync/client.ts +0 -6
  177. package/src/wix-sync/export.ts +0 -19
  178. package/src/wix-sync/import.ts +0 -27
  179. package/src/wix-sync/index.ts +0 -36
  180. package/src/wix-sync/init.ts +0 -77
  181. package/src/wix-sync/is-alive.ts +0 -25
  182. package/src/wix-sync/migrate.ts +0 -23
  183. package/src/wix-sync/sync.ts +0 -27
  184. package/tsconfig.json +0 -34
@@ -1,205 +0,0 @@
1
- import * as fs from 'fs';
2
- import glob from 'glob';
3
- import * as path from 'path';
4
- import gulp from 'gulp';
5
- import ts from 'gulp-typescript';
6
- import { blue, green, magenta, orange, red, yellow } from '../index.js';
7
- // /**
8
- // * Extracts a match from a file
9
- // * @param {string} filePath File path
10
- // * @param {string} pattern Pattern to match
11
- // */
12
- // function extractMatchFromFile(filePath: string, pattern: string) {
13
- // return new Promise((resolve, reject) => {
14
- // fs.readFile(filePath, 'utf8', (err, data) => {
15
- // if (err){
16
- // reject(err);
17
- // return;
18
- // }
19
- // const regex = new RegExp(pattern);
20
- // const match = regex.exec(data);
21
- // const capturedGroup = match ? match.groups?.page : null;
22
- // resolve(capturedGroup);
23
- // });
24
- // });
25
- // }
26
- // async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string): Promise<Object[]> {
27
- // const files = await glob(path.join(folderPath, globPattern));
28
- // const filenameList: Object[] = [];
29
- // for (const file of files) {
30
- // if (pattern) {
31
- // const capturedGroup = await extractMatchFromFile(file, pattern);
32
- // if (capturedGroup) {
33
- // filenameList.push(capturedGroup);
34
- // }
35
- // } else {
36
- // filenameList.push(path.basename(file));
37
- // }
38
- // }
39
- // return filenameList;
40
- // }
41
- /**
42
- * Extracts a match from a file
43
- * @param {string} filePath File path
44
- * @param {string} pattern Pattern to match
45
- */
46
- function extractMatchFromFile(filePath, pattern) {
47
- return new Promise((resolve, reject) => {
48
- fs.readFile(filePath, 'utf8', (err, data) => {
49
- if (err) {
50
- reject(err);
51
- return;
52
- }
53
- const regex = new RegExp(pattern);
54
- const match = regex.exec(data);
55
- const capturedGroup = match ? match.groups?.page : null;
56
- resolve(capturedGroup);
57
- });
58
- });
59
- }
60
- /**
61
- * Reads files in a folder
62
- * @param {string} folderPath Folder path
63
- * @param {string} pattern Pattern to match
64
- * @param {string} globPattern Glob pattern
65
- */
66
- function readFilesInFolder(folderPath, pattern, globPattern) {
67
- return new Promise((resolve, reject) => {
68
- glob(path.join(folderPath, globPattern), (err, files) => {
69
- if (err) {
70
- reject(err);
71
- return;
72
- }
73
- const filenameList = [];
74
- /**
75
- * Traverse files
76
- * @param {number} index Index
77
- */
78
- function traverseFiles(index) {
79
- if (index === files.length) {
80
- resolve(filenameList);
81
- return;
82
- }
83
- const file = files[index];
84
- if (pattern) {
85
- if (!file)
86
- return;
87
- extractMatchFromFile(file, pattern)
88
- .then((capturedGroup) => {
89
- if (capturedGroup) {
90
- filenameList.push(capturedGroup);
91
- }
92
- traverseFiles(index + 1);
93
- })
94
- .catch(reject);
95
- }
96
- if (!pattern) {
97
- if (!file)
98
- return;
99
- filenameList.push(path.basename(file));
100
- traverseFiles(index + 1);
101
- }
102
- }
103
- traverseFiles(0);
104
- });
105
- });
106
- }
107
- export async function checkPages(fail, force) {
108
- console.log("🐕" + green.underline.bold(' => Checking pages...'));
109
- return new Promise(async (resolve, reject) => {
110
- try {
111
- const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json');
112
- const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts');
113
- const sourcePagesSet = new Set(sourcePages);
114
- const tsPagesSet = new Set(tsPages);
115
- const missingInTs = Array.from(sourcePagesSet).filter((item) => !tsPages.includes(item));
116
- const obsoleteInTs = Array.from(tsPagesSet).filter((item) => !sourcePages.includes(item));
117
- if (missingInTs.length > 0) {
118
- if (!force) {
119
- console.log("💩" + red.underline.bold(' => Missing pages in ts folder: '), '\n', missingInTs);
120
- }
121
- if (force) {
122
- for (const page of missingInTs) {
123
- console.log("🐶" + magenta.underline.bold(' => Creating missing page: '), page);
124
- fs.writeFileSync(`./typescript/pages/${page}`, '');
125
- }
126
- }
127
- }
128
- if (obsoleteInTs.length > 0) {
129
- if (!force) {
130
- console.log("🦴" + yellow.underline.bold(' => Obsolete in ts folder'), '\n', obsoleteInTs);
131
- }
132
- if (force) {
133
- for (const page of obsoleteInTs) {
134
- console.log("🐶" + magenta.underline.bold(' => Deleting obsolete page: '), page);
135
- fs.rmSync(`./typescript/pages/${page}`);
136
- }
137
- }
138
- }
139
- if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
140
- console.log("🐶" + blue.underline.bold(' => Pages are in-sync!'));
141
- }
142
- else if (fail) {
143
- process.exit(1);
144
- }
145
- ;
146
- }
147
- catch (error) {
148
- reject(error);
149
- }
150
- });
151
- }
152
- const customReporter = {
153
- error: (error, tsInstance) => {
154
- if (!error.diagnostic) {
155
- console.log(red(error.message));
156
- return;
157
- }
158
- const { fullFilename, startPosition } = error;
159
- const relativePath = path.relative(process.cwd(), fullFilename ?? '');
160
- const line = startPosition ? startPosition.line + 1 : 0;
161
- const col = startPosition ? startPosition.character + 1 : 0;
162
- const message = tsInstance.flattenDiagnosticMessageText(error.diagnostic.messageText, '\n');
163
- console.log(`${blue.underline(relativePath)}:${yellow(String(line))}:${yellow(String(col))}`);
164
- console.log(` ${red('error')} ${yellow(`TS${error.diagnostic.code}`)}: ${message}`);
165
- },
166
- finish: (results) => {
167
- const errorCount = results.transpileErrors + results.semanticErrors + results.declarationErrors;
168
- if (errorCount > 0) {
169
- console.log(`\n💥 ${red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}.`)}`);
170
- }
171
- },
172
- };
173
- export function checkTs(options) {
174
- const folders = ['typescript', ...options.modulesSourcePaths];
175
- // Create tasks for each folder
176
- const tasks = folders.map((folder) => {
177
- const tsProject = ts.createProject(`./local.tsconfig.json`, { noEmit: true, declaration: false, skipDefaultLibCheck: true });
178
- const taskName = `test-${folder}`; // Create a unique name for each task
179
- const task = () => {
180
- let hasError = false;
181
- const stream = gulp.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
182
- .pipe(tsProject(customReporter))
183
- .on('error', () => {
184
- hasError = true;
185
- });
186
- if (options.isWatching) {
187
- stream.on('error', function () {
188
- this.emit('end');
189
- });
190
- }
191
- stream.on('end', () => {
192
- if (!hasError) {
193
- console.log("🐶" + blue.underline(` => Typescriptcheck for ${orange(folder)} succeeded!`));
194
- }
195
- });
196
- return stream;
197
- };
198
- // Register the task with Gulp
199
- Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
200
- return task;
201
- });
202
- // Run all tasks in parallel
203
- return gulp.parallel(...tasks);
204
- }
205
- //# sourceMappingURL=checks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checks.js","sourceRoot":"","sources":["checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGxE,MAAM;AACN,mCAAmC;AACnC,wCAAwC;AACxC,8CAA8C;AAC9C,MAAM;AACN,qEAAqE;AACrE,6CAA6C;AAC7C,mDAAmD;AACnD,eAAe;AACf,mBAAmB;AAEnB,cAAc;AACd,OAAO;AACP,wCAAwC;AACxC,qCAAqC;AACrC,8DAA8D;AAC9D,6BAA6B;AAC7B,QAAQ;AACR,OAAO;AACP,IAAI;AAEJ,yHAAyH;AACzH,oEAAoE;AACpE,yCAAyC;AAEzC,kCAAkC;AAClC,yBAAyB;AACzB,+EAA+E;AAC/E,mCAAmC;AACnC,oDAAoD;AACpD,gBAAgB;AAChB,mBAAmB;AACnB,sDAAsD;AACtD,YAAY;AACZ,QAAQ;AAER,2BAA2B;AAC3B,IAAI;AAEJ;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,QAAgB,EAAE,OAAe;IAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EA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,IAAI,MAAM,gBAAgB,CAAC,CAAC;iBACrE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;iBAC/B,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBACd,QAAQ,GAAG,IAAI,CAAC;YACpB,CAAC,CAAC,CAAC;YAEP,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE;oBACf,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC,CAAC,CAAC;YACP,CAAC;YAED,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBAClB,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACZ,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,2BAA2B,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;gBAC/F,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;QAEF,8BAA8B;QAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,kCAAkC;QAC5F,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,4BAA4B;IAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC;AACnC,CAAC"}
@@ -1,228 +0,0 @@
1
- import * as fs from 'fs';
2
- import glob from 'glob';
3
-
4
- import * as path from 'path';
5
- import typescript from 'typescript';
6
- import gulp from 'gulp';
7
- import ts from 'gulp-typescript';
8
- import { blue, green, magenta, orange, red, yellow } from '../index.js';
9
- import { TaskOptions } from '../Gulpfile.js';
10
-
11
- // /**
12
- // * Extracts a match from a file
13
- // * @param {string} filePath File path
14
- // * @param {string} pattern Pattern to match
15
- // */
16
- // function extractMatchFromFile(filePath: string, pattern: string) {
17
- // return new Promise((resolve, reject) => {
18
- // fs.readFile(filePath, 'utf8', (err, data) => {
19
- // if (err){
20
- // reject(err);
21
-
22
- // return;
23
- // }
24
- // const regex = new RegExp(pattern);
25
- // const match = regex.exec(data);
26
- // const capturedGroup = match ? match.groups?.page : null;
27
- // resolve(capturedGroup);
28
- // });
29
- // });
30
- // }
31
-
32
- // async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string): Promise<Object[]> {
33
- // const files = await glob(path.join(folderPath, globPattern));
34
- // const filenameList: Object[] = [];
35
-
36
- // for (const file of files) {
37
- // if (pattern) {
38
- // const capturedGroup = await extractMatchFromFile(file, pattern);
39
- // if (capturedGroup) {
40
- // filenameList.push(capturedGroup);
41
- // }
42
- // } else {
43
- // filenameList.push(path.basename(file));
44
- // }
45
- // }
46
-
47
- // return filenameList;
48
- // }
49
-
50
- /**
51
- * Extracts a match from a file
52
- * @param {string} filePath File path
53
- * @param {string} pattern Pattern to match
54
- */
55
- function extractMatchFromFile(filePath: string, pattern: string) {
56
- return new Promise((resolve, reject) => {
57
- fs.readFile(filePath, 'utf8', (err, data) => {
58
- if (err){
59
- reject(err);
60
-
61
- return;
62
- }
63
- const regex = new RegExp(pattern);
64
- const match = regex.exec(data);
65
- const capturedGroup = match ? match.groups?.page : null;
66
- resolve(capturedGroup);
67
- });
68
- });
69
- }
70
-
71
- /**
72
- * Reads files in a folder
73
- * @param {string} folderPath Folder path
74
- * @param {string} pattern Pattern to match
75
- * @param {string} globPattern Glob pattern
76
- */
77
- function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string,) {
78
- return new Promise((resolve, reject) => {
79
- glob(path.join(folderPath, globPattern), (err: unknown, files: string[]) => {
80
- if (err){
81
- reject(err);
82
-
83
- return;
84
- }
85
- const filenameList: Object[] = [];
86
- /**
87
- * Traverse files
88
- * @param {number} index Index
89
- */
90
- function traverseFiles(index: number) {
91
- if (index === files.length){
92
- resolve(filenameList);
93
-
94
- return;
95
- }
96
- const file = files[index];
97
- if(pattern){
98
- if(!file) return
99
- extractMatchFromFile(file, pattern)
100
- .then((capturedGroup) => {
101
- if (capturedGroup){
102
- filenameList.push(capturedGroup);
103
- }
104
- traverseFiles(index + 1);
105
- })
106
- .catch(reject);
107
- }
108
- if(!pattern){
109
- if(!file) return
110
- filenameList.push(path.basename(file));
111
- traverseFiles(index + 1);
112
- }
113
- }
114
- traverseFiles(0);
115
- });
116
- });
117
- }
118
- export async function checkPages(fail: boolean, force: boolean) {
119
- console.log("🐕" + green.underline.bold(' => Checking pages...'));
120
- return new Promise<void>(async (resolve, reject) => {
121
- try {
122
- const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json',) as string[];
123
- const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts',) as string[];
124
-
125
- const sourcePagesSet = new Set(sourcePages);
126
- const tsPagesSet = new Set(tsPages);
127
- const missingInTs = Array.from(sourcePagesSet).filter((item: string) => !tsPages.includes(item));
128
- const obsoleteInTs = Array.from(tsPagesSet).filter((item: string) => !sourcePages.includes(item));
129
- if (missingInTs.length > 0){
130
- if(!force){
131
- console.log("💩" + red.underline.bold(' => Missing pages in ts folder: '), '\n', missingInTs);
132
- }
133
- if(force) {
134
- for (const page of missingInTs) {
135
- console.log("🐶" + magenta.underline.bold(' => Creating missing page: '), page);
136
- fs.writeFileSync(`./typescript/pages/${page}`, '');
137
- }
138
- }
139
- }
140
- if (obsoleteInTs.length > 0){
141
- if(!force){
142
- console.log("🦴" + yellow.underline.bold(' => Obsolete in ts folder'), '\n', obsoleteInTs);
143
- }
144
- if(force) {
145
- for (const page of obsoleteInTs) {
146
- console.log("🐶" + magenta.underline.bold(' => Deleting obsolete page: '), page);
147
- fs.rmSync(`./typescript/pages/${page}`);
148
- }
149
- }
150
- }
151
- if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
152
- console.log("🐶" + blue.underline.bold(' => Pages are in-sync!'))
153
- } else if(fail){
154
- process.exit(1);
155
- };
156
- } catch (error) {
157
- reject(error);
158
- }
159
- });
160
- }
161
-
162
- const customReporter: ts.reporter.Reporter = {
163
- error: (error, tsInstance) => {
164
- if (!error.diagnostic) {
165
- console.log(red(error.message));
166
- return;
167
- }
168
- const { fullFilename, startPosition } = error;
169
- const relativePath = path.relative(process.cwd(), fullFilename ?? '');
170
- const line = startPosition ? startPosition.line + 1 : 0;
171
- const col = startPosition ? startPosition.character + 1 : 0;
172
-
173
- const message = tsInstance.flattenDiagnosticMessageText(error.diagnostic.messageText, '\n');
174
-
175
- console.log(
176
- `${blue.underline(relativePath)}:${yellow(String(line))}:${yellow(String(col))}`
177
- );
178
- console.log(` ${red('error')} ${yellow(`TS${error.diagnostic.code}`)}: ${message}`);
179
- },
180
- finish: (results) => {
181
- const errorCount = results.transpileErrors + results.semanticErrors + results.declarationErrors;
182
- if (errorCount > 0) {
183
- console.log(`\n💥 ${red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}.`)}`);
184
- }
185
- },
186
- };
187
-
188
- export function checkTs(options: TaskOptions) {
189
- const folders = ['typescript', ...options.modulesSourcePaths];
190
-
191
-
192
- // Create tasks for each folder
193
- const tasks = folders.map((folder) => {
194
- const tsProject = ts.createProject(`./local.tsconfig.json`, { noEmit: true, declaration: false, skipDefaultLibCheck: true });
195
-
196
- const taskName = `test-${folder}`; // Create a unique name for each task
197
-
198
- const task = () => {
199
- let hasError = false;
200
- const stream = gulp.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
201
- .pipe(tsProject(customReporter))
202
- .on('error', () => {
203
- hasError = true;
204
- });
205
-
206
- if (options.isWatching) {
207
- stream.on('error', function (this: NodeJS.ReadWriteStream) {
208
- this.emit('end');
209
- });
210
- }
211
-
212
- stream.on('end', () => {
213
- if (!hasError) {
214
- console.log("🐶" + blue.underline(` => Typescriptcheck for ${orange(folder)} succeeded!`));
215
- }
216
- });
217
-
218
- return stream;
219
- };
220
-
221
- // Register the task with Gulp
222
- Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
223
- return task;
224
- });
225
-
226
- // Run all tasks in parallel
227
- return gulp.parallel(...tasks);
228
- }
@@ -1,3 +0,0 @@
1
- import { TaskOptions } from '../Gulpfile';
2
- export declare function cleanWix(): () => any;
3
- export declare function cleanSrc(options: TaskOptions): () => any;
package/old/gulp/clean.js DELETED
@@ -1,29 +0,0 @@
1
- import gulp from 'gulp';
2
- import clean from 'gulp-clean';
3
- import { blue, orange, red } from '../index.js';
4
- export function cleanWix() {
5
- return () => {
6
- return gulp.src('./.wix', { read: false, allowEmpty: true })
7
- .pipe(clean({ force: true }))
8
- .on('error', function (e) {
9
- console.log("💩" + red.underline.bold(' => Cleaning of .wix failed!'));
10
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
11
- this.emit('end');
12
- })
13
- .on('end', function () { console.log("🐶" + blue.underline(' => Cleaning of .wix succeeded!')); });
14
- };
15
- }
16
- export function cleanSrc(options) {
17
- const { outputDir } = options;
18
- return () => {
19
- return gulp.src([`${outputDir}/pages`, `${outputDir}/public`, `${outputDir}/backend`], { read: false, allowEmpty: true })
20
- .pipe(clean({ force: true }))
21
- .on('error', function (e) {
22
- console.log("💩" + red.underline.bold('Cleaning of output files failed!'));
23
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
24
- this.emit('end');
25
- })
26
- .on('end', function () { console.log("🐶" + blue.underline(' => Cleaning of .src succeeded!')); });
27
- };
28
- }
29
- //# sourceMappingURL=clean.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clean.js","sourceRoot":"","sources":["clean.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,QAAQ;IACpB,OAAO,GAAG,EAAE;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,QAA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AAG,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC;aACD,EAAE,CAAC,KAAK,EAAE,cAAa,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC,CAAA;AACF,CAAC"}
package/old/gulp/clean.ts DELETED
@@ -1,33 +0,0 @@
1
- import chalk from 'chalk';
2
- import gulp from 'gulp';
3
- import { TaskOptions } from '../Gulpfile';
4
- import clean from 'gulp-clean';
5
- import { blue, orange, red } from '../index.js';
6
-
7
- export function cleanWix() {
8
- return () => {
9
- return gulp.src('./.wix', { read: false, allowEmpty: true })
10
- .pipe(clean({ force: true }))
11
- .on('error', function (e: Error) {
12
- console.log("💩" + red.underline.bold(' => Cleaning of .wix failed!'));
13
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
14
- this.emit('end');
15
- })
16
- .on('end', function() { console.log("🐶" + blue.underline(' => Cleaning of .wix succeeded!')); });
17
- }
18
- }
19
-
20
- export function cleanSrc(options: TaskOptions) {
21
- const { outputDir } = options;
22
-
23
- return () => {
24
- return gulp.src([`${outputDir}/pages`, `${outputDir}/public`, `${outputDir}/backend`], { read: false, allowEmpty: true })
25
- .pipe(clean({ force: true }))
26
- .on('error', function (e: Error) {
27
- console.log("💩" + red.underline.bold('Cleaning of output files failed!'));
28
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
29
- this.emit('end');
30
- })
31
- .on('end', function() { console.log("🐶" + blue.underline(' => Cleaning of .src succeeded!')); });
32
- }
33
- }
@@ -1,2 +0,0 @@
1
- import { TaskOptions } from '../Gulpfile';
2
- export declare function copyFiles(options: TaskOptions): import("undertaker").TaskFunction;
package/old/gulp/copy.js DELETED
@@ -1,34 +0,0 @@
1
- import gulp from 'gulp';
2
- import { blue, orange, red } from '../index.js';
3
- export function copyFiles(options) {
4
- const folders = ['typescript', ...options.modulesSourcePaths];
5
- // Create tasks for each folder
6
- const tasks = folders.map((folder) => {
7
- const { outputDir } = options;
8
- const taskName = `copy-${folder}`; // Create a unique name for each task
9
- const task = () => gulp.src([
10
- `${folder}/**/*`,
11
- `!${folder}/*tsconfig.json`,
12
- `!${folder}/**/*.ts`,
13
- `!${folder}/**/*.tsx`,
14
- `!${folder}/types/**/**`,
15
- `!${folder}/__mocks__/**/**`,
16
- `!${folder}/styles/**`,
17
- ])
18
- .pipe(gulp.dest(outputDir))
19
- .on('error', function (e) {
20
- console.log("💩" + red.underline.bold(` => Copy of files for ${orange(folder)} failed!`));
21
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
22
- this.emit('end');
23
- })
24
- .on('end', function () {
25
- console.log("🐶" + blue.underline(` => Copy of files for ${orange(folder)} succeeded!`));
26
- });
27
- // Register the task with Gulp
28
- Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
29
- return task;
30
- });
31
- // Run all tasks in parallel
32
- return gulp.parallel(...tasks);
33
- }
34
- //# sourceMappingURL=copy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy.js","sourceRoot":"","sources":["copy.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,UAAU,SAAS,CAAC,OAAoB;IAC1C,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE9D,+BAA+B;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACvC,MAAM,EAAE,SAAS,EAAC,GAAG,OAAO,CAAC;QAEvB,MAA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 +0,0 @@
1
- import gulp from 'gulp';
2
- import chalk from 'chalk';
3
- import { TaskOptions } from '../Gulpfile';
4
- import { blue, orange, red } from '../index.js';
5
-
6
- export function copyFiles(options: TaskOptions) {
7
- const folders = ['typescript', ...options.modulesSourcePaths];
8
-
9
- // Create tasks for each folder
10
- const tasks = folders.map((folder) => {
11
- const { outputDir} = options;
12
-
13
- const taskName = `copy-${folder}`; // Create a unique name for each task
14
-
15
- const task = () =>
16
- gulp.src([
17
- `${folder}/**/*`,
18
- `!${folder}/*tsconfig.json`,
19
- `!${folder}/**/*.ts`,
20
- `!${folder}/**/*.tsx`,
21
- `!${folder}/types/**/**`,
22
- `!${folder}/__mocks__/**/**`,
23
- `!${folder}/styles/**`,
24
- ])
25
- .pipe(gulp.dest(outputDir))
26
- .on('error', function (e: Error) {
27
- console.log("💩" + red.underline.bold(` => Copy of files for ${orange(folder)} failed!`));
28
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
29
- this.emit('end');
30
- })
31
- .on('end', function () {
32
- console.log("🐶" + blue.underline(` => Copy of files for ${orange(folder)} succeeded!`));
33
- });
34
-
35
- // Register the task with Gulp
36
- Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
37
- return task;
38
- });
39
-
40
- // Run all tasks in parallel
41
- return gulp.parallel(...tasks);
42
- }
@@ -1,2 +0,0 @@
1
- export declare function getModulesSync(): Record<string, string> | undefined;
2
- export declare function getModulesSourcePaths(): string[];
@@ -1,25 +0,0 @@
1
- import * as path from 'path';
2
- import * as fs from 'fs';
3
- export function getModulesSync() {
4
- const absolutePath = path.resolve('./lucy.json');
5
- const fileContent = fs.readFileSync(absolutePath, 'utf8');
6
- return JSON.parse(fileContent).modules;
7
- }
8
- export function getModulesSourcePaths() {
9
- const absolutePath = path.resolve('./lucy.json');
10
- const fileContent = fs.readFileSync(absolutePath, 'utf8');
11
- const data = JSON.parse(fileContent).modules;
12
- const paths = [];
13
- for (const module of Object.keys(data)) {
14
- if (!data[module].noCompile) {
15
- if (data[module].path) {
16
- paths.push(data[module].path);
17
- }
18
- else {
19
- paths.push(module);
20
- }
21
- }
22
- }
23
- return paths;
24
- }
25
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,MAAM,UAAU,cAAc;IAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAQ,CAAC;IACjE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,qBAAqB;IACjC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAQ,CAAC;IACjE,MAAM,IAAI,GAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;IAC9C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACJ,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -1,26 +0,0 @@
1
-
2
- import * as path from 'path';
3
- import * as fs from 'fs';
4
-
5
- export function getModulesSync(): Record<string, string> | undefined {
6
- const absolutePath = path.resolve('./lucy.json');
7
- const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
8
- return JSON.parse(fileContent).modules;
9
- }
10
-
11
- export function getModulesSourcePaths(): string[] {
12
- const absolutePath = path.resolve('./lucy.json');
13
- const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
14
- const data = JSON.parse(fileContent).modules;
15
- const paths: string[] = [];
16
- for (const module of Object.keys(data)) {
17
- if (!data[module].noCompile) {
18
- if (data[module].path) {
19
- paths.push(data[module].path);
20
- } else {
21
- paths.push(module);
22
- }
23
- }
24
- }
25
- return paths;
26
- }