@lvce-editor/shared-process 0.0.33 → 0.0.34
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/config/builtinCommands.json +4 -0
- package/config/defaultKeyBindings.json +4 -0
- package/package.json +3 -3
- package/src/parts/Command/Command.js +8 -7
- package/src/parts/FileSystem/FileSystem.ipc.js +1 -0
- package/src/parts/FileSystem/FileSystem.js +5 -1
- package/src/parts/Platform/Platform.ipc.js +10 -9
- package/src/parts/Platform/Platform.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/shared-process",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"verror": "^1.10.1",
|
|
39
39
|
"ws": "^8.8.1",
|
|
40
40
|
"xdg-basedir": "^5.1.0",
|
|
41
|
-
"@lvce-editor/pty-host": "0.0.
|
|
42
|
-
"@lvce-editor/extension-host": "0.0.
|
|
41
|
+
"@lvce-editor/pty-host": "0.0.34",
|
|
42
|
+
"@lvce-editor/extension-host": "0.0.34"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
45
|
"electron-clipboard-ex": "^1.3.3",
|
|
@@ -88,17 +88,18 @@ const getOrLoadModule = (moduleId) => {
|
|
|
88
88
|
|
|
89
89
|
const getModuleId = (commandId) => {
|
|
90
90
|
switch (commandId) {
|
|
91
|
-
case 'FileSystem.
|
|
92
|
-
case 'FileSystem.
|
|
93
|
-
case 'FileSystem.readDirWithFileTypes':
|
|
94
|
-
case 'FileSystem.remove':
|
|
95
|
-
case 'FileSystem.mkdir':
|
|
91
|
+
case 'FileSystem.chmod':
|
|
92
|
+
case 'FileSystem.copy':
|
|
96
93
|
case 'FileSystem.createFile':
|
|
97
94
|
case 'FileSystem.createFolder':
|
|
98
|
-
case 'FileSystem.rename':
|
|
99
95
|
case 'FileSystem.ensureFile':
|
|
100
|
-
case 'FileSystem.copy':
|
|
101
96
|
case 'FileSystem.getPathSeparator':
|
|
97
|
+
case 'FileSystem.mkdir':
|
|
98
|
+
case 'FileSystem.readDirWithFileTypes':
|
|
99
|
+
case 'FileSystem.readFile':
|
|
100
|
+
case 'FileSystem.remove':
|
|
101
|
+
case 'FileSystem.rename':
|
|
102
|
+
case 'FileSystem.writeFile':
|
|
102
103
|
return MODULE_FILE_SYSTEM
|
|
103
104
|
case 'Workspace.resolveRoot':
|
|
104
105
|
case 'Workspace.getHomeDir':
|
|
@@ -15,6 +15,7 @@ const fileSystemWatch = (socket, id, path) => {
|
|
|
15
15
|
|
|
16
16
|
// TODO separate ipc from code like in renderer worker
|
|
17
17
|
export const Commands = {
|
|
18
|
+
'FileSystem.chmod': FileSystem.chmod,
|
|
18
19
|
'FileSystem.copy': FileSystem.copy,
|
|
19
20
|
'FileSystem.createFile': FileSystem.createFile,
|
|
20
21
|
'FileSystem.createFolder': FileSystem.createFolder,
|
|
@@ -260,13 +260,17 @@ export const getRealPath = async (path) => {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
// TODO handle error
|
|
263
264
|
export const stat = async (path) => {
|
|
264
265
|
const stats = await fs.stat(path)
|
|
265
266
|
const type = getType(stats)
|
|
266
267
|
return type
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
|
|
270
|
+
export const chmod = async (path, permissions) => {
|
|
271
|
+
await fs.chmod(path, permissions)
|
|
272
|
+
}
|
|
273
|
+
|
|
270
274
|
// export const unwatch = (id) => {
|
|
271
275
|
// state.watchers[id].close()
|
|
272
276
|
// delete state.watchers[id]
|
|
@@ -2,19 +2,20 @@ import * as Platform from '../Platform/Platform.js'
|
|
|
2
2
|
|
|
3
3
|
// prettier-ignore
|
|
4
4
|
export const Commands = {
|
|
5
|
-
'Platform.getConfigDir': Platform.getConfigDir,
|
|
6
5
|
'Platform.getAppDir': Platform.getAppDir,
|
|
7
|
-
'Platform.getHomeDir': Platform.getHomeDir,
|
|
8
|
-
'Platform.getDataDir': Platform.getDataDir,
|
|
9
|
-
'Platform.getExtensionsPath': Platform.getExtensionsPath,
|
|
10
6
|
'Platform.getBuiltinExtensionsPath': Platform.getBuiltinExtensionsPath,
|
|
11
|
-
'Platform.getDisabledExtensionsPath': Platform.getDisabledExtensionsPath,
|
|
12
7
|
'Platform.getCachedExtensionsPath': Platform.getCachedExtensionsPath,
|
|
13
|
-
'Platform.
|
|
8
|
+
'Platform.getCacheDir': Platform.getCacheDir,
|
|
9
|
+
'Platform.getConfigDir': Platform.getConfigDir,
|
|
10
|
+
'Platform.getDataDir': Platform.getDataDir,
|
|
11
|
+
'Platform.getDisabledExtensionsPath': Platform.getDisabledExtensionsPath,
|
|
12
|
+
'Platform.getExtensionsPath': Platform.getExtensionsPath,
|
|
13
|
+
'Platform.getHomeDir': Platform.getHomeDir,
|
|
14
14
|
'Platform.getLogsDir': Platform.getLogsDir,
|
|
15
|
-
'Platform.
|
|
15
|
+
'Platform.getMarketplaceUrl': Platform.getMarketplaceUrl,
|
|
16
|
+
'Platform.getNodePath': Platform.getNodePath,
|
|
16
17
|
'Platform.getRecentlyOpenedPath': Platform.getRecentlyOpenedPath,
|
|
17
|
-
'Platform.getCacheDir': Platform.getCacheDir,
|
|
18
|
-
'Platform.setEnvironmentVariables': Platform.setEnvironmentVariables,
|
|
19
18
|
'Platform.getTestPath': Platform.getTestPath,
|
|
19
|
+
'Platform.getUserSettingsPath': Platform.getUserSettingsPath,
|
|
20
|
+
'Platform.setEnvironmentVariables': Platform.setEnvironmentVariables,
|
|
20
21
|
}
|