@lvce-editor/shared-process 0.40.0 → 0.40.1

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.40.0",
3
+ "version": "0.40.1",
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.40.0",
21
+ "@lvce-editor/extension-host-helper-process": "0.40.1",
22
22
  "@lvce-editor/ipc": "^11.6.0",
23
23
  "@lvce-editor/json-rpc": "^5.2.0",
24
24
  "@lvce-editor/jsonc-parser": "^1.5.0",
@@ -35,7 +35,7 @@
35
35
  "@lvce-editor/preview-process": "^3.11.0",
36
36
  "@lvce-editor/pty-host": "^3.0.0",
37
37
  "@lvce-editor/search-process": "^4.0.1",
38
- "@lvce-editor/typescript-compile-process": "^2.0.0",
38
+ "@lvce-editor/typescript-compile-process": "^2.1.0",
39
39
  "open": "^10.1.0",
40
40
  "tail": "^2.2.6",
41
41
  "tmp-promise": "^3.0.3",
@@ -0,0 +1,7 @@
1
+ import { join } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ export const getBuiltinExtensionsPath = () => {
4
+ const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
5
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '21f6893', 'extensions');
6
+ return builtinExtensionsPath;
7
+ };
@@ -3,6 +3,7 @@ import * as ExtensionManifestInputType from '../ExtensionManifestInputType/Exten
3
3
  import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js';
4
4
  import * as ExtensionManifests from '../ExtensionManifests/ExtensionManifests.js';
5
5
  import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
6
+ import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js';
6
7
  import { VError } from '../VError/VError.js';
7
8
  const getManifestVersion = (json) => {
8
9
  if (json && json.version && typeof json.version === 'string') {
@@ -52,7 +53,7 @@ export const list = async () => {
52
53
  },
53
54
  {
54
55
  type: ExtensionManifestInputType.Folder,
55
- path: PlatformPaths.getBuiltinExtensionsPath(),
56
+ path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
56
57
  },
57
58
  ]);
58
59
  const infos = getManifestInfos(manifests);
@@ -3,6 +3,7 @@ import * as Debug from '../Debug/Debug.js';
3
3
  import * as ExtensionManifestInputType from '../ExtensionManifestInputType/ExtensionManifestInputType.js';
4
4
  import * as ExtensionManifests from '../ExtensionManifests/ExtensionManifests.js';
5
5
  import * as Path from '../Path/Path.js';
6
+ import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js';
6
7
  import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
7
8
  import { VError } from '../VError/VError.js';
8
9
  export const enable = async (id) => {
@@ -33,9 +34,9 @@ export const getBuiltinExtensions = () => {
33
34
  return ExtensionManifests.getAll([
34
35
  {
35
36
  type: ExtensionManifestInputType.Folder,
36
- path: PlatformPaths.getBuiltinExtensionsPath(),
37
+ path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
37
38
  },
38
- ], PlatformPaths.getBuiltinExtensionsPath());
39
+ ], BuiltinExtensionsPath.getBuiltinExtensionsPath());
39
40
  };
40
41
  export const getInstalledExtensions = () => {
41
42
  return ExtensionManifests.getAll([
@@ -43,7 +44,7 @@ export const getInstalledExtensions = () => {
43
44
  type: ExtensionManifestInputType.Folder,
44
45
  path: PlatformPaths.getExtensionsPath(),
45
46
  },
46
- ], PlatformPaths.getBuiltinExtensionsPath());
47
+ ], BuiltinExtensionsPath.getBuiltinExtensionsPath());
47
48
  };
48
49
  export const getExtensions = () => {
49
50
  return ExtensionManifests.getAll([
@@ -61,9 +62,9 @@ export const getExtensions = () => {
61
62
  },
62
63
  {
63
64
  type: ExtensionManifestInputType.Folder,
64
- path: PlatformPaths.getBuiltinExtensionsPath(),
65
+ path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
65
66
  },
66
- ], PlatformPaths.getBuiltinExtensionsPath());
67
+ ], BuiltinExtensionsPath.getBuiltinExtensionsPath());
67
68
  };
68
69
  export const getDisabledExtensions = () => {
69
70
  return ExtensionManifests.getAll([
@@ -71,6 +72,6 @@ export const getDisabledExtensions = () => {
71
72
  type: ExtensionManifestInputType.Folder,
72
73
  path: PlatformPaths.getDisabledExtensionsPath(),
73
74
  },
74
- ], PlatformPaths.getBuiltinExtensionsPath());
75
+ ], BuiltinExtensionsPath.getBuiltinExtensionsPath());
75
76
  };
