@lvce-editor/explorer-view 5.11.0 → 5.13.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/explorerViewWorkerMain.js +32 -26
- package/package.json +1 -1
|
@@ -243,8 +243,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
243
243
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
244
244
|
const message = lines[messageIndex];
|
|
245
245
|
return {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
247
|
+
message
|
|
248
248
|
};
|
|
249
249
|
};
|
|
250
250
|
const isModuleNotFoundError = stderr => {
|
|
@@ -267,14 +267,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
267
267
|
const getNativeModuleErrorMessage = stderr => {
|
|
268
268
|
const message = getMessageCodeBlock(stderr);
|
|
269
269
|
return {
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
271
|
+
message: `Incompatible native node module: ${message}`
|
|
272
272
|
};
|
|
273
273
|
};
|
|
274
274
|
const getModuleSyntaxError = () => {
|
|
275
275
|
return {
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
277
|
+
message: `ES Modules are not supported in electron`
|
|
278
278
|
};
|
|
279
279
|
};
|
|
280
280
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -293,8 +293,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
293
293
|
rest
|
|
294
294
|
} = getDetails(lines);
|
|
295
295
|
return {
|
|
296
|
-
message: actualMessage,
|
|
297
296
|
code: '',
|
|
297
|
+
message: actualMessage,
|
|
298
298
|
stack: rest
|
|
299
299
|
};
|
|
300
300
|
};
|
|
@@ -304,8 +304,8 @@ class IpcError extends VError {
|
|
|
304
304
|
if (stdout || stderr) {
|
|
305
305
|
// @ts-ignore
|
|
306
306
|
const {
|
|
307
|
-
message,
|
|
308
307
|
code,
|
|
308
|
+
message,
|
|
309
309
|
stack
|
|
310
310
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
311
311
|
const cause = new Error(message);
|
|
@@ -366,8 +366,8 @@ const wrap$f = global => {
|
|
|
366
366
|
};
|
|
367
367
|
const waitForFirstMessage = async port => {
|
|
368
368
|
const {
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
promise,
|
|
370
|
+
resolve
|
|
371
371
|
} = Promise.withResolvers();
|
|
372
372
|
port.addEventListener('message', resolve, {
|
|
373
373
|
once: true
|
|
@@ -387,8 +387,8 @@ const listen$6 = async () => {
|
|
|
387
387
|
const type = firstMessage.params[0];
|
|
388
388
|
if (type === 'message-port') {
|
|
389
389
|
parentIpc.send({
|
|
390
|
-
jsonrpc: '2.0',
|
|
391
390
|
id: firstMessage.id,
|
|
391
|
+
jsonrpc: '2.0',
|
|
392
392
|
result: null
|
|
393
393
|
});
|
|
394
394
|
parentIpc.dispose();
|
|
@@ -445,8 +445,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
445
445
|
};
|
|
446
446
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
447
447
|
const {
|
|
448
|
-
|
|
449
|
-
|
|
448
|
+
promise,
|
|
449
|
+
resolve
|
|
450
450
|
} = Promise.withResolvers();
|
|
451
451
|
const listenerMap = Object.create(null);
|
|
452
452
|
const cleanup = value => {
|
|
@@ -458,8 +458,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
458
458
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
459
459
|
const listener = event => {
|
|
460
460
|
cleanup({
|
|
461
|
-
|
|
462
|
-
|
|
461
|
+
event,
|
|
462
|
+
type
|
|
463
463
|
});
|
|
464
464
|
};
|
|
465
465
|
addListener(eventEmitter, event, listener);
|
|
@@ -469,8 +469,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
469
469
|
};
|
|
470
470
|
const Message$1 = 3;
|
|
471
471
|
const create$5$1 = async ({
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
isMessagePortOpen,
|
|
473
|
+
messagePort
|
|
474
474
|
}) => {
|
|
475
475
|
if (!isMessagePort(messagePort)) {
|
|
476
476
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -483,8 +483,8 @@ const create$5$1 = async ({
|
|
|
483
483
|
});
|
|
484
484
|
messagePort.start();
|
|
485
485
|
const {
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
event,
|
|
487
|
+
type
|
|
488
488
|
} = await eventPromise;
|
|
489
489
|
if (type !== Message$1) {
|
|
490
490
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -2628,8 +2628,9 @@ const ListItem = 22;
|
|
|
2628
2628
|
const Slash = '/';
|
|
2629
2629
|
|
|
2630
2630
|
// TODO parentUid might ot be needed
|
|
2631
|
-
const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) => {
|
|
2631
|
+
const create = (id, uri, x, y, width, height, args, parentUid, platform = 0, assetDir = '') => {
|
|
2632
2632
|
const state = {
|
|
2633
|
+
assetDir,
|
|
2633
2634
|
confirmDelete: false,
|
|
2634
2635
|
confirmPaste: false,
|
|
2635
2636
|
cutItems: [],
|
|
@@ -2688,8 +2689,8 @@ const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) =>
|
|
|
2688
2689
|
};
|
|
2689
2690
|
|
|
2690
2691
|
// TODO parentUid might ot be needed
|
|
2691
|
-
const create2 = (uid, uri, x, y, width, height, args, parentUid, platform = 0) => {
|
|
2692
|
-
return create(uid, uri, x, y, width, height, args, parentUid, platform);
|
|
2692
|
+
const create2 = (uid, uri, x, y, width, height, args, parentUid, platform = 0, assetDir = '') => {
|
|
2693
|
+
return create(uid, uri, x, y, width, height, args, parentUid, platform, assetDir);
|
|
2693
2694
|
};
|
|
2694
2695
|
|
|
2695
2696
|
const isEqual$6 = (oldState, newState) => {
|
|
@@ -4827,19 +4828,19 @@ const normalizeDecorations = decorations => {
|
|
|
4827
4828
|
return decorations.filter(isValid);
|
|
4828
4829
|
};
|
|
4829
4830
|
|
|
4830
|
-
const getFileDecorations = async (scheme, root, maybeUris, decorationsEnabled) => {
|
|
4831
|
+
const getFileDecorations = async (scheme, root, maybeUris, decorationsEnabled, assetDir, platform) => {
|
|
4831
4832
|
try {
|
|
4832
4833
|
if (!decorationsEnabled) {
|
|
4833
4834
|
return [];
|
|
4834
4835
|
}
|
|
4835
|
-
const providerIds = await invoke$1('SourceControl.getEnabledProviderIds', scheme, root);
|
|
4836
|
+
const providerIds = await invoke$1('SourceControl.getEnabledProviderIds', scheme, root, assetDir, platform);
|
|
4836
4837
|
if (providerIds.length === 0) {
|
|
4837
4838
|
return [];
|
|
4838
4839
|
}
|
|
4839
4840
|
// TODO how to handle multiple providers?
|
|
4840
4841
|
const providerId = providerIds.at(-1);
|
|
4841
4842
|
const uris = ensureUris(maybeUris);
|
|
4842
|
-
const decorations = await invoke$1('SourceControl.getFileDecorations', providerId, uris);
|
|
4843
|
+
const decorations = await invoke$1('SourceControl.getFileDecorations', providerId, uris, assetDir, platform);
|
|
4843
4844
|
const normalized = normalizeDecorations(decorations);
|
|
4844
4845
|
return normalized;
|
|
4845
4846
|
} catch (error) {
|
|
@@ -4986,6 +4987,11 @@ const getSavedRoot = (savedState, workspacePath) => {
|
|
|
4986
4987
|
return workspacePath;
|
|
4987
4988
|
};
|
|
4988
4989
|
const loadContent = async (state, savedState) => {
|
|
4990
|
+
// @ts-ignore
|
|
4991
|
+
const {
|
|
4992
|
+
assetDir,
|
|
4993
|
+
platform
|
|
4994
|
+
} = state;
|
|
4989
4995
|
const {
|
|
4990
4996
|
confirmDelete,
|
|
4991
4997
|
sourceControlDecorations,
|
|
@@ -5006,7 +5012,7 @@ const loadContent = async (state, savedState) => {
|
|
|
5006
5012
|
deltaY = savedState.deltaY;
|
|
5007
5013
|
}
|
|
5008
5014
|
const scheme = getScheme(root);
|
|
5009
|
-
const decorations = await getFileDecorations(scheme, root, restoredDirents.filter(item => item.depth === 1).map(item => item.path), sourceControlDecorations);
|
|
5015
|
+
const decorations = await getFileDecorations(scheme, root, restoredDirents.filter(item => item.depth === 1).map(item => item.path), sourceControlDecorations, assetDir, platform);
|
|
5010
5016
|
return {
|
|
5011
5017
|
...state,
|
|
5012
5018
|
confirmDelete,
|