@pronto-tools-and-more/pronto 6.1.2 → 6.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": "6.1.2",
3
+ "version": "6.2.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -17,13 +17,13 @@
17
17
  "@lvce-editor/ipc": "^10.2.1",
18
18
  "@lvce-editor/json-rpc": "^3.0.0",
19
19
  "@lvce-editor/verror": "^1.4.0",
20
- "@pronto-tools-and-more/file-watcher": "6.1.2",
21
- "@pronto-tools-and-more/files": "6.1.2",
22
- "@pronto-tools-and-more/network-process": "6.1.2",
23
- "@pronto-tools-and-more/sass-compiler": "6.1.2",
24
- "@pronto-tools-and-more/components-renderer": "6.1.2",
25
- "@pronto-tools-and-more/components": "6.1.2",
26
- "@pronto-tools-and-more/schema-process": "6.1.2",
20
+ "@pronto-tools-and-more/file-watcher": "6.2.0",
21
+ "@pronto-tools-and-more/files": "6.2.0",
22
+ "@pronto-tools-and-more/network-process": "6.2.0",
23
+ "@pronto-tools-and-more/sass-compiler": "6.2.0",
24
+ "@pronto-tools-and-more/components-renderer": "6.2.0",
25
+ "@pronto-tools-and-more/components": "6.2.0",
26
+ "@pronto-tools-and-more/schema-process": "6.2.0",
27
27
  "execa": "^9.3.1",
28
28
  "express": "^4.20.0"
29
29
  },
@@ -28,13 +28,15 @@ export const create = ({
28
28
  const contentPath = join(root, "src", "default", "content");
29
29
  app.get(
30
30
  "/",
31
- HandleIndex.handleIndex(
31
+ HandleIndex.handleIndex({
32
32
  storeFrontPath,
33
33
  appId,
34
34
  baseUrl,
35
35
  contentUrl,
36
- platform
37
- )
36
+ platform,
37
+ mode,
38
+ filesPath: FilesPath.filesPath,
39
+ })
38
40
  );
39
41
  app.get(
40
42
  "/modules/main.js",
@@ -2,10 +2,17 @@ import { readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import * as UpdateIndexHtml from "../UpdateIndexHtml/UpdateIndexHtml.js";
4
4
 
5
+ const getIndexHtmlPath = (mode, filesPath, storeFrontPath) => {
6
+ if (mode === "slim") {
7
+ join(filesPath, "framework", "src", "default", "storefront", "index.html");
8
+ }
9
+ return join(storeFrontPath, "index.html");
10
+ };
11
+
5
12
  export const handleIndex =
6
- (storeFrontPath, appId, baseUrl, contentUrl, platform) =>
13
+ ({ storeFrontPath, appId, baseUrl, contentUrl, platform, mode, filesPath }) =>
7
14
  async (req, res) => {
8
- const indexHtmlPath = join(storeFrontPath, "index.html");
15
+ const indexHtmlPath = getIndexHtmlPath(mode, filesPath, storeFrontPath);
9
16
  const indexHtmlContent = await readFile(indexHtmlPath, "utf8");
10
17
  const newIndexHtml = UpdateIndexHtml.updateIndexHtml(
11
18
  indexHtmlContent,