@lvce-editor/extension-host-worker 1.16.0 → 2.0.0
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/dist/extensionHostWorkerMain.js +209 -243
- package/package.json +1 -1
|
@@ -330,7 +330,7 @@ class NoProviderFoundError extends Error {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
const normalizeLine
|
|
333
|
+
const normalizeLine = line => {
|
|
334
334
|
if (line.startsWith('Error: ')) {
|
|
335
335
|
return line.slice('Error: '.length);
|
|
336
336
|
}
|
|
@@ -339,41 +339,41 @@ const normalizeLine$1 = line => {
|
|
|
339
339
|
}
|
|
340
340
|
return line;
|
|
341
341
|
};
|
|
342
|
-
const getCombinedMessage
|
|
343
|
-
const stringifiedError = normalizeLine
|
|
342
|
+
const getCombinedMessage = (error, message) => {
|
|
343
|
+
const stringifiedError = normalizeLine(`${error}`);
|
|
344
344
|
if (message) {
|
|
345
345
|
return `${message}: ${stringifiedError}`;
|
|
346
346
|
}
|
|
347
347
|
return stringifiedError;
|
|
348
348
|
};
|
|
349
|
-
const NewLine$
|
|
350
|
-
const getNewLineIndex$
|
|
351
|
-
return string.indexOf(NewLine$
|
|
349
|
+
const NewLine$2 = '\n';
|
|
350
|
+
const getNewLineIndex$1 = (string, startIndex = undefined) => {
|
|
351
|
+
return string.indexOf(NewLine$2, startIndex);
|
|
352
352
|
};
|
|
353
|
-
const mergeStacks
|
|
353
|
+
const mergeStacks = (parent, child) => {
|
|
354
354
|
if (!child) {
|
|
355
355
|
return parent;
|
|
356
356
|
}
|
|
357
|
-
const parentNewLineIndex = getNewLineIndex$
|
|
358
|
-
const childNewLineIndex = getNewLineIndex$
|
|
357
|
+
const parentNewLineIndex = getNewLineIndex$1(parent);
|
|
358
|
+
const childNewLineIndex = getNewLineIndex$1(child);
|
|
359
359
|
if (childNewLineIndex === -1) {
|
|
360
360
|
return parent;
|
|
361
361
|
}
|
|
362
362
|
const parentFirstLine = parent.slice(0, parentNewLineIndex);
|
|
363
363
|
const childRest = child.slice(childNewLineIndex);
|
|
364
|
-
const childFirstLine = normalizeLine
|
|
364
|
+
const childFirstLine = normalizeLine(child.slice(0, childNewLineIndex));
|
|
365
365
|
if (parentFirstLine.includes(childFirstLine)) {
|
|
366
366
|
return parentFirstLine + childRest;
|
|
367
367
|
}
|
|
368
368
|
return child;
|
|
369
369
|
};
|
|
370
|
-
|
|
370
|
+
class VError extends Error {
|
|
371
371
|
constructor(error, message) {
|
|
372
|
-
const combinedMessage = getCombinedMessage
|
|
372
|
+
const combinedMessage = getCombinedMessage(error, message);
|
|
373
373
|
super(combinedMessage);
|
|
374
374
|
this.name = 'VError';
|
|
375
375
|
if (error instanceof Error) {
|
|
376
|
-
this.stack = mergeStacks
|
|
376
|
+
this.stack = mergeStacks(this.stack, error.stack);
|
|
377
377
|
}
|
|
378
378
|
if (error.codeFrame) {
|
|
379
379
|
// @ts-ignore
|
|
@@ -384,7 +384,7 @@ let VError$1 = class VError extends Error {
|
|
|
384
384
|
this.code = error.code;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
}
|
|
387
|
+
}
|
|
388
388
|
|
|
389
389
|
const getType = value => {
|
|
390
390
|
switch (typeof value) {
|
|
@@ -552,7 +552,7 @@ const registerMethod = ({
|
|
|
552
552
|
if (error) {
|
|
553
553
|
const improvedError = improveValidationError(name, error);
|
|
554
554
|
// @ts-ignore
|
|
555
|
-
throw new VError
|
|
555
|
+
throw new VError(improvedError);
|
|
556
556
|
}
|
|
557
557
|
return result;
|
|
558
558
|
} catch (error) {
|
|
@@ -562,7 +562,7 @@ const registerMethod = ({
|
|
|
562
562
|
if (actualError.message === 'provider[methodName] is not a function') {
|
|
563
563
|
const camelCaseName = toCamelCase(name);
|
|
564
564
|
// @ts-ignore
|
|
565
|
-
throw new VError
|
|
565
|
+
throw new VError(`Failed to execute ${spacedOutName} provider: VError: ${camelCaseName}Provider.${methodName} is not a function`);
|
|
566
566
|
}
|
|
567
567
|
const message = actualError.name === 'Error' ? `${actualError.message}` : `${actualError.name}: ${actualError.message}`;
|
|
568
568
|
actualError.message = `Failed to execute ${spacedOutName} provider: ${message}`;
|
|
@@ -704,7 +704,7 @@ const registerCommand = command => {
|
|
|
704
704
|
state$9.commands[command.id] = command;
|
|
705
705
|
} catch (error) {
|
|
706
706
|
const commandDisplayId = getCommandDisplay(command);
|
|
707
|
-
throw new VError
|
|
707
|
+
throw new VError(error, `Failed to register command${commandDisplayId}`);
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
710
|
const executeCommand = async (id, ...args) => {
|
|
@@ -720,7 +720,7 @@ const executeCommand = async (id, ...args) => {
|
|
|
720
720
|
if (error && error.isExpected) {
|
|
721
721
|
throw error;
|
|
722
722
|
}
|
|
723
|
-
throw new VError
|
|
723
|
+
throw new VError(error, 'Failed to execute command');
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
726
|
|
|
@@ -827,7 +827,7 @@ class JsonRpcError extends Error {
|
|
|
827
827
|
this.name = 'JsonRpcError';
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
|
-
const NewLine$
|
|
830
|
+
const NewLine$1 = '\n';
|
|
831
831
|
const DomException = 'DOMException';
|
|
832
832
|
const ReferenceError$1 = 'ReferenceError';
|
|
833
833
|
const SyntaxError$1 = 'SyntaxError';
|
|
@@ -872,23 +872,23 @@ const constructError = (message, type, name) => {
|
|
|
872
872
|
}
|
|
873
873
|
return new ErrorConstructor(message);
|
|
874
874
|
};
|
|
875
|
-
const getNewLineIndex
|
|
876
|
-
return string.indexOf(NewLine$
|
|
875
|
+
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
876
|
+
return string.indexOf(NewLine$1, startIndex);
|
|
877
877
|
};
|
|
878
878
|
const getParentStack = error => {
|
|
879
879
|
let parentStack = error.stack || error.data || error.message || '';
|
|
880
880
|
if (parentStack.startsWith(' at')) {
|
|
881
|
-
parentStack = error.message + NewLine$
|
|
881
|
+
parentStack = error.message + NewLine$1 + parentStack;
|
|
882
882
|
}
|
|
883
883
|
return parentStack;
|
|
884
884
|
};
|
|
885
885
|
const joinLines$1 = lines => {
|
|
886
|
-
return lines.join(NewLine$
|
|
886
|
+
return lines.join(NewLine$1);
|
|
887
887
|
};
|
|
888
888
|
const MethodNotFound = -32601;
|
|
889
889
|
const Custom = -32001;
|
|
890
890
|
const splitLines$2 = lines => {
|
|
891
|
-
return lines.split(NewLine$
|
|
891
|
+
return lines.split(NewLine$1);
|
|
892
892
|
};
|
|
893
893
|
const restoreJsonRpcError = error => {
|
|
894
894
|
if (error && error instanceof Error) {
|
|
@@ -898,14 +898,14 @@ const restoreJsonRpcError = error => {
|
|
|
898
898
|
if (error && error.code && error.code === MethodNotFound) {
|
|
899
899
|
const restoredError = new JsonRpcError(error.message);
|
|
900
900
|
const parentStack = getParentStack(error);
|
|
901
|
-
restoredError.stack = parentStack + NewLine$
|
|
901
|
+
restoredError.stack = parentStack + NewLine$1 + currentStack;
|
|
902
902
|
return restoredError;
|
|
903
903
|
}
|
|
904
904
|
if (error && error.message) {
|
|
905
905
|
const restoredError = constructError(error.message, error.type, error.name);
|
|
906
906
|
if (error.data) {
|
|
907
907
|
if (error.data.stack && error.data.type && error.message) {
|
|
908
|
-
restoredError.stack = error.data.type + ': ' + error.message + NewLine$
|
|
908
|
+
restoredError.stack = error.data.type + ': ' + error.message + NewLine$1 + error.data.stack + NewLine$1 + currentStack;
|
|
909
909
|
} else if (error.data.stack) {
|
|
910
910
|
restoredError.stack = error.data.stack;
|
|
911
911
|
}
|
|
@@ -925,7 +925,7 @@ const restoreJsonRpcError = error => {
|
|
|
925
925
|
if (error.stack) {
|
|
926
926
|
const lowerStack = restoredError.stack || '';
|
|
927
927
|
// @ts-ignore
|
|
928
|
-
const indexNewLine = getNewLineIndex
|
|
928
|
+
const indexNewLine = getNewLineIndex(lowerStack);
|
|
929
929
|
const parentStack = getParentStack(error);
|
|
930
930
|
// @ts-ignore
|
|
931
931
|
restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
|
|
@@ -1161,7 +1161,7 @@ const invokeAndTransfer = (method, ...params) => {
|
|
|
1161
1161
|
const ipc = get$4();
|
|
1162
1162
|
return invokeAndTransfer$1(ipc, method, ...params);
|
|
1163
1163
|
};
|
|
1164
|
-
const listen$
|
|
1164
|
+
const listen$1 = ipc => {
|
|
1165
1165
|
handleIpc(ipc);
|
|
1166
1166
|
set$4(ipc);
|
|
1167
1167
|
};
|
|
@@ -1173,7 +1173,7 @@ const getDebugProvider = id => {
|
|
|
1173
1173
|
const provider = state$6.debugProviderMap[id];
|
|
1174
1174
|
if (!provider) {
|
|
1175
1175
|
// @ts-ignore
|
|
1176
|
-
throw new VError
|
|
1176
|
+
throw new VError(`no debug provider "${id}" found`);
|
|
1177
1177
|
}
|
|
1178
1178
|
return provider;
|
|
1179
1179
|
};
|
|
@@ -1202,7 +1202,7 @@ const start = async (protocol, path) => {
|
|
|
1202
1202
|
handleScriptParsed
|
|
1203
1203
|
}, path);
|
|
1204
1204
|
} catch (error) {
|
|
1205
|
-
throw new VError
|
|
1205
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1206
1206
|
}
|
|
1207
1207
|
};
|
|
1208
1208
|
const listProcesses = async (protocol, path) => {
|
|
@@ -1212,7 +1212,7 @@ const listProcesses = async (protocol, path) => {
|
|
|
1212
1212
|
array(processes);
|
|
1213
1213
|
return processes;
|
|
1214
1214
|
} catch (error) {
|
|
1215
|
-
throw new VError
|
|
1215
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
1218
1218
|
const resume = async protocol => {
|
|
@@ -1220,7 +1220,7 @@ const resume = async protocol => {
|
|
|
1220
1220
|
const provider = getDebugProvider(protocol);
|
|
1221
1221
|
return await provider.resume();
|
|
1222
1222
|
} catch (error) {
|
|
1223
|
-
throw new VError
|
|
1223
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1224
1224
|
}
|
|
1225
1225
|
};
|
|
1226
1226
|
const pause = async protocol => {
|
|
@@ -1228,7 +1228,7 @@ const pause = async protocol => {
|
|
|
1228
1228
|
const provider = getDebugProvider(protocol);
|
|
1229
1229
|
return await provider.pause();
|
|
1230
1230
|
} catch (error) {
|
|
1231
|
-
throw new VError
|
|
1231
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1232
1232
|
}
|
|
1233
1233
|
};
|
|
1234
1234
|
const stepInto = async protocol => {
|
|
@@ -1236,7 +1236,7 @@ const stepInto = async protocol => {
|
|
|
1236
1236
|
const provider = getDebugProvider(protocol);
|
|
1237
1237
|
return await provider.stepInto();
|
|
1238
1238
|
} catch (error) {
|
|
1239
|
-
throw new VError
|
|
1239
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
1242
1242
|
const stepOut = async protocol => {
|
|
@@ -1244,7 +1244,7 @@ const stepOut = async protocol => {
|
|
|
1244
1244
|
const provider = getDebugProvider(protocol);
|
|
1245
1245
|
return await provider.stepOut();
|
|
1246
1246
|
} catch (error) {
|
|
1247
|
-
throw new VError
|
|
1247
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
1250
|
const stepOver = async protocol => {
|
|
@@ -1252,7 +1252,7 @@ const stepOver = async protocol => {
|
|
|
1252
1252
|
const provider = getDebugProvider(protocol);
|
|
1253
1253
|
return await provider.stepOver();
|
|
1254
1254
|
} catch (error) {
|
|
1255
|
-
throw new VError
|
|
1255
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1256
1256
|
}
|
|
1257
1257
|
};
|
|
1258
1258
|
const setPauseOnException = async (protocol, value) => {
|
|
@@ -1260,7 +1260,7 @@ const setPauseOnException = async (protocol, value) => {
|
|
|
1260
1260
|
const provider = getDebugProvider(protocol);
|
|
1261
1261
|
return await provider.setPauseOnExceptions(value);
|
|
1262
1262
|
} catch (error) {
|
|
1263
|
-
throw new VError
|
|
1263
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1264
1264
|
}
|
|
1265
1265
|
};
|
|
1266
1266
|
const getProperties = async (protocol, objectId) => {
|
|
@@ -1268,7 +1268,7 @@ const getProperties = async (protocol, objectId) => {
|
|
|
1268
1268
|
const provider = getDebugProvider(protocol);
|
|
1269
1269
|
return await provider.getProperties(objectId);
|
|
1270
1270
|
} catch (error) {
|
|
1271
|
-
throw new VError
|
|
1271
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1272
1272
|
}
|
|
1273
1273
|
};
|
|
1274
1274
|
const evaluate = async (protocol, expression, callFrameId) => {
|
|
@@ -1276,7 +1276,7 @@ const evaluate = async (protocol, expression, callFrameId) => {
|
|
|
1276
1276
|
const provider = getDebugProvider(protocol);
|
|
1277
1277
|
return await provider.evaluate(expression, callFrameId);
|
|
1278
1278
|
} catch (error) {
|
|
1279
|
-
throw new VError
|
|
1279
|
+
throw new VError(error, 'Failed to execute debug provider');
|
|
1280
1280
|
}
|
|
1281
1281
|
};
|
|
1282
1282
|
const setPauseOnExceptions = async (protocol, value) => {
|
|
@@ -1284,7 +1284,7 @@ const setPauseOnExceptions = async (protocol, value) => {
|
|
|
1284
1284
|
const provider = getDebugProvider(protocol);
|
|
1285
1285
|
return await provider.setPauseOnExceptions(value);
|
|
1286
1286
|
} catch (error) {
|
|
1287
|
-
throw new VError
|
|
1287
|
+
throw new VError(error, 'Failed to execute setPauseOnExceptions');
|
|
1288
1288
|
}
|
|
1289
1289
|
};
|
|
1290
1290
|
|
|
@@ -1341,7 +1341,7 @@ const get$3 = protocol => {
|
|
|
1341
1341
|
const provider = fileSystemProviderMap[protocol];
|
|
1342
1342
|
if (!provider) {
|
|
1343
1343
|
// @ts-ignore
|
|
1344
|
-
throw new VError
|
|
1344
|
+
throw new VError(`no file system provider for protocol "${protocol}" found`);
|
|
1345
1345
|
}
|
|
1346
1346
|
return provider;
|
|
1347
1347
|
};
|
|
@@ -1363,7 +1363,7 @@ const readDirWithFileTypes = async (protocol, path) => {
|
|
|
1363
1363
|
const provider = get$3(protocol);
|
|
1364
1364
|
return await provider.readDirWithFileTypes(path);
|
|
1365
1365
|
} catch (error) {
|
|
1366
|
-
throw new VError
|
|
1366
|
+
throw new VError(error, 'Failed to execute file system provider');
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
1369
1369
|
const readFile = async (protocol, path) => {
|
|
@@ -1371,7 +1371,7 @@ const readFile = async (protocol, path) => {
|
|
|
1371
1371
|
const provider = get$3(protocol);
|
|
1372
1372
|
return await provider.readFile(path);
|
|
1373
1373
|
} catch (error) {
|
|
1374
|
-
throw new VError
|
|
1374
|
+
throw new VError(error, 'Failed to execute file system provider');
|
|
1375
1375
|
}
|
|
1376
1376
|
};
|
|
1377
1377
|
const readFileExternal = async path => {
|
|
@@ -1399,7 +1399,7 @@ const writeFile = async (protocol, uri, content) => {
|
|
|
1399
1399
|
const provider = get$3(protocol);
|
|
1400
1400
|
return await provider.writeFile(uri, content);
|
|
1401
1401
|
} catch (error) {
|
|
1402
|
-
throw new VError
|
|
1402
|
+
throw new VError(error, 'Failed to execute file system provider');
|
|
1403
1403
|
}
|
|
1404
1404
|
};
|
|
1405
1405
|
const getPathSeparator = protocol => {
|
|
@@ -1407,7 +1407,7 @@ const getPathSeparator = protocol => {
|
|
|
1407
1407
|
const provider = get$3(protocol);
|
|
1408
1408
|
return provider.pathSeparator;
|
|
1409
1409
|
} catch (error) {
|
|
1410
|
-
throw new VError
|
|
1410
|
+
throw new VError(error, 'Failed to execute file system provider');
|
|
1411
1411
|
}
|
|
1412
1412
|
};
|
|
1413
1413
|
|
|
@@ -1529,7 +1529,7 @@ const create$7 = async ({
|
|
|
1529
1529
|
const ipc = module.wrap(rawIpc);
|
|
1530
1530
|
return ipc;
|
|
1531
1531
|
} catch (error) {
|
|
1532
|
-
throw new VError
|
|
1532
|
+
throw new VError(error, `Failed to create ipc`);
|
|
1533
1533
|
}
|
|
1534
1534
|
};
|
|
1535
1535
|
|
|
@@ -1578,7 +1578,7 @@ const createNodeRpc = async ({
|
|
|
1578
1578
|
await rpc.invoke('LoadFile.loadFile', path);
|
|
1579
1579
|
return rpc;
|
|
1580
1580
|
} catch (error) {
|
|
1581
|
-
throw new VError
|
|
1581
|
+
throw new VError(error, `Failed to create node rpc`);
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
1584
|
|
|
@@ -1782,7 +1782,7 @@ const createRpc = ({
|
|
|
1782
1782
|
contentSecurityPolicy
|
|
1783
1783
|
});
|
|
1784
1784
|
} catch (error) {
|
|
1785
|
-
throw new VError
|
|
1785
|
+
throw new VError(error, `Failed to create webworker rpc`);
|
|
1786
1786
|
}
|
|
1787
1787
|
};
|
|
1788
1788
|
|
|
@@ -1919,7 +1919,7 @@ const registerTextSearchProvider = textSearchProvider => {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
state$4.textSearchProviders[textSearchProvider.scheme] = textSearchProvider;
|
|
1921
1921
|
} catch (error) {
|
|
1922
|
-
throw new VError
|
|
1922
|
+
throw new VError(error, 'Failed to register text search provider');
|
|
1923
1923
|
}
|
|
1924
1924
|
};
|
|
1925
1925
|
const executeTextSearchProvider = async (scheme, query) => {
|
|
@@ -1931,7 +1931,7 @@ const executeTextSearchProvider = async (scheme, query) => {
|
|
|
1931
1931
|
const results = await textSearchProvider.provideTextSearchResults(query);
|
|
1932
1932
|
return results;
|
|
1933
1933
|
} catch (error) {
|
|
1934
|
-
throw new VError
|
|
1934
|
+
throw new VError(error, 'Failed to execute text search provider');
|
|
1935
1935
|
}
|
|
1936
1936
|
};
|
|
1937
1937
|
|
|
@@ -2098,6 +2098,16 @@ const getRemoteUrl = async (uri, options = {}) => {
|
|
|
2098
2098
|
throw new Error(`unsupported platform for remote url`);
|
|
2099
2099
|
};
|
|
2100
2100
|
|
|
2101
|
+
const waitForFirstMessage$1 = async port => {
|
|
2102
|
+
const {
|
|
2103
|
+
resolve,
|
|
2104
|
+
promise
|
|
2105
|
+
} = Promise.withResolvers();
|
|
2106
|
+
port.onmessage = resolve;
|
|
2107
|
+
const firstMessage = await promise;
|
|
2108
|
+
return firstMessage;
|
|
2109
|
+
};
|
|
2110
|
+
|
|
2101
2111
|
// TODO pass uuid to allow having multiple webviews open at the same time
|
|
2102
2112
|
const createWebView = async (providerId, port, uri, uid, origin) => {
|
|
2103
2113
|
const provider = getProvider(providerId);
|
|
@@ -2108,9 +2118,7 @@ const createWebView = async (providerId, port, uri, uid, origin) => {
|
|
|
2108
2118
|
// TODO cancel promise when webview is disposed before sending message
|
|
2109
2119
|
// TODO handle case when webview doesn't send ready message
|
|
2110
2120
|
// TODO handle error
|
|
2111
|
-
await
|
|
2112
|
-
port.onmessage = resolve;
|
|
2113
|
-
});
|
|
2121
|
+
await waitForFirstMessage$1(port);
|
|
2114
2122
|
|
|
2115
2123
|
// TODO use ipc module
|
|
2116
2124
|
const handlePortMessage = async event => {
|
|
@@ -2123,10 +2131,14 @@ const createWebView = async (providerId, port, uri, uid, origin) => {
|
|
|
2123
2131
|
params,
|
|
2124
2132
|
id
|
|
2125
2133
|
} = data;
|
|
2134
|
+
if (id && !method) {
|
|
2135
|
+
resolve(id, data);
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2126
2138
|
if (provider && provider.commands && provider.commands[method]) {
|
|
2127
2139
|
const fn = provider.commands[method];
|
|
2128
2140
|
const result = await fn(...params);
|
|
2129
|
-
if (id) {
|
|
2141
|
+
if (id && method) {
|
|
2130
2142
|
target.postMessage({
|
|
2131
2143
|
jsonrpc: '2.0',
|
|
2132
2144
|
id,
|
|
@@ -2141,13 +2153,22 @@ const createWebView = async (providerId, port, uri, uid, origin) => {
|
|
|
2141
2153
|
provider,
|
|
2142
2154
|
uid,
|
|
2143
2155
|
origin,
|
|
2144
|
-
invoke(method, ...params) {
|
|
2145
|
-
|
|
2156
|
+
async invoke(method, ...params) {
|
|
2157
|
+
const {
|
|
2158
|
+
id,
|
|
2159
|
+
promise
|
|
2160
|
+
} = registerPromise();
|
|
2146
2161
|
port.postMessage({
|
|
2147
2162
|
jsonrpc: '2.0',
|
|
2163
|
+
id,
|
|
2148
2164
|
method,
|
|
2149
2165
|
params
|
|
2150
2166
|
});
|
|
2167
|
+
const result = await promise;
|
|
2168
|
+
if (result.error) {
|
|
2169
|
+
throw new Error(`Error: ${result.error.message}`);
|
|
2170
|
+
}
|
|
2171
|
+
return result.result;
|
|
2151
2172
|
}
|
|
2152
2173
|
};
|
|
2153
2174
|
// TODO allow creating multiple webviews per provider
|
|
@@ -2243,7 +2264,7 @@ const api = {
|
|
|
2243
2264
|
env: env,
|
|
2244
2265
|
// Errors
|
|
2245
2266
|
FormattingError,
|
|
2246
|
-
VError
|
|
2267
|
+
VError,
|
|
2247
2268
|
// Exec
|
|
2248
2269
|
exec: exec,
|
|
2249
2270
|
// File System
|
|
@@ -2799,7 +2820,7 @@ const activate = async (extension, absolutePath) => {
|
|
|
2799
2820
|
}
|
|
2800
2821
|
} catch (error) {
|
|
2801
2822
|
const id = getExtensionId(extension);
|
|
2802
|
-
throw new VError
|
|
2823
|
+
throw new VError(error, `Failed to activate extension ${id}`);
|
|
2803
2824
|
}
|
|
2804
2825
|
// console.info('activated', path)
|
|
2805
2826
|
};
|
|
@@ -2837,7 +2858,7 @@ const mockExec = () => {
|
|
|
2837
2858
|
};
|
|
2838
2859
|
};
|
|
2839
2860
|
} catch (error) {
|
|
2840
|
-
throw new VError
|
|
2861
|
+
throw new VError(error, 'Failed to mock exec function');
|
|
2841
2862
|
}
|
|
2842
2863
|
};
|
|
2843
2864
|
|
|
@@ -2852,7 +2873,7 @@ const mockRpc = () => {
|
|
|
2852
2873
|
}
|
|
2853
2874
|
};
|
|
2854
2875
|
} catch (error) {
|
|
2855
|
-
throw new VError
|
|
2876
|
+
throw new VError(error, 'Failed to mock exec function');
|
|
2856
2877
|
}
|
|
2857
2878
|
};
|
|
2858
2879
|
};
|
|
@@ -2889,30 +2910,6 @@ const Auto = () => {
|
|
|
2889
2910
|
return ModuleWorkerWithMessagePort;
|
|
2890
2911
|
};
|
|
2891
2912
|
|
|
2892
|
-
const getData$1 = event => {
|
|
2893
|
-
return event.data;
|
|
2894
|
-
};
|
|
2895
|
-
const attachEvents = that => {
|
|
2896
|
-
const handleMessage = (...args) => {
|
|
2897
|
-
const data = that.getData(...args);
|
|
2898
|
-
that.dispatchEvent(new MessageEvent('message', {
|
|
2899
|
-
data
|
|
2900
|
-
}));
|
|
2901
|
-
};
|
|
2902
|
-
that.onMessage(handleMessage);
|
|
2903
|
-
const handleClose = event => {
|
|
2904
|
-
that.dispatchEvent(new Event('close'));
|
|
2905
|
-
};
|
|
2906
|
-
that.onClose(handleClose);
|
|
2907
|
-
};
|
|
2908
|
-
class Ipc extends EventTarget {
|
|
2909
|
-
constructor(rawIpc) {
|
|
2910
|
-
super();
|
|
2911
|
-
this._rawIpc = rawIpc;
|
|
2912
|
-
attachEvents(this);
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
const readyMessage = 'ready';
|
|
2916
2913
|
const walkValue = (value, transferrables, isTransferrable) => {
|
|
2917
2914
|
if (!value) {
|
|
2918
2915
|
return;
|
|
@@ -2963,99 +2960,35 @@ const getTransferrables = value => {
|
|
|
2963
2960
|
walkValue(value, transferrables, isTransferrable);
|
|
2964
2961
|
return transferrables;
|
|
2965
2962
|
};
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
getData(event) {
|
|
2979
|
-
return getData$1(event);
|
|
2980
|
-
}
|
|
2981
|
-
send(message) {
|
|
2982
|
-
this._rawIpc.postMessage(message);
|
|
2983
|
-
}
|
|
2984
|
-
sendAndTransfer(message) {
|
|
2985
|
-
const transfer = getTransferrables(message);
|
|
2986
|
-
this._rawIpc.postMessage(message, transfer);
|
|
2987
|
-
}
|
|
2988
|
-
dispose() {
|
|
2989
|
-
// ignore
|
|
2990
|
-
}
|
|
2991
|
-
onClose(callback) {
|
|
2992
|
-
// ignore
|
|
2993
|
-
}
|
|
2994
|
-
onMessage(callback) {
|
|
2995
|
-
this._rawIpc.addEventListener('message', callback);
|
|
2996
|
-
this._rawIpc.start();
|
|
2997
|
-
}
|
|
2998
|
-
}
|
|
2999
|
-
const wrap$6 = port => {
|
|
3000
|
-
return new IpcChildWithMessagePort(port);
|
|
3001
|
-
};
|
|
3002
|
-
const IpcChildWithMessagePort$1 = {
|
|
3003
|
-
__proto__: null,
|
|
3004
|
-
listen: listen$3,
|
|
3005
|
-
signal: signal$3,
|
|
3006
|
-
wrap: wrap$6
|
|
3007
|
-
};
|
|
3008
|
-
const listen$2 = () => {
|
|
3009
|
-
// @ts-ignore
|
|
3010
|
-
if (typeof WorkerGlobalScope === 'undefined') {
|
|
3011
|
-
throw new TypeError('module is not in web worker scope');
|
|
3012
|
-
}
|
|
3013
|
-
return globalThis;
|
|
3014
|
-
};
|
|
3015
|
-
const signal$2 = global => {
|
|
3016
|
-
global.postMessage(readyMessage);
|
|
2963
|
+
const attachEvents = that => {
|
|
2964
|
+
const handleMessage = (...args) => {
|
|
2965
|
+
const data = that.getData(...args);
|
|
2966
|
+
that.dispatchEvent(new MessageEvent('message', {
|
|
2967
|
+
data
|
|
2968
|
+
}));
|
|
2969
|
+
};
|
|
2970
|
+
that.onMessage(handleMessage);
|
|
2971
|
+
const handleClose = event => {
|
|
2972
|
+
that.dispatchEvent(new Event('close'));
|
|
2973
|
+
};
|
|
2974
|
+
that.onClose(handleClose);
|
|
3017
2975
|
};
|
|
3018
|
-
class
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
// @ts-ignore
|
|
3024
|
-
this._rawIpc.postMessage(message);
|
|
3025
|
-
}
|
|
3026
|
-
sendAndTransfer(message) {
|
|
3027
|
-
const transfer = getTransferrables(message);
|
|
3028
|
-
// @ts-ignore
|
|
3029
|
-
this._rawIpc.postMessage(message, transfer);
|
|
3030
|
-
}
|
|
3031
|
-
dispose() {
|
|
3032
|
-
// ignore
|
|
3033
|
-
}
|
|
3034
|
-
onClose(callback) {
|
|
3035
|
-
// ignore
|
|
3036
|
-
}
|
|
3037
|
-
onMessage(callback) {
|
|
3038
|
-
this._rawIpc.addEventListener('message', callback);
|
|
2976
|
+
class Ipc extends EventTarget {
|
|
2977
|
+
constructor(rawIpc) {
|
|
2978
|
+
super();
|
|
2979
|
+
this._rawIpc = rawIpc;
|
|
2980
|
+
attachEvents(this);
|
|
3039
2981
|
}
|
|
3040
2982
|
}
|
|
3041
|
-
const wrap$5 = global => {
|
|
3042
|
-
return new IpcChildWithModuleWorker(global);
|
|
3043
|
-
};
|
|
3044
|
-
const IpcChildWithModuleWorker$1 = {
|
|
3045
|
-
__proto__: null,
|
|
3046
|
-
listen: listen$2,
|
|
3047
|
-
signal: signal$2,
|
|
3048
|
-
wrap: wrap$5
|
|
3049
|
-
};
|
|
3050
2983
|
const E_INCOMPATIBLE_NATIVE_MODULE = 'E_INCOMPATIBLE_NATIVE_MODULE';
|
|
3051
2984
|
const E_MODULES_NOT_SUPPORTED_IN_ELECTRON = 'E_MODULES_NOT_SUPPORTED_IN_ELECTRON';
|
|
3052
2985
|
const ERR_MODULE_NOT_FOUND = 'ERR_MODULE_NOT_FOUND';
|
|
3053
|
-
const NewLine
|
|
2986
|
+
const NewLine = '\n';
|
|
3054
2987
|
const joinLines = lines => {
|
|
3055
|
-
return lines.join(NewLine
|
|
2988
|
+
return lines.join(NewLine);
|
|
3056
2989
|
};
|
|
3057
2990
|
const splitLines$1 = lines => {
|
|
3058
|
-
return lines.split(NewLine
|
|
2991
|
+
return lines.split(NewLine);
|
|
3059
2992
|
};
|
|
3060
2993
|
const isModuleNotFoundMessage = line => {
|
|
3061
2994
|
return line.includes('[ERR_MODULE_NOT_FOUND]');
|
|
@@ -3160,61 +3093,6 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
3160
3093
|
stack: rest
|
|
3161
3094
|
};
|
|
3162
3095
|
};
|
|
3163
|
-
const normalizeLine = line => {
|
|
3164
|
-
if (line.startsWith('Error: ')) {
|
|
3165
|
-
return line.slice('Error: '.length);
|
|
3166
|
-
}
|
|
3167
|
-
if (line.startsWith('VError: ')) {
|
|
3168
|
-
return line.slice('VError: '.length);
|
|
3169
|
-
}
|
|
3170
|
-
return line;
|
|
3171
|
-
};
|
|
3172
|
-
const getCombinedMessage = (error, message) => {
|
|
3173
|
-
const stringifiedError = normalizeLine(`${error}`);
|
|
3174
|
-
if (message) {
|
|
3175
|
-
return `${message}: ${stringifiedError}`;
|
|
3176
|
-
}
|
|
3177
|
-
return stringifiedError;
|
|
3178
|
-
};
|
|
3179
|
-
const NewLine = '\n';
|
|
3180
|
-
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
3181
|
-
return string.indexOf(NewLine, startIndex);
|
|
3182
|
-
};
|
|
3183
|
-
const mergeStacks = (parent, child) => {
|
|
3184
|
-
if (!child) {
|
|
3185
|
-
return parent;
|
|
3186
|
-
}
|
|
3187
|
-
const parentNewLineIndex = getNewLineIndex(parent);
|
|
3188
|
-
const childNewLineIndex = getNewLineIndex(child);
|
|
3189
|
-
if (childNewLineIndex === -1) {
|
|
3190
|
-
return parent;
|
|
3191
|
-
}
|
|
3192
|
-
const parentFirstLine = parent.slice(0, parentNewLineIndex);
|
|
3193
|
-
const childRest = child.slice(childNewLineIndex);
|
|
3194
|
-
const childFirstLine = normalizeLine(child.slice(0, childNewLineIndex));
|
|
3195
|
-
if (parentFirstLine.includes(childFirstLine)) {
|
|
3196
|
-
return parentFirstLine + childRest;
|
|
3197
|
-
}
|
|
3198
|
-
return child;
|
|
3199
|
-
};
|
|
3200
|
-
class VError extends Error {
|
|
3201
|
-
constructor(error, message) {
|
|
3202
|
-
const combinedMessage = getCombinedMessage(error, message);
|
|
3203
|
-
super(combinedMessage);
|
|
3204
|
-
this.name = 'VError';
|
|
3205
|
-
if (error instanceof Error) {
|
|
3206
|
-
this.stack = mergeStacks(this.stack, error.stack);
|
|
3207
|
-
}
|
|
3208
|
-
if (error.codeFrame) {
|
|
3209
|
-
// @ts-ignore
|
|
3210
|
-
this.codeFrame = error.codeFrame;
|
|
3211
|
-
}
|
|
3212
|
-
if (error.code) {
|
|
3213
|
-
// @ts-ignore
|
|
3214
|
-
this.code = error.code;
|
|
3215
|
-
}
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
3096
|
let IpcError$1 = class IpcError extends VError {
|
|
3219
3097
|
// @ts-ignore
|
|
3220
3098
|
constructor(betterMessage, stdout = '', stderr = '') {
|
|
@@ -3241,6 +3119,94 @@ let IpcError$1 = class IpcError extends VError {
|
|
|
3241
3119
|
this.stderr = stderr;
|
|
3242
3120
|
}
|
|
3243
3121
|
};
|
|
3122
|
+
const readyMessage = 'ready';
|
|
3123
|
+
const getData$2 = event => {
|
|
3124
|
+
return event.data;
|
|
3125
|
+
};
|
|
3126
|
+
const listen$8 = ({
|
|
3127
|
+
port
|
|
3128
|
+
}) => {
|
|
3129
|
+
return port;
|
|
3130
|
+
};
|
|
3131
|
+
const signal$8 = port => {
|
|
3132
|
+
port.postMessage(readyMessage);
|
|
3133
|
+
};
|
|
3134
|
+
class IpcChildWithMessagePort extends Ipc {
|
|
3135
|
+
constructor(port) {
|
|
3136
|
+
super(port);
|
|
3137
|
+
}
|
|
3138
|
+
getData(event) {
|
|
3139
|
+
return getData$2(event);
|
|
3140
|
+
}
|
|
3141
|
+
send(message) {
|
|
3142
|
+
this._rawIpc.postMessage(message);
|
|
3143
|
+
}
|
|
3144
|
+
sendAndTransfer(message) {
|
|
3145
|
+
const transfer = getTransferrables(message);
|
|
3146
|
+
this._rawIpc.postMessage(message, transfer);
|
|
3147
|
+
}
|
|
3148
|
+
dispose() {
|
|
3149
|
+
// ignore
|
|
3150
|
+
}
|
|
3151
|
+
onClose(callback) {
|
|
3152
|
+
// ignore
|
|
3153
|
+
}
|
|
3154
|
+
onMessage(callback) {
|
|
3155
|
+
this._rawIpc.addEventListener('message', callback);
|
|
3156
|
+
this._rawIpc.start();
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
const wrap$f = port => {
|
|
3160
|
+
return new IpcChildWithMessagePort(port);
|
|
3161
|
+
};
|
|
3162
|
+
const IpcChildWithMessagePort$1 = {
|
|
3163
|
+
__proto__: null,
|
|
3164
|
+
listen: listen$8,
|
|
3165
|
+
signal: signal$8,
|
|
3166
|
+
wrap: wrap$f
|
|
3167
|
+
};
|
|
3168
|
+
const listen$7 = () => {
|
|
3169
|
+
// @ts-ignore
|
|
3170
|
+
if (typeof WorkerGlobalScope === 'undefined') {
|
|
3171
|
+
throw new TypeError('module is not in web worker scope');
|
|
3172
|
+
}
|
|
3173
|
+
return globalThis;
|
|
3174
|
+
};
|
|
3175
|
+
const signal$7 = global => {
|
|
3176
|
+
global.postMessage(readyMessage);
|
|
3177
|
+
};
|
|
3178
|
+
class IpcChildWithModuleWorker extends Ipc {
|
|
3179
|
+
getData(event) {
|
|
3180
|
+
return getData$2(event);
|
|
3181
|
+
}
|
|
3182
|
+
send(message) {
|
|
3183
|
+
// @ts-ignore
|
|
3184
|
+
this._rawIpc.postMessage(message);
|
|
3185
|
+
}
|
|
3186
|
+
sendAndTransfer(message) {
|
|
3187
|
+
const transfer = getTransferrables(message);
|
|
3188
|
+
// @ts-ignore
|
|
3189
|
+
this._rawIpc.postMessage(message, transfer);
|
|
3190
|
+
}
|
|
3191
|
+
dispose() {
|
|
3192
|
+
// ignore
|
|
3193
|
+
}
|
|
3194
|
+
onClose(callback) {
|
|
3195
|
+
// ignore
|
|
3196
|
+
}
|
|
3197
|
+
onMessage(callback) {
|
|
3198
|
+
this._rawIpc.addEventListener('message', callback);
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
const wrap$e = global => {
|
|
3202
|
+
return new IpcChildWithModuleWorker(global);
|
|
3203
|
+
};
|
|
3204
|
+
const IpcChildWithModuleWorker$1 = {
|
|
3205
|
+
__proto__: null,
|
|
3206
|
+
listen: listen$7,
|
|
3207
|
+
signal: signal$7,
|
|
3208
|
+
wrap: wrap$e
|
|
3209
|
+
};
|
|
3244
3210
|
const withResolvers$1 = () => {
|
|
3245
3211
|
let _resolve;
|
|
3246
3212
|
const promise = new Promise(resolve => {
|
|
@@ -3263,10 +3229,10 @@ const waitForFirstMessage = async port => {
|
|
|
3263
3229
|
// @ts-ignore
|
|
3264
3230
|
return event.data;
|
|
3265
3231
|
};
|
|
3266
|
-
const listen$
|
|
3267
|
-
const parentIpcRaw = listen$
|
|
3268
|
-
signal$
|
|
3269
|
-
const parentIpc = wrap$
|
|
3232
|
+
const listen$6 = async () => {
|
|
3233
|
+
const parentIpcRaw = listen$7();
|
|
3234
|
+
signal$7(parentIpcRaw);
|
|
3235
|
+
const parentIpc = wrap$e(parentIpcRaw);
|
|
3270
3236
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
3271
3237
|
if (firstMessage.method !== 'initialize') {
|
|
3272
3238
|
throw new IpcError$1('unexpected first message');
|
|
@@ -3289,7 +3255,7 @@ class IpcChildWithModuleWorkerAndMessagePort extends Ipc {
|
|
|
3289
3255
|
super(port);
|
|
3290
3256
|
}
|
|
3291
3257
|
getData(event) {
|
|
3292
|
-
return getData$
|
|
3258
|
+
return getData$2(event);
|
|
3293
3259
|
}
|
|
3294
3260
|
send(message) {
|
|
3295
3261
|
this._rawIpc.postMessage(message);
|
|
@@ -3311,13 +3277,13 @@ class IpcChildWithModuleWorkerAndMessagePort extends Ipc {
|
|
|
3311
3277
|
this._rawIpc.start();
|
|
3312
3278
|
}
|
|
3313
3279
|
}
|
|
3314
|
-
const wrap$
|
|
3280
|
+
const wrap$d = port => {
|
|
3315
3281
|
return new IpcChildWithModuleWorkerAndMessagePort(port);
|
|
3316
3282
|
};
|
|
3317
3283
|
const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
3318
3284
|
__proto__: null,
|
|
3319
|
-
listen: listen$
|
|
3320
|
-
wrap: wrap$
|
|
3285
|
+
listen: listen$6,
|
|
3286
|
+
wrap: wrap$d
|
|
3321
3287
|
};
|
|
3322
3288
|
|
|
3323
3289
|
const getModule$1 = method => {
|
|
@@ -3371,7 +3337,7 @@ function promisifyRequest(request) {
|
|
|
3371
3337
|
request.addEventListener('success', success);
|
|
3372
3338
|
request.addEventListener('error', error);
|
|
3373
3339
|
});
|
|
3374
|
-
// This mapping exists in reverseTransformCache but doesn't
|
|
3340
|
+
// This mapping exists in reverseTransformCache but doesn't exist in transformCache. This
|
|
3375
3341
|
// is because we create many promises from a single IDBRequest.
|
|
3376
3342
|
reverseTransformCache.set(promise, request);
|
|
3377
3343
|
return promise;
|
|
@@ -3639,7 +3605,7 @@ const saveValue = async (storeId, value) => {
|
|
|
3639
3605
|
// TODO
|
|
3640
3606
|
return;
|
|
3641
3607
|
}
|
|
3642
|
-
throw new VError
|
|
3608
|
+
throw new VError(error, 'Failed to save value to indexed db');
|
|
3643
3609
|
}
|
|
3644
3610
|
};
|
|
3645
3611
|
const getValues = async storeId => {
|
|
@@ -3652,7 +3618,7 @@ const getValues = async storeId => {
|
|
|
3652
3618
|
});
|
|
3653
3619
|
return objects;
|
|
3654
3620
|
} catch (error) {
|
|
3655
|
-
throw new VError
|
|
3621
|
+
throw new VError(error, 'Failed to get values from indexed db');
|
|
3656
3622
|
}
|
|
3657
3623
|
};
|
|
3658
3624
|
const getValuesByIndexName = async (storeId, indexName, only) => {
|
|
@@ -3716,7 +3682,7 @@ const set = async (key, value) => {
|
|
|
3716
3682
|
const db = await getDbMemoized();
|
|
3717
3683
|
await db.put(storeId, value, key);
|
|
3718
3684
|
} catch (error) {
|
|
3719
|
-
throw new VError
|
|
3685
|
+
throw new VError(error, 'Failed to save value to indexed db');
|
|
3720
3686
|
}
|
|
3721
3687
|
};
|
|
3722
3688
|
const get = async key => {
|
|
@@ -3725,7 +3691,7 @@ const get = async key => {
|
|
|
3725
3691
|
const value = db.get(storeId, key);
|
|
3726
3692
|
return value;
|
|
3727
3693
|
} catch (error) {
|
|
3728
|
-
throw new VError
|
|
3694
|
+
throw new VError(error, 'Failed to get value from indexed db');
|
|
3729
3695
|
}
|
|
3730
3696
|
};
|
|
3731
3697
|
|
|
@@ -3769,7 +3735,7 @@ const getJson = async url => {
|
|
|
3769
3735
|
const json = await response.json();
|
|
3770
3736
|
return json;
|
|
3771
3737
|
} catch (error) {
|
|
3772
|
-
throw new VError
|
|
3738
|
+
throw new VError(error, `Failed to get json`);
|
|
3773
3739
|
}
|
|
3774
3740
|
};
|
|
3775
3741
|
|
|
@@ -3845,7 +3811,7 @@ const getHandle = async uri => {
|
|
|
3845
3811
|
const handle = await getHandle$1(uri);
|
|
3846
3812
|
return handle;
|
|
3847
3813
|
} catch (error) {
|
|
3848
|
-
throw new VError
|
|
3814
|
+
throw new VError(error, 'Failed to get handle');
|
|
3849
3815
|
}
|
|
3850
3816
|
};
|
|
3851
3817
|
|
|
@@ -3885,7 +3851,7 @@ const searchFile = async uri => {
|
|
|
3885
3851
|
const handle = await getDirectoryHandle$1(path);
|
|
3886
3852
|
if (!handle) {
|
|
3887
3853
|
// @ts-ignore
|
|
3888
|
-
throw new VError
|
|
3854
|
+
throw new VError(`Folder not found ${uri}`);
|
|
3889
3855
|
}
|
|
3890
3856
|
const all = [];
|
|
3891
3857
|
await searchFilesRecursively(all, '', handle);
|
|
@@ -3901,7 +3867,7 @@ const getText = async url => {
|
|
|
3901
3867
|
const text = await response.text();
|
|
3902
3868
|
return text;
|
|
3903
3869
|
} catch (error) {
|
|
3904
|
-
throw new VError
|
|
3870
|
+
throw new VError(error, `Failed to get text`);
|
|
3905
3871
|
}
|
|
3906
3872
|
};
|
|
3907
3873
|
|
|
@@ -3966,7 +3932,7 @@ const getChildHandles = async handle => {
|
|
|
3966
3932
|
try {
|
|
3967
3933
|
return await getChildHandles$1(handle);
|
|
3968
3934
|
} catch (error) {
|
|
3969
|
-
throw new VError
|
|
3935
|
+
throw new VError(error, 'failed to get child handles');
|
|
3970
3936
|
}
|
|
3971
3937
|
};
|
|
3972
3938
|
|
|
@@ -4184,7 +4150,7 @@ const main = async () => {
|
|
|
4184
4150
|
const ipc = await listen({
|
|
4185
4151
|
method: Auto()
|
|
4186
4152
|
});
|
|
4187
|
-
listen$
|
|
4153
|
+
listen$1(ipc);
|
|
4188
4154
|
};
|
|
4189
4155
|
|
|
4190
4156
|
main();
|
|
@@ -4315,7 +4281,7 @@ const wrap$3 = webSocket => {
|
|
|
4315
4281
|
send(message) {
|
|
4316
4282
|
if (this.webSocket.readyState !== webSocket.OPEN) {
|
|
4317
4283
|
// @ts-ignore
|
|
4318
|
-
throw new VError
|
|
4284
|
+
throw new VError(`Failed to send message: WebSocket is not open`);
|
|
4319
4285
|
}
|
|
4320
4286
|
const stringifiedMessage = stringifyCompact(message);
|
|
4321
4287
|
this.webSocket.send(stringifiedMessage);
|
package/package.json
CHANGED