@lvce-editor/shared-process 0.25.9 → 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 +5 -6
- 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 +10 -14
- package/src/parts/ContentSecurityPolicyState/ContentSecurityPolicyState.js +5 -7
- package/src/parts/ContentSecurityPolicySyntaxHighlightingWorker/ContentSecurityPolicySyntaxHighlightingWorker.js +2 -0
- package/src/parts/ContentSecurityPolicyTerminalWorker/ContentSecurityPolicyTerminalWorker.js +2 -4
- package/src/parts/ContentSecurityPolicyTestWorker/ContentSecurityPolicyTestWorker.js +2 -4
- package/src/parts/ContentSecurityPolicyWorker/ContentSecurityPolicyWorker.js +7 -12
- 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 +5 -0
- 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 -48
- 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 +9 -0
- 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 -153
- 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
- package/src/parts/ChromeExtension/ChromeExtension.ipc.js +0 -8
- package/src/parts/ChromeExtension/ChromeExtension.js +0 -46
- package/src/parts/ExtractZip/ExtractZip.js +0 -12
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import * as GetBrowserWindowOptions from '../GetBrowserWindowOptions/GetBrowserWindowOptions.js'
|
|
2
|
-
import * as Platform from '../Platform/Platform.js'
|
|
3
|
-
|
|
1
|
+
import * as GetBrowserWindowOptions from '../GetBrowserWindowOptions/GetBrowserWindowOptions.js';
|
|
2
|
+
import * as Platform from '../Platform/Platform.js';
|
|
4
3
|
export const getAppWindowOptions = (preferences, screenWidth, screenHeight) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
4
|
+
const titleBarPreference = preferences['window.titleBarStyle'];
|
|
5
|
+
const frame = titleBarPreference !== 'custom';
|
|
6
|
+
const titleBarStyle = titleBarPreference === 'custom' ? 'hidden' : undefined;
|
|
7
|
+
const zoomLevelPreference = preferences['window.zoomLevel'];
|
|
8
|
+
const zoomLevel = zoomLevelPreference;
|
|
9
|
+
const windowControlsOverlayPreference = (Platform.isWindows || Platform.isMacOs) && preferences['window.controlsOverlay.enabled'];
|
|
10
|
+
const titleBarOverlay = windowControlsOverlayPreference
|
|
11
|
+
? {
|
|
12
|
+
color: '#1e2324',
|
|
13
|
+
symbolColor: '#74b1be',
|
|
14
|
+
height: 29,
|
|
15
|
+
}
|
|
16
|
+
: undefined;
|
|
17
|
+
return GetBrowserWindowOptions.getBrowserWindowOptions({
|
|
18
|
+
y: 0,
|
|
19
|
+
x: screenWidth - 800,
|
|
20
|
+
width: 800,
|
|
21
|
+
height: screenHeight,
|
|
22
|
+
background: '#1e2324',
|
|
23
|
+
titleBarStyle,
|
|
24
|
+
frame,
|
|
25
|
+
titleBarOverlay,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import * as GetIcon from '../GetIcon/GetIcon.js'
|
|
2
|
-
import * as GetPreloadUrl from '../GetPreloadUrl/GetPreloadUrl.js'
|
|
3
|
-
|
|
1
|
+
import * as GetIcon from '../GetIcon/GetIcon.js';
|
|
2
|
+
import * as GetPreloadUrl from '../GetPreloadUrl/GetPreloadUrl.js';
|
|
4
3
|
/**
|
|
5
4
|
*
|
|
6
5
|
* @returns {any}
|
|
7
6
|
*/
|
|
8
7
|
export const getBrowserWindowOptions = ({ x, y, width, height, titleBarStyle, titleBarOverlay, frame, background }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
8
|
+
const icon = GetIcon.getIcon();
|
|
9
|
+
return {
|
|
10
|
+
x,
|
|
11
|
+
y,
|
|
12
|
+
width,
|
|
13
|
+
height,
|
|
14
|
+
autoHideMenuBar: true,
|
|
15
|
+
titleBarStyle,
|
|
16
|
+
titleBarOverlay,
|
|
17
|
+
frame,
|
|
18
|
+
webPreferences: {
|
|
19
|
+
enableWebSQL: false,
|
|
20
|
+
spellcheck: false,
|
|
21
|
+
sandbox: true,
|
|
22
|
+
contextIsolation: true,
|
|
23
|
+
v8CacheOptions: 'bypassHeatCheck', // TODO this is what vscode uses, but it doesn't work properly in electron https://github.com/electron/electron/issues/27075
|
|
24
|
+
preload: GetPreloadUrl.getPreloadUrl(),
|
|
25
|
+
additionalArguments: ['--lvce-window-kind'],
|
|
26
|
+
},
|
|
27
|
+
backgroundColor: background,
|
|
28
|
+
show: false,
|
|
29
|
+
icon,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import * as DirentType from '../DirentType/DirentType.js'
|
|
2
|
-
|
|
1
|
+
import * as DirentType from '../DirentType/DirentType.js';
|
|
3
2
|
/**
|
|
4
3
|
* @param {import('fs').Dirent|import('fs').StatsBase} dirent
|
|
5
4
|
*/
|
|
6
5
|
export const getDirentType = (dirent) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
6
|
+
if (dirent.isFile()) {
|
|
7
|
+
return DirentType.File;
|
|
8
|
+
}
|
|
9
|
+
if (dirent.isDirectory()) {
|
|
10
|
+
return DirentType.Directory;
|
|
11
|
+
}
|
|
12
|
+
if (dirent.isSymbolicLink()) {
|
|
13
|
+
return DirentType.Symlink;
|
|
14
|
+
}
|
|
15
|
+
if (dirent.isSocket()) {
|
|
16
|
+
return DirentType.Socket;
|
|
17
|
+
}
|
|
18
|
+
if (dirent.isBlockDevice()) {
|
|
19
|
+
return DirentType.BlockDevice;
|
|
20
|
+
}
|
|
21
|
+
if (dirent.isCharacterDevice()) {
|
|
22
|
+
return DirentType.CharacterDevice;
|
|
23
|
+
}
|
|
24
|
+
if (dirent.isFIFO()) {
|
|
25
|
+
return DirentType.Fifo;
|
|
26
|
+
}
|
|
27
|
+
return DirentType.Unknown;
|
|
28
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as GetElectronFileResponse from './GetElectronFileResponse.js'
|
|
2
|
-
|
|
3
|
-
export const name = 'GetElectronFileResponse'
|
|
4
|
-
|
|
1
|
+
import * as GetElectronFileResponse from './GetElectronFileResponse.js';
|
|
2
|
+
export const name = 'GetElectronFileResponse';
|
|
5
3
|
export const Commands = {
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
getElectronFileResponse: GetElectronFileResponse.getElectronFileResponse,
|
|
5
|
+
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { stat } from 'fs/promises'
|
|
2
|
-
import * as GetElectronFileResponseAbsolutePath from '../GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js'
|
|
3
|
-
import * as GetElectronFileResponseContent from '../GetElectronFileResponseContent/GetElectronFileResponseContent.js'
|
|
4
|
-
import * as GetElectronFileResponseRelativePath from '../GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js'
|
|
5
|
-
import * as GetEtag from '../GetEtag/GetEtag.js'
|
|
6
|
-
import * as GetHeaders from '../GetHeaders/GetHeaders.js'
|
|
7
|
-
import * as GetNotFoundResponse from '../GetNotFoundResponse/GetNotFoundResponse.js'
|
|
8
|
-
import * as GetNotModifiedResponse from '../GetNotModifiedResponse/GetNotModifiedResponse.js'
|
|
9
|
-
import * as GetServerErrorResponse from '../GetServerErrorResponse/GetServerErrorResponse.js'
|
|
10
|
-
import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.js'
|
|
11
|
-
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js'
|
|
12
|
-
import * as Logger from '../Logger/Logger.js'
|
|
13
|
-
|
|
1
|
+
import { stat } from 'fs/promises';
|
|
2
|
+
import * as GetElectronFileResponseAbsolutePath from '../GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js';
|
|
3
|
+
import * as GetElectronFileResponseContent from '../GetElectronFileResponseContent/GetElectronFileResponseContent.js';
|
|
4
|
+
import * as GetElectronFileResponseRelativePath from '../GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js';
|
|
5
|
+
import * as GetEtag from '../GetEtag/GetEtag.js';
|
|
6
|
+
import * as GetHeaders from '../GetHeaders/GetHeaders.js';
|
|
7
|
+
import * as GetNotFoundResponse from '../GetNotFoundResponse/GetNotFoundResponse.js';
|
|
8
|
+
import * as GetNotModifiedResponse from '../GetNotModifiedResponse/GetNotModifiedResponse.js';
|
|
9
|
+
import * as GetServerErrorResponse from '../GetServerErrorResponse/GetServerErrorResponse.js';
|
|
10
|
+
import * as HttpStatusCode from '../HttpStatusCode/HttpStatusCode.js';
|
|
11
|
+
import * as IsEnoentError from '../IsEnoentError/IsEnoentError.js';
|
|
12
|
+
import * as Logger from '../Logger/Logger.js';
|
|
14
13
|
export const getElectronFileResponse = async (url, request) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
try {
|
|
15
|
+
const pathName = GetElectronFileResponseRelativePath.getElectronFileResponseRelativePath(url);
|
|
16
|
+
const absolutePath = GetElectronFileResponseAbsolutePath.getElectronFileResponseAbsolutePath(pathName);
|
|
17
|
+
let etag;
|
|
18
|
+
if (request) {
|
|
19
|
+
const stats = await stat(absolutePath);
|
|
20
|
+
etag = GetEtag.getEtag(stats);
|
|
21
|
+
if (request.headers['if-none-match'] === etag) {
|
|
22
|
+
return GetNotModifiedResponse.getNotModifiedResponse();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const content = await GetElectronFileResponseContent.getElectronFileResponseContent(request, absolutePath, url);
|
|
26
|
+
const headers = GetHeaders.getHeaders(absolutePath, pathName);
|
|
27
|
+
headers['Cache-Control'] = 'public, max-age=0, must-revalidate';
|
|
28
|
+
if (etag) {
|
|
29
|
+
headers['Etag'] = etag;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
body: content,
|
|
33
|
+
init: {
|
|
34
|
+
status: HttpStatusCode.Ok,
|
|
35
|
+
headers,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
25
38
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (IsEnoentError.isEnoentError(error)) {
|
|
41
|
+
return GetNotFoundResponse.getNotFoundResponse();
|
|
42
|
+
}
|
|
43
|
+
Logger.error(error);
|
|
44
|
+
return GetServerErrorResponse.getServerErrorResponse();
|
|
31
45
|
}
|
|
32
|
-
|
|
33
|
-
body: content,
|
|
34
|
-
init: {
|
|
35
|
-
status: HttpStatusCode.Ok,
|
|
36
|
-
headers,
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
if (IsEnoentError.isEnoentError(error)) {
|
|
41
|
-
return GetNotFoundResponse.getNotFoundResponse()
|
|
42
|
-
}
|
|
43
|
-
Logger.error(error)
|
|
44
|
-
return GetServerErrorResponse.getServerErrorResponse()
|
|
45
|
-
}
|
|
46
|
-
}
|
|
46
|
+
};
|
package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import { tmpdir } from 'node:os'
|
|
2
|
-
import { join } from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
import * as Path from '../Path/Path.js'
|
|
5
|
-
import * as Platform from '../Platform/Platform.js'
|
|
6
|
-
import * as Root from '../Root/Root.js'
|
|
7
|
-
|
|
1
|
+
import { tmpdir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import * as Path from '../Path/Path.js';
|
|
5
|
+
import * as Platform from '../Platform/Platform.js';
|
|
6
|
+
import * as Root from '../Root/Root.js';
|
|
8
7
|
export const getElectronFileResponseAbsolutePath = (pathName) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (pathName.startsWith(`/packages`)) {
|
|
14
|
-
return Path.join(Root.root, pathName)
|
|
15
|
-
}
|
|
16
|
-
if (pathName.startsWith(`/static`)) {
|
|
17
|
-
return Path.join(Root.root, pathName)
|
|
18
|
-
}
|
|
19
|
-
if (pathName.startsWith(`/extensions`)) {
|
|
20
|
-
return Path.join(Root.root, pathName)
|
|
21
|
-
}
|
|
22
|
-
// TODO maybe have a separate protocol for remote, e.g. vscode has vscode-remote
|
|
23
|
-
if (pathName.startsWith(`/remote`)) {
|
|
24
|
-
const uri = pathName.slice('/remote'.length)
|
|
25
|
-
if (Platform.isWindows) {
|
|
26
|
-
return fileURLToPath(`file://` + uri)
|
|
8
|
+
// TODO remove if/else in prod (use replacement)
|
|
9
|
+
if (pathName === `/` || pathName.startsWith(`/?`)) {
|
|
10
|
+
return Path.join(Root.root, 'static', 'index.html');
|
|
27
11
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
if (pathName.startsWith(`/packages`)) {
|
|
13
|
+
return Path.join(Root.root, pathName);
|
|
14
|
+
}
|
|
15
|
+
if (pathName.startsWith(`/static`)) {
|
|
16
|
+
return Path.join(Root.root, pathName);
|
|
17
|
+
}
|
|
18
|
+
if (pathName.startsWith(`/extensions`)) {
|
|
19
|
+
return Path.join(Root.root, pathName);
|
|
20
|
+
}
|
|
21
|
+
// TODO maybe have a separate protocol for remote, e.g. vscode has vscode-remote
|
|
22
|
+
if (pathName.startsWith(`/remote`)) {
|
|
23
|
+
const uri = pathName.slice('/remote'.length);
|
|
24
|
+
if (Platform.isWindows) {
|
|
25
|
+
return fileURLToPath(`file://` + uri);
|
|
26
|
+
}
|
|
27
|
+
return uri;
|
|
28
|
+
}
|
|
29
|
+
if (pathName.startsWith('/process-explorer/process-explorer-theme.css')) {
|
|
30
|
+
const processExplorerThemeCss = join(tmpdir(), 'process-explorer-theme.css');
|
|
31
|
+
return processExplorerThemeCss;
|
|
32
|
+
}
|
|
33
|
+
return Path.join(Root.root, 'static', pathName);
|
|
34
|
+
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises'
|
|
2
|
-
import * as Platform from '../Platform/Platform.js'
|
|
3
|
-
import * as ShouldTranspileTypescript from '../ShouldTranspileTypescript/ShouldTranspileTypescript.js'
|
|
4
|
-
import * as TranspileTypeScript from '../TranspileTypeScript/TranspileTypeScript.js'
|
|
5
|
-
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import * as Platform from '../Platform/Platform.js';
|
|
3
|
+
import * as ShouldTranspileTypescript from '../ShouldTranspileTypescript/ShouldTranspileTypescript.js';
|
|
4
|
+
import * as TranspileTypeScript from '../TranspileTypeScript/TranspileTypeScript.js';
|
|
6
5
|
export const getElectronFileResponseContent = async (request, absolutePath, url) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
6
|
+
let content = await readFile(absolutePath);
|
|
7
|
+
if (ShouldTranspileTypescript.shouldTranspileTypescript(request, url)) {
|
|
8
|
+
const newContent = await TranspileTypeScript.transpileTypeScript(content.toString());
|
|
9
|
+
content = newContent.outputText;
|
|
10
|
+
}
|
|
11
|
+
if (!Platform.isProduction && url === `${Platform.scheme}://-/`) {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
content = content.toString().replace(' <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />\n', '');
|
|
14
|
+
}
|
|
15
|
+
return content;
|
|
16
|
+
};
|
package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import * as Platform from '../Platform/Platform.js'
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
const
|
|
5
|
-
const prefixLength = prefix.length
|
|
6
|
-
|
|
1
|
+
import * as Platform from '../Platform/Platform.js';
|
|
2
|
+
const { scheme } = Platform;
|
|
3
|
+
const prefix = `${scheme}://-`;
|
|
4
|
+
const prefixLength = prefix.length;
|
|
7
5
|
export const getElectronFileResponseRelativePath = (requestUrl) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
if (requestUrl.startsWith('/')) {
|
|
7
|
+
return requestUrl;
|
|
8
|
+
}
|
|
9
|
+
const decoded = decodeURI(requestUrl);
|
|
10
|
+
const pathName = decoded.slice(prefixLength);
|
|
11
|
+
return pathName;
|
|
12
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as IsWindows from '../IsWindows/IsWindows.js'
|
|
2
|
-
import * as Path from '../Path/Path.js'
|
|
3
|
-
import * as Root from '../Root/Root.js'
|
|
4
|
-
|
|
1
|
+
import * as IsWindows from '../IsWindows/IsWindows.js';
|
|
2
|
+
import * as Path from '../Path/Path.js';
|
|
3
|
+
import * as Root from '../Root/Root.js';
|
|
5
4
|
export const getElectronRebuildPath = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
5
|
+
if (IsWindows.isWindows) {
|
|
6
|
+
return Path.join(Root.root, 'packages', 'main-process', 'node_modules', '.bin', 'electron-rebuild.cmd');
|
|
7
|
+
}
|
|
8
|
+
return Path.join(Root.root, 'packages', 'main-process', 'node_modules', '.bin', 'electron-rebuild');
|
|
9
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const getEtag = (fileStat) => {
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
return `W/"${[fileStat.ino, fileStat.size, fileStat.mtime.getTime()].join('-')}"`;
|
|
3
|
+
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import * as Promises from '../Promises/Promises.js'
|
|
2
|
-
|
|
1
|
+
import * as Promises from '../Promises/Promises.js';
|
|
3
2
|
export const getFirstEvent = (eventEmitter, eventMap) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const { resolve, promise } = Promises.withResolvers();
|
|
4
|
+
const listenerMap = Object.create(null);
|
|
5
|
+
const cleanup = (value) => {
|
|
6
|
+
for (const event of Object.keys(eventMap)) {
|
|
7
|
+
eventEmitter.off(event, listenerMap[event]);
|
|
8
|
+
}
|
|
9
|
+
resolve(value);
|
|
10
|
+
};
|
|
11
|
+
for (const [event, type] of Object.entries(eventMap)) {
|
|
12
|
+
const listener = (event) => {
|
|
13
|
+
cleanup({
|
|
14
|
+
type,
|
|
15
|
+
event,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
eventEmitter.on(event, listener);
|
|
19
|
+
listenerMap[event] = listener;
|
|
9
20
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (const [event, type] of Object.entries(eventMap)) {
|
|
13
|
-
const listener = (event) => {
|
|
14
|
-
cleanup({
|
|
15
|
-
type,
|
|
16
|
-
event,
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
eventEmitter.on(event, listener)
|
|
20
|
-
listenerMap[event] = listener
|
|
21
|
-
}
|
|
22
|
-
return promise
|
|
23
|
-
}
|
|
21
|
+
return promise;
|
|
22
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js'
|
|
2
|
-
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js'
|
|
3
|
-
|
|
1
|
+
import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js';
|
|
2
|
+
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js';
|
|
4
3
|
export const getFirstNodeWorkerEvent = (worker) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
return GetFirstEvent.getFirstEvent(worker, {
|
|
5
|
+
exit: FirstNodeWorkerEventType.Exit,
|
|
6
|
+
error: FirstNodeWorkerEventType.Error,
|
|
7
|
+
});
|
|
8
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js'
|
|
2
|
-
import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js'
|
|
3
|
-
|
|
1
|
+
import * as GetFirstEvent from '../GetFirstEvent/GetFirstEvent.js';
|
|
2
|
+
import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js';
|
|
4
3
|
export const getFirstSpawnedProcessEvent = (childProcess) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
return GetFirstEvent.getFirstEvent(childProcess, {
|
|
5
|
+
error: FirstNodeWorkerEventType.Error,
|
|
6
|
+
exit: FirstNodeWorkerEventType.Exit,
|
|
7
|
+
});
|
|
8
|
+
};
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { extname } from 'path'
|
|
2
|
-
import * as GetHeadersDefault from '../GetHeadersDefault/GetHeadersDefault.js'
|
|
3
|
-
import * as GetHeadersExtensionHostWorker from '../GetHeadersExtensionHostWorker/GetHeadersExtensionHostWorker.js'
|
|
4
|
-
import * as GetHeadersMainFrame from '../GetHeadersMainFrame/GetHeadersMainFrame.js'
|
|
5
|
-
import * as GetHeadersOtherWorker from '../GetHeadersOtherWorker/GetHeadersOtherWorker.js'
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as GetHeadersTerminalWorker from '../GetHeadersTerminalWorker/GetHeadersTerminalWorker.js'
|
|
9
|
-
import * as GetHeadersTestWorker from '../GetHeadersTestWorker/GetHeadersTestWorker.js'
|
|
10
|
-
import * as GetMimeType from '../GetMimeType/GetMimeType.js'
|
|
11
|
-
|
|
1
|
+
import { extname } from 'path';
|
|
2
|
+
import * as GetHeadersDefault from '../GetHeadersDefault/GetHeadersDefault.js';
|
|
3
|
+
import * as GetHeadersExtensionHostWorker from '../GetHeadersExtensionHostWorker/GetHeadersExtensionHostWorker.js';
|
|
4
|
+
import * as GetHeadersMainFrame from '../GetHeadersMainFrame/GetHeadersMainFrame.js';
|
|
5
|
+
import * as GetHeadersOtherWorker from '../GetHeadersOtherWorker/GetHeadersOtherWorker.js';
|
|
6
|
+
import * as GetHeadersRendererWorker from '../GetHeadersRendererWorker/GetHeadersRendererWorker.js';
|
|
7
|
+
import * as GetHeadersSyntaxHighlightingWorker from '../GetHeadersSyntaxHighlightingWorker/GetHeadersSyntaxHighlightingWorker.js';
|
|
8
|
+
import * as GetHeadersTerminalWorker from '../GetHeadersTerminalWorker/GetHeadersTerminalWorker.js';
|
|
9
|
+
import * as GetHeadersTestWorker from '../GetHeadersTestWorker/GetHeadersTestWorker.js';
|
|
10
|
+
import * as GetMimeType from '../GetMimeType/GetMimeType.js';
|
|
11
|
+
import * as HttpHeader from '../HttpHeader/HttpHeader.js';
|
|
12
12
|
const getExtraHeaders = (pathName, fileExtension) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
switch (fileExtension) {
|
|
14
|
+
case '.html':
|
|
15
|
+
return GetHeadersMainFrame.getHeadersMainFrame();
|
|
16
|
+
case '.js':
|
|
17
|
+
case '.ts':
|
|
18
|
+
if (pathName.endsWith('testWorkerMain.js') || pathName.endsWith('testWorkerMain.ts')) {
|
|
19
|
+
return GetHeadersTestWorker.getHeadersExtensionHostWorker();
|
|
20
|
+
}
|
|
21
|
+
if (pathName.endsWith('rendererWorkerMain.js') || pathName.endsWith('rendererWorkerMain.ts')) {
|
|
22
|
+
return GetHeadersRendererWorker.getHeadersRendererWorker();
|
|
23
|
+
}
|
|
24
|
+
if (pathName.endsWith('extensionHostWorkerMain.js') || pathName.endsWith('extensionHostWorkerMain.ts')) {
|
|
25
|
+
return GetHeadersExtensionHostWorker.getHeadersExtensionHostWorker();
|
|
26
|
+
}
|
|
27
|
+
if (pathName.endsWith('terminalWorkerMain.js') || pathName.endsWith('terminalWorkerMain.ts')) {
|
|
28
|
+
return GetHeadersTerminalWorker.getHeadersTerminalWorker();
|
|
29
|
+
}
|
|
30
|
+
if (pathName.endsWith('syntaxHighlightingWorkerMain.js') || pathName.endsWith('syntaxHighlightingWorkerMain.ts')) {
|
|
31
|
+
return GetHeadersSyntaxHighlightingWorker.getHeadersSyntaxHighlightingWorker();
|
|
32
|
+
}
|
|
33
|
+
if (pathName.endsWith('WorkerMain.js') || pathName.endsWith('WorkerMain.ts')) {
|
|
34
|
+
return GetHeadersOtherWorker.getHeadersOtherWorker(pathName);
|
|
35
|
+
}
|
|
36
|
+
return GetHeadersDefault.getHeadersDefault();
|
|
37
|
+
default:
|
|
38
|
+
return GetHeadersDefault.getHeadersDefault();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
39
41
|
export const getHeaders = (absolutePath, pathName) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
42
|
+
const extension = extname(absolutePath);
|
|
43
|
+
const mime = GetMimeType.getMimeType(extension);
|
|
44
|
+
const headers = {
|
|
45
|
+
[HttpHeader.ContentType]: mime,
|
|
46
|
+
};
|
|
47
|
+
const extraHeaders = getExtraHeaders(pathName, extension);
|
|
48
|
+
return {
|
|
49
|
+
...headers,
|
|
50
|
+
...extraHeaders,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const getHeadersDefault = () => {
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
return {};
|
|
3
|
+
};
|