@lvce-editor/shared-process 0.21.7 → 0.21.8
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 +6 -6
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +1 -1
- package/src/parts/GetMimeType/GetMimeType.js +1 -0
- package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +11 -3
- package/src/parts/MimeType/MimeType.js +1 -1
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/TranspileTypeScript/TranspileTypeScript.js +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.8",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/code-frame": "^7.23.5",
|
|
21
21
|
"@lvce-editor/assert": "^1.0.1",
|
|
22
|
-
"@lvce-editor/extension-host": "0.21.
|
|
23
|
-
"@lvce-editor/extension-host-helper-process": "0.21.
|
|
22
|
+
"@lvce-editor/extension-host": "0.21.8",
|
|
23
|
+
"@lvce-editor/extension-host-helper-process": "0.21.8",
|
|
24
24
|
"@lvce-editor/json-rpc": "^0.4.0",
|
|
25
25
|
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
26
26
|
"@lvce-editor/pretty-error": "^1.3.0",
|
|
27
|
-
"@lvce-editor/pty-host": "0.21.
|
|
27
|
+
"@lvce-editor/pty-host": "0.21.8",
|
|
28
28
|
"@lvce-editor/verror": "^1.1.2",
|
|
29
29
|
"debug": "^4.3.4",
|
|
30
30
|
"execa": "^8.0.1",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"p-queue": "^8.0.1",
|
|
36
36
|
"parse-json": "^8.1.0",
|
|
37
37
|
"tar-fs": "^3.0.4",
|
|
38
|
-
"ws": "^8.
|
|
38
|
+
"ws": "^8.16.0",
|
|
39
39
|
"xdg-basedir": "^5.1.0"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
42
|
"@lvce-editor/ripgrep": "^1.0.1",
|
|
43
43
|
"extract-zip": "^2.0.1",
|
|
44
44
|
"open": "^10.0.1",
|
|
45
|
-
"symlink-dir": "^5.2.
|
|
45
|
+
"symlink-dir": "^5.2.1",
|
|
46
46
|
"tail": "^2.2.6",
|
|
47
47
|
"tmp-promise": "^3.0.3",
|
|
48
48
|
"trash": "^8.1.1"
|
|
@@ -17,7 +17,7 @@ export const getElectronFileResponseContent = async (absolutePath, url) => {
|
|
|
17
17
|
let content = await readFile(absolutePath)
|
|
18
18
|
if (IsTypeScriptPath.isTypeScriptPath(url)) {
|
|
19
19
|
const preferences = await getPreferences()
|
|
20
|
-
if (preferences['typescript.transpile']) {
|
|
20
|
+
if (preferences['typescript.transpile'] || process.env['TRANSPILE_TYPESCRIPT']) {
|
|
21
21
|
const newContent = await TranspileTypeScript.transpileTypeScript(content.toString())
|
|
22
22
|
content = newContent.outputText
|
|
23
23
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { join } from 'path'
|
|
2
|
-
import * as
|
|
1
|
+
import { join } from 'node:path'
|
|
2
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
3
3
|
|
|
4
4
|
export const getTypeScriptPath = () => {
|
|
5
|
-
return join(
|
|
5
|
+
return join(
|
|
6
|
+
PlatformPaths.getBuiltinExtensionsPath(),
|
|
7
|
+
'builtin.language-features-typescript',
|
|
8
|
+
'node',
|
|
9
|
+
'node_modules',
|
|
10
|
+
'typescript',
|
|
11
|
+
'lib',
|
|
12
|
+
'typescript.js',
|
|
13
|
+
)
|
|
6
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const ApplicationFontWoff = 'application/font-woff'
|
|
2
|
-
export const ApplicationJson = '
|
|
2
|
+
export const ApplicationJson = 'application/json'
|
|
3
3
|
export const AudioMidi = 'audio/midi'
|
|
4
4
|
export const AudioMpeg = 'audio/mpeg'
|
|
5
5
|
export const AudioOgg = 'audio/ogg'
|
|
@@ -61,11 +61,11 @@ export const getSetupName = () => {
|
|
|
61
61
|
return 'Lvce-Setup'
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export const version = '0.21.
|
|
64
|
+
export const version = '0.21.8'
|
|
65
65
|
|
|
66
|
-
export const commit = '
|
|
66
|
+
export const commit = 'b6072b1'
|
|
67
67
|
|
|
68
|
-
export const date = '2023-12-
|
|
68
|
+
export const date = '2023-12-27T09:35:13.000Z'
|
|
69
69
|
|
|
70
70
|
export const getVersion = () => {
|
|
71
71
|
return version
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { VError } from '@lvce-editor/verror'
|
|
2
|
-
import * as GetTypeScriptPath from '../GetTypeScriptPath/GetTypeScriptPath.js'
|
|
3
2
|
import * as Assert from '../Assert/Assert.js'
|
|
3
|
+
import * as GetTypeScriptPath from '../GetTypeScriptPath/GetTypeScriptPath.js'
|
|
4
4
|
import * as LoadTypeScript from '../LoadTypeScript/LoadTypeScript.js'
|
|
5
5
|
|
|
6
6
|
export const transpileTypeScript = async (code) => {
|
|
7
7
|
try {
|
|
8
8
|
Assert.string(code)
|
|
9
9
|
const typescriptPath = GetTypeScriptPath.getTypeScriptPath()
|
|
10
|
-
console.log({ typescriptPath })
|
|
11
10
|
const typescript = await LoadTypeScript.loadTypeScript(typescriptPath)
|
|
12
|
-
console.log({ k: Object.keys(typescript) })
|
|
13
11
|
const newContent = await typescript.transpileModule(code, {
|
|
14
12
|
compilerOptions: {
|
|
15
13
|
target: 'esnext',
|
|
16
14
|
},
|
|
17
15
|
})
|
|
18
|
-
console.log({ newContent })
|
|
19
16
|
return newContent
|
|
20
17
|
} catch (error) {
|
|
21
|
-
console.log({ error })
|
|
22
18
|
throw new VError(error, `Failed to transpile typescript`)
|
|
23
19
|
}
|
|
24
20
|
}
|