@pronto-tools-and-more/pronto 4.8.0 → 4.9.1
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": "4.
|
|
3
|
+
"version": "4.9.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@pronto-tools-and-more/file-watcher": "4.
|
|
17
|
-
"@pronto-tools-and-more/files": "4.
|
|
18
|
-
"@pronto-tools-and-more/network-process": "4.
|
|
19
|
-
"@pronto-tools-and-more/sass-compiler": "4.
|
|
16
|
+
"@pronto-tools-and-more/file-watcher": "4.9.1",
|
|
17
|
+
"@pronto-tools-and-more/files": "4.9.1",
|
|
18
|
+
"@pronto-tools-and-more/network-process": "4.9.1",
|
|
19
|
+
"@pronto-tools-and-more/sass-compiler": "4.9.1",
|
|
20
20
|
"@lvce-editor/assert": "^1.2.0",
|
|
21
|
-
"@lvce-editor/ipc": "^
|
|
22
|
-
"@lvce-editor/json-rpc": "^
|
|
21
|
+
"@lvce-editor/ipc": "^10.0.4",
|
|
22
|
+
"@lvce-editor/json-rpc": "^3.0.0",
|
|
23
23
|
"@lvce-editor/verror": "^1.4.0",
|
|
24
24
|
"execa": "^9.3.1",
|
|
25
25
|
"express": "^4.19.2"
|
|
@@ -2,6 +2,7 @@ import { readdir } from "node:fs/promises";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { pipeline } from "node:stream/promises";
|
|
4
4
|
import * as JsonFile from "../JsonFile/JsonFile.js";
|
|
5
|
+
import { createReadStream } from "node:fs";
|
|
5
6
|
|
|
6
7
|
const handleViewsSplit = async (storeFrontPath) => {
|
|
7
8
|
const viewsFolderPath = join(storeFrontPath, "assets", "views");
|
|
@@ -26,5 +27,6 @@ export const handleViews =
|
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
const viewsFilePath = join(storeFrontPath, "assets", "views.json");
|
|
29
|
-
|
|
30
|
+
const readStream = createReadStream(viewsFilePath);
|
|
31
|
+
await pipeline(readStream, res);
|
|
30
32
|
};
|
package/src/parts/Split/Split.js
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import * as NetworkProcess from "../NetworkProcess/NetworkProcess.js";
|
|
2
|
-
import * as Cwd from "../Cwd/Cwd.js";
|
|
3
1
|
import { VError } from "@lvce-editor/verror";
|
|
4
|
-
import {
|
|
2
|
+
import { existsSync } from "fs";
|
|
5
3
|
import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import * as Cwd from "../Cwd/Cwd.js";
|
|
6
6
|
import * as JsonFile from "../JsonFile/JsonFile.js";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
const normalize = (name) => {
|
|
9
|
+
if (!name) {
|
|
10
|
+
return "anonymous" + Math.random().toFixed(3);
|
|
11
|
+
}
|
|
12
|
+
return name.replaceAll("/", "-");
|
|
13
|
+
};
|
|
8
14
|
|
|
9
15
|
const getFileName = (item) => {
|
|
10
16
|
if (item.path) {
|
|
11
17
|
if (item.path === "/") {
|
|
12
|
-
|
|
18
|
+
if (item.redirectTo) {
|
|
19
|
+
return "redirect.json";
|
|
20
|
+
}
|
|
21
|
+
return normalize(item.name) + ".json";
|
|
13
22
|
}
|
|
14
|
-
return item.path + ".json";
|
|
23
|
+
return normalize(item.path) + ".json";
|
|
15
24
|
}
|
|
16
25
|
if (item.globalData) {
|
|
17
26
|
return `globalData.json`;
|