@lvce-editor/shared-process 0.86.4 → 0.86.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/index.js +2 -2
- package/package.json +6 -6
- package/src/parts/AppWindow/AppWindow.js +5 -5
- package/src/parts/ApplyEdit/ApplyEdit.js +1 -1
- package/src/parts/ApplyIncomingIpcResponse/ApplyIncomingIpcResponse.js +13 -8
- package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.js +2 -2
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +1 -1
- package/src/parts/CliModule/CliModule.js +2 -2
- package/src/parts/ColorTheme/ColorTheme.js +1 -1
- package/src/parts/Command/Command.js +1 -1
- package/src/parts/Crash/Crash.js +1 -1
- package/src/parts/CreateTestOverviewHtml/CreateTestOverviewHtml.js +3 -1
- package/src/parts/DefaultUrl/DefaultUrl.js +1 -1
- package/src/parts/DownloadAndExtract/DownloadAndExtract.js +2 -2
- package/src/parts/ElectronInitialize/ElectronInitialize.js +1 -1
- package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.js +4 -4
- package/src/parts/ErrorHandling/ErrorHandling.js +1 -1
- package/src/parts/ExecCommand/ExecCommand.js +2 -2
- package/src/parts/ExportStatic/ExportStatic.js +35 -32
- package/src/parts/ExtensionHostHelperProcessIpc/ExtensionHostHelperProcessIpc.js +3 -3
- package/src/parts/ExtensionHostRpc/ExtensionHostRpc.js +4 -4
- package/src/parts/ExtensionInstall/ExtensionInstall.js +2 -2
- package/src/parts/ExtensionInstallFromGitHub/ExtensionInstallFromGitHub.js +2 -2
- package/src/parts/ExtensionInstallFromUrl/ExtensionInstallFromUrl.js +1 -1
- package/src/parts/ExtensionInstallParseInput/ExtensionInstallParseInput.js +5 -5
- package/src/parts/ExtensionList/ExtensionList.js +7 -7
- package/src/parts/ExtensionManagement/ExtensionManagement.ipc.js +3 -3
- package/src/parts/ExtensionManagement/ExtensionManagement.js +13 -13
- package/src/parts/ExtensionManifest/ExtensionManifest.js +3 -3
- package/src/parts/ExtensionManifests/ExtensionManifests.js +2 -2
- package/src/parts/ExtensionManifests/ExtensionManifestsFromFolder.js +1 -1
- package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtensionsFolder.js +1 -1
- package/src/parts/FileSystem/FileSystem.ipc.js +1 -1
- package/src/parts/FileSystem/FileSystem.js +2 -2
- package/src/parts/FileSystemDisk/FileSystemDisk.ipc.js +1 -1
- package/src/parts/FileSystemDisk/FileSystemDisk.js +3 -3
- package/src/parts/FileSystemProcess/FileSystemProcess.js +1 -1
- package/src/parts/FileWatcher/FileWatcher.ipc.js +1 -1
- package/src/parts/FileWatcher/FileWatcher.js +2 -2
- package/src/parts/GetAppWindowOptions/GetAppWindowOptions.js +9 -9
- package/src/parts/GetBrowserWindowOptions/GetBrowserWindowOptions.js +14 -14
- package/src/parts/GetContentResponse/GetContentResponse.js +1 -1
- package/src/parts/GetContentSecurityPolicy/GetContentSecurityPolicy.js +1 -1
- package/src/parts/GetExtensionEtags/GetExtensionEtags.js +1 -1
- package/src/parts/GetFirstEvent/GetFirstEvent.js +2 -2
- package/src/parts/GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js +1 -1
- package/src/parts/GetHeaders/GetHeaders.js +4 -4
- package/src/parts/GetMimeType/GetMimeType.js +10 -10
- package/src/parts/GetMultipleChoiceResponse/GetMultipleChoiceResponse.js +1 -1
- package/src/parts/GetNotFoundResponse/GetNotFoundResponse.js +1 -1
- package/src/parts/GetNotModifiedResponse/GetNotModifiedResponse.js +1 -1
- package/src/parts/GetServerErrorResponse/GetServerErrorResponse.js +1 -1
- package/src/parts/GetStatusString/GetStatusString.js +5 -5
- package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.js +3 -3
- package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +7 -7
- package/src/parts/GetTitleBarItems/GetTitleBarItems.js +4 -4
- package/src/parts/GetTransferrables/GetTransferrables.js +1 -1
- package/src/parts/GetWebViewsFromExtensions/GetWebViewsFromExtensions.js +2 -2
- package/src/parts/GitLsFiles/GitLsFiles.js +2 -2
- package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.js +1 -1
- package/src/parts/HandleElectronReady/HandleElectronReady.js +1 -1
- package/src/parts/HandleIncomingIpc/HandleIncomingIpc.js +8 -8
- package/src/parts/HandleIncomingIpcMessagePort/HandleIncomingIpcMessagePort.js +1 -1
- package/src/parts/HandleIncomingIpcWebSocket/HandleIncomingIpcWebSocket.js +1 -1
- package/src/parts/HandleIpcAuthProcess/HandleIpcAuthProcess.js +1 -1
- package/src/parts/HandleIpcClipBoardProcess/HandleIpcClipBoardProcess.js +2 -2
- package/src/parts/HandleIpcEmbedsProcess/HandleIpcEmbedsProcess.js +1 -1
- package/src/parts/HandleIpcExtensionHostHelperProcess/HandleIpcExtensionHostHelperProcess.js +2 -2
- package/src/parts/HandleIpcFileSystemProcess/HandleIpcFileSystemProcess.js +2 -2
- package/src/parts/HandleIpcFileWatcher/HandleIpcFileWatcher.js +3 -3
- package/src/parts/HandleIpcModule/HandleIpcModule.js +8 -8
- package/src/parts/HandleIpcProcessExplorer/HandleIpcProcessExplorer.js +3 -3
- package/src/parts/HandleIpcSearchProcess/HandleIpcSearchProcess.js +2 -2
- package/src/parts/HandleIpcSharedProcess/HandleIpcSharedProcess.js +2 -2
- package/src/parts/HandleIpcTerminalProcess/HandleIpcTerminalProcess.js +3 -3
- package/src/parts/HandleMessagePortForAuthProcess/HandleMessagePortForAuthProcess.ipc.js +1 -1
- package/src/parts/HandleMessagePortForEmbedsProcess/HandleMessagePortForEmbedsProcess.ipc.js +1 -1
- package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.js +1 -1
- package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.js +1 -1
- package/src/parts/HandleWebSocket/HandleWebSocket.js +1 -1
- package/src/parts/HandleWebSocketForUnknown/HandleWebSocketForUnknown.js +1 -1
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +8 -8
- package/src/parts/HeapSnapshot/HeapSnapshot.js +1 -1
- package/src/parts/IpcChildModule/IpcChildModule.js +6 -6
- package/src/parts/IpcChildWithNodeMessagePort/IpcChildWithNodeMessagePort.js +6 -6
- package/src/parts/IpcParentModule/IpcParentModule.js +4 -4
- package/src/parts/IpcParentWithElectronUtilityProcess/IpcParentWithElectronUtilityProcess.js +22 -22
- package/src/parts/Json/Json.js +1 -1
- package/src/parts/LaunchAuthProcess/LaunchAuthProcess.js +2 -2
- package/src/parts/LaunchClipBoardProcess/LaunchClipBoardProcess.js +2 -2
- package/src/parts/LaunchEmbedsProcess/LaunchEmbedsProcess.js +2 -2
- package/src/parts/LaunchFileSystemProcess/LaunchFileSystemProcess.js +2 -2
- package/src/parts/LaunchFileWatcherProcess/LaunchFileWatcherProcess.js +2 -2
- package/src/parts/LaunchPreviewProcess/LaunchPreviewProcess.js +2 -2
- package/src/parts/LaunchProcess/LaunchProcess.js +4 -4
- package/src/parts/LaunchProcessExplorer/LaunchProcessExplorer.js +1 -1
- package/src/parts/LaunchSearchProcess/LaunchSearchProcess.js +1 -1
- package/src/parts/LaunchTypeScriptCompileProcess/LaunchTypeScriptCompileProcess.js +6 -6
- package/src/parts/Main/Main.js +1 -1
- package/src/parts/Module/Module.js +56 -56
- package/src/parts/ModuleMap/ModuleMap.js +107 -107
- package/src/parts/NetworkProcess/NetworkProcess.js +1 -1
- package/src/parts/OutputChannel/OutputChannel.js +1 -1
- package/src/parts/ParseUrlGithub/ParseUrlGithub.js +9 -9
- package/src/parts/Performance/Performance.js +15 -15
- package/src/parts/Platform/Platform.js +3 -3
- package/src/parts/PlatformPaths/PlatformPaths.ipc.js +1 -1
- package/src/parts/PreloadUrl/PreloadUrl.js +1 -1
- package/src/parts/Process/Process.js +1 -1
- package/src/parts/Promises/Promises.js +2 -2
- package/src/parts/PtyHostState/PtyHostState.js +4 -4
- package/src/parts/Queue/Queue.js +2 -2
- package/src/parts/ResolveRoot/ResolveRoot.js +12 -12
- package/src/parts/Restart/Restart.js +1 -1
- package/src/parts/Screen/Screen.ipc.js +1 -1
- package/src/parts/SearchProcess/SearchProcess.js +1 -1
- package/src/parts/SendIncomingIpc/SendIncomingIpc.js +2 -2
- package/src/parts/TemporaryMessagePort/TemporaryMessagePort.js +1 -1
- package/src/parts/Terminal/Terminal.js +3 -3
- package/src/parts/TextDocument/TextDocument.js +1 -1
- package/src/parts/TranspileTypeScript/TranspileTypeScript.js +1 -1
- package/src/parts/TranspileTypeScriptCached/TranspileTypeScriptCached.js +1 -1
- package/src/parts/WaitForProcessToExit/WaitForProcessToExit.js +1 -1
- package/src/parts/WebViewServer/WebViewServer.ipc.js +2 -2
- package/src/parts/Workspace/Workspace.js +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { basename } from 'node:path'
|
|
2
|
+
import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js'
|
|
2
3
|
import * as ExtensionManifestInputType from '../ExtensionManifestInputType/ExtensionManifestInputType.js'
|
|
3
|
-
import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
|
|
4
4
|
import * as ExtensionManifests from '../ExtensionManifests/ExtensionManifests.js'
|
|
5
|
+
import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
|
|
5
6
|
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
7
|
import * as TransientLinkedExtensions from '../TransientLinkedExtensions/TransientLinkedExtensions.js'
|
|
7
|
-
import * as BuiltinExtensionsPath from '../BuiltinExtensionsPath/BuiltinExtensionsPath.js'
|
|
8
8
|
import { VError } from '../VError/VError.js'
|
|
9
9
|
|
|
10
10
|
const getManifestVersion = (json) => {
|
|
@@ -34,8 +34,8 @@ const getManifestInfo = (json) => {
|
|
|
34
34
|
const symlink = getSymlink(json)
|
|
35
35
|
return {
|
|
36
36
|
id,
|
|
37
|
-
version,
|
|
38
37
|
symlink,
|
|
38
|
+
version,
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -52,23 +52,23 @@ export const list = async () => {
|
|
|
52
52
|
try {
|
|
53
53
|
const transientLinkedExtensions = TransientLinkedExtensions.getLinkedExtensions().map((link) => {
|
|
54
54
|
return {
|
|
55
|
-
type: ExtensionManifestInputType.LinkedExtension,
|
|
56
55
|
path: link.resolvedPath,
|
|
56
|
+
type: ExtensionManifestInputType.LinkedExtension,
|
|
57
57
|
}
|
|
58
58
|
})
|
|
59
59
|
const manifests = await ExtensionManifests.getAll([
|
|
60
60
|
...transientLinkedExtensions,
|
|
61
61
|
{
|
|
62
|
-
type: ExtensionManifestInputType.LinkedExtensionsFolder,
|
|
63
62
|
path: PlatformPaths.getLinkedExtensionsPath(),
|
|
63
|
+
type: ExtensionManifestInputType.LinkedExtensionsFolder,
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
type: ExtensionManifestInputType.Folder,
|
|
67
66
|
path: PlatformPaths.getExtensionsPath(),
|
|
67
|
+
type: ExtensionManifestInputType.Folder,
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
type: ExtensionManifestInputType.Folder,
|
|
71
70
|
path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
71
|
+
type: ExtensionManifestInputType.Folder,
|
|
72
72
|
},
|
|
73
73
|
])
|
|
74
74
|
const infos = getManifestInfos(manifests)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as ExtensionHostIconTheme from '../ExtensionManagement/ExtensionManagementIconTheme.js'
|
|
2
|
+
import * as WatchForHotReload from '../WatchForHotReload/WatchForHotReload.js'
|
|
2
3
|
import * as ExtensionManagement from './ExtensionManagement.js'
|
|
3
4
|
import * as ExtensionHostColorTheme from './ExtensionManagementColorTheme.js'
|
|
4
5
|
import * as ExtensionHostLanguages from './ExtensionManagementLanguages.js'
|
|
5
|
-
import * as WatchForHotReload from '../WatchForHotReload/WatchForHotReload.js'
|
|
6
6
|
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const Commands = {
|
|
@@ -13,11 +13,11 @@ export const Commands = {
|
|
|
13
13
|
'ExtensionHost.getLanguages': ExtensionHostLanguages.getLanguages,
|
|
14
14
|
'ExtensionHost.getWebViews': ExtensionHostLanguages.getWebViews,
|
|
15
15
|
'ExtensionHost.watchColorTheme': ExtensionHostColorTheme.watch,
|
|
16
|
+
'ExtensionHost.watchForHotReload': WatchForHotReload.watchForHotReload,
|
|
16
17
|
'ExtensionManagement.disable': ExtensionManagement.disable,
|
|
17
18
|
'ExtensionManagement.enable': ExtensionManagement.enable,
|
|
18
19
|
'ExtensionManagement.getAllExtensions': ExtensionManagement.getExtensions,
|
|
19
20
|
'ExtensionManagement.getExtensions': ExtensionManagement.getExtensions,
|
|
20
|
-
'ExtensionManagement.uninstall': ExtensionManagement.uninstall,
|
|
21
21
|
'ExtensionManagement.getExtensionsEtag': ExtensionManagement.getExtensionsEtag,
|
|
22
|
-
'
|
|
22
|
+
'ExtensionManagement.uninstall': ExtensionManagement.uninstall,
|
|
23
23
|
}
|
|
@@ -75,8 +75,8 @@ export const getBuiltinExtensions = () => {
|
|
|
75
75
|
return ExtensionManifests.getAll(
|
|
76
76
|
[
|
|
77
77
|
{
|
|
78
|
-
type: ExtensionManifestInputType.Folder,
|
|
79
78
|
path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
79
|
+
type: ExtensionManifestInputType.Folder,
|
|
80
80
|
},
|
|
81
81
|
],
|
|
82
82
|
BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
@@ -87,8 +87,8 @@ export const getInstalledExtensions = () => {
|
|
|
87
87
|
return ExtensionManifests.getAll(
|
|
88
88
|
[
|
|
89
89
|
{
|
|
90
|
-
type: ExtensionManifestInputType.Folder,
|
|
91
90
|
path: PlatformPaths.getExtensionsPath(),
|
|
91
|
+
type: ExtensionManifestInputType.Folder,
|
|
92
92
|
},
|
|
93
93
|
],
|
|
94
94
|
BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
@@ -98,28 +98,28 @@ export const getInstalledExtensions = () => {
|
|
|
98
98
|
export const getExtensions = () => {
|
|
99
99
|
const transientLinkedExtensions = TransientLinkedExtensions.getLinkedExtensions().map((link) => {
|
|
100
100
|
return {
|
|
101
|
-
type: ExtensionManifestInputType.LinkedExtension,
|
|
102
101
|
path: link.resolvedPath,
|
|
102
|
+
type: ExtensionManifestInputType.LinkedExtension,
|
|
103
103
|
}
|
|
104
104
|
})
|
|
105
105
|
return ExtensionManifests.getAll(
|
|
106
106
|
[
|
|
107
107
|
{
|
|
108
|
-
type: ExtensionManifestInputType.OnlyExtension,
|
|
109
108
|
path: PlatformPaths.getOnlyExtensionPath(),
|
|
109
|
+
type: ExtensionManifestInputType.OnlyExtension,
|
|
110
110
|
},
|
|
111
111
|
...transientLinkedExtensions,
|
|
112
112
|
{
|
|
113
|
-
type: ExtensionManifestInputType.Folder,
|
|
114
113
|
path: PlatformPaths.getLinkedExtensionsPath(),
|
|
114
|
+
type: ExtensionManifestInputType.Folder,
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
type: ExtensionManifestInputType.Folder,
|
|
118
117
|
path: PlatformPaths.getExtensionsPath(),
|
|
118
|
+
type: ExtensionManifestInputType.Folder,
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
type: ExtensionManifestInputType.Folder,
|
|
122
121
|
path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
122
|
+
type: ExtensionManifestInputType.Folder,
|
|
123
123
|
},
|
|
124
124
|
],
|
|
125
125
|
BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
@@ -129,27 +129,27 @@ export const getExtensions = () => {
|
|
|
129
129
|
export const getExtensionsEtag = async () => {
|
|
130
130
|
const transientLinkedExtensions = TransientLinkedExtensions.getLinkedExtensions().map((link) => {
|
|
131
131
|
return {
|
|
132
|
-
type: ExtensionManifestInputType.LinkedExtension,
|
|
133
132
|
path: link.resolvedPath,
|
|
133
|
+
type: ExtensionManifestInputType.LinkedExtension,
|
|
134
134
|
}
|
|
135
135
|
})
|
|
136
136
|
const stats = await GetExtensionEtags.getExtensionEtags([
|
|
137
137
|
{
|
|
138
|
-
type: ExtensionManifestInputType.OnlyExtension,
|
|
139
138
|
path: PlatformPaths.getOnlyExtensionPath(),
|
|
139
|
+
type: ExtensionManifestInputType.OnlyExtension,
|
|
140
140
|
},
|
|
141
141
|
...transientLinkedExtensions,
|
|
142
142
|
{
|
|
143
|
-
type: ExtensionManifestInputType.Folder,
|
|
144
143
|
path: PlatformPaths.getLinkedExtensionsPath(),
|
|
144
|
+
type: ExtensionManifestInputType.Folder,
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
type: ExtensionManifestInputType.Folder,
|
|
148
147
|
path: PlatformPaths.getExtensionsPath(),
|
|
148
|
+
type: ExtensionManifestInputType.Folder,
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
|
-
type: ExtensionManifestInputType.Folder,
|
|
152
151
|
path: BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
152
|
+
type: ExtensionManifestInputType.Folder,
|
|
153
153
|
},
|
|
154
154
|
])
|
|
155
155
|
const etag = GetEtagFromStats.getEtagFromStats(stats)
|
|
@@ -160,8 +160,8 @@ export const getDisabledExtensions = () => {
|
|
|
160
160
|
return ExtensionManifests.getAll(
|
|
161
161
|
[
|
|
162
162
|
{
|
|
163
|
-
type: ExtensionManifestInputType.Folder,
|
|
164
163
|
path: PlatformPaths.getDisabledExtensionsPath(),
|
|
164
|
+
type: ExtensionManifestInputType.Folder,
|
|
165
165
|
},
|
|
166
166
|
],
|
|
167
167
|
BuiltinExtensionsPath.getBuiltinExtensionsPath(),
|
|
@@ -21,8 +21,8 @@ export const get = async (path) => {
|
|
|
21
21
|
return {
|
|
22
22
|
...json,
|
|
23
23
|
path,
|
|
24
|
-
uri,
|
|
25
24
|
status: ExtensionManifestStatus.Resolved,
|
|
25
|
+
uri,
|
|
26
26
|
}
|
|
27
27
|
} catch (error) {
|
|
28
28
|
const id = InferExtensionId.inferExtensionId(path)
|
|
@@ -40,8 +40,8 @@ export const get = async (path) => {
|
|
|
40
40
|
return {
|
|
41
41
|
...json,
|
|
42
42
|
path: extensionPath,
|
|
43
|
-
uri,
|
|
44
43
|
status: ExtensionManifestStatus.Resolved,
|
|
44
|
+
uri,
|
|
45
45
|
}
|
|
46
46
|
} catch {}
|
|
47
47
|
// @ts-ignore
|
|
@@ -54,8 +54,8 @@ export const get = async (path) => {
|
|
|
54
54
|
}
|
|
55
55
|
return {
|
|
56
56
|
path,
|
|
57
|
-
status: ExtensionManifestStatus.Rejected,
|
|
58
57
|
reason: enhancedError,
|
|
58
|
+
status: ExtensionManifestStatus.Rejected,
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -10,12 +10,12 @@ const getModule = (type) => {
|
|
|
10
10
|
switch (type) {
|
|
11
11
|
case ExtensionManifestInputType.Folder:
|
|
12
12
|
return ExtensionManifestsGetFromFolder
|
|
13
|
-
case ExtensionManifestInputType.OnlyExtension:
|
|
14
|
-
return ExtensionManifestsGetFromOnlyExtension
|
|
15
13
|
case ExtensionManifestInputType.LinkedExtension:
|
|
16
14
|
return ExtensionManifestsGetFromLinkedExtension
|
|
17
15
|
case ExtensionManifestInputType.LinkedExtensionsFolder:
|
|
18
16
|
return ExtensionManifestsGetFromLinkedExtensionsFolder
|
|
17
|
+
case ExtensionManifestInputType.OnlyExtension:
|
|
18
|
+
return ExtensionManifestsGetFromOnlyExtension
|
|
19
19
|
default:
|
|
20
20
|
throw new Error('unsupported input type')
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
2
1
|
import * as DirentType from '../DirentType/DirentType.js'
|
|
2
|
+
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
3
3
|
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
4
4
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
5
5
|
import * as ToAbsolutePaths from '../ToAbsolutePaths/ToAbsolutePaths.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readlink } from 'node:fs/promises'
|
|
2
|
-
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
3
2
|
import * as DirentType from '../DirentType/DirentType.js'
|
|
3
|
+
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
4
4
|
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
5
5
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
6
6
|
import * as MergeWithSymlinks from '../MergeWithSymlinks/MergeWithSymlinks.js'
|
|
@@ -24,6 +24,7 @@ export const Commands = {
|
|
|
24
24
|
ensureFile: FileSystem.ensureFile,
|
|
25
25
|
getPathSeparator: FileSystem.getPathSeparator,
|
|
26
26
|
getRealPath: FileSystem.getRealPath,
|
|
27
|
+
getRealUri: FileSystem.getRealUri,
|
|
27
28
|
mkdir: FileSystem.mkdir,
|
|
28
29
|
readDirWithFileTypes: FileSystem.readDirWithFileTypes,
|
|
29
30
|
readFile: FileSystem.readFile,
|
|
@@ -33,5 +34,4 @@ export const Commands = {
|
|
|
33
34
|
rename: FileSystem.rename,
|
|
34
35
|
stat: FileSystem.stat,
|
|
35
36
|
writeFile: FileSystem.writeFile,
|
|
36
|
-
getRealUri: FileSystem.getRealUri,
|
|
37
37
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// TODO lazyload chokidar and trash (but doesn't work currently because of bug with jest)
|
|
2
2
|
import * as fs from 'node:fs/promises'
|
|
3
3
|
import * as os from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
4
6
|
import * as Assert from '../Assert/Assert.js'
|
|
5
7
|
import * as EncodingType from '../EncodingType/EncodingType.js'
|
|
6
8
|
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
|
|
@@ -11,8 +13,6 @@ import * as Path from '../Path/Path.js'
|
|
|
11
13
|
import * as Platform from '../Platform/Platform.js'
|
|
12
14
|
import * as Trash from '../Trash/Trash.js'
|
|
13
15
|
import { VError } from '../VError/VError.js'
|
|
14
|
-
import { fileURLToPath } from 'node:url'
|
|
15
|
-
import { join } from 'node:path'
|
|
16
16
|
|
|
17
17
|
export const state = {
|
|
18
18
|
watcherMap: Object.create(null),
|
|
@@ -5,6 +5,7 @@ export const name = 'FileSystemDisk'
|
|
|
5
5
|
export const Commands = {
|
|
6
6
|
chmod: FileSystemDisk.chmod,
|
|
7
7
|
copy: FileSystemDisk.copy,
|
|
8
|
+
getFolderSize: FileSystemDisk.getFolderSize,
|
|
8
9
|
getPathSeparator: FileSystemDisk.getPathSeparator,
|
|
9
10
|
mkdir: FileSystemDisk.mkdir,
|
|
10
11
|
readDirWithFileTypes: FileSystemDisk.readDirWithFileTypes,
|
|
@@ -14,5 +15,4 @@ export const Commands = {
|
|
|
14
15
|
rename: FileSystemDisk.rename,
|
|
15
16
|
stat: FileSystemDisk.stat,
|
|
16
17
|
writeFile: FileSystemDisk.writeFile,
|
|
17
|
-
getFolderSize: FileSystemDisk.getFolderSize,
|
|
18
18
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// TODO lazyload chokidar and trash (but doesn't work currently because of bug with jest)
|
|
2
2
|
import * as fs from 'node:fs/promises'
|
|
3
3
|
import * as os from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
4
6
|
import * as Assert from '../Assert/Assert.js'
|
|
5
7
|
import * as EncodingType from '../EncodingType/EncodingType.js'
|
|
6
8
|
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
|
|
7
9
|
import { FileNotFoundError } from '../FileNotFoundError/FileNotFoundError.js'
|
|
8
10
|
import * as GetDirentType from '../GetDirentType/GetDirentType.js'
|
|
11
|
+
import * as GetFolderSizeInternal from '../GetFolderSizeInternal/GetFolderSizeInternal.js'
|
|
9
12
|
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
10
13
|
import * as Trash from '../Trash/Trash.js'
|
|
11
|
-
import * as GetFolderSizeInternal from '../GetFolderSizeInternal/GetFolderSizeInternal.js'
|
|
12
14
|
import { VError } from '../VError/VError.js'
|
|
13
|
-
import { fileURLToPath } from 'node:url'
|
|
14
|
-
import { join } from 'node:path'
|
|
15
15
|
|
|
16
16
|
const assertUri = (uri) => {
|
|
17
17
|
if (!uri.startsWith('file://')) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as LaunchFileSystemProcess from '../LaunchFileSystemProcess/LaunchFileSystemProcess.js'
|
|
2
1
|
import * as JsonRpc from '../JsonRpc/JsonRpc.js'
|
|
2
|
+
import * as LaunchFileSystemProcess from '../LaunchFileSystemProcess/LaunchFileSystemProcess.js'
|
|
3
3
|
|
|
4
4
|
export const state = {
|
|
5
5
|
/**
|
|
@@ -3,7 +3,7 @@ import * as FileWatcher from '../FileWatcher/FileWatcher.js'
|
|
|
3
3
|
export const name = 'FileWatcher'
|
|
4
4
|
|
|
5
5
|
export const Commands = {
|
|
6
|
+
handleChange: FileWatcher.handleChange,
|
|
6
7
|
watch: FileWatcher.watch,
|
|
7
8
|
watchFile2: FileWatcher.watchFile2,
|
|
8
|
-
handleChange: FileWatcher.handleChange,
|
|
9
9
|
}
|
|
@@ -10,13 +10,13 @@ const handleEvents = (id, ipc, event) => {
|
|
|
10
10
|
// TODO remove ipc and dispose file watcher when socket / messageport closes
|
|
11
11
|
const internalIdMap = Object.create(null)
|
|
12
12
|
|
|
13
|
-
export const watch = async (ipc, id, {
|
|
13
|
+
export const watch = async (ipc, id, { exclude, roots } ) => {
|
|
14
14
|
const internalId = Id.create()
|
|
15
15
|
internalIdMap[internalId] = { id, ipc }
|
|
16
16
|
await FileWatcherProcess.invoke('FileWatcher.watchFolders', {
|
|
17
|
+
exclude,
|
|
17
18
|
id: internalId,
|
|
18
19
|
roots,
|
|
19
|
-
exclude,
|
|
20
20
|
})
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as GetBrowserWindowOptions from '../GetBrowserWindowOptions/GetBrowserWindowOptions.js'
|
|
2
1
|
import * as ExtensionManagementColorTheme from '../ExtensionManagement/ExtensionManagementColorTheme.js'
|
|
2
|
+
import * as GetBrowserWindowOptions from '../GetBrowserWindowOptions/GetBrowserWindowOptions.js'
|
|
3
3
|
import * as Platform from '../Platform/Platform.js'
|
|
4
4
|
|
|
5
5
|
const fallbackBackground = '#1e2324'
|
|
@@ -26,7 +26,7 @@ const getColorThemeJson = async (preferences) => {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export const getAppWindowOptions = async ({ preferences,
|
|
29
|
+
export const getAppWindowOptions = async ({ preferences, preloadUrl, screenHeight, screenWidth } ) => {
|
|
30
30
|
const colorThemeJson = await getColorThemeJson(preferences)
|
|
31
31
|
const colors = colorThemeJson.colors && typeof colorThemeJson.colors === 'object' ? colorThemeJson.colors : {}
|
|
32
32
|
const background = getColor(colors, ['MainBackground'], fallbackBackground)
|
|
@@ -47,20 +47,20 @@ export const getAppWindowOptions = async ({ preferences, screenWidth, screenHeig
|
|
|
47
47
|
const titleBarOverlay = windowControlsOverlayPreference
|
|
48
48
|
? {
|
|
49
49
|
color: titleBarBackground,
|
|
50
|
-
symbolColor: titleBarSymbolColor,
|
|
51
50
|
height: 29,
|
|
51
|
+
symbolColor: titleBarSymbolColor,
|
|
52
52
|
}
|
|
53
53
|
: undefined
|
|
54
54
|
|
|
55
55
|
return GetBrowserWindowOptions.getBrowserWindowOptions({
|
|
56
|
-
y: 0,
|
|
57
|
-
x: screenWidth - 800,
|
|
58
|
-
width: 800,
|
|
59
|
-
height: screenHeight,
|
|
60
56
|
background,
|
|
61
|
-
titleBarStyle,
|
|
62
57
|
frame,
|
|
63
|
-
|
|
58
|
+
height: screenHeight,
|
|
64
59
|
preloadUrl,
|
|
60
|
+
titleBarOverlay,
|
|
61
|
+
titleBarStyle,
|
|
62
|
+
width: 800,
|
|
63
|
+
x: screenWidth - 800,
|
|
64
|
+
y: 0,
|
|
65
65
|
})
|
|
66
66
|
}
|
|
@@ -5,28 +5,28 @@ import * as GetIcon from '../GetIcon/GetIcon.js'
|
|
|
5
5
|
*
|
|
6
6
|
* @returns {any}
|
|
7
7
|
*/
|
|
8
|
-
export const getBrowserWindowOptions = ({
|
|
8
|
+
export const getBrowserWindowOptions = ({ background, frame, height, preloadUrl, titleBarOverlay, titleBarStyle, width, x, y } ) => {
|
|
9
9
|
const icon = GetIcon.getIcon()
|
|
10
10
|
return {
|
|
11
|
-
x,
|
|
12
|
-
y,
|
|
13
|
-
width,
|
|
14
|
-
height,
|
|
15
11
|
autoHideMenuBar: true,
|
|
16
|
-
|
|
17
|
-
titleBarOverlay,
|
|
12
|
+
backgroundColor: background,
|
|
18
13
|
frame,
|
|
14
|
+
height,
|
|
15
|
+
icon,
|
|
16
|
+
show: false,
|
|
17
|
+
titleBarOverlay,
|
|
18
|
+
titleBarStyle,
|
|
19
19
|
webPreferences: {
|
|
20
|
+
additionalArguments: [],
|
|
21
|
+
contextIsolation: true,
|
|
20
22
|
enableWebSQL: false,
|
|
21
|
-
|
|
23
|
+
preload: preloadUrl,
|
|
22
24
|
sandbox: true,
|
|
23
|
-
|
|
25
|
+
spellcheck: false,
|
|
24
26
|
v8CacheOptions: BrowserWindowV8CacheOptions.browserWindowV8CacheOptions,
|
|
25
|
-
preload: preloadUrl,
|
|
26
|
-
additionalArguments: [],
|
|
27
27
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
width,
|
|
29
|
+
x,
|
|
30
|
+
y,
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Character from '../Character/Character.js'
|
|
2
1
|
import * as AddSemiColon from '../AddSemiColon/AddSemiColon.js'
|
|
2
|
+
import * as Character from '../Character/Character.js'
|
|
3
3
|
|
|
4
4
|
export const getContentSecurityPolicy = (items) => {
|
|
5
5
|
return items.map(AddSemiColon.addSemicolon).join(Character.Space)
|
|
@@ -59,8 +59,8 @@ const get = (input) => {
|
|
|
59
59
|
case ExtensionManifestInputType.Folder:
|
|
60
60
|
case ExtensionManifestInputType.LinkedExtensionsFolder:
|
|
61
61
|
return getFolder(input.path)
|
|
62
|
-
case ExtensionManifestInputType.OnlyExtension:
|
|
63
62
|
case ExtensionManifestInputType.LinkedExtension:
|
|
63
|
+
case ExtensionManifestInputType.OnlyExtension:
|
|
64
64
|
return getOnly(input.path)
|
|
65
65
|
default:
|
|
66
66
|
return []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Promises from '../Promises/Promises.js'
|
|
2
2
|
|
|
3
3
|
export const getFirstEvent = (eventEmitter, eventMap) => {
|
|
4
|
-
const {
|
|
4
|
+
const { promise, resolve } = Promises.withResolvers()
|
|
5
5
|
const listenerMap = Object.create(null)
|
|
6
6
|
const cleanup = (value) => {
|
|
7
7
|
for (const event of Object.keys(eventMap)) {
|
|
@@ -12,8 +12,8 @@ export const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
12
12
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
13
13
|
const listener = (event) => {
|
|
14
14
|
cleanup({
|
|
15
|
-
type,
|
|
16
15
|
event,
|
|
16
|
+
type,
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
eventEmitter.on(event, listener)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js'
|
|
2
1
|
import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js'
|
|
2
|
+
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js'
|
|
3
3
|
|
|
4
4
|
export const getFirstSpawnedProcessEvent = (childProcess) => {
|
|
5
5
|
return GetFirstEvent.getFirstEvent(childProcess, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { extname } from 'path'
|
|
2
|
+
import * as ContentSecurityPolicyState from '../ContentSecurityPolicyState/ContentSecurityPolicyState.js'
|
|
2
3
|
import * as CrossOriginEmbedderPolicy from '../CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js'
|
|
3
4
|
import * as CrossOriginResourcePolicy from '../CrossOriginResourcePolicy/CrossOriginResourcePolicy.js'
|
|
4
5
|
import * as GetExtraHeaders from '../GetExtraHeaders/GetExtraHeaders.js'
|
|
5
|
-
import * as ContentSecurityPolicyState from '../ContentSecurityPolicyState/ContentSecurityPolicyState.js'
|
|
6
6
|
import * as GetMimeType from '../GetMimeType/GetMimeType.js'
|
|
7
7
|
import * as HttpHeader from '../HttpHeader/HttpHeader.js'
|
|
8
8
|
|
|
@@ -10,16 +10,16 @@ export const getHeaders = async (absolutePath, pathName, etag, url, size) => {
|
|
|
10
10
|
const extension = extname(absolutePath)
|
|
11
11
|
const mime = GetMimeType.getMimeType(extension)
|
|
12
12
|
const headers = {
|
|
13
|
-
[HttpHeader.ContentType]: mime,
|
|
14
13
|
[HttpHeader.ContentLength]: `${size}`,
|
|
15
|
-
[HttpHeader.
|
|
14
|
+
[HttpHeader.ContentType]: mime,
|
|
16
15
|
[HttpHeader.CrossOriginEmbedderPolicy]: CrossOriginEmbedderPolicy.value,
|
|
16
|
+
[HttpHeader.CrossOriginResourcePolicy]: CrossOriginResourcePolicy.value,
|
|
17
17
|
}
|
|
18
18
|
const extraHeaders = await GetExtraHeaders.getExtraHeaders({
|
|
19
19
|
absolutePath,
|
|
20
|
-
pathName,
|
|
21
20
|
etag,
|
|
22
21
|
isForElectronProduction: false,
|
|
22
|
+
pathName,
|
|
23
23
|
})
|
|
24
24
|
const dynamicCsp = ContentSecurityPolicyState.get(url)
|
|
25
25
|
if (dynamicCsp) {
|
|
@@ -2,29 +2,29 @@ import * as MimeType from '../MimeType/MimeType.js'
|
|
|
2
2
|
|
|
3
3
|
export const getMimeType = (fileExtension) => {
|
|
4
4
|
switch (fileExtension) {
|
|
5
|
-
case '.html':
|
|
6
|
-
return MimeType.TextHtml
|
|
7
5
|
case '.css':
|
|
8
6
|
return MimeType.TextCss
|
|
9
|
-
case '.
|
|
10
|
-
return MimeType.
|
|
7
|
+
case '.html':
|
|
8
|
+
return MimeType.TextHtml
|
|
11
9
|
case '.js':
|
|
12
10
|
case '.mjs':
|
|
13
11
|
case '.ts':
|
|
14
12
|
return MimeType.TextJavaScript
|
|
15
|
-
case '.svg':
|
|
16
|
-
return MimeType.ImageSvgXml
|
|
17
|
-
case '.png':
|
|
18
|
-
return MimeType.ImagePng
|
|
19
13
|
case '.json':
|
|
20
14
|
case '.map':
|
|
21
15
|
return MimeType.ApplicationJson
|
|
16
|
+
case '.md':
|
|
17
|
+
return MimeType.Markdown
|
|
22
18
|
case '.mp3':
|
|
23
19
|
return MimeType.AudioMpeg
|
|
20
|
+
case '.png':
|
|
21
|
+
return MimeType.ImagePng
|
|
22
|
+
case '.svg':
|
|
23
|
+
return MimeType.ImageSvgXml
|
|
24
|
+
case '.ttf':
|
|
25
|
+
return MimeType.FontTtf
|
|
24
26
|
case '.webm':
|
|
25
27
|
return MimeType.VideoWebm
|
|
26
|
-
case '.md':
|
|
27
|
-
return MimeType.Markdown
|
|
28
28
|
default:
|
|
29
29
|
console.warn(`[shared-process] unsupported file extension: ${fileExtension}`)
|
|
30
30
|
return ''
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import * as Os from 'node:os'
|
|
2
|
-
import * as Platform from '../Platform/Platform.js'
|
|
3
2
|
import * as ByteSize from '../ByteSize/ByteSize.js'
|
|
3
|
+
import * as Platform from '../Platform/Platform.js'
|
|
4
4
|
|
|
5
5
|
const UiStrings = {
|
|
6
|
-
OsVersion: 'Os Version',
|
|
7
6
|
Cpus: 'CPUs',
|
|
8
7
|
Memory: 'Memory (System)',
|
|
8
|
+
OsVersion: 'Os Version',
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const visitVersion = {
|
|
12
|
-
key: UiStrings.OsVersion,
|
|
13
12
|
getValue() {
|
|
14
13
|
const { version } = Platform
|
|
15
14
|
return version
|
|
16
15
|
},
|
|
16
|
+
key: UiStrings.OsVersion,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const visitCpus = {
|
|
20
|
-
key: UiStrings.Cpus,
|
|
21
20
|
getValue() {
|
|
22
21
|
const cpus = Os.cpus()
|
|
23
22
|
if (!cpus || cpus.length === 0) {
|
|
@@ -29,10 +28,10 @@ const visitCpus = {
|
|
|
29
28
|
const { speed } = firstCpu
|
|
30
29
|
return `${model} (${cpuLength} x ${speed})`
|
|
31
30
|
},
|
|
31
|
+
key: UiStrings.Cpus,
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const visitMemory = {
|
|
35
|
-
key: UiStrings.Memory,
|
|
36
35
|
getValue() {
|
|
37
36
|
const totalMemory = Os.totalmem()
|
|
38
37
|
const freeMemory = Os.freemem()
|
|
@@ -42,6 +41,7 @@ const visitMemory = {
|
|
|
42
41
|
const freeGbShort = freeGb.toFixed(2)
|
|
43
42
|
return `${totalGbShort} GB (${freeGbShort} GB free)`
|
|
44
43
|
},
|
|
44
|
+
key: UiStrings.Memory,
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const getKeyLength = (visitor) => {
|