@lvce-editor/shared-process 0.95.16 → 0.95.17

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.95.16",
3
+ "version": "0.95.17",
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.7.0",
21
- "@lvce-editor/extension-host-helper-process": "0.95.16",
21
+ "@lvce-editor/extension-host-helper-process": "0.95.17",
22
22
  "@lvce-editor/ipc": "16.6.0",
23
23
  "@lvce-editor/json-rpc": "8.5.0",
24
24
  "@lvce-editor/jsonc-parser": "1.5.0",
@@ -1,3 +1,10 @@
1
- export const addCustomPathsToIndexHtml = async (content) => {
1
+ export const addCustomPathsToIndexHtml = async (content, additionalConfig = {}) => {
2
+ if (Object.keys(additionalConfig).length === 0) {
2
3
  return content
4
+ }
5
+ const stringifiedConfig = JSON.stringify(additionalConfig, null, 2)
6
+ return content.toString().replace(
7
+ '</title>',
8
+ '</title>\n <script type="application/json" id="Config">' + stringifiedConfig + '</script>',
9
+ )
3
10
  }
@@ -3,6 +3,6 @@ import { fileURLToPath } from 'url'
3
3
 
4
4
  export const getBuiltinExtensionsPath = () => {
5
5
  const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'))
6
- const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'd38b27d', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', 'cb8ea1c', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -13,13 +13,19 @@ import * as GetTestPath from '../GetTestPath/GetTestPath.js'
13
13
  import * as HttpHeader from '../HttpHeader/HttpHeader.js'
14
14
  import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.js'
15
15
  import * as Logger from '../Logger/Logger.js'
16
+ import * as WebSocketIssuerRegistry from '../WebSocketIssuerRegistry/WebSocketIssuerRegistry.js'
17
+
18
+ const getTestPageContent = async (indexHtmlPath) => {
19
+ const body = await readFile(indexHtmlPath, 'utf8')
20
+ const webSocketIssuer = WebSocketIssuerRegistry.create()
21
+ return AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(body, { webSocketIssuer })
22
+ }
16
23
 
17
24
  export const getTestRequestResponse = async (request, indexHtmlPath) => {
18
25
  try {
19
26
  const pathName = GetPathName.getPathName(request)
20
27
  if (pathName === '/tests/_all.html') {
21
- const body = await readFile(indexHtmlPath, 'utf8')
22
- const content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(body)
28
+ const content = await getTestPageContent(indexHtmlPath)
23
29
  const headers = {
24
30
  [HttpHeader.ContentSecurityPolicy]: ContentSecurityPolicyDocument.value,
25
31
  [HttpHeader.ContentType]: 'text/html',
@@ -30,8 +36,7 @@ export const getTestRequestResponse = async (request, indexHtmlPath) => {
30
36
  return GetContentResponse.getContentResponse(content, headers)
31
37
  }
32
38
  if (pathName.endsWith('.html')) {
33
- const body = await readFile(indexHtmlPath, 'utf8')
34
- const content = await AddCustomPathsToIndexHtml.addCustomPathsToIndexHtml(body)
39
+ const content = await getTestPageContent(indexHtmlPath)
35
40
  const headers = {
36
41
  [HttpHeader.ContentSecurityPolicy]: ContentSecurityPolicyDocument.value,
37
42
  [HttpHeader.ContentType]: 'text/html',
@@ -61,11 +61,11 @@ export const getSetupName = () => {
61
61
  return 'Lvce-Setup'
62
62
  }
63
63
 
64
- export const version = '0.95.16'
64
+ export const version = '0.95.17'
65
65
 
66
- export const commit = 'd38b27d'
66
+ export const commit = 'cb8ea1c'
67
67
 
68
- export const date = '2026-08-01T18:24:49.000Z'
68
+ export const date = '2026-08-01T21:38:42.000Z'
69
69
 
70
70
  export const getVersion = () => {
71
71
  return version
@@ -2,5 +2,5 @@ import { join } from 'node:path'
2
2
  import * as Root from '../Root/Root.js'
3
3
 
4
4
  export const getPreloadUrl = () => {
5
- return join(Root.root, 'static', 'd38b27d', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', 'cb8ea1c', 'packages', 'preload', 'dist', 'index.js')
6
6
  }