@lvce-editor/shared-process 0.85.3 → 0.86.1

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.
Files changed (461) hide show
  1. package/index.js +1 -1
  2. package/package.json +13 -13
  3. package/src/parts/AddCustomPathsToIndexHtml/AddCustomPathsToIndexHtml.js +2 -2
  4. package/src/parts/AddSemiColon/AddSemiColon.js +4 -3
  5. package/src/parts/AppWindow/AppWindow.js +48 -22
  6. package/src/parts/ApplyEdit/ApplyEdit.js +7 -6
  7. package/src/parts/ApplyIncomingIpcResponse/ApplyIncomingIpcResponse.js +13 -12
  8. package/src/parts/Assert/Assert.js +1 -1
  9. package/src/parts/AttachDebugger/AttachDebugger.ipc.js +6 -4
  10. package/src/parts/AttachDebugger/AttachDebugger.js +5 -4
  11. package/src/parts/AuthProcess/AuthProcess.js +14 -12
  12. package/src/parts/AuthProcessPath/AuthProcessPath.js +4 -3
  13. package/src/parts/AuthProcessState/AuthProcessState.js +12 -9
  14. package/src/parts/Authority/Authority.js +1 -1
  15. package/src/parts/AutoUpdateType/AutoUpdateType.js +4 -4
  16. package/src/parts/AutoUpdater/AutoUpdater.ipc.js +5 -4
  17. package/src/parts/AutoUpdater/AutoUpdater.js +31 -31
  18. package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.ipc.js +7 -5
  19. package/src/parts/AutoUpdaterAppImage/AutoUpdaterAppImage.js +50 -49
  20. package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.ipc.js +5 -4
  21. package/src/parts/AutoUpdaterWindowsNsis/AutoUpdaterWindowsNsis.js +59 -58
  22. package/src/parts/BrowserWindowV8CacheOptions/BrowserWindowV8CacheOptions.js +4 -3
  23. package/src/parts/BuiltinExtensionsPath/BuiltinExtensionsPath.js +7 -6
  24. package/src/parts/BulkReplacement/BulkReplacement.ipc.js +6 -4
  25. package/src/parts/BulkReplacement/BulkReplacement.js +16 -16
  26. package/src/parts/BulkReplacementContent/BulkReplacementContent.js +27 -26
  27. package/src/parts/ByteSize/ByteSize.js +4 -4
  28. package/src/parts/Callback/Callback.js +1 -1
  29. package/src/parts/Character/Character.js +12 -12
  30. package/src/parts/Clamp/Clamp.js +2 -2
  31. package/src/parts/Cli/Cli.js +14 -14
  32. package/src/parts/CliCommandType/CliCommandType.js +11 -11
  33. package/src/parts/CliHelp/CliHelp.js +9 -8
  34. package/src/parts/CliInstall/CliInstall.js +24 -24
  35. package/src/parts/CliLink/CliLink.js +17 -17
  36. package/src/parts/CliList/CliList.js +18 -15
  37. package/src/parts/CliModule/CliModule.js +27 -26
  38. package/src/parts/CliStatus/CliStatus.js +5 -4
  39. package/src/parts/CliUnlink/CliUnlink.js +17 -17
  40. package/src/parts/CliVersion/CliVersion.js +8 -7
  41. package/src/parts/ClipBoard/ClipBoard.ipc.js +7 -5
  42. package/src/parts/ClipBoard/ClipBoard.js +7 -5
  43. package/src/parts/ClipBoardProcess/ClipBoardProcess.js +19 -16
  44. package/src/parts/ClipBoardProcessPath/ClipBoardProcessPath.js +13 -3
  45. package/src/parts/ColorTheme/ColorTheme.js +18 -15
  46. package/src/parts/Command/Command.js +69 -62
  47. package/src/parts/CommandNotFoundError/CommandNotFoundError.js +10 -7
  48. package/src/parts/CompareVersion/CompareVersion.js +2 -2
  49. package/src/parts/ConnectIpcToElectron/ConnectIpcToElectron.js +20 -18
  50. package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.ipc.js +6 -4
  51. package/src/parts/ContentSecurityPolicy/ContentSecurityPolicy.js +7 -6
  52. package/src/parts/ContentSecurityPolicyDocument/ContentSecurityPolicyDocument.js +45 -39
  53. package/src/parts/ContentSecurityPolicyState/ContentSecurityPolicyState.js +7 -5
  54. package/src/parts/CpuProfile/CpuProfile.js +25 -22
  55. package/src/parts/Crash/Crash.ipc.js +5 -4
  56. package/src/parts/Crash/Crash.js +11 -8
  57. package/src/parts/CreateTestOverview/CreateTestOverview.js +7 -6
  58. package/src/parts/CreateTestOverviewHtml/CreateTestOverviewHtml.js +24 -21
  59. package/src/parts/CreateUtilityProcessRpc/CreateUtilityProcessRpc.js +6 -5
  60. package/src/parts/CrossOriginEmbedderPolicy/CrossOriginEmbedderPolicy.js +1 -1
  61. package/src/parts/CrossOriginOpenerPolicy/CrossOriginOpenerPolicy.js +2 -2
  62. package/src/parts/CrossOriginResourcePolicy/CrossOriginResourcePolicy.js +1 -1
  63. package/src/parts/DeduplicateExtensions/DeduplicateExtensions.js +13 -13
  64. package/src/parts/DefaultUrl/DefaultUrl.js +4 -3
  65. package/src/parts/Desktop/Desktop.js +19 -18
  66. package/src/parts/DesktopCapturer/DesktopCapturer.ipc.js +6 -4
  67. package/src/parts/DesktopCapturer/DesktopCapturer.js +4 -3
  68. package/src/parts/DesktopType/DesktopType.js +3 -3
  69. package/src/parts/DestroySocket/DestroySocket.js +4 -5
  70. package/src/parts/Developer/Developer.ipc.js +12 -11
  71. package/src/parts/Developer/Developer.js +40 -33
  72. package/src/parts/DirentType/DirentType.js +12 -12
  73. package/src/parts/Download/Download.ipc.js +6 -4
  74. package/src/parts/Download/Download.js +4 -3
  75. package/src/parts/DownloadAndExtract/DownloadAndExtract.js +5 -4
  76. package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.ipc.js +6 -5
  77. package/src/parts/ElectronApplicationMenu/ElectronApplicationMenu.js +23 -20
  78. package/src/parts/ElectronContentTracing/ElectronContentTracing.ipc.js +7 -5
  79. package/src/parts/ElectronContentTracing/ElectronContentTracing.js +7 -5
  80. package/src/parts/ElectronContextMenu/ElectronContextMenu.ipc.js +6 -4
  81. package/src/parts/ElectronContextMenu/ElectronContextMenu.js +8 -7
  82. package/src/parts/ElectronDeveloper/ElectronDeveloper.ipc.js +6 -4
  83. package/src/parts/ElectronDeveloper/ElectronDeveloper.js +4 -3
  84. package/src/parts/ElectronDialog/ElectronDialog.ipc.js +8 -6
  85. package/src/parts/ElectronDialog/ElectronDialog.js +10 -7
  86. package/src/parts/ElectronInitialize/ElectronInitialize.ipc.js +6 -4
  87. package/src/parts/ElectronInitialize/ElectronInitialize.js +10 -9
  88. package/src/parts/ElectronNet/ElectronNet.ipc.js +6 -4
  89. package/src/parts/ElectronNet/ElectronNet.js +4 -3
  90. package/src/parts/ElectronNetLog/ElectronNetLog.ipc.js +7 -5
  91. package/src/parts/ElectronNetLog/ElectronNetLog.js +7 -5
  92. package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.ipc.js +7 -5
  93. package/src/parts/ElectronPowerSaveBlocker/ElectronPowerSaveBlocker.js +7 -5
  94. package/src/parts/ElectronProcess/ElectronProcess.ipc.js +7 -5
  95. package/src/parts/ElectronProcess/ElectronProcess.js +7 -5
  96. package/src/parts/ElectronSafeStorage/ElectronSafeStorage.ipc.js +8 -6
  97. package/src/parts/ElectronSafeStorage/ElectronSafeStorage.js +13 -10
  98. package/src/parts/ElectronShell/ElectronShell.ipc.js +6 -4
  99. package/src/parts/ElectronShell/ElectronShell.js +4 -3
  100. package/src/parts/ElectronWindow/ElectronWindow.ipc.js +18 -15
  101. package/src/parts/ElectronWindow/ElectronWindow.js +87 -61
  102. package/src/parts/ElectronWindowAbout/ElectronWindowAbout.ipc.js +6 -4
  103. package/src/parts/ElectronWindowAbout/ElectronWindowAbout.js +4 -3
  104. package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.ipc.js +6 -4
  105. package/src/parts/ElectronWindowProcessExplorer/ElectronWindowProcessExplorer.js +33 -31
  106. package/src/parts/EmbedsProcess/EmbedsProcess.js +14 -12
  107. package/src/parts/EmbedsProcessPath/EmbedsProcessPath.js +13 -3
  108. package/src/parts/EmbedsProcessState/EmbedsProcessState.js +12 -9
  109. package/src/parts/EncodingType/EncodingType.js +2 -2
  110. package/src/parts/Env/Env.js +16 -11
  111. package/src/parts/Error/FileSystemError.js +9 -6
  112. package/src/parts/ErrorCodes/ErrorCodes.js +22 -22
  113. package/src/parts/ErrorHandling/ErrorHandling.js +61 -53
  114. package/src/parts/Exec/Exec.ipc.js +6 -4
  115. package/src/parts/Exec/Exec.js +6 -5
  116. package/src/parts/ExecCommand/ExecCommand.js +22 -19
  117. package/src/parts/ExecPromise/ExecPromise.js +4 -3
  118. package/src/parts/Exit/Exit.ipc.js +6 -4
  119. package/src/parts/Exit/Exit.js +4 -3
  120. package/src/parts/ExitCode/ExitCode.js +5 -3
  121. package/src/parts/ExportStatic/ExportStatic.js +695 -552
  122. package/src/parts/ExtensionHostHelperProcessIpc/ExtensionHostHelperProcessIpc.js +15 -14
  123. package/src/parts/ExtensionHostRpc/ExtensionHostRpc.js +79 -70
  124. package/src/parts/ExtensionInstall/ExtensionInstall.ipc.js +6 -4
  125. package/src/parts/ExtensionInstall/ExtensionInstall.js +23 -21
  126. package/src/parts/ExtensionInstallFromFile/ExtensionInstallFromFile.js +34 -33
  127. package/src/parts/ExtensionInstallFromGitHub/ExtensionInstallFromGitHub.js +31 -31
  128. package/src/parts/ExtensionInstallFromUrl/ExtensionInstallFromUrl.js +32 -32
  129. package/src/parts/ExtensionInstallParseInput/ExtensionInstallParseInput.js +46 -43
  130. package/src/parts/ExtensionInstallType/ExtensionInstallType.js +7 -4
  131. package/src/parts/ExtensionLink/ExtensionLink.js +40 -40
  132. package/src/parts/ExtensionList/ExtensionList.js +72 -66
  133. package/src/parts/ExtensionManagement/ExtensionManagement.ipc.js +21 -20
  134. package/src/parts/ExtensionManagement/ExtensionManagement.js +157 -133
  135. package/src/parts/ExtensionManagement/ExtensionManagementColorTheme.js +70 -62
  136. package/src/parts/ExtensionManagement/ExtensionManagementIconTheme.js +26 -26
  137. package/src/parts/ExtensionManagement/ExtensionManagementLanguages.js +63 -58
  138. package/src/parts/ExtensionManifest/ExtensionManifest.js +54 -56
  139. package/src/parts/ExtensionManifestInputType/ExtensionManifestInputType.js +7 -4
  140. package/src/parts/ExtensionManifestStatus/ExtensionManifestStatus.js +3 -2
  141. package/src/parts/ExtensionManifests/ExtensionManifests.js +46 -41
  142. package/src/parts/ExtensionManifests/ExtensionManifestsFromFolder.js +21 -21
  143. package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtension.js +17 -16
  144. package/src/parts/ExtensionManifests/ExtensionManifestsFromLinkedExtensionsFolder.js +36 -35
  145. package/src/parts/ExtensionManifests/ExtensionManifestsFromOnlyExtension.js +8 -7
  146. package/src/parts/ExtensionUninstall/ExtensionUninstall.js +15 -15
  147. package/src/parts/ExtensionUnlink/ExtensionUnlink.js +19 -19
  148. package/src/parts/Extract/Extract.js +12 -10
  149. package/src/parts/FileNotFoundError/FileNotFoundError.js +15 -11
  150. package/src/parts/FileSystem/FileSystem.ipc.js +33 -30
  151. package/src/parts/FileSystem/FileSystem.js +269 -257
  152. package/src/parts/FileSystemDisk/FileSystemDisk.ipc.js +17 -15
  153. package/src/parts/FileSystemDisk/FileSystemDisk.js +226 -217
  154. package/src/parts/FileSystemProcess/FileSystemProcess.js +19 -16
  155. package/src/parts/FileSystemProcessPath/FileSystemProcessPath.js +3 -2
  156. package/src/parts/FileWatcher/FileWatcher.ipc.js +8 -6
  157. package/src/parts/FileWatcher/FileWatcher.js +40 -35
  158. package/src/parts/FileWatcherProcess/FileWatcherProcess.js +19 -16
  159. package/src/parts/FileWatcherProcessPath/FileWatcherProcessPath.js +3 -2
  160. package/src/parts/FirstNodeWorkerEventType/FirstNodeWorkerEventType.js +3 -3
  161. package/src/parts/FixElectronParameters/FixElectronParameters.js +10 -9
  162. package/src/parts/GetAppImageDownloadUrl/GetAppImageDownloadUrl.js +5 -4
  163. package/src/parts/GetAppImagePath/GetAppImagePath.js +4 -3
  164. package/src/parts/GetAppWindowOptions/GetAppWindowOptions.js +63 -53
  165. package/src/parts/GetBrowserWindowOptions/GetBrowserWindowOptions.js +28 -27
  166. package/src/parts/GetContentResponse/GetContentResponse.js +11 -10
  167. package/src/parts/GetContentSecurityPolicy/GetContentSecurityPolicy.js +5 -4
  168. package/src/parts/GetCustomPathsConfig/GetCustomPathsConfig.js +14 -13
  169. package/src/parts/GetDirentType/GetDirentType.js +25 -24
  170. package/src/parts/GetElectronFileResponse/GetElectronFileResponse.ipc.js +6 -4
  171. package/src/parts/GetElectronFileResponse/GetElectronFileResponse.js +48 -47
  172. package/src/parts/GetElectronFileResponseAbsolutePath/GetElectronFileResponseAbsolutePath.js +61 -58
  173. package/src/parts/GetElectronFileResponseContent/GetElectronFileResponseContent.js +31 -29
  174. package/src/parts/GetElectronFileResponseRelativePath/GetElectronFileResponseRelativePath.js +33 -30
  175. package/src/parts/GetElectronRebuildPath/GetElectronRebuildPath.js +9 -8
  176. package/src/parts/GetEtag/GetEtag.js +2 -2
  177. package/src/parts/GetEtagFromStats/GetEtagFromStats.js +10 -9
  178. package/src/parts/GetExtensionEtags/GetExtensionEtags.js +66 -60
  179. package/src/parts/GetExtensions/GetExtensions.ipc.js +6 -4
  180. package/src/parts/GetExtensions/GetExtensions.js +4 -3
  181. package/src/parts/GetExtraHeaders/GetExtraHeaders.js +8 -7
  182. package/src/parts/GetFirstEvent/GetFirstEvent.js +21 -20
  183. package/src/parts/GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js +8 -7
  184. package/src/parts/GetFolderSizeInternal/GetFolderSizeInternal.js +20 -20
  185. package/src/parts/GetHeaders/GetHeaders.js +34 -33
  186. package/src/parts/GetHeadersDefault/GetHeadersDefault.js +2 -2
  187. package/src/parts/GetHeadersOtherWorker/GetHeadersOtherWorker.js +13 -12
  188. package/src/parts/GetHelpString/GetHelpString.js +5 -4
  189. package/src/parts/GetHttpErrorMessage/GetHttpErrorMessage.js +19 -20
  190. package/src/parts/GetIcon/GetIcon.js +16 -20
  191. package/src/parts/GetLatestReleaseVersion/GetLatestReleaseVersion.js +33 -32
  192. package/src/parts/GetMimeType/GetMimeType.js +31 -30
  193. package/src/parts/GetMultipleChoiceResponse/GetMultipleChoiceResponse.js +11 -10
  194. package/src/parts/GetNewLineIndex/GetNewLineIndex.js +5 -4
  195. package/src/parts/GetNotFoundResponse/GetNotFoundResponse.js +11 -10
  196. package/src/parts/GetNotModifiedResponse/GetNotModifiedResponse.js +11 -10
  197. package/src/parts/GetNsisUpdateArgs/GetNsisUpdateArgs.js +6 -6
  198. package/src/parts/GetNsisUpdateDownloadPath/GetNsisUpdateDownloadPath.js +10 -9
  199. package/src/parts/GetPathEtag/GetPathEtag.js +11 -10
  200. package/src/parts/GetPathName/GetPathName.js +3 -3
  201. package/src/parts/GetPortTuple/GetPortTuple.js +10 -10
  202. package/src/parts/GetProcessExplorerUrl/GetProcessExplorerUrl.js +4 -3
  203. package/src/parts/GetRemoteUrl/GetRemoteUrl.js +5 -4
  204. package/src/parts/GetResolvedTestPath/GetResolvedTestPath.js +19 -17
  205. package/src/parts/GetServerErrorResponse/GetServerErrorResponse.js +11 -10
  206. package/src/parts/GetStatusString/GetStatusString.js +62 -54
  207. package/src/parts/GetTerminalProcessPath/GetTerminalProcessPath.js +5 -4
  208. package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.ipc.js +6 -4
  209. package/src/parts/GetTerminalSpawnOptions/GetTerminalSpawnOptions.js +17 -16
  210. package/src/parts/GetTestPath/GetTestPath.js +4 -3
  211. package/src/parts/GetTestRequestResponse/GetTestRequestResponse.js +72 -72
  212. package/src/parts/GetTitleBarItems/GetTitleBarItems.js +41 -40
  213. package/src/parts/GetTransferrables/GetTransferrables.js +7 -6
  214. package/src/parts/GetTypeFromUrl/GetTypeFromUrl.js +19 -18
  215. package/src/parts/GetTypeScriptPath/GetTypeScriptPath.js +21 -12
  216. package/src/parts/GetVersionString/GetVersionString.js +5 -4
  217. package/src/parts/GetWebViewsFromExtensions/GetWebViewsFromExtensions.js +23 -22
  218. package/src/parts/GetWindowId/GetWindowId.ipc.js +6 -4
  219. package/src/parts/GetWindowId/GetWindowId.js +6 -5
  220. package/src/parts/GetWindowsNsisDownloadUrl/GetWindowsNsisDownloadUrl.js +7 -6
  221. package/src/parts/GetWorkspaceId/GetWorkspaceId.js +4 -3
  222. package/src/parts/GitLsFiles/GitLsFiles.ipc.js +8 -6
  223. package/src/parts/GitLsFiles/GitLsFiles.js +22 -19
  224. package/src/parts/HandleCliArgs/HandleCliArgs.ipc.js +6 -4
  225. package/src/parts/HandleCliArgs/HandleCliArgs.js +11 -11
  226. package/src/parts/HandleDisconnect/HandleDisconnect.js +6 -5
  227. package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.ipc.js +6 -4
  228. package/src/parts/HandleElectronMessagePort/HandleElectronMessagePort.js +10 -9
  229. package/src/parts/HandleElectronReady/HandleElectronReady.ipc.js +6 -4
  230. package/src/parts/HandleElectronReady/HandleElectronReady.js +21 -21
  231. package/src/parts/HandleIncomingIpc/HandleIncomingIpc.js +40 -38
  232. package/src/parts/HandleIncomingIpcMessagePort/HandleIncomingIpcMessagePort.js +7 -7
  233. package/src/parts/HandleIncomingIpcWebSocket/HandleIncomingIpcWebSocket.js +7 -7
  234. package/src/parts/HandleIpc/HandleIpc.js +24 -23
  235. package/src/parts/HandleIpcAuthProcess/HandleIpcAuthProcess.js +11 -9
  236. package/src/parts/HandleIpcClipBoardProcess/HandleIpcClipBoardProcess.js +21 -17
  237. package/src/parts/HandleIpcEmbedsProcess/HandleIpcEmbedsProcess.js +11 -9
  238. package/src/parts/HandleIpcExtensionHostHelperProcess/HandleIpcExtensionHostHelperProcess.js +28 -24
  239. package/src/parts/HandleIpcFileSystemProcess/HandleIpcFileSystemProcess.js +21 -17
  240. package/src/parts/HandleIpcFileWatcher/HandleIpcFileWatcher.js +22 -18
  241. package/src/parts/HandleIpcModule/HandleIpcModule.js +36 -35
  242. package/src/parts/HandleIpcProcessExplorer/HandleIpcProcessExplorer.js +23 -19
  243. package/src/parts/HandleIpcSearchProcess/HandleIpcSearchProcess.js +21 -17
  244. package/src/parts/HandleIpcSharedProcess/HandleIpcSharedProcess.js +40 -36
  245. package/src/parts/HandleIpcTerminalProcess/HandleIpcTerminalProcess.js +22 -18
  246. package/src/parts/HandleMessage/HandleMessage.js +25 -14
  247. package/src/parts/HandleMessagePortForAuthProcess/HandleMessagePortForAuthProcess.ipc.js +7 -5
  248. package/src/parts/HandleMessagePortForAuthProcess/HandleMessagePortForAuthProcess.js +20 -18
  249. package/src/parts/HandleMessagePortForClipBoardProcess/HandleMessagePortForClipBoardProcess.ipc.js +6 -4
  250. package/src/parts/HandleMessagePortForClipBoardProcess/HandleMessagePortForClipBoardProcess.js +7 -6
  251. package/src/parts/HandleMessagePortForEmbedsProcess/HandleMessagePortForEmbedsProcess.ipc.js +7 -5
  252. package/src/parts/HandleMessagePortForEmbedsProcess/HandleMessagePortForEmbedsProcess.js +20 -18
  253. package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.ipc.js +6 -4
  254. package/src/parts/HandleMessagePortForExtensionHostHelperProcess/HandleMessagePortForExtensionHostHelperProcess.js +19 -18
  255. package/src/parts/HandleMessagePortForFileSystemProcess/HandleMessagePortForFileSystemProcess.ipc.js +6 -4
  256. package/src/parts/HandleMessagePortForFileSystemProcess/HandleMessagePortForFileSystemProcess.js +7 -6
  257. package/src/parts/HandleMessagePortForProcessExplorer/HandleMessagePortForProcessExplorer.ipc.js +6 -4
  258. package/src/parts/HandleMessagePortForProcessExplorer/HandleMessagePortForProcessExplorer.js +7 -7
  259. package/src/parts/HandleMessagePortForSearchProcess/HandleMessagePortForSearchProcess.ipc.js +6 -4
  260. package/src/parts/HandleMessagePortForSearchProcess/HandleMessagePortForSearchProcess.js +5 -4
  261. package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.ipc.js +6 -4
  262. package/src/parts/HandleMessagePortForTerminalProcess/HandleMessagePortForTerminalProcess.js +7 -6
  263. package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.ipc.js +6 -4
  264. package/src/parts/HandleNodeMessagePort/HandleNodeMessagePort.js +10 -9
  265. package/src/parts/HandleRemoteRequest/HandleRemoteRequest.ipc.js +6 -4
  266. package/src/parts/HandleRemoteRequest/HandleRemoteRequest.js +11 -10
  267. package/src/parts/HandleRequest/HandleRequest.ipc.js +6 -4
  268. package/src/parts/HandleRequest/HandleRequest.js +21 -20
  269. package/src/parts/HandleRequestTest/HandleRequestTest.ipc.js +6 -4
  270. package/src/parts/HandleRequestTest/HandleRequestTest.js +10 -9
  271. package/src/parts/HandleSocketError/HandleSocketError.js +11 -10
  272. package/src/parts/HandleUncaughtExceptionMonitor/HandleUncaughtExceptionMonitor.js +12 -9
  273. package/src/parts/HandleWebSocket/HandleWebSocket.ipc.js +6 -4
  274. package/src/parts/HandleWebSocket/HandleWebSocket.js +24 -24
  275. package/src/parts/HandleWebSocketForClipBoardProcess/HandleWebSocketForClipBoardProcess.js +5 -4
  276. package/src/parts/HandleWebSocketForExtensionHostHelperProcess/HandleWebSocketForExtensionHostHelperProcess.js +5 -4
  277. package/src/parts/HandleWebSocketForFileSystemProcess/HandleWebSocketForFileSystemProcess.js +5 -4
  278. package/src/parts/HandleWebSocketForProcessExplorer/HandleWebSocketForProcessExplorer.js +5 -4
  279. package/src/parts/HandleWebSocketForSearchProcess/HandleWebSocketForSearchProcess.js +5 -4
  280. package/src/parts/HandleWebSocketForSharedProcess/HandleWebSocketForSharedProcess.js +5 -4
  281. package/src/parts/HandleWebSocketForTerminalProcess/HandleWebSocketForTerminalProcess.js +5 -4
  282. package/src/parts/HandleWebSocketForUnknown/HandleWebSocketForUnknown.js +6 -5
  283. package/src/parts/HandleWebSocketModule/HandleWebSocketModule.js +33 -32
  284. package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.ipc.js +6 -4
  285. package/src/parts/HandleWindowAllClosed/HandleWindowAllClosed.js +7 -6
  286. package/src/parts/Hash/Hash.js +6 -4
  287. package/src/parts/HeapSnapshot/HeapSnapshot.ipc.js +4 -3
  288. package/src/parts/HeapSnapshot/HeapSnapshot.js +9 -6
  289. package/src/parts/HttpHeader/HttpHeader.js +9 -9
  290. package/src/parts/HttpServerResponse/HttpServerResponse.js +22 -19
  291. package/src/parts/HttpStatusCode/HttpStatusCode.js +6 -6
  292. package/src/parts/Id/Id.js +6 -5
  293. package/src/parts/IndexHtmlPath/IndexHtmlPath.js +4 -3
  294. package/src/parts/InferExtensionId/InferExtensionId.js +8 -7
  295. package/src/parts/InstallExtension/InstallExtension.ipc.js +4 -3
  296. package/src/parts/InstallExtension/InstallExtension.js +28 -28
  297. package/src/parts/IpcChild/IpcChild.js +14 -13
  298. package/src/parts/IpcChildModule/IpcChildModule.js +26 -19
  299. package/src/parts/IpcChildType/IpcChildType.js +19 -18
  300. package/src/parts/IpcChildWithNodeMessagePort/IpcChildWithNodeMessagePort.js +46 -45
  301. package/src/parts/IpcError/IpcError.js +4 -4
  302. package/src/parts/IpcId/IpcId.js +18 -17
  303. package/src/parts/IpcParent/IpcParent.js +10 -9
  304. package/src/parts/IpcParentModule/IpcParentModule.js +14 -13
  305. package/src/parts/IpcParentType/IpcParentType.js +3 -3
  306. package/src/parts/IpcParentWithElectronUtilityProcess/IpcParentWithElectronUtilityProcess.js +81 -76
  307. package/src/parts/IpcTransferState/IpcTransferState.js +14 -11
  308. package/src/parts/IsAbsolutePath/IsAbsolutePath.js +4 -3
  309. package/src/parts/IsAllowedWebSocketOrigin/IsAllowedWebSocketOrigin.js +39 -37
  310. package/src/parts/IsAppImage/IsAppImage.js +4 -3
  311. package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.ipc.js +6 -4
  312. package/src/parts/IsAutoUpdateSupported/IsAutoUpdateSupported.js +8 -6
  313. package/src/parts/IsBuiltServer/IsBuiltServer.js +1 -1
  314. package/src/parts/IsElectron/IsElectron.js +3 -1
  315. package/src/parts/IsEnoentError/IsEnoentError.js +11 -9
  316. package/src/parts/IsEnoentErrorWindows/IsEnoentErrorWindows.js +6 -4
  317. package/src/parts/IsEsrchError/IsEsrchError.js +4 -3
  318. package/src/parts/IsIgnoredError/IsIgnoredError.js +17 -16
  319. package/src/parts/IsLinux/IsLinux.js +3 -2
  320. package/src/parts/IsMessagePort/IsMessagePort.js +2 -2
  321. package/src/parts/IsMessagePortMain/IsMessagePortMain.js +2 -2
  322. package/src/parts/IsProduction/IsProduction.js +3 -2
  323. package/src/parts/IsSocket/IsSocket.js +4 -3
  324. package/src/parts/IsTransferrable/IsTransferrable.js +8 -7
  325. package/src/parts/IsTypeScriptPath/IsTypeScriptPath.js +5 -4
  326. package/src/parts/IsWindows/IsWindows.js +1 -1
  327. package/src/parts/JoinLines/JoinLines.js +4 -3
  328. package/src/parts/Json/Json.js +17 -15
  329. package/src/parts/JsonFile/JsonFile.js +12 -10
  330. package/src/parts/JsonRpc/JsonRpc.js +1 -1
  331. package/src/parts/JsonRpcVersion/JsonRpcVersion.js +1 -1
  332. package/src/parts/Jsonc/Jsonc.js +2 -1
  333. package/src/parts/JsoncFile/JsoncFile.js +8 -7
  334. package/src/parts/LaunchAuthProcess/LaunchAuthProcess.js +14 -13
  335. package/src/parts/LaunchClipBoardProcess/LaunchClipBoardProcess.js +14 -13
  336. package/src/parts/LaunchEmbedsProcess/LaunchEmbedsProcess.js +17 -16
  337. package/src/parts/LaunchFileSystemProcess/LaunchFileSystemProcess.js +21 -20
  338. package/src/parts/LaunchFileWatcherProcess/LaunchFileWatcherProcess.js +14 -13
  339. package/src/parts/LaunchNetworkProcess/LaunchNetworkProcess.js +13 -12
  340. package/src/parts/LaunchPreviewProcess/LaunchPreviewProcess.js +13 -12
  341. package/src/parts/LaunchProcess/LaunchProcess.js +34 -32
  342. package/src/parts/LaunchProcessExplorer/LaunchProcessExplorer.js +22 -21
  343. package/src/parts/LaunchPtyHost/LaunchPtyHost.js +16 -15
  344. package/src/parts/LaunchSearchProcess/LaunchSearchProcess.js +13 -12
  345. package/src/parts/LaunchTypeScriptCompileProcess/LaunchTypeScriptCompileProcess.js +25 -24
  346. package/src/parts/LimitString/LimitString.js +14 -13
  347. package/src/parts/LoadTypeScript/LoadTypeScript.js +12 -12
  348. package/src/parts/Logger/Logger.js +43 -35
  349. package/src/parts/Main/Main.js +16 -15
  350. package/src/parts/MainProcess/MainProcess.js +26 -20
  351. package/src/parts/MakeExecutable/MakeExecutable.js +9 -9
  352. package/src/parts/MergeWithSymlinks/MergeWithSymlinks.js +14 -14
  353. package/src/parts/MimeType/MimeType.js +38 -38
  354. package/src/parts/Module/Module.js +155 -154
  355. package/src/parts/ModuleId/ModuleId.js +80 -80
  356. package/src/parts/ModuleMap/ModuleMap.js +339 -337
  357. package/src/parts/NetworkProcess/NetworkProcess.js +19 -16
  358. package/src/parts/NetworkProcessPath/NetworkProcessPath.js +3 -2
  359. package/src/parts/OpenExternal/OpenExternal.ipc.js +7 -5
  360. package/src/parts/OpenExternal/OpenExternal.js +7 -5
  361. package/src/parts/OpenNativeFolder/OpenNativeFolder.ipc.js +6 -4
  362. package/src/parts/OpenNativeFolder/OpenNativeFolder.js +9 -9
  363. package/src/parts/Os/Os.ipc.js +4 -3
  364. package/src/parts/Os/Os.js +4 -3
  365. package/src/parts/OutputChannel/OutputChannel.ipc.js +39 -35
  366. package/src/parts/OutputChannel/OutputChannel.js +35 -32
  367. package/src/parts/OutputChannelState/OutputChannelState.js +15 -11
  368. package/src/parts/ParseUrlGithub/ParseUrlGithub.js +51 -49
  369. package/src/parts/Path/Path.js +16 -11
  370. package/src/parts/Performance/Performance.ipc.js +6 -4
  371. package/src/parts/Performance/Performance.js +27 -16
  372. package/src/parts/Platform/Platform.ipc.js +35 -33
  373. package/src/parts/Platform/Platform.js +76 -48
  374. package/src/parts/PlatformPaths/PlatformPaths.ipc.js +26 -24
  375. package/src/parts/PlatformPaths/PlatformPaths.js +140 -97
  376. package/src/parts/Preferences/Preferences.ipc.js +6 -4
  377. package/src/parts/Preferences/Preferences.js +83 -81
  378. package/src/parts/PreloadUrl/PreloadUrl.js +5 -4
  379. package/src/parts/PrettyError/PrettyError.js +1 -1
  380. package/src/parts/PreviewProcess/PreviewProcess.js +23 -19
  381. package/src/parts/PreviewProcessPath/PreviewProcessPath.js +3 -2
  382. package/src/parts/PrintPrettyError/PrintPrettyError.js +5 -4
  383. package/src/parts/Process/Process.ipc.js +10 -9
  384. package/src/parts/Process/Process.js +58 -45
  385. package/src/parts/ProcessDisplayName/ProcessDisplayName.js +1 -1
  386. package/src/parts/ProcessExitEventType/ProcessExitEventType.js +2 -2
  387. package/src/parts/ProcessExplorer/ProcessExplorer.ipc.js +6 -4
  388. package/src/parts/ProcessExplorer/ProcessExplorer.js +45 -42
  389. package/src/parts/ProcessExplorerPath/ProcessExplorerPath.js +3 -2
  390. package/src/parts/ProcessId/ProcessId.ipc.js +7 -5
  391. package/src/parts/ProcessId/ProcessId.js +5 -4
  392. package/src/parts/ProcessListeners/ProcessListeners.js +10 -8
  393. package/src/parts/Promises/Promises.js +18 -18
  394. package/src/parts/ProtocolType/ProtocolType.js +8 -8
  395. package/src/parts/PtyHost/PtyHost.js +28 -24
  396. package/src/parts/PtyHostPath/PtyHostPath.js +3 -2
  397. package/src/parts/PtyHostState/PtyHostState.js +17 -17
  398. package/src/parts/Queue/Queue.js +32 -31
  399. package/src/parts/RebuildNodePty/RebuildNodePty.ipc.js +6 -4
  400. package/src/parts/RebuildNodePty/RebuildNodePty.js +4 -3
  401. package/src/parts/RecentlyOpened/RecentlyOpened.ipc.js +6 -4
  402. package/src/parts/RecentlyOpened/RecentlyOpened.js +53 -54
  403. package/src/parts/RegisterWebViewProtocol/RegisterWebViewProtocol.js +13 -11
  404. package/src/parts/RejectWebSocket/RejectWebSocket.js +10 -9
  405. package/src/parts/RemoveQueryParameters/RemoveQueryParameters.js +6 -6
  406. package/src/parts/RemoveSymlink/RemoveSymlink.js +11 -11
  407. package/src/parts/RemoveValues/RemoveValues.js +21 -21
  408. package/src/parts/RequiresSocket/RequiresSocket.js +18 -16
  409. package/src/parts/ResolveBin/ResolveBin.js +10 -10
  410. package/src/parts/ResolveRoot/ResolveRoot.js +81 -78
  411. package/src/parts/Restart/Restart.js +10 -9
  412. package/src/parts/Root/Root.js +6 -4
  413. package/src/parts/Scheme/Scheme.js +1 -1
  414. package/src/parts/Screen/Screen.ipc.js +8 -6
  415. package/src/parts/Screen/Screen.js +10 -7
  416. package/src/parts/SearchProcess/SearchProcess.js +19 -16
  417. package/src/parts/SearchProcessPath/SearchProcessPath.js +3 -2
  418. package/src/parts/SendIncomingIpc/SendIncomingIpc.js +27 -24
  419. package/src/parts/SetHeaders/SetHeaders.js +4 -4
  420. package/src/parts/ShouldLogError/ShouldLogError.js +7 -6
  421. package/src/parts/ShouldTranspileTypescript/ShouldTranspileTypescript.js +11 -10
  422. package/src/parts/Signal/Signal.js +3 -3
  423. package/src/parts/SplitLines/SplitLines.js +4 -3
  424. package/src/parts/StaticPath/StaticPath.js +13 -12
  425. package/src/parts/StaticServerPath/StaticServerPath.js +4 -3
  426. package/src/parts/SymLink/SymLink.js +4 -3
  427. package/src/parts/TemporaryMessagePort/TemporaryMessagePort.ipc.js +9 -7
  428. package/src/parts/TemporaryMessagePort/TemporaryMessagePort.js +69 -64
  429. package/src/parts/Terminal/Terminal.ipc.js +9 -7
  430. package/src/parts/Terminal/Terminal.js +73 -68
  431. package/src/parts/TerminalState/TerminalState.js +12 -9
  432. package/src/parts/TextDocument/TextDocument.ipc.js +4 -3
  433. package/src/parts/TextDocument/TextDocument.js +23 -18
  434. package/src/parts/Timeout/Timeout.js +5 -4
  435. package/src/parts/TmpFile/TmpFile.js +13 -11
  436. package/src/parts/ToAbsolutePaths/ToAbsolutePaths.js +8 -7
  437. package/src/parts/Transferrables/Transferrables.js +5 -4
  438. package/src/parts/TransientLinkedExtensions/TransientLinkedExtensions.js +64 -58
  439. package/src/parts/TranspileTypeScript/TranspileTypeScript.js +8 -7
  440. package/src/parts/TranspileTypeScriptCached/TranspileTypeScriptCached.js +20 -19
  441. package/src/parts/Trash/Trash.js +11 -9
  442. package/src/parts/TrashElectron/TrashElectron.js +8 -7
  443. package/src/parts/TrashNode/TrashNode.js +9 -9
  444. package/src/parts/TypeScriptCompileCachePath/TypeScriptCompileCachePath.js +4 -3
  445. package/src/parts/TypeScriptCompileProcess/TypeScriptCompileProcess.js +19 -16
  446. package/src/parts/TypeScriptCompileProcessPath/TypeScriptCompileProcessPath.js +3 -2
  447. package/src/parts/UpdateState/UpdateState.js +11 -8
  448. package/src/parts/UpdateStateType/UpdateStateType.js +9 -9
  449. package/src/parts/V8CacheOptions/V8CacheOptions.js +2 -2
  450. package/src/parts/VError/VError.js +1 -1
  451. package/src/parts/WaitForProcessToExit/WaitForProcessToExit.js +8 -7
  452. package/src/parts/WalkValue/WalkValue.js +18 -18
  453. package/src/parts/WatchFile/WatchFile.js +12 -12
  454. package/src/parts/WatchForHotReload/WatchForHotReload.js +20 -16
  455. package/src/parts/WebViewProtocolState/WebViewProtocolState.js +9 -8
  456. package/src/parts/WebViewServer/WebViewServer.ipc.js +11 -9
  457. package/src/parts/WebViewServer/WebViewServer.js +26 -14
  458. package/src/parts/Workspace/Workspace.ipc.js +7 -5
  459. package/src/parts/Workspace/Workspace.js +23 -20
  460. package/src/parts/WorkspaceSource/WorkspaceSource.js +3 -3
  461. package/src/sharedProcessMain.js +3 -2
