@lvce-editor/shared-process 0.38.9 → 0.40.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": "@lvce-editor/shared-process",
3
- "version": "0.38.9",
3
+ "version": "0.40.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,24 +18,24 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@lvce-editor/assert": "^1.3.0",
21
- "@lvce-editor/extension-host-helper-process": "0.38.9",
22
- "@lvce-editor/ipc": "^11.3.0",
21
+ "@lvce-editor/extension-host-helper-process": "0.40.0",
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",
25
25
  "@lvce-editor/pretty-error": "^1.6.0",
26
26
  "@lvce-editor/verror": "^1.6.0",
27
- "debug": "^4.3.7",
27
+ "debug": "^4.4.0",
28
28
  "is-object": "^1.0.2",
29
29
  "xdg-basedir": "^5.1.0"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@lvce-editor/embeds-process": "^1.5.0",
32
+ "@lvce-editor/embeds-process": "^1.6.0",
33
33
  "@lvce-editor/network-process": "^2.1.0",
34
34
  "@lvce-editor/preload": "^1.4.0",
35
35
  "@lvce-editor/preview-process": "^3.11.0",
36
- "@lvce-editor/pty-host": "^2.1.0",
37
- "@lvce-editor/search-process": "^3.2.0",
38
- "@lvce-editor/typescript-compile-process": "^1.6.0",
36
+ "@lvce-editor/pty-host": "^3.0.0",
37
+ "@lvce-editor/search-process": "^4.0.1",
38
+ "@lvce-editor/typescript-compile-process": "^2.0.0",
39
39
  "open": "^10.1.0",
40
40
  "tail": "^2.2.6",
41
41
  "tmp-promise": "^3.0.3",
@@ -371,6 +371,18 @@ const resolveServerStaticPath = (root) => {
371
371
  if (existsSync(guessThree)) {
372
372
  return guessThree;
373
373
  }
374
+ const guessFour = Path.join(root, 'packages', 'build', 'node_modules', '@lvce-editor', 'static-server', 'static');
375
+ if (existsSync(guessFour)) {
376
+ return guessFour;
377
+ }
378
+ const guessFive = Path.join(root, 'node_modules', '@lvce-editor', 'static-server', 'static');
379
+ if (existsSync(guessFive)) {
380
+ return guessFive;
381
+ }
382
+ const guessSix = Path.join(root, 'packages', 'server', 'node_modules', '@lvce-editor', 'static-server', 'static');
383
+ if (existsSync(guessSix)) {
384
+ return guessSix;
385
+ }
374
386
  throw new Error(`server static path not found`);
375
387
  };
376
388
  /**
@@ -1,12 +1,11 @@
1
- import { stat } from 'node:fs/promises';
2
1
  import * as GetContentResponse from '../GetContentResponse/GetContentResponse.js';
3
2
  import * as GetElectronFileResponseAbsolutePath from '../GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js';
4
3
  import * as GetElectronFileResponseContent from '../GetElectronFileResponseContent/GetElectronFileResponseContent.js';
5
4
  import * as GetElectronFileResponseRelativePath from '../GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js';
6
- import * as GetEtag from '../GetEtag/GetEtag.js';
7
5
  import * as GetHeaders from '../GetHeaders/GetHeaders.js';
8
6
  import * as GetNotFoundResponse from '../GetNotFoundResponse/GetNotFoundResponse.js';
9
7
  import * as GetNotModifiedResponse from '../GetNotModifiedResponse/GetNotModifiedResponse.js';
8
+ import * as GetPathEtag from '../GetPathEtag/GetPathEtag.js';
10
9
  import * as GetServerErrorResponse from '../GetServerErrorResponse/GetServerErrorResponse.js';
11
10
  import * as HttpHeader from '../HttpHeader/HttpHeader.js';
12
11
  import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js';
@@ -20,12 +19,7 @@ export const getElectronFileResponse = async (url, request) => {
20
19
  let etag;
21
20
  // TODO when is there no request?
22
21
  if (request) {
23
- let stats = await stat(absolutePath);
24
- if (stats.isDirectory()) {
25
- absolutePath += '/index.html';
26
- stats = await stat(absolutePath);
27
- }
28
- etag = GetEtag.getEtag(stats);
22
+ etag = await GetPathEtag.getPathEtag(absolutePath);
29
23
  if (request.headers[HttpHeader.IfNotMatch] === etag) {
30
24
  const headers = GetHeaders.getHeaders(absolutePath, pathName);
31
25
  return GetNotModifiedResponse.getNotModifiedResponse(headers);
@@ -0,0 +1,11 @@
1
+ import { stat } from 'node:fs/promises';
2
+ import * as GetEtag from '../GetEtag/GetEtag.js';
3
+ export const getPathEtag = async (absolutePath) => {
4
+ let stats = await stat(absolutePath);
5
+ if (stats.isDirectory()) {
6
+ absolutePath += '/index.html';
7
+ stats = await stat(absolutePath);
8
+ }
9
+ const etag = GetEtag.getEtag(stats);
10
+ return etag;
11
+ };
@@ -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.9';
45
- export const commit = 'f3cf31a';
46
- export const date = '2024-11-24T22:17:04.000Z';
44
+ export const version = '0.40.0';
45
+ export const commit = 'c76328b';
46
+ export const date = '2024-12-07T19:48:48.000Z';
47
47
  export const getVersion = () => {
48
48
  return version;
49
49
  };