@lvce-editor/shared-process 0.49.4 → 0.49.6
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.49.
|
|
3
|
+
"version": "0.49.6",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lvce-editor/assert": "1.3.0",
|
|
21
|
-
"@lvce-editor/extension-host-helper-process": "0.49.
|
|
21
|
+
"@lvce-editor/extension-host-helper-process": "0.49.6",
|
|
22
22
|
"@lvce-editor/ipc": "13.7.0",
|
|
23
23
|
"@lvce-editor/json-rpc": "5.4.0",
|
|
24
24
|
"@lvce-editor/jsonc-parser": "1.5.0",
|
|
@@ -2,6 +2,6 @@ import { join } from 'path';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
export const getBuiltinExtensionsPath = () => {
|
|
4
4
|
const staticServerPath = fileURLToPath(import.meta.resolve('@lvce-editor/static-server'));
|
|
5
|
-
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '
|
|
5
|
+
const builtinExtensionsPath = join(staticServerPath, '..', '..', 'static', '327e289', 'extensions');
|
|
6
6
|
return builtinExtensionsPath;
|
|
7
7
|
};
|
|
@@ -8,9 +8,9 @@ import { FileNotFoundError } from '../FileNotFoundError/FileNotFoundError.js';
|
|
|
8
8
|
import * as GetDirentType from '../GetDirentType/GetDirentType.js';
|
|
9
9
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js';
|
|
10
10
|
import * as Trash from '../Trash/Trash.js';
|
|
11
|
+
import * as GetFolderSizeInternal from '../GetFolderSizeInternal/GetFolderSizeInternal.js';
|
|
11
12
|
import { VError } from '../VError/VError.js';
|
|
12
13
|
import { fileURLToPath } from 'node:url';
|
|
13
|
-
import { join } from 'node:path';
|
|
14
14
|
const assertUri = (uri) => {
|
|
15
15
|
if (!uri.startsWith('file://')) {
|
|
16
16
|
throw new Error(`path must be a valid file uri`);
|
|
@@ -246,20 +246,8 @@ export const readJson = async (uri) => {
|
|
|
246
246
|
throw new VError(error, `Failed to read file as json "${uri}"`);
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
const getFolderSizeInternal = async (path) => {
|
|
250
|
-
let total = 0;
|
|
251
|
-
const stats = await fs.stat(path);
|
|
252
|
-
total += stats.size;
|
|
253
|
-
if (stats.isDirectory()) {
|
|
254
|
-
const dirents = await fs.readdir(path);
|
|
255
|
-
for (const dirent of dirents) {
|
|
256
|
-
total += await getFolderSizeInternal(join(path, dirent));
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return total;
|
|
260
|
-
};
|
|
261
249
|
export const getFolderSize = async (uri) => {
|
|
262
250
|
const path = fileURLToPath(uri);
|
|
263
|
-
const total = await getFolderSizeInternal(path);
|
|
251
|
+
const total = await GetFolderSizeInternal.getFolderSizeInternal(path);
|
|
264
252
|
return total;
|
|
265
253
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export const getFolderSizeInternal = async (path) => {
|
|
4
|
+
let total = 0;
|
|
5
|
+
try {
|
|
6
|
+
const stats = await fs.stat(path);
|
|
7
|
+
total += stats.size;
|
|
8
|
+
if (stats.isDirectory() && !stats.isSymbolicLink()) {
|
|
9
|
+
const dirents = await fs.readdir(path);
|
|
10
|
+
for (const dirent of dirents) {
|
|
11
|
+
total += await getFolderSizeInternal(join(path, dirent));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
return total;
|
|
19
|
+
};
|
|
@@ -41,9 +41,9 @@ export const getAppImageName = () => {
|
|
|
41
41
|
export const getSetupName = () => {
|
|
42
42
|
return 'Lvce-Setup';
|
|
43
43
|
};
|
|
44
|
-
export const version = '0.49.
|
|
45
|
-
export const commit = '
|
|
46
|
-
export const date = '2025-04-
|
|
44
|
+
export const version = '0.49.6';
|
|
45
|
+
export const commit = '327e289';
|
|
46
|
+
export const date = '2025-04-04T16:12:32.000Z';
|
|
47
47
|
export const getVersion = () => {
|
|
48
48
|
return version;
|
|
49
49
|
};
|