76
77
  export * from '../ExtensionUninstall/ExtensionUninstall.js';
@@ -1,13 +1,13 @@
1
1
  import { join } from 'node:path';
2
2
  import { pathToFileURL } from 'node:url';
3
+ import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js';
3
4
  import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
4
5
  import * as IsProduction from '../IsProduction/IsProduction.js';
5
- import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
6
6
  export const getTypeScriptUri = () => {
7
7
  if (!IsProduction.isProduction || IsBuiltServer.isBuiltServer) {
8
8
  return 'typescript';
9
9
  }
10
- const typescriptPath = join(PlatformPaths.getBuiltinExtensionsPath(), 'builtin.language-features-typescript', 'node', 'node_modules', 'typescript', 'lib', 'typescript.js');
10
+ const typescriptPath = join(BuiltinExtensionsPath.getBuiltinExtensionsPath(), 'builtin.language-features-typescript', 'node', 'node_modules', 'typescript', 'lib', 'typescript.js');
11
11
  const typescriptUri = pathToFileURL(typescriptPath).toString();
12
12
  return typescriptUri;
13
13
  };
@@ -0,0 +1,5 @@
1
+ import * as HandleRequestTest from './HandleRequest.js';
2
+ export const name = 'HandleRequest';
3
+ export const Commands = {
4
+ handleRequest: HandleRequestTest.handleRequest,
5
+ };
@@ -0,0 +1,9 @@
1
+ import * as Assert from '../Assert/Assert.js';
2
+ import * as HttpServerResponse from '../HttpServerResponse/HttpServerResponse.js';
3
+ import * as GetElectronFileResponse from '../GetElectronFileResponse/GetElectronFileResponse.js';
4
+ export const handleRequest = async (socket, request) => {
5
+ Assert.object(socket);
6
+ Assert.object(request);
7
+ const fileResponse = await GetElectronFileResponse.getElectronFileResponse(request.url, request);
8
+ HttpServerResponse.send(request, socket, fileResponse);
9
+ };
@@ -135,6 +135,8 @@ export const load = (moduleId) => {
135
135
  return import('../GetExtensions/GetExtensions.ipc.js');
136
136
  case ModuleId.FileSystemDisk:
137
137
  return import('../FileSystemDisk/FileSystemDisk.ipc.js');
138
+ case ModuleId.HandleRequest:
139
+ return import('../HandleRequest/HandleRequest.ipc.js');
138
140
  default:
139
141
  throw new Error(`module ${moduleId} not found`);
140
142
  }
@@ -71,3 +71,4 @@ export const WebViewServer = 76;
71
71
  export const Transferrable = 77;
72
72
  export const GetExtensions = 78;
73
73
  export const FileSystemDisk = 79;
74
+ export const HandleRequest = 80;
@@ -300,6 +300,8 @@ export const getModuleId = (commandId) => {
300
300
  case 'FileSystemDisk.readJson':
301
301
  case 'FileSystemDisk.writeFile':
302
302
  return ModuleId.FileSystemDisk;
303
+ case 'HandleRequest.handleRequest':
304
+ return ModuleId.HandleRequest;
303
305
  default:
304
306
  throw new CommandNotFoundError(commandId);
305
307
  }
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
41
41
  export const getSetupName = () => {
42
42
  return 'Lvce-Setup';
43
43
  };
44
- export const version = '0.40.0';
45
- export const commit = 'c76328b';
46
- export const date = '2024-12-07T19:48:48.000Z';
44
+ export const version = '0.40.1';
45
+ export const commit = '21f6893';
46
+ export const date = '2024-12-08T16:28:13.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };
@@ -1,14 +1,12 @@
1
- import { dirname, join } from 'node:path';
1
+ import { join } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
2
3
  import * as IsBuiltServer from '../IsBuiltServer/IsBuiltServer.js';
3
4
  import * as Root from '../Root/Root.js';
4
- import { fileURLToPath } from 'node:url';
5
5
  export const getStaticPath = () => {
6
6
  if (IsBuiltServer.isBuiltServer) {
7
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');
8
+ const staticServerUri = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
9
+ const staticPath = join(staticServerUri, '..', '..', 'static');
12
10
  return staticPath;
13
11
  }
14
12
  return join(Root.root, 'static');