lucy-cli 1.2.0 → 1.2.2

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/dist/helpers.js CHANGED
@@ -19,23 +19,48 @@ export async function installPackages(wixPackages, devPackages, cwd, locked) {
19
19
  const devPackageVersions = Object.values(devPackages);
20
20
  const devPackageNamesAndVersions = devPackageNames.map((name, index) => `${name}@${devPackageVersions[index]}`);
21
21
  let success = true;
22
- wixPackageNames.forEach((name, index) => {
23
- console.log(`🐕 => Installing ${orange(name)}`);
24
- const wixInstall = locked ? `wix install ${wixPackageNamesAndVersions}` : `wix install ${name}`;
25
- const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
26
- if (wixres.error) {
27
- console.log((`💩 ${red.underline.bold("=> Failed to install package =>")} ${orange(wixres.error.message)}`));
22
+ // Dev packages are installed all at once with yarn.
23
+ if (devPackageNames.length > 0) {
24
+ console.log(`🐕 => Installing dev packages with yarn...`);
25
+ const packagesToInstall = locked ? devPackageNamesAndVersions.join(' ') : devPackageNames.join(' ');
26
+ const yarnAdd = `yarn add -D ${packagesToInstall}`;
27
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
28
+ if (yarnRes.error) {
28
29
  success = false;
30
+ console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
29
31
  }
30
32
  else {
31
- console.log("🐕" + blue.underline(` => Package installed!`));
33
+ console.log("🐕" + blue.underline(` => Dev packages installed!`));
32
34
  }
33
- });
34
- const yarnAdd = locked ? `yarn add -D ${devPackageNamesAndVersions.join(' ')}` : `yarn add -D ${devPackageNames.join(' ')}`;
35
- const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
36
- if (yarnRes.error) {
37
- success = false;
38
- console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
35
+ }
36
+ // Packages are installed all at once with yarn.
37
+ if (wixPackageNames.length > 0) {
38
+ console.log(`🐕 => Installing packages with yarn...`);
39
+ const packagesToInstall = locked ? wixPackageNamesAndVersions.join(' ') : wixPackageNames.join(' ');
40
+ const yarnAdd = `yarn add ${packagesToInstall}`;
41
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
42
+ if (yarnRes.error) {
43
+ success = false;
44
+ console.log((`💩 ${red.underline.bold("=> Failed to install packages =>")} ${orange(yarnRes.error.message)}`));
45
+ }
46
+ else {
47
+ console.log("🐕" + blue.underline(` => Packages installed!`));
48
+ }
49
+ }
50
+ // Wix packages are installed one by one.
51
+ if (wixPackageNames.length > 0) {
52
+ wixPackageNames.forEach((name, index) => {
53
+ console.log(`🐕 => Installing wix package ${orange(name)}`);
54
+ const wixInstall = locked ? `wix install ${wixPackageNamesAndVersions[index]}` : `wix install ${name}`;
55
+ const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
56
+ if (wixres.error) {
57
+ console.log((`💩 ${red.underline.bold("=> Failed to install wix package =>")} ${orange(wixres.error.message)}`));
58
+ success = false;
59
+ }
60
+ else {
61
+ console.log("🐕" + blue.underline(` => Wix package ${orange(name)} installed!`));
62
+ }
63
+ });
39
64
  }
40
65
  if (success) {
41
66
  console.log("🐕" + blue.underline(` => All Packages installed!`));
@@ -18,6 +18,7 @@
18
18
  "@types/node": "^24.0.10",
19
19
  "@types/nodemailer": "^6.4.17",
20
20
  "@types/react": "^19.1.8",
21
+ "madge": "^8.0.0",
21
22
  "@typescript-eslint/eslint-plugin": "^8.35.1",
22
23
  "@typescript-eslint/parser": "^8.35.1",
23
24
  "@typescript-eslint/utils": "^8.35.1",
@@ -60,6 +61,7 @@
60
61
  "test": "vitest --ui --coverage",
61
62
  "coverage": "vitest run --coverage",
62
63
  "cypress": "cypress open",
63
- "e2e": "cypress-cloud run --parallel --record"
64
+ "e2e": "cypress-cloud run --parallel --record",
65
+ "graph": "madge --image graph.svg src"
64
66
  }
65
67
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
- import { batchCheckUpdateState, clearStale, getImageUploadUrl, insertItemBatch, isAlive, saveItemBatch } from 'backend/lib/http-functions/sync2';
2
+ import { batchCheckUpdateState, clearStale, getImageUploadUrl, insertItemBatch, isAlive, saveItemBatch } from 'backend/lib/http-functions/sync';
3
3
  import { WixHttpFunctionRequest } from 'wix-http-functions';
4
4
 
5
5
  /**------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
package/src/helpers.ts CHANGED
@@ -24,22 +24,48 @@ export async function installPackages(wixPackages: Record<string, string>, devPa
24
24
  const devPackageNamesAndVersions = devPackageNames.map((name, index) => `${name}@${devPackageVersions[index]}`);
25
25
 
26
26
  let success = true;
27
- wixPackageNames.forEach((name, index) => {
28
- console.log(`🐕 => Installing ${orange(name)}`);
29
- const wixInstall = locked ? `wix install ${wixPackageNamesAndVersions}`: `wix install ${name}`;
30
- const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
31
- if (wixres.error) {
32
- console.log((`💩 ${red.underline.bold("=> Failed to install package =>")} ${orange(wixres.error.message)}`));
27
+
28
+ // Dev packages are installed all at once with yarn.
29
+ if (devPackageNames.length > 0) {
30
+ console.log(`🐕 => Installing dev packages with yarn...`);
31
+ const packagesToInstall = locked ? devPackageNamesAndVersions.join(' ') : devPackageNames.join(' ');
32
+ const yarnAdd = `yarn add -D ${packagesToInstall}`;
33
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
34
+ if (yarnRes.error) {
35
+ success = false;
36
+ console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
37
+ } else {
38
+ console.log("🐕" + blue.underline(` => Dev packages installed!`));
39
+ }
40
+ }
41
+
42
+ // Packages are installed all at once with yarn.
43
+ if (wixPackageNames.length > 0) {
44
+ console.log(`🐕 => Installing packages with yarn...`);
45
+ const packagesToInstall = locked ? wixPackageNamesAndVersions.join(' ') : wixPackageNames.join(' ');
46
+ const yarnAdd = `yarn add ${packagesToInstall}`;
47
+ const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
48
+ if (yarnRes.error) {
33
49
  success = false;
50
+ console.log((`💩 ${red.underline.bold("=> Failed to install packages =>")} ${orange(yarnRes.error.message)}`));
34
51
  } else {
35
- console.log("🐕" + blue.underline(` => Package installed!`));
52
+ console.log("🐕" + blue.underline(` => Packages installed!`));
36
53
  }
37
- });
38
- const yarnAdd = locked ? `yarn add -D ${devPackageNamesAndVersions.join(' ')}` : `yarn add -D ${devPackageNames.join(' ')}`;
39
- const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
40
- if (yarnRes.error) {
41
- success = false;
42
- console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
54
+ }
55
+
56
+ // Wix packages are installed one by one.
57
+ if (wixPackageNames.length > 0) {
58
+ wixPackageNames.forEach((name, index) => {
59
+ console.log(`🐕 => Installing wix package ${orange(name)}`);
60
+ const wixInstall = locked ? `wix install ${wixPackageNamesAndVersions[index]}`: `wix install ${name}`;
61
+ const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
62
+ if (wixres.error) {
63
+ console.log((`💩 ${red.underline.bold("=> Failed to install wix package =>")} ${orange(wixres.error.message)}`));
64
+ success = false;
65
+ } else {
66
+ console.log("🐕" + blue.underline(` => Wix package ${orange(name)} installed!`));
67
+ }
68
+ });
43
69
  }
44
70
 
45
71
  if(success) {
package/src/settings.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "@types/node": "^24.0.10",
19
19
  "@types/nodemailer": "^6.4.17",
20
20
  "@types/react": "^19.1.8",
21
+ "madge": "^8.0.0",
21
22
  "@typescript-eslint/eslint-plugin": "^8.35.1",
22
23
  "@typescript-eslint/parser": "^8.35.1",
23
24
  "@typescript-eslint/utils": "^8.35.1",
@@ -60,6 +61,7 @@
60
61
  "test": "vitest --ui --coverage",
61
62
  "coverage": "vitest run --coverage",
62
63
  "cypress": "cypress open",
63
- "e2e": "cypress-cloud run --parallel --record"
64
+ "e2e": "cypress-cloud run --parallel --record",
65
+ "graph": "madge --image graph.svg src"
64
66
  }
65
67
  }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- overrides: [
3
- {
4
- files: ["**/*.{ts,tsx}"],
5
- customSyntax: "@stylelint/postcss-css-in-js",
6
- },
7
- ],
8
- };
@@ -1,7 +0,0 @@
1
- export const environment = {
2
- gitTag: 'development',
3
- devMode: false,
4
- development: process.env.SEGMENT === 'dev' ? true : false,
5
- } as const;
6
-
7
- export type Environment = typeof environment;
@@ -1,4 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const frontendAPISchema = z.object({});
4
- export type FrontendAPI = z.infer<typeof frontendAPISchema>;
@@ -1,32 +0,0 @@
1
- import * as fs from 'fs';
2
-
3
-
4
- export interface RenderToFsOPtions {
5
- renderer: (arg0: any, arg1: any) => Promise<string>;
6
- dataSource: string;
7
- destination: string;
8
- }
9
- /**
10
- * Render E-Mail to file system
11
- * @param {RenderToFsOPtions} options Preview Options
12
- * @returns {Promise<void>}
13
- */
14
- export async function renderToFs(options: RenderToFsOPtions): Promise<void> {
15
- if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development') return;
16
- console.log('rendered', process.env.NODE_ENV, options);
17
- fs.readFile(`typescript/backend/templates/data/${options.dataSource}`, 'utf8', async (err, data) => {
18
- if (err){
19
- console.error('Template Rendere => ', err);
20
-
21
- return;
22
- }
23
- const fakeDate = JSON.parse(data) as any;
24
- console.log('fakeDate', fakeDate);
25
- const html = await options.renderer(fakeDate, 'de');
26
- fs.writeFile(`typescript/backend/templates/preview/${options.destination}.html`, html, err => {
27
- if (err){
28
- console.error(err);
29
- }
30
- });
31
- });
32
- }
File without changes