lucy-cli 0.9.2 → 0.9.4

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/dist/Gulpfile.js CHANGED
@@ -64,7 +64,7 @@ gulp.task('gen-docs', shell.task([
64
64
  'yarn docs',
65
65
  ]));
66
66
  gulp.task('fix-wix', gulp.series(cleanWix(), 'sync-types', 'fix-wixtypes', 'add-wix-types'));
67
- gulp.task('build', gulp.parallel('build-backend', 'build-public', buildPages(taskOptions), compileScss(taskOptions), 'copy-files'));
67
+ gulp.task('build', gulp.parallel('build-backend', 'build-public', 'preview-templates', buildPages(taskOptions), compileScss(taskOptions), 'copy-files'));
68
68
  gulp.task('build-pipeline', gulp.series(cleanSrc(taskOptions), 'set-production', 'fix-wixtypes', 'add-wix-types', 'test', 'build'));
69
69
  gulp.task('build-prod', gulp.series((done) => checkPages(true, false).then(() => done(), (err) => done(err)), cleanSrc(taskOptions), 'set-production', 'fix-wix', 'build-backend', 'build-public', buildPages(taskOptions), 'copy-files', compileScss(taskOptions), 'gen-docs'));
70
70
  gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions), 'test', 'start-wix', (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err))));
@@ -9,7 +9,13 @@ const swcOptions = {
9
9
  parser: {
10
10
  syntax: "typescript",
11
11
  tsx: true,
12
+ decorators: true,
13
+ // preserveAllComments: true
12
14
  },
15
+ preserveAllComments: false,
16
+ minify: {
17
+ compress: true // equivalent to {}
18
+ }
13
19
  },
14
20
  };
15
21
  export function buildBackend(options) {
@@ -29,7 +35,6 @@ export function buildBackend(options) {
29
35
  `!${folder}/backend/**/*.jsw.ts`,
30
36
  `!${folder}/backend/**/*.spec.ts`,
31
37
  ])
32
- .pipe(swc(swcOptions))
33
38
  .pipe(swc(swcOptions))
34
39
  .on('error', function (e) {
35
40
  console.log("💩" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
@@ -9,6 +9,10 @@ const swcOptions = {
9
9
  syntax: "typescript",
10
10
  tsx: true,
11
11
  },
12
+ preserveAllComments: false,
13
+ minify: {
14
+ compress: true // equivalent to {}
15
+ }
12
16
  },
13
17
  };
14
18
  export function buildPages(options) {
@@ -9,6 +9,10 @@ const swcOptions = {
9
9
  syntax: "typescript",
10
10
  tsx: true,
11
11
  },
12
+ preserveAllComments: false,
13
+ minify: {
14
+ compress: true // equivalent to {}
15
+ }
12
16
  },
13
17
  };
14
18
  export function buildPublic(options) {
@@ -19,7 +19,7 @@ export function previewTemplates(options) {
19
19
  `${folder}/backend/templates/data/*.json`,
20
20
  `!${folder}/backend/templates/render.ts`,
21
21
  ])
22
- .pipe(exec((file) => `npx ts-node-esm -T ${file.path}`, taskOpt))
22
+ .pipe(exec((file) => `npx tsx --tsconfig ${file.dirname}/../../local.tsconfig.json ${file.path}`, taskOpt))
23
23
  .on('error', function (e) {
24
24
  console.log("💩" + red.underline.bold(` => Render of Template for ${orange(folder)} failed!`));
25
25
  console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
package/dist/gulp/test.js CHANGED
@@ -34,10 +34,12 @@ export function test(options) {
34
34
  coverageDirectory: './coverage',
35
35
  coverageReporters: ['clover', 'json', 'lcov', 'text'],
36
36
  rootDir: `./${folder}`,
37
+ roots: [...folders.map(folder => `../${folder}`)],
37
38
  testMatch: ['**/*.spec.ts'],
38
39
  passWithNoTests: true,
39
40
  moduleNameMapper: {
40
- 'public/(.*)': '<rootDir>/public/$1'
41
+ 'public/(.*)': [...folders.map(folder => `../${folder}/$1`)],
42
+ 'backend/(.*)': [...folders.map(folder => `../${folder}/$1`)],
41
43
  }
42
44
  }))
