lucy-cli 2.0.0-beta.13 ā 2.0.0-beta.15
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.
- package/package.json +7 -2
- package/.cursorignore +0 -4
- package/.eslintrc.cjs +0 -96
- package/.github/funding.yml +0 -2
- package/.nvmrc +0 -1
- package/.stylelintrc.js +0 -8
- package/.wix/debug.log +0 -10
- package/.yarnrc.yml +0 -2
- package/files/sync-data/data/test.csv +0 -17
- package/files/sync-data/files/lucy.jpg +0 -0
- package/files/sync-data/schema/test.json +0 -11
- package/lucy.jpg +0 -0
- package/mitarbeiter-login.html +0 -188
- package/old/Gulpfile.d.ts +0 -34
- package/old/Gulpfile.js +0 -116
- package/old/Gulpfile.js.map +0 -1
- package/old/Gulpfile.ts +0 -231
- package/old/gulp/backend.d.ts +0 -3
- package/old/gulp/backend.js +0 -92
- package/old/gulp/backend.js.map +0 -1
- package/old/gulp/backend.ts +0 -109
- package/old/gulp/checks.d.ts +0 -3
- package/old/gulp/checks.js +0 -205
- package/old/gulp/checks.js.map +0 -1
- package/old/gulp/checks.ts +0 -228
- package/old/gulp/clean.d.ts +0 -3
- package/old/gulp/clean.js +0 -29
- package/old/gulp/clean.js.map +0 -1
- package/old/gulp/clean.ts +0 -33
- package/old/gulp/copy.d.ts +0 -2
- package/old/gulp/copy.js +0 -34
- package/old/gulp/copy.js.map +0 -1
- package/old/gulp/copy.ts +0 -42
- package/old/gulp/helpers.d.ts +0 -2
- package/old/gulp/helpers.js +0 -25
- package/old/gulp/helpers.js.map +0 -1
- package/old/gulp/helpers.ts +0 -26
- package/old/gulp/pages.d.ts +0 -2
- package/old/gulp/pages.js +0 -37
- package/old/gulp/pages.js.map +0 -1
- package/old/gulp/pages.ts +0 -40
- package/old/gulp/pipeline.d.ts +0 -1
- package/old/gulp/pipeline.js +0 -29
- package/old/gulp/pipeline.js.map +0 -1
- package/old/gulp/pipeline.ts +0 -31
- package/old/gulp/public.d.ts +0 -2
- package/old/gulp/public.js +0 -50
- package/old/gulp/public.js.map +0 -1
- package/old/gulp/public.ts +0 -59
- package/old/gulp/styles.d.ts +0 -2
- package/old/gulp/styles.js +0 -40
- package/old/gulp/styles.js.map +0 -1
- package/old/gulp/styles.ts +0 -46
- package/old/gulp/templates.d.ts +0 -2
- package/old/gulp/templates.js +0 -33
- package/old/gulp/templates.js.map +0 -1
- package/old/gulp/templates.ts +0 -39
- package/old/gulp/types.d.ts +0 -4
- package/old/gulp/types.js +0 -289
- package/old/gulp/types.js.map +0 -1
- package/old/gulp/types.ts +0 -311
- package/old/gulp/watchers.d.ts +0 -9
- package/old/gulp/watchers.js +0 -59
- package/old/gulp/watchers.js.map +0 -1
- package/old/gulp/watchers.ts +0 -105
- package/old/helpers.d.ts +0 -32
- package/old/helpers.js +0 -267
- package/old/helpers.js.map +0 -1
- package/old/helpers.ts +0 -307
- package/old/index.d.ts +0 -59
- package/old/index.js +0 -288
- package/old/index.js.map +0 -1
- package/old/index.ts +0 -379
- package/old/init.d.ts +0 -8
- package/old/init.js +0 -165
- package/old/init.js.map +0 -1
- package/old/init.ts +0 -183
- package/old/models.d.ts +0 -37
- package/old/models.js +0 -2
- package/old/models.js.map +0 -1
- package/old/models.ts +0 -35
- package/old/prepare.d.ts +0 -8
- package/old/prepare.js +0 -20
- package/old/prepare.js.map +0 -1
- package/old/prepare.ts +0 -24
- package/old/schemas/index.d.ts +0 -0
- package/old/schemas/index.js +0 -2
- package/old/schemas/index.js.map +0 -1
- package/old/schemas/index.ts +0 -0
- package/old/schemas/types.d.ts +0 -0
- package/old/schemas/types.js +0 -2
- package/old/schemas/types.js.map +0 -1
- package/old/schemas/types.ts +0 -0
- package/old/settings.json +0 -67
- package/old/sync.d.ts +0 -2
- package/old/sync.js +0 -88
- package/old/sync.js.map +0 -1
- package/old/sync.ts +0 -97
- package/old/types.d.ts +0 -8
- package/pnpm-workspace.yaml +0 -6
- package/settings/backend-settings.json +0 -19
- package/settings/master-settings.json +0 -20
- package/settings/page-settings.json +0 -21
- package/settings/public-settings.json +0 -22
- package/src/args.ts +0 -121
- package/src/commands/checks.ts +0 -51
- package/src/commands/cleanup.ts +0 -11
- package/src/commands/copy.ts +0 -29
- package/src/commands/edit.ts +0 -81
- package/src/commands/exec.ts +0 -73
- package/src/commands/git.ts +0 -152
- package/src/commands/home.ts +0 -20
- package/src/commands/install.ts +0 -269
- package/src/commands/read.ts +0 -45
- package/src/commands/write.ts +0 -45
- package/src/commands.ts +0 -21
- package/src/config.ts +0 -142
- package/src/error.ts +0 -3
- package/src/helpers.ts +0 -93
- package/src/index.ts +0 -113
- package/src/init/blocks.ts +0 -85
- package/src/init/cargo.ts +0 -25
- package/src/init/expo.ts +0 -69
- package/src/init/gitModules.ts +0 -15
- package/src/init/index.ts +0 -86
- package/src/init/monorepo.ts +0 -72
- package/src/init/prepareVelo.ts +0 -19
- package/src/init/tauri.ts +0 -42
- package/src/init/templates.ts +0 -98
- package/src/init/velo.ts +0 -66
- package/src/policy.ts +0 -6
- package/src/prepare.ts +0 -24
- package/src/runtime.ts +0 -21
- package/src/schemas/gulp.ts +0 -31
- package/src/schemas/index.ts +0 -17
- package/src/schemas/lucy.ts +0 -43
- package/src/schemas/tsconfig.ts +0 -35
- package/src/schemas/types.ts +0 -40
- package/src/settings.json +0 -67
- package/src/states.ts +0 -15
- package/src/tasks/Gulpfile.ts +0 -207
- package/src/tasks/gulp/backend.ts +0 -113
- package/src/tasks/gulp/checks.ts +0 -219
- package/src/tasks/gulp/clean.ts +0 -38
- package/src/tasks/gulp/copy.ts +0 -38
- package/src/tasks/gulp/helpers.ts +0 -18
- package/src/tasks/gulp/pages.ts +0 -43
- package/src/tasks/gulp/pipeline.ts +0 -31
- package/src/tasks/gulp/public.ts +0 -61
- package/src/tasks/gulp/styles.ts +0 -47
- package/src/tasks/gulp/templates.ts +0 -53
- package/src/tasks/gulp/types.ts +0 -310
- package/src/tasks/gulp/watchers.ts +0 -97
- package/src/tasks/index.ts +0 -24
- package/src/tasks/syncSettings.ts +0 -21
- package/src/types.d.ts +0 -8
- package/src/utils/index.ts +0 -0
- package/src/utils/logger.ts +0 -40
- package/src/wix-sdk/check.ts +0 -24
- package/src/wix-sdk/client.ts +0 -18
- package/src/wix-sdk/index.ts +0 -17
- package/src/wix-sdk/init.ts +0 -54
- package/src/wix-sdk/run.ts +0 -56
- package/src/wix-sync/client.ts +0 -6
- package/src/wix-sync/export.ts +0 -19
- package/src/wix-sync/import.ts +0 -27
- package/src/wix-sync/index.ts +0 -36
- package/src/wix-sync/init.ts +0 -77
- package/src/wix-sync/is-alive.ts +0 -25
- package/src/wix-sync/migrate.ts +0 -23
- package/src/wix-sync/sync.ts +0 -27
- package/tsconfig.json +0 -34
package/old/Gulpfile.ts
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import gulp from 'gulp';
|
|
2
|
-
import gulpSass from 'gulp-sass';
|
|
3
|
-
import shell from 'gulp-shell';
|
|
4
|
-
import * as os from 'os';
|
|
5
|
-
import * as dartSass from 'sass';
|
|
6
|
-
|
|
7
|
-
import backendSettings from '../settings/backend-settings.json' with { type: "json" };;
|
|
8
|
-
import masterSettings from '../settings/master-settings.json' with { type: "json" };;
|
|
9
|
-
import pageSettings from '../settings/page-settings.json' with { type: "json" };;
|
|
10
|
-
import publicSettings from '../settings/public-settings.json' with { type: "json" };;
|
|
11
|
-
|
|
12
|
-
import { buildPublic } from './gulp/public.js';
|
|
13
|
-
import { buildBackend, buildBackendJSW } from './gulp/backend.js';
|
|
14
|
-
import { checkPages, checkTs } from './gulp/checks.js';
|
|
15
|
-
import { compileScss } from './gulp/styles.js';
|
|
16
|
-
import { buildPages } from './gulp/pages.js';
|
|
17
|
-
import { previewTemplates } from './gulp/templates.js';
|
|
18
|
-
import { copyFiles } from './gulp/copy.js';
|
|
19
|
-
import { cleanSrc, cleanWix } from './gulp/clean.js';
|
|
20
|
-
import { addTypes, updateWixTypes } from './gulp/types.js';
|
|
21
|
-
import { setProdConfig } from './gulp/pipeline.js';
|
|
22
|
-
import { watchAll } from './gulp/watchers.js';
|
|
23
|
-
import { ModuleSettings, ProjectSettings, blue, green, magenta, orange, red } from './index.js';
|
|
24
|
-
import { getModulesSourcePaths, getModulesSync } from './gulp/helpers.js';
|
|
25
|
-
|
|
26
|
-
const sass = gulpSass(dartSass);
|
|
27
|
-
|
|
28
|
-
export type TaskOptions = {
|
|
29
|
-
moduleSettings?: ModuleSettings,
|
|
30
|
-
projectSettings?: ProjectSettings
|
|
31
|
-
enableIncrementalBuild: boolean;
|
|
32
|
-
outputDir: string;
|
|
33
|
-
sass: ReturnType<typeof gulpSass>;
|
|
34
|
-
userHomeDir: string;
|
|
35
|
-
replaceOptions: typeof replaceOptions;
|
|
36
|
-
backendSettings: typeof backendSettings,
|
|
37
|
-
masterSettings: typeof masterSettings,
|
|
38
|
-
pageSettings: typeof pageSettings,
|
|
39
|
-
publicSettings: typeof publicSettings,
|
|
40
|
-
modulesSync: Record<string, string> | undefined;
|
|
41
|
-
modulesSourcePaths: string[];
|
|
42
|
-
cwd: string;
|
|
43
|
-
isWatching?: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface File {
|
|
47
|
-
path: string;
|
|
48
|
-
dirname: string;
|
|
49
|
-
// other properties...
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const outputDir = './src';
|
|
53
|
-
const userHomeDir = os.homedir();
|
|
54
|
-
const replaceOptions = {
|
|
55
|
-
logs: {
|
|
56
|
-
enabled: false
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const taskOptions: TaskOptions = {
|
|
60
|
-
enableIncrementalBuild: false,
|
|
61
|
-
outputDir,
|
|
62
|
-
sass,
|
|
63
|
-
userHomeDir,
|
|
64
|
-
pageSettings,
|
|
65
|
-
publicSettings,
|
|
66
|
-
backendSettings,
|
|
67
|
-
masterSettings,
|
|
68
|
-
replaceOptions,
|
|
69
|
-
cwd: process.cwd(),
|
|
70
|
-
modulesSync: getModulesSync(),
|
|
71
|
-
modulesSourcePaths: getModulesSourcePaths(),
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const watchTaskOptions: TaskOptions = { ...taskOptions, isWatching: true };
|
|
75
|
-
|
|
76
|
-
gulp.task('check-ts', gulp.parallel(
|
|
77
|
-
checkTs(taskOptions),
|
|
78
|
-
));
|
|
79
|
-
|
|
80
|
-
gulp.task('scss', gulp.parallel(
|
|
81
|
-
compileScss(taskOptions),
|
|
82
|
-
));
|
|
83
|
-
|
|
84
|
-
gulp.task('build-backend', gulp.parallel(
|
|
85
|
-
buildBackend(taskOptions),
|
|
86
|
-
buildBackendJSW(taskOptions),
|
|
87
|
-
// buildBackendHTTP(taskOptions),
|
|
88
|
-
));
|
|
89
|
-
|
|
90
|
-
gulp.task('build-public', gulp.parallel(
|
|
91
|
-
buildPublic(taskOptions),
|
|
92
|
-
));
|
|
93
|
-
|
|
94
|
-
gulp.task('preview-templates', gulp.parallel(
|
|
95
|
-
previewTemplates(taskOptions),
|
|
96
|
-
));
|
|
97
|
-
|
|
98
|
-
gulp.task('copy-files', gulp.parallel(
|
|
99
|
-
copyFiles(taskOptions),
|
|
100
|
-
));
|
|
101
|
-
|
|
102
|
-
gulp.task('test', function () {
|
|
103
|
-
return shell.task(
|
|
104
|
-
['yarn test'],
|
|
105
|
-
{ ignoreErrors: true }
|
|
106
|
-
)().then(() => {
|
|
107
|
-
console.log("š" + blue.underline.bold(' => Exited test task!'));
|
|
108
|
-
}).catch(err => {
|
|
109
|
-
console.log("š©" + red.underline.bold(' => Error in test task!'));
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
gulp.task('test-ci', function () {
|
|
113
|
-
return shell.task(
|
|
114
|
-
['yarn test --run'],
|
|
115
|
-
{ ignoreErrors: true }
|
|
116
|
-
)().then(() => {
|
|
117
|
-
console.log("š" + blue.underline.bold(' => Exited test task!'));
|
|
118
|
-
}).catch(err => {
|
|
119
|
-
console.log("š©" + red.underline.bold(' => Error in test task!'));
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
gulp.task('sync-types', shell.task([
|
|
124
|
-
'yarn postinstall',
|
|
125
|
-
]));
|
|
126
|
-
|
|
127
|
-
gulp.task('fix-wixtypes', gulp.parallel(
|
|
128
|
-
updateWixTypes(taskOptions)
|
|
129
|
-
));
|
|
130
|
-
|
|
131
|
-
gulp.task('add-wix-types', function(done: gulp.TaskFunctionCallback) {
|
|
132
|
-
return addTypes(taskOptions, done);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
gulp.task('set-production', gulp.parallel(
|
|
136
|
-
setProdConfig()
|
|
137
|
-
));
|
|
138
|
-
|
|
139
|
-
gulp.task('start-wix', shell.task([
|
|
140
|
-
'yarn wix:dev',
|
|
141
|
-
]));
|
|
142
|
-
|
|
143
|
-
gulp.task('gen-docs', shell.task([
|
|
144
|
-
'yarn docs',
|
|
145
|
-
]));
|
|
146
|
-
|
|
147
|
-
gulp.task('fix-wix', gulp.series(
|
|
148
|
-
cleanWix(),
|
|
149
|
-
'sync-types',
|
|
150
|
-
'fix-wixtypes',
|
|
151
|
-
'add-wix-types'
|
|
152
|
-
));
|
|
153
|
-
|
|
154
|
-
gulp.task('build', gulp.parallel(
|
|
155
|
-
'build-backend',
|
|
156
|
-
'build-public',
|
|
157
|
-
'preview-templates',
|
|
158
|
-
buildPages(taskOptions),
|
|
159
|
-
compileScss(taskOptions),
|
|
160
|
-
'copy-files'
|
|
161
|
-
)
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
gulp.task('build-pipeline', gulp.series(
|
|
165
|
-
cleanSrc(taskOptions),
|
|
166
|
-
'set-production',
|
|
167
|
-
'check-ts',
|
|
168
|
-
'fix-wixtypes',
|
|
169
|
-
'add-wix-types',
|
|
170
|
-
'test-ci',
|
|
171
|
-
'build',
|
|
172
|
-
));
|
|
173
|
-
|
|
174
|
-
gulp.task('build-prod', gulp.series(
|
|
175
|
-
(done) => checkPages(true, false).then(() => done(), (err) => done(err)),
|
|
176
|
-
cleanSrc(taskOptions),
|
|
177
|
-
'set-production',
|
|
178
|
-
'fix-wix',
|
|
179
|
-
'check-ts',
|
|
180
|
-
'test-ci',
|
|
181
|
-
'build-backend',
|
|
182
|
-
'build-public',
|
|
183
|
-
buildPages(taskOptions),
|
|
184
|
-
'copy-files',
|
|
185
|
-
compileScss(taskOptions),
|
|
186
|
-
// 'gen-docs'
|
|
187
|
-
));
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
gulp.task('start-dev-env', gulp.parallel(
|
|
191
|
-
watchAll(watchTaskOptions),
|
|
192
|
-
'test',
|
|
193
|
-
'start-wix',
|
|
194
|
-
'check-ts',
|
|
195
|
-
(done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
|
|
196
|
-
));
|
|
197
|
-
|
|
198
|
-
gulp.task('dev', gulp.series(
|
|
199
|
-
cleanSrc(taskOptions),
|
|
200
|
-
'fix-wix',
|
|
201
|
-
'build',
|
|
202
|
-
'start-dev-env',
|
|
203
|
-
)
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
async function gulpTaskRunner(task: string) {
|
|
207
|
-
return new Promise(function (resolve, reject) {
|
|
208
|
-
gulp.series(task, (done) => {
|
|
209
|
-
resolve(true);
|
|
210
|
-
done();
|
|
211
|
-
})(function (err) {
|
|
212
|
-
if (err) {
|
|
213
|
-
console.log((`š© ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
|
|
214
|
-
reject(err);
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export async function runTask(task: string, moduleSettings: ModuleSettings, projectSettings: ProjectSettings) {
|
|
221
|
-
taskOptions.cwd = moduleSettings.targetFolder;
|
|
222
|
-
taskOptions.moduleSettings = moduleSettings;
|
|
223
|
-
taskOptions.projectSettings = projectSettings;
|
|
224
|
-
console.log("š" + magenta.underline(' => Starting Task => ' + orange(task)));
|
|
225
|
-
try {
|
|
226
|
-
await gulpTaskRunner(task);
|
|
227
|
-
} catch (err) {
|
|
228
|
-
console.log((`š© ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
|
|
229
|
-
}
|
|
230
|
-
console.log("š¶" + green.underline.bold(' => Task completed: ' + task));
|
|
231
|
-
}
|
package/old/gulp/backend.d.ts
DELETED
package/old/gulp/backend.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import gulp from 'gulp';
|
|
2
|
-
import rename from 'gulp-rename';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import { blue, orange, red } from '../index.js';
|
|
5
|
-
import swc from 'gulp-swc';
|
|
6
|
-
const swcOptions = {
|
|
7
|
-
jsc: {
|
|
8
|
-
target: 'es2020',
|
|
9
|
-
parser: {
|
|
10
|
-
syntax: "typescript",
|
|
11
|
-
tsx: true,
|
|
12
|
-
decorators: true,
|
|
13
|
-
// preserveAllComments: true
|
|
14
|
-
},
|
|
15
|
-
preserveAllComments: false,
|
|
16
|
-
minify: {
|
|
17
|
-
compress: true // equivalent to {}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export function buildBackend(options) {
|
|
22
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
|
23
|
-
const { outputDir } = options;
|
|
24
|
-
// Create tasks for each folder
|
|
25
|
-
const tasks = folders.map((folder) => {
|
|
26
|
-
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
|
27
|
-
const task = () => gulp.src([
|
|
28
|
-
`${folder}/backend/**/*.ts`,
|
|
29
|
-
`${folder}/backend/**/*.tsx`,
|
|
30
|
-
`!${folder}/backend/**/*.jsw.ts`,
|
|
31
|
-
`!${folder}/backend/**/*.spec.ts`,
|
|
32
|
-
])
|
|
33
|
-
.pipe(swc(swcOptions))
|
|
34
|
-
.on('error', function (e) {
|
|
35
|
-
console.log("š©" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
|
36
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
37
|
-
this.emit('end');
|
|
38
|
-
})
|
|
39
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
|
40
|
-
.on('error', function (e) {
|
|
41
|
-
console.log("š©" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
|
42
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
43
|
-
this.emit('end');
|
|
44
|
-
})
|
|
45
|
-
.on('end', function () {
|
|
46
|
-
console.log("š¶" + blue.underline(` => Build of Backend files for ${orange(folder)} succeeded!`));
|
|
47
|
-
});
|
|
48
|
-
// Register the task with Gulp
|
|
49
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
|
50
|
-
return task;
|
|
51
|
-
});
|
|
52
|
-
// Run all tasks in parallel
|
|
53
|
-
return gulp.parallel(...tasks);
|
|
54
|
-
}
|
|
55
|
-
export function buildBackendJSW(options) {
|
|
56
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
|
57
|
-
const swcOptions = {
|
|
58
|
-
jsc: {
|
|
59
|
-
target: 'es6',
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
const { outputDir } = options;
|
|
63
|
-
// Create tasks for each folder
|
|
64
|
-
const tasks = folders.map((folder) => {
|
|
65
|
-
const taskName = `build-${folder}`; // Create a unique name for each task
|
|
66
|
-
const task = () => gulp.src([
|
|
67
|
-
`${folder}/backend/**/*.jsw.ts`,
|
|
68
|
-
])
|
|
69
|
-
.pipe(swc(swcOptions))
|
|
70
|
-
.on('error', function (e) {
|
|
71
|
-
console.log("š©" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
|
72
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
73
|
-
this.emit('end');
|
|
74
|
-
})
|
|
75
|
-
.pipe(rename({ extname: '' }))
|
|
76
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
|
77
|
-
.on('error', function (e) {
|
|
78
|
-
console.log("š©" + red.underline.bold(` => Build of JSW files for ${orange(folder)} failed!`));
|
|
79
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
80
|
-
this.emit('end');
|
|
81
|
-
})
|
|
82
|
-
.on('end', function () {
|
|
83
|
-
console.log("š¶" + blue.underline(` => Build of JSW files for ${orange(folder)} succeeded!`));
|
|
84
|
-
});
|
|
85
|
-
// Register the task with Gulp
|
|
86
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
|
87
|
-
return task;
|
|
88
|
-
});
|
|
89
|
-
// Run all tasks in parallel
|
|
90
|
-
return gulp.parallel(...tasks);
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=backend.js.map
|
package/old/gulp/backend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["backend.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,GAAG,MAAM,UAAU,CAAC;AAG3B,MAAM,UAAU,GAAG;IACf,GAAG,EAAE;QACD,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACJ,MAAM,EAAE,YAAY;YACpB,GAAG,EAAE,IAAI;YACT,UAAU,EAAE,IAAI;YAChB,4BAA4B;SAC/B;QACD,mBAAmB,EAAE,KAAK;QAC1B,MAAM,EAAE;YACJ,QAAQ,EAAE,IAAI,CAAC,mBAAmB;SACrC;KACJ;CACJ,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,OAAoB;IAC7C,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,C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CAAC;AACnC,CAAC"}
|
package/old/gulp/backend.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import gulp from 'gulp';
|
|
2
|
-
import rename from 'gulp-rename';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import { TaskOptions } from '../Gulpfile';
|
|
5
|
-
import { blue, orange, red } from '../index.js';
|
|
6
|
-
import swc from 'gulp-swc';
|
|
7
|
-
import { cond } from 'cypress/types/lodash';
|
|
8
|
-
|
|
9
|
-
const swcOptions = {
|
|
10
|
-
jsc: {
|
|
11
|
-
target: 'es2020',
|
|
12
|
-
parser: {
|
|
13
|
-
syntax: "typescript",
|
|
14
|
-
tsx: true,
|
|
15
|
-
decorators: true,
|
|
16
|
-
// preserveAllComments: true
|
|
17
|
-
},
|
|
18
|
-
preserveAllComments: false,
|
|
19
|
-
minify: {
|
|
20
|
-
compress: true // equivalent to {}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export function buildBackend(options: TaskOptions) {
|
|
26
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
|
27
|
-
|
|
28
|
-
const { outputDir } = options;
|
|
29
|
-
|
|
30
|
-
// Create tasks for each folder
|
|
31
|
-
const tasks = folders.map((folder) => {
|
|
32
|
-
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
|
33
|
-
|
|
34
|
-
const task = () =>
|
|
35
|
-
gulp.src([
|
|
36
|
-
`${folder}/backend/**/*.ts`,
|
|
37
|
-
`${folder}/backend/**/*.tsx`,
|
|
38
|
-
`!${folder}/backend/**/*.jsw.ts`,
|
|
39
|
-
`!${folder}/backend/**/*.spec.ts`,
|
|
40
|
-
])
|
|
41
|
-
.pipe(swc(swcOptions))
|
|
42
|
-
.on('error', function (e: Error) {
|
|
43
|
-
console.log("š©" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
|
44
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
45
|
-
this.emit('end');
|
|
46
|
-
})
|
|
47
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
|
48
|
-
.on('error', function (e: Error) {
|
|
49
|
-
console.log("š©" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
|
50
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
51
|
-
this.emit('end');
|
|
52
|
-
})
|
|
53
|
-
.on('end', function () {
|
|
54
|
-
console.log("š¶" + blue.underline(` => Build of Backend files for ${orange(folder)} succeeded!`));
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// Register the task with Gulp
|
|
58
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
|
59
|
-
return task;
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// Run all tasks in parallel
|
|
63
|
-
return gulp.parallel(...tasks);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export function buildBackendJSW(options: TaskOptions) {
|
|
68
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
|
69
|
-
|
|
70
|
-
const swcOptions = {
|
|
71
|
-
jsc: {
|
|
72
|
-
target: 'es6',
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
const { outputDir } = options;
|
|
76
|
-
|
|
77
|
-
// Create tasks for each folder
|
|
78
|
-
const tasks = folders.map((folder) => {
|
|
79
|
-
const taskName = `build-${folder}`; // Create a unique name for each task
|
|
80
|
-
|
|
81
|
-
const task = () =>
|
|
82
|
-
gulp.src([
|
|
83
|
-
`${folder}/backend/**/*.jsw.ts`,
|
|
84
|
-
])
|
|
85
|
-
.pipe(swc(swcOptions))
|
|
86
|
-
.on('error', function (e: Error) {
|
|
87
|
-
console.log("š©" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
|
88
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
89
|
-
this.emit('end');
|
|
90
|
-
})
|
|
91
|
-
.pipe(rename({ extname: '' }))
|
|
92
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
|
93
|
-
.on('error', function (e: Error) {
|
|
94
|
-
console.log("š©" + red.underline.bold(` => Build of JSW files for ${orange(folder)} failed!`));
|
|
95
|
-
console.log("š©" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
|
96
|
-
this.emit('end');
|
|
97
|
-
})
|
|
98
|
-
.on('end', function () {
|
|
99
|
-
console.log("š¶" + blue.underline(` => Build of JSW files for ${orange(folder)} succeeded!`));
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// Register the task with Gulp
|
|
103
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
|
104
|
-
return task;
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// Run all tasks in parallel
|
|
108
|
-
return gulp.parallel(...tasks);
|
|
109
|
-
}
|
package/old/gulp/checks.d.ts
DELETED
package/old/gulp/checks.js
DELETED
|
@@ -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
|
package/old/gulp/checks.js.map
DELETED
|
@@ -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,EAAE,EAAE;YAC3C,IAAI,GAAG,EAAC,CAAC;gBACR,MAAM,CAAC,GAAG,CAAC,CA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