lucy-cli 0.9.5 → 0.9.6
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 +4 -2
- package/dist/Gulpfile.js +10 -10
- package/dist/gulp/templates.js +1 -1
- package/dist/gulp/test.d.ts +1 -1
- package/dist/gulp/test.js +14 -67
- package/dist/gulp/watchers.js +7 -2
- package/dist/settings.json +1 -4
- package/files/local.tsconfig.json +53 -0
- package/files/typedoc.json +9 -10
- package/files/vitest.config.ts +45 -5
- package/package.json +1 -1
- package/src/Gulpfile.ts +13 -11
- package/src/gulp/templates.ts +1 -1
- package/src/gulp/watchers.ts +6 -3
- package/src/settings.json +1 -4
- package/src/gulp/test.ts +0 -87
package/README.md
CHANGED
@@ -44,10 +44,12 @@ 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 Vitest
|
48
|
-
- Lucy-CLI can run tests with
|
47
|
+
9. **Teting with Vitest**
|
48
|
+
- Lucy-CLI can run tests with Vitest.
|
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.
|
51
|
+
- Vitest is looking for mokes in typescript folder and lib folder.
|
52
|
+
- You can add additional mock folders in vitest.config.ts file.
|
51
53
|
|
52
54
|
10. **Linting with ESLint**
|
53
55
|
- Lucy-CLI can lint the code with ESLint.
|
package/dist/Gulpfile.js
CHANGED
@@ -18,7 +18,7 @@ import { cleanSrc, cleanWix } from './gulp/clean.js';
|
|
18
18
|
import { addTypes, updateWixTypes } from './gulp/types.js';
|
19
19
|
import { setProdConfig } from './gulp/pipeline.js';
|
20
20
|
import { watchAll } from './gulp/watchers.js';
|
21
|
-
import { green, magenta, orange, red } from './index.js';
|
21
|
+
import { blue, green, magenta, orange, red } from './index.js';
|
22
22
|
import { getModulesSync } from './gulp/helpers.js';
|
23
23
|
const sass = gulpSass(dartSass);
|
24
24
|
const outputDir = './src';
|
@@ -47,11 +47,13 @@ gulp.task('build-backend', gulp.parallel(buildBackend(taskOptions), buildBackend
|
|
47
47
|
gulp.task('build-public', gulp.parallel(buildPublic(taskOptions)));
|
48
48
|
gulp.task('preview-templates', gulp.parallel(previewTemplates(taskOptions)));
|
49
49
|
gulp.task('copy-files', gulp.parallel(copyFiles(taskOptions)));
|
50
|
-
gulp.task('test',
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
50
|
+
gulp.task('test', function () {
|
51
|
+
return shell.task(['yarn test'], { ignoreErrors: true })().then(() => {
|
52
|
+
console.log("🐕" + blue.underline.bold(' => Exited test task!'));
|
53
|
+
}).catch(err => {
|
54
|
+
console.log("💩" + red.underline.bold(' => Error in test task!'));
|
55
|
+
});
|
56
|
+
});
|
55
57
|
gulp.task('sync-types', shell.task([
|
56
58
|
'yarn postinstall',
|
57
59
|
]));
|
@@ -61,7 +63,7 @@ gulp.task('add-wix-types', function (done) {
|
|
61
63
|
});
|
62
64
|
gulp.task('set-production', gulp.parallel(setProdConfig()));
|
63
65
|
gulp.task('start-wix', shell.task([
|
64
|
-
'yarn wix:dev',
|
66
|
+
'sleep 3; yarn wix:dev',
|
65
67
|
]));
|
66
68
|
gulp.task('gen-docs', shell.task([
|
67
69
|
'yarn docs',
|
@@ -72,9 +74,7 @@ gulp.task('build-pipeline', gulp.series(cleanSrc(taskOptions), 'set-production',
|
|
72
74
|
// 'test',
|
73
75
|
'build'));
|
74
76
|
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'));
|
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))));
|
77
|
+
gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions), 'test', 'start-wix', (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err))));
|
78
78
|
gulp.task('dev', gulp.series(cleanSrc(taskOptions), 'fix-wix', 'build', 'start-dev-env'));
|
79
79
|
async function gulpTaskRunner(task) {
|
80
80
|
return new Promise(function (resolve, reject) {
|
package/dist/gulp/templates.js
CHANGED
@@ -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 tsx --tsconfig
|
22
|
+
.pipe(exec((file) => `npx tsx --tsconfig ./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.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
import { TaskOptions } from '../Gulpfile.js';
|
2
|
-
export declare function
|
2
|
+
export declare function buildPages(options: TaskOptions): () => any;
|
package/dist/gulp/test.js
CHANGED
@@ -5,75 +5,22 @@ const jest = gulpJest.default;
|
|
5
5
|
const taskOpt = {
|
6
6
|
continueOnError: true,
|
7
7
|
};
|
8
|
-
export function
|
9
|
-
const
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
// }
|
14
|
-
// }
|
15
|
-
// Create tasks for each folder
|
16
|
-
const tasks = folders.map((folder) => {
|
17
|
-
const taskName = `tests-coverage-${folder}`; // Create a unique name for each task
|
18
|
-
const task = () => gulp.src([
|
19
|
-
`${folder}/backend/**/*.spec.ts`,
|
20
|
-
])
|
21
|
-
.pipe(exec((file) => `yarn coverage`, taskOpt))
|
8
|
+
export function buildPages(options) {
|
9
|
+
const { outputDir } = options;
|
10
|
+
return () => {
|
11
|
+
return gulp.src('typescript/pages/*.ts')
|
12
|
+
.pipe(swc(swcOptions))
|
22
13
|
.on('error', function (e) {
|
23
|
-
console.log("💩" + red.underline.bold(` =>
|
14
|
+
console.log("💩" + red.underline.bold(` => Build of Pages files failed!`));
|
24
15
|
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
25
16
|
this.emit('end');
|
26
17
|
})
|
27
|
-
.
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return gulp.parallel(...tasks);
|
36
|
-
// return () => {
|
37
|
-
// return gulp.src([
|
38
|
-
// ...folders.map(folder => `${folder}/backend/**/*.spec.ts`)
|
39
|
-
// ])
|
40
|
-
// .pipe(jest({
|
41
|
-
// verbose: true,
|
42
|
-
// extensionsToTreatAsEsm: ['.ts'],
|
43
|
-
// transform: {
|
44
|
-
// '^.+\\.tsx?$': [
|
45
|
-
// 'ts-jest',
|
46
|
-
// {
|
47
|
-
// tsconfig: `./typescript/tsconfig.json`,
|
48
|
-
// usESM: true,
|
49
|
-
// },
|
50
|
-
// ],
|
51
|
-
// },
|
52
|
-
// preset: 'ts-jest',
|
53
|
-
// setupFilesAfterEnv: [],
|
54
|
-
// testEnvironment: 'node',
|
55
|
-
// collectCoverage: true,
|
56
|
-
// coverageDirectory: './coverage',
|
57
|
-
// coverageReporters: ['clover', 'json', 'lcov', 'text'],
|
58
|
-
// rootDir: `./typescript`,
|
59
|
-
// roots: [`.`],
|
60
|
-
// testMatch: ['**/*.spec.ts'],
|
61
|
-
// passWithNoTests: true,
|
62
|
-
// moduleNameMapper: {
|
63
|
-
// 'public/(.*)': [...folders.map(folder => `${folder}/$1`)],
|
64
|
-
// 'backend/(.*)': [...folders.map(folder => `${folder}/$1`)],
|
65
|
-
// }
|
66
|
-
// }))
|
67
|
-
// .on('error', function (e: Error) {
|
68
|
-
// console.log("💩" + red.underline.bold(` => Tests for failed!`));
|
69
|
-
// console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
70
|
-
// this.emit('end');
|
71
|
-
// })
|
72
|
-
// .on('end', function () {
|
73
|
-
// console.log("🐶" + blue.underline(` => Tests succeeded!`));
|
74
|
-
// });
|
75
|
-
// }
|
76
|
-
}
|
77
|
-
function exec(arg0, taskOpt) {
|
78
|
-
throw new Error('Function not implemented.');
|
18
|
+
.pipe(gulp.dest(path.join(outputDir, 'pages')))
|
19
|
+
.on('error', function (e) {
|
20
|
+
console.log("💩" + red.underline.bold(' => Build of Pages TS files failed!'));
|
21
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
22
|
+
this.emit('end');
|
23
|
+
})
|
24
|
+
.on('end', function () { console.log("🐶" + blue.underline(' => Build of Pages TS files succeeded!')); });
|
25
|
+
};
|
79
26
|
}
|
package/dist/gulp/watchers.js
CHANGED
@@ -6,6 +6,7 @@ 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 shell from 'gulp-shell';
|
9
10
|
let taskOptions;
|
10
11
|
export function watchSCSS() {
|
11
12
|
return gulp.watch([
|
@@ -18,13 +19,17 @@ export function watchBackend() {
|
|
18
19
|
'*/backend/**/*.tsx',
|
19
20
|
'!*/backend/**/*.jsw.ts',
|
20
21
|
'!src/**/**',
|
21
|
-
], gulp.parallel(checkTs(taskOptions), buildBackend(taskOptions)
|
22
|
+
], gulp.parallel(checkTs(taskOptions), buildBackend(taskOptions), shell.task([
|
23
|
+
'yarn docs',
|
24
|
+
])));
|
22
25
|
}
|
23
26
|
export function watchPublic() {
|
24
27
|
return gulp.watch([
|
25
28
|
'*/public/**/*.ts',
|
26
29
|
'*/public/**/*.tsx',
|
27
|
-
], gulp.parallel(checkTs(taskOptions), buildPublic(taskOptions)
|
30
|
+
], gulp.parallel(checkTs(taskOptions), buildPublic(taskOptions), shell.task([
|
31
|
+
'yarn docs',
|
32
|
+
])));
|
28
33
|
}
|
29
34
|
export function watchPages() {
|
30
35
|
return gulp.watch('typescript/pages/**/*.ts', gulp.parallel(checkTs(taskOptions), buildPages(taskOptions)));
|
package/dist/settings.json
CHANGED
@@ -41,9 +41,6 @@
|
|
41
41
|
"ts-node": "^10.9.2",
|
42
42
|
"tsx": "^4.19.2",
|
43
43
|
"typedoc": "0.27.1",
|
44
|
-
"typedoc-plugin-merge-modules": "^6.0.3",
|
45
|
-
"typedoc-plugin-zod": "^1.3.0",
|
46
|
-
"typedoc-theme-hierarchy": "^5.0.3",
|
47
44
|
"typescript": "5.6.3",
|
48
45
|
"typescript-eslint": "^8.15.0",
|
49
46
|
"typescript-eslint-language-service": "^5.0.5",
|
@@ -60,7 +57,7 @@
|
|
60
57
|
"build": "lucy-cli build-prod",
|
61
58
|
"fix-wix": "lucy-cli fix-wix",
|
62
59
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
63
|
-
"test": "vitest --ui",
|
60
|
+
"test": "vitest --ui --coverage",
|
64
61
|
"coverage": "vitest run --coverage",
|
65
62
|
"cypress": "cypress open",
|
66
63
|
"e2e": "cypress-cloud run --parallel --record"
|
@@ -0,0 +1,53 @@
|
|
1
|
+
{
|
2
|
+
"typeAcquisition": {
|
3
|
+
"enable": true
|
4
|
+
},
|
5
|
+
"compilerOptions": {
|
6
|
+
"outDir": "../src",
|
7
|
+
"rootDir": ".",
|
8
|
+
"target": "ES2020",
|
9
|
+
"module": "ES2020",
|
10
|
+
"moduleResolution": "Node",
|
11
|
+
"preserveConstEnums": true,
|
12
|
+
"allowSyntheticDefaultImports": true,
|
13
|
+
"skipLibCheck": false,
|
14
|
+
"allowJs": true,
|
15
|
+
"declaration": true,
|
16
|
+
"jsx": "react",
|
17
|
+
"strict": true,
|
18
|
+
"alwaysStrict": false,
|
19
|
+
"noImplicitAny": true,
|
20
|
+
"noImplicitReturns": true,
|
21
|
+
"noImplicitThis": true,
|
22
|
+
"strictNullChecks": true,
|
23
|
+
"exactOptionalPropertyTypes": true,
|
24
|
+
"strictBindCallApply": true,
|
25
|
+
"strictFunctionTypes": true,
|
26
|
+
"strictPropertyInitialization": true,
|
27
|
+
"resolveJsonModule": true,
|
28
|
+
"plugins": [
|
29
|
+
{
|
30
|
+
"name": "@styled/typescript-styled-plugin"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"name": "typescript-eslint-language-service"
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"paths": {
|
37
|
+
"public/*": ["./lib/public/*", "./typescript/public/*"],
|
38
|
+
"backend/*": ["./lib/backend/*", "./typescript/backend/*"],
|
39
|
+
"pages/*": ["./pages/*"],
|
40
|
+
"types/*": ["./types/*"]
|
41
|
+
},
|
42
|
+
"typeRoots": ["./types", "../node_modules/@types"]
|
43
|
+
},
|
44
|
+
"exclude": [
|
45
|
+
"../node_modules",
|
46
|
+
"../.wix",
|
47
|
+
"node_modules",
|
48
|
+
"./wix",
|
49
|
+
"./**/*.test.ts",
|
50
|
+
"../src/**/*"
|
51
|
+
],
|
52
|
+
"include": ["!*.d.ts", "public/**/*.tsx", "**/*.ts"]
|
53
|
+
}
|
package/files/typedoc.json
CHANGED
@@ -7,23 +7,22 @@
|
|
7
7
|
"entryPointStrategy": "expand",
|
8
8
|
"out": "docs",
|
9
9
|
"plugin": [
|
10
|
-
"typedoc-theme
|
11
|
-
"typedoc-plugin-zod",
|
12
|
-
"typedoc-plugin-merge-modules"
|
10
|
+
"typedoc-github-theme",
|
13
11
|
],
|
14
|
-
"
|
15
|
-
"tsconfig": "docs.tsconfig.json",
|
12
|
+
"tsconfig": "local.tsconfig.json",
|
16
13
|
"excludeExternals": true,
|
17
14
|
"externalPattern": [
|
18
15
|
"**/node_modules/**",
|
19
16
|
"**/.wix/**",
|
20
|
-
".wix/**"
|
17
|
+
".wix/**",
|
21
18
|
],
|
22
19
|
"exclude": [
|
23
20
|
"./.wix/**/*",
|
24
|
-
".wix/**/*"
|
21
|
+
".wix/**/*",
|
22
|
+
"cypress/**",
|
23
|
+
"**/__mocks__/**",
|
25
24
|
],
|
26
|
-
"name": "
|
27
|
-
"mergeModulesRenameDefaults":
|
28
|
-
"mergeModulesMergeMode": "project",
|
25
|
+
"name": "wix-integraleakademie",
|
26
|
+
// "mergeModulesRenameDefaults": false, // NEW option of TypeDoc added by this plugin
|
27
|
+
// "mergeModulesMergeMode": "project", // NEW option of TypeDoc added by this plugin
|
29
28
|
}
|
package/files/vitest.config.ts
CHANGED
@@ -1,17 +1,57 @@
|
|
1
|
-
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
2
|
+
import path from 'node:path';
|
3
|
+
|
4
|
+
import fs from 'fs';
|
2
5
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
3
6
|
import { defineConfig } from 'vitest/config';
|
4
7
|
|
5
8
|
export default defineConfig({
|
6
|
-
plugins: [
|
7
|
-
|
8
|
-
|
9
|
+
plugins: [
|
10
|
+
tsconfigPaths({
|
11
|
+
projects: ['./local.tsconfig.json'],
|
12
|
+
}),
|
13
|
+
{
|
14
|
+
name: 'multi-folder-wix-resolution',
|
15
|
+
enforce: 'pre',
|
16
|
+
resolveId(source) {
|
17
|
+
|
18
|
+
if (source.startsWith('wix')){
|
19
|
+
const baseName = source.replace(/^wix/, '');
|
20
|
+
const candidates = [
|
21
|
+
path.resolve(__dirname, './lib/__mocks__/wix' + baseName),
|
22
|
+
path.resolve(__dirname, './typescript/__mocks__/wix' + baseName),
|
23
|
+
];
|
24
|
+
|
25
|
+
for (const candidate of candidates){
|
26
|
+
if (fs.existsSync(candidate + '.ts') || fs.existsSync(candidate + '/index.ts')){
|
27
|
+
return candidate;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
return null;
|
33
|
+
},
|
34
|
+
},
|
35
|
+
],
|
9
36
|
test: {
|
10
37
|
coverage: {
|
11
38
|
provider: 'v8',
|
12
39
|
reporter: ['text', 'json', 'html'],
|
13
40
|
reportsDirectory: './coverage',
|
14
|
-
exclude: ['**/node_modules/**', 'src/**', '.wix/**'],
|
41
|
+
exclude: ['**/node_modules/**', 'src/**', '.wix/**', '**/models/**', '**/__mocks__/**', 'docs/**', 'cypress/**', '**/pages/**'],
|
15
42
|
},
|
43
|
+
alias: {}
|
16
44
|
},
|
45
|
+
// resolve: {
|
46
|
+
// alias: [
|
47
|
+
// {
|
48
|
+
// find: /^wix(.*)$/,
|
49
|
+
// replacement: path.resolve(__dirname, './lib/__mocks__/wix$1'),
|
50
|
+
// },
|
51
|
+
// {
|
52
|
+
// find: /^wix(.*)$/,
|
53
|
+
// replacement: path.resolve(__dirname, './typescript/__mocks__/wix$1'),
|
54
|
+
// },
|
55
|
+
// ],
|
56
|
+
// },
|
17
57
|
});
|
package/package.json
CHANGED
package/src/Gulpfile.ts
CHANGED
@@ -20,8 +20,7 @@ import { cleanSrc, cleanWix } from './gulp/clean.js';
|
|
20
20
|
import { addTypes, updateWixTypes } from './gulp/types.js';
|
21
21
|
import { setProdConfig } from './gulp/pipeline.js';
|
22
22
|
import { watchAll } from './gulp/watchers.js';
|
23
|
-
import { ModuleSettings, ProjectSettings, green, magenta, orange, red } from './index.js';
|
24
|
-
import { test } from './gulp/test.js';
|
23
|
+
import { ModuleSettings, ProjectSettings, blue, green, magenta, orange, red } from './index.js';
|
25
24
|
import { getModulesSync } from './gulp/helpers.js';
|
26
25
|
|
27
26
|
const sass = gulpSass(dartSass);
|
@@ -95,13 +94,16 @@ gulp.task('copy-files', gulp.parallel(
|
|
95
94
|
copyFiles(taskOptions),
|
96
95
|
));
|
97
96
|
|
98
|
-
gulp.task('test',
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
));
|
104
|
-
|
97
|
+
gulp.task('test', function () {
|
98
|
+
return shell.task(
|
99
|
+
['yarn test'],
|
100
|
+
{ ignoreErrors: true }
|
101
|
+
)().then(() => {
|
102
|
+
console.log("🐕" + blue.underline.bold(' => Exited test task!'));
|
103
|
+
}).catch(err => {
|
104
|
+
console.log("💩" + red.underline.bold(' => Error in test task!'));
|
105
|
+
});
|
106
|
+
});
|
105
107
|
|
106
108
|
gulp.task('sync-types', shell.task([
|
107
109
|
'yarn postinstall',
|
@@ -120,7 +122,7 @@ gulp.task('set-production', gulp.parallel(
|
|
120
122
|
));
|
121
123
|
|
122
124
|
gulp.task('start-wix', shell.task([
|
123
|
-
'yarn wix:dev',
|
125
|
+
'sleep 3; yarn wix:dev',
|
124
126
|
]));
|
125
127
|
|
126
128
|
gulp.task('gen-docs', shell.task([
|
@@ -169,7 +171,7 @@ gulp.task('build-prod', gulp.series(
|
|
169
171
|
|
170
172
|
gulp.task('start-dev-env', gulp.parallel(
|
171
173
|
watchAll(taskOptions),
|
172
|
-
|
174
|
+
'test',
|
173
175
|
'start-wix',
|
174
176
|
(done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
|
175
177
|
));
|
package/src/gulp/templates.ts
CHANGED
@@ -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 tsx --tsconfig
|
27
|
+
.pipe(exec((file: File) => `npx tsx --tsconfig ./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/watchers.ts
CHANGED
@@ -7,7 +7,6 @@ import { buildPages } from './pages.js';
|
|
7
7
|
import { copyFiles } from './copy.js';
|
8
8
|
import { previewTemplates } from './templates.js';
|
9
9
|
import { checkPages, checkTs } from './checks.js';
|
10
|
-
import { test } from './test.js';
|
11
10
|
import shell from 'gulp-shell';
|
12
11
|
|
13
12
|
let taskOptions: TaskOptions;
|
@@ -29,7 +28,9 @@ export function watchBackend() {
|
|
29
28
|
], gulp.parallel(
|
30
29
|
checkTs(taskOptions),
|
31
30
|
buildBackend(taskOptions),
|
32
|
-
|
31
|
+
shell.task([
|
32
|
+
'yarn docs',
|
33
|
+
]))
|
33
34
|
);
|
34
35
|
}
|
35
36
|
|
@@ -40,7 +41,9 @@ export function watchPublic() {
|
|
40
41
|
], gulp.parallel(
|
41
42
|
checkTs(taskOptions),
|
42
43
|
buildPublic(taskOptions),
|
43
|
-
|
44
|
+
shell.task([
|
45
|
+
'yarn docs',
|
46
|
+
]))
|
44
47
|
);
|
45
48
|
}
|
46
49
|
|
package/src/settings.json
CHANGED
@@ -41,9 +41,6 @@
|
|
41
41
|
"ts-node": "^10.9.2",
|
42
42
|
"tsx": "^4.19.2",
|
43
43
|
"typedoc": "0.27.1",
|
44
|
-
"typedoc-plugin-merge-modules": "^6.0.3",
|
45
|
-
"typedoc-plugin-zod": "^1.3.0",
|
46
|
-
"typedoc-theme-hierarchy": "^5.0.3",
|
47
44
|
"typescript": "5.6.3",
|
48
45
|
"typescript-eslint": "^8.15.0",
|
49
46
|
"typescript-eslint-language-service": "^5.0.5",
|
@@ -60,7 +57,7 @@
|
|
60
57
|
"build": "lucy-cli build-prod",
|
61
58
|
"fix-wix": "lucy-cli fix-wix",
|
62
59
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
63
|
-
"test": "vitest --ui",
|
60
|
+
"test": "vitest --ui --coverage",
|
64
61
|
"coverage": "vitest run --coverage",
|
65
62
|
"cypress": "cypress open",
|
66
63
|
"e2e": "cypress-cloud run --parallel --record"
|
package/src/gulp/test.ts
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import { blue, orange, red } from '../index.js';
|
3
|
-
import gulpJest from 'gulp-jest';
|
4
|
-
import { TaskOptions } from '../Gulpfile.js';
|
5
|
-
const jest = gulpJest.default;
|
6
|
-
|
7
|
-
const taskOpt = {
|
8
|
-
continueOnError: true,
|
9
|
-
};
|
10
|
-
export function test(options: TaskOptions) {
|
11
|
-
const folders = ['typescript'];
|
12
|
-
// if (options.modulesSync){
|
13
|
-
// for (const module of Object.keys(options.modulesSync)) {
|
14
|
-
// folders.push(module);
|
15
|
-
// }
|
16
|
-
// }
|
17
|
-
|
18
|
-
// Create tasks for each folder
|
19
|
-
const tasks = folders.map((folder) => {
|
20
|
-
const taskName = `tests-coverage-${folder}`; // Create a unique name for each task
|
21
|
-
const task = () =>
|
22
|
-
gulp.src([
|
23
|
-
`${folder}/backend/**/*.spec.ts`,
|
24
|
-
])
|
25
|
-
.pipe(exec((file: File) => `yarn coverage`, taskOpt))
|
26
|
-
.on('error', function (e: Error) {
|
27
|
-
console.log("💩" + red.underline.bold(` => Failed to generate coverage for ${orange(folder)} failed!`));
|
28
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
29
|
-
this.emit('end');
|
30
|
-
})
|
31
|
-
.on('end', function () {
|
32
|
-
console.log("🐶" + blue.underline(` => Coverage for ${orange(folder)} succeeded!`));
|
33
|
-
});
|
34
|
-
|
35
|
-
// Register the task with Gulp
|
36
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
37
|
-
return task;
|
38
|
-
});
|
39
|
-
|
40
|
-
// Run all tasks in parallel
|
41
|
-
return gulp.parallel(...tasks);
|
42
|
-
|
43
|
-
// return () => {
|
44
|
-
// return gulp.src([
|
45
|
-
// ...folders.map(folder => `${folder}/backend/**/*.spec.ts`)
|
46
|
-
// ])
|
47
|
-
// .pipe(jest({
|
48
|
-
// verbose: true,
|
49
|
-
// extensionsToTreatAsEsm: ['.ts'],
|
50
|
-
// transform: {
|
51
|
-
// '^.+\\.tsx?$': [
|
52
|
-
// 'ts-jest',
|
53
|
-
// {
|
54
|
-
// tsconfig: `./typescript/tsconfig.json`,
|
55
|
-
// usESM: true,
|
56
|
-
// },
|
57
|
-
// ],
|
58
|
-
// },
|
59
|
-
// preset: 'ts-jest',
|
60
|
-
// setupFilesAfterEnv: [],
|
61
|
-
// testEnvironment: 'node',
|
62
|
-
// collectCoverage: true,
|
63
|
-
// coverageDirectory: './coverage',
|
64
|
-
// coverageReporters: ['clover', 'json', 'lcov', 'text'],
|
65
|
-
// rootDir: `./typescript`,
|
66
|
-
// roots: [`.`],
|
67
|
-
// testMatch: ['**/*.spec.ts'],
|
68
|
-
// passWithNoTests: true,
|
69
|
-
// moduleNameMapper: {
|
70
|
-
// 'public/(.*)': [...folders.map(folder => `${folder}/$1`)],
|
71
|
-
// 'backend/(.*)': [...folders.map(folder => `${folder}/$1`)],
|
72
|
-
// }
|
73
|
-
// }))
|
74
|
-
// .on('error', function (e: Error) {
|
75
|
-
// console.log("💩" + red.underline.bold(` => Tests for failed!`));
|
76
|
-
// console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
77
|
-
// this.emit('end');
|
78
|
-
// })
|
79
|
-
// .on('end', function () {
|
80
|
-
// console.log("🐶" + blue.underline(` => Tests succeeded!`));
|
81
|
-
// });
|
82
|
-
// }
|
83
|
-
}
|
84
|
-
|
85
|
-
function exec(arg0: (file: File) => string, taskOpt: { continueOnError: boolean; }): any {
|
86
|
-
throw new Error('Function not implemented.');
|
87
|
-
}
|