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 +38 -13
- package/dist/settings.json +3 -1
- package/files/typescript/backend/http-functions.ts +1 -1
- package/package.json +1 -1
- package/src/helpers.ts +39 -13
- package/src/settings.json +3 -1
- package/files/.stylelintrc copy.js +0 -8
- package/files/typescript/backend/constants/env.ts +0 -7
- package/files/typescript/public/models/frontendApi.model.ts +0 -4
- package/files/typescript/templates/render.ts +0 -32
- /package/files/typescript/{types → public}/.gitkeep +0 -0
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
const
|
26
|
-
|
27
|
-
|
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(` =>
|
33
|
+
console.log("🐕" + blue.underline(` => Dev packages installed!`));
|
32
34
|
}
|
33
|
-
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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!`));
|
package/dist/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,5 +1,5 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
2
|
-
import { batchCheckUpdateState, clearStale, getImageUploadUrl, insertItemBatch, isAlive, saveItemBatch } from 'backend/lib/http-functions/
|
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
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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(` =>
|
52
|
+
console.log("🐕" + blue.underline(` => Packages installed!`));
|
36
53
|
}
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
if (
|
41
|
-
|
42
|
-
|
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,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
|