lucy-cli 1.2.3 → 1.2.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/README.md +2 -1
- package/dist/gulp/styles.js +32 -24
- package/dist/helpers.js +8 -7
- package/dist/index.d.ts +2 -1
- package/files/typescript/public/scss/app.scss +0 -0
- package/package.json +1 -1
- package/src/gulp/styles.ts +34 -29
- package/src/helpers.ts +8 -7
- package/src/index.ts +2 -1
package/README.md
CHANGED
@@ -59,7 +59,8 @@ Lucy-CLI is designed to streamline the setup and management of TypeScript within
|
|
59
59
|
"modules": {
|
60
60
|
"<repoName>": {
|
61
61
|
"url": "String",
|
62
|
-
"branch": "String"
|
62
|
+
"branch": "String",
|
63
|
+
"path": "String" // Optional, specifies the path where the submodule should be cloned
|
63
64
|
}
|
64
65
|
}
|
65
66
|
```
|
package/dist/gulp/styles.js
CHANGED
@@ -8,29 +8,37 @@ export function compileScss(options) {
|
|
8
8
|
// }
|
9
9
|
// }
|
10
10
|
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;
|
11
|
+
const buildWixScss = () => gulp.src(['typescript/styles/global.scss'])
|
12
|
+
.pipe(sass().on('error', sass.logError))
|
13
|
+
.on('error', function (e) {
|
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) {
|
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!`));
|
33
26
|
});
|
34
|
-
|
35
|
-
|
27
|
+
const buildScss = () => gulp.src(['typescript/public/scss/app.scss'])
|
28
|
+
.pipe(sass().on('error', sass.logError))
|
29
|
+
.on('error', function (e) {
|
30
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('app.scss')} failed!`));
|
31
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
32
|
+
this.emit('end');
|
33
|
+
})
|
34
|
+
.pipe(gulp.dest(`${outputDir}/public/css`))
|
35
|
+
.on('error', function (e) {
|
36
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('app.scss')} failed!`));
|
37
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
38
|
+
this.emit('end');
|
39
|
+
})
|
40
|
+
.on('end', function () {
|
41
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('app.scss')} succeeded!`));
|
42
|
+
});
|
43
|
+
return gulp.parallel(buildWixScss, buildScss);
|
36
44
|
}
|
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
File without changes
|
package/package.json
CHANGED
package/src/gulp/styles.ts
CHANGED
@@ -13,34 +13,39 @@ export function compileScss(options: TaskOptions) {
|
|
13
13
|
|
14
14
|
const { sass, outputDir} = options;
|
15
15
|
|
16
|
+
const buildWixScss = () => gulp.src(['typescript/styles/global.scss'])
|
17
|
+
.pipe(sass().on('error', sass.logError))
|
18
|
+
.on('error', function (e: Error) {
|
19
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('global.scs')} failed!`));
|
20
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
21
|
+
this.emit('end');
|
22
|
+
})
|
23
|
+
.pipe(gulp.dest(`${outputDir}/styles`))
|
24
|
+
.on('error', function (e: Error) {
|
25
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('global.scs')} failed!`));
|
26
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
27
|
+
this.emit('end');
|
28
|
+
})
|
29
|
+
.on('end', function () {
|
30
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('global.scs')} succeeded!`));
|
31
|
+
});
|
16
32
|
|
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);
|
33
|
+
const buildScss = () => gulp.src(['typescript/public/scss/app.scss'])
|
34
|
+
.pipe(sass().on('error', sass.logError))
|
35
|
+
.on('error', function (e: Error) {
|
36
|
+
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('app.scss')} failed!`));
|
37
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
38
|
+
this.emit('end');
|
39
|
+
})
|
40
|
+
.pipe(gulp.dest(`${outputDir}/public/css`))
|
41
|
+
.on('error', function (e: Error) {
|
42
|
+
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('app.scss')} failed!`));
|
43
|
+
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
44
|
+
this.emit('end');
|
45
|
+
})
|
46
|
+
.on('end', function () {
|
47
|
+
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('app.scss')} succeeded!`));
|
48
|
+
});
|
49
|
+
|
50
|
+
return gulp.parallel(buildWixScss, buildScss);
|
46
51
|
}
|
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
|
}
|