@pronto-tools-and-more/pronto 9.17.0 → 9.18.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/pronto",
3
- "version": "9.17.0",
3
+ "version": "9.18.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -17,15 +17,15 @@
17
17
  "@lvce-editor/ipc": "^11.1.0",
18
18
  "@lvce-editor/json-rpc": "^5.0.0",
19
19
  "@lvce-editor/verror": "^1.5.0",
20
- "@pronto-tools-and-more/file-watcher": "9.17.0",
21
- "@pronto-tools-and-more/files": "9.17.0",
22
- "@pronto-tools-and-more/network-process": "9.17.0",
23
- "@pronto-tools-and-more/sass-compiler": "9.17.0",
24
- "@pronto-tools-and-more/components-renderer": "9.17.0",
25
- "@pronto-tools-and-more/components": "9.17.0",
26
- "@pronto-tools-and-more/schema-process": "9.17.0",
27
- "@pronto-tools-and-more/diff-process": "9.17.0",
28
- "@pronto-tools-and-more/type-checker": "9.17.0",
20
+ "@pronto-tools-and-more/file-watcher": "9.18.0",
21
+ "@pronto-tools-and-more/files": "9.18.0",
22
+ "@pronto-tools-and-more/network-process": "9.18.0",
23
+ "@pronto-tools-and-more/sass-compiler": "9.18.0",
24
+ "@pronto-tools-and-more/components-renderer": "9.18.0",
25
+ "@pronto-tools-and-more/components": "9.18.0",
26
+ "@pronto-tools-and-more/schema-process": "9.18.0",
27
+ "@pronto-tools-and-more/diff-process": "9.18.0",
28
+ "@pronto-tools-and-more/type-checker": "9.18.0",
29
29
  "execa": "^9.5.1",
30
30
  "express": "^4.21.1"
31
31
  },
@@ -21,6 +21,7 @@ export const create = ({
21
21
  splitViews,
22
22
  reactComponents,
23
23
  managerWebUrl,
24
+ resourceDynamicUrlsInViewsJson,
24
25
  }) => {
25
26
  const app = express();
26
27
  const storeFrontPath = join(root, "src", "default", "storefront");
@@ -57,6 +58,7 @@ export const create = ({
57
58
  storeFrontPath,
58
59
  splitViews,
59
60
  reactComponents,
61
+ resourceDynamicUrlsInViewsJson,
60
62
  })
61
63
  );
62
64
  app.use("*", HandleCss.handleCss(storeFrontPath));
@@ -51,6 +51,7 @@ export const build = async () => {
51
51
  pathPrefix: Config.pathPrefix,
52
52
  isBuild: true,
53
53
  hotReload: false,
54
+ resourceDynamicUrlsInViewsJson: false,
54
55
  });
55
56
  const viewsPath = join(
56
57
  dist,
@@ -110,3 +110,6 @@ export const reactComponents = config.reactComponents || false;
110
110
  export const pushToReleaseOnGitTag = config.pushToReleaseOnGitTag || false;
111
111
 
112
112
  export const hotReload = config.hotReload || false;
113
+
114
+ export const resourceDynamicUrlsInViewsJson =
115
+ config.resourceDynamicUrlsInViewsJson || false;
@@ -24,6 +24,7 @@ export const createServer = async (root, errorColor) => {
24
24
  managerWebUrl: Config.managerWebUrl,
25
25
  reactComponents: Config.reactComponents,
26
26
  splitViews: Config.splitViews,
27
+ resourceDynamicUrlsInViewsJson: Config.resourceDynamicUrlsInViewsJson,
27
28
  });
28
29
  const server = http.createServer(app);
29
30
  const webSocketServer = new ws.WebSocketServer({
@@ -11,6 +11,7 @@ export const getViewsResponse = async ({
11
11
  pathPrefix,
12
12
  isBuild,
13
13
  hotReload,
14
+ resourceDynamicUrlsInViewsJson,
14
15
  }) => {
15
16
  if (reactComponents) {
16
17
  const content = await HandleViewsReactComponents.handleViewsReactComponents(
@@ -26,9 +27,18 @@ export const getViewsResponse = async ({
26
27
  }
27
28
  if (splitViews) {
28
29
  const content = await HandleViewsSplit.handleViewsSplit(storeFrontPath);
30
+ if (resourceDynamicUrlsInViewsJson && !isBuild) {
31
+ const replacement = "";
32
+ const actualContent = content.replaceAll(
33
+ "resource://dynamic",
34
+ replacement
35
+ );
36
+ return actualContent;
37
+ }
29
38
  return content;
30
39
  }
31
40
  const viewsFilePath = join(storeFrontPath, "assets", "views.json");
32
41
  const content = await readFile(viewsFilePath, "utf8");
42
+
33
43
  return content;
34
44
  };
@@ -1,7 +1,12 @@
1
1
  import * as GetViewsResponse from "../GetViewsResponse/GetViewsResponse.js";
2
2
 
3
3
  export const handleViews =
4
- ({ storeFrontPath, splitViews, reactComponents }) =>
4
+ ({
5
+ storeFrontPath,
6
+ splitViews,
7
+ reactComponents,
8
+ resourceDynamicUrlsInViewsJson,
9
+ }) =>
5
10
  async (req, res) => {
6
11
  res.setHeader("Content-Type", "application/json");
7
12
  const content = await GetViewsResponse.getViewsResponse({
@@ -11,6 +16,7 @@ export const handleViews =
11
16
  pathPrefix: "",
12
17
  isBuild: false,
13
18
  hotReload: false,
19
+ resourceDynamicUrlsInViewsJson,
14
20
  });
15
21
  res.end(content);
16
22
  };
@@ -1 +1 @@
1
- export const version = '9.17.0'
1
+ export const version = '9.18.0'