@lvce-editor/shared-process 0.119.23 → 0.119.24

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.119.23",
3
+ "version": "0.119.24",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -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', '4920c41', 'extensions')
6
+ const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '9736253', 'extensions')
7
7
  return builtinExtensionsPath
8
8
  }
@@ -13,6 +13,7 @@ const backslashRegex = /\\/g
13
13
  const importFromTsRegex = /(from\s+['"][^'"]+)\.ts(['"])/g
14
14
  const sideEffectImportTsRegex = /(import\s+['"][^'"]+)\.ts(['"])/g
15
15
  const dynamicImportTsRegex = /(import\(\s*['"][^'"]+)\.ts(['"]\s*\))/g
16
+ const runtimeConfigScriptRegex = /<script id="Config" type="application\/json">([\s\S]*?)<\/script>/
16
17
 
17
18
  const staticContentSecurityPolicy = GetContentSecurityPolicy.getContentSecurityPolicy([
18
19
  `default-src 'none'`,
@@ -143,31 +144,22 @@ export const validateRendererProcessArtifacts = ({ commitHash, root } ) => {
143
144
  }
144
145
  }
145
146
 
146
- const applyOverridesRendererProcess = async ({ commitHash, pathPrefix, root } ) => {
147
- await replace(
148
- Path.join(root, 'dist', commitHash, 'packages', 'renderer-process', 'dist', 'rendererProcessMain.js'),
149
- 'platform = Remote;',
150
- 'platform = Web',
151
- )
152
- await replace(
153
- Path.join(root, 'dist', commitHash, 'packages', 'renderer-process', 'dist', 'rendererProcessMain.js'),
154
- `/${commitHash}`,
155
- `${pathPrefix}/${commitHash}`,
156
- )
147
+ const applyRuntimeConfigOverrides = async ({ root } ) => {
148
+ const indexHtmlPath = Path.join(root, 'dist', 'index.html')
149
+ const content = await readFile(indexHtmlPath, 'utf8')
150
+ const configElement = content.match(runtimeConfigScriptRegex)
151
+ if (!configElement) {
152
+ throw new Error(`runtime config not found in ${indexHtmlPath}`)
153
+ }
154
+ const config = JSON.parse(configElement[1])
155
+ config.platform = 'web'
156
+ const serializedConfig = JSON.stringify(config).replaceAll('<', '\\u003c').replaceAll('>', '\\u003e').replaceAll('&', '\\u0026')
157
+ const newContent = content.replace(configElement[0], `<script id="Config" type="application/json">${serializedConfig}</script>`)
158
+ await writeFile(indexHtmlPath, newContent)
157
159
  }
158
160
 
159
161
  const applyOverrides = async ({ commitHash, pathPrefix, root, serverStaticPath } ) => {
160
- await applyOverridesRendererProcess({ commitHash, pathPrefix, root })
161
- await replace(
162
- Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
163
- 'platform = Remote;',
164
- 'platform = Web$1;',
165
- )
166
- await replace(
167
- Path.join(root, 'dist', commitHash, 'packages', 'renderer-worker', 'dist', 'rendererWorkerMain.js'),
168
- `/${commitHash}`,
169
- `${pathPrefix}/${commitHash}`,
170
- )
162
+ await applyRuntimeConfigOverrides({ root })
171
163
  const extensionDirents = await FileSystem.readDir(Path.join(serverStaticPath, commitHash, 'extensions'))
172
164
 
173
165
  const languageBasicsDirents = extensionDirents.filter(isLanguageBasics)
@@ -56,11 +56,11 @@ export const getSetupName = () => {
56
56
  return 'Lvce-Setup'
57
57
  }
58
58
 
59
- export const version = '0.119.23'
59
+ export const version = '0.119.24'
60
60
 
61
- export const commit = '4920c41'
61
+ export const commit = '9736253'
62
62
 
63
- export const date = '2026-10-03T19:32:02.000Z'
63
+ export const date = '2026-10-03T22:06:27.000Z'
64
64
 
65
65
  export const getVersion = () => {
66
66
  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', '4920c41', 'packages', 'preload', 'dist', 'index.js')
5
+ return join(Root.root, 'static', '9736253', 'packages', 'preload', 'dist', 'index.js')
6
6
  }