lucy-cli 0.7.15 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +29 -1
- package/dist/Gulpfile.d.ts +1 -0
- package/dist/Gulpfile.js +14 -12
- package/dist/gulp/backend.d.ts +2 -5
- package/dist/gulp/backend.js +43 -82
- package/dist/gulp/checks.d.ts +2 -2
- package/dist/gulp/checks.js +21 -22
- package/dist/gulp/copy.d.ts +1 -2
- package/dist/gulp/copy.js +29 -34
- package/dist/gulp/helpers.d.ts +1 -0
- package/dist/gulp/helpers.js +7 -0
- package/dist/gulp/public.d.ts +1 -2
- package/dist/gulp/public.js +20 -33
- package/dist/gulp/styles.d.ts +1 -1
- package/dist/gulp/styles.js +19 -6
- package/dist/gulp/templates.d.ts +2 -2
- package/dist/gulp/templates.js +27 -30
- package/dist/gulp/test.d.ts +2 -2
- package/dist/gulp/test.js +24 -50
- package/dist/gulp/types.js +9 -18
- package/dist/gulp/watchers.d.ts +0 -6
- package/dist/gulp/watchers.js +27 -61
- package/dist/helpers.d.ts +4 -0
- package/dist/helpers.js +19 -0
- package/dist/index.js +7 -1
- package/dist/models.d.ts +37 -0
- package/dist/models.js +1 -0
- package/files/typescript/templates/render.ts +32 -0
- package/lucy.jpg +0 -0
- package/package.json +1 -1
- package/settings/master-settings.json +0 -1
- package/settings/page-settings.json +0 -1
- package/settings/public-settings.json +0 -1
- package/src/Gulpfile.ts +13 -17
- package/src/gulp/backend.ts +74 -107
- package/src/gulp/checks.ts +32 -28
- package/src/gulp/copy.ts +38 -40
- package/src/gulp/helpers.ts +9 -0
- package/src/gulp/public.ts +36 -47
- package/src/gulp/styles.ts +32 -13
- package/src/gulp/templates.ts +38 -39
- package/src/gulp/test.ts +55 -75
- package/src/gulp/types.ts +28 -41
- package/src/gulp/watchers.ts +31 -101
- package/src/helpers.ts +23 -1
- package/src/index.ts +7 -1
- package/src/models.ts +35 -0
package/src/gulp/backend.ts
CHANGED
@@ -3,130 +3,97 @@ import { createGulpEsbuild } from 'gulp-esbuild';
|
|
3
3
|
import rename from 'gulp-rename';
|
4
4
|
import * as path from 'path';
|
5
5
|
import { TaskOptions } from '../Gulpfile';
|
6
|
-
import { blue, red } from '../index.js';
|
7
|
-
import ts from 'gulp-typescript';
|
8
|
-
import merge from 'merge2';
|
9
|
-
import esbuild from 'gulp-esbuild';
|
10
|
-
import concat from 'gulp-concat';
|
11
|
-
import tsConf from '../../files/typescript/tsconfig.json' assert { type: 'json' };
|
12
|
-
|
13
|
-
|
14
|
-
type TsSettings = ts.Settings;
|
15
|
-
const tsOptions:TsSettings = tsConf.compilerOptions;
|
6
|
+
import { blue, orange, red } from '../index.js';
|
16
7
|
|
17
8
|
export function buildBackend(options: TaskOptions) {
|
18
|
-
const
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
return () => {
|
24
|
-
return gulp.src([
|
25
|
-
'typescript/backend/**/*.ts',
|
26
|
-
'typescript/backend/**/*.tsx',
|
27
|
-
'!typescript/backend/**/*.jsw.ts',
|
28
|
-
'!typescript/backend/**/*.spec.ts',
|
29
|
-
'!typescript/backend/http-functions.ts',
|
30
|
-
])
|
31
|
-
.pipe(gulpEsbuild({
|
32
|
-
bundle: false,
|
33
|
-
}))
|
34
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
35
|
-
.on('error', function () {
|
36
|
-
console.log("💩" + red.underline.bold(' => Build of Backend TS files failed!'));
|
37
|
-
this.emit('end');
|
38
|
-
})
|
39
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Build of Backend TS files succeeded!'));
|
9
|
+
const folders = ['typescript'];
|
10
|
+
if (options.modulesSync){
|
11
|
+
for (const module of Object.keys(options.modulesSync)) {
|
12
|
+
folders.push(module);
|
40
13
|
}
|
41
|
-
|
42
|
-
}
|
14
|
+
}
|
43
15
|
|
44
|
-
export function buildBackendLib(options: TaskOptions) {
|
45
16
|
const { outputDir, enableIncrementalBuild } = options;
|
46
17
|
const gulpEsbuild = createGulpEsbuild({
|
47
18
|
incremental: enableIncrementalBuild,
|
48
19
|
});
|
49
|
-
|
50
|
-
return () => {
|
51
|
-
return gulp.src([
|
52
|
-
'lib/backend/**/*.ts',
|
53
|
-
'lib/backend/**/*.tsx',
|
54
|
-
'!lib/backend/**/*.jsw.ts',
|
55
|
-
'!lib/backend/**/*.spec.ts',
|
56
|
-
'!lib/backend/http-functions.ts',
|
57
|
-
])
|
58
|
-
.pipe(gulpEsbuild({
|
59
|
-
bundle: false,
|
60
|
-
}))
|
61
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
62
|
-
.on('error', function () {
|
63
|
-
console.log("💩" + red.underline.bold(' => Build of Backend TS (LIB) files failed!'));
|
64
|
-
this.emit('end');
|
65
|
-
})
|
66
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Build of Backend TS (LIB) files succeeded!'));
|
67
|
-
}
|
68
|
-
)}
|
69
|
-
}
|
70
20
|
|
71
|
-
|
72
|
-
const
|
73
|
-
|
74
|
-
|
21
|
+
// Create tasks for each folder
|
22
|
+
const tasks = folders.map((folder) => {
|
23
|
+
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
24
|
+
|
25
|
+
const task = () =>
|
26
|
+
gulp.src([
|
27
|
+
`${folder}/backend/**/*.ts`,
|
28
|
+
`${folder}/backend/**/*.tsx`,
|
29
|
+
`!${folder}/backend/**/*.jsw.ts`,
|
30
|
+
`!${folder}/backend/**/*.spec.ts`,
|
31
|
+
])
|
32
|
+
.pipe(
|
33
|
+
gulpEsbuild({
|
34
|
+
bundle: false,
|
35
|
+
})
|
36
|
+
)
|
37
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
38
|
+
.on('error', function () {
|
39
|
+
console.log("💩" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
40
|
+
this.emit('end');
|
41
|
+
})
|
42
|
+
.on('end', function () {
|
43
|
+
console.log("🐶" + blue.underline(` => Build of Backend files for ${orange(folder)} succeeded!`));
|
44
|
+
});
|
45
|
+
|
46
|
+
// Register the task with Gulp
|
47
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
48
|
+
return task;
|
75
49
|
});
|
76
50
|
|
77
|
-
|
78
|
-
|
79
|
-
.pipe(gulpEsbuild({
|
80
|
-
bundle: false,
|
81
|
-
}))
|
82
|
-
.pipe(rename({ extname: '' }))
|
83
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
84
|
-
.on('error', function () {
|
85
|
-
console.log("💩" + red.underline.bold(' => Build of JSW files failed!'));
|
86
|
-
this.emit('end');
|
87
|
-
})
|
88
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Build of (JSW) files succeeded!'))})
|
89
|
-
}
|
51
|
+
// Run all tasks in parallel
|
52
|
+
return gulp.parallel(...tasks);
|
90
53
|
}
|
91
54
|
|
92
|
-
|
55
|
+
|
56
|
+
export function buildBackendJSW(options: TaskOptions) {
|
57
|
+
const folders = ['typescript'];
|
58
|
+
if (options.modulesSync){
|
59
|
+
for (const module of Object.keys(options.modulesSync)) {
|
60
|
+
folders.push(module);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
93
64
|
const { outputDir, enableIncrementalBuild } = options;
|
94
65
|
const gulpEsbuild = createGulpEsbuild({
|
95
66
|
incremental: enableIncrementalBuild,
|
96
67
|
});
|
97
68
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
bundle: false,
|
102
|
-
}))
|
103
|
-
.pipe(rename({ extname: '' }))
|
104
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
105
|
-
.on('error', function () {
|
106
|
-
console.log("💩" + red.underline.bold(' => Build of JSW (LIB) files failed!'));
|
107
|
-
this.emit('end');
|
108
|
-
})
|
109
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Build of JSW (LIB) files succeeded!'))})
|
110
|
-
}
|
111
|
-
}
|
69
|
+
// Create tasks for each folder
|
70
|
+
const tasks = folders.map((folder) => {
|
71
|
+
const taskName = `build-${folder}`; // Create a unique name for each task
|
112
72
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
73
|
+
const task = () =>
|
74
|
+
gulp.src([
|
75
|
+
`${folder}/backend/**/*.jsw.ts`,
|
76
|
+
])
|
77
|
+
.pipe(
|
78
|
+
gulpEsbuild({
|
79
|
+
bundle: false,
|
80
|
+
})
|
81
|
+
)
|
82
|
+
.pipe(rename({ extname: '' }))
|
83
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
84
|
+
.on('error', function () {
|
85
|
+
console.log("💩" + red.underline.bold(` => Build of JSW files for ${orange(folder)} failed!`));
|
86
|
+
this.emit('end');
|
87
|
+
})
|
88
|
+
.on('end', function () {
|
89
|
+
console.log("🐶" + blue.underline(` => Build of JSW files for ${orange(folder)} succeeded!`));
|
90
|
+
});
|
91
|
+
|
92
|
+
// Register the task with Gulp
|
93
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
94
|
+
return task;
|
95
|
+
});
|
96
|
+
|
97
|
+
// Run all tasks in parallel
|
98
|
+
return gulp.parallel(...tasks);
|
132
99
|
}
|
package/src/gulp/checks.ts
CHANGED
@@ -3,7 +3,8 @@ import glob from 'glob';
|
|
3
3
|
import * as path from 'path';
|
4
4
|
import gulp from 'gulp';
|
5
5
|
import ts from 'gulp-typescript';
|
6
|
-
import { blue, green, magenta, red, yellow } from '../index.js';
|
6
|
+
import { blue, green, magenta, orange, red, yellow } from '../index.js';
|
7
|
+
import { TaskOptions } from '../Gulpfile.js';
|
7
8
|
|
8
9
|
/**
|
9
10
|
* Extracts a match from a file
|
@@ -118,33 +119,36 @@ export async function checkPages(fail: boolean, force: boolean) {
|
|
118
119
|
});
|
119
120
|
}
|
120
121
|
|
121
|
-
export function checkTs() {
|
122
|
-
const
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
122
|
+
export function checkTs(options: TaskOptions) {
|
123
|
+
const folders = ['typescript'];
|
124
|
+
if (options.modulesSync){
|
125
|
+
for (const module of Object.keys(options.modulesSync)) {
|
126
|
+
folders.push(module);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
// Create tasks for each folder
|
131
|
+
const tasks = folders.map((folder) => {
|
132
|
+
const tsProject = ts.createProject(`./${folder}/tsconfig.json`, { noEmit: true });
|
133
|
+
|
134
|
+
const taskName = `test-${folder}`; // Create a unique name for each task
|
135
|
+
|
136
|
+
const task = () =>
|
137
|
+
gulp.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`], { cwd: folder })
|
138
|
+
.pipe(tsProject(ts.reporter.fullReporter()))
|
139
|
+
.on('error', function () {
|
140
|
+
console.log("💩" + red.underline.bold(` => Typescriptcheck for ${orange(folder)} failed!`));
|
141
|
+
this.emit('end');
|
142
|
+
})
|
143
|
+
.on('end', function () {
|
144
|
+
console.log("🐶" + blue.underline(` => Typescriptcheck for ${orange(folder)} succeeded!`));
|
145
|
+
});
|
135
146
|
|
136
|
-
|
137
|
-
|
147
|
+
// Register the task with Gulp
|
148
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
149
|
+
return task;
|
150
|
+
});
|
138
151
|
|
139
|
-
|
140
|
-
|
141
|
-
.pipe(tsProject(ts.reporter.fullReporter()))
|
142
|
-
.on('error', function () {
|
143
|
-
console.log("💩" + red.underline.bold(' => Typescript (LIB) error!'));
|
144
|
-
this.emit('end');
|
145
|
-
})
|
146
|
-
.on('end', function () {
|
147
|
-
console.log("🐶" + blue.underline(' => Typescript check (LIB) succeeded!'));
|
148
|
-
});
|
149
|
-
};
|
152
|
+
// Run all tasks in parallel
|
153
|
+
return gulp.parallel(...tasks);
|
150
154
|
}
|
package/src/gulp/copy.ts
CHANGED
@@ -1,48 +1,46 @@
|
|
1
1
|
import gulp from 'gulp';
|
2
2
|
import chalk from 'chalk';
|
3
3
|
import { TaskOptions } from '../Gulpfile';
|
4
|
-
import { blue, red } from '../index.js';
|
4
|
+
import { blue, orange, red } from '../index.js';
|
5
5
|
|
6
6
|
export function copyFiles(options: TaskOptions) {
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
'!typescript/*tsconfig.json',
|
13
|
-
'!typescript/**/*.ts',
|
14
|
-
'!typescript/**/*.tsx',
|
15
|
-
'!typescript/types/**/**',
|
16
|
-
'!typescript/__mocks__/**/**',
|
17
|
-
'!typescript/styles/**',
|
18
|
-
])
|
19
|
-
.pipe(gulp.dest(outputDir))
|
20
|
-
.on('error', function () {
|
21
|
-
console.log("💩" + red.underline.bold(' => Copy of files failed!'));
|
22
|
-
this.emit('end');
|
23
|
-
})
|
24
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Copy of files succeeded!')); });
|
7
|
+
const folders = ['typescript'];
|
8
|
+
if (options.modulesSync){
|
9
|
+
for (const module of Object.keys(options.modulesSync)) {
|
10
|
+
folders.push(module);
|
11
|
+
}
|
25
12
|
}
|
26
|
-
}
|
27
13
|
|
28
|
-
|
29
|
-
const
|
14
|
+
// Create tasks for each folder
|
15
|
+
const tasks = folders.map((folder) => {
|
16
|
+
const { outputDir} = options;
|
30
17
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
18
|
+
const taskName = `copy-${folder}`; // Create a unique name for each task
|
19
|
+
|
20
|
+
const task = () =>
|
21
|
+
gulp.src([
|
22
|
+
`${folder}/**/*`,
|
23
|
+
`!${folder}/*tsconfig.json`,
|
24
|
+
`!${folder}/**/*.ts`,
|
25
|
+
`!${folder}/**/*.tsx`,
|
26
|
+
`!${folder}/types/**/**`,
|
27
|
+
`!${folder}/__mocks__/**/**`,
|
28
|
+
`!${folder}/styles/**`,
|
29
|
+
])
|
30
|
+
.pipe(gulp.dest(outputDir))
|
31
|
+
.on('error', function () {
|
32
|
+
console.log("💩" + red.underline.bold(` => Copy of files for ${orange(folder)} failed!`));
|
33
|
+
this.emit('end');
|
34
|
+
})
|
35
|
+
.on('end', function () {
|
36
|
+
console.log("🐶" + blue.underline(` => Copy of files for ${orange(folder)} succeeded!`));
|
37
|
+
});
|
38
|
+
|
39
|
+
// Register the task with Gulp
|
40
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
41
|
+
return task;
|
42
|
+
});
|
43
|
+
|
44
|
+
// Run all tasks in parallel
|
45
|
+
return gulp.parallel(...tasks);
|
46
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
import * as path from 'path';
|
3
|
+
import * as fs from 'fs';
|
4
|
+
|
5
|
+
export function getModulesSync(): Record<string, string> | undefined {
|
6
|
+
const absolutePath = path.resolve('./lucy.json');
|
7
|
+
const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
|
8
|
+
return JSON.parse(fileContent).modules;
|
9
|
+
}
|
package/src/gulp/public.ts
CHANGED
@@ -3,62 +3,51 @@ import { createGulpEsbuild } from 'gulp-esbuild';
|
|
3
3
|
|
4
4
|
import * as path from 'path';
|
5
5
|
import { TaskOptions } from '../Gulpfile';
|
6
|
-
import { blue, red } from '../index.js';
|
6
|
+
import { blue, orange, red } from '../index.js';
|
7
7
|
|
8
8
|
export function buildPublic(options: TaskOptions) {
|
9
|
+
const folders = ['typescript'];
|
10
|
+
if (options.modulesSync){
|
11
|
+
for (const module of Object.keys(options.modulesSync)) {
|
12
|
+
folders.push(module);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
9
16
|
const { outputDir, enableIncrementalBuild } = options;
|
10
17
|
const gulpEsbuild = createGulpEsbuild({
|
11
18
|
incremental: enableIncrementalBuild,
|
12
19
|
});
|
13
20
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
'typescript/public/**/*.tsx',
|
18
|
-
])
|
19
|
-
.pipe(gulpEsbuild({
|
20
|
-
bundle: false,
|
21
|
-
loader: {
|
22
|
-
'.tsx': 'tsx',
|
23
|
-
},
|
24
|
-
}))
|
25
|
-
.pipe(gulp.dest(path.join(outputDir, 'public')))
|
26
|
-
.on('error', function () {
|
27
|
-
console.log("💩" + red.underline.bold(' => Build of Public TS files failed!'));
|
28
|
-
this.emit('end');
|
29
|
-
})
|
30
|
-
.on('end', function () {
|
31
|
-
console.log("🐶" + blue.underline(' => Build of Public TS files succeeded!'));
|
32
|
-
});
|
33
|
-
};
|
34
|
-
}
|
21
|
+
// Create tasks for each folder
|
22
|
+
const tasks = folders.map((folder) => {
|
23
|
+
const taskName = `build_Public-${folder}`; // Create a unique name for each task
|
35
24
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
25
|
+
const task = () =>
|
26
|
+
gulp.src([
|
27
|
+
`${folder}/public/**/*.ts`,
|
28
|
+
`${folder}/public/**/*.tsx`,
|
29
|
+
])
|
30
|
+
.pipe(gulpEsbuild({
|
31
|
+
bundle: false,
|
32
|
+
loader: {
|
33
|
+
'.tsx': 'tsx',
|
34
|
+
},
|
35
|
+
}))
|
36
|
+
.pipe(gulp.dest(path.join(outputDir, 'public')))
|
37
|
+
.on('error', function () {
|
38
|
+
console.log("💩" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
39
|
+
this.emit('end');
|
40
|
+
})
|
41
|
+
.on('end', function () {
|
42
|
+
console.log("🐶" + blue.underline(` => Build of Public files for ${orange(folder)} succeeded!`));
|
43
|
+
});
|
44
|
+
|
45
|
+
// Register the task with Gulp
|
46
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
47
|
+
return task;
|
40
48
|
});
|
41
49
|
|
42
|
-
|
43
|
-
|
44
|
-
'lib/public/**/*.ts',
|
45
|
-
'lib/public/**/*.tsx'
|
46
|
-
])
|
47
|
-
.pipe(gulpEsbuild({
|
48
|
-
bundle: false,
|
49
|
-
loader: {
|
50
|
-
'.tsx': 'tsx',
|
51
|
-
},
|
52
|
-
}))
|
53
|
-
.pipe(gulp.dest(path.join(outputDir, 'public')))
|
54
|
-
.on('error', function () {
|
55
|
-
console.log("💩" + red.underline.bold(' => Build of Public (LIB) TS files failed!'));
|
56
|
-
this.emit('end');
|
57
|
-
})
|
58
|
-
.on('end', function () {
|
59
|
-
console.log("🐶" + blue.underline(' => Build of Public (LIB) TS files succeeded!'));
|
60
|
-
});
|
61
|
-
};
|
50
|
+
// Run all tasks in parallel
|
51
|
+
return gulp.parallel(...tasks);
|
62
52
|
}
|
63
53
|
|
64
|
-
|
package/src/gulp/styles.ts
CHANGED
@@ -1,21 +1,40 @@
|
|
1
1
|
import gulp from 'gulp';
|
2
2
|
import chalk from 'chalk';
|
3
3
|
import { TaskOptions } from '../Gulpfile';
|
4
|
-
import { blue, red } from '../index.js';
|
4
|
+
import { blue, orange, red } from '../index.js';
|
5
5
|
|
6
6
|
export function compileScss(options: TaskOptions) {
|
7
|
+
const folders = ['typescript'];
|
8
|
+
// if (options.modulesSync){
|
9
|
+
// for (const module of Object.keys(options.modulesSync)) {
|
10
|
+
// folders.push(module);
|
11
|
+
// }
|
12
|
+
// }
|
13
|
+
|
7
14
|
const { sass, outputDir} = options;
|
8
15
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
|
17
|
+
// Create tasks for each folder
|
18
|
+
const tasks = folders.map((folder) => {
|
19
|
+
const taskName = `compile_sass-${folder}`; // Create a unique name for each task
|
20
|
+
|
21
|
+
const task = () =>
|
22
|
+
gulp.src(['typescript/styles/global.scss'])
|
23
|
+
.pipe(sass().on('error', sass.logError))
|
24
|
+
.pipe(gulp.dest(`${outputDir}/styles`))
|
25
|
+
.on('error', function () {
|
26
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange(folder)} failed!`));
|
27
|
+
this.emit('end');
|
28
|
+
})
|
29
|
+
.on('end', function () {
|
30
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange(folder)} succeeded!`));
|
31
|
+
});
|
32
|
+
|
33
|
+
// Register the task with Gulp
|
34
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
35
|
+
return task;
|
36
|
+
});
|
37
|
+
|
38
|
+
// Run all tasks in parallel
|
39
|
+
return gulp.parallel(...tasks);
|
21
40
|
}
|
package/src/gulp/templates.ts
CHANGED
@@ -1,44 +1,43 @@
|
|
1
1
|
import gulp from 'gulp';
|
2
|
-
import { File } from '../Gulpfile';
|
2
|
+
import { File, TaskOptions } from '../Gulpfile';
|
3
3
|
import exec from 'gulp-exec';
|
4
|
-
import { blue, red } from '../index.js';
|
4
|
+
import { blue, orange, red } from '../index.js';
|
5
5
|
|
6
|
-
export function previewTemplates() {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
])
|
17
|
-
.pipe(exec((file: File) => `npx ts-node-esm -T ${file.path}`, options))
|
18
|
-
.on('error', function () {
|
19
|
-
console.log("💩" + red.underline.bold(' => Render of Template failed!'));
|
20
|
-
this.emit('end');
|
21
|
-
})
|
22
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Render of Template succeeded!')); });
|
23
|
-
};
|
24
|
-
}
|
25
|
-
|
26
|
-
export function previewTemplatesLib() {
|
27
|
-
const options = {
|
28
|
-
continueOnError: true,
|
29
|
-
};
|
30
|
-
|
31
|
-
return () => {
|
32
|
-
return gulp.src([
|
33
|
-
'lib/backend/templates/**/*.tsx',
|
34
|
-
'lib/backend/templates/data/*.json',
|
35
|
-
'!lib/backend/templates/render.ts',
|
36
|
-
])
|
37
|
-
.pipe(exec((file: File) => `npx ts-node-esm -T ${file.path}`, options))
|
38
|
-
.on('error', function () {
|
39
|
-
console.log("💩" + red.underline.bold(' => Render of Template (LIB) failed!'));
|
40
|
-
this.emit('end');
|
41
|
-
})
|
42
|
-
.on('end', function() { console.log("🐶" + blue.underline(' => Render of Template (LIB) succeeded!')); });
|
6
|
+
export function previewTemplates(options: TaskOptions) {
|
7
|
+
const folders = ['typescript'];
|
8
|
+
if (options.modulesSync){
|
9
|
+
for (const module of Object.keys(options.modulesSync)) {
|
10
|
+
folders.push(module);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
const taskOpt = {
|
15
|
+
continueOnError: true,
|
43
16
|
};
|
17
|
+
|
18
|
+
// Create tasks for each folder
|
19
|
+
const tasks = folders.map((folder) => {
|
20
|
+
const taskName = `render_templates-${folder}`; // Create a unique name for each task
|
21
|
+
const task = () =>
|
22
|
+
gulp.src([
|
23
|
+
`${folder}/backend/templates/**/*.tsx`,
|
24
|
+
`${folder}/backend/templates/data/*.json`,
|
25
|
+
`!${folder}/backend/templates/render.ts`,
|
26
|
+
])
|
27
|
+
.pipe(exec((file: File) => `npx ts-node-esm -T ${file.path}`, taskOpt))
|
28
|
+
.on('error', function () {
|
29
|
+
console.log("💩" + red.underline.bold(` => Render of Template for ${orange(folder)} failed!`));
|
30
|
+
this.emit('end');
|
31
|
+
})
|
32
|
+
.on('end', function () {
|
33
|
+
console.log("🐶" + blue.underline(` => Render of Template for ${orange(folder)} succeeded!`));
|
34
|
+
});
|
35
|
+
|
36
|
+
// Register the task with Gulp
|
37
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
38
|
+
return task;
|
39
|
+
});
|
40
|
+
|
41
|
+
// Run all tasks in parallel
|
42
|
+
return gulp.parallel(...tasks);
|
44
43
|
}
|