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