@lvce-editor/shared-process 0.17.12 → 0.17.14
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 +11 -10
- package/src/parts/ExportStatic/ExportStatic.js +6 -0
- package/src/parts/IpcChild/IpcChild.js +5 -0
- package/src/parts/IpcChildWithElectronUtilityProcess/IpcChildWithElectronUtilityProcess.js +4 -1
- package/src/parts/IpcChildWithNodeForkedProcess/IpcChildWithNodeForkedProcess.js +4 -1
- package/src/parts/IpcChildWithNodeWorker/IpcChildWithNodeWorker.js +4 -1
- package/src/parts/Jsonc/Jsonc.js +1 -304
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/JsoncCharCode/JsoncCharCode.js +0 -23
- package/src/parts/JsoncTokenType/JsoncTokenType.js +0 -11
package/package.json
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.14",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@babel/code-frame": "^7.22.13",
|
|
8
|
-
"@lvce-editor/extension-host": "0.17.
|
|
9
|
-
"@lvce-editor/extension-host-helper-process": "0.17.
|
|
8
|
+
"@lvce-editor/extension-host": "0.17.14",
|
|
9
|
+
"@lvce-editor/extension-host-helper-process": "0.17.14",
|
|
10
|
+
"@lvce-editor/jsonc-parser": "^1.1.0",
|
|
10
11
|
"@lvce-editor/pretty-error": "^1.1.1",
|
|
11
|
-
"@lvce-editor/pty-host": "0.17.
|
|
12
|
-
"@lvce-editor/verror": "^1.1.
|
|
12
|
+
"@lvce-editor/pty-host": "0.17.14",
|
|
13
|
+
"@lvce-editor/verror": "^1.1.1",
|
|
13
14
|
"debug": "^4.3.4",
|
|
14
15
|
"execa": "^8.0.1",
|
|
15
|
-
"exit-hook": "^
|
|
16
|
+
"exit-hook": "^4.0.0",
|
|
16
17
|
"got": "^13.0.0",
|
|
17
18
|
"is-object": "^1.0.2",
|
|
18
19
|
"lines-and-columns": "^2.0.3",
|
|
19
|
-
"p-queue": "^7.4.
|
|
20
|
-
"parse-json": "^7.
|
|
20
|
+
"p-queue": "^7.4.1",
|
|
21
|
+
"parse-json": "^7.1.0",
|
|
21
22
|
"tar-fs": "^3.0.4",
|
|
22
|
-
"ws": "^8.
|
|
23
|
+
"ws": "^8.14.1",
|
|
23
24
|
"xdg-basedir": "^5.1.0"
|
|
24
25
|
},
|
|
25
26
|
"optionalDependencies": {
|
|
26
27
|
"extract-zip": "^2.0.1",
|
|
27
28
|
"open": "^9.1.0",
|
|
28
|
-
"symlink-dir": "^5.
|
|
29
|
+
"symlink-dir": "^5.2.0",
|
|
29
30
|
"tail": "^2.2.6",
|
|
30
31
|
"tmp-promise": "^3.0.3",
|
|
31
32
|
"trash": "^8.1.1",
|
|
@@ -139,6 +139,11 @@ const applyOverrides = async ({ root, commitHash, pathPrefix }) => {
|
|
|
139
139
|
`return \`\${extensionPath}\${value}\``,
|
|
140
140
|
`return \`${pathPrefix}/${commitHash}/file-icons/\${value.slice(7)}\``
|
|
141
141
|
)
|
|
142
|
+
await replace(
|
|
143
|
+
Path.join(root, 'dist', commitHash, 'packages', 'extension-host-worker', 'dist', 'extensionHostWorkerMain.js'),
|
|
144
|
+
`/${commitHash}/packages/extension-host-sub-worker`,
|
|
145
|
+
`/${pathPrefix}/${commitHash}/packages/extension-host-sub-worker`
|
|
146
|
+
)
|
|
142
147
|
|
|
143
148
|
// workaround for firefox bug
|
|
144
149
|
await replace(
|
|
@@ -227,6 +232,7 @@ const applyOverrides = async ({ root, commitHash, pathPrefix }) => {
|
|
|
227
232
|
await replace(Path.join(root, 'dist', 'manifest.json'), `/${commitHash}`, `${pathPrefix}/${commitHash}`)
|
|
228
233
|
await replace(Path.join(root, 'dist', 'manifest.json'), `"start_url": "/"`, `"start_url": "${pathPrefix}"`)
|
|
229
234
|
await replace(Path.join(root, 'dist', commitHash, 'css', 'App.css'), `/${commitHash}`, `${pathPrefix}/${commitHash}`)
|
|
235
|
+
await replace(Path.join(root, 'dist', commitHash, 'css', 'parts', 'Symbol.css'), `/${commitHash}`, `${pathPrefix}/${commitHash}`)
|
|
230
236
|
}
|
|
231
237
|
}
|
|
232
238
|
|
|
@@ -4,6 +4,11 @@ export const listen = async ({ method, ...params }) => {
|
|
|
4
4
|
const module = await IpcChildModule.getModule(method)
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
const rawIpc = await module.listen(params)
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
if (module.signal) {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
module.signal(rawIpc)
|
|
11
|
+
}
|
|
7
12
|
const ipc = module.wrap(rawIpc)
|
|
8
13
|
return ipc
|
|
9
14
|
}
|
|
@@ -6,10 +6,13 @@ export const listen = () => {
|
|
|
6
6
|
if (!parentPort) {
|
|
7
7
|
throw new Error('parent port must be defined')
|
|
8
8
|
}
|
|
9
|
-
parentPort.postMessage('ready')
|
|
10
9
|
return parentPort
|
|
11
10
|
}
|
|
12
11
|
|
|
12
|
+
export const signal = (parentPort) => {
|
|
13
|
+
parentPort.postMessage('ready')
|
|
14
|
+
}
|
|
15
|
+
|
|
13
16
|
const getActualData = (event) => {
|
|
14
17
|
const { data, ports } = event
|
|
15
18
|
if (ports.length === 0) {
|
|
@@ -2,10 +2,13 @@ export const listen = async () => {
|
|
|
2
2
|
if (!process.send) {
|
|
3
3
|
throw new Error('process.send must be defined')
|
|
4
4
|
}
|
|
5
|
-
process.send('ready')
|
|
6
5
|
return process
|
|
7
6
|
}
|
|
8
7
|
|
|
8
|
+
export const signal = (process) => {
|
|
9
|
+
process.send('ready')
|
|
10
|
+
}
|
|
11
|
+
|
|
9
12
|
const getActualData = (message, handle) => {
|
|
10
13
|
if (handle) {
|
|
11
14
|
return {
|
|
@@ -5,10 +5,13 @@ export const listen = async () => {
|
|
|
5
5
|
if (!parentPort) {
|
|
6
6
|
throw new Error('parentPort is required')
|
|
7
7
|
}
|
|
8
|
-
parentPort.postMessage('ready')
|
|
9
8
|
return parentPort
|
|
10
9
|
}
|
|
11
10
|
|
|
11
|
+
export const signal = (parentPort) => {
|
|
12
|
+
parentPort.postMessage('ready')
|
|
13
|
+
}
|
|
14
|
+
|
|
12
15
|
const getActualData = (message) => {
|
|
13
16
|
return message
|
|
14
17
|
}
|
package/src/parts/Jsonc/Jsonc.js
CHANGED
|
@@ -1,304 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as TokenType from '../JsoncTokenType/JsoncTokenType.js'
|
|
3
|
-
|
|
4
|
-
const createScanner = (text) => {
|
|
5
|
-
let offset = 0
|
|
6
|
-
const length = text.length
|
|
7
|
-
|
|
8
|
-
const scanValue = () => {
|
|
9
|
-
while (offset < length) {
|
|
10
|
-
const code = text.charCodeAt(offset)
|
|
11
|
-
switch (code) {
|
|
12
|
-
case CharCode.CurlyOpen:
|
|
13
|
-
offset++
|
|
14
|
-
return TokenType.CurlyOpen
|
|
15
|
-
case CharCode.CurlyClose:
|
|
16
|
-
offset++
|
|
17
|
-
return TokenType.CurlyClose
|
|
18
|
-
case CharCode.SquareOpen:
|
|
19
|
-
offset++
|
|
20
|
-
return TokenType.SquareOpen
|
|
21
|
-
case CharCode.SquareClose:
|
|
22
|
-
offset++
|
|
23
|
-
return TokenType.SquareClose
|
|
24
|
-
case CharCode.DoubleQuote:
|
|
25
|
-
offset++
|
|
26
|
-
return TokenType.DoubleQuote
|
|
27
|
-
case CharCode.Comma:
|
|
28
|
-
text.slice(offset) //?
|
|
29
|
-
offset++
|
|
30
|
-
return TokenType.Comma
|
|
31
|
-
case CharCode.Zero:
|
|
32
|
-
case CharCode.One:
|
|
33
|
-
case CharCode.Two:
|
|
34
|
-
case CharCode.Three:
|
|
35
|
-
case CharCode.Four:
|
|
36
|
-
case CharCode.Five:
|
|
37
|
-
case CharCode.Six:
|
|
38
|
-
case CharCode.Seven:
|
|
39
|
-
case CharCode.Eight:
|
|
40
|
-
case CharCode.Nine:
|
|
41
|
-
case CharCode.Dot:
|
|
42
|
-
offset++
|
|
43
|
-
return TokenType.Numeric
|
|
44
|
-
case CharCode.CarriageReturn:
|
|
45
|
-
case CharCode.LineFeed:
|
|
46
|
-
case CharCode.Tab:
|
|
47
|
-
case CharCode.Space:
|
|
48
|
-
offset++
|
|
49
|
-
break
|
|
50
|
-
case CharCode.Slash:
|
|
51
|
-
return TokenType.Slash
|
|
52
|
-
default:
|
|
53
|
-
return TokenType.Literal
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return TokenType.Eof
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const scanString = () => {
|
|
60
|
-
while (offset < length) {
|
|
61
|
-
const code = text.charCodeAt(offset)
|
|
62
|
-
if (code === CharCode.DoubleQuote) {
|
|
63
|
-
break
|
|
64
|
-
}
|
|
65
|
-
offset++
|
|
66
|
-
}
|
|
67
|
-
offset++
|
|
68
|
-
const start = offset
|
|
69
|
-
while (offset < length) {
|
|
70
|
-
const code = text.charCodeAt(offset)
|
|
71
|
-
if (code === CharCode.DoubleQuote) {
|
|
72
|
-
break
|
|
73
|
-
}
|
|
74
|
-
offset++
|
|
75
|
-
}
|
|
76
|
-
const result = text.slice(start, offset)
|
|
77
|
-
offset++
|
|
78
|
-
return result
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const scanPropertyName = () => {
|
|
82
|
-
return scanString()
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const scanPropertyColon = () => {
|
|
86
|
-
const code = text.charCodeAt(offset)
|
|
87
|
-
offset++
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const goBack = (delta) => {
|
|
91
|
-
offset -= delta
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const scanNumber = () => {
|
|
95
|
-
const start = offset
|
|
96
|
-
outer: while (offset < length) {
|
|
97
|
-
const code = text.charCodeAt(offset)
|
|
98
|
-
switch (code) {
|
|
99
|
-
case CharCode.Zero:
|
|
100
|
-
case CharCode.One:
|
|
101
|
-
case CharCode.Two:
|
|
102
|
-
case CharCode.Three:
|
|
103
|
-
case CharCode.Four:
|
|
104
|
-
case CharCode.Five:
|
|
105
|
-
case CharCode.Six:
|
|
106
|
-
case CharCode.Seven:
|
|
107
|
-
case CharCode.Eight:
|
|
108
|
-
case CharCode.Nine:
|
|
109
|
-
case CharCode.Dot:
|
|
110
|
-
break
|
|
111
|
-
default:
|
|
112
|
-
break outer
|
|
113
|
-
}
|
|
114
|
-
offset++
|
|
115
|
-
}
|
|
116
|
-
const result = text.slice(start, offset)
|
|
117
|
-
result
|
|
118
|
-
return result
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const scanLiteral = () => {
|
|
122
|
-
const start = offset
|
|
123
|
-
outer: while (offset < length) {
|
|
124
|
-
const code = text.charCodeAt(offset)
|
|
125
|
-
switch (code) {
|
|
126
|
-
case CharCode.LineFeed:
|
|
127
|
-
case CharCode.CarriageReturn:
|
|
128
|
-
case CharCode.Tab:
|
|
129
|
-
case CharCode.Space:
|
|
130
|
-
case CharCode.Comma:
|
|
131
|
-
break outer
|
|
132
|
-
default:
|
|
133
|
-
break
|
|
134
|
-
}
|
|
135
|
-
offset++
|
|
136
|
-
}
|
|
137
|
-
const result = text.slice(start, offset)
|
|
138
|
-
return result
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const scanBlockComment = () => {
|
|
142
|
-
while (offset < length) {
|
|
143
|
-
if (text.charCodeAt(offset) === CharCode.Star && text.charCodeAt(offset + 1) === CharCode.Slash) {
|
|
144
|
-
break
|
|
145
|
-
}
|
|
146
|
-
offset++
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const scanLineComment = () => {
|
|
151
|
-
while (offset < length) {
|
|
152
|
-
const code = text.charCodeAt(offset)
|
|
153
|
-
if (code === CharCode.LineFeed) {
|
|
154
|
-
break
|
|
155
|
-
}
|
|
156
|
-
offset++
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const scanComment = () => {
|
|
161
|
-
const code = text.charCodeAt(offset)
|
|
162
|
-
switch (code) {
|
|
163
|
-
case CharCode.Star:
|
|
164
|
-
return scanBlockComment()
|
|
165
|
-
case CharCode.Slash:
|
|
166
|
-
return scanLineComment()
|
|
167
|
-
default:
|
|
168
|
-
break
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return {
|
|
173
|
-
scanValue,
|
|
174
|
-
scanPropertyName,
|
|
175
|
-
scanPropertyColon,
|
|
176
|
-
scanString,
|
|
177
|
-
scanNumber,
|
|
178
|
-
goBack,
|
|
179
|
-
scanLiteral,
|
|
180
|
-
scanComment,
|
|
181
|
-
getOffset() {
|
|
182
|
-
return offset
|
|
183
|
-
},
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const parsePropertyName = (scanner) => {
|
|
188
|
-
const propertyName = scanner.scanPropertyName()
|
|
189
|
-
return propertyName
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const parsePropertyColon = (scanner) => {
|
|
193
|
-
scanner.scanPropertyColon()
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const parseNumber = (scanner) => {
|
|
197
|
-
scanner.goBack(1)
|
|
198
|
-
const rawValue = scanner.scanNumber()
|
|
199
|
-
const value = parseFloat(rawValue)
|
|
200
|
-
return value
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const parseObject = (scanner) => {
|
|
204
|
-
const object = {}
|
|
205
|
-
outer: while (true) {
|
|
206
|
-
const token = scanner.scanValue()
|
|
207
|
-
switch (token) {
|
|
208
|
-
case TokenType.Eof:
|
|
209
|
-
case TokenType.None:
|
|
210
|
-
case TokenType.CurlyClose:
|
|
211
|
-
break outer
|
|
212
|
-
case TokenType.DoubleQuote:
|
|
213
|
-
scanner.goBack(1)
|
|
214
|
-
const propertyName = parsePropertyName(scanner)
|
|
215
|
-
parsePropertyColon(scanner)
|
|
216
|
-
const value = parseValue(scanner)
|
|
217
|
-
object[propertyName] = value
|
|
218
|
-
case TokenType.Comma:
|
|
219
|
-
break
|
|
220
|
-
case TokenType.Slash:
|
|
221
|
-
parseComment(scanner)
|
|
222
|
-
break
|
|
223
|
-
default:
|
|
224
|
-
break
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return object
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const parseString = (scanner) => {
|
|
231
|
-
scanner.goBack(1)
|
|
232
|
-
const value = scanner.scanString()
|
|
233
|
-
return value
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const parseArray = (scanner) => {
|
|
237
|
-
const array = []
|
|
238
|
-
outer: while (true) {
|
|
239
|
-
const token = scanner.scanValue()
|
|
240
|
-
switch (token) {
|
|
241
|
-
case TokenType.Eof:
|
|
242
|
-
case TokenType.None:
|
|
243
|
-
case TokenType.SquareClose:
|
|
244
|
-
break outer
|
|
245
|
-
case TokenType.Slash:
|
|
246
|
-
scanner.scanComment()
|
|
247
|
-
break
|
|
248
|
-
default:
|
|
249
|
-
scanner.goBack(1)
|
|
250
|
-
const value = parseValue(scanner)
|
|
251
|
-
array.push(value)
|
|
252
|
-
break
|
|
253
|
-
case TokenType.Comma:
|
|
254
|
-
break
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return array
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
const parseLiteral = (scanner) => {
|
|
261
|
-
const rawValue = scanner.scanLiteral()
|
|
262
|
-
switch (rawValue) {
|
|
263
|
-
case 'true':
|
|
264
|
-
return true
|
|
265
|
-
case 'false':
|
|
266
|
-
return false
|
|
267
|
-
case 'null':
|
|
268
|
-
return null
|
|
269
|
-
default:
|
|
270
|
-
return undefined
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
const parseComment = (scanner) => {
|
|
275
|
-
scanner.scanComment()
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const parseValue = (scanner) => {
|
|
279
|
-
const token = scanner.scanValue()
|
|
280
|
-
switch (token) {
|
|
281
|
-
case TokenType.CurlyOpen:
|
|
282
|
-
return parseObject(scanner)
|
|
283
|
-
case TokenType.DoubleQuote:
|
|
284
|
-
return parseString(scanner)
|
|
285
|
-
case TokenType.Numeric:
|
|
286
|
-
return parseNumber(scanner)
|
|
287
|
-
case TokenType.SquareOpen:
|
|
288
|
-
return parseArray(scanner)
|
|
289
|
-
case TokenType.Literal:
|
|
290
|
-
return parseLiteral(scanner)
|
|
291
|
-
case TokenType.Slash:
|
|
292
|
-
parseComment(scanner)
|
|
293
|
-
return parseValue(scanner)
|
|
294
|
-
default:
|
|
295
|
-
token
|
|
296
|
-
return undefined
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export const parse = (text) => {
|
|
301
|
-
const scanner = createScanner(text)
|
|
302
|
-
const result = parseValue(scanner)
|
|
303
|
-
return result
|
|
304
|
-
}
|
|
1
|
+
export * from '@lvce-editor/jsonc-parser'
|
|
@@ -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.14'
|
|
179
179
|
|
|
180
|
-
export const commit = '
|
|
180
|
+
export const commit = '57b9931'
|
|
181
181
|
|
|
182
|
-
export const date = '2023-
|
|
182
|
+
export const date = '2023-09-16T12:47:05.000Z'
|
|
183
183
|
|
|
184
184
|
export const getVersion = () => {
|
|
185
185
|
return version
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const CurlyOpen = '{'.charCodeAt(0)
|
|
2
|
-
export const CurlyClose = '}'.charCodeAt(0)
|
|
3
|
-
export const SquareOpen = '['.charCodeAt(0)
|
|
4
|
-
export const SquareClose = ']'.charCodeAt(0)
|
|
5
|
-
export const DoubleQuote = '"'.charCodeAt(0)
|
|
6
|
-
export const Comma = ','.charCodeAt(0)
|
|
7
|
-
export const Zero = '0'.charCodeAt(0)
|
|
8
|
-
export const One = '1'.charCodeAt(0)
|
|
9
|
-
export const Two = '2'.charCodeAt(0)
|
|
10
|
-
export const Three = '3'.charCodeAt(0)
|
|
11
|
-
export const Four = '4'.charCodeAt(0)
|
|
12
|
-
export const Five = '5'.charCodeAt(0)
|
|
13
|
-
export const Six = '6'.charCodeAt(0)
|
|
14
|
-
export const Seven = '7'.charCodeAt(0)
|
|
15
|
-
export const Eight = '8'.charCodeAt(0)
|
|
16
|
-
export const Nine = '9'.charCodeAt(0)
|
|
17
|
-
export const Dot = '.'.charCodeAt(0)
|
|
18
|
-
export const CarriageReturn = '\r'.charCodeAt(0)
|
|
19
|
-
export const LineFeed = '\n'.charCodeAt(0)
|
|
20
|
-
export const Space = ' '.charCodeAt(0)
|
|
21
|
-
export const Tab = '\t'.charCodeAt(0)
|
|
22
|
-
export const Slash = '/'.charCodeAt(0)
|
|
23
|
-
export const Star = '*'.charCodeAt(0)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const None = 0
|
|
2
|
-
export const CurlyOpen = 1
|
|
3
|
-
export const CurlyClose = 2
|
|
4
|
-
export const Eof = 3
|
|
5
|
-
export const SquareOpen = 4
|
|
6
|
-
export const SquareClose = 5
|
|
7
|
-
export const DoubleQuote = 6
|
|
8
|
-
export const Comma = 7
|
|
9
|
-
export const Numeric = 8
|
|
10
|
-
export const Slash = 9
|
|
11
|
-
export const Literal = 10
|