@lvce-editor/shared-process 0.25.10 → 0.25.11
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 +3 -3
- package/src/parts/AddAccurateMemoryUsage/AddAccurateMemoryUsage.js +7 -8
- package/src/parts/AddSemiColon/AddSemiColon.js +3 -4
- package/src/parts/AppWindow/AppWindow.js +14 -16
- package/src/parts/ApplyEdit/ApplyEdit.js +6 -7
- package/src/parts/Assert/Assert.js +1 -1
- package/src/parts/AttachDebugger/AttachDebugger.ipc.js +4 -6
- package/src/parts/AttachDebugger/AttachDebugger.js +4 -5
- package/src/parts/Authority/Authority.js +1 -1
- package/src/parts/AutoUpdateType/AutoUpdateType.js +4 -4
- package/src/parts/AutoUpdater/AutoUpdater.ipc.js +5 -7
- package/src/parts/AutoUpdater/AutoUpdater.js +31 -31
- package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.ipc.js +5 -7
- package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.js +49 -50
- package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.ipc.js +5 -7
- package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.js +49 -49
- package/src/parts/BulkReplacement/BulkReplacement.ipc.js +4 -6
- package/src/parts/BulkReplacement/BulkReplacement.js +16 -16
- package/src/parts/BulkReplacementContent/BulkReplacementContent.js +26 -27
- package/src/parts/ByteSize/ByteSize.js +4 -4
- package/src/parts/Callback/Callback.js +1 -1
- package/src/parts/Character/Character.js +12 -12
- package/src/parts/ChildProcess/ChildProcess.js +71 -86
- package/src/parts/Clamp/Clamp.js +2 -2
- package/src/parts/Cli/Cli.js +12 -12
- package/src/parts/CliCommandType/CliCommandType.js +11 -11
- package/src/parts/CliHelp/CliHelp.js +8 -9
- package/src/parts/CliInstall/CliInstall.js +24 -24
- package/src/parts/CliLink/CliLink.js +17 -17
- package/src/parts/CliList/CliList.js +15 -18
- package/src/parts/CliModule/CliModule.js +26 -27
- package/src/parts/CliStatus/CliStatus.js +4 -5
- package/src/parts/CliUnlink/CliUnlink.js +17 -17
- package/src/parts/CliVersion/CliVersion.js +7 -8
- package/src/parts/ClipBoard/ClipBoard.ipc.js +5 -7
- package/src/parts/ClipBoard/ClipBoard.js +18 -21
- package/src/parts/ClipBoard/ClipBoardGnome.js +49 -54
- package/src/parts/ClipBoard/ClipBoardNoop.js +10 -12
- package/src/parts/ClipBoard/ClipBoardWindows.js +17 -18
- package/src/parts/CollectTextSearchStdout/CollectTextSearchStdout.js +83 -93
- package/src/parts/ColorTheme/ColorTheme.js +14 -17
- package/src/parts/Command/Command.js +61 -68
- package/src/parts/CommandNotFoundError/CommandNotFoundError.js +7 -8
- package/src/parts/CompareVersion/CompareVersion.js +2 -2
- package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.ipc.js +4 -6
- package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.js +6 -7
- package/src/parts/ContentSecurityPolicyDocument/ContentSecurityPolicyDocument.js +9 -10
- package/src/parts/ContentSecurityPolicyState/ContentSecurityPolicyState.js +5 -7
- package/src/parts/ContentSecurityPolicySyntaxHighlightingWorker/ContentSecurityPolicySyntaxHighlightingWorker.js +2 -3
- package/src/parts/ContentSecurityPolicyTerminalWorker/ContentSecurityPolicyTerminalWorker.js +2 -3
- package/src/parts/ContentSecurityPolicyTestWorker/ContentSecurityPolicyTestWorker.js +2 -3
- package/src/parts/ContentSecurityPolicyWorker/ContentSecurityPolicyWorker.js +6 -7
- package/src/parts/CpuProfile/CpuProfile.js +22 -25
- package/src/parts/Crash/Crash.ipc.js +5 -7
- package/src/parts/Crash/Crash.js +8 -11
- package/src/parts/CreatePidMap/CreatePidMap.js +4 -5
- package/src/parts/CreateTestOverview/CreateTestOverview.js +19 -22
- package/src/parts/CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js +1 -1
- package/src/parts/CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js +2 -2
- package/src/parts/Debug/Debug.js +2 -3
- package/src/parts/DefaultUrl/DefaultUrl.js +3 -4
- package/src/parts/Desktop/Desktop.js +18 -19
- package/src/parts/DesktopCapturer/DesktopCapturer.ipc.js +4 -6
- package/src/parts/DesktopCapturer/DesktopCapturer.js +3 -4
- package/src/parts/DesktopType/DesktopType.js +3 -3
- package/src/parts/DestroySocket/DestroySocket.js +5 -4
- package/src/parts/Developer/Developer.ipc.js +12 -14
- package/src/parts/Developer/Developer.js +33 -40
- package/src/parts/DirentType/DirentType.js +12 -12
- package/src/parts/Download/Download.ipc.js +4 -6
- package/src/parts/Download/Download.js +20 -19
- package/src/parts/DownloadAndExtract/DownloadAndExtract.js +16 -20
- package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.ipc.js +5 -7
- package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.js +20 -23
- package/src/parts/ElectronBrowserView/ElectronBrowserView.ipc.js +5 -7
- package/src/parts/ElectronBrowserView/ElectronBrowserView.js +18 -21
- package/src/parts/ElectronBrowserViewFunctions/ElectronBrowserViewFunctions.ipc.js +17 -19
- package/src/parts/ElectronBrowserViewFunctions/ElectronBrowserViewFunctions.js +26 -41
- package/src/parts/ElectronBrowserViewIpcState/ElectronBrowserViewIpcState.js +10 -14
- package/src/parts/ElectronBrowserViewQuickPick/ElectronBrowserViewQuickPick.ipc.js +5 -7
- package/src/parts/ElectronBrowserViewQuickPick/ElectronBrowserViewQuickPick.js +5 -7
- package/src/parts/ElectronBrowserViewState/ElectronBrowserViewState.js +8 -11
- package/src/parts/ElectronBrowserViewSuggestions/ElectronBrowserViewSuggestions.ipc.js +6 -8
- package/src/parts/ElectronBrowserViewSuggestions/ElectronBrowserViewSuggestions.js +7 -10
- package/src/parts/ElectronClipBoard/ElectronClipBoard.ipc.js +4 -6
- package/src/parts/ElectronClipBoard/ElectronClipBoard.js +3 -4
- package/src/parts/ElectronContentTracing/ElectronContentTracing.ipc.js +5 -7
- package/src/parts/ElectronContentTracing/ElectronContentTracing.js +5 -7
- package/src/parts/ElectronContextMenu/ElectronContextMenu.ipc.js +4 -6
- package/src/parts/ElectronContextMenu/ElectronContextMenu.js +7 -8
- package/src/parts/ElectronDeveloper/ElectronDeveloper.ipc.js +4 -6
- package/src/parts/ElectronDeveloper/ElectronDeveloper.js +3 -4
- package/src/parts/ElectronDialog/ElectronDialog.ipc.js +5 -7
- package/src/parts/ElectronDialog/ElectronDialog.js +5 -7
- package/src/parts/ElectronInitialize/ElectronInitialize.ipc.js +4 -6
- package/src/parts/ElectronInitialize/ElectronInitialize.js +9 -10
- package/src/parts/ElectronNet/ElectronNet.ipc.js +4 -6
- package/src/parts/ElectronNet/ElectronNet.js +3 -4
- package/src/parts/ElectronNetLog/ElectronNetLog.ipc.js +5 -7
- package/src/parts/ElectronNetLog/ElectronNetLog.js +5 -7
- package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.ipc.js +5 -7
- package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.js +5 -7
- package/src/parts/ElectronProcess/ElectronProcess.ipc.js +5 -7
- package/src/parts/ElectronProcess/ElectronProcess.js +5 -7
- package/src/parts/ElectronSafeStorage/ElectronSafeStorage.ipc.js +6 -8
- package/src/parts/ElectronSafeStorage/ElectronSafeStorage.js +10 -13
- package/src/parts/ElectronShell/ElectronShell.ipc.js +4 -6
- package/src/parts/ElectronShell/ElectronShell.js +3 -4
- package/src/parts/ElectronWebContents/ElectronWebContents.ipc.js +11 -13
- package/src/parts/ElectronWebContents/ElectronWebContents.js +45 -61
- package/src/parts/ElectronWebContentsView/ElectronWebContentsView.ipc.js +5 -7
- package/src/parts/ElectronWebContentsView/ElectronWebContentsView.js +16 -18
- package/src/parts/ElectronWebContentsViewFunctions/ElectronWebContentsViewFunctions.ipc.js +17 -19
- package/src/parts/ElectronWebContentsViewFunctions/ElectronWebContentsViewFunctions.js +26 -41
- package/src/parts/ElectronWindow/ElectronWindow.ipc.js +15 -17
- package/src/parts/ElectronWindow/ElectronWindow.js +60 -81
- package/src/parts/ElectronWindowAbout/ElectronWindowAbout.ipc.js +4 -6
- package/src/parts/ElectronWindowAbout/ElectronWindowAbout.js +3 -4
- package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.ipc.js +4 -6
- package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.js +31 -33
- package/src/parts/EncodingType/EncodingType.js +2 -2
- package/src/parts/Env/Env.js +11 -16
- package/src/parts/Error/FileSystemError.js +6 -7
- package/src/parts/ErrorCodes/ErrorCodes.js +22 -22
- package/src/parts/ErrorHandling/ErrorHandling.js +52 -60
- package/src/parts/Exec/Exec.js +11 -12
- package/src/parts/ExecCommand/ExecCommand.js +19 -22
- package/src/parts/ExecPromise/ExecPromise.js +3 -4
- package/src/parts/Exit/Exit.ipc.js +4 -6
- package/src/parts/Exit/Exit.js +3 -4
- package/src/parts/ExitCode/ExitCode.js +3 -5
- package/src/parts/ExportStatic/ExportStatic.js +318 -419
- package/src/parts/ExtensionHostHelperProcessIpc/ExtensionHostHelperProcessIpc.js +13 -14
- package/src/parts/ExtensionHostRpc/ExtensionHostRpc.js +70 -79
- package/src/parts/ExtensionInstall/ExtensionInstall.ipc.js +4 -6
- package/src/parts/ExtensionInstall/ExtensionInstall.js +21 -23
- package/src/parts/ExtensionInstallFromFile/ExtensionInstallFromFile.js +32 -33
- package/src/parts/ExtensionInstallFromGitHub/ExtensionInstallFromGitHub.js +30 -30
- package/src/parts/ExtensionInstallFromUrl/ExtensionInstallFromUrl.js +30 -30
- package/src/parts/ExtensionInstallParseInput/ExtensionInstallParseInput.js +43 -46
- package/src/parts/ExtensionInstallType/ExtensionInstallType.js +4 -7
- package/src/parts/ExtensionLink/ExtensionLink.js +40 -40
- package/src/parts/ExtensionList/ExtensionList.js +57 -63
- package/src/parts/ExtensionManagement/ExtensionManagement.ipc.js +16 -17
- package/src/parts/ExtensionManagement/ExtensionManagement.js +70 -87
- package/src/parts/ExtensionManagement/ExtensionManagementColorTheme.js +62 -70
- package/src/parts/ExtensionManagement/ExtensionManagementIconTheme.js +26 -26
- package/src/parts/ExtensionManagement/ExtensionManagementLanguages.js +55 -59
- package/src/parts/ExtensionManifest/ExtensionManifest.js +50 -48
- package/src/parts/ExtensionManifestInputType/ExtensionManifestInputType.js +3 -5
- package/src/parts/ExtensionManifestStatus/ExtensionManifestStatus.js +2 -3
- package/src/parts/ExtensionManifests/ExtensionManifests.js +36 -40
- package/src/parts/ExtensionManifests/ExtensionManifestsFromFolder.js +19 -19
- package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtensionsFolder.js +46 -47
- package/src/parts/ExtensionManifests/ExtensionManifestsFromOnlyExtension.js +7 -8
- package/src/parts/ExtensionUninstall/ExtensionUninstall.js +17 -17
- package/src/parts/ExtensionUnlink/ExtensionUnlink.js +19 -19
- package/src/parts/Extract/Extract.js +24 -28
- package/src/parts/FileNotFoundError/FileNotFoundError.js +11 -13
- package/src/parts/FileSystem/FileSystem.ipc.js +27 -30
- package/src/parts/FileSystem/FileSystem.js +214 -228
- package/src/parts/FileSystemWatch/FileSystemWatch.js +4 -5
- package/src/parts/FirstNodeWorkerEventType/FirstNodeWorkerEventType.js +3 -3
- package/src/parts/GetAccurateMemoryUsage/GetAccurateMemoryUsage.js +34 -34
- package/src/parts/GetAppImageDownloadUrl/GetAppImageDownloadUrl.js +4 -5
- package/src/parts/GetAppImagePath/GetAppImagePath.js +3 -4
- package/src/parts/GetAppWindowOptions/GetAppWindowOptions.js +26 -28
- package/src/parts/GetBrowserWindowOptions/GetBrowserWindowOptions.js +26 -27
- package/src/parts/GetContentSecurityPolicy/GetContentSecurityPolicy.js +4 -5
- package/src/parts/GetDirentType/GetDirentType.js +24 -25
- package/src/parts/GetElectronFileResponse/GetElectronFileResponse.ipc.js +4 -6
- package/src/parts/GetElectronFileResponse/GetElectronFileResponse.js +43 -43
- package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js +32 -33
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +15 -16
- package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js +11 -13
- package/src/parts/GetElectronRebuildPath/GetElectronRebuildPath.js +8 -9
- package/src/parts/GetEtag/GetEtag.js +2 -2
- package/src/parts/GetFirstEvent/GetFirstEvent.js +20 -21
- package/src/parts/GetFirstNodeWorkerEvent/GetFirstNodeWorkerEvent.js +7 -8
- package/src/parts/GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js +7 -8
- package/src/parts/GetHeaders/GetHeaders.js +50 -52
- package/src/parts/GetHeadersDefault/GetHeadersDefault.js +2 -2
- package/src/parts/GetHeadersExtensionHostWorker/GetHeadersExtensionHostWorker.js +8 -9
- package/src/parts/GetHeadersMainFrame/GetHeadersMainFrame.js +10 -11
- package/src/parts/GetHeadersOtherWorker/GetHeadersOtherWorker.js +12 -13
- package/src/parts/GetHeadersRendererWorker/GetHeadersRendererWorker.js +8 -9
- package/src/parts/GetHeadersSyntaxHighlightingWorker/GetHeadersSyntaxHighlightingWorker.js +8 -9
- package/src/parts/GetHeadersTerminalWorker/GetHeadersTerminalWorker.js +8 -9
- package/src/parts/GetHeadersTestWorker/GetHeadersTestWorker.js +8 -9
- package/src/parts/GetHelpString/GetHelpString.js +4 -5
- package/src/parts/GetHttpErrorMessage/GetHttpErrorMessage.js +20 -21
- package/src/parts/GetIcon/GetIcon.js +17 -18
- package/src/parts/GetLatestReleaseVersion/GetLatestReleaseVersion.js +29 -30
- package/src/parts/GetMimeType/GetMimeType.js +26 -27
- package/src/parts/GetNewLineIndex/GetNewLineIndex.js +3 -4
- package/src/parts/GetNotFoundResponse/GetNotFoundResponse.js +10 -11
- package/src/parts/GetNotModifiedResponse/GetNotModifiedResponse.js +9 -10
- package/src/parts/GetNsisUpdateArgs/GetNsisUpdateArgs.js +6 -6
- package/src/parts/GetNsisUpdateDownloadPath/GetNsisUpdateDownloadPath.js +9 -10
- package/src/parts/GetPathName/GetPathName.js +3 -3
- package/src/parts/GetPreloadUrl/GetPreloadUrl.js +4 -5
- package/src/parts/GetProcessExplorerUrl/GetProcessExplorerUrl.js +3 -4
- package/src/parts/GetPsOutput/GetPsOutput.js +16 -17
- package/src/parts/GetRemoteUrl/GetRemoteUrl.js +4 -5
- package/src/parts/GetServerErrorResponse/GetServerErrorResponse.js +10 -11
- package/src/parts/GetStatusString/GetStatusString.js +54 -62
- package/src/parts/GetTerminalProcessPath/GetTerminalProcessPath.js +4 -5
- package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.ipc.js +4 -6
- package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.js +16 -17
- package/src/parts/GetTestPath/GetTestPath.js +10 -11
- package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +41 -42
- package/src/parts/GetTitleBarItems/GetTitleBarItems.js +40 -41
- package/src/parts/GetTypeFromUrl/GetTypeFromUrl.js +17 -18
- package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +11 -20
- package/src/parts/GetVersionString/GetVersionString.js +4 -5
- package/src/parts/GetWindowId/GetWindowId.ipc.js +4 -6
- package/src/parts/GetWindowId/GetWindowId.js +4 -5
- package/src/parts/GetWindowsNsisDownloadUrl/GetWindowsNsisDownloadUrl.js +6 -7
- package/src/parts/GetWorkspaceId/GetWorkspaceId.js +3 -4
- package/src/parts/GitLsFiles/GitLsFiles.ipc.js +6 -8
- package/src/parts/GitLsFiles/GitLsFiles.js +19 -22
- package/src/parts/HandleCliArgs/HandleCliArgs.ipc.js +4 -6
- package/src/parts/HandleCliArgs/HandleCliArgs.js +11 -11
- package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.ipc.js +4 -6
- package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.js +13 -14
- package/src/parts/HandleElectronReady/HandleElectronReady.ipc.js +4 -6
- package/src/parts/HandleElectronReady/HandleElectronReady.js +8 -9
- package/src/parts/HandleIpc/HandleIpc.js +20 -23
- package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.ipc.js +4 -6
- package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.js +17 -18
- package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.ipc.js +4 -6
- package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.js +8 -9
- package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.ipc.js +4 -6
- package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.js +9 -10
- package/src/parts/HandleRemoteRequest/HandleRemoteRequest.ipc.js +4 -6
- package/src/parts/HandleRemoteRequest/HandleRemoteRequest.js +8 -9
- package/src/parts/HandleRequestTest/HandleRequestTest.ipc.js +4 -6
- package/src/parts/HandleRequestTest/HandleRequestTest.js +9 -10
- package/src/parts/HandleSocketError/HandleSocketError.js +10 -11
- package/src/parts/HandleUncaughtExceptionMonitor/HandleUncaughtExceptionMonitor.js +9 -12
- package/src/parts/HandleWebSocket/HandleWebSocket.ipc.js +4 -6
- package/src/parts/HandleWebSocket/HandleWebSocket.js +19 -19
- package/src/parts/HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js +8 -9
- package/src/parts/HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js +15 -16
- package/src/parts/HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js +17 -21
- package/src/parts/HandleWebSocketForUnknown/HandleWebSocketForUnknown.js +9 -9
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +16 -17
- package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.ipc.js +4 -6
- package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.js +9 -10
- package/src/parts/HasPositiveMemoryUsage/HasPositiveMemoryUsage.js +2 -2
- package/src/parts/Hash/Hash.js +4 -6
- package/src/parts/HeapSnapshot/HeapSnapshot.ipc.js +4 -6
- package/src/parts/HeapSnapshot/HeapSnapshot.js +6 -9
- package/src/parts/HttpHeader/HttpHeader.js +7 -7
- package/src/parts/HttpServerResponse/HttpServerResponse.js +15 -16
- package/src/parts/HttpStatusCode/HttpStatusCode.js +5 -5
- package/src/parts/Id/Id.js +4 -5
- package/src/parts/IncrementalTextSearch/IncrementalTextSearch.js +44 -47
- package/src/parts/IncrementalTextSearch/IncremetalTextSearch.ipc.js +4 -6
- package/src/parts/InferExtensionId/InferExtensionId.js +7 -8
- package/src/parts/InstallExtension/InstallExtension.ipc.js +3 -4
- package/src/parts/InstallExtension/InstallExtension.js +32 -32
- package/src/parts/IpcChild/IpcChild.js +12 -13
- package/src/parts/IpcChildModule/IpcChildModule.js +19 -26
- package/src/parts/IpcChildType/IpcChildType.js +18 -19
- package/src/parts/IpcChildWithElectronMessagePort/IpcChildWithElectronMessagePort.js +47 -48
- package/src/parts/IpcChildWithNodeMessagePort/IpcChildWithNodeMessagePort.js +40 -41
- package/src/parts/IpcError/IpcError.js +4 -4
- package/src/parts/IpcParent/IpcParent.js +8 -9
- package/src/parts/IpcParentModule/IpcParentModule.js +13 -14
- package/src/parts/IpcParentType/IpcParentType.js +3 -3
- package/src/parts/IpcParentWithElectronUtilityProcess/IpcParentWithElectronUtilityProcess.js +45 -48
- package/src/parts/IsAbsolutePath/IsAbsolutePath.js +3 -4
- package/src/parts/IsAppImage/IsAppImage.js +3 -4
- package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.ipc.js +4 -6
- package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.js +6 -8
- package/src/parts/IsBuiltServer/IsBuiltServer.js +1 -1
- package/src/parts/IsDlOpenError/IsDlOpenError.js +3 -4
- package/src/parts/IsElectron/IsElectron.js +3 -4
- package/src/parts/IsEnoentError/IsEnoentError.js +9 -11
- package/src/parts/IsEnoentErrorWindows/IsEnoentErrorWindows.js +2 -2
- package/src/parts/IsEsrchError/IsEsrchError.js +3 -4
- package/src/parts/IsIgnoredError/IsIgnoredError.js +12 -13
- package/src/parts/IsMessagePort/IsMessagePort.js +2 -2
- package/src/parts/IsMessagePortMain/IsMessagePortMain.js +2 -2
- package/src/parts/IsTypeScriptPath/IsTypeScriptPath.js +2 -2
- package/src/parts/IsWindows/IsWindows.js +1 -1
- package/src/parts/JoinLines/JoinLines.js +3 -4
- package/src/parts/Json/Json.js +15 -17
- package/src/parts/JsonFile/JsonFile.js +10 -12
- package/src/parts/JsonRpc/JsonRpc.js +1 -1
- package/src/parts/JsonRpcVersion/JsonRpcVersion.js +1 -1
- package/src/parts/Jsonc/Jsonc.js +1 -1
- package/src/parts/JsoncFile/JsoncFile.js +7 -8
- package/src/parts/LeftCut/LeftCut.js +17 -18
- package/src/parts/LimitString/LimitString.js +13 -14
- package/src/parts/ListProcessGetName/ListProcessGetName.js +55 -56
- package/src/parts/ListProcessesWithMemoryUsage/ListProcessesWithMemoryUsage.ipc.js +4 -6
- package/src/parts/ListProcessesWithMemoryUsage/ListProcessesWithMemoryUsage.js +9 -11
- package/src/parts/ListProcessesWithMemoryUsageUnix/ListProcessesWithMemoryUsageUnix.js +19 -20
- package/src/parts/ListProcessesWithMemoryUsageWindows/ListProcessesWithMemoryUsageWindows.js +33 -36
- package/src/parts/LoadTypeScript/LoadTypeScript.js +12 -12
- package/src/parts/LoadWindowsProcessTree/LoadWindowsProcessTree.js +11 -13
- package/src/parts/Logger/Logger.js +34 -42
- package/src/parts/Main/Main.js +13 -14
- package/src/parts/MakeExecutable/MakeExecutable.js +9 -9
- package/src/parts/MimeType/MimeType.js +37 -37
- package/src/parts/Module/Module.js +150 -151
- package/src/parts/ModuleId/ModuleId.js +76 -76
- package/src/parts/ModuleMap/ModuleMap.js +329 -330
- package/src/parts/OpenExternal/OpenExternal.ipc.js +5 -7
- package/src/parts/OpenExternal/OpenExternal.js +5 -7
- package/src/parts/OpenNativeFolder/OpenNativeFolder.ipc.js +4 -6
- package/src/parts/OpenNativeFolder/OpenNativeFolder.js +9 -9
- package/src/parts/Os/Os.ipc.js +4 -6
- package/src/parts/Os/Os.js +3 -4
- package/src/parts/OutputChannel/OutputChannel.ipc.js +35 -39
- package/src/parts/OutputChannel/OutputChannel.js +32 -35
- package/src/parts/OutputChannelState/OutputChannelState.js +10 -14
- package/src/parts/ParentIpc/ParentIpc.js +19 -25
- package/src/parts/ParseInt/ParseInt.js +2 -2
- package/src/parts/ParseMemory/ParseMemory.js +9 -10
- package/src/parts/ParsePsOutput/ParsePsOutput.js +42 -46
- package/src/parts/ParseRipGrepLines/ParseRipGrepLines.js +9 -10
- package/src/parts/ParseUrlGithub/ParseUrlGithub.js +49 -51
- package/src/parts/Path/Path.js +11 -16
- package/src/parts/Performance/Performance.ipc.js +4 -6
- package/src/parts/Performance/Performance.js +16 -27
- package/src/parts/Platform/Platform.ipc.js +28 -30
- package/src/parts/Platform/Platform.js +46 -73
- package/src/parts/PlatformPaths/PlatformPaths.ipc.js +21 -23
- package/src/parts/PlatformPaths/PlatformPaths.js +79 -114
- package/src/parts/Preferences/Preferences.ipc.js +4 -6
- package/src/parts/Preferences/Preferences.js +69 -70
- package/src/parts/PrettyError/PrettyError.js +1 -1
- package/src/parts/PrintPrettyError/PrintPrettyError.js +3 -4
- package/src/parts/Process/Process.ipc.js +10 -12
- package/src/parts/Process/Process.js +35 -48
- package/src/parts/ProcessDisplayName/ProcessDisplayName.js +1 -1
- package/src/parts/ProcessExitEventType/ProcessExitEventType.js +2 -2
- package/src/parts/ProcessId/ProcessId.ipc.js +5 -7
- package/src/parts/ProcessId/ProcessId.js +4 -5
- package/src/parts/ProcessListeners/ProcessListeners.js +11 -14
- package/src/parts/Promises/Promises.js +18 -18
- package/src/parts/ProtocolType/ProtocolType.js +4 -4
- package/src/parts/PtyHost/PtyHost.js +55 -62
- package/src/parts/PtyHostPath/PtyHostPath.js +10 -10
- package/src/parts/PtyHostState/PtyHostState.js +16 -16
- package/src/parts/Queue/Queue.js +30 -31
- package/src/parts/RebuildForElectron/RebuildForElectron.js +14 -14
- package/src/parts/RebuildForNode/RebuildForNode.js +12 -12
- package/src/parts/RebuildNodePty/RebuildNodePty.ipc.js +4 -6
- package/src/parts/RebuildNodePty/RebuildNodePty.js +20 -22
- package/src/parts/RecentlyOpened/RecentlyOpened.ipc.js +4 -6
- package/src/parts/RecentlyOpened/RecentlyOpened.js +54 -53
- package/src/parts/RemoveSymlink/RemoveSymlink.js +11 -11
- package/src/parts/RequiresSocket/RequiresSocket.js +14 -15
- package/src/parts/Restart/Restart.js +9 -10
- package/src/parts/RipGrep/RipGrep.js +35 -37
- package/src/parts/RipGrepParsedLineType/RipGrepParsedLineType.js +4 -4
- package/src/parts/RipGrepPath/RipGrepPath.js +1 -1
- package/src/parts/Root/Root.js +4 -6
- package/src/parts/Screen/Screen.ipc.js +6 -8
- package/src/parts/Screen/Screen.js +7 -10
- package/src/parts/SearchFile/SearchFile.ipc.js +4 -6
- package/src/parts/SearchFile/SearchFile.js +26 -27
- package/src/parts/SetHeaders/SetHeaders.js +4 -4
- package/src/parts/ShouldLogError/ShouldLogError.js +6 -7
- package/src/parts/ShouldTranspileTypescript/ShouldTranspileTypescript.js +10 -11
- package/src/parts/Signal/Signal.js +3 -3
- package/src/parts/SplitLines/SplitLines.js +3 -4
- package/src/parts/SymLink/SymLink.js +3 -4
- package/src/parts/TemporaryMessagePort/TemporaryMessagePort.ipc.js +4 -6
- package/src/parts/TemporaryMessagePort/TemporaryMessagePort.js +18 -21
- package/src/parts/Terminal/Terminal.ipc.js +7 -9
- package/src/parts/Terminal/Terminal.js +68 -73
- package/src/parts/TerminalState/TerminalState.js +8 -11
- package/src/parts/TextDocument/TextDocument.ipc.js +3 -4
- package/src/parts/TextDocument/TextDocument.js +17 -22
- package/src/parts/TextSearch/TextSearch.ipc.js +4 -6
- package/src/parts/TextSearch/TextSearch.js +18 -22
- package/src/parts/TextSearchError/TextSearchError.js +12 -12
- package/src/parts/TextSearchResultType/TextSearchResultType.js +2 -2
- package/src/parts/Timeout/Timeout.js +4 -5
- package/src/parts/TmpFile/TmpFile.js +11 -13
- package/src/parts/ToAbsolutePaths/ToAbsolutePaths.js +7 -8
- package/src/parts/ToTextSearchResult/ToTextSearchResult.js +23 -24
- package/src/parts/Trace/Trace.js +10 -14
- package/src/parts/TranspileTypeScript/TranspileTypeScript.js +19 -19
- package/src/parts/Trash/Trash.js +15 -16
- package/src/parts/TrashElectron/TrashElectron.js +7 -8
- package/src/parts/TrashNode/TrashNode.js +3 -4
- package/src/parts/UpdateState/UpdateState.js +7 -10
- package/src/parts/UpdateStateType/UpdateStateType.js +9 -9
- package/src/parts/VError/VError.js +1 -1
- package/src/parts/WaitForProcessToExit/WaitForProcessToExit.js +7 -8
- package/src/parts/WebSocketServer/WebSocketServer.ipc.js +4 -6
- package/src/parts/WebSocketServer/WebSocketServer.js +1 -1
- package/src/parts/WindowsProcessTree/WindowsProcessTree.js +12 -14
- package/src/parts/WindowsProcessTreeDataFlag/WindowsProcessTreeDataFlag.js +3 -3
- package/src/parts/Workspace/Workspace.ipc.js +5 -7
- package/src/parts/Workspace/Workspace.js +79 -84
- package/src/parts/WorkspaceSource/WorkspaceSource.js +2 -2
- package/src/sharedProcessMain.js +2 -3
|
@@ -1,84 +1,83 @@
|
|
|
1
|
-
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
2
|
-
import * as JsoncFile from '../JsoncFile/JsoncFile.js'
|
|
3
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
4
|
-
import * as Process from '../Process/Process.js'
|
|
5
|
-
import { VError } from '../VError/VError.js'
|
|
1
|
+
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js';
|
|
2
|
+
import * as JsoncFile from '../JsoncFile/JsoncFile.js';
|
|
3
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js';
|
|
4
|
+
import * as Process from '../Process/Process.js';
|
|
5
|
+
import { VError } from '../VError/VError.js';
|
|
6
6
|
// TODO need jsonc parser for settings with comments
|
|
7
|
-
|
|
8
7
|
export const getUserPreferences = async () => {
|
|
9
|
-
try {
|
|
10
|
-
const userSettingsPath = PlatformPaths.getUserSettingsPath()
|
|
11
|
-
let json
|
|
12
8
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const userSettingsPath = PlatformPaths.getUserSettingsPath();
|
|
10
|
+
let json;
|
|
11
|
+
try {
|
|
12
|
+
json = await JsoncFile.readJsonc(userSettingsPath);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (IsEnoentError.isEnoentError(error)) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
return json;
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
22
|
+
catch (error) {
|
|
23
|
+
throw new VError(error, 'failed to get user preferences');
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
26
|
// TODO handle error
|
|
27
27
|
export const getDefaultPreferences = async () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
28
|
+
try {
|
|
29
|
+
const defaultSettingsPath = PlatformPaths.getDefaultSettingsPath();
|
|
30
|
+
return await JsoncFile.readJsonc(defaultSettingsPath);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
throw new VError(error, 'Failed to load default preferences');
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
36
|
// TODO efficiently load preferences -> first load cached preferences
|
|
37
37
|
// -> on idle check preferences
|
|
38
|
-
|
|
39
38
|
const getOverrides = () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const argvSliced = Process.argv.slice(2);
|
|
40
|
+
const overrides = {};
|
|
41
|
+
for (const argv of argvSliced) {
|
|
42
|
+
if (argv.startsWith('--theme=')) {
|
|
43
|
+
overrides['workbench.colorTheme'] = argv.slice('--theme='.length);
|
|
44
|
+
}
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
46
|
+
return overrides;
|
|
47
|
+
};
|
|
49
48
|
// TODO compare with timestamp/hash that preferences are fresh
|
|
50
49
|
export const getAll = async () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
try {
|
|
51
|
+
// try {
|
|
52
|
+
// const cachedPreferences = JSON.parse(
|
|
53
|
+
// await readFile(CACHED_SETTINGS_PATH, 'utf-8')
|
|
54
|
+
// )
|
|
55
|
+
// return cachedPreferences
|
|
56
|
+
// } catch {
|
|
57
|
+
// // ignore
|
|
58
|
+
// }
|
|
59
|
+
const defaultPreferences = await getDefaultPreferences();
|
|
60
|
+
const userPreferences = await getUserPreferences();
|
|
61
|
+
const overrides = getOverrides();
|
|
62
|
+
// TODO separate backend and frontend preferences, ui only needs frontend preferences
|
|
63
|
+
const preferences = {
|
|
64
|
+
...defaultPreferences,
|
|
65
|
+
...userPreferences,
|
|
66
|
+
...overrides,
|
|
67
|
+
};
|
|
68
|
+
// try {
|
|
69
|
+
// await mkdir(dirname(CACHED_SETTINGS_PATH), { recursive: true })
|
|
70
|
+
// await writeFile(
|
|
71
|
+
// CACHED_SETTINGS_PATH,
|
|
72
|
+
// JSON.stringify(preferences, null, 2) + '\n'
|
|
73
|
+
// )
|
|
74
|
+
// } catch {
|
|
75
|
+
// // ignore
|
|
76
|
+
// }
|
|
77
|
+
return preferences;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new VError(error, 'Failed to get all preferences');
|
|
68
81
|
}
|
|
69
|
-
|
|
70
|
-
// await mkdir(dirname(CACHED_SETTINGS_PATH), { recursive: true })
|
|
71
|
-
// await writeFile(
|
|
72
|
-
// CACHED_SETTINGS_PATH,
|
|
73
|
-
// JSON.stringify(preferences, null, 2) + '\n'
|
|
74
|
-
// )
|
|
75
|
-
// } catch {
|
|
76
|
-
// // ignore
|
|
77
|
-
// }
|
|
78
|
-
return preferences
|
|
79
|
-
} catch (error) {
|
|
80
|
-
throw new VError(error, 'Failed to get all preferences')
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
82
|
+
};
|
|
84
83
|
// TODO when preferences cannot be loaded, ui should show useful error message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { prepare, prepareJsonError } from '@lvce-editor/pretty-error'
|
|
1
|
+
export { prepare, prepareJsonError } from '@lvce-editor/pretty-error';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as Logger from '../Logger/Logger.js'
|
|
2
|
-
|
|
1
|
+
import * as Logger from '../Logger/Logger.js';
|
|
3
2
|
export const printPrettyError = (prettyError, prefix = '') => {
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
Logger.error(`${prefix}${prettyError.type}: ${prettyError.message}\n\n${prettyError.codeFrame}\n\n${prettyError.stack}\n`);
|
|
4
|
+
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import * as Process from './Process.js'
|
|
2
|
-
|
|
3
|
-
export const name = 'Process'
|
|
4
|
-
|
|
1
|
+
import * as Process from './Process.js';
|
|
2
|
+
export const name = 'Process';
|
|
5
3
|
export const Commands = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
4
|
+
crash: Process.crash,
|
|
5
|
+
crashAsync: Process.crashAsync,
|
|
6
|
+
getArch: Process.getArch,
|
|
7
|
+
getNodeVersion: Process.getNodeVersion,
|
|
8
|
+
getPid: Process.getPid,
|
|
9
|
+
getV8Version: Process.getV8Version,
|
|
10
|
+
kill: Process.kill,
|
|
11
|
+
};
|
|
@@ -1,61 +1,48 @@
|
|
|
1
|
-
import { VError } from '../VError/VError.js'
|
|
2
|
-
import * as IsEsrchError from '../IsEsrchError/IsEsrchError.js'
|
|
3
|
-
|
|
1
|
+
import { VError } from '../VError/VError.js';
|
|
2
|
+
import * as IsEsrchError from '../IsEsrchError/IsEsrchError.js';
|
|
4
3
|
export const crash = (message) => {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
4
|
+
throw new Error(message);
|
|
5
|
+
};
|
|
8
6
|
export const crashAsync = async (message) => {
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
};
|
|
12
9
|
export const exit = (code) => {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
10
|
+
process.exit(code);
|
|
11
|
+
};
|
|
16
12
|
export const setExitCode = (exitCode) => {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const { argv } = process
|
|
21
|
-
|
|
13
|
+
process.exitCode = exitCode;
|
|
14
|
+
};
|
|
15
|
+
export const { argv } = process;
|
|
22
16
|
export const cwd = () => {
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
17
|
+
return process.cwd();
|
|
18
|
+
};
|
|
26
19
|
export const memoryUsage = () => {
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
20
|
+
return process.memoryUsage();
|
|
21
|
+
};
|
|
30
22
|
export const isConnected = () => {
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
23
|
+
return process.connected;
|
|
24
|
+
};
|
|
34
25
|
export const kill = (pid, signal) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} catch (error) {
|
|
38
|
-
if (IsEsrchError.isEsrchError(error)) {
|
|
39
|
-
return
|
|
26
|
+
try {
|
|
27
|
+
process.kill(pid, signal);
|
|
40
28
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (IsEsrchError.isEsrchError(error)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
throw new VError(error, `Failed to kill process ${pid} with signal ${signal}`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
45
36
|
export const getPid = () => {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const { platform } = process
|
|
50
|
-
|
|
37
|
+
return process.pid;
|
|
38
|
+
};
|
|
39
|
+
export const { platform } = process;
|
|
51
40
|
export const getV8Version = () => {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
41
|
+
return process.versions.v8;
|
|
42
|
+
};
|
|
55
43
|
export const getNodeVersion = () => {
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
44
|
+
return process.versions.node;
|
|
45
|
+
};
|
|
59
46
|
export const getArch = () => {
|
|
60
|
-
|
|
61
|
-
}
|
|
47
|
+
return process.arch;
|
|
48
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const processDisplayName = 'shared process'
|
|
1
|
+
export const processDisplayName = 'shared process';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const Error = 1
|
|
2
|
-
export const Exit = 2
|
|
1
|
+
export const Error = 1;
|
|
2
|
+
export const Exit = 2;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as ProcessId from './ProcessId.js'
|
|
2
|
-
|
|
3
|
-
export const name = 'ProcessId'
|
|
4
|
-
|
|
1
|
+
import * as ProcessId from './ProcessId.js';
|
|
2
|
+
export const name = 'ProcessId';
|
|
5
3
|
export const Commands = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
getMainProcessId: ProcessId.getMainProcessId,
|
|
5
|
+
getSharedProcessId: ProcessId.getSharedProcessId,
|
|
6
|
+
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import * as ErrorHandling from '../ErrorHandling/ErrorHandling.js'
|
|
2
|
-
import * as ExitCode from '../ExitCode/ExitCode.js'
|
|
3
|
-
import * as Process from '../Process/Process.js'
|
|
4
|
-
|
|
1
|
+
import * as ErrorHandling from '../ErrorHandling/ErrorHandling.js';
|
|
2
|
+
import * as ExitCode from '../ExitCode/ExitCode.js';
|
|
3
|
+
import * as Process from '../Process/Process.js';
|
|
5
4
|
export const handleDisconnect = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
5
|
+
console.info('[shared process] disconnected');
|
|
6
|
+
Process.exit(ExitCode.Success);
|
|
7
|
+
};
|
|
10
8
|
export const handleSigTerm = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
9
|
+
console.info('[shared-process] sigterm');
|
|
10
|
+
Process.exit(ExitCode.Success);
|
|
11
|
+
};
|
|
15
12
|
export const handleUncaughtExceptionMonitor = (error) => {
|
|
16
|
-
|
|
17
|
-
}
|
|
13
|
+
ErrorHandling.handleUncaughtExceptionMonitor(error);
|
|
14
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export const withResolvers = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type {any}
|
|
4
|
+
*/
|
|
5
|
+
let _resolve;
|
|
6
|
+
/**
|
|
7
|
+
* @type {any}
|
|
8
|
+
*/
|
|
9
|
+
let _reject;
|
|
10
|
+
const promise = new Promise((resolve, reject) => {
|
|
11
|
+
_resolve = resolve;
|
|
12
|
+
_reject = reject;
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
resolve: _resolve,
|
|
16
|
+
reject: _reject,
|
|
17
|
+
promise,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const ExtensionHost = 'extension-host'
|
|
2
|
-
export const ExtensionHostHelperProcess = 'extension-host-helper-process'
|
|
3
|
-
export const SharedProcess = 'shared-process'
|
|
4
|
-
export const TerminalProcess = 'terminal-process'
|
|
1
|
+
export const ExtensionHost = 'extension-host';
|
|
2
|
+
export const ExtensionHostHelperProcess = 'extension-host-helper-process';
|
|
3
|
+
export const SharedProcess = 'shared-process';
|
|
4
|
+
export const TerminalProcess = 'terminal-process';
|
|
@@ -1,71 +1,64 @@
|
|
|
1
|
-
import exitHook from 'exit-hook'
|
|
2
|
-
import * as Debug from '../Debug/Debug.js'
|
|
3
|
-
import * as HandleIpc from '../HandleIpc/HandleIpc.js'
|
|
4
|
-
import * as IpcParent from '../IpcParent/IpcParent.js'
|
|
5
|
-
import * as IpcParentType from '../IpcParentType/IpcParentType.js'
|
|
6
|
-
import * as JsonRpc from '../JsonRpc/JsonRpc.js'
|
|
7
|
-
import * as PtyHostPath from '../PtyHostPath/PtyHostPath.js'
|
|
8
|
-
import * as PtyHostState from '../PtyHostState/PtyHostState.js'
|
|
9
|
-
|
|
1
|
+
import exitHook from 'exit-hook';
|
|
2
|
+
import * as Debug from '../Debug/Debug.js';
|
|
3
|
+
import * as HandleIpc from '../HandleIpc/HandleIpc.js';
|
|
4
|
+
import * as IpcParent from '../IpcParent/IpcParent.js';
|
|
5
|
+
import * as IpcParentType from '../IpcParentType/IpcParentType.js';
|
|
6
|
+
import * as JsonRpc from '../JsonRpc/JsonRpc.js';
|
|
7
|
+
import * as PtyHostPath from '../PtyHostPath/PtyHostPath.js';
|
|
8
|
+
import * as PtyHostState from '../PtyHostState/PtyHostState.js';
|
|
10
9
|
const cleanUpAll = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
10
|
+
if (PtyHostState.state.ipc) {
|
|
11
|
+
PtyHostState.state.ipc.dispose();
|
|
12
|
+
PtyHostState.state.ipc = undefined;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
17
15
|
const handleProcessExit = () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
16
|
+
Debug.debug('shared process exit, clean terminals');
|
|
17
|
+
cleanUpAll();
|
|
18
|
+
};
|
|
22
19
|
const createPtyHost = async (method) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
20
|
+
exitHook(handleProcessExit);
|
|
21
|
+
const ptyHostPath = await PtyHostPath.getPtyHostPath();
|
|
22
|
+
const ptyHost = await IpcParent.create({
|
|
23
|
+
method,
|
|
24
|
+
path: ptyHostPath,
|
|
25
|
+
argv: [],
|
|
26
|
+
stdio: 'inherit',
|
|
27
|
+
name: 'Terminal Process',
|
|
28
|
+
});
|
|
29
|
+
HandleIpc.handleIpc(ptyHost);
|
|
30
|
+
const handleClose = () => {
|
|
31
|
+
ptyHost.off('close', handleClose);
|
|
32
|
+
PtyHostState.state.ipc = undefined;
|
|
33
|
+
PtyHostState.state.ptyHostPromise = undefined;
|
|
34
|
+
};
|
|
35
|
+
ptyHost.on('close', handleClose);
|
|
36
|
+
PtyHostState.state.ipc = ptyHost;
|
|
37
|
+
return ptyHost;
|
|
38
|
+
};
|
|
43
39
|
export const getOrCreate = (method = IpcParentType.NodeForkedProcess) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
40
|
+
Debug.debug('creating pty host');
|
|
41
|
+
if (!PtyHostState.state.ptyHostPromise) {
|
|
42
|
+
PtyHostState.state.ptyHostPromise = createPtyHost(method);
|
|
43
|
+
}
|
|
44
|
+
return PtyHostState.state.ptyHostPromise;
|
|
45
|
+
};
|
|
51
46
|
export const getCurrentInstance = () => {
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
47
|
+
return PtyHostState.state.ipc;
|
|
48
|
+
};
|
|
55
49
|
export const disposeAll = () => {
|
|
56
|
-
if (PtyHostState.state.ipc) {
|
|
57
|
-
PtyHostState.state.ipc.removeAllListeners()
|
|
58
50
|
if (PtyHostState.state.ipc) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
51
|
+
PtyHostState.state.ipc.removeAllListeners();
|
|
52
|
+
if (PtyHostState.state.ipc) {
|
|
53
|
+
PtyHostState.state.ipc.dispose();
|
|
54
|
+
PtyHostState.state.ipc = undefined;
|
|
55
|
+
}
|
|
56
|
+
PtyHostState.state.ptyHostState = /* None */ 0;
|
|
57
|
+
PtyHostState.state.send = (message) => {
|
|
58
|
+
PtyHostState.state.pendingMessages.push(message);
|
|
59
|
+
};
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
61
|
+
};
|
|
69
62
|
export const invoke = (method, ...params) => {
|
|
70
|
-
|
|
71
|
-
}
|
|
63
|
+
return JsonRpc.invoke(PtyHostState.state.ipc, method, ...params);
|
|
64
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as Root from '../Root/Root.js'
|
|
2
|
-
import * as Path from '../Path/Path.js'
|
|
3
|
-
|
|
1
|
+
import * as Root from '../Root/Root.js';
|
|
2
|
+
import * as Path from '../Path/Path.js';
|
|
4
3
|
export const getPtyHostPath = async () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
4
|
+
try {
|
|
5
|
+
const { ptyHostPath } = await import('@lvce-editor/pty-host');
|
|
6
|
+
return ptyHostPath;
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return Path.join(Root.root, 'packages', 'pty-host', 'src', 'ptyHostMain.js');
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const state = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
2
|
+
/**
|
|
3
|
+
* @type {any}
|
|
4
|
+
*/
|
|
5
|
+
ipc: undefined,
|
|
6
|
+
/**
|
|
7
|
+
* @type {any}
|
|
8
|
+
*/
|
|
9
|
+
ptyHostPromise: undefined,
|
|
10
|
+
/**
|
|
11
|
+
* @type {any[]}
|
|
12
|
+
*/
|
|
13
|
+
pendingMessages: [],
|
|
14
|
+
send(message) {
|
|
15
|
+
state.pendingMessages.push(message);
|
|
16
|
+
},
|
|
17
|
+
};
|
package/src/parts/Queue/Queue.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
export const state = {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
2
|
+
queueMap: Object.create(null),
|
|
3
|
+
};
|
|
5
4
|
const run = async (queue) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
queue.state = 'running'
|
|
10
|
-
let item
|
|
11
|
-
while ((item = queue.items.shift())) {
|
|
12
|
-
try {
|
|
13
|
-
await item.fn()
|
|
14
|
-
item.resolve()
|
|
15
|
-
} catch (error) {
|
|
16
|
-
item.reject(error)
|
|
5
|
+
if (queue.state === 'running') {
|
|
6
|
+
return;
|
|
17
7
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
queue.state = 'running';
|
|
9
|
+
let item;
|
|
10
|
+
while ((item = queue.items.shift())) {
|
|
11
|
+
try {
|
|
12
|
+
await item.fn();
|
|
13
|
+
item.resolve();
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
item.reject(error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
queue.state = 'idle';
|
|
20
|
+
};
|
|
22
21
|
export const add = async (key, fn) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
22
|
+
const queue = (state.queueMap[key] ||= {
|
|
23
|
+
state: 'idle',
|
|
24
|
+
items: [],
|
|
25
|
+
});
|
|
26
|
+
await new Promise((resolve, reject) => {
|
|
27
|
+
queue.items.push({
|
|
28
|
+
fn,
|
|
29
|
+
resolve,
|
|
30
|
+
reject,
|
|
31
|
+
});
|
|
32
|
+
run(queue);
|
|
33
|
+
});
|
|
34
|
+
};
|