@lvce-editor/file-system-process 3.1.0 → 3.3.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/index.js +15 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
1
2
|
import * as fs from 'node:fs/promises';
|
|
2
3
|
import * as os from 'node:os';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
4
5
|
import { join } from 'node:path';
|
|
5
|
-
import { existsSync } from 'node:fs';
|
|
6
6
|
import _trash from 'trash';
|
|
7
7
|
import { Buffer } from 'node:buffer';
|
|
8
8
|
|
|
@@ -265,6 +265,8 @@ const ErrorWorker$1 = 3308;
|
|
|
265
265
|
const SyntaxHighlightingWorker$1 = 3309;
|
|
266
266
|
const ClipBoardWorker$1 = 3400;
|
|
267
267
|
const ClipBoardProcess$1 = 3401;
|
|
268
|
+
const ExtensionDetailWorker = 3402;
|
|
269
|
+
const ProblemsWorker = 3403;
|
|
268
270
|
const RpcId = {
|
|
269
271
|
__proto__: null,
|
|
270
272
|
ClipBoardProcess: ClipBoardProcess$1,
|
|
@@ -276,11 +278,13 @@ const RpcId = {
|
|
|
276
278
|
EmbedsProcess: EmbedsProcess$1,
|
|
277
279
|
EmbedsWorker,
|
|
278
280
|
ErrorWorker: ErrorWorker$1,
|
|
281
|
+
ExtensionDetailWorker,
|
|
279
282
|
ExtensionHostWorker,
|
|
280
283
|
FileSystemProcess: FileSystemProcess$1,
|
|
281
284
|
FileSystemWorker: FileSystemWorker$1,
|
|
282
285
|
MainProcess: MainProcess$1,
|
|
283
286
|
MarkdownWorker: MarkdownWorker$1,
|
|
287
|
+
ProblemsWorker,
|
|
284
288
|
RendererProcess: RendererProcess$1,
|
|
285
289
|
RendererWorker: RendererWorker$1,
|
|
286
290
|
SearchProcess: SearchProcess$1,
|
|
@@ -365,7 +369,6 @@ const trash = async path => {
|
|
|
365
369
|
}
|
|
366
370
|
};
|
|
367
371
|
|
|
368
|
-
// TODO lazyload chokidar and trash (but doesn't work currently because of bug with jest)
|
|
369
372
|
const assertUri = uri => {
|
|
370
373
|
if (!uri.startsWith('file://')) {
|
|
371
374
|
throw new Error(`path must be a valid file uri`);
|
|
@@ -475,6 +478,11 @@ const mkdir = async uri => {
|
|
|
475
478
|
throw new VError(error, `Failed to create directory "${uri}"`);
|
|
476
479
|
}
|
|
477
480
|
};
|
|
481
|
+
const exists = async uri => {
|
|
482
|
+
assertUri(uri);
|
|
483
|
+
const path = fileURLToPath(uri);
|
|
484
|
+
return existsSync(path);
|
|
485
|
+
};
|
|
478
486
|
const fallbackRename = async (oldUri, newUri) => {
|
|
479
487
|
try {
|
|
480
488
|
const oldPath = fileURLToPath(oldUri);
|
|
@@ -1611,7 +1619,7 @@ const listen$2 = async (module, options) => {
|
|
|
1611
1619
|
const ipc = module.wrap(rawIpc);
|
|
1612
1620
|
return ipc;
|
|
1613
1621
|
};
|
|
1614
|
-
const create$
|
|
1622
|
+
const create$j = async ({
|
|
1615
1623
|
commandMap,
|
|
1616
1624
|
messagePort,
|
|
1617
1625
|
requiresSocket
|
|
@@ -1630,9 +1638,9 @@ const create$g = async ({
|
|
|
1630
1638
|
};
|
|
1631
1639
|
const ElectronMessagePortRpcClient = {
|
|
1632
1640
|
__proto__: null,
|
|
1633
|
-
create: create$
|
|
1641
|
+
create: create$j
|
|
1634
1642
|
};
|
|
1635
|
-
const create$
|
|
1643
|
+
const create$i = async ({
|
|
1636
1644
|
commandMap
|
|
1637
1645
|
}) => {
|
|
1638
1646
|
// TODO create a commandMap per rpc instance
|
|
@@ -1644,7 +1652,7 @@ const create$f = async ({
|
|
|
1644
1652
|
};
|
|
1645
1653
|
const ElectronUtilityProcessRpcClient = {
|
|
1646
1654
|
__proto__: null,
|
|
1647
|
-
create: create$
|
|
1655
|
+
create: create$i
|
|
1648
1656
|
};
|
|
1649
1657
|
const create$9 = async ({
|
|
1650
1658
|
commandMap
|
|
@@ -1836,6 +1844,7 @@ const initialize = async () => {
|
|
|
1836
1844
|
const commandMap = {
|
|
1837
1845
|
'FileSystem.chmod': chmod,
|
|
1838
1846
|
'FileSystem.copy': copy,
|
|
1847
|
+
'FileSystem.exists': exists,
|
|
1839
1848
|
'FileSystem.getFolderSize': getFolderSize,
|
|
1840
1849
|
'FileSystem.getPathSeparator': getPathSeparator,
|
|
1841
1850
|
'FileSystem.mkdir': mkdir,
|