@lvce-editor/shared-process 0.0.32 → 0.0.35
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 +12 -0
- package/config/defaultKeyBindings.json +8 -0
- package/package.json +11 -3
- package/src/parts/Command/Command.js +17 -15
- package/src/parts/Electron/Electron.js +3 -2
- package/src/parts/ExtensionManagement/ExtensionManagement.js +1 -0
- package/src/parts/FileSystem/FileSystem.ipc.js +1 -0
- package/src/parts/FileSystem/FileSystem.js +5 -1
- package/src/parts/Platform/Platform.ipc.js +11 -8
- package/src/parts/Platform/Platform.js +21 -0
|
@@ -272,10 +272,22 @@
|
|
|
272
272
|
"label": "Editor: Unindent",
|
|
273
273
|
"aliases": ["Indent Less", "DeIndent"]
|
|
274
274
|
},
|
|
275
|
+
{
|
|
276
|
+
"id": "Editor.sortLinesAscending",
|
|
277
|
+
"label": "Editor: Sort Lines Ascending"
|
|
278
|
+
},
|
|
275
279
|
{
|
|
276
280
|
"id": "Editor.toggleComment",
|
|
277
281
|
"label": "Editor: Toggle Comment"
|
|
278
282
|
},
|
|
283
|
+
{
|
|
284
|
+
"id": "Editor.selectUp",
|
|
285
|
+
"label": "Editor: Select Up"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"id": "Editor.selectDown",
|
|
289
|
+
"label": "Editor: Select Down"
|
|
290
|
+
},
|
|
279
291
|
{
|
|
280
292
|
"id": "Editor.toggleBlockComment",
|
|
281
293
|
"label": "Editor: Toggle Block Comment"
|
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.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"keywords": [],
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/lvce-editor/lvce-editor.git",
|
|
17
|
+
"directory": "packages/shared-process"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=16"
|
|
21
|
+
},
|
|
14
22
|
"dependencies": {
|
|
15
23
|
"chokidar": "^3.5.3",
|
|
16
24
|
"debug": "^4.3.4",
|
|
@@ -30,8 +38,8 @@
|
|
|
30
38
|
"verror": "^1.10.1",
|
|
31
39
|
"ws": "^8.8.1",
|
|
32
40
|
"xdg-basedir": "^5.1.0",
|
|
33
|
-
"@lvce-editor/pty-host": "0.0.
|
|
34
|
-
"@lvce-editor/extension-host": "0.0.
|
|
41
|
+
"@lvce-editor/pty-host": "0.0.35",
|
|
42
|
+
"@lvce-editor/extension-host": "0.0.35"
|
|
35
43
|
},
|
|
36
44
|
"optionalDependencies": {
|
|
37
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':
|
|
@@ -178,19 +179,20 @@ const getModuleId = (commandId) => {
|
|
|
178
179
|
return MODULE_EXTENSION_MANAGEMENT
|
|
179
180
|
case 'Search.search':
|
|
180
181
|
return MODULE_SEARCH
|
|
181
|
-
case 'Platform.getConfigDir':
|
|
182
182
|
case 'Platform.getAppDir':
|
|
183
|
-
case 'Platform.getHomeDir':
|
|
184
|
-
case 'Platform.getDataDir':
|
|
185
|
-
case 'Platform.getExtensionsPath':
|
|
186
183
|
case 'Platform.getBuiltinExtensionsPath':
|
|
187
|
-
case 'Platform.getDisabledExtensionsPath':
|
|
188
184
|
case 'Platform.getCachedExtensionsPath':
|
|
189
|
-
case 'Platform.
|
|
185
|
+
case 'Platform.getCacheDir':
|
|
186
|
+
case 'Platform.getConfigDir':
|
|
187
|
+
case 'Platform.getDataDir':
|
|
188
|
+
case 'Platform.getDisabledExtensionsPath':
|
|
189
|
+
case 'Platform.getExtensionsPath':
|
|
190
|
+
case 'Platform.getHomeDir':
|
|
190
191
|
case 'Platform.getLogsDir':
|
|
191
|
-
case 'Platform.
|
|
192
|
+
case 'Platform.getMarketplaceUrl':
|
|
192
193
|
case 'Platform.getRecentlyOpenedPath':
|
|
193
|
-
case 'Platform.
|
|
194
|
+
case 'Platform.getTestPath':
|
|
195
|
+
case 'Platform.getUserSettingsPath':
|
|
194
196
|
case 'Platform.setEnvironmentVariables':
|
|
195
197
|
return MODULE_PLATFORM
|
|
196
198
|
case 'Terminal.create':
|
|
@@ -65,9 +65,10 @@ export const about = async () => {
|
|
|
65
65
|
await invoke(/* About.open */ 'About.open')
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export const showOpenDialog = async () => {
|
|
68
|
+
export const showOpenDialog = async (title) => {
|
|
69
69
|
const result = await invoke(
|
|
70
|
-
/* Dialog.showOpenDialog */ 'Dialog.showOpenDialog'
|
|
70
|
+
/* Dialog.showOpenDialog */ 'Dialog.showOpenDialog',
|
|
71
|
+
/* title */ title
|
|
71
72
|
)
|
|
72
73
|
return result
|
|
73
74
|
}
|
|
@@ -26,6 +26,7 @@ export const state = {
|
|
|
26
26
|
const onlyExtension = await getExtensionManifests([absolutePath])
|
|
27
27
|
return [...builtinExtensions.filter(isLanguageBasics), ...onlyExtension]
|
|
28
28
|
}
|
|
29
|
+
|
|
29
30
|
const installedExtensions = await getInstalledExtensions()
|
|
30
31
|
return [...builtinExtensions, ...installedExtensions]
|
|
31
32
|
},
|
|
@@ -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,18 +2,21 @@ 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.
|
|
18
|
+
'Platform.getTestPath': Platform.getTestPath,
|
|
19
|
+
'Platform.getTmpDir': Platform.getTmpDir,
|
|
20
|
+
'Platform.getUserSettingsPath': Platform.getUserSettingsPath,
|
|
18
21
|
'Platform.setEnvironmentVariables': Platform.setEnvironmentVariables,
|
|
19
22
|
}
|
|
@@ -4,6 +4,7 @@ import { extensionHostPath } from '@lvce-editor/extension-host'
|
|
|
4
4
|
import { xdgCache, xdgConfig, xdgData, xdgState } from 'xdg-basedir'
|
|
5
5
|
import * as Path from '../Path/Path.js'
|
|
6
6
|
import * as Root from '../Root/Root.js'
|
|
7
|
+
import { pathToFileURL } from 'node:url'
|
|
7
8
|
|
|
8
9
|
export const getApplicationName = () => {
|
|
9
10
|
return 'lvce-oss'
|
|
@@ -117,3 +118,23 @@ export const setEnvironmentVariables = (variables) => {
|
|
|
117
118
|
process.env[key] = value
|
|
118
119
|
}
|
|
119
120
|
}
|
|
121
|
+
|
|
122
|
+
export const getTestPath = () => {
|
|
123
|
+
if (process.env.TEST_PATH) {
|
|
124
|
+
const testPath =
|
|
125
|
+
'/remote' +
|
|
126
|
+
pathToFileURL(Path.join(process.cwd(), process.env.TEST_PATH))
|
|
127
|
+
.toString()
|
|
128
|
+
.slice(7)
|
|
129
|
+
return testPath
|
|
130
|
+
}
|
|
131
|
+
return '/packages/extension-host-worker-tests'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const getNodePath = () => {
|
|
135
|
+
return process.argv[0]
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const getTmpDir = () => {
|
|
139
|
+
return tmpdir()
|
|
140
|
+
}
|