@lvce-editor/shared-process 0.35.3 → 0.35.5

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.35.3",
3
+ "version": "0.35.5",
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.35.3",
21
+ "@lvce-editor/extension-host-helper-process": "0.35.5",
22
22
  "@lvce-editor/ipc": "^11.0.1",
23
23
  "@lvce-editor/json-rpc": "^4.1.0",
24
24
  "@lvce-editor/jsonc-parser": "^1.4.0",
@@ -1,15 +1,24 @@
1
1
  import { pathToFileURL } from 'node:url';
2
2
  import * as Platform from '../Platform/Platform.js';
3
3
  import * as Preferences from '../Preferences/Preferences.js';
4
- export const addCustomRendererProcessPath = async (content) => {
4
+ export const addCustomPathsToIndexHtml = async (content) => {
5
5
  if (Platform.isProduction) {
6
6
  return content;
7
7
  }
8
+ let newContent = content;
8
9
  const preferences = await Preferences.getUserPreferences();
9
10
  if (preferences['develop.rendererProcessPath']) {
10
- return content
11
+ newContent = newContent
11
12
  .toString()
12
13
  .replace('/packages/renderer-worker/node_modules/@lvce-editor/renderer-process/dist/rendererProcessMain.js', '/remote' + pathToFileURL(preferences['develop.rendererProcessPath']).toString().slice(7));
13
14
  }
14
- return content;
15
+ if (preferences['develop.extensionHostWorkerPath']) {
16
+ const actualUrl = '/remote' + pathToFileURL(preferences['develop.extensionHostWorkerPath']).toString().slice(7);
17
+ const config = JSON.stringify({
18
+ extensionHostWorkerUrl: actualUrl,
19
+ });
20
+ newContent = newContent.toString().replace('</title>', `</title>
21
+ <script type="application.json" id="Config">${config}</script>`);
22
+ }
23
+ return newContent;
15
24
  };
@@ -1,5 +1,5 @@
1
1
  import { readFile } from 'node:fs/promises';
2
- import * as AddCustomRendererProcessPath from '../AddCustomRendererProcessPath/AddCustomRendererProcessPath.js';
2
+ import * as AddCustomPathsToIndexHtml from '../AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js';
3
3
  import * as Platform from '../Platform/Platform.js';
4
4
  import * as ShouldTranspileTypescript from '../ShouldTranspileTypescript/ShouldTranspileTypescript.js';
5
5
  import * as TranspileTypeScript from '../TranspileTypeScript/TranspileTypeScript.js';
@@ -18,7 +18,7 @@ export const getElectronFileResponseContent = async (request, absolutePath, url)
18
18
  content = content.toString().replace(' <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />\n', '');
19
19
  }
20
20
  if (url === '/') {
21
- content = await AddCustomRendererProcessPath.addCustomRendererProcessPath(content);
21
+ content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(content);
22
22
  }
23
23
  if (typeof content === 'string') {
24
24
  content = Buffer.from(content);
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
- import * as AddCustomRendererProcessPath from '../AddCustomRendererProcessPath/AddCustomRendererProcessPath.js';
3
+ import * as AddCustomPathsToIndexHtml from '../AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js';
4
4
  import * as CreateTestOverview from '../CreateTestOverview/CreateTestOverview.js';
5
5
  import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js';
6
6
  import * as CrossOriginOpenerPolicy from '../CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js';
@@ -14,7 +14,7 @@ export const getTestRequestResponse = async (request, indexHtmlPath) => {
14
14
  const pathName = GetPathName.getPathName(request);
15
15
  if (pathName.endsWith('.html')) {
16
16
  const body = await readFile(indexHtmlPath, 'utf8');
17
- const content = await AddCustomRendererProcessPath.addCustomRendererProcessPath(body);
17
+ const content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(body);
18
18
  return {
19
19
  body: content,
20
20
  init: {
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.35.3';
45
- export const commit = '05f09be';
46
- export const date = '2024-10-04T11:45:39.000Z';
44
+ export const version = '0.35.5';
45
+ export const commit = '1a69d51';
46
+ export const date = '2024-10-04T16:30:38.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };