@pronto-tools-and-more/pronto 5.1.0 → 5.2.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pronto-tools-and-more/pronto",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
"@lvce-editor/ipc": "^10.0.4",
|
|
18
18
|
"@lvce-editor/json-rpc": "^3.0.0",
|
|
19
19
|
"@lvce-editor/verror": "^1.4.0",
|
|
20
|
-
"@pronto-tools-and-more/file-watcher": "5.
|
|
21
|
-
"@pronto-tools-and-more/files": "5.
|
|
22
|
-
"@pronto-tools-and-more/network-process": "5.
|
|
23
|
-
"@pronto-tools-and-more/sass-compiler": "5.
|
|
24
|
-
"@pronto-tools-and-more/components-renderer": "5.
|
|
20
|
+
"@pronto-tools-and-more/file-watcher": "5.2.0",
|
|
21
|
+
"@pronto-tools-and-more/files": "5.2.0",
|
|
22
|
+
"@pronto-tools-and-more/network-process": "5.2.0",
|
|
23
|
+
"@pronto-tools-and-more/sass-compiler": "5.2.0",
|
|
24
|
+
"@pronto-tools-and-more/components-renderer": "5.2.0",
|
|
25
|
+
"@pronto-tools-and-more/components": "5.2.0",
|
|
25
26
|
"execa": "^9.3.1",
|
|
26
27
|
"express": "^4.19.2"
|
|
27
28
|
},
|
|
@@ -7,6 +7,7 @@ import * as HandleViewsSplit from "../HandleViewsSplit/HandleViewsSplit.js";
|
|
|
7
7
|
export const handleViews =
|
|
8
8
|
({ storeFrontPath, splitViews, reactComponents }) =>
|
|
9
9
|
async (req, res) => {
|
|
10
|
+
res.setHeader("Content-Type", "application/json");
|
|
10
11
|
if (reactComponents) {
|
|
11
12
|
const content =
|
|
12
13
|
await HandleViewsReactComponents.handleViewsReactComponents(
|
|
@@ -6,6 +6,7 @@ import * as IpcParent from "../IpcParent/IpcParent.js";
|
|
|
6
6
|
import * as IpcParentType from "../IpcParentType/IpcParentType.js";
|
|
7
7
|
import * as UnhandleIpc from "../UnhandleIpc/UnhandleIpc.js";
|
|
8
8
|
import * as JsonRpc from "../JsonRpc/JsonRpc.js";
|
|
9
|
+
import * as HandleViewsSplit from "../HandleViewsSplit/HandleViewsSplit.js";
|
|
9
10
|
|
|
10
11
|
export const handleViewsReactComponents = async (storeFrontPath) => {
|
|
11
12
|
try {
|
|
@@ -41,7 +42,10 @@ export const handleViewsReactComponents = async (storeFrontPath) => {
|
|
|
41
42
|
);
|
|
42
43
|
UnhandleIpc.unhandleIpc(ipc);
|
|
43
44
|
ipc.dispose();
|
|
44
|
-
|
|
45
|
+
const splitResult = await HandleViewsSplit.handleViewsSplit(storeFrontPath);
|
|
46
|
+
const splitResultParsed = JSON.parse(splitResult);
|
|
47
|
+
const merged = [...splitResultParsed, ...result];
|
|
48
|
+
return JSON.stringify(merged, null, 2);
|
|
45
49
|
} catch (error) {
|
|
46
50
|
console.log(error);
|
|
47
51
|
console.error(`[pronto] views json error: ${error}`);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { readdir } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import * as JsonFile from "../JsonFile/JsonFile.js";
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
4
5
|
|
|
5
6
|
export const handleViewsSplit = async (storeFrontPath) => {
|
|
6
7
|
const viewsFolderPath = join(storeFrontPath, "assets", "views");
|
|
8
|
+
if (!existsSync(viewsFolderPath)) {
|
|
9
|
+
return JSON.stringify([]);
|
|
10
|
+
}
|
|
7
11
|
const dirents = await readdir(viewsFolderPath);
|
|
8
12
|
const promises = [];
|
|
9
13
|
for (const dirent of dirents) {
|