43
45
  .on('error', function (e) {
@@ -54,4 +56,44 @@ export function test(options) {
54
56
  });
55
57
  // Run all tasks in parallel
56
58
  return gulp.parallel(...tasks);
59
+ // return () => {
60
+ // return gulp.src([
61
+ // ...folders.map(folder => `${folder}/backend/**/*.spec.ts`)
62
+ // ])
63
+ // .pipe(jest({
64
+ // verbose: true,
65
+ // extensionsToTreatAsEsm: ['.ts'],
66
+ // transform: {
67
+ // '^.+\\.tsx?$': [
68
+ // 'ts-jest',
69
+ // {
70
+ // tsconfig: `./typescript/tsconfig.json`,
71
+ // usESM: true,
72
+ // },
73
+ // ],
74
+ // },
75
+ // preset: 'ts-jest',
76
+ // setupFilesAfterEnv: [],
77
+ // testEnvironment: 'node',
78
+ // collectCoverage: true,
79
+ // coverageDirectory: './coverage',
80
+ // coverageReporters: ['clover', 'json', 'lcov', 'text'],
81
+ // rootDir: `./typescript`,
82
+ // roots: [`.`],
83
+ // testMatch: ['**/*.spec.ts'],
84
+ // passWithNoTests: true,
85
+ // moduleNameMapper: {
86
+ // 'public/(.*)': [...folders.map(folder => `${folder}/$1`)],
87
+ // 'backend/(.*)': [...folders.map(folder => `${folder}/$1`)],
88
+ // }
89
+ // }))
90
+ // .on('error', function (e: Error) {
91
+ // console.log("💩" + red.underline.bold(` => Tests for failed!`));
92
+ // console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
93
+ // this.emit('end');
94
+ // })
95
+ // .on('end', function () {
96
+ // console.log("🐶" + blue.underline(` => Tests succeeded!`));
97
+ // });
98
+ // }
57
99
  }
