lucy-cli 1.2.3 → 1.2.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 +4 -2
- package/dist/Gulpfile.d.ts +1 -0
- package/dist/Gulpfile.js +2 -1
- package/dist/gulp/backend.js +2 -12
- package/dist/gulp/checks.js +1 -6
- package/dist/gulp/copy.js +1 -6
- package/dist/gulp/helpers.d.ts +1 -0
- package/dist/gulp/helpers.js +17 -0
- package/dist/gulp/public.js +1 -6
- package/dist/gulp/styles.js +32 -29
- package/dist/gulp/templates.js +1 -6
- package/dist/helpers.js +8 -7
- package/dist/index.d.ts +9 -1
- package/files/typescript/public/scss/app.scss +0 -0
- package/package.json +1 -1
- package/src/Gulpfile.ts +3 -1
- package/src/gulp/backend.ts +3 -12
- package/src/gulp/checks.ts +2 -6
- package/src/gulp/copy.ts +1 -6
- package/src/gulp/helpers.ts +17 -0
- package/src/gulp/public.ts +1 -6
- package/src/gulp/styles.ts +34 -34
- package/src/gulp/templates.ts +1 -6
- package/src/helpers.ts +8 -7
- package/src/index.ts +9 -1
package/README.md
CHANGED
@@ -58,8 +58,10 @@ Lucy-CLI is designed to streamline the setup and management of TypeScript within
|
|
58
58
|
``` json
|
59
59
|
"modules": {
|
60
60
|
"<repoName>": {
|
61
|
-
|
62
|
-
|
61
|
+
"url": "String",
|
62
|
+
"branch": "String",
|
63
|
+
"path": "String", // Optional, specifies the path where the submodule should be cloned
|
64
|
+
"noCompile": true // Optional, if true, the module will not be compiled
|
63
65
|
}
|
64
66
|
}
|
65
67
|
```
|
package/dist/Gulpfile.d.ts
CHANGED
package/dist/Gulpfile.js
CHANGED
@@ -23,7 +23,7 @@ import { addTypes, updateWixTypes } from './gulp/types.js';
|
|
23
23
|
import { setProdConfig } from './gulp/pipeline.js';
|
24
24
|
import { watchAll } from './gulp/watchers.js';
|
25
25
|
import { blue, green, magenta, orange, red } from './index.js';
|
26
|
-
import { getModulesSync } from './gulp/helpers.js';
|
26
|
+
import { getModulesSourcePaths, getModulesSync } from './gulp/helpers.js';
|
27
27
|
const sass = gulpSass(dartSass);
|
28
28
|
const outputDir = './src';
|
29
29
|
const userHomeDir = os.homedir();
|
@@ -44,6 +44,7 @@ const taskOptions = {
|
|
44
44
|
replaceOptions,
|
45
45
|
cwd: process.cwd(),
|
46
46
|
modulesSync: getModulesSync(),
|
47
|
+
modulesSourcePaths: getModulesSourcePaths(),
|
47
48
|
};
|
48
49
|
const watchTaskOptions = { ...taskOptions, isWatching: true };
|
49
50
|
gulp.task('check-ts', gulp.parallel(checkTs(taskOptions)));
|
package/dist/gulp/backend.js
CHANGED
@@ -19,12 +19,7 @@ const swcOptions = {
|
|
19
19
|
},
|
20
20
|
};
|
21
21
|
export function buildBackend(options) {
|
22
|
-
const folders = ['typescript'];
|
23
|
-
if (options.modulesSync) {
|
24
|
-
for (const module of Object.keys(options.modulesSync)) {
|
25
|
-
folders.push(module);
|
26
|
-
}
|
27
|
-
}
|
22
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
28
23
|
const { outputDir } = options;
|
29
24
|
// Create tasks for each folder
|
30
25
|
const tasks = folders.map((folder) => {
|
@@ -58,12 +53,7 @@ export function buildBackend(options) {
|
|
58
53
|
return gulp.parallel(...tasks);
|
59
54
|
}
|
60
55
|
export function buildBackendJSW(options) {
|
61
|
-
const folders = ['typescript'];
|
62
|
-
if (options.modulesSync) {
|
63
|
-
for (const module of Object.keys(options.modulesSync)) {
|
64
|
-
folders.push(module);
|
65
|
-
}
|
66
|
-
}
|
56
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
67
57
|
const swcOptions = {
|
68
58
|
jsc: {
|
69
59
|
target: 'es6',
|
package/dist/gulp/checks.js
CHANGED
@@ -171,12 +171,7 @@ const customReporter = {
|
|
171
171
|
},
|
172
172
|
};
|
173
173
|
export function checkTs(options) {
|
174
|
-
const folders = ['typescript'];
|
175
|
-
if (options.modulesSync) {
|
176
|
-
for (const module of Object.keys(options.modulesSync)) {
|
177
|
-
folders.push(module);
|
178
|
-
}
|
179
|
-
}
|
174
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
180
175
|
// Create tasks for each folder
|
181
176
|
const tasks = folders.map((folder) => {
|
182
177
|
const tsProject = ts.createProject(`./local.tsconfig.json`, { noEmit: true, declaration: false, skipDefaultLibCheck: true });
|
package/dist/gulp/copy.js
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
import gulp from 'gulp';
|
2
2
|
import { blue, orange, red } from '../index.js';
|
3
3
|
export function copyFiles(options) {
|
4
|
-
const folders = ['typescript'];
|
5
|
-
if (options.modulesSync) {
|
6
|
-
for (const module of Object.keys(options.modulesSync)) {
|
7
|
-
folders.push(module);
|
8
|
-
}
|
9
|
-
}
|
4
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
10
5
|
// Create tasks for each folder
|
11
6
|
const tasks = folders.map((folder) => {
|
12
7
|
const { outputDir } = options;
|
package/dist/gulp/helpers.d.ts
CHANGED
package/dist/gulp/helpers.js
CHANGED
@@ -5,3 +5,20 @@ export function getModulesSync() {
|
|
5
5
|
const fileContent = fs.readFileSync(absolutePath, 'utf8');
|
6
6
|
return JSON.parse(fileContent).modules;
|
7
7
|
}
|
8
|
+
export function getModulesSourcePaths() {
|
9
|
+
const absolutePath = path.resolve('./lucy.json');
|
10
|
+
const fileContent = fs.readFileSync(absolutePath, 'utf8');
|
11
|
+
const data = JSON.parse(fileContent).modules;
|
12
|
+
const paths = [];
|
13
|
+
for (const module of Object.keys(data)) {
|
14
|
+
if (!data[module].noCompile) {
|
15
|
+
if (data[module].path) {
|
16
|
+
paths.push(data[module].path);
|
17
|
+
}
|
18
|
+
else {
|
19
|
+
paths.push(module);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return paths;
|
24
|
+
}
|
package/dist/gulp/public.js
CHANGED
@@ -16,12 +16,7 @@ const swcOptions = {
|
|
16
16
|
},
|
17
17
|
};
|
18
18
|
export function buildPublic(options) {
|
19
|
-
const folders = ['typescript'];
|
20
|
-
if (options.modulesSync) {
|
21
|
-
for (const module of Object.keys(options.modulesSync)) {
|
22
|
-
folders.push(module);
|
23
|
-
}
|
24
|
-
}
|
19
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
25
20
|
const { outputDir } = options;
|
26
21
|
// Create tasks for each folder
|
27
22
|
const tasks = folders.map((folder) => {
|
package/dist/gulp/styles.js
CHANGED
@@ -2,35 +2,38 @@ import gulp from 'gulp';
|
|
2
2
|
import { blue, orange, red } from '../index.js';
|
3
3
|
export function compileScss(options) {
|
4
4
|
const folders = ['typescript'];
|
5
|
-
// if (options.modulesSync){
|
6
|
-
// for (const module of Object.keys(options.modulesSync)) {
|
7
|
-
// folders.push(module);
|
8
|
-
// }
|
9
|
-
// }
|
10
5
|
const { sass, outputDir } = options;
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
})
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
})
|
27
|
-
.on('end', function () {
|
28
|
-
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange(folder)} succeeded!`));
|
29
|
-
});
|
30
|
-
// Register the task with Gulp
|
31
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
32
|
-
return task;
|
6
|
+
const buildWixScss = () => gulp.src(['typescript/styles/global.scss'], { allowEmpty: true })
|
7
|
+
.pipe(sass().on('error', sass.logError))
|
8
|
+
.on('error', function (e) {
|
9
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('global.scs')} failed!`));
|
10
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
11
|
+
this.emit('end');
|
12
|
+
})
|
13
|
+
.pipe(gulp.dest(`${outputDir}/styles`))
|
14
|
+
.on('error', function (e) {
|
15
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('global.scs')} failed!`));
|
16
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
17
|
+
this.emit('end');
|
18
|
+
})
|
19
|
+
.on('end', function () {
|
20
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('global.scs')} succeeded!`));
|
33
21
|
});
|
34
|
-
|
35
|
-
|
22
|
+
const buildScss = () => gulp.src(['typescript/public/scss/app.scss'], { allowEmpty: true })
|
23
|
+
.pipe(sass().on('error', sass.logError))
|
24
|
+
.on('error', function (e) {
|
25
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('app.scss')} failed!`));
|
26
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
27
|
+
this.emit('end');
|
28
|
+
})
|
29
|
+
.pipe(gulp.dest(`${outputDir}/public/css`))
|
30
|
+
.on('error', function (e) {
|
31
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('app.scss')} failed!`));
|
32
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
33
|
+
this.emit('end');
|
34
|
+
})
|
35
|
+
.on('end', function () {
|
36
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('app.scss')} succeeded!`));
|
37
|
+
});
|
38
|
+
return gulp.parallel(buildWixScss, buildScss);
|
36
39
|
}
|
package/dist/gulp/templates.js
CHANGED
@@ -2,12 +2,7 @@ import gulp from 'gulp';
|
|
2
2
|
import exec from 'gulp-exec';
|
3
3
|
import { blue, orange, red } from '../index.js';
|
4
4
|
export function previewTemplates(options) {
|
5
|
-
const folders = ['typescript'];
|
6
|
-
if (options.modulesSync) {
|
7
|
-
for (const module of Object.keys(options.modulesSync)) {
|
8
|
-
folders.push(module);
|
9
|
-
}
|
10
|
-
}
|
5
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
11
6
|
const taskOpt = {
|
12
7
|
continueOnError: true,
|
13
8
|
};
|
package/dist/helpers.js
CHANGED
@@ -92,23 +92,24 @@ export async function gitInit(cwd, modules, force) {
|
|
92
92
|
const dotGitmodulesPath = path.join(cwd, '.gitmodules');
|
93
93
|
for (const [name, repo] of Object.entries(modules)) {
|
94
94
|
console.log(chalk.green.underline.bold(`Processing submodule ${name}`));
|
95
|
+
const clonePath = repo.path || name;
|
95
96
|
try {
|
96
|
-
const isRegistered = await isSubmoduleRegistered(git,
|
97
|
+
const isRegistered = await isSubmoduleRegistered(git, clonePath);
|
97
98
|
// Check that .gitmodules exists AND contains the entry for this specific submodule.
|
98
99
|
const isConfiguredInFile = fs.existsSync(dotGitmodulesPath) &&
|
99
|
-
fs.readFileSync(dotGitmodulesPath, 'utf-8').includes(`[submodule "${
|
100
|
+
fs.readFileSync(dotGitmodulesPath, 'utf-8').includes(`[submodule "${clonePath}"]`);
|
100
101
|
// Add/repair if not configured in .gitmodules, or if forced by the user.
|
101
102
|
if (!isConfiguredInFile || force) {
|
102
|
-
console.log(`🐕 ${blue.underline(`Adding/updating submodule ${name}...`)}`);
|
103
|
+
console.log(`🐕 ${blue.underline(`Adding/updating submodule ${name} at ${clonePath}...`)}`);
|
103
104
|
// If git already has a config entry, we must use --force to repair it.
|
104
|
-
const submoduleArgs = ['add', ...(force || isRegistered ? ['--force'] : []), repo.url,
|
105
|
+
const submoduleArgs = ['add', ...(force || isRegistered ? ['--force'] : []), repo.url, clonePath];
|
105
106
|
await git.subModule(submoduleArgs);
|
106
107
|
}
|
107
108
|
else {
|
108
|
-
console.log(`🐕 ${blue.underline(`Submodule ${name} already registered. Skipping add.`)}`);
|
109
|
+
console.log(`🐕 ${blue.underline(`Submodule ${name} at ${clonePath} already registered. Skipping add.`)}`);
|
109
110
|
}
|
110
|
-
await git.submoduleUpdate(['--init', '--recursive',
|
111
|
-
await simpleGit({ baseDir: path.join(cwd,
|
111
|
+
await git.submoduleUpdate(['--init', '--recursive', clonePath]);
|
112
|
+
await simpleGit({ baseDir: path.join(cwd, clonePath) }).checkout(repo.branch);
|
112
113
|
}
|
113
114
|
catch (err) {
|
114
115
|
console.log((`💩 ${red.underline.bold(`=> Command failed for submodule ${name} =>`)} ${orange(err)}`));
|
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
#!/usr/bin/env node --no-warnings
|
2
|
+
export type ModulesSettings = {
|
3
|
+
packageRoot: string;
|
4
|
+
targetFolder: string;
|
5
|
+
args: string[];
|
6
|
+
settings: LucySettings;
|
7
|
+
};
|
2
8
|
export type LucySettings = {
|
3
9
|
modules: {
|
4
|
-
[
|
10
|
+
[libName: string]: {
|
5
11
|
url: string;
|
6
12
|
branch: string;
|
13
|
+
path?: string;
|
14
|
+
noCompile?: boolean;
|
7
15
|
};
|
8
16
|
};
|
9
17
|
wixSettings: {
|
File without changes
|
package/package.json
CHANGED
package/src/Gulpfile.ts
CHANGED
@@ -21,7 +21,7 @@ import { addTypes, updateWixTypes } from './gulp/types.js';
|
|
21
21
|
import { setProdConfig } from './gulp/pipeline.js';
|
22
22
|
import { watchAll } from './gulp/watchers.js';
|
23
23
|
import { ModuleSettings, ProjectSettings, blue, green, magenta, orange, red } from './index.js';
|
24
|
-
import { getModulesSync } from './gulp/helpers.js';
|
24
|
+
import { getModulesSourcePaths, getModulesSync } from './gulp/helpers.js';
|
25
25
|
|
26
26
|
const sass = gulpSass(dartSass);
|
27
27
|
|
@@ -38,6 +38,7 @@ export type TaskOptions = {
|
|
38
38
|
pageSettings: typeof pageSettings,
|
39
39
|
publicSettings: typeof publicSettings,
|
40
40
|
modulesSync: Record<string, string> | undefined;
|
41
|
+
modulesSourcePaths: string[];
|
41
42
|
cwd: string;
|
42
43
|
isWatching?: boolean;
|
43
44
|
}
|
@@ -67,6 +68,7 @@ const taskOptions: TaskOptions = {
|
|
67
68
|
replaceOptions,
|
68
69
|
cwd: process.cwd(),
|
69
70
|
modulesSync: getModulesSync(),
|
71
|
+
modulesSourcePaths: getModulesSourcePaths(),
|
70
72
|
}
|
71
73
|
|
72
74
|
const watchTaskOptions: TaskOptions = { ...taskOptions, isWatching: true };
|
package/src/gulp/backend.ts
CHANGED
@@ -23,12 +23,7 @@ const swcOptions = {
|
|
23
23
|
};
|
24
24
|
|
25
25
|
export function buildBackend(options: TaskOptions) {
|
26
|
-
const folders = ['typescript'];
|
27
|
-
if (options.modulesSync){
|
28
|
-
for (const module of Object.keys(options.modulesSync)) {
|
29
|
-
folders.push(module);
|
30
|
-
}
|
31
|
-
}
|
26
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
32
27
|
|
33
28
|
const { outputDir } = options;
|
34
29
|
|
@@ -70,12 +65,8 @@ export function buildBackend(options: TaskOptions) {
|
|
70
65
|
|
71
66
|
|
72
67
|
export function buildBackendJSW(options: TaskOptions) {
|
73
|
-
const folders = ['typescript'];
|
74
|
-
|
75
|
-
for (const module of Object.keys(options.modulesSync)) {
|
76
|
-
folders.push(module);
|
77
|
-
}
|
78
|
-
}
|
68
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
69
|
+
|
79
70
|
const swcOptions = {
|
80
71
|
jsc: {
|
81
72
|
target: 'es6',
|
package/src/gulp/checks.ts
CHANGED
@@ -186,12 +186,8 @@ const customReporter: ts.reporter.Reporter = {
|
|
186
186
|
};
|
187
187
|
|
188
188
|
export function checkTs(options: TaskOptions) {
|
189
|
-
const folders = ['typescript'];
|
190
|
-
|
191
|
-
for (const module of Object.keys(options.modulesSync)) {
|
192
|
-
folders.push(module);
|
193
|
-
}
|
194
|
-
}
|
189
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
190
|
+
|
195
191
|
|
196
192
|
// Create tasks for each folder
|
197
193
|
const tasks = folders.map((folder) => {
|
package/src/gulp/copy.ts
CHANGED
@@ -4,12 +4,7 @@ import { TaskOptions } from '../Gulpfile';
|
|
4
4
|
import { blue, orange, red } from '../index.js';
|
5
5
|
|
6
6
|
export function copyFiles(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
|
-
}
|
7
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
13
8
|
|
14
9
|
// Create tasks for each folder
|
15
10
|
const tasks = folders.map((folder) => {
|
package/src/gulp/helpers.ts
CHANGED
@@ -6,4 +6,21 @@ export function getModulesSync(): Record<string, string> | undefined {
|
|
6
6
|
const absolutePath = path.resolve('./lucy.json');
|
7
7
|
const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
|
8
8
|
return JSON.parse(fileContent).modules;
|
9
|
+
}
|
10
|
+
|
11
|
+
export function getModulesSourcePaths(): string[] {
|
12
|
+
const absolutePath = path.resolve('./lucy.json');
|
13
|
+
const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
|
14
|
+
const data = JSON.parse(fileContent).modules;
|
15
|
+
const paths: string[] = [];
|
16
|
+
for (const module of Object.keys(data)) {
|
17
|
+
if (!data[module].noCompile) {
|
18
|
+
if (data[module].path) {
|
19
|
+
paths.push(data[module].path);
|
20
|
+
} else {
|
21
|
+
paths.push(module);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
return paths;
|
9
26
|
}
|
package/src/gulp/public.ts
CHANGED
@@ -19,12 +19,7 @@ const swcOptions = {
|
|
19
19
|
};
|
20
20
|
|
21
21
|
export function buildPublic(options: TaskOptions) {
|
22
|
-
const folders = ['typescript'];
|
23
|
-
if (options.modulesSync){
|
24
|
-
for (const module of Object.keys(options.modulesSync)) {
|
25
|
-
folders.push(module);
|
26
|
-
}
|
27
|
-
}
|
22
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
28
23
|
|
29
24
|
const { outputDir } = options;
|
30
25
|
|
package/src/gulp/styles.ts
CHANGED
@@ -5,42 +5,42 @@ import { blue, orange, red } from '../index.js';
|
|
5
5
|
|
6
6
|
export function compileScss(options: TaskOptions) {
|
7
7
|
const folders = ['typescript'];
|
8
|
-
// if (options.modulesSync){
|
9
|
-
// for (const module of Object.keys(options.modulesSync)) {
|
10
|
-
// folders.push(module);
|
11
|
-
// }
|
12
|
-
// }
|
13
8
|
|
14
9
|
const { sass, outputDir} = options;
|
15
10
|
|
11
|
+
const buildWixScss = () => gulp.src(['typescript/styles/global.scss'], { allowEmpty: true })
|
12
|
+
.pipe(sass().on('error', sass.logError))
|
13
|
+
.on('error', function (e: Error) {
|
14
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('global.scs')} failed!`));
|
15
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
16
|
+
this.emit('end');
|
17
|
+
})
|
18
|
+
.pipe(gulp.dest(`${outputDir}/styles`))
|
19
|
+
.on('error', function (e: Error) {
|
20
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('global.scs')} failed!`));
|
21
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
22
|
+
this.emit('end');
|
23
|
+
})
|
24
|
+
.on('end', function () {
|
25
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('global.scs')} succeeded!`));
|
26
|
+
});
|
16
27
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
.on('end', function () {
|
36
|
-
console.log("🐶" + blue.underline(` => Compiling of scss 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);
|
28
|
+
const buildScss = () => gulp.src(['typescript/public/scss/app.scss'], { allowEmpty: true })
|
29
|
+
.pipe(sass().on('error', sass.logError))
|
30
|
+
.on('error', function (e: Error) {
|
31
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('app.scss')} failed!`));
|
32
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
33
|
+
this.emit('end');
|
34
|
+
})
|
35
|
+
.pipe(gulp.dest(`${outputDir}/public/css`))
|
36
|
+
.on('error', function (e: Error) {
|
37
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('app.scss')} failed!`));
|
38
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
39
|
+
this.emit('end');
|
40
|
+
})
|
41
|
+
.on('end', function () {
|
42
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('app.scss')} succeeded!`));
|
43
|
+
});
|
44
|
+
|
45
|
+
return gulp.parallel(buildWixScss, buildScss);
|
46
46
|
}
|
package/src/gulp/templates.ts
CHANGED
@@ -4,12 +4,7 @@ import exec from 'gulp-exec';
|
|
4
4
|
import { blue, orange, red } from '../index.js';
|
5
5
|
|
6
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
|
-
}
|
7
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
13
8
|
|
14
9
|
const taskOpt = {
|
15
10
|
continueOnError: true,
|
package/src/helpers.ts
CHANGED
@@ -102,25 +102,26 @@ export async function gitInit(cwd: string, modules: LucySettings['modules'] | un
|
|
102
102
|
|
103
103
|
for (const [name, repo] of Object.entries(modules)) {
|
104
104
|
console.log(chalk.green.underline.bold(`Processing submodule ${name}`));
|
105
|
+
const clonePath = repo.path || name;
|
105
106
|
|
106
107
|
try {
|
107
|
-
const isRegistered = await isSubmoduleRegistered(git,
|
108
|
+
const isRegistered = await isSubmoduleRegistered(git, clonePath);
|
108
109
|
// Check that .gitmodules exists AND contains the entry for this specific submodule.
|
109
110
|
const isConfiguredInFile = fs.existsSync(dotGitmodulesPath) &&
|
110
|
-
fs.readFileSync(dotGitmodulesPath, 'utf-8').includes(`[submodule "${
|
111
|
+
fs.readFileSync(dotGitmodulesPath, 'utf-8').includes(`[submodule "${clonePath}"]`);
|
111
112
|
|
112
113
|
// Add/repair if not configured in .gitmodules, or if forced by the user.
|
113
114
|
if (!isConfiguredInFile || force) {
|
114
|
-
console.log(`🐕 ${blue.underline(`Adding/updating submodule ${name}...`)}`);
|
115
|
+
console.log(`🐕 ${blue.underline(`Adding/updating submodule ${name} at ${clonePath}...`)}`);
|
115
116
|
// If git already has a config entry, we must use --force to repair it.
|
116
|
-
const submoduleArgs = ['add', ...(force || isRegistered ? ['--force'] : []), repo.url,
|
117
|
+
const submoduleArgs = ['add', ...(force || isRegistered ? ['--force'] : []), repo.url, clonePath];
|
117
118
|
await git.subModule(submoduleArgs);
|
118
119
|
} else {
|
119
|
-
console.log(`🐕 ${blue.underline(`Submodule ${name} already registered. Skipping add.`)}`);
|
120
|
+
console.log(`🐕 ${blue.underline(`Submodule ${name} at ${clonePath} already registered. Skipping add.`)}`);
|
120
121
|
}
|
121
122
|
|
122
|
-
await git.submoduleUpdate(['--init', '--recursive',
|
123
|
-
await simpleGit({ baseDir: path.join(cwd,
|
123
|
+
await git.submoduleUpdate(['--init', '--recursive', clonePath]);
|
124
|
+
await simpleGit({ baseDir: path.join(cwd, clonePath) }).checkout(repo.branch);
|
124
125
|
} catch (err) {
|
125
126
|
console.log((`💩 ${red.underline.bold(`=> Command failed for submodule ${name} =>`)} ${orange(err)}`));
|
126
127
|
}
|
package/src/index.ts
CHANGED
@@ -16,11 +16,19 @@ import { prepare } from './prepare.js';
|
|
16
16
|
import { spawn, spawnSync } from 'child_process';
|
17
17
|
import os from 'os';
|
18
18
|
|
19
|
+
export type ModulesSettings = {
|
20
|
+
packageRoot: string;
|
21
|
+
targetFolder: string;
|
22
|
+
args: string[];
|
23
|
+
settings: LucySettings;
|
24
|
+
}
|
19
25
|
export type LucySettings = {
|
20
26
|
modules: {
|
21
|
-
[
|
27
|
+
[libName: string]: {
|
22
28
|
url: string;
|
23
29
|
branch: string;
|
30
|
+
path?: string;
|
31
|
+
noCompile?: boolean;
|
24
32
|
};
|
25
33
|
};
|
26
34
|
wixSettings: {
|