@pronto-tools-and-more/pronto 5.0.1 → 5.1.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.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -17,11 +17,11 @@
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.0.1",
21
- "@pronto-tools-and-more/files": "5.0.1",
22
- "@pronto-tools-and-more/network-process": "5.0.1",
23
- "@pronto-tools-and-more/sass-compiler": "5.0.1",
24
- "@pronto-tools-and-more/components-renderer": "5.0.1",
20
+ "@pronto-tools-and-more/file-watcher": "5.1.0",
21
+ "@pronto-tools-and-more/files": "5.1.0",
22
+ "@pronto-tools-and-more/network-process": "5.1.0",
23
+ "@pronto-tools-and-more/sass-compiler": "5.1.0",
24
+ "@pronto-tools-and-more/components-renderer": "5.1.0",
25
25
  "execa": "^9.3.1",
26
26
  "express": "^4.19.2"
27
27
  },
@@ -4,6 +4,7 @@ import * as ComponentsRendererPath from "../ComponentsRendererPath/ComponentsRen
4
4
  import * as HandleIpc from "../HandleIpc/HandleIpc.js";
5
5
  import * as IpcParent from "../IpcParent/IpcParent.js";
6
6
  import * as IpcParentType from "../IpcParentType/IpcParentType.js";
7
+ import * as UnhandleIpc from "../UnhandleIpc/UnhandleIpc.js";
7
8
  import * as JsonRpc from "../JsonRpc/JsonRpc.js";
8
9
 
9
10
  export const handleViewsReactComponents = async (storeFrontPath) => {
@@ -16,6 +17,13 @@ export const handleViewsReactComponents = async (storeFrontPath) => {
16
17
  "src",
17
18
  "main.ts"
18
19
  );
20
+ const tsconfigPath = join(
21
+ storeFrontPath,
22
+ "..",
23
+ "..",
24
+ "components",
25
+ "tsconfig.json"
26
+ );
19
27
  if (!existsSync(componentsPath)) {
20
28
  throw new Error(`components path not found: ${componentsPath}`);
21
29
  }
@@ -28,9 +36,12 @@ export const handleViewsReactComponents = async (storeFrontPath) => {
28
36
  const result = await JsonRpc.invoke(
29
37
  ipc,
30
38
  "RenderViews.renderViews",
31
- componentsPath
39
+ componentsPath,
40
+ tsconfigPath
32
41
  );
33
- return JSON.stringify(result);
42
+ UnhandleIpc.unhandleIpc(ipc);
43
+ ipc.dispose();
44
+ return JSON.stringify(result, null, 2);
34
45
  } catch (error) {
35
46
  console.log(error);
36
47
  console.error(`[pronto] views json error: ${error}`);
@@ -0,0 +1,10 @@
1
+ import * as HandleMessage from "../HandleMessage/HandleMessage.js";
2
+
3
+ export const unhandleIpc = (ipc) => {
4
+ if ("addEventListener" in ipc) {
5
+ ipc.removeEventListener("message", HandleMessage.handleMessage);
6
+ } else if ("on" in ipc) {
7
+ // deprecated
8
+ ipc.off("message", HandleMessage.handleMessage);
9
+ }
10
+ };