@lvce-editor/shared-process 0.17.7 → 0.17.9
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.17.
|
|
3
|
+
"version": "0.17.9",
|
|
4
4
|
"description": "Utility package for @lvce-editor/server",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/code-frame": "^7.22.10",
|
|
20
|
-
"@lvce-editor/extension-host": "0.17.
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.17.
|
|
20
|
+
"@lvce-editor/extension-host": "0.17.9",
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.17.9",
|
|
22
22
|
"@lvce-editor/pretty-error": "^1.1.0",
|
|
23
|
-
"@lvce-editor/pty-host": "0.17.
|
|
23
|
+
"@lvce-editor/pty-host": "0.17.9",
|
|
24
|
+
"@lvce-editor/verror": "^1.0.1",
|
|
24
25
|
"debug": "^4.3.4",
|
|
25
|
-
"execa": "^8.0.
|
|
26
|
+
"execa": "^8.0.1",
|
|
26
27
|
"exit-hook": "^3.2.0",
|
|
27
28
|
"got": "^13.0.0",
|
|
28
29
|
"is-object": "^1.0.2",
|
|
@@ -175,11 +175,11 @@ export const getSetupName = () => {
|
|
|
175
175
|
return 'Lvce-Setup'
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
export const version = '0.17.
|
|
178
|
+
export const version = '0.17.9'
|
|
179
179
|
|
|
180
|
-
export const commit = '
|
|
180
|
+
export const commit = 'be6f30d'
|
|
181
181
|
|
|
182
|
-
export const date = '2023-08-
|
|
182
|
+
export const date = '2023-08-21T20:43:03.000Z'
|
|
183
183
|
|
|
184
184
|
export const getVersion = () => {
|
|
185
185
|
return version
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as NormalizeErrorLine from '../NormalizeErrorLine/NormalizeErrorLine.js'
|
|
3
|
-
|
|
4
|
-
const getCombinedMessage = (error, message) => {
|
|
5
|
-
const stringifiedError = NormalizeErrorLine.normalizeLine(`${error}`)
|
|
6
|
-
if (message) {
|
|
7
|
-
return `${message}: ${stringifiedError}`
|
|
8
|
-
}
|
|
9
|
-
return stringifiedError
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export class VError extends Error {
|
|
13
|
-
constructor(error, message) {
|
|
14
|
-
const combinedMessage = getCombinedMessage(error, message)
|
|
15
|
-
super(combinedMessage)
|
|
16
|
-
this.name = 'VError'
|
|
17
|
-
if (error instanceof Error) {
|
|
18
|
-
this.stack = MergeStacks.mergeStacks(this.stack, error.stack)
|
|
19
|
-
}
|
|
20
|
-
if (error.codeFrame) {
|
|
21
|
-
this.codeFrame = error.codeFrame
|
|
22
|
-
}
|
|
23
|
-
if (error.code) {
|
|
24
|
-
this.code = error.code
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
export * from '@lvce-editor/verror'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as GetNewLineIndex from '../GetNewLineIndex/GetNewLineIndex.js'
|
|
2
|
-
import * as NormalizeErrorLine from '../NormalizeErrorLine/NormalizeErrorLine.js'
|
|
3
|
-
|
|
4
|
-
export const mergeStacks = (parent, child) => {
|
|
5
|
-
if (!child) {
|
|
6
|
-
return parent
|
|
7
|
-
}
|
|
8
|
-
const parentNewLineIndex = GetNewLineIndex.getNewLineIndex(parent)
|
|
9
|
-
const childNewLineIndex = GetNewLineIndex.getNewLineIndex(child)
|
|
10
|
-
if (childNewLineIndex === -1) {
|
|
11
|
-
return parent
|
|
12
|
-
}
|
|
13
|
-
const parentFirstLine = parent.slice(0, parentNewLineIndex)
|
|
14
|
-
const childRest = child.slice(childNewLineIndex)
|
|
15
|
-
const childFirstLine = NormalizeErrorLine.normalizeLine(child.slice(0, childNewLineIndex))
|
|
16
|
-
if (parentFirstLine.includes(childFirstLine)) {
|
|
17
|
-
return parentFirstLine + childRest
|
|
18
|
-
}
|
|
19
|
-
return child
|
|
20
|
-
}
|