@pronto-tools-and-more/components-renderer 6.32.0 → 6.33.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/components-renderer",
3
- "version": "6.32.0",
3
+ "version": "6.33.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -13,9 +13,9 @@
13
13
  "author": "",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@lvce-editor/assert": "^1.2.0",
17
- "@lvce-editor/ipc": "^10.0.4",
18
- "@lvce-editor/json-rpc": "^3.0.0",
16
+ "@lvce-editor/assert": "^1.3.0",
17
+ "@lvce-editor/ipc": "^11.0.1",
18
+ "@lvce-editor/json-rpc": "^4.1.0",
19
19
  "@lvce-editor/verror": "^1.4.0",
20
20
  "@swc-node/register": "^1.10.9"
21
21
  },
@@ -4,20 +4,22 @@ import * as LoadRoutes from "../LoadRoutes/LoadRoutes.js";
4
4
  import * as LoadSwc from "../LoadSwc/LoadSwc.js";
5
5
  import * as RenderView from "../RenderView/RenderView.js";
6
6
  import * as SwcNodePath from "../SwcNodePath/SwcNodePath.js";
7
+ import * as SetAssetDir from "../SetAssetDir/SetAssetDir.js";
7
8
 
8
9
  export const renderViews = async (
9
10
  componentsPathMain,
10
11
  tsconfigPath,
11
- pathPrefix
12
+ pathPrefix,
13
+ isBuild
12
14
  ) => {
13
15
  Assert.string(componentsPathMain);
14
16
  Assert.string(tsconfigPath);
15
17
 
16
18
  await LoadSwc.loadSwc(SwcNodePath.swcNodePath, tsconfigPath);
17
19
 
18
- // TODO use import meta env once supported
19
- // @ts-ignore
20
- process.env.ASSET_DIR = `resource://dynamic`;
20
+ const assetDir = isBuild ? "" : "resource://dynamic";
21
+ SetAssetDir.setAssetDir(assetDir);
22
+
21
23
  const module = await LoadRoutes.loadRoutes(componentsPathMain);
22
24
  const values = Object.values(module);
23
25
  // TODO return views string instead of json for faster performance?
@@ -0,0 +1,8 @@
1
+ import * as Assert from "../Assert/Assert.js";
2
+
3
+ export const setAssetDir = (path) => {
4
+ Assert.string(path);
5
+ // TODO use import meta env once supported
6
+ // @ts-ignore
7
+ process.env.ASSET_DIR = `resource://dynamic`;
8
+ };