@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,62 +1,57 @@
|
|
|
1
1
|
// see https://www.cyberciti.biz/faq/how-do-i-copy-a-file-to-the-clipboard-in-linux
|
|
2
2
|
// see also http://manpages.ubuntu.com/manpages/bionic/man1/xclip.1.html
|
|
3
3
|
// on gnome, get current selection targets with `xclip -selection clipboard -t TARGETS -o`
|
|
4
|
-
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import { VError } from '../VError/VError.js'
|
|
9
|
-
|
|
4
|
+
import * as Exec from '../Exec/Exec.js';
|
|
5
|
+
import * as JoinLines from '../JoinLines/JoinLines.js';
|
|
6
|
+
import * as SplitLines from '../SplitLines/SplitLines.js';
|
|
7
|
+
import { VError } from '../VError/VError.js';
|
|
10
8
|
const removePrefix = (file) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
9
|
+
if (file.startsWith('file://')) {
|
|
10
|
+
return file.slice('file://'.length);
|
|
11
|
+
}
|
|
12
|
+
return file;
|
|
13
|
+
};
|
|
17
14
|
const addPrefix = (file) => {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
15
|
+
return `file://${file}`;
|
|
16
|
+
};
|
|
21
17
|
export const readFiles = async () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
let result;
|
|
19
|
+
try {
|
|
20
|
+
result = await Exec.exec('xclip', ['-selection', 'clipboard', '-o', '-t', 'x-special/gnome-copied-files'], {});
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error &&
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
error.stderr === 'Error: target x-special/gnome-copied-files not available') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
throw error;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
30
|
+
const [type, ...files] = SplitLines.splitLines(result.stdout);
|
|
31
|
+
const actualFiles = files.map(removePrefix);
|
|
32
|
+
return {
|
|
33
|
+
source: 'gnomeCopiedFiles',
|
|
34
|
+
type,
|
|
35
|
+
files: actualFiles,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
44
38
|
export const writeFiles = async (type, files) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
39
|
+
const filesWithPrefix = files.map(addPrefix);
|
|
40
|
+
const gnomeCopiedFilesContent = JoinLines.joinLines([type, ...filesWithPrefix]);
|
|
41
|
+
const uriListContent = JoinLines.joinLines(filesWithPrefix);
|
|
42
|
+
const plainContent = JoinLines.joinLines(files);
|
|
43
|
+
try {
|
|
44
|
+
await Exec.exec('xclip', ['-i', '-selection', 'clipboard', '-t', 'x-special/gnome-copied-files'], {
|
|
45
|
+
input: gnomeCopiedFilesContent,
|
|
46
|
+
});
|
|
47
|
+
await Exec.exec('xclip', ['-i', '-selection', 'clipboard', '-t', 'text/uri-list'], {
|
|
48
|
+
input: uriListContent,
|
|
49
|
+
});
|
|
50
|
+
await Exec.exec('xclip', ['-i', '-selection', 'clipboard', '-t', 'text/plain'], {
|
|
51
|
+
input: plainContent,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
throw new VError(error, 'Failed to copy files to clipboard');
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import * as Desktop from '../Desktop/Desktop.js'
|
|
2
|
-
|
|
1
|
+
import * as Desktop from '../Desktop/Desktop.js';
|
|
3
2
|
export const readFiles = async () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
3
|
+
return {
|
|
4
|
+
source: 'notSupported',
|
|
5
|
+
type: 'none',
|
|
6
|
+
files: [],
|
|
7
|
+
};
|
|
8
|
+
};
|
|
11
9
|
export const writeFiles = (type, files) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
10
|
+
const desktop = Desktop.getDesktop();
|
|
11
|
+
console.info(`writing files to clipboard is not yet supported on ${desktop}`);
|
|
12
|
+
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
import clipboardEx from 'electron-clipboard-ex'
|
|
3
|
-
import { VError } from '../VError/VError.js'
|
|
4
|
-
|
|
2
|
+
import clipboardEx from 'electron-clipboard-ex';
|
|
3
|
+
import { VError } from '../VError/VError.js';
|
|
5
4
|
export const readFiles = async () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
5
|
+
const filePaths = clipboardEx.readFilePaths();
|
|
6
|
+
console.log(filePaths);
|
|
7
|
+
return {
|
|
8
|
+
source: 'electron-clipboard-ex',
|
|
9
|
+
type: 'copy', // TODO can't be sure on this
|
|
10
|
+
files: filePaths,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
15
13
|
export const writeFiles = async (type, files) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
14
|
+
try {
|
|
15
|
+
clipboardEx.writeFilePaths(files);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
throw new VError(error, 'Failed to copy files to clipboard');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -1,103 +1,93 @@
|
|
|
1
|
-
import { Writable } from 'node:stream'
|
|
2
|
-
import { pipeline } from 'node:stream/promises'
|
|
3
|
-
import * as EncodingType from '../EncodingType/EncodingType.js'
|
|
4
|
-
import * as GetNewLineIndex from '../GetNewLineIndex/GetNewLineIndex.js'
|
|
5
|
-
import * as RipGrepParsedLineType from '../RipGrepParsedLineType/RipGrepParsedLineType.js'
|
|
6
|
-
import * as TextSearchResultType from '../TextSearchResultType/TextSearchResultType.js'
|
|
7
|
-
import * as ToTextSearchResult from '../ToTextSearchResult/ToTextSearchResult.js'
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import { pipeline } from 'node:stream/promises';
|
|
3
|
+
import * as EncodingType from '../EncodingType/EncodingType.js';
|
|
4
|
+
import * as GetNewLineIndex from '../GetNewLineIndex/GetNewLineIndex.js';
|
|
5
|
+
import * as RipGrepParsedLineType from '../RipGrepParsedLineType/RipGrepParsedLineType.js';
|
|
6
|
+
import * as TextSearchResultType from '../TextSearchResultType/TextSearchResultType.js';
|
|
7
|
+
import * as ToTextSearchResult from '../ToTextSearchResult/ToTextSearchResult.js';
|
|
8
8
|
// TODO update vscode-ripgrep when https://github.com/mhinz/vim-grepper/issues/244, https://github.com/BurntSushi/ripgrep/issues/1892 is fixed
|
|
9
|
-
|
|
10
9
|
// need to use '.' as last argument for ripgrep
|
|
11
10
|
// issue 1 https://github.com/nvim-telescope/telescope.nvim/pull/908/files
|
|
12
11
|
// issue 2 https://github.com/BurntSushi/ripgrep/issues/1892
|
|
13
12
|
// remove workaround when ripgrep is fixed
|
|
14
|
-
|
|
15
13
|
// TODO stats flag might not be necessary
|
|
16
14
|
// TODO update client
|
|
17
15
|
// TODO not always run nice, maybe configure nice via flag/options
|
|
18
|
-
|
|
19
16
|
export const collectStdout = async (childProcess, maxSearchResults, charsBefore, charsAfter) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
default:
|
|
53
|
-
break
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const handleData = (chunk) => {
|
|
58
|
-
let newLineIndex = GetNewLineIndex.getNewLineIndex(chunk)
|
|
59
|
-
const dataString = buffer + chunk
|
|
60
|
-
if (newLineIndex === -1) {
|
|
61
|
-
buffer = dataString
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
newLineIndex += buffer.length
|
|
65
|
-
let previousIndex = 0
|
|
66
|
-
while (newLineIndex >= 0) {
|
|
67
|
-
const line = dataString.slice(previousIndex, newLineIndex)
|
|
68
|
-
handleLine(line)
|
|
69
|
-
previousIndex = newLineIndex + 1
|
|
70
|
-
newLineIndex = GetNewLineIndex.getNewLineIndex(dataString, previousIndex)
|
|
71
|
-
}
|
|
72
|
-
buffer = dataString.slice(previousIndex)
|
|
73
|
-
|
|
74
|
-
if (numberOfResults > maxSearchResults) {
|
|
75
|
-
limitHit = true
|
|
76
|
-
childProcess.kill()
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
await pipeline(
|
|
81
|
-
childProcess.stdout,
|
|
82
|
-
new Writable({
|
|
83
|
-
decodeStrings: false,
|
|
84
|
-
construct(callback) {
|
|
85
|
-
callback()
|
|
86
|
-
},
|
|
87
|
-
write(chunk, encoding, callback) {
|
|
88
|
-
try {
|
|
89
|
-
handleData(chunk)
|
|
90
|
-
callback()
|
|
91
|
-
} catch (error) {
|
|
92
|
-
callback(error)
|
|
17
|
+
const allSearchResults = Object.create(null);
|
|
18
|
+
let buffer = '';
|
|
19
|
+
let stats = {};
|
|
20
|
+
let limitHit = false;
|
|
21
|
+
let numberOfResults = 0;
|
|
22
|
+
childProcess.stdout.setEncoding(EncodingType.Utf8);
|
|
23
|
+
const handleLine = (line) => {
|
|
24
|
+
const parsedLine = JSON.parse(line);
|
|
25
|
+
const { type, data } = parsedLine;
|
|
26
|
+
switch (type) {
|
|
27
|
+
case RipGrepParsedLineType.Begin:
|
|
28
|
+
allSearchResults[data.path.text] = [
|
|
29
|
+
{
|
|
30
|
+
type: TextSearchResultType.File,
|
|
31
|
+
start: 0,
|
|
32
|
+
end: 0,
|
|
33
|
+
lineNumber: 0,
|
|
34
|
+
text: data.path.text,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
break;
|
|
38
|
+
case RipGrepParsedLineType.Match:
|
|
39
|
+
const remaining = maxSearchResults - numberOfResults;
|
|
40
|
+
const matches = ToTextSearchResult.toTextSearchResult(parsedLine, remaining, charsBefore, charsAfter);
|
|
41
|
+
numberOfResults += matches.length;
|
|
42
|
+
allSearchResults[data.path.text].push(...matches);
|
|
43
|
+
break;
|
|
44
|
+
case RipGrepParsedLineType.Summary:
|
|
45
|
+
stats = data;
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
break;
|
|
93
49
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
50
|
+
};
|
|
51
|
+
const handleData = (chunk) => {
|
|
52
|
+
let newLineIndex = GetNewLineIndex.getNewLineIndex(chunk);
|
|
53
|
+
const dataString = buffer + chunk;
|
|
54
|
+
if (newLineIndex === -1) {
|
|
55
|
+
buffer = dataString;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
newLineIndex += buffer.length;
|
|
59
|
+
let previousIndex = 0;
|
|
60
|
+
while (newLineIndex >= 0) {
|
|
61
|
+
const line = dataString.slice(previousIndex, newLineIndex);
|
|
62
|
+
handleLine(line);
|
|
63
|
+
previousIndex = newLineIndex + 1;
|
|
64
|
+
newLineIndex = GetNewLineIndex.getNewLineIndex(dataString, previousIndex);
|
|
65
|
+
}
|
|
66
|
+
buffer = dataString.slice(previousIndex);
|
|
67
|
+
if (numberOfResults > maxSearchResults) {
|
|
68
|
+
limitHit = true;
|
|
69
|
+
childProcess.kill();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
await pipeline(childProcess.stdout, new Writable({
|
|
73
|
+
decodeStrings: false,
|
|
74
|
+
construct(callback) {
|
|
75
|
+
callback();
|
|
76
|
+
},
|
|
77
|
+
write(chunk, encoding, callback) {
|
|
78
|
+
try {
|
|
79
|
+
handleData(chunk);
|
|
80
|
+
callback();
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
callback(error);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
}));
|
|
87
|
+
const results = Object.values(allSearchResults).flat(1);
|
|
88
|
+
return {
|
|
89
|
+
results,
|
|
90
|
+
stats,
|
|
91
|
+
limitHit,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import * as JoinLines from '../JoinLines/JoinLines.js'
|
|
2
|
-
|
|
1
|
+
import * as JoinLines from '../JoinLines/JoinLines.js';
|
|
3
2
|
export const getColorThemeJson = async () => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
3
|
+
return {
|
|
4
|
+
MainBackground: '#1e2324',
|
|
5
|
+
TreeItemForeground: ` rgb(188, 190, 190)`,
|
|
6
|
+
FocusOutline: `#3d5252`,
|
|
7
|
+
};
|
|
8
|
+
};
|
|
11
9
|
const toInnerLine = ([key, value]) => {
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
10
|
+
return ` --${key}: ${value};`;
|
|
11
|
+
};
|
|
15
12
|
export const toCss = (colorThemeJson) => {
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const innerLines = Object.entries(colorThemeJson).map(toInnerLine);
|
|
14
|
+
const css = `:root {
|
|
18
15
|
${JoinLines.joinLines(innerLines)}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
16
|
+
}`;
|
|
17
|
+
return css;
|
|
18
|
+
};
|
|
@@ -1,80 +1,73 @@
|
|
|
1
|
-
import { CommandNotFoundError } from '../CommandNotFoundError/CommandNotFoundError.js'
|
|
2
|
-
import * as ModuleMap from '../ModuleMap/ModuleMap.js'
|
|
3
|
-
import { VError } from '../VError/VError.js'
|
|
4
|
-
|
|
1
|
+
import { CommandNotFoundError } from '../CommandNotFoundError/CommandNotFoundError.js';
|
|
2
|
+
import * as ModuleMap from '../ModuleMap/ModuleMap.js';
|
|
3
|
+
import { VError } from '../VError/VError.js';
|
|
5
4
|
export const state = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
5
|
+
commands: Object.create(null),
|
|
6
|
+
pendingModules: Object.create(null),
|
|
7
|
+
async load(moduleId) { },
|
|
8
|
+
};
|
|
11
9
|
const initializeModule = (module) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
if (module.Commands) {
|
|
11
|
+
for (const [key, value] of Object.entries(module.Commands)) {
|
|
12
|
+
if (module.name) {
|
|
13
|
+
const actualKey = `${module.name}.${key}`;
|
|
14
|
+
register(actualKey, value);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
register(key, value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
throw new Error(`module ${module.name} is missing an initialize function and commands`)
|
|
24
|
-
}
|
|
25
|
-
|
|
22
|
+
throw new Error(`module ${module.name} is missing an initialize function and commands`);
|
|
23
|
+
};
|
|
26
24
|
const loadModule = async (moduleId) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (error && error instanceof SyntaxError && error.stack === `SyntaxError: ${error.message}`) {
|
|
32
|
-
Error.captureStackTrace(error, loadModule)
|
|
25
|
+
try {
|
|
26
|
+
const module = await state.load(moduleId);
|
|
27
|
+
initializeModule(module);
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error && error instanceof SyntaxError && error.stack === `SyntaxError: ${error.message}`) {
|
|
31
|
+
Error.captureStackTrace(error, loadModule);
|
|
32
|
+
}
|
|
33
|
+
throw new VError(error, `failed to load module ${moduleId}`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
38
36
|
const getOrLoadModule = (moduleId) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
37
|
+
if (!state.pendingModules[moduleId]) {
|
|
38
|
+
state.pendingModules[moduleId] = loadModule(moduleId);
|
|
39
|
+
}
|
|
40
|
+
return state.pendingModules[moduleId];
|
|
41
|
+
};
|
|
45
42
|
const loadCommand = async (command) => {
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
43
|
+
await getOrLoadModule(ModuleMap.getModuleId(command));
|
|
44
|
+
};
|
|
49
45
|
export const register = (commandId, listener) => {
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const hasThrown = new Set()
|
|
54
|
-
|
|
46
|
+
state.commands[commandId] = listener;
|
|
47
|
+
};
|
|
48
|
+
const hasThrown = new Set();
|
|
55
49
|
const executeCommandAsync = async (command, ...args) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (!(command in state.commands)) {
|
|
62
|
-
if (hasThrown.has(command)) {
|
|
63
|
-
return
|
|
50
|
+
try {
|
|
51
|
+
await loadCommand(command);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw new VError(error, `Failed to load command ${command}`);
|
|
64
55
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
if (!(command in state.commands)) {
|
|
57
|
+
if (hasThrown.has(command)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
hasThrown.add(command);
|
|
61
|
+
throw new CommandNotFoundError(command);
|
|
62
|
+
}
|
|
63
|
+
return state.commands[command](...args);
|
|
64
|
+
};
|
|
71
65
|
export const execute = (command, ...args) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
66
|
+
if (command in state.commands) {
|
|
67
|
+
return state.commands[command](...args);
|
|
68
|
+
}
|
|
69
|
+
return executeCommandAsync(command, ...args);
|
|
70
|
+
};
|
|
78
71
|
export const setLoad = (load) => {
|
|
79
|
-
|
|
80
|
-
}
|
|
72
|
+
state.load = load;
|
|
73
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
|
|
2
|
-
import * as ProcessDisplayName from '../ProcessDisplayName/ProcessDisplayName.js'
|
|
3
|
-
|
|
1
|
+
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js';
|
|
2
|
+
import * as ProcessDisplayName from '../ProcessDisplayName/ProcessDisplayName.js';
|
|
4
3
|
export class CommandNotFoundError extends Error {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
constructor(id) {
|
|
5
|
+
super(`Command ${id} not found in ${ProcessDisplayName.processDisplayName}`);
|
|
6
|
+
this.name = 'CommandNotFoundError';
|
|
7
|
+
this.code = ErrorCodes.E_COMMAND_NOT_FOUND;
|
|
8
|
+
}
|
|
10
9
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const isGreater = (version, otherVersion) => {
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
return true;
|
|
3
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as ContentSecurityPolicy from './ContentSecurityPolicy.js'
|
|
2
|
-
|
|
3
|
-
export const name = 'ContentSecurityPolicy'
|
|
4
|
-
|
|
1
|
+
import * as ContentSecurityPolicy from './ContentSecurityPolicy.js';
|
|
2
|
+
export const name = 'ContentSecurityPolicy';
|
|
5
3
|
export const Commands = {
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
set: ContentSecurityPolicy.set,
|
|
5
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as Assert from '../Assert/Assert.js'
|
|
2
|
-
import * as ContentSecurityPolicyState from '../ContentSecurityPolicyState/ContentSecurityPolicyState.js'
|
|
3
|
-
|
|
1
|
+
import * as Assert from '../Assert/Assert.js';
|
|
2
|
+
import * as ContentSecurityPolicyState from '../ContentSecurityPolicyState/ContentSecurityPolicyState.js';
|
|
4
3
|
export const set = (url, contentSecurityPolicy) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
Assert.string(url);
|
|
5
|
+
Assert.string(contentSecurityPolicy);
|
|
6
|
+
ContentSecurityPolicyState.set(url, contentSecurityPolicy);
|
|
7
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js'
|
|
2
|
-
|
|
1
|
+
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
3
2
|
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
])
|
|
3
|
+
`default-src 'none'`,
|
|
4
|
+
`font-src 'self'`,
|
|
5
|
+
`frame-src *`,
|
|
6
|
+
`img-src 'self' https: data:`,
|
|
7
|
+
`script-src 'self'`,
|
|
8
|
+
`media-src 'self'`,
|
|
9
|
+
`style-src 'self'`,
|
|
10
|
+
]);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
const map = Object.create(null)
|
|
2
|
-
|
|
1
|
+
const map = Object.create(null);
|
|
3
2
|
export const set = (url, contentSecurityPolicy) => {
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
3
|
+
map[url] = contentSecurityPolicy;
|
|
4
|
+
};
|
|
7
5
|
export const get = (url) => {
|
|
8
|
-
|
|
9
|
-
}
|
|
6
|
+
return map[url];
|
|
7
|
+
};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js'
|
|
2
|
-
|
|
3
|
-
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`])
|
|
1
|
+
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
2
|
+
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`]);
|
package/src/parts/ContentSecurityPolicyTerminalWorker/ContentSecurityPolicyTerminalWorker.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js'
|
|
2
|
-
|
|
3
|
-
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`, `connect-src 'self'`])
|
|
1
|
+
import * as GetContentSecurityPolicy from '../GetContentSecurityPolicy/GetContentSecurityPolicy.js';
|
|
2
|
+
export const value = GetContentSecurityPolicy.getContentSecurityPolicy([`default-src 'none'`, `script-src 'self'`, `connect-src 'self'`]);
|