@lvce-editor/shared-process 0.30.0 → 0.30.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.30.0",
3
+ "version": "0.30.2",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "^1.2.0",
21
- "@lvce-editor/extension-host-helper-process": "0.30.0",
22
- "@lvce-editor/ipc": "^9.2.0",
21
+ "@lvce-editor/extension-host-helper-process": "0.30.2",
22
+ "@lvce-editor/ipc": "^9.3.0",
23
23
  "@lvce-editor/json-rpc": "^1.3.0",
24
24
  "@lvce-editor/jsonc-parser": "^1.4.0",
25
25
  "@lvce-editor/pretty-error": "^1.5.0",
@@ -29,7 +29,7 @@
29
29
  "xdg-basedir": "^5.1.0"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@lvce-editor/network-process": "^1.2.0",
32
+ "@lvce-editor/network-process": "^1.3.0",
33
33
  "@lvce-editor/preload": "^1.3.0",
34
34
  "@lvce-editor/search-process": "^1.2.0",
35
35
  "@lvce-editor/typescript-compile-process": "^1.2.0",
@@ -1,4 +1,5 @@
1
1
  import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
2
+ import * as IsElectron from '../IsElectron/IsElectron.js';
2
3
  export const value = GetContentSecurityPolicy.getContentSecurityPolicy([
3
4
  `default-src 'none'`,
4
5
  `font-src 'self'`,
@@ -6,4 +7,5 @@ export const value = GetContentSecurityPolicy.getContentSecurityPolicy([
6
7
  `media-src 'self'`,
7
8
  `script-src 'self'`,
8
9
  `style-src 'self'`,
10
+ ...(IsElectron.isElectron ? [] : [`manifest-src 'self'`]),
9
11
  ]);
@@ -2,16 +2,32 @@ import { readFile } from 'node:fs/promises';
2
2
  import * as Platform from '../Platform/Platform.js';
3
3
  import * as ShouldTranspileTypescript from '../ShouldTranspileTypescript/ShouldTranspileTypescript.js';
4
4
  import * as TranspileTypeScript from '../TranspileTypeScript/TranspileTypeScript.js';
5
+ import * as Preferences from '../Preferences/Preferences.js';
6
+ import { pathToFileURL } from 'node:url';
5
7
  export const getElectronFileResponseContent = async (request, absolutePath, url) => {
6
8
  if (ShouldTranspileTypescript.shouldTranspileTypescript(request, url)) {
7
9
  const content = await readFile(absolutePath);
8
10
  const newContent = await TranspileTypeScript.transpileTypeScript(content.toString());
9
- return newContent.outputText;
11
+ const newContentString = newContent.outputText;
12
+ const newContentBuffer = Buffer.from(newContentString);
13
+ return newContentBuffer;
10
14
  }
11
15
  let content = await readFile(absolutePath);
12
16
  if (!Platform.isProduction && url === `${Platform.scheme}://-/`) {
13
17
  // @ts-ignore
14
18
  content = content.toString().replace(' <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />\n', '');
15
19
  }
20
+ if (!Platform.isProduction && url === '/') {
21
+ const preferences = await Preferences.getUserPreferences();
22
+ if (preferences['develop.rendererProcessPath']) {
23
+ // @ts-ignore
24
+ content = content
25
+ .toString()
26
+ .replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js', '/remote' + pathToFileURL(preferences['develop.rendererProcessPath']).toString().slice(7));
27
+ }
28
+ }
29
+ if (typeof content === 'string') {
30
+ content = Buffer.from(content);
31
+ }
16
32
  return content;
17
33
  };
@@ -1,19 +1,20 @@
1
1
  import * as IsLinux from '../IsLinux/IsLinux.js';
2
+ import * as IsProduction from '../IsProduction/IsProduction.js';
2
3
  import * as IsWindows from '../IsWindows/IsWindows.js';
3
4
  import * as Path from '../Path/Path.js';
4
5
  import * as Platform from '../Platform/Platform.js';
5
6
  import * as Root from '../Root/Root.js';
6
7
  export const getIcon = () => {
7
- if (!Platform.isProduction && IsLinux.isLinux) {
8
+ if (!IsProduction.isProduction && IsLinux.isLinux) {
8
9
  return Path.join(Root.root, 'packages', 'build', 'files', 'icon.png');
9
10
  }
10
- if (!Platform.isProduction && IsWindows.isWindows) {
11
+ if (!IsProduction.isProduction && IsWindows.isWindows) {
11
12
  return Path.join(Root.root, 'packages', 'build', 'files', 'icon.png');
12
13
  }
13
- if (Platform.isProduction && Platform.isArchLinux) {
14
+ if (IsProduction.isProduction && Platform.isArchLinux) {
14
15
  return Path.join(Root.root, 'static', 'icons', 'icon.png');
15
16
  }
16
- if (Platform.isProduction && Platform.isAppImage) {
17
+ if (IsProduction.isProduction && Platform.isAppImage) {
17
18
  return Path.join(Root.root, 'static', 'icons', 'icon.png');
18
19
  }
19
20
  return undefined;
@@ -1,10 +1,10 @@
1
1
  import { join } from 'node:path';
2
+ import { pathToFileURL } from 'node:url';
2
3
  import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
4
+ import * as IsProduction from '../IsProduction/IsProduction.js';
3
5
  import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
4
- import * as Platform from '../Platform/Platform.js';
5
- import { pathToFileURL } from 'node:url';
6
6
  export const getTypeScriptUri = () => {
7
- if (!Platform.isProduction || IsBuiltServer.isBuiltServer) {
7
+ if (!IsProduction.isProduction || IsBuiltServer.isBuiltServer) {
8
8
  return 'typescript';
9
9
  }
10
10
  const typescriptPath = join(PlatformPaths.getBuiltinExtensionsPath(), 'builtin.language-features-typescript', 'node', 'node_modules', 'typescript', 'lib', 'typescript.js');
@@ -8,7 +8,7 @@ export const isWindows = platform === 'win32';
8
8
  export const isMacOs = platform === 'darwin';
9
9
  export const isDeb = false;
10
10
  export const isLinux = platform === 'linux';
11
- export const isProduction = false;
11
+ export const isProduction = true;
12
12
  export const isArchLinux = false;
13
13
  export const isAppImage = false;
14
14
  export const scheme = 'lvce-oss';
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.30.0';
45
- export const commit = '1d13af6';
46
- export const date = '2024-06-13T18:16:21.000Z';
44
+ export const version = '0.30.2';
45
+ export const commit = '2dd4ca3';
46
+ export const date = '2024-06-17T19:53:56.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };