lucy-cli 0.9.4 → 0.9.5
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/README.md +1 -1
- package/dist/Gulpfile.js +11 -4
- package/dist/gulp/test.js +15 -35
- package/dist/gulp/watchers.js +3 -4
- package/dist/settings.json +6 -5
- package/files/vitest.config.ts +17 -0
- package/package.json +3 -3
- package/src/Gulpfile.ts +7 -3
- package/src/gulp/test.ts +17 -36
- package/src/gulp/watchers.ts +1 -3
- package/src/settings.json +6 -5
package/README.md
CHANGED
@@ -44,7 +44,7 @@ Lucy-CLI is designed to streamline the setup and management of TypeScript within
|
|
44
44
|
8. **Wix NPM Package Installation**
|
45
45
|
- Lucy-CLI can install Wix npm packages from the `lucy.json` file in the project directory.
|
46
46
|
|
47
|
-
9. **Teting with
|
47
|
+
9. **Teting with Vitest(Not working)**
|
48
48
|
- Lucy-CLI can run tests with Jest.
|
49
49
|
- It runs tests located backend folder with the file name ending with `.spec.ts`.
|
50
50
|
- it creates a code coverage report in the coverage folder in the lib folders and typescript folders.
|
package/dist/Gulpfile.js
CHANGED
@@ -19,7 +19,6 @@ import { addTypes, updateWixTypes } from './gulp/types.js';
|
|
19
19
|
import { setProdConfig } from './gulp/pipeline.js';
|
20
20
|
import { watchAll } from './gulp/watchers.js';
|
21
21
|
import { green, magenta, orange, red } from './index.js';
|
22
|
-
import { test } from './gulp/test.js';
|
23
22
|
import { getModulesSync } from './gulp/helpers.js';
|
24
23
|
const sass = gulpSass(dartSass);
|
25
24
|
const outputDir = './src';
|
@@ -48,7 +47,11 @@ gulp.task('build-backend', gulp.parallel(buildBackend(taskOptions), buildBackend
|
|
48
47
|
gulp.task('build-public', gulp.parallel(buildPublic(taskOptions)));
|
49
48
|
gulp.task('preview-templates', gulp.parallel(previewTemplates(taskOptions)));
|
50
49
|
gulp.task('copy-files', gulp.parallel(copyFiles(taskOptions)));
|
51
|
-
gulp.task('test', gulp.parallel(
|
50
|
+
gulp.task('test', gulp.parallel(
|
51
|
+
// test(taskOptions),
|
52
|
+
shell.task([
|
53
|
+
'sleep 2; yarn test',
|
54
|
+
])));
|
52
55
|
gulp.task('sync-types', shell.task([
|
53
56
|
'yarn postinstall',
|
54
57
|
]));
|
@@ -65,9 +68,13 @@ gulp.task('gen-docs', shell.task([
|
|
65
68
|
]));
|
66
69
|
gulp.task('fix-wix', gulp.series(cleanWix(), 'sync-types', 'fix-wixtypes', 'add-wix-types'));
|
67
70
|
gulp.task('build', gulp.parallel('build-backend', 'build-public', 'preview-templates', buildPages(taskOptions), compileScss(taskOptions), 'copy-files'));
|
68
|
-
gulp.task('build-pipeline', gulp.series(cleanSrc(taskOptions), 'set-production', 'fix-wixtypes', 'add-wix-types',
|
71
|
+
gulp.task('build-pipeline', gulp.series(cleanSrc(taskOptions), 'set-production', 'fix-wixtypes', 'add-wix-types',
|
72
|
+
// 'test',
|
73
|
+
'build'));
|
69
74
|
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
|
-
gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions),
|
75
|
+
gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions),
|
76
|
+
// 'test',
|
77
|
+
'start-wix', (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err))));
|
71
78
|
gulp.task('dev', gulp.series(cleanSrc(taskOptions), 'fix-wix', 'build', 'start-dev-env'));
|
72
79
|
async function gulpTaskRunner(task) {
|
73
80
|
return new Promise(function (resolve, reject) {
|
package/dist/gulp/test.js
CHANGED
@@ -2,53 +2,30 @@ import gulp from 'gulp';
|
|
2
2
|
import { blue, orange, red } from '../index.js';
|
3
3
|
import gulpJest from 'gulp-jest';
|
4
4
|
const jest = gulpJest.default;
|
5
|
+
const taskOpt = {
|
6
|
+
continueOnError: true,
|
7
|
+
};
|
5
8
|
export function test(options) {
|
6
9
|
const folders = ['typescript'];
|
7
|
-
if (options.modulesSync)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
10
|
+
// if (options.modulesSync){
|
11
|
+
// for (const module of Object.keys(options.modulesSync)) {
|
12
|
+
// folders.push(module);
|
13
|
+
// }
|
14
|
+
// }
|
12
15
|
// Create tasks for each folder
|
13
16
|
const tasks = folders.map((folder) => {
|
14
|
-
const taskName = `tests-${folder}`; // Create a unique name for each task
|
17
|
+
const taskName = `tests-coverage-${folder}`; // Create a unique name for each task
|
15
18
|
const task = () => gulp.src([
|
16
19
|
`${folder}/backend/**/*.spec.ts`,
|
17
20
|
])
|
18
|
-
.pipe(
|
19
|
-
verbose: true,
|
20
|
-
extensionsToTreatAsEsm: ['.ts'],
|
21
|
-
transform: {
|
22
|
-
'^.+\\.tsx?$': [
|
23
|
-
'ts-jest',
|
24
|
-
{
|
25
|
-
tsconfig: `./${folder}/tsconfig.json`,
|
26
|
-
usESM: true,
|
27
|
-
},
|
28
|
-
],
|
29
|
-
},
|
30
|
-
preset: 'ts-jest',
|
31
|
-
setupFilesAfterEnv: [],
|
32
|
-
testEnvironment: 'node',
|
33
|
-
collectCoverage: true,
|
34
|
-
coverageDirectory: './coverage',
|
35
|
-
coverageReporters: ['clover', 'json', 'lcov', 'text'],
|
36
|
-
rootDir: `./${folder}`,
|
37
|
-
roots: [...folders.map(folder => `../${folder}`)],
|
38
|
-
testMatch: ['**/*.spec.ts'],
|
39
|
-
passWithNoTests: true,
|
40
|
-
moduleNameMapper: {
|
41
|
-
'public/(.*)': [...folders.map(folder => `../${folder}/$1`)],
|
42
|
-
'backend/(.*)': [...folders.map(folder => `../${folder}/$1`)],
|
43
|
-
}
|
44
|
-
}))
|
21
|
+
.pipe(exec((file) => `yarn coverage`, taskOpt))
|
45
22
|
.on('error', function (e) {
|
46
|
-
console.log("💩" + red.underline.bold(` =>
|
23
|
+
console.log("💩" + red.underline.bold(` => Failed to generate coverage for ${orange(folder)} failed!`));
|
47
24
|
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
48
25
|
this.emit('end');
|
49
26
|
})
|
50
27
|
.on('end', function () {
|
51
|
-
console.log("🐶" + blue.underline(` =>
|
28
|
+
console.log("🐶" + blue.underline(` => Coverage for ${orange(folder)} succeeded!`));
|
52
29
|
});
|
53
30
|
// Register the task with Gulp
|
54
31
|
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
@@ -97,3 +74,6 @@ export function test(options) {
|
|
97
74
|
// });
|
98
75
|
// }
|
99
76
|
}
|
77
|
+
function exec(arg0, taskOpt) {
|
78
|
+
throw new Error('Function not implemented.');
|
79
|
+
}
|
package/dist/gulp/watchers.js
CHANGED
@@ -6,7 +6,6 @@ import { buildPages } from './pages.js';
|
|
6
6
|
import { copyFiles } from './copy.js';
|
7
7
|
import { previewTemplates } from './templates.js';
|
8
8
|
import { checkTs } from './checks.js';
|
9
|
-
import { test } from './test.js';
|
10
9
|
let taskOptions;
|
11
10
|
export function watchSCSS() {
|
12
11
|
return gulp.watch([
|
@@ -19,13 +18,13 @@ export function watchBackend() {
|
|
19
18
|
'*/backend/**/*.tsx',
|
20
19
|
'!*/backend/**/*.jsw.ts',
|
21
20
|
'!src/**/**',
|
22
|
-
], gulp.parallel(
|
21
|
+
], gulp.parallel(checkTs(taskOptions), buildBackend(taskOptions)));
|
23
22
|
}
|
24
23
|
export function watchPublic() {
|
25
24
|
return gulp.watch([
|
26
25
|
'*/public/**/*.ts',
|
27
26
|
'*/public/**/*.tsx',
|
28
|
-
], gulp.parallel(
|
27
|
+
], gulp.parallel(checkTs(taskOptions), buildPublic(taskOptions)));
|
29
28
|
}
|
30
29
|
export function watchPages() {
|
31
30
|
return gulp.watch('typescript/pages/**/*.ts', gulp.parallel(checkTs(taskOptions), buildPages(taskOptions)));
|
@@ -44,7 +43,7 @@ export function watchTemplates() {
|
|
44
43
|
'*/backend/templates/**/*.tsx',
|
45
44
|
'*/backend/templates/data/*.json',
|
46
45
|
'!*/backend/templates/render.ts',
|
47
|
-
], gulp.parallel(previewTemplates(taskOptions),
|
46
|
+
], gulp.parallel(previewTemplates(taskOptions), checkTs(taskOptions)));
|
48
47
|
}
|
49
48
|
export function watchTypes() {
|
50
49
|
return gulp.watch([
|
package/dist/settings.json
CHANGED
@@ -35,11 +35,9 @@
|
|
35
35
|
"eslint-plugin-named-import-spacing": "^1.0.3",
|
36
36
|
"eslint-plugin-promise": "^7.2.1",
|
37
37
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
38
|
-
"jest": "^29.7.0",
|
39
38
|
"prettier": "^3.3.3",
|
40
39
|
"react": "^18.3.1",
|
41
40
|
"sass": "^1.81.0",
|
42
|
-
"ts-jest": "^29.2.5",
|
43
41
|
"ts-node": "^10.9.2",
|
44
42
|
"tsx": "^4.19.2",
|
45
43
|
"typedoc": "0.27.1",
|
@@ -48,7 +46,10 @@
|
|
48
46
|
"typedoc-theme-hierarchy": "^5.0.3",
|
49
47
|
"typescript": "5.6.3",
|
50
48
|
"typescript-eslint": "^8.15.0",
|
51
|
-
"typescript-eslint-language-service": "^5.0.5"
|
49
|
+
"typescript-eslint-language-service": "^5.0.5",
|
50
|
+
"vitest": "^2.1.8",
|
51
|
+
"vitest-tsconfig-paths": "^3.4.1",
|
52
|
+
"vite-tsconfig-paths": "^5.1.4"
|
52
53
|
},
|
53
54
|
"scripts": {
|
54
55
|
"postinstall": "wix sync-types",
|
@@ -59,8 +60,8 @@
|
|
59
60
|
"build": "lucy-cli build-prod",
|
60
61
|
"fix-wix": "lucy-cli fix-wix",
|
61
62
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
62
|
-
"test": "
|
63
|
-
"
|
63
|
+
"test": "vitest --ui",
|
64
|
+
"coverage": "vitest run --coverage",
|
64
65
|
"cypress": "cypress open",
|
65
66
|
"e2e": "cypress-cloud run --parallel --record"
|
66
67
|
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
2
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
3
|
+
import { defineConfig } from 'vitest/config';
|
4
|
+
|
5
|
+
export default defineConfig({
|
6
|
+
plugins: [tsconfigPaths({
|
7
|
+
projects: ['./typescript/tsconfig.json'],
|
8
|
+
})],
|
9
|
+
test: {
|
10
|
+
coverage: {
|
11
|
+
provider: 'v8',
|
12
|
+
reporter: ['text', 'json', 'html'],
|
13
|
+
reportsDirectory: './coverage',
|
14
|
+
exclude: ['**/node_modules/**', 'src/**', '.wix/**'],
|
15
|
+
},
|
16
|
+
},
|
17
|
+
});
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"type": "module",
|
3
3
|
"name": "lucy-cli",
|
4
|
-
"version": "0.9.
|
4
|
+
"version": "0.9.5",
|
5
5
|
"description": "Lucy Framework for WIX Studio Editor",
|
6
6
|
"main": ".dist/index.js",
|
7
7
|
"scripts": {
|
@@ -68,8 +68,8 @@
|
|
68
68
|
"ts-node": "^10.9.1",
|
69
69
|
"typedoc": "0.26.11",
|
70
70
|
"typedoc-theme-hierarchy": "5.0.3",
|
71
|
-
"
|
72
|
-
"
|
71
|
+
"typescript": "^5.6.3",
|
72
|
+
"velo-sync": "^0.0.9"
|
73
73
|
},
|
74
74
|
"devDependencies": {
|
75
75
|
"@types/fs-extra": "^11.0.4",
|
package/src/Gulpfile.ts
CHANGED
@@ -96,9 +96,13 @@ gulp.task('copy-files', gulp.parallel(
|
|
96
96
|
));
|
97
97
|
|
98
98
|
gulp.task('test', gulp.parallel(
|
99
|
-
test(taskOptions),
|
99
|
+
// test(taskOptions),
|
100
|
+
shell.task([
|
101
|
+
'sleep 2; yarn test',
|
102
|
+
])
|
100
103
|
));
|
101
104
|
|
105
|
+
|
102
106
|
gulp.task('sync-types', shell.task([
|
103
107
|
'yarn postinstall',
|
104
108
|
]));
|
@@ -145,7 +149,7 @@ gulp.task('build-pipeline', gulp.series(
|
|
145
149
|
'set-production',
|
146
150
|
'fix-wixtypes',
|
147
151
|
'add-wix-types',
|
148
|
-
'test',
|
152
|
+
// 'test',
|
149
153
|
'build',
|
150
154
|
));
|
151
155
|
|
@@ -165,7 +169,7 @@ gulp.task('build-prod', gulp.series(
|
|
165
169
|
|
166
170
|
gulp.task('start-dev-env', gulp.parallel(
|
167
171
|
watchAll(taskOptions),
|
168
|
-
'test',
|
172
|
+
// 'test',
|
169
173
|
'start-wix',
|
170
174
|
(done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
|
171
175
|
));
|
package/src/gulp/test.ts
CHANGED
@@ -4,55 +4,32 @@ import gulpJest from 'gulp-jest';
|
|
4
4
|
import { TaskOptions } from '../Gulpfile.js';
|
5
5
|
const jest = gulpJest.default;
|
6
6
|
|
7
|
+
const taskOpt = {
|
8
|
+
continueOnError: true,
|
9
|
+
};
|
7
10
|
export function test(options: TaskOptions) {
|
8
11
|
const folders = ['typescript'];
|
9
|
-
if (options.modulesSync){
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
12
|
+
// if (options.modulesSync){
|
13
|
+
// for (const module of Object.keys(options.modulesSync)) {
|
14
|
+
// folders.push(module);
|
15
|
+
// }
|
16
|
+
// }
|
14
17
|
|
15
18
|
// Create tasks for each folder
|
16
19
|
const tasks = folders.map((folder) => {
|
17
|
-
const taskName = `tests-${folder}`; // Create a unique name for each task
|
20
|
+
const taskName = `tests-coverage-${folder}`; // Create a unique name for each task
|
18
21
|
const task = () =>
|
19
22
|
gulp.src([
|
20
23
|
`${folder}/backend/**/*.spec.ts`,
|
21
24
|
])
|
22
|
-
.pipe(
|
23
|
-
verbose: true,
|
24
|
-
extensionsToTreatAsEsm: ['.ts'],
|
25
|
-
transform: {
|
26
|
-
'^.+\\.tsx?$': [
|
27
|
-
'ts-jest',
|
28
|
-
{
|
29
|
-
tsconfig: `./${folder}/tsconfig.json`,
|
30
|
-
usESM: true,
|
31
|
-
},
|
32
|
-
],
|
33
|
-
},
|
34
|
-
preset: 'ts-jest',
|
35
|
-
setupFilesAfterEnv: [],
|
36
|
-
testEnvironment: 'node',
|
37
|
-
collectCoverage: true,
|
38
|
-
coverageDirectory: './coverage',
|
39
|
-
coverageReporters: ['clover', 'json', 'lcov', 'text'],
|
40
|
-
rootDir: `./${folder}`,
|
41
|
-
roots: [...folders.map(folder => `../${folder}`)],
|
42
|
-
testMatch: ['**/*.spec.ts'],
|
43
|
-
passWithNoTests: true,
|
44
|
-
moduleNameMapper: {
|
45
|
-
'public/(.*)': [...folders.map(folder => `../${folder}/$1`)],
|
46
|
-
'backend/(.*)': [...folders.map(folder => `../${folder}/$1`)],
|
47
|
-
}
|
48
|
-
}))
|
25
|
+
.pipe(exec((file: File) => `yarn coverage`, taskOpt))
|
49
26
|
.on('error', function (e: Error) {
|
50
|
-
console.log("💩" + red.underline.bold(` =>
|
27
|
+
console.log("💩" + red.underline.bold(` => Failed to generate coverage for ${orange(folder)} failed!`));
|
51
28
|
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
52
29
|
this.emit('end');
|
53
30
|
})
|
54
31
|
.on('end', function () {
|
55
|
-
console.log("🐶" + blue.underline(` =>
|
32
|
+
console.log("🐶" + blue.underline(` => Coverage for ${orange(folder)} succeeded!`));
|
56
33
|
});
|
57
34
|
|
58
35
|
// Register the task with Gulp
|
@@ -103,4 +80,8 @@ export function test(options: TaskOptions) {
|
|
103
80
|
// console.log("🐶" + blue.underline(` => Tests succeeded!`));
|
104
81
|
// });
|
105
82
|
// }
|
106
|
-
}
|
83
|
+
}
|
84
|
+
|
85
|
+
function exec(arg0: (file: File) => string, taskOpt: { continueOnError: boolean; }): any {
|
86
|
+
throw new Error('Function not implemented.');
|
87
|
+
}
|
package/src/gulp/watchers.ts
CHANGED
@@ -8,6 +8,7 @@ import { copyFiles } from './copy.js';
|
|
8
8
|
import { previewTemplates } from './templates.js';
|
9
9
|
import { checkPages, checkTs } from './checks.js';
|
10
10
|
import { test } from './test.js';
|
11
|
+
import shell from 'gulp-shell';
|
11
12
|
|
12
13
|
let taskOptions: TaskOptions;
|
13
14
|
|
@@ -26,7 +27,6 @@ export function watchBackend() {
|
|
26
27
|
'!*/backend/**/*.jsw.ts',
|
27
28
|
'!src/**/**',
|
28
29
|
], gulp.parallel(
|
29
|
-
test(taskOptions),
|
30
30
|
checkTs(taskOptions),
|
31
31
|
buildBackend(taskOptions),
|
32
32
|
)
|
@@ -38,7 +38,6 @@ export function watchPublic() {
|
|
38
38
|
'*/public/**/*.ts',
|
39
39
|
'*/public/**/*.tsx',
|
40
40
|
], gulp.parallel(
|
41
|
-
test(taskOptions),
|
42
41
|
checkTs(taskOptions),
|
43
42
|
buildPublic(taskOptions),
|
44
43
|
)
|
@@ -71,7 +70,6 @@ export function watchTemplates() {
|
|
71
70
|
'!*/backend/templates/render.ts',
|
72
71
|
], gulp.parallel(
|
73
72
|
previewTemplates(taskOptions),
|
74
|
-
test(taskOptions),
|
75
73
|
checkTs(taskOptions),
|
76
74
|
)
|
77
75
|
);
|
package/src/settings.json
CHANGED
@@ -35,11 +35,9 @@
|
|
35
35
|
"eslint-plugin-named-import-spacing": "^1.0.3",
|
36
36
|
"eslint-plugin-promise": "^7.2.1",
|
37
37
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
38
|
-
"jest": "^29.7.0",
|
39
38
|
"prettier": "^3.3.3",
|
40
39
|
"react": "^18.3.1",
|
41
40
|
"sass": "^1.81.0",
|
42
|
-
"ts-jest": "^29.2.5",
|
43
41
|
"ts-node": "^10.9.2",
|
44
42
|
"tsx": "^4.19.2",
|
45
43
|
"typedoc": "0.27.1",
|
@@ -48,7 +46,10 @@
|
|
48
46
|
"typedoc-theme-hierarchy": "^5.0.3",
|
49
47
|
"typescript": "5.6.3",
|
50
48
|
"typescript-eslint": "^8.15.0",
|
51
|
-
"typescript-eslint-language-service": "^5.0.5"
|
49
|
+
"typescript-eslint-language-service": "^5.0.5",
|
50
|
+
"vitest": "^2.1.8",
|
51
|
+
"vitest-tsconfig-paths": "^3.4.1",
|
52
|
+
"vite-tsconfig-paths": "^5.1.4"
|
52
53
|
},
|
53
54
|
"scripts": {
|
54
55
|
"postinstall": "wix sync-types",
|
@@ -59,8 +60,8 @@
|
|
59
60
|
"build": "lucy-cli build-prod",
|
60
61
|
"fix-wix": "lucy-cli fix-wix",
|
61
62
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
62
|
-
"test": "
|
63
|
-
"
|
63
|
+
"test": "vitest --ui",
|
64
|
+
"coverage": "vitest run --coverage",
|
64
65
|
"cypress": "cypress open",
|
65
66
|
"e2e": "cypress-cloud run --parallel --record"
|
66
67
|
}
|