package/index.js CHANGED
@@ -24,7 +24,7 @@ const toAbsoluteExtensionPath = (root, extensionPath) => {
24
24
  /**
25
25
  * @param {{extensionPath?: string, extensionPaths?: string[] | string, testPath?: string, root?: string}} [options]
26
26
  */
27
- export const exportStatic = async (options = {}) => {
27
+ export const exportStatic = async (options = {}) => {
28
28
  const { extensionPath, extensionPaths = [], testPath = '', root = '' } = options
29
29
  if (!root) {
30
30
  throw new Error(`root argument is required`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/shared-process",
3
- "version": "0.85.3",
3
+ "version": "0.86.1",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -17,29 +17,29 @@
17
17
  "node": ">=24"
18
18
  },
19
19
  "dependencies": {
20
- "@lvce-editor/assert": "1.6.0",
21
- "@lvce-editor/auth-process": "1.6.0",
22
- "@lvce-editor/extension-host-helper-process": "0.85.3",
23
- "@lvce-editor/ipc": "16.1.0",
24
- "@lvce-editor/json-rpc": "8.1.0",
20
+ "@lvce-editor/assert": "1.7.0",
21
+ "@lvce-editor/auth-process": "1.7.0",
22
+ "@lvce-editor/extension-host-helper-process": "0.86.1",
23
+ "@lvce-editor/ipc": "16.2.0",
24
+ "@lvce-editor/json-rpc": "8.2.0",
25
25
  "@lvce-editor/jsonc-parser": "1.5.0",
26
26
  "@lvce-editor/pretty-error": "2.0.0",
27
27
  "@lvce-editor/process-explorer": "3.8.0",
28
- "@lvce-editor/rpc-registry": "9.31.0",
28
+ "@lvce-editor/rpc-registry": "9.32.0",
29
29
  "@lvce-editor/verror": "1.7.0",
30
30
  "is-object": "^1.0.2",
31
31
  "xdg-basedir": "^5.1.0"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@lvce-editor/embeds-process": "4.4.0",
35
- "@lvce-editor/file-system-process": "5.1.0",
36
- "@lvce-editor/file-watcher-process": "4.0.0",
34
+ "@lvce-editor/embeds-process": "4.5.0",
35
+ "@lvce-editor/file-system-process": "5.2.0",
36
+ "@lvce-editor/file-watcher-process": "4.1.0",
37
37
  "@lvce-editor/network-process": "5.2.0",
38
38
  "@lvce-editor/preload": "1.5.0",
39
39
  "@lvce-editor/preview-process": "11.0.0",
40
- "@lvce-editor/pty-host": "8.1.0",
41
- "@lvce-editor/search-process": "15.0.0",
42
- "@lvce-editor/typescript-compile-process": "5.1.0",
40
+ "@lvce-editor/pty-host": "8.2.0",
41
+ "@lvce-editor/search-process": "15.1.0",
42
+ "@lvce-editor/typescript-compile-process": "5.2.0",
43
43
  "open": "^11.0.0",
44
44
  "tail": "^2.2.6",
45
45
  "tmp-promise": "^3.0.3",
@@ -1,3 +1,3 @@
1
1
  export const addCustomPathsToIndexHtml = async (content) => {
2
- return content;
3
- };
2
+ return content
3
+ }
@@ -1,4 +1,5 @@
1
- import * as Character from '../Character/Character.js';
1
+ import * as Character from '../Character/Character.js'
2
+
2
3
  export const addSemicolon = (line) => {
3
- return line + Character.SemiColon;
4
- };
4
+ return line + Character.SemiColon
5
+ }
@@ -1,23 +1,49 @@
1
- import * as DefaultUrl from '../DefaultUrl/DefaultUrl.js';
2
- import * as GetAppWindowOptions from '../GetAppWindowOptions/GetAppWindowOptions.js';
3
- import * as GetTitleBarItems from '../GetTitleBarItems/GetTitleBarItems.js';
4
- import * as ParentIpc from '../MainProcess/MainProcess.js';
5
- import * as Preferences from '../Preferences/Preferences.js';
6
- import * as PreloadUrl from '../PreloadUrl/PreloadUrl.js';
7
- import * as Screen from '../Screen/Screen.js';
8
- export const createAppWindow = async ({ preferences, parsedArgs, workingDirectory, url = DefaultUrl.defaultUrl, preloadUrl }) => {
9
- const { width, height } = await Screen.getBounds();
10
- const windowOptions = await GetAppWindowOptions.getAppWindowOptions({
11
- preferences,
12
- screenWidth: width,
13
- screenHeight: height,
14
- preloadUrl,
15
- });
16
- const titleBarItems = GetTitleBarItems.getTitleBarItems();
17
- return ParentIpc.invoke('AppWindow.createAppWindow', windowOptions, parsedArgs, workingDirectory, titleBarItems, url);
18
- };
1
+ import * as DefaultUrl from '../DefaultUrl/DefaultUrl.js'
2
+ import * as GetAppWindowOptions from '../GetAppWindowOptions/GetAppWindowOptions.js'
3
+ import * as GetTitleBarItems from '../GetTitleBarItems/GetTitleBarItems.js'
4
+ import * as ParentIpc from '../MainProcess/MainProcess.js'
5
+ import * as Preferences from '../Preferences/Preferences.js'
6
+ import * as PreloadUrl from '../PreloadUrl/PreloadUrl.js'
7
+ import * as Screen from '../Screen/Screen.js'
8
+
9
+ const getValidatedAppUrl = (url) => {
10
+ if (typeof url !== 'string') {
11
+ throw new TypeError('Expected url to be a string')
12
+ }
13
+ const defaultUrl = new URL(DefaultUrl.defaultUrl)
14
+ const parsedUrl = new URL(url, defaultUrl)
15
+ const isAppUrl =
16
+ parsedUrl.protocol === defaultUrl.protocol &&
17
+ parsedUrl.host === defaultUrl.host &&
18
+ parsedUrl.username === defaultUrl.username &&
19
+ parsedUrl.password === defaultUrl.password
20
+ if (!isAppUrl) {
21
+ throw new TypeError('Only application URLs can be opened in an app window')
22
+ }
23
+ return parsedUrl.toString()
24
+ }
25
+
26
+ export const createAppWindow = async ({ preferences, parsedArgs, workingDirectory, url = DefaultUrl.defaultUrl, preloadUrl } ) => {
27
+ const validatedUrl = getValidatedAppUrl(url)
28
+ const { width, height } = await Screen.getBounds()
29
+ const windowOptions = await GetAppWindowOptions.getAppWindowOptions({
30
+ preferences,
31
+ screenWidth: width,
32
+ screenHeight: height,
33
+ preloadUrl,
34
+ })
35
+ const titleBarItems = GetTitleBarItems.getTitleBarItems()
36
+ return ParentIpc.invoke('AppWindow.createAppWindow', windowOptions, parsedArgs, workingDirectory, titleBarItems, validatedUrl)
37
+ }
38
+
19
39
  export const openNew = async (url) => {
20
- const preferences = await Preferences.getAll();
21
- const preloadUrl = PreloadUrl.getPreloadUrl();
22
- return createAppWindow({ preferences, parsedArgs: [], workingDirectory: '', url, preloadUrl });
23
- };
40
+ const preferences = await Preferences.getAll()
41
+ const preloadUrl = PreloadUrl.getPreloadUrl()
42
+ return createAppWindow({ preferences, parsedArgs: [], workingDirectory: '', url, preloadUrl })
43
+ }
44
+
45
+ export const openNewWithUri = async (uri) => {
46
+ const url = new URL(DefaultUrl.defaultUrl)
47
+ url.searchParams.set('openUri', uri)
48
+ return openNew(url.toString())
49
+ }
@@ -1,7 +1,8 @@
1
- import * as FileSystem from '../FileSystem/FileSystem.js';
2
- import * as BulkReplacementContent from '../BulkReplacementContent/BulkReplacementContent.js';
1
+ import * as FileSystem from '../FileSystem/FileSystem.js'
2
+ import * as BulkReplacementContent from '../BulkReplacementContent/BulkReplacementContent.js'
3
+
3
4
  export const applyEdit = async (path, ranges, replacement) => {
4
- const content = await FileSystem.readFile(path);
5
- const newContent = BulkReplacementContent.getNewContent(content, ranges, replacement);
6
- await FileSystem.writeFile(path, newContent);
7
- };
5
+ const content = await FileSystem.readFile(path)
6
+ const newContent = BulkReplacementContent.getNewContent(content, ranges, replacement)
7
+ await FileSystem.writeFile(path, newContent)
8
+ }
@@ -1,13 +1,14 @@
1
- import * as HandleIpc from '../HandleIpc/HandleIpc.js';
2
- import * as SendIncomingIpc from '../SendIncomingIpc/SendIncomingIpc.js';
1
+ import * as HandleIpc from '../HandleIpc/HandleIpc.js'
2
+ import * as SendIncomingIpc from '../SendIncomingIpc/SendIncomingIpc.js'
3
+
3
4
  export const applyIncomingIpcResponse = async (target, response, ipcId) => {
4
- switch (response.type) {
5
- case 'handle':
6
- HandleIpc.handleIpc(target);
7
- break;
8
- case 'send':
9
- return SendIncomingIpc.sendIncomingIpc(target, response, ipcId);
10
- default:
11
- throw new Error('unexpected response');
12
- }
13
- };
5
+ switch (response.type) {
6
+ case 'handle':
7
+ HandleIpc.handleIpc(target)
8
+ break
9
+ case 'send':
10
+ return SendIncomingIpc.sendIncomingIpc(target, response, ipcId)
11
+ default:
12
+ throw new Error('unexpected response')
13
+ }
14
+ }
@@ -1 +1 @@
1
- export * from '@lvce-editor/assert';
1
+ export * from '@lvce-editor/assert'
@@ -1,5 +1,7 @@
1
- import * as AttachDebugger from './AttachDebugger.js';
2
- export const name = 'AttachDebugger';
1
+ import * as AttachDebugger from './AttachDebugger.js'
2
+
3
+ export const name = 'AttachDebugger'
4
+
3
5
  export const Commands = {
4
- attachDebugger: AttachDebugger.attachDebugger,
5
- };
6
+ attachDebugger: AttachDebugger.attachDebugger,
7
+ }
@@ -1,5 +1,6 @@
1
- import * as Process from '../Process/Process.js';
2
- import * as Signal from '../Signal/Signal.js';
1
+ import * as Process from '../Process/Process.js'
2
+ import * as Signal from '../Signal/Signal.js'
3
+
3
4
  export const attachDebugger = (pid) => {
4
- Process.kill(pid, Signal.SIGUSR1);
5
- };
5
+ Process.kill(pid, Signal.SIGUSR1)
6
+ }
@@ -1,13 +1,15 @@
1
- import * as LaunchAuthProcess from '../LaunchAuthProcess/LaunchAuthProcess.js';
2
- export const state = {
3
- /**
4
- * @type {any}
5
- */
6
- ipc: undefined,
7
- };
1
+ import * as LaunchAuthProcess from '../LaunchAuthProcess/LaunchAuthProcess.js'
2
+
3
+ export const state = {
4
+ /**
5
+ * @type {any}
6
+ */
7
+ ipc: undefined,
8
+ }
9
+
8
10
  export const getOrCreate = async () => {
9
- if (!state.ipc) {
10
- state.ipc = LaunchAuthProcess.launchAuthProcess();
11
- }
12
- return state.ipc;
13
- };
11
+ if (!state.ipc) {
12
+ state.ipc = LaunchAuthProcess.launchAuthProcess()
13
+ }
14
+ return state.ipc
15
+ }
@@ -1,3 +1,4 @@
1
- import * as Path from '../Path/Path.js';
2
- import * as Root from '../Root/Root.js';
3
- export const authProcessPath = Path.join(Root.root, 'packages', 'shared-process', 'node_modules', '@lvce-editor', 'auth-process', 'dist', 'index.js');
1
+ import * as Path from '../Path/Path.js'
2
+ import * as Root from '../Root/Root.js'
3
+
4
+ export const authProcessPath = Path.join(Root.root, 'packages', 'shared-process', 'node_modules', '@lvce-editor', 'auth-process', 'dist', 'index.js')
@@ -1,12 +1,15 @@
1
- const state = {
2
- ref: 0,
3
- };
1
+ const state = {
2
+ ref: 0,
3
+ }
4
+
4
5
  export const increment = () => {
5
- state.ref++;
6
- };
6
+ state.ref++
7
+ }
8
+
7
9
  export const hasRef = () => {
8
- return state.ref > 0;
9
- };
10
+ return state.ref > 0
11
+ }
12
+
10
13
  export const decrement = async () => {
11
- state.ref--;
12
- };
14
+ state.ref--
15
+ }
@@ -1 +1 @@
1
- export const Authority = '-';
1
+ export const Authority = '-'
@@ -1,4 +1,4 @@
1
- export const AppImage = 'AppImage';
2
- export const Deb = 'Deb';
3
- export const None = 'None';
4
- export const WindowsNsis = 'WindowsNsis';
1
+ export const AppImage = 'AppImage'
2
+ export const Deb = 'Deb'
3
+ export const None = 'None'
4
+ export const WindowsNsis = 'WindowsNsis'
@@ -1,5 +1,6 @@
1
- import * as AutoUpdater from './AutoUpdater.js';
1
+ import * as AutoUpdater from './AutoUpdater.js'
2
+
2
3
  export const Commands = {
3
- 'AutoUpdater.getAutoUpdateType': AutoUpdater.getAutoUpdateType,
4
- 'AutoUpdater.getLatestVersion': AutoUpdater.getLatestVersion,
5
- };
4
+ 'AutoUpdater.getAutoUpdateType': AutoUpdater.getAutoUpdateType,
5
+ 'AutoUpdater.getLatestVersion': AutoUpdater.getLatestVersion,
6
+ }
@@ -1,36 +1,36 @@
1
- import * as AutoUpdateType from '../AutoUpdateType/AutoUpdateType.js';
2
- import * as CompareVersion from '../CompareVersion/CompareVersion.js';
3
- import * as GetLatestReleaseVersion from '../GetLatestReleaseVersion/GetLatestReleaseVersion.js';
4
- import * as IsAppImage from '../IsAppImage/IsAppImage.js';
5
- import * as Platform from '../Platform/Platform.js';
6
- import { VError } from '../VError/VError.js';
1
+ import * as AutoUpdateType from '../AutoUpdateType/AutoUpdateType.js'
2
+ import * as CompareVersion from '../CompareVersion/CompareVersion.js'
3
+ import * as GetLatestReleaseVersion from '../GetLatestReleaseVersion/GetLatestReleaseVersion.js'
4
+ import * as IsAppImage from '../IsAppImage/IsAppImage.js'
5
+ import * as Platform from '../Platform/Platform.js'
6
+ import { VError } from '../VError/VError.js'
7
+
7
8
  export const getAutoUpdateType = async () => {
8
- try {
9
- if (Platform.isDeb) {
10
- return AutoUpdateType.Deb;
11
- }
12
- if (Platform.isWindows) {
13
- return AutoUpdateType.WindowsNsis;
14
- }
15
- if (IsAppImage.isAppImage()) {
16
- return AutoUpdateType.AppImage;
17
- }
18
- return AutoUpdateType.None;
9
+ try {
10
+ if (Platform.isDeb) {
11
+ return AutoUpdateType.Deb
19
12
  }
20
- catch (error) {
21
- throw new VError(error, `Failed to get auto update type`);
13
+ if (Platform.isWindows) {
14
+ return AutoUpdateType.WindowsNsis
22
15
  }
23
- };
24
- export const getLatestVersion = async () => {
25
- const repository = Platform.getRepository();
26
- const version = await GetLatestReleaseVersion.getLatestReleaseVersion(repository);
27
- const currentVersion = Platform.version;
28
- if (CompareVersion.isGreater(version, currentVersion)) {
29
- return {
30
- version,
31
- };
16
+ if (IsAppImage.isAppImage()) {
17
+ return AutoUpdateType.AppImage
32
18
  }
33
- else {
34
- console.log('not update is available');
19
+ return AutoUpdateType.None
20
+ } catch (error) {
21
+ throw new VError(error, `Failed to get auto update type`)
22
+ }
23
+ }
24
+
25
+ export const getLatestVersion = async () => {
26
+ const repository = Platform.getRepository()
27
+ const version = await GetLatestReleaseVersion.getLatestReleaseVersion(repository)
28
+ const currentVersion = Platform.version
29
+ if (CompareVersion.isGreater(version, currentVersion)) {
30
+ return {
31
+ version,
35
32
  }
36
- };
33
+ } else {
34
+ console.log('not update is available')
35
+ }
36
+ }
@@ -1,6 +1,8 @@
1
- import * as AutoUpdaterAppImage from './AutoUpdaterAppImage.js';
2
- export const name = 'AutoUpdaterAppImage';
1
+ import * as AutoUpdaterAppImage from './AutoUpdaterAppImage.js'
2
+
3
+ export const name = 'AutoUpdaterAppImage'
4
+
3
5
  export const Commands = {
4
- downloadUpdate: AutoUpdaterAppImage.downloadUpdate,
5
- installAndRestart: AutoUpdaterAppImage.installAndRestart,
6
- };
6
+ downloadUpdate: AutoUpdaterAppImage.downloadUpdate,
7
+ installAndRestart: AutoUpdaterAppImage.installAndRestart,
8
+ }
@@ -1,54 +1,55 @@
1
- import { rename } from 'node:fs/promises';
2
- import { tmpdir } from 'node:os';
3
- import { join } from 'node:path';
4
- import * as Assert from '../Assert/Assert.js';
5
- import * as Download from '../Download/Download.js';
6
- import * as GetAppImageDownloadUrl from '../GetAppImageDownloadUrl/GetAppImageDownloadUrl.js';
7
- import * as GetAppImagePath from '../GetAppImagePath/GetAppImagePath.js';
8
- import * as MakeExecutable from '../MakeExecutable/MakeExecutable.js';
9
- import * as Platform from '../Platform/Platform.js';
10
- import * as Restart from '../Restart/Restart.js';
11
- import { VError } from '../VError/VError.js';
1
+ import { rename } from 'node:fs/promises'
2
+ import { tmpdir } from 'node:os'
3
+ import { join } from 'node:path'
4
+ import * as Assert from '../Assert/Assert.js'
5
+ import * as Download from '../Download/Download.js'
6
+ import * as GetAppImageDownloadUrl from '../GetAppImageDownloadUrl/GetAppImageDownloadUrl.js'
7
+ import * as GetAppImagePath from '../GetAppImagePath/GetAppImagePath.js'
8
+ import * as MakeExecutable from '../MakeExecutable/MakeExecutable.js'
9
+ import * as Platform from '../Platform/Platform.js'
10
+ import * as Restart from '../Restart/Restart.js'
11
+ import { VError } from '../VError/VError.js'
12
+
12
13
  const getOutfilePath = (version) => {
13
- Assert.string(version);
14
- const outFile = join(tmpdir(), `appimage-${version}`);
15
- return outFile;
16
- };
14
+ Assert.string(version)
15
+ const outFile = join(tmpdir(), `appimage-${version}`)
16
+ return outFile
17
+ }
18
+
17
19
  export const downloadUpdate = async (version) => {
18
- try {
19
- Assert.string(version);
20
- const repository = Platform.getRepository();
21
- const appImageName = Platform.getAppImageName();
22
- const downLoadUrl = GetAppImageDownloadUrl.getDownloadUrl(repository, version, appImageName);
23
- const outFile = getOutfilePath(version);
24
- await Download.download(downLoadUrl, outFile);
25
- return outFile;
26
- }
27
- catch (error) {
28
- throw new VError(error, `Failed to download new version ${version}`);
29
- }
30
- };
20
+ try {
21
+ Assert.string(version)
22
+ const repository = Platform.getRepository()
23
+ const appImageName = Platform.getAppImageName()
24
+ const downLoadUrl = GetAppImageDownloadUrl.getDownloadUrl(repository, version, appImageName)
25
+ const outFile = getOutfilePath(version)
26
+ await Download.download(downLoadUrl, outFile)
27
+ return outFile
28
+ } catch (error) {
29
+ throw new VError(error, `Failed to download new version ${version}`)
30
+ }
31
+ }
32
+
31
33
  const installNewAppImage = async (currentAppImageFile, downloadPath) => {
32
- try {
33
- await rename(downloadPath, currentAppImageFile);
34
- return currentAppImageFile;
35
- }
36
- catch (error) {
37
- throw new VError(error, `Failed to rename AppImage file`);
38
- }
39
- };
34
+ try {
35
+ await rename(downloadPath, currentAppImageFile)
36
+ return currentAppImageFile
37
+ } catch (error) {
38
+ throw new VError(error, `Failed to rename AppImage file`)
39
+ }
40
+ }
41
+
40
42
  export const installAndRestart = async (downloadPath) => {
41
- try {
42
- Assert.string(downloadPath);
43
- const currentAppImageFile = GetAppImagePath.getAppImagePath();
44
- if (!currentAppImageFile) {
45
- throw new Error(`AppImage path not found`);
46
- }
47
- await MakeExecutable.makeExecutable(downloadPath);
48
- const installedPath = await installNewAppImage(currentAppImageFile, downloadPath);
49
- await Restart.restart(installedPath);
50
- }
51
- catch (error) {
52
- throw new VError(error, `Failed to install AppImage update`);
43
+ try {
44
+ Assert.string(downloadPath)
45
+ const currentAppImageFile = GetAppImagePath.getAppImagePath()
46
+ if (!currentAppImageFile) {
47
+ throw new Error(`AppImage path not found`)
53
48
  }
54
- };
49
+ await MakeExecutable.makeExecutable(downloadPath)
50
+ const installedPath = await installNewAppImage(currentAppImageFile, downloadPath)
51
+ await Restart.restart(installedPath)
52
+ } catch (error) {
53
+ throw new VError(error, `Failed to install AppImage update`)
54
+ }
55
+ }
@@ -1,5 +1,6 @@
1
- import * as AutoUpdaterWindowsNsis from './AutoUpdaterWindowsNsis.js';
1
+ import * as AutoUpdaterWindowsNsis from './AutoUpdaterWindowsNsis.js'
2
+
2
3
  export const Commands = {
3
- 'AutoUpdaterWindowsNsis.downloadUpdate': AutoUpdaterWindowsNsis.downloadUpdate,
4
- 'AutoUpdaterWindowsNsis.installAndRestart': AutoUpdaterWindowsNsis.installAndRestart,
5
- };
4
+ 'AutoUpdaterWindowsNsis.downloadUpdate': AutoUpdaterWindowsNsis.downloadUpdate,
5
+ 'AutoUpdaterWindowsNsis.installAndRestart': AutoUpdaterWindowsNsis.installAndRestart,
6
+ }
@@ -1,63 +1,64 @@
1
- import { spawn } from 'node:child_process';
2
- import * as Assert from '../Assert/Assert.js';
3
- import * as Download from '../Download/Download.js';
4
- import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js';
5
- import * as GetFirstSpawnedProcessEvent from '../GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js';
6
- import * as GetNsisUpdateArgs from '../GetNsisUpdateArgs/GetNsisUpdateArgs.js';
7
- import * as GetNsisDownloadPath from '../GetNsisUpdateDownloadPath/GetNsisUpdateDownloadPath.js';
8
- import * as GetWindowsNsisDownloadUrl from '../GetWindowsNsisDownloadUrl/GetWindowsNsisDownloadUrl.js';
9
- import * as Logger from '../Logger/Logger.js';
10
- import * as Platform from '../Platform/Platform.js';
11
- import * as UpdateState from '../UpdateState/UpdateState.js';
12
- import * as UpdateStateType from '../UpdateStateType/UpdateStateType.js';
13
- import { VError } from '../VError/VError.js';
1
+ import { spawn } from 'node:child_process'
2
+ import * as Assert from '../Assert/Assert.js'
3
+ import * as Download from '../Download/Download.js'
4
+ import * as FirstNodeWorkerEventType from '../FirstNodeWorkerEventType/FirstNodeWorkerEventType.js'
5
+ import * as GetFirstSpawnedProcessEvent from '../GetFirstSpawnedProcessEvent/GetFirstSpawnedProcessEvent.js'
6
+ import * as GetNsisUpdateArgs from '../GetNsisUpdateArgs/GetNsisUpdateArgs.js'
7
+ import * as GetNsisDownloadPath from '../GetNsisUpdateDownloadPath/GetNsisUpdateDownloadPath.js'
8
+ import * as GetWindowsNsisDownloadUrl from '../GetWindowsNsisDownloadUrl/GetWindowsNsisDownloadUrl.js'
9
+ import * as Logger from '../Logger/Logger.js'
10
+ import * as Platform from '../Platform/Platform.js'
11
+ import * as UpdateState from '../UpdateState/UpdateState.js'
12
+ import * as UpdateStateType from '../UpdateStateType/UpdateStateType.js'
13
+ import { VError } from '../VError/VError.js'
14
+
14
15
  const getArchPostFix = (arch) => {
15
- switch (arch) {
16
- case 'arm':
17
- case 'arm64':
18
- return '-arm64';
19
- default:
20
- return '-x64';
21
- }
22
- };
16
+ switch (arch) {
17
+ case 'arm':
18
+ case 'arm64':
19
+ return '-arm64'
20
+ default:
21
+ return '-x64'
22
+ }
23
+ }
24
+
23
25
  // TODO make it possible to cancel downloading updates