@@ -17,7 +17,6 @@ export function watchBackend() {
17
17
  return gulp.watch([
18
18
  '*/backend/**/*.ts',
19
19
  '*/backend/**/*.tsx',
20
- '!*/backend/**/*.spec.ts',
21
20
  '!*/backend/**/*.jsw.ts',
22
21
  '!src/**/**',
23
22
  ], gulp.parallel(test(taskOptions), checkTs(taskOptions), buildBackend(taskOptions)));
@@ -13,6 +13,7 @@
13
13
  "wixPackages": {},
14
14
  "devPackages": {
15
15
  "@eslint/js": "^9.15.0",
16
+ "@okee-tech/eslint-plugin-neverthrow": "^1.0.3",
16
17
  "@styled/typescript-styled-plugin": "^1.0.1",
17
18
  "@total-typescript/ts-reset": "^0.6.1",
18
19
  "@types/jest": "^29.5.14",
@@ -28,9 +29,11 @@
28
29
  "cypress-cloud": "^1.11.0",
29
30
  "esbuild": "^0.24.0",
30
31
  "eslint": "^9.15.0",
32
+ "eslint-plugin-exception-handling": "^1.5.4",
31
33
  "eslint-plugin-import": "^2.31.0",
32
34
  "eslint-plugin-jsdoc": "^50.5.0",
33
35
  "eslint-plugin-named-import-spacing": "^1.0.3",
36
+ "eslint-plugin-promise": "^7.2.1",
34
37
  "eslint-plugin-simple-import-sort": "^12.1.1",
35
38
  "jest": "^29.7.0",
36
39
  "prettier": "^3.3.3",
@@ -39,7 +42,7 @@
39
42
  "ts-jest": "^29.2.5",
40
43
  "ts-node": "^10.9.2",
41
44
  "tsx": "^4.19.2",
42
- "typedoc": "^0.26.11",
45
+ "typedoc": "0.27.1",
43
46
  "typedoc-plugin-merge-modules": "^6.0.3",
44
47
  "typedoc-plugin-zod": "^1.3.0",
45
48
  "typedoc-theme-hierarchy": "^5.0.3",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.9.2",
4
+ "version": "0.9.4",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
package/src/Gulpfile.ts CHANGED
@@ -133,6 +133,7 @@ gulp.task('fix-wix', gulp.series(
133
133
  gulp.task('build', gulp.parallel(
134
134
  'build-backend',
135
135
  'build-public',
136
+ 'preview-templates',
136
137
  buildPages(taskOptions),
137
138
  compileScss(taskOptions),
138
139
  'copy-files'
@@ -12,7 +12,13 @@ const swcOptions = {
12
12
  parser: {
13
13
  syntax: "typescript",
14
14
  tsx: true,
15
+ decorators: true,
16
+ // preserveAllComments: true
15
17
  },
18
+ preserveAllComments: false,
19
+ minify: {
20
+ compress: true // equivalent to {}
21
+ }
16
22
  },
17
23
  };
18
24
 
@@ -37,7 +43,6 @@ export function buildBackend(options: TaskOptions) {
37
43
  `!${folder}/backend/**/*.jsw.ts`,
38
44
  `!${folder}/backend/**/*.spec.ts`,
39
45
  ])
40
- .pipe(swc(swcOptions))
41
46
  .pipe(swc(swcOptions))
42
47
  .on('error', function (e: Error) {
43
48
  console.log("💩" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
package/src/gulp/pages.ts CHANGED
@@ -11,6 +11,10 @@ const swcOptions = {
11
11
  syntax: "typescript",
12
12
  tsx: true,
13
13
  },
14
+ preserveAllComments: false,
15
+ minify: {
16
+ compress: true // equivalent to {}
17
+ }
14
18
  },
15
19
  };
16
20
 
@@ -11,6 +11,10 @@ const swcOptions = {
11
11
  syntax: "typescript",
12
12
  tsx: true,
13
13
  },
14
+ preserveAllComments: false,
15
+ minify: {
16
+ compress: true // equivalent to {}
17
+ }
14
18
  },
15
19
  };
16
20
 
@@ -24,7 +24,7 @@ export function previewTemplates(options: TaskOptions) {
24
24
  `${folder}/backend/templates/data/*.json`,
25
25
  `!${folder}/backend/templates/render.ts`,
26
26
  ])
27
- .pipe(exec((file: File) => `npx ts-node-esm -T ${file.path}`, taskOpt))
27
+ .pipe(exec((file: File) => `npx tsx --tsconfig ${file.dirname}/../../local.tsconfig.json ${file.path}`, taskOpt))
28
28
  .on('error', function (e: Error) {
29
29
  console.log("💩" + red.underline.bold(` => Render of Template for ${orange(folder)} failed!`));
30
30
  console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
package/src/gulp/test.ts CHANGED
@@ -38,10 +38,12 @@ export function test(options: TaskOptions) {
38
38
  coverageDirectory: './coverage',
39
39
  coverageReporters: ['clover', 'json', 'lcov', 'text'],
40
40
  rootDir: `./${folder}`,
41
+ roots: [...folders.map(folder => `../${folder}`)],
41
42
  testMatch: ['**/*.spec.ts'],
42
43
  passWithNoTests: true,
43
44
  moduleNameMapper: {
44
- 'public/(.*)': '<rootDir>/public/$1'
45
+ 'public/(.*)': [...folders.map(folder => `../${folder}/$1`)],
46
+ 'backend/(.*)': [...folders.map(folder => `../${folder}/$1`)],
45
47
  }
46
48
  }))
47
49
  .on('error', function (e: Error) {
@@ -60,4 +62,45 @@ export function test(options: TaskOptions) {
60
62
 
61
63
  // Run all tasks in parallel
62
64
  return gulp.parallel(...tasks);
65
+
66
+ // return () => {
67
+ // return gulp.src([
68
+ // ...folders.map(folder => `${folder}/backend/**/*.spec.ts`)
69
+ // ])
70
+ // .pipe(jest({
71
+ // verbose: true,
72
+ // extensionsToTreatAsEsm: ['.ts'],
73
+ // transform: {
74
+ // '^.+\\.tsx?$': [
75
+ // 'ts-jest',
76
+ // {
77
+ // tsconfig: `./typescript/tsconfig.json`,
78
+ // usESM: true,
79
+ // },
80
+ // ],
81
+ // },
82
+ // preset: 'ts-jest',
83
+ // setupFilesAfterEnv: [],
84
+ // testEnvironment: 'node',
85
+ // collectCoverage: true,
86
+ // coverageDirectory: './coverage',
87
+ // coverageReporters: ['clover', 'json', 'lcov', 'text'],
88
+ // rootDir: `./typescript`,
89
+ // roots: [`.`],
90
+ // testMatch: ['**/*.spec.ts'],
91
+ // passWithNoTests: true,
92
+ // moduleNameMapper: {
93
+ // 'public/(.*)': [...folders.map(folder => `${folder}/$1`)],
94
+ // 'backend/(.*)': [...folders.map(folder => `${folder}/$1`)],
95
+ // }
96
+ // }))
97
+ // .on('error', function (e: Error) {
98
+ // console.log("💩" + red.underline.bold(` => Tests for failed!`));
99
+ // console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
100
+ // this.emit('end');
101
+ // })
102
+ // .on('end', function () {
103
+ // console.log("🐶" + blue.underline(` => Tests succeeded!`));
104
+ // });
105
+ // }
63
106
  }
@@ -23,7 +23,6 @@ export function watchBackend() {
23
23
  return gulp.watch([
24
24
  '*/backend/**/*.ts',
25
25
  '*/backend/**/*.tsx',
26
- '!*/backend/**/*.spec.ts',
27
26
  '!*/backend/**/*.jsw.ts',
28
27
  '!src/**/**',
29
28
  ], gulp.parallel(
package/src/settings.json CHANGED
@@ -13,6 +13,7 @@
13
13
  "wixPackages": {},
14
14
  "devPackages": {
15
15
  "@eslint/js": "^9.15.0",
16
+ "@okee-tech/eslint-plugin-neverthrow": "^1.0.3",
16
17
  "@styled/typescript-styled-plugin": "^1.0.1",
17
18
  "@total-typescript/ts-reset": "^0.6.1",
18
19
  "@types/jest": "^29.5.14",
@@ -28,9 +29,11 @@
28
29
  "cypress-cloud": "^1.11.0",
29
30
  "esbuild": "^0.24.0",
30
31
  "eslint": "^9.15.0",
32
+ "eslint-plugin-exception-handling": "^1.5.4",
31
33
  "eslint-plugin-import": "^2.31.0",
32
34
  "eslint-plugin-jsdoc": "^50.5.0",
33
35
  "eslint-plugin-named-import-spacing": "^1.0.3",
36
+ "eslint-plugin-promise": "^7.2.1",
34
37
  "eslint-plugin-simple-import-sort": "^12.1.1",
35
38
  "jest": "^29.7.0",
36
39
  "prettier": "^3.3.3",
@@ -39,7 +42,7 @@
39
42
  "ts-jest": "^29.2.5",
40
43
  "ts-node": "^10.9.2",
41
44
  "tsx": "^4.19.2",
42
- "typedoc": "^0.26.11",
45
+ "typedoc": "0.27.1",
43
46
  "typedoc-plugin-merge-modules": "^6.0.3",
44
47
  "typedoc-plugin-zod": "^1.3.0",
45
48
  "typedoc-theme-hierarchy": "^5.0.3",