@pronto-tools-and-more/pronto 4.9.0 → 4.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/pronto",
3
- "version": "4.9.0",
3
+ "version": "4.9.2",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -13,20 +13,20 @@
13
13
  "author": "",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@pronto-tools-and-more/file-watcher": "4.9.0",
17
- "@pronto-tools-and-more/files": "4.9.0",
18
- "@pronto-tools-and-more/network-process": "4.9.0",
19
- "@pronto-tools-and-more/sass-compiler": "4.9.0",
16
+ "@pronto-tools-and-more/file-watcher": "4.9.2",
17
+ "@pronto-tools-and-more/files": "4.9.2",
18
+ "@pronto-tools-and-more/network-process": "4.9.2",
19
+ "@pronto-tools-and-more/sass-compiler": "4.9.2",
20
20
  "@lvce-editor/assert": "^1.2.0",
21
- "@lvce-editor/ipc": "^9.4.0",
22
- "@lvce-editor/json-rpc": "^2.0.0",
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"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/express": "^4.17.21",
29
- "@types/node": "^20.14.10",
29
+ "@types/node": "^22.5.0",
30
30
  "@types/ws": "^8.5.12",
31
31
  "jest": "^29.7.0"
32
32
  },
@@ -14,5 +14,6 @@ export const handleIndex =
14
14
  contentUrl,
15
15
  platform
16
16
  );
17
+ res.setHeader("content-type", "text/html; charset=utf-8");
17
18
  res.end(newIndexHtml);
18
19
  };
@@ -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
- await pipeline(viewsFilePath, res);
30
+ const readStream = createReadStream(viewsFilePath);
31
+ await pipeline(readStream, res);
30
32
  };
@@ -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 { join } from "path";
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
- import { existsSync } from "fs";
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
- return item.name + ".json";
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`;