@lvce-editor/shared-process 0.38.1 → 0.38.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": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "^1.3.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.38.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.38.2",
|
|
22
22
|
"@lvce-editor/ipc": "^11.1.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "^5.0.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "^1.5.0",
|
package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { tmpdir } from 'node:os';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import * as IndexHtmlPath from '../IndexHtmlPath/IndexHtmlPath.js';
|
|
5
4
|
import * as Path from '../Path/Path.js';
|
|
6
5
|
import * as Platform from '../Platform/Platform.js';
|
|
7
6
|
import * as Root from '../Root/Root.js';
|
|
7
|
+
import * as StaticPath from '../StaticPath/StaticPath.js';
|
|
8
8
|
// TODO clean up this code
|
|
9
9
|
export const getElectronFileResponseAbsolutePath = (pathName) => {
|
|
10
10
|
// TODO remove if/else in prod (use replacement)
|
|
11
11
|
if (pathName === `/` || pathName.startsWith(`/?`)) {
|
|
12
|
-
|
|
12
|
+
const staticPath = StaticPath.getStaticPath();
|
|
13
|
+
return Path.join(staticPath, 'index.html');
|
|
13
14
|
}
|
|
14
15
|
if (pathName.startsWith(`/packages`)) {
|
|
15
16
|
return Path.join(Root.root, pathName);
|
|
@@ -36,5 +37,6 @@ export const getElectronFileResponseAbsolutePath = (pathName) => {
|
|
|
36
37
|
if (pathName.startsWith('/home')) {
|
|
37
38
|
return pathName;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
+
const staticPath = StaticPath.getStaticPath();
|
|
41
|
+
return Path.join(staticPath, pathName);
|
|
40
42
|
};
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.38.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2024-11-
|
|
44
|
+
export const version = '0.38.2';
|
|
45
|
+
export const commit = '6baa369';
|
|
46
|
+
export const date = '2024-11-15T23:02:42.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
|
|
3
|
+
import * as Root from '../Root/Root.js';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
export const getStaticPath = () => {
|
|
6
|
+
if (IsBuiltServer.isBuiltServer) {
|
|
7
|
+
// TODO maybe move static files to separate package
|
|
8
|
+
const serverIndexUri = import.meta.resolve('@lvce-editor/server');
|
|
9
|
+
const serverIndexPath = fileURLToPath(serverIndexUri);
|
|
10
|
+
const serverPath = dirname(serverIndexPath);
|
|
11
|
+
const staticPath = join(serverPath, 'static');
|
|
12
|
+
return staticPath;
|
|
13
|
+
}
|
|
14
|
+
return join(Root.root, 'static');
|
|
15
|
+
};
|