@lvce-editor/shared-process 0.85.3 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +12 -12
- package/src/parts/AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js +2 -2
- package/src/parts/AddSemiColon/AddSemiColon.js +4 -3
- package/src/parts/AppWindow/AppWindow.js +30 -22
- package/src/parts/ApplyEdit/ApplyEdit.js +7 -6
- package/src/parts/ApplyIncomingIpcResponse/ApplyIncomingIpcResponse.js +13 -12
- package/src/parts/Assert/Assert.js +1 -1
- package/src/parts/AttachDebugger/AttachDebugger.ipc.js +6 -4
- package/src/parts/AttachDebugger/AttachDebugger.js +5 -4
- package/src/parts/AuthProcess/AuthProcess.js +14 -12
- package/src/parts/AuthProcessPath/AuthProcessPath.js +4 -3
- package/src/parts/AuthProcessState/AuthProcessState.js +12 -9
- package/src/parts/Authority/Authority.js +1 -1
- package/src/parts/AutoUpdateType/AutoUpdateType.js +4 -4
- package/src/parts/AutoUpdater/AutoUpdater.ipc.js +5 -4
- package/src/parts/AutoUpdater/AutoUpdater.js +31 -31
- package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.ipc.js +7 -5
- package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.js +50 -49
- package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.ipc.js +5 -4
- package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.js +59 -58
- package/src/parts/BrowserWindowV8CacheOptions/BrowserWindowV8CacheOptions.js +4 -3
- package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +7 -6
- package/src/parts/BulkReplacement/BulkReplacement.ipc.js +6 -4
- package/src/parts/BulkReplacement/BulkReplacement.js +16 -16
- package/src/parts/BulkReplacementContent/BulkReplacementContent.js +27 -26
- 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/Clamp/Clamp.js +2 -2
- package/src/parts/Cli/Cli.js +14 -14
- package/src/parts/CliCommandType/CliCommandType.js +11 -11
- package/src/parts/CliHelp/CliHelp.js +9 -8
- package/src/parts/CliInstall/CliInstall.js +24 -24
- package/src/parts/CliLink/CliLink.js +17 -17
- package/src/parts/CliList/CliList.js +18 -15
- package/src/parts/CliModule/CliModule.js +27 -26
- package/src/parts/CliStatus/CliStatus.js +5 -4
- package/src/parts/CliUnlink/CliUnlink.js +17 -17
- package/src/parts/CliVersion/CliVersion.js +8 -7
- package/src/parts/ClipBoard/ClipBoard.ipc.js +7 -5
- package/src/parts/ClipBoard/ClipBoard.js +7 -5
- package/src/parts/ClipBoardProcess/ClipBoardProcess.js +19 -16
- package/src/parts/ClipBoardProcessPath/ClipBoardProcessPath.js +13 -3
- package/src/parts/ColorTheme/ColorTheme.js +18 -15
- package/src/parts/Command/Command.js +69 -62
- package/src/parts/CommandNotFoundError/CommandNotFoundError.js +10 -7
- package/src/parts/CompareVersion/CompareVersion.js +2 -2
- package/src/parts/ConnectIpcToElectron/ConnectIpcToElectron.js +20 -18
- package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.ipc.js +6 -4
- package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.js +7 -6
- package/src/parts/ContentSecurityPolicyDocument/ContentSecurityPolicyDocument.js +45 -39
- package/src/parts/ContentSecurityPolicyState/ContentSecurityPolicyState.js +7 -5
- package/src/parts/CpuProfile/CpuProfile.js +25 -22
- package/src/parts/Crash/Crash.ipc.js +5 -4
- package/src/parts/Crash/Crash.js +11 -8
- package/src/parts/CreateTestOverview/CreateTestOverview.js +7 -6
- package/src/parts/CreateTestOverviewHtml/CreateTestOverviewHtml.js +24 -21
- package/src/parts/CreateUtilityProcessRpc/CreateUtilityProcessRpc.js +6 -5
- package/src/parts/CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js +1 -1
- package/src/parts/CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js +2 -2
- package/src/parts/CrossOriginResourcePolicy/CrossOriginResourcePolicy.js +1 -1
- package/src/parts/DeduplicateExtensions/DeduplicateExtensions.js +13 -13
- package/src/parts/DefaultUrl/DefaultUrl.js +4 -3
- package/src/parts/Desktop/Desktop.js +19 -18
- package/src/parts/DesktopCapturer/DesktopCapturer.ipc.js +6 -4
- package/src/parts/DesktopCapturer/DesktopCapturer.js +4 -3
- package/src/parts/DesktopType/DesktopType.js +3 -3
- package/src/parts/DestroySocket/DestroySocket.js +4 -5
- package/src/parts/Developer/Developer.ipc.js +12 -11
- package/src/parts/Developer/Developer.js +40 -33
- package/src/parts/DirentType/DirentType.js +12 -12
- package/src/parts/Download/Download.ipc.js +6 -4
- package/src/parts/Download/Download.js +4 -3
- package/src/parts/DownloadAndExtract/DownloadAndExtract.js +5 -4
- package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.ipc.js +6 -5
- package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.js +23 -20
- package/src/parts/ElectronContentTracing/ElectronContentTracing.ipc.js +7 -5
- package/src/parts/ElectronContentTracing/ElectronContentTracing.js +7 -5
- package/src/parts/ElectronContextMenu/ElectronContextMenu.ipc.js +6 -4
- package/src/parts/ElectronContextMenu/ElectronContextMenu.js +8 -7
- package/src/parts/ElectronDeveloper/ElectronDeveloper.ipc.js +6 -4
- package/src/parts/ElectronDeveloper/ElectronDeveloper.js +4 -3
- package/src/parts/ElectronDialog/ElectronDialog.ipc.js +8 -6
- package/src/parts/ElectronDialog/ElectronDialog.js +10 -7
- package/src/parts/ElectronInitialize/ElectronInitialize.ipc.js +6 -4
- package/src/parts/ElectronInitialize/ElectronInitialize.js +10 -9
- package/src/parts/ElectronNet/ElectronNet.ipc.js +6 -4
- package/src/parts/ElectronNet/ElectronNet.js +4 -3
- package/src/parts/ElectronNetLog/ElectronNetLog.ipc.js +7 -5
- package/src/parts/ElectronNetLog/ElectronNetLog.js +7 -5
- package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.ipc.js +7 -5
- package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.js +7 -5
- package/src/parts/ElectronProcess/ElectronProcess.ipc.js +7 -5
- package/src/parts/ElectronProcess/ElectronProcess.js +7 -5
- package/src/parts/ElectronSafeStorage/ElectronSafeStorage.ipc.js +8 -6
- package/src/parts/ElectronSafeStorage/ElectronSafeStorage.js +13 -10
- package/src/parts/ElectronShell/ElectronShell.ipc.js +6 -4
- package/src/parts/ElectronShell/ElectronShell.js +4 -3
- package/src/parts/ElectronWindow/ElectronWindow.ipc.js +18 -15
- package/src/parts/ElectronWindow/ElectronWindow.js +87 -61
- package/src/parts/ElectronWindowAbout/ElectronWindowAbout.ipc.js +6 -4
- package/src/parts/ElectronWindowAbout/ElectronWindowAbout.js +4 -3
- package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.ipc.js +6 -4
- package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.js +33 -31
- package/src/parts/EmbedsProcess/EmbedsProcess.js +14 -12
- package/src/parts/EmbedsProcessPath/EmbedsProcessPath.js +13 -3
- package/src/parts/EmbedsProcessState/EmbedsProcessState.js +12 -9
- package/src/parts/EncodingType/EncodingType.js +2 -2
- package/src/parts/Env/Env.js +16 -11
- package/src/parts/Error/FileSystemError.js +9 -6
- package/src/parts/ErrorCodes/ErrorCodes.js +22 -22
- package/src/parts/ErrorHandling/ErrorHandling.js +61 -53
- package/src/parts/Exec/Exec.ipc.js +6 -4
- package/src/parts/Exec/Exec.js +6 -5
- package/src/parts/ExecCommand/ExecCommand.js +22 -19
- package/src/parts/ExecPromise/ExecPromise.js +4 -3
- package/src/parts/Exit/Exit.ipc.js +6 -4
- package/src/parts/Exit/Exit.js +4 -3
- package/src/parts/ExitCode/ExitCode.js +5 -3
- package/src/parts/ExportStatic/ExportStatic.js +695 -552
- package/src/parts/ExtensionHostHelperProcessIpc/ExtensionHostHelperProcessIpc.js +15 -14
- package/src/parts/ExtensionHostRpc/ExtensionHostRpc.js +79 -70
- package/src/parts/ExtensionInstall/ExtensionInstall.ipc.js +6 -4
- package/src/parts/ExtensionInstall/ExtensionInstall.js +23 -21
- package/src/parts/ExtensionInstallFromFile/ExtensionInstallFromFile.js +34 -33
- package/src/parts/ExtensionInstallFromGitHub/ExtensionInstallFromGitHub.js +31 -31
- package/src/parts/ExtensionInstallFromUrl/ExtensionInstallFromUrl.js +32 -32
- package/src/parts/ExtensionInstallParseInput/ExtensionInstallParseInput.js +46 -43
- package/src/parts/ExtensionInstallType/ExtensionInstallType.js +7 -4
- package/src/parts/ExtensionLink/ExtensionLink.js +40 -40
- package/src/parts/ExtensionList/ExtensionList.js +72 -66
- package/src/parts/ExtensionManagement/ExtensionManagement.ipc.js +21 -20
- package/src/parts/ExtensionManagement/ExtensionManagement.js +157 -133
- package/src/parts/ExtensionManagement/ExtensionManagementColorTheme.js +70 -62
- package/src/parts/ExtensionManagement/ExtensionManagementIconTheme.js +26 -26
- package/src/parts/ExtensionManagement/ExtensionManagementLanguages.js +63 -58
- package/src/parts/ExtensionManifest/ExtensionManifest.js +54 -56
- package/src/parts/ExtensionManifestInputType/ExtensionManifestInputType.js +7 -4
- package/src/parts/ExtensionManifestStatus/ExtensionManifestStatus.js +3 -2
- package/src/parts/ExtensionManifests/ExtensionManifests.js +46 -41
- package/src/parts/ExtensionManifests/ExtensionManifestsFromFolder.js +21 -21
- package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtension.js +17 -16
- package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtensionsFolder.js +36 -35
- package/src/parts/ExtensionManifests/ExtensionManifestsFromOnlyExtension.js +8 -7
- package/src/parts/ExtensionUninstall/ExtensionUninstall.js +15 -15
- package/src/parts/ExtensionUnlink/ExtensionUnlink.js +19 -19
- package/src/parts/Extract/Extract.js +12 -10
- package/src/parts/FileNotFoundError/FileNotFoundError.js +15 -11
- package/src/parts/FileSystem/FileSystem.ipc.js +33 -30
- package/src/parts/FileSystem/FileSystem.js +269 -257
- package/src/parts/FileSystemDisk/FileSystemDisk.ipc.js +17 -15
- package/src/parts/FileSystemDisk/FileSystemDisk.js +226 -217
- package/src/parts/FileSystemProcess/FileSystemProcess.js +19 -16
- package/src/parts/FileSystemProcessPath/FileSystemProcessPath.js +3 -2
- package/src/parts/FileWatcher/FileWatcher.ipc.js +8 -6
- package/src/parts/FileWatcher/FileWatcher.js +40 -35
- package/src/parts/FileWatcherProcess/FileWatcherProcess.js +19 -16
- package/src/parts/FileWatcherProcessPath/FileWatcherProcessPath.js +3 -2
- package/src/parts/FirstNodeWorkerEventType/FirstNodeWorkerEventType.js +3 -3
- package/src/parts/FixElectronParameters/FixElectronParameters.js +10 -9
- package/src/parts/GetAppImageDownloadUrl/GetAppImageDownloadUrl.js +5 -4
- package/src/parts/GetAppImagePath/GetAppImagePath.js +4 -3
- package/src/parts/GetAppWindowOptions/GetAppWindowOptions.js +63 -53
- package/src/parts/GetBrowserWindowOptions/GetBrowserWindowOptions.js +28 -27
- package/src/parts/GetContentResponse/GetContentResponse.js +11 -10
- package/src/parts/GetContentSecurityPolicy/GetContentSecurityPolicy.js +5 -4
- package/src/parts/GetCustomPathsConfig/GetCustomPathsConfig.js +14 -13
- package/src/parts/GetDirentType/GetDirentType.js +25 -24
- package/src/parts/GetElectronFileResponse/GetElectronFileResponse.ipc.js +6 -4
- package/src/parts/GetElectronFileResponse/GetElectronFileResponse.js +48 -47
- package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js +61 -58
- package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +31 -29
- package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js +33 -30
- package/src/parts/GetElectronRebuildPath/GetElectronRebuildPath.js +9 -8
- package/src/parts/GetEtag/GetEtag.js +2 -2
- package/src/parts/GetEtagFromStats/GetEtagFromStats.js +10 -9
- package/src/parts/GetExtensionEtags/GetExtensionEtags.js +66 -60
- package/src/parts/GetExtensions/GetExtensions.ipc.js +6 -4
- package/src/parts/GetExtensions/GetExtensions.js +4 -3
- package/src/parts/GetExtraHeaders/GetExtraHeaders.js +8 -7
- package/src/parts/GetFirstEvent/GetFirstEvent.js +21 -20
- package/src/parts/GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js +8 -7
- package/src/parts/GetFolderSizeInternal/GetFolderSizeInternal.js +20 -20
- package/src/parts/GetHeaders/GetHeaders.js +34 -33
- package/src/parts/GetHeadersDefault/GetHeadersDefault.js +2 -2
- package/src/parts/GetHeadersOtherWorker/GetHeadersOtherWorker.js +13 -12
- package/src/parts/GetHelpString/GetHelpString.js +5 -4
- package/src/parts/GetHttpErrorMessage/GetHttpErrorMessage.js +19 -20
- package/src/parts/GetIcon/GetIcon.js +21 -20
- package/src/parts/GetLatestReleaseVersion/GetLatestReleaseVersion.js +33 -32
- package/src/parts/GetMimeType/GetMimeType.js +31 -30
- package/src/parts/GetMultipleChoiceResponse/GetMultipleChoiceResponse.js +11 -10
- package/src/parts/GetNewLineIndex/GetNewLineIndex.js +5 -4
- package/src/parts/GetNotFoundResponse/GetNotFoundResponse.js +11 -10
- package/src/parts/GetNotModifiedResponse/GetNotModifiedResponse.js +11 -10
- package/src/parts/GetNsisUpdateArgs/GetNsisUpdateArgs.js +6 -6
- package/src/parts/GetNsisUpdateDownloadPath/GetNsisUpdateDownloadPath.js +10 -9
- package/src/parts/GetPathEtag/GetPathEtag.js +11 -10
- package/src/parts/GetPathName/GetPathName.js +3 -3
- package/src/parts/GetPortTuple/GetPortTuple.js +10 -10
- package/src/parts/GetProcessExplorerUrl/GetProcessExplorerUrl.js +4 -3
- package/src/parts/GetRemoteUrl/GetRemoteUrl.js +5 -4
- package/src/parts/GetResolvedTestPath/GetResolvedTestPath.js +19 -17
- package/src/parts/GetServerErrorResponse/GetServerErrorResponse.js +11 -10
- package/src/parts/GetStatusString/GetStatusString.js +62 -54
- package/src/parts/GetTerminalProcessPath/GetTerminalProcessPath.js +5 -4
- package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.ipc.js +6 -4
- package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.js +17 -16
- package/src/parts/GetTestPath/GetTestPath.js +4 -3
- package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +72 -72
- package/src/parts/GetTitleBarItems/GetTitleBarItems.js +41 -40
- package/src/parts/GetTransferrables/GetTransferrables.js +7 -6
- package/src/parts/GetTypeFromUrl/GetTypeFromUrl.js +19 -18
- package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +21 -12
- package/src/parts/GetVersionString/GetVersionString.js +5 -4
- package/src/parts/GetWebViewsFromExtensions/GetWebViewsFromExtensions.js +23 -22
- package/src/parts/GetWindowId/GetWindowId.ipc.js +6 -4
- package/src/parts/GetWindowId/GetWindowId.js +6 -5
- package/src/parts/GetWindowsNsisDownloadUrl/GetWindowsNsisDownloadUrl.js +7 -6
- package/src/parts/GetWorkspaceId/GetWorkspaceId.js +4 -3
- package/src/parts/GitLsFiles/GitLsFiles.ipc.js +8 -6
- package/src/parts/GitLsFiles/GitLsFiles.js +22 -19
- package/src/parts/HandleCliArgs/HandleCliArgs.ipc.js +6 -4
- package/src/parts/HandleCliArgs/HandleCliArgs.js +11 -11
- package/src/parts/HandleDisconnect/HandleDisconnect.js +6 -5
- package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.ipc.js +6 -4
- package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.js +10 -9
- package/src/parts/HandleElectronReady/HandleElectronReady.ipc.js +6 -4
- package/src/parts/HandleElectronReady/HandleElectronReady.js +21 -21
- package/src/parts/HandleIncomingIpc/HandleIncomingIpc.js +40 -38
- package/src/parts/HandleIncomingIpcMessagePort/HandleIncomingIpcMessagePort.js +7 -7
- package/src/parts/HandleIncomingIpcWebSocket/HandleIncomingIpcWebSocket.js +7 -7
- package/src/parts/HandleIpc/HandleIpc.js +24 -23
- package/src/parts/HandleIpcAuthProcess/HandleIpcAuthProcess.js +11 -9
- package/src/parts/HandleIpcClipBoardProcess/HandleIpcClipBoardProcess.js +21 -17
- package/src/parts/HandleIpcEmbedsProcess/HandleIpcEmbedsProcess.js +11 -9
- package/src/parts/HandleIpcExtensionHostHelperProcess/HandleIpcExtensionHostHelperProcess.js +28 -24
- package/src/parts/HandleIpcFileSystemProcess/HandleIpcFileSystemProcess.js +21 -17
- package/src/parts/HandleIpcFileWatcher/HandleIpcFileWatcher.js +22 -18
- package/src/parts/HandleIpcModule/HandleIpcModule.js +36 -35
- package/src/parts/HandleIpcProcessExplorer/HandleIpcProcessExplorer.js +23 -19
- package/src/parts/HandleIpcSearchProcess/HandleIpcSearchProcess.js +21 -17
- package/src/parts/HandleIpcSharedProcess/HandleIpcSharedProcess.js +40 -36
- package/src/parts/HandleIpcTerminalProcess/HandleIpcTerminalProcess.js +22 -18
- package/src/parts/HandleMessage/HandleMessage.js +25 -14
- package/src/parts/HandleMessagePortForAuthProcess/HandleMessagePortForAuthProcess.ipc.js +7 -5
- package/src/parts/HandleMessagePortForAuthProcess/HandleMessagePortForAuthProcess.js +20 -18
- package/src/parts/HandleMessagePortForClipBoardProcess/HandleMessagePortForClipBoardProcess.ipc.js +6 -4
- package/src/parts/HandleMessagePortForClipBoardProcess/HandleMessagePortForClipBoardProcess.js +7 -6
- package/src/parts/HandleMessagePortForEmbedsProcess/HandleMessagePortForEmbedsProcess.ipc.js +7 -5
- package/src/parts/HandleMessagePortForEmbedsProcess/HandleMessagePortForEmbedsProcess.js +20 -18
- package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.ipc.js +6 -4
- package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.js +19 -18
- package/src/parts/HandleMessagePortForFileSystemProcess/HandleMessagePortForFileSystemProcess.ipc.js +6 -4
- package/src/parts/HandleMessagePortForFileSystemProcess/HandleMessagePortForFileSystemProcess.js +7 -6
- package/src/parts/HandleMessagePortForProcessExplorer/HandleMessagePortForProcessExplorer.ipc.js +6 -4
- package/src/parts/HandleMessagePortForProcessExplorer/HandleMessagePortForProcessExplorer.js +7 -7
- package/src/parts/HandleMessagePortForSearchProcess/HandleMessagePortForSearchProcess.ipc.js +6 -4
- package/src/parts/HandleMessagePortForSearchProcess/HandleMessagePortForSearchProcess.js +5 -4
- package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.ipc.js +6 -4
- package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.js +7 -6
- package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.ipc.js +6 -4
- package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.js +10 -9
- package/src/parts/HandleRemoteRequest/HandleRemoteRequest.ipc.js +6 -4
- package/src/parts/HandleRemoteRequest/HandleRemoteRequest.js +11 -10
- package/src/parts/HandleRequest/HandleRequest.ipc.js +6 -4
- package/src/parts/HandleRequest/HandleRequest.js +21 -20
- package/src/parts/HandleRequestTest/HandleRequestTest.ipc.js +6 -4
- package/src/parts/HandleRequestTest/HandleRequestTest.js +10 -9
- package/src/parts/HandleSocketError/HandleSocketError.js +11 -10
- package/src/parts/HandleUncaughtExceptionMonitor/HandleUncaughtExceptionMonitor.js +12 -9
- package/src/parts/HandleWebSocket/HandleWebSocket.ipc.js +6 -4
- package/src/parts/HandleWebSocket/HandleWebSocket.js +24 -24
- package/src/parts/HandleWebSocketForClipBoardProcess/HandleWebSocketForClipBoardProcess.js +5 -4
- package/src/parts/HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js +5 -4
- package/src/parts/HandleWebSocketForFileSystemProcess/HandleWebSocketForFileSystemProcess.js +5 -4
- package/src/parts/HandleWebSocketForProcessExplorer/HandleWebSocketForProcessExplorer.js +5 -4
- package/src/parts/HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js +5 -4
- package/src/parts/HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js +5 -4
- package/src/parts/HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js +5 -4
- package/src/parts/HandleWebSocketForUnknown/HandleWebSocketForUnknown.js +6 -5
- package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +33 -32
- package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.ipc.js +6 -4
- package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.js +7 -6
- package/src/parts/Hash/Hash.js +6 -4
- package/src/parts/HeapSnapshot/HeapSnapshot.ipc.js +4 -3
- package/src/parts/HeapSnapshot/HeapSnapshot.js +9 -6
- package/src/parts/HttpHeader/HttpHeader.js +9 -9
- package/src/parts/HttpServerResponse/HttpServerResponse.js +22 -19
- package/src/parts/HttpStatusCode/HttpStatusCode.js +6 -6
- package/src/parts/Id/Id.js +6 -5
- package/src/parts/IndexHtmlPath/IndexHtmlPath.js +4 -3
- package/src/parts/InferExtensionId/InferExtensionId.js +8 -7
- package/src/parts/InstallExtension/InstallExtension.ipc.js +4 -3
- package/src/parts/InstallExtension/InstallExtension.js +28 -28
- package/src/parts/IpcChild/IpcChild.js +14 -13
- package/src/parts/IpcChildModule/IpcChildModule.js +26 -19
- package/src/parts/IpcChildType/IpcChildType.js +19 -18
- package/src/parts/IpcChildWithNodeMessagePort/IpcChildWithNodeMessagePort.js +46 -45
- package/src/parts/IpcError/IpcError.js +4 -4
- package/src/parts/IpcId/IpcId.js +18 -17
- package/src/parts/IpcParent/IpcParent.js +10 -9
- package/src/parts/IpcParentModule/IpcParentModule.js +14 -13
- package/src/parts/IpcParentType/IpcParentType.js +3 -3
- package/src/parts/IpcParentWithElectronUtilityProcess/IpcParentWithElectronUtilityProcess.js +81 -76
- package/src/parts/IpcTransferState/IpcTransferState.js +14 -11
- package/src/parts/IsAbsolutePath/IsAbsolutePath.js +4 -3
- package/src/parts/IsAllowedWebSocketOrigin/IsAllowedWebSocketOrigin.js +39 -37
- package/src/parts/IsAppImage/IsAppImage.js +4 -3
- package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.ipc.js +6 -4
- package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.js +8 -6
- package/src/parts/IsBuiltServer/IsBuiltServer.js +1 -1
- package/src/parts/IsElectron/IsElectron.js +3 -1
- package/src/parts/IsEnoentError/IsEnoentError.js +11 -9
- package/src/parts/IsEnoentErrorWindows/IsEnoentErrorWindows.js +6 -4
- package/src/parts/IsEsrchError/IsEsrchError.js +4 -3
- package/src/parts/IsIgnoredError/IsIgnoredError.js +17 -16
- package/src/parts/IsLinux/IsLinux.js +3 -2
- package/src/parts/IsMessagePort/IsMessagePort.js +2 -2
- package/src/parts/IsMessagePortMain/IsMessagePortMain.js +2 -2
- package/src/parts/IsProduction/IsProduction.js +3 -2
- package/src/parts/IsSocket/IsSocket.js +4 -3
- package/src/parts/IsTransferrable/IsTransferrable.js +8 -7
- package/src/parts/IsTypeScriptPath/IsTypeScriptPath.js +5 -4
- package/src/parts/IsWindows/IsWindows.js +1 -1
- package/src/parts/JoinLines/JoinLines.js +4 -3
- package/src/parts/Json/Json.js +17 -15
- package/src/parts/JsonFile/JsonFile.js +12 -10
- package/src/parts/JsonRpc/JsonRpc.js +1 -1
- package/src/parts/JsonRpcVersion/JsonRpcVersion.js +1 -1
- package/src/parts/Jsonc/Jsonc.js +2 -1
- package/src/parts/JsoncFile/JsoncFile.js +8 -7
- package/src/parts/LaunchAuthProcess/LaunchAuthProcess.js +14 -13
- package/src/parts/LaunchClipBoardProcess/LaunchClipBoardProcess.js +14 -13
- package/src/parts/LaunchEmbedsProcess/LaunchEmbedsProcess.js +17 -16
- package/src/parts/LaunchFileSystemProcess/LaunchFileSystemProcess.js +21 -20
- package/src/parts/LaunchFileWatcherProcess/LaunchFileWatcherProcess.js +14 -13
- package/src/parts/LaunchNetworkProcess/LaunchNetworkProcess.js +13 -12
- package/src/parts/LaunchPreviewProcess/LaunchPreviewProcess.js +13 -12
- package/src/parts/LaunchProcess/LaunchProcess.js +34 -32
- package/src/parts/LaunchProcessExplorer/LaunchProcessExplorer.js +22 -21
- package/src/parts/LaunchPtyHost/LaunchPtyHost.js +16 -15
- package/src/parts/LaunchSearchProcess/LaunchSearchProcess.js +13 -12
- package/src/parts/LaunchTypeScriptCompileProcess/LaunchTypeScriptCompileProcess.js +25 -24
- package/src/parts/LimitString/LimitString.js +14 -13
- package/src/parts/LoadTypeScript/LoadTypeScript.js +12 -12
- package/src/parts/Logger/Logger.js +43 -35
- package/src/parts/Main/Main.js +16 -15
- package/src/parts/MainProcess/MainProcess.js +26 -20
- package/src/parts/MakeExecutable/MakeExecutable.js +9 -9
- package/src/parts/MergeWithSymlinks/MergeWithSymlinks.js +14 -14
- package/src/parts/MimeType/MimeType.js +38 -38
- package/src/parts/Module/Module.js +155 -154
- package/src/parts/ModuleId/ModuleId.js +80 -80
- package/src/parts/ModuleMap/ModuleMap.js +339 -337
- package/src/parts/NetworkProcess/NetworkProcess.js +19 -16
- package/src/parts/NetworkProcessPath/NetworkProcessPath.js +3 -2
- package/src/parts/OpenExternal/OpenExternal.ipc.js +7 -5
- package/src/parts/OpenExternal/OpenExternal.js +7 -5
- package/src/parts/OpenNativeFolder/OpenNativeFolder.ipc.js +6 -4
- package/src/parts/OpenNativeFolder/OpenNativeFolder.js +9 -9
- package/src/parts/Os/Os.ipc.js +4 -3
- package/src/parts/Os/Os.js +4 -3
- package/src/parts/OutputChannel/OutputChannel.ipc.js +39 -35
- package/src/parts/OutputChannel/OutputChannel.js +35 -32
- package/src/parts/OutputChannelState/OutputChannelState.js +15 -11
- package/src/parts/ParseUrlGithub/ParseUrlGithub.js +51 -49
- package/src/parts/Path/Path.js +16 -11
- package/src/parts/Performance/Performance.ipc.js +6 -4
- package/src/parts/Performance/Performance.js +27 -16
- package/src/parts/Platform/Platform.ipc.js +35 -33
- package/src/parts/Platform/Platform.js +76 -48
- package/src/parts/PlatformPaths/PlatformPaths.ipc.js +26 -24
- package/src/parts/PlatformPaths/PlatformPaths.js +140 -97
- package/src/parts/Preferences/Preferences.ipc.js +6 -4
- package/src/parts/Preferences/Preferences.js +83 -81
- package/src/parts/PreloadUrl/PreloadUrl.js +5 -4
- package/src/parts/PrettyError/PrettyError.js +1 -1
- package/src/parts/PreviewProcess/PreviewProcess.js +23 -19
- package/src/parts/PreviewProcessPath/PreviewProcessPath.js +3 -2
- package/src/parts/PrintPrettyError/PrintPrettyError.js +5 -4
- package/src/parts/Process/Process.ipc.js +10 -9
- package/src/parts/Process/Process.js +58 -45
- package/src/parts/ProcessDisplayName/ProcessDisplayName.js +1 -1
- package/src/parts/ProcessExitEventType/ProcessExitEventType.js +2 -2
- package/src/parts/ProcessExplorer/ProcessExplorer.ipc.js +6 -4
- package/src/parts/ProcessExplorer/ProcessExplorer.js +45 -42
- package/src/parts/ProcessExplorerPath/ProcessExplorerPath.js +3 -2
- package/src/parts/ProcessId/ProcessId.ipc.js +7 -5
- package/src/parts/ProcessId/ProcessId.js +5 -4
- package/src/parts/ProcessListeners/ProcessListeners.js +10 -8
- package/src/parts/Promises/Promises.js +18 -18
- package/src/parts/ProtocolType/ProtocolType.js +8 -8
- package/src/parts/PtyHost/PtyHost.js +28 -24
- package/src/parts/PtyHostPath/PtyHostPath.js +3 -2
- package/src/parts/PtyHostState/PtyHostState.js +17 -17
- package/src/parts/Queue/Queue.js +32 -31
- package/src/parts/RebuildNodePty/RebuildNodePty.ipc.js +6 -4
- package/src/parts/RebuildNodePty/RebuildNodePty.js +4 -3
- package/src/parts/RecentlyOpened/RecentlyOpened.ipc.js +6 -4
- package/src/parts/RecentlyOpened/RecentlyOpened.js +53 -54
- package/src/parts/RegisterWebViewProtocol/RegisterWebViewProtocol.js +13 -11
- package/src/parts/RejectWebSocket/RejectWebSocket.js +10 -9
- package/src/parts/RemoveQueryParameters/RemoveQueryParameters.js +6 -6
- package/src/parts/RemoveSymlink/RemoveSymlink.js +11 -11
- package/src/parts/RemoveValues/RemoveValues.js +21 -21
- package/src/parts/RequiresSocket/RequiresSocket.js +18 -16
- package/src/parts/ResolveBin/ResolveBin.js +10 -10
- package/src/parts/ResolveRoot/ResolveRoot.js +81 -78
- package/src/parts/Restart/Restart.js +10 -9
- package/src/parts/Root/Root.js +6 -4
- package/src/parts/Scheme/Scheme.js +1 -1
- package/src/parts/Screen/Screen.ipc.js +8 -6
- package/src/parts/Screen/Screen.js +10 -7
- package/src/parts/SearchProcess/SearchProcess.js +19 -16
- package/src/parts/SearchProcessPath/SearchProcessPath.js +3 -2
- package/src/parts/SendIncomingIpc/SendIncomingIpc.js +27 -24
- package/src/parts/SetHeaders/SetHeaders.js +4 -4
- package/src/parts/ShouldLogError/ShouldLogError.js +7 -6
- package/src/parts/ShouldTranspileTypescript/ShouldTranspileTypescript.js +11 -10
- package/src/parts/Signal/Signal.js +3 -3
- package/src/parts/SplitLines/SplitLines.js +4 -3
- package/src/parts/StaticPath/StaticPath.js +13 -12
- package/src/parts/StaticServerPath/StaticServerPath.js +4 -3
- package/src/parts/SymLink/SymLink.js +4 -3
- package/src/parts/TemporaryMessagePort/TemporaryMessagePort.ipc.js +9 -7
- package/src/parts/TemporaryMessagePort/TemporaryMessagePort.js +69 -64
- package/src/parts/Terminal/Terminal.ipc.js +9 -7
- package/src/parts/Terminal/Terminal.js +73 -68
- package/src/parts/TerminalState/TerminalState.js +12 -9
- package/src/parts/TextDocument/TextDocument.ipc.js +4 -3
- package/src/parts/TextDocument/TextDocument.js +23 -18
- package/src/parts/Timeout/Timeout.js +5 -4
- package/src/parts/TmpFile/TmpFile.js +13 -11
- package/src/parts/ToAbsolutePaths/ToAbsolutePaths.js +8 -7
- package/src/parts/Transferrables/Transferrables.js +5 -4
- package/src/parts/TransientLinkedExtensions/TransientLinkedExtensions.js +64 -58
- package/src/parts/TranspileTypeScript/TranspileTypeScript.js +8 -7
- package/src/parts/TranspileTypeScriptCached/TranspileTypeScriptCached.js +20 -19
- package/src/parts/Trash/Trash.js +11 -9
- package/src/parts/TrashElectron/TrashElectron.js +8 -7
- package/src/parts/TrashNode/TrashNode.js +9 -9
- package/src/parts/TypeScriptCompileCachePath/TypeScriptCompileCachePath.js +4 -3
- package/src/parts/TypeScriptCompileProcess/TypeScriptCompileProcess.js +19 -16
- package/src/parts/TypeScriptCompileProcessPath/TypeScriptCompileProcessPath.js +3 -2
- package/src/parts/UpdateState/UpdateState.js +11 -8
- package/src/parts/UpdateStateType/UpdateStateType.js +9 -9
- package/src/parts/V8CacheOptions/V8CacheOptions.js +2 -2
- package/src/parts/VError/VError.js +1 -1
- package/src/parts/WaitForProcessToExit/WaitForProcessToExit.js +8 -7
- package/src/parts/WalkValue/WalkValue.js +18 -18
- package/src/parts/WatchFile/WatchFile.js +12 -12
- package/src/parts/WatchForHotReload/WatchForHotReload.js +20 -16
- package/src/parts/WebViewProtocolState/WebViewProtocolState.js +9 -8
- package/src/parts/WebViewServer/WebViewServer.ipc.js +11 -9
- package/src/parts/WebViewServer/WebViewServer.js +26 -14
- package/src/parts/Workspace/Workspace.ipc.js +7 -5
- package/src/parts/Workspace/Workspace.js +23 -20
- package/src/parts/WorkspaceSource/WorkspaceSource.js +3 -3
- package/src/sharedProcessMain.js +3 -2
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import * as IpcParent from '../IpcParent/IpcParent.js'
|
|
2
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
3
|
-
import * as Id from '../Id/Id.js'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as IpcParent from '../IpcParent/IpcParent.js'
|
|
2
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
3
|
+
import * as Id from '../Id/Id.js'
|
|
4
|
+
|
|
5
|
+
export const create = async ({ method } ) => {
|
|
6
|
+
const extensionHostHelperProcessPath = await PlatformPaths.getExtensionHostHelperProcessPath()
|
|
7
|
+
const id = Id.create()
|
|
8
|
+
const ipc = await IpcParent.create({
|
|
9
|
+
method,
|
|
10
|
+
path: extensionHostHelperProcessPath,
|
|
11
|
+
execArgv: [],
|
|
12
|
+
name: `Extension Host Helper Process ${id}`,
|
|
13
|
+
})
|
|
14
|
+
return ipc
|
|
15
|
+
}
|
|
@@ -1,73 +1,82 @@
|
|
|
1
|
-
import * as Assert from '../Assert/Assert.js'
|
|
2
|
-
import * as Timeout from '../Timeout/Timeout.js'
|
|
3
|
-
import { VError } from '../VError/VError.js'
|
|
4
|
-
import * as Logger from '../Logger/Logger.js'
|
|
1
|
+
import * as Assert from '../Assert/Assert.js'
|
|
2
|
+
import * as Timeout from '../Timeout/Timeout.js'
|
|
3
|
+
import { VError } from '../VError/VError.js'
|
|
4
|
+
import * as Logger from '../Logger/Logger.js'
|
|
5
5
|
// TODO maybe rename to extension host management for clarity
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
const CONNECTION_TIMEOUT = 3000
|
|
8
|
+
|
|
7
9
|
export const create = async (ipc, socket) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
Assert.object(socket)
|
|
11
|
+
|
|
12
|
+
const handleChildProcessError = (error) => {
|
|
13
|
+
Logger.error(`[Extension Host] ${error}`)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const handleChildProcessExit = (exitCode) => {
|
|
17
|
+
Logger.info(`[SharedProcess] Extension Host exited with code ${exitCode}`)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const handleSocketClose = () => {
|
|
21
|
+
Logger.info('[shared process] disposing extension host')
|
|
22
|
+
ipc.dispose()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
socket.on('close', handleSocketClose)
|
|
26
|
+
|
|
27
|
+
ipc.on('error', handleChildProcessError)
|
|
28
|
+
|
|
29
|
+
ipc.on('exit', handleChildProcessExit)
|
|
30
|
+
|
|
31
|
+
await new Promise((resolve, reject) => {
|
|
32
|
+
const handleFirstError = (error) => {
|
|
33
|
+
cleanup()
|
|
34
|
+
reject(error)
|
|
35
|
+
}
|
|
36
|
+
const handleFirstExit = (exitCode) => {
|
|
37
|
+
cleanup()
|
|
38
|
+
reject(new VError(`Extension Host exited with code ${exitCode}`))
|
|
39
|
+
}
|
|
40
|
+
const handleFirstMessage = (message) => {
|
|
41
|
+
cleanup()
|
|
42
|
+
if (message === 'ready') {
|
|
43
|
+
resolve(undefined)
|
|
44
|
+
} else {
|
|
45
|
+
reject(new VError('Unexpected first message from extension host'))
|
|
46
|
+
}
|
|
47
|
+
}
|
|
15
48
|
const handleSocketClose = () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
clearTimeout(timeout);
|
|
51
|
-
};
|
|
52
|
-
const handleTimeout = () => {
|
|
53
|
-
cleanup();
|
|
54
|
-
reject(new VError('Extension host did not connect'));
|
|
55
|
-
};
|
|
56
|
-
const timeout = Timeout.setTimeout(handleTimeout, CONNECTION_TIMEOUT);
|
|
57
|
-
ipc.on('error', handleFirstError);
|
|
58
|
-
ipc.on('exit', handleFirstExit);
|
|
59
|
-
ipc.on('message', handleFirstMessage);
|
|
60
|
-
socket.on('close', handleSocketClose);
|
|
61
|
-
});
|
|
62
|
-
return {
|
|
63
|
-
on(event, listener) {
|
|
64
|
-
ipc.on(event, listener);
|
|
65
|
-
},
|
|
66
|
-
send(message) {
|
|
67
|
-
ipc.send(message);
|
|
68
|
-
},
|
|
69
|
-
dispose() {
|
|
70
|
-
ipc.dispose();
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
};
|
|
49
|
+
cleanup()
|
|
50
|
+
ipc.off('error', handleChildProcessError)
|
|
51
|
+
ipc.off('exit', handleChildProcessExit)
|
|
52
|
+
resolve(undefined)
|
|
53
|
+
}
|
|
54
|
+
const cleanup = () => {
|
|
55
|
+
ipc.off('error', handleFirstError)
|
|
56
|
+
ipc.off('exit', handleFirstExit)
|
|
57
|
+
ipc.off('message', handleFirstMessage)
|
|
58
|
+
clearTimeout(timeout)
|
|
59
|
+
}
|
|
60
|
+
const handleTimeout = () => {
|
|
61
|
+
cleanup()
|
|
62
|
+
reject(new VError('Extension host did not connect'))
|
|
63
|
+
}
|
|
64
|
+
const timeout = Timeout.setTimeout(handleTimeout, CONNECTION_TIMEOUT)
|
|
65
|
+
ipc.on('error', handleFirstError)
|
|
66
|
+
ipc.on('exit', handleFirstExit)
|
|
67
|
+
ipc.on('message', handleFirstMessage)
|
|
68
|
+
socket.on('close', handleSocketClose)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
on(event, listener) {
|
|
73
|
+
ipc.on(event, listener)
|
|
74
|
+
},
|
|
75
|
+
send(message) {
|
|
76
|
+
ipc.send(message)
|
|
77
|
+
},
|
|
78
|
+
dispose() {
|
|
79
|
+
ipc.dispose()
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import * as ExensionInstall from './ExtensionInstall.js'
|
|
2
|
-
|
|
1
|
+
import * as ExensionInstall from './ExtensionInstall.js'
|
|
2
|
+
|
|
3
|
+
export const name = 'ExtensionInstall'
|
|
4
|
+
|
|
3
5
|
// prettier-ignore
|
|
4
6
|
export const Commands = {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
+
install: ExensionInstall.install,
|
|
8
|
+
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import * as ExtensionInstallParseInput from '../ExtensionInstallParseInput/ExtensionInstallParseInput.js'
|
|
2
|
-
import * as ExtensionInstallType from '../ExtensionInstallType/ExtensionInstallType.js'
|
|
1
|
+
import * as ExtensionInstallParseInput from '../ExtensionInstallParseInput/ExtensionInstallParseInput.js'
|
|
2
|
+
import * as ExtensionInstallType from '../ExtensionInstallType/ExtensionInstallType.js'
|
|
3
|
+
|
|
3
4
|
const getModule = (type) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
5
|
+
switch (type) {
|
|
6
|
+
case ExtensionInstallType.GithubRepository:
|
|
7
|
+
return import('../ExtensionInstallFromGitHub/ExtensionInstallFromGitHub.js')
|
|
8
|
+
case ExtensionInstallType.Url:
|
|
9
|
+
return import('../ExtensionInstallFromUrl/ExtensionInstallFromUrl.js')
|
|
10
|
+
case ExtensionInstallType.File:
|
|
11
|
+
return import('../ExtensionInstallFromFile/ExtensionInstallFromFile.js')
|
|
12
|
+
default:
|
|
13
|
+
throw new Error('module not found')
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
15
17
|
export const install = async (input) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
18
|
+
const parsed = ExtensionInstallParseInput.parse(input)
|
|
19
|
+
if (parsed.type === ExtensionInstallType.ParsingError) {
|
|
20
|
+
throw new Error(`Cannot install ${input}: ${parsed.options.message}`)
|
|
21
|
+
}
|
|
22
|
+
const module = await getModule(parsed.type)
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
await module.install(parsed.options)
|
|
25
|
+
}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import * as Extract from '../Extract/Extract.js'
|
|
2
|
-
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
3
|
-
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
4
|
-
import * as Path from '../Path/Path.js'
|
|
5
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
|
-
import { VError } from '../VError/VError.js'
|
|
1
|
+
import * as Extract from '../Extract/Extract.js'
|
|
2
|
+
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
3
|
+
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
4
|
+
import * as Path from '../Path/Path.js'
|
|
5
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
|
+
import { VError } from '../VError/VError.js'
|
|
7
|
+
|
|
7
8
|
const getCachedExtensionFolderName = (path) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const baseName = Path.basename(path)
|
|
10
|
+
if (baseName.endsWith('.tar.br')) {
|
|
11
|
+
return 'file-' + baseName.slice(0, -'.tar.br'.length)
|
|
12
|
+
}
|
|
13
|
+
return `file-${baseName}`
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const install = async ({ path } ) => {
|
|
17
|
+
try {
|
|
18
|
+
const cachedExtensionsPath = PlatformPaths.getCachedExtensionsPath()
|
|
19
|
+
const cachedExtensionFolderName = getCachedExtensionFolderName(path)
|
|
20
|
+
const cachedExtensionPath = Path.join(cachedExtensionsPath, cachedExtensionFolderName)
|
|
21
|
+
await Extract.extractTarBr(path, cachedExtensionPath)
|
|
22
|
+
const extensionsPath = PlatformPaths.getExtensionsPath()
|
|
23
|
+
const manifestPath = Path.join(cachedExtensionPath, 'extension.json')
|
|
24
|
+
const manifestJson = await JsonFile.readJson(manifestPath)
|
|
25
|
+
const { id } = manifestJson
|
|
26
|
+
if (!id) {
|
|
27
|
+
throw new Error('missing id in extension manifest')
|
|
11
28
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const extensionsPath = PlatformPaths.getExtensionsPath();
|
|
21
|
-
const manifestPath = Path.join(cachedExtensionPath, 'extension.json');
|
|
22
|
-
const manifestJson = await JsonFile.readJson(manifestPath);
|
|
23
|
-
const { id } = manifestJson;
|
|
24
|
-
if (!id) {
|
|
25
|
-
throw new Error('missing id in extension manifest');
|
|
26
|
-
}
|
|
27
|
-
const outDir = Path.join(extensionsPath, id);
|
|
28
|
-
await FileSystem.remove(outDir);
|
|
29
|
-
await FileSystem.mkdir(Path.dirname(outDir));
|
|
30
|
-
await FileSystem.rename(cachedExtensionPath, outDir);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
throw new VError(error, `Failed to install ${path}`);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
29
|
+
const outDir = Path.join(extensionsPath, id)
|
|
30
|
+
await FileSystem.remove(outDir)
|
|
31
|
+
await FileSystem.mkdir(Path.dirname(outDir))
|
|
32
|
+
await FileSystem.rename(cachedExtensionPath, outDir)
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw new VError(error, `Failed to install ${path}`)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import * as DownloadAndExtract from '../DownloadAndExtract/DownloadAndExtract.js'
|
|
2
|
-
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
3
|
-
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
4
|
-
import * as Path from '../Path/Path.js'
|
|
5
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
|
-
import { VError } from '../VError/VError.js'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const outDir = Path.join(extensionsPath, id);
|
|
25
|
-
await FileSystem.remove(outDir);
|
|
26
|
-
await FileSystem.mkdir(extensionsPath);
|
|
27
|
-
await FileSystem.rename(cachedExtensionPath, outDir);
|
|
1
|
+
import * as DownloadAndExtract from '../DownloadAndExtract/DownloadAndExtract.js'
|
|
2
|
+
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
3
|
+
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
4
|
+
import * as Path from '../Path/Path.js'
|
|
5
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
6
|
+
import { VError } from '../VError/VError.js'
|
|
7
|
+
|
|
8
|
+
export const install = async ({ user, repo, branch } ) => {
|
|
9
|
+
try {
|
|
10
|
+
const cachedExtensionsPath = PlatformPaths.getCachedExtensionsPath()
|
|
11
|
+
const url = `https://codeload.github.com/${user}/${repo}/tar.gz/${branch}`
|
|
12
|
+
const cachedExtensionPath = Path.join(cachedExtensionsPath, `github-${user}-${repo}-${branch}`)
|
|
13
|
+
await DownloadAndExtract.downloadAndExtractTarGz({
|
|
14
|
+
url,
|
|
15
|
+
outDir: cachedExtensionPath,
|
|
16
|
+
strip: 1,
|
|
17
|
+
})
|
|
18
|
+
const extensionsPath = PlatformPaths.getExtensionsPath()
|
|
19
|
+
const manifestPath = Path.join(cachedExtensionPath, 'extension.json')
|
|
20
|
+
const manifestJson = await JsonFile.readJson(manifestPath)
|
|
21
|
+
const { id } = manifestJson
|
|
22
|
+
if (!id) {
|
|
23
|
+
throw new Error('missing id in extension manifest')
|
|
28
24
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
const outDir = Path.join(extensionsPath, id)
|
|
26
|
+
await FileSystem.remove(outDir)
|
|
27
|
+
await FileSystem.mkdir(extensionsPath)
|
|
28
|
+
await FileSystem.rename(cachedExtensionPath, outDir)
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw new VError(error, `Failed to install ${user}/${repo}`)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { mkdir, rename, rm } from 'node:fs/promises'
|
|
2
|
-
import { dirname, join } from 'node:path'
|
|
3
|
-
import * as Download from '../Download/Download.js'
|
|
4
|
-
import * as Extract from '../Extract/Extract.js'
|
|
5
|
-
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
6
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
7
|
-
import * as TmpFile from '../TmpFile/TmpFile.js'
|
|
8
|
-
import { VError } from '../VError/VError.js'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const outDir = join(extensionsPath, id);
|
|
26
|
-
await rm(outDir, { recursive: true, force: true });
|
|
27
|
-
await mkdir(dirname(outDir), { recursive: true });
|
|
28
|
-
await rename(tmpDir, outDir);
|
|
1
|
+
import { mkdir, rename, rm } from 'node:fs/promises'
|
|
2
|
+
import { dirname, join } from 'node:path'
|
|
3
|
+
import * as Download from '../Download/Download.js'
|
|
4
|
+
import * as Extract from '../Extract/Extract.js'
|
|
5
|
+
import * as JsonFile from '../JsonFile/JsonFile.js'
|
|
6
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
7
|
+
import * as TmpFile from '../TmpFile/TmpFile.js'
|
|
8
|
+
import { VError } from '../VError/VError.js'
|
|
9
|
+
|
|
10
|
+
export const install = async ({ url } ) => {
|
|
11
|
+
try {
|
|
12
|
+
// TODO cache extension tar br file, probably by url <cachedExtensions>/user/repo/releases/<tag>/<fileName>
|
|
13
|
+
// const cachedExtensionsPath = Platform.getCachedExtensionsPath()
|
|
14
|
+
// const outFile = join(cachedExtensionsPath, 'installed-extension.tar.br')
|
|
15
|
+
const extensionsPath = PlatformPaths.getExtensionsPath()
|
|
16
|
+
const tmpFile = await TmpFile.getTmpFile()
|
|
17
|
+
await Download.download(url, tmpFile)
|
|
18
|
+
const tmpDir = await TmpFile.getTmpDir()
|
|
19
|
+
await Extract.extractTarBr(tmpFile, tmpDir)
|
|
20
|
+
const manifestPath = join(tmpDir, 'extension.json')
|
|
21
|
+
const manifestJson = await JsonFile.readJson(manifestPath)
|
|
22
|
+
const { id } = manifestJson
|
|
23
|
+
if (!id) {
|
|
24
|
+
throw new Error('missing id in extension manifest')
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
26
|
+
const outDir = join(extensionsPath, id)
|
|
27
|
+
await rm(outDir, { recursive: true, force: true })
|
|
28
|
+
await mkdir(dirname(outDir), { recursive: true })
|
|
29
|
+
await rename(tmpDir, outDir)
|
|
30
|
+
} catch (error) {
|
|
31
|
+
throw new VError(error, `Failed to install "${url}"`)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import * as ExtensionInstallType from '../ExtensionInstallType/ExtensionInstallType.js'
|
|
2
|
-
import * as Path from '../Path/Path.js'
|
|
3
|
-
import * as ParseUrlGithub from '../ParseUrlGithub/ParseUrlGithub.js'
|
|
1
|
+
import * as ExtensionInstallType from '../ExtensionInstallType/ExtensionInstallType.js'
|
|
2
|
+
import * as Path from '../Path/Path.js'
|
|
3
|
+
import * as ParseUrlGithub from '../ParseUrlGithub/ParseUrlGithub.js'
|
|
4
|
+
|
|
4
5
|
const parseUrl = (input) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
type: ExtensionInstallType.Url,
|
|
11
|
-
options: {
|
|
12
|
-
url: input,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
}
|
|
6
|
+
if (input.startsWith('https://github.com')) {
|
|
7
|
+
return ParseUrlGithub.parseUrlGithub(input)
|
|
8
|
+
}
|
|
9
|
+
if (input.endsWith('.tar.br')) {
|
|
16
10
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
11
|
+
type: ExtensionInstallType.Url,
|
|
12
|
+
options: {
|
|
13
|
+
url: input,
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
type: ExtensionInstallType.ParsingError,
|
|
19
|
+
options: {
|
|
20
|
+
message: 'Failed to parse url',
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
23
25
|
const parseFile = (input) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
26
|
+
return {
|
|
27
|
+
type: ExtensionInstallType.File,
|
|
28
|
+
options: {
|
|
29
|
+
path: input,
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
31
34
|
export const parse = (input) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
35
|
+
if (input.startsWith('https://')) {
|
|
36
|
+
return parseUrl(input)
|
|
37
|
+
}
|
|
38
|
+
if (input.startsWith('.')) {
|
|
39
|
+
return parseFile(input)
|
|
40
|
+
}
|
|
41
|
+
if (Path.isAbsolute(input)) {
|
|
42
|
+
return parseFile(input)
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
type: ExtensionInstallType.ParsingError,
|
|
46
|
+
options: {
|
|
47
|
+
message: 'Failed to parse input',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
|
|
2
|
-
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
3
|
-
import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
|
|
4
|
-
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
5
|
-
import * as Path from '../Path/Path.js'
|
|
6
|
-
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
7
|
-
import * as SymLink from '../SymLink/SymLink.js'
|
|
8
|
-
import { VError } from '../VError/VError.js'
|
|
1
|
+
import * as ErrorCodes from '../ErrorCodes/ErrorCodes.js'
|
|
2
|
+
import * as ExtensionManifest from '../ExtensionManifest/ExtensionManifest.js'
|
|
3
|
+
import * as ExtensionManifestStatus from '../ExtensionManifestStatus/ExtensionManifestStatus.js'
|
|
4
|
+
import * as FileSystem from '../FileSystem/FileSystem.js'
|
|
5
|
+
import * as Path from '../Path/Path.js'
|
|
6
|
+
import * as PlatformPaths from '../PlatformPaths/PlatformPaths.js'
|
|
7
|
+
import * as SymLink from '../SymLink/SymLink.js'
|
|
8
|
+
import { VError } from '../VError/VError.js'
|
|
9
|
+
|
|
9
10
|
const linkFallBack = async (path) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath();
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
const to = Path.join(linkedExtensionsPath, manifest.id);
|
|
18
|
-
await FileSystem.remove(to);
|
|
19
|
-
await SymLink.createSymLink(path, to);
|
|
11
|
+
try {
|
|
12
|
+
const manifest = await ExtensionManifest.get(path)
|
|
13
|
+
if (manifest.status === ExtensionManifestStatus.Rejected) {
|
|
14
|
+
throw manifest.reason
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath()
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
const to = Path.join(linkedExtensionsPath, manifest.id)
|
|
19
|
+
await FileSystem.remove(to)
|
|
20
|
+
await SymLink.createSymLink(path, to)
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw new VError(error, `Failed to link extension`)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
25
26
|
export const link = async (path) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
try {
|
|
28
|
+
const manifest = await ExtensionManifest.get(path)
|
|
29
|
+
if (manifest.status === ExtensionManifestStatus.Rejected) {
|
|
30
|
+
throw manifest.reason
|
|
31
|
+
}
|
|
32
|
+
const linkedExtensionsPath = PlatformPaths.getLinkedExtensionsPath()
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
const to = Path.join(linkedExtensionsPath, manifest.id)
|
|
35
|
+
await SymLink.createSymLink(path, to)
|
|
36
|
+
} catch (error) {
|
|
37
|
+
if (error && error.code === ErrorCodes.E_MANIFEST_NOT_FOUND) {
|
|
38
|
+
throw new VError(`Failed to link extension: Extension manifest not found '${error.path}'`)
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw new VError(`Failed to link extension: Extension manifest not found '${error.path}'`);
|
|
39
|
-
}
|
|
40
|
-
if (error && error.code === ErrorCodes.EEXIST) {
|
|
41
|
-
return linkFallBack(path);
|
|
42
|
-
}
|
|
43
|
-
throw new VError(error, `Failed to link extension`);
|
|
40
|
+
if (error && error.code === ErrorCodes.EEXIST) {
|
|
41
|
+
return linkFallBack(path)
|
|
44
42
|
}
|
|
45
|
-
|
|
43
|
+
throw new VError(error, `Failed to link extension`)
|
|
44
|
+
}
|
|
45
|
+
}
|