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 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
  ```
@@ -8,29 +8,37 @@ export function compileScss(options) {
8
8
  // }
9
9
  // }
10
10
  const { sass, outputDir } = options;
11
- // Create tasks for each folder
12
- const tasks = folders.map((folder) => {
13
- const taskName = `compile_sass-${folder}`; // Create a unique name for each task
14
- const task = () => gulp.src(['typescript/styles/global.scss'])
15
- .pipe(sass().on('error', sass.logError))
16
- .on('error', function (e) {
17
- console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange(folder)} failed!`));
18
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
19
- this.emit('end');
20
- })
21
- .pipe(gulp.dest(`${outputDir}/styles`))
22
- .on('error', function (e) {
23
- console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange(folder)} failed!`));
24
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
25
- this.emit('end');
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
- // Run all tasks in parallel
35
- return gulp.parallel(...tasks);
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, name);
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 "${name}"]`);
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, name];
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', name]);
111
- await simpleGit({ baseDir: path.join(cwd, name) }).checkout(repo.branch);
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,10 @@
1
1
  #!/usr/bin/env node --no-warnings
2
2
  export type LucySettings = {
3
3
  modules: {
4
- [llibName: string]: {
4
+ [libName: string]: {
5
5
  url: string;
6
6
  branch: string;
7
+ path?: string;
7
8
  };
8
9
  };
9
10
  wixSettings: {
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -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
- // 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
- .on('error', function (e: Error) {
25
- console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange(folder)} failed!`));
26
- console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
27
- this.emit('end');
28
- })
29
- .pipe(gulp.dest(`${outputDir}/styles`))
30
- .on('error', function (e: Error) {
31
- console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange(folder)} 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(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, name);
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 "${name}"]`);
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, name];
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', name]);
123
- await simpleGit({ baseDir: path.join(cwd, name) }).checkout(repo.branch);
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
@@ -18,9 +18,10 @@ import os from 'os';
18
18
 
19
19
  export type LucySettings = {
20
20
  modules: {
21
- [llibName: string]: {
21
+ [libName: string]: {
22
22
  url: string;
23
23
  branch: string;
24
+ path?: string;
24
25
  };
25
26
  };
26
27
  wixSettings: {