24
26
  export const downloadUpdate = async (version) => {
25
- try {
26
- Assert.string(version);
27
- const repository = Platform.getRepository();
28
- const setupName = Platform.getSetupName();
29
- const archPostFix = getArchPostFix(process.arch);
30
- const fileName = `${setupName}-v${version}${archPostFix}.exe`;
31
- const downLoadUrl = GetWindowsNsisDownloadUrl.getDownloadUrl(repository, version, fileName);
32
- const outFile = GetNsisDownloadPath.getNsisUpdateDownloadPath(version);
33
- Logger.info(`[shared-process] downloading nsis update: ${downLoadUrl} -> ${outFile}`);
34
- UpdateState.set(UpdateStateType.Downloading);
35
- await Download.download(downLoadUrl, outFile);
36
- UpdateState.set(UpdateStateType.Downloaded);
37
- Logger.info(`[shared-process] downloaded nsis update: ${outFile}`);
38
- return outFile;
39
- }
40
- catch (error) {
41
- throw new VError(error, `Failed to download new version ${version}`);
42
- }
43
- };
27
+ try {
28
+ Assert.string(version)
29
+ const repository = Platform.getRepository()
30
+ const setupName = Platform.getSetupName()
31
+ const archPostFix = getArchPostFix(process.arch)
32
+ const fileName = `${setupName}-v${version}${archPostFix}.exe`
33
+ const downLoadUrl = GetWindowsNsisDownloadUrl.getDownloadUrl(repository, version, fileName)
34
+ const outFile = GetNsisDownloadPath.getNsisUpdateDownloadPath(version)
35
+ Logger.info(`[shared-process] downloading nsis update: ${downLoadUrl} -> ${outFile}`)
36
+ UpdateState.set(UpdateStateType.Downloading)
37
+ await Download.download(downLoadUrl, outFile)
38
+ UpdateState.set(UpdateStateType.Downloaded)
39
+ Logger.info(`[shared-process] downloaded nsis update: ${outFile}`)
40
+ return outFile
41
+ } catch (error) {
42
+ throw new VError(error, `Failed to download new version ${version}`)
43
+ }
44
+ }
45
+
44
46
  export const installAndRestart = async (downloadPath) => {
45
- try {
46
- Assert.string(downloadPath);
47
- const args = GetNsisUpdateArgs.getNsisUpdateArgs();
48
- Logger.info(`[shared-process] spawning nsis update: ${downloadPath}`);
49
- UpdateState.set(UpdateStateType.Updating);
50
- const child = spawn(downloadPath, args, {
51
- stdio: 'inherit',
52
- detached: true,
53
- });
54
- const { type, event } = await GetFirstSpawnedProcessEvent.getFirstSpawnedProcessEvent(child);
55
- if (type === FirstNodeWorkerEventType.Error) {
56
- throw new Error(`Child process error: ${event}`);
57
- }
58
- Logger.info(`[shared-process] finished nsis update`);
59
- }
60
- catch (error) {
61
- throw new VError(error, `Failed to install nsis update`);
47
+ try {
48
+ Assert.string(downloadPath)
49
+ const args = GetNsisUpdateArgs.getNsisUpdateArgs()
50
+ Logger.info(`[shared-process] spawning nsis update: ${downloadPath}`)
51
+ UpdateState.set(UpdateStateType.Updating)
52
+ const child = spawn(downloadPath, args, {
53
+ stdio: 'inherit',
54
+ detached: true,
55
+ })
56
+ const { type, event } = await GetFirstSpawnedProcessEvent.getFirstSpawnedProcessEvent(child)
57
+ if (type === FirstNodeWorkerEventType.Error) {
58
+ throw new Error(`Child process error: ${event}`)
62
59
  }
63
- };
60
+ Logger.info(`[shared-process] finished nsis update`)
61
+ } catch (error) {
62
+ throw new VError(error, `Failed to install nsis update`)
63
+ }
64
+ }