app-builder-lib 27.0.0-alpha.0 → 27.0.0-alpha.10

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 (458) hide show
  1. package/dist/Framework.d.ts +2 -0
  2. package/dist/Framework.d.ts.map +1 -1
  3. package/dist/Framework.js.map +1 -1
  4. package/dist/appInfo.d.ts +1 -1
  5. package/dist/appInfo.d.ts.map +1 -1
  6. package/dist/appInfo.js +3 -3
  7. package/dist/appInfo.js.map +1 -1
  8. package/dist/asar/asar.js +1 -1
  9. package/dist/asar/asar.js.map +1 -1
  10. package/dist/asar/asarFileChecker.d.ts +4 -2
  11. package/dist/asar/asarFileChecker.d.ts.map +1 -1
  12. package/dist/asar/asarFileChecker.js +2 -3
  13. package/dist/asar/asarFileChecker.js.map +1 -1
  14. package/dist/asar/asarUtil.js +21 -11
  15. package/dist/asar/asarUtil.js.map +1 -1
  16. package/dist/codeSign/certInfo.d.ts +14 -0
  17. package/dist/codeSign/certInfo.d.ts.map +1 -1
  18. package/dist/codeSign/certInfo.js +49 -0
  19. package/dist/codeSign/certInfo.js.map +1 -1
  20. package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
  21. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  22. package/dist/codeSign/mac/macCodeSign.js +50 -25
  23. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  24. package/dist/codeSign/signResult.d.ts +26 -0
  25. package/dist/codeSign/signResult.d.ts.map +1 -0
  26. package/dist/codeSign/signResult.js +12 -0
  27. package/dist/codeSign/signResult.js.map +1 -0
  28. package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
  29. package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
  30. package/dist/codeSign/win/hsmSignManager.js +50 -0
  31. package/dist/codeSign/win/hsmSignManager.js.map +1 -0
  32. package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
  33. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
  34. package/dist/codeSign/win/pkcs11SignManager.js +82 -0
  35. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
  36. package/dist/codeSign/win/signManager.d.ts +17 -0
  37. package/dist/codeSign/win/signManager.d.ts.map +1 -0
  38. package/dist/codeSign/win/signManager.js +19 -0
  39. package/dist/codeSign/win/signManager.js.map +1 -0
  40. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +95 -0
  41. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
  42. package/dist/codeSign/win/signtoolBaseSignManager.js +507 -0
  43. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
  44. package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
  45. package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
  46. package/dist/codeSign/win/windowsCodeSign.js +22 -8
  47. package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
  48. package/dist/codeSign/win/windowsSignAzureManager.d.ts +11 -4
  49. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  50. package/dist/codeSign/win/windowsSignAzureManager.js +142 -37
  51. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  52. package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
  53. package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
  54. package/dist/codeSign/win/windowsSignToolManager.js +3 -363
  55. package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
  56. package/dist/configuration.d.ts +228 -163
  57. package/dist/configuration.d.ts.map +1 -1
  58. package/dist/configuration.js +11 -1
  59. package/dist/configuration.js.map +1 -1
  60. package/dist/core.d.ts +14 -0
  61. package/dist/core.d.ts.map +1 -1
  62. package/dist/core.js +11 -0
  63. package/dist/core.js.map +1 -1
  64. package/dist/electron/ElectronFramework.d.ts +3 -3
  65. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  66. package/dist/electron/ElectronFramework.js +60 -61
  67. package/dist/electron/ElectronFramework.js.map +1 -1
  68. package/dist/electron/electronArchSupport.d.ts +12 -0
  69. package/dist/electron/electronArchSupport.d.ts.map +1 -0
  70. package/dist/electron/electronArchSupport.js +58 -0
  71. package/dist/electron/electronArchSupport.js.map +1 -0
  72. package/dist/electron/electronVersion.d.ts.map +1 -1
  73. package/dist/electron/electronVersion.js +1 -11
  74. package/dist/electron/electronVersion.js.map +1 -1
  75. package/dist/electron/injectFFMPEG.js +2 -2
  76. package/dist/electron/injectFFMPEG.js.map +1 -1
  77. package/dist/electron/mac/electronMac.js +24 -35
  78. package/dist/electron/mac/electronMac.js.map +1 -1
  79. package/dist/electron/mac/electronMacUtils.d.ts +24 -0
  80. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
  81. package/dist/electron/mac/electronMacUtils.js +42 -0
  82. package/dist/electron/mac/electronMacUtils.js.map +1 -0
  83. package/dist/electron/win/electronWin.js +2 -2
  84. package/dist/electron/win/electronWin.js.map +1 -1
  85. package/dist/fileMatcher.d.ts +42 -2
  86. package/dist/fileMatcher.d.ts.map +1 -1
  87. package/dist/fileMatcher.js +246 -18
  88. package/dist/fileMatcher.js.map +1 -1
  89. package/dist/index.d.ts +11 -5
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +17 -1
  92. package/dist/index.js.map +1 -1
  93. package/dist/indexInternal.d.ts +19 -8
  94. package/dist/indexInternal.d.ts.map +1 -1
  95. package/dist/indexInternal.js +18 -7
  96. package/dist/indexInternal.js.map +1 -1
  97. package/dist/linuxPackager.d.ts.map +1 -1
  98. package/dist/linuxPackager.js +19 -1
  99. package/dist/linuxPackager.js.map +1 -1
  100. package/dist/macPackager.d.ts +31 -14
  101. package/dist/macPackager.d.ts.map +1 -1
  102. package/dist/macPackager.js +236 -147
  103. package/dist/macPackager.js.map +1 -1
  104. package/dist/node-module-collector/index.d.ts.map +1 -1
  105. package/dist/node-module-collector/index.js +47 -16
  106. package/dist/node-module-collector/index.js.map +1 -1
  107. package/dist/node-module-collector/moduleManager.d.ts +11 -2
  108. package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
  109. package/dist/node-module-collector/moduleManager.js +34 -14
  110. package/dist/node-module-collector/moduleManager.js.map +1 -1
  111. package/dist/node-module-collector/nodeModulesCollector.d.ts +47 -26
  112. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  113. package/dist/node-module-collector/nodeModulesCollector.js +157 -142
  114. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  115. package/dist/node-module-collector/packageManager.js +1 -1
  116. package/dist/node-module-collector/packageManager.js.map +1 -1
  117. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +90 -1
  118. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  119. package/dist/node-module-collector/pnpmNodeModulesCollector.js +325 -25
  120. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  121. package/dist/node-module-collector/types.d.ts +4 -0
  122. package/dist/node-module-collector/types.d.ts.map +1 -1
  123. package/dist/node-module-collector/types.js.map +1 -1
  124. package/dist/options/FuseOptionsV1.d.ts +137 -0
  125. package/dist/options/FuseOptionsV1.d.ts.map +1 -0
  126. package/dist/options/FuseOptionsV1.js +2 -0
  127. package/dist/options/FuseOptionsV1.js.map +1 -0
  128. package/dist/options/MsixOptions.d.ts +126 -0
  129. package/dist/options/MsixOptions.d.ts.map +1 -0
  130. package/dist/options/MsixOptions.js +2 -0
  131. package/dist/options/MsixOptions.js.map +1 -0
  132. package/dist/options/PlatformSpecificBuildOptions.d.ts +55 -9
  133. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  134. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  135. package/dist/options/SnapOptions.d.ts +23 -17
  136. package/dist/options/SnapOptions.d.ts.map +1 -1
  137. package/dist/options/SnapOptions.js.map +1 -1
  138. package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
  139. package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
  140. package/dist/options/SquirrelWindowsOptions.js.map +1 -1
  141. package/dist/options/linuxOptions.d.ts +8 -12
  142. package/dist/options/linuxOptions.d.ts.map +1 -1
  143. package/dist/options/linuxOptions.js.map +1 -1
  144. package/dist/options/macOptions.d.ts +113 -131
  145. package/dist/options/macOptions.d.ts.map +1 -1
  146. package/dist/options/macOptions.js.map +1 -1
  147. package/dist/options/pkgOptions.d.ts +1 -1
  148. package/dist/options/pkgOptions.js.map +1 -1
  149. package/dist/options/winOptions.d.ts +282 -70
  150. package/dist/options/winOptions.d.ts.map +1 -1
  151. package/dist/options/winOptions.js +12 -1
  152. package/dist/options/winOptions.js.map +1 -1
  153. package/dist/packager.d.ts +6 -1
  154. package/dist/packager.d.ts.map +1 -1
  155. package/dist/packager.js +121 -40
  156. package/dist/packager.js.map +1 -1
  157. package/dist/packagerApi.d.ts +10 -1
  158. package/dist/packagerApi.d.ts.map +1 -1
  159. package/dist/packagerApi.js.map +1 -1
  160. package/dist/platformPackager.d.ts +49 -3
  161. package/dist/platformPackager.d.ts.map +1 -1
  162. package/dist/platformPackager.js +130 -17
  163. package/dist/platformPackager.js.map +1 -1
  164. package/dist/publish/PublishManager.d.ts +36 -2
  165. package/dist/publish/PublishManager.d.ts.map +1 -1
  166. package/dist/publish/PublishManager.js +387 -23
  167. package/dist/publish/PublishManager.js.map +1 -1
  168. package/dist/publish/updateInfoBuilder.d.ts +1 -1
  169. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  170. package/dist/publish/updateInfoBuilder.js +110 -32
  171. package/dist/publish/updateInfoBuilder.js.map +1 -1
  172. package/dist/targets/ArchiveTarget.d.ts +1 -0
  173. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  174. package/dist/targets/ArchiveTarget.js +6 -3
  175. package/dist/targets/ArchiveTarget.js.map +1 -1
  176. package/dist/targets/archive.d.ts +33 -2
  177. package/dist/targets/archive.d.ts.map +1 -1
  178. package/dist/targets/archive.js +109 -29
  179. package/dist/targets/archive.js.map +1 -1
  180. package/dist/targets/blockmap/blockmap.d.ts +43 -3
  181. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  182. package/dist/targets/blockmap/blockmap.js +141 -15
  183. package/dist/targets/blockmap/blockmap.js.map +1 -1
  184. package/dist/targets/blockmap/verbatimRange.d.ts +44 -0
  185. package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -0
  186. package/dist/targets/blockmap/verbatimRange.js +117 -0
  187. package/dist/targets/blockmap/verbatimRange.js.map +1 -0
  188. package/dist/targets/differentialUpdateInfoBuilder.d.ts +28 -2
  189. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  190. package/dist/targets/differentialUpdateInfoBuilder.js +75 -6
  191. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  192. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  193. package/dist/targets/linux/FlatpakTarget.js +13 -3
  194. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  195. package/dist/targets/linux/FpmTarget.d.ts +14 -0
  196. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  197. package/dist/targets/linux/FpmTarget.js +86 -10
  198. package/dist/targets/linux/FpmTarget.js.map +1 -1
  199. package/dist/targets/linux/LinuxTargetHelper.d.ts +15 -0
  200. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  201. package/dist/targets/linux/LinuxTargetHelper.js +54 -59
  202. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  203. package/dist/targets/linux/appimage/AppImageTarget.d.ts +2 -0
  204. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  205. package/dist/targets/linux/appimage/AppImageTarget.js +16 -15
  206. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  207. package/dist/targets/linux/appimage/appImageUtil.d.ts +5 -1
  208. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  209. package/dist/targets/linux/appimage/appImageUtil.js +14 -7
  210. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  211. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  212. package/dist/targets/linux/appimage/appLauncher.js +5 -11
  213. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  214. package/dist/targets/linux/launcherScript.d.ts +32 -0
  215. package/dist/targets/linux/launcherScript.d.ts.map +1 -0
  216. package/dist/targets/linux/launcherScript.js +24 -0
  217. package/dist/targets/linux/launcherScript.js.map +1 -0
  218. package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
  219. package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
  220. package/dist/targets/linux/snap/SnapTarget.js +23 -1
  221. package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
  222. package/dist/targets/linux/snap/core24.d.ts +30 -1
  223. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  224. package/dist/targets/linux/snap/core24.js +146 -70
  225. package/dist/targets/linux/snap/core24.js.map +1 -1
  226. package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
  227. package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
  228. package/dist/targets/linux/snap/coreCustom.js +2 -2
  229. package/dist/targets/linux/snap/coreCustom.js.map +1 -1
  230. package/dist/targets/linux/snap/coreLegacy.d.ts +3 -3
  231. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  232. package/dist/targets/linux/snap/coreLegacy.js +12 -12
  233. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  234. package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
  235. package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
  236. package/dist/targets/linux/snap/snapCommand.js +21 -0
  237. package/dist/targets/linux/snap/snapCommand.js.map +1 -0
  238. package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
  239. package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
  240. package/dist/targets/linux/snap/snapcraft.js +11 -0
  241. package/dist/targets/linux/snap/snapcraft.js.map +1 -0
  242. package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
  243. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  244. package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
  245. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  246. package/dist/targets/mac/MacTargetHelper.d.ts +146 -14
  247. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  248. package/dist/targets/mac/MacTargetHelper.js +485 -91
  249. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  250. package/dist/targets/mac/pkg.d.ts +16 -0
  251. package/dist/targets/mac/pkg.d.ts.map +1 -1
  252. package/dist/targets/mac/pkg.js +31 -5
  253. package/dist/targets/mac/pkg.js.map +1 -1
  254. package/dist/targets/targetFactory.d.ts +7 -0
  255. package/dist/targets/targetFactory.d.ts.map +1 -1
  256. package/dist/targets/targetFactory.js +28 -0
  257. package/dist/targets/targetFactory.js.map +1 -1
  258. package/dist/targets/win/AppxTarget.d.ts +1 -2
  259. package/dist/targets/win/AppxTarget.d.ts.map +1 -1
  260. package/dist/targets/win/AppxTarget.js +37 -314
  261. package/dist/targets/win/AppxTarget.js.map +1 -1
  262. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  263. package/dist/targets/win/MsiTarget.js +13 -13
  264. package/dist/targets/win/MsiTarget.js.map +1 -1
  265. package/dist/targets/win/MsixTarget.d.ts +22 -0
  266. package/dist/targets/win/MsixTarget.d.ts.map +1 -0
  267. package/dist/targets/win/MsixTarget.js +214 -0
  268. package/dist/targets/win/MsixTarget.js.map +1 -0
  269. package/dist/targets/win/nsis/Defines.d.ts +3 -0
  270. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  271. package/dist/targets/win/nsis/Defines.js.map +1 -1
  272. package/dist/targets/win/nsis/NsisTarget.d.ts +57 -3
  273. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  274. package/dist/targets/win/nsis/NsisTarget.js +252 -113
  275. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  276. package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
  277. package/dist/targets/win/nsis/WebInstallerTarget.js +23 -12
  278. package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
  279. package/dist/targets/win/nsis/nsisOptions.d.ts +56 -48
  280. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  281. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  282. package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
  283. package/dist/targets/win/nsis/nsisScriptGenerator.js +4 -3
  284. package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
  285. package/dist/targets/win/nsis/nsisUtil.d.ts +17 -2
  286. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  287. package/dist/targets/win/nsis/nsisUtil.js +143 -41
  288. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  289. package/dist/targets/win/nsis/progId.d.ts +21 -0
  290. package/dist/targets/win/nsis/progId.d.ts.map +1 -0
  291. package/dist/targets/win/nsis/progId.js +60 -0
  292. package/dist/targets/win/nsis/progId.js.map +1 -0
  293. package/dist/targets/win/winAppUtil.d.ts +115 -0
  294. package/dist/targets/win/winAppUtil.d.ts.map +1 -0
  295. package/dist/targets/win/winAppUtil.js +407 -0
  296. package/dist/targets/win/winAppUtil.js.map +1 -0
  297. package/dist/toolsets/7zip.d.ts +32 -0
  298. package/dist/toolsets/7zip.d.ts.map +1 -1
  299. package/dist/toolsets/7zip.js +39 -11
  300. package/dist/toolsets/7zip.js.map +1 -1
  301. package/dist/toolsets/appimage.d.ts +3 -3
  302. package/dist/toolsets/appimage.d.ts.map +1 -1
  303. package/dist/toolsets/appimage.js +9 -6
  304. package/dist/toolsets/appimage.js.map +1 -1
  305. package/dist/toolsets/custom.d.ts +2 -3
  306. package/dist/toolsets/custom.d.ts.map +1 -1
  307. package/dist/toolsets/custom.js +67 -149
  308. package/dist/toolsets/custom.js.map +1 -1
  309. package/dist/toolsets/fpm.d.ts.map +1 -1
  310. package/dist/toolsets/fpm.js +11 -5
  311. package/dist/toolsets/fpm.js.map +1 -1
  312. package/dist/toolsets/icons.d.ts.map +1 -1
  313. package/dist/toolsets/icons.js +17 -3
  314. package/dist/toolsets/icons.js.map +1 -1
  315. package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
  316. package/dist/toolsets/linuxToolsMac.js +17 -4
  317. package/dist/toolsets/linuxToolsMac.js.map +1 -1
  318. package/dist/toolsets/nsis.d.ts +5 -0
  319. package/dist/toolsets/nsis.d.ts.map +1 -1
  320. package/dist/toolsets/nsis.js +20 -4
  321. package/dist/toolsets/nsis.js.map +1 -1
  322. package/dist/toolsets/version.d.ts +12 -0
  323. package/dist/toolsets/version.d.ts.map +1 -0
  324. package/dist/toolsets/version.js +13 -0
  325. package/dist/toolsets/version.js.map +1 -0
  326. package/dist/toolsets/winCodeSign.d.ts +56 -3
  327. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  328. package/dist/toolsets/winCodeSign.js +125 -42
  329. package/dist/toolsets/winCodeSign.js.map +1 -1
  330. package/dist/toolsets/wine.d.ts +2 -1
  331. package/dist/toolsets/wine.d.ts.map +1 -1
  332. package/dist/toolsets/wine.js +31 -15
  333. package/dist/toolsets/wine.js.map +1 -1
  334. package/dist/util/NodeModuleCopyHelper.js +14 -6
  335. package/dist/util/NodeModuleCopyHelper.js.map +1 -1
  336. package/dist/util/appFileCopier.d.ts +52 -0
  337. package/dist/util/appFileCopier.d.ts.map +1 -1
  338. package/dist/util/appFileCopier.js +221 -21
  339. package/dist/util/appFileCopier.js.map +1 -1
  340. package/dist/util/archCompatibility.d.ts +42 -0
  341. package/dist/util/archCompatibility.d.ts.map +1 -0
  342. package/dist/util/archCompatibility.js +202 -0
  343. package/dist/util/archCompatibility.js.map +1 -0
  344. package/dist/util/checksum.d.ts +36 -0
  345. package/dist/util/checksum.d.ts.map +1 -0
  346. package/dist/util/checksum.js +48 -0
  347. package/dist/util/checksum.js.map +1 -0
  348. package/dist/util/config/config.d.ts +1 -0
  349. package/dist/util/config/config.d.ts.map +1 -1
  350. package/dist/util/config/config.js +8 -1
  351. package/dist/util/config/config.js.map +1 -1
  352. package/dist/util/config/legacyConfigGuard.d.ts +7 -0
  353. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
  354. package/dist/util/config/legacyConfigGuard.js +187 -0
  355. package/dist/util/config/legacyConfigGuard.js.map +1 -0
  356. package/dist/util/config/legacyOptions.d.ts +75 -0
  357. package/dist/util/config/legacyOptions.d.ts.map +1 -0
  358. package/dist/util/config/legacyOptions.js +399 -0
  359. package/dist/util/config/legacyOptions.js.map +1 -0
  360. package/dist/util/config/load.d.ts +2 -2
  361. package/dist/util/config/load.d.ts.map +1 -1
  362. package/dist/util/config/load.js +3 -12
  363. package/dist/util/config/load.js.map +1 -1
  364. package/dist/util/config/schemaValidator.d.ts.map +1 -1
  365. package/dist/util/config/schemaValidator.js +26 -3
  366. package/dist/util/config/schemaValidator.js.map +1 -1
  367. package/dist/util/electronGet.d.ts +30 -32
  368. package/dist/util/electronGet.d.ts.map +1 -1
  369. package/dist/util/electronGet.js +359 -129
  370. package/dist/util/electronGet.js.map +1 -1
  371. package/dist/util/flags.d.ts +5 -5
  372. package/dist/util/flags.d.ts.map +1 -1
  373. package/dist/util/flags.js +124 -16
  374. package/dist/util/flags.js.map +1 -1
  375. package/dist/util/hash.d.ts +1 -1
  376. package/dist/util/hash.d.ts.map +1 -1
  377. package/dist/util/hash.js +1 -15
  378. package/dist/util/hash.js.map +1 -1
  379. package/dist/util/installOrRebuild.d.ts +44 -0
  380. package/dist/util/installOrRebuild.d.ts.map +1 -0
  381. package/dist/util/installOrRebuild.js +276 -0
  382. package/dist/util/installOrRebuild.js.map +1 -0
  383. package/dist/util/langs.d.ts.map +1 -1
  384. package/dist/util/langs.js +1 -0
  385. package/dist/util/langs.js.map +1 -1
  386. package/dist/util/license.d.ts.map +1 -1
  387. package/dist/util/license.js +4 -1
  388. package/dist/util/license.js.map +1 -1
  389. package/dist/util/mac/macosIconComposer.d.ts +2 -1
  390. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  391. package/dist/util/mac/macosIconComposer.js +41 -59
  392. package/dist/util/mac/macosIconComposer.js.map +1 -1
  393. package/dist/util/mac/macosVersion.d.ts +0 -1
  394. package/dist/util/mac/macosVersion.d.ts.map +1 -1
  395. package/dist/util/mac/macosVersion.js +0 -3
  396. package/dist/util/mac/macosVersion.js.map +1 -1
  397. package/dist/util/mac/plist.d.ts +1 -1
  398. package/dist/util/mac/plist.d.ts.map +1 -1
  399. package/dist/util/mac/plist.js +6 -1
  400. package/dist/util/mac/plist.js.map +1 -1
  401. package/dist/util/nativeBinaryVerifier.d.ts +40 -0
  402. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -0
  403. package/dist/util/nativeBinaryVerifier.js +381 -0
  404. package/dist/util/nativeBinaryVerifier.js.map +1 -0
  405. package/dist/util/packageMetadata.js +57 -31
  406. package/dist/util/packageMetadata.js.map +1 -1
  407. package/dist/util/repositoryInfo.js +6 -3
  408. package/dist/util/repositoryInfo.js.map +1 -1
  409. package/dist/util/resolve.js +1 -1
  410. package/dist/util/resolve.js.map +1 -1
  411. package/dist/util/streamSpawnToFile.d.ts +47 -0
  412. package/dist/util/streamSpawnToFile.d.ts.map +1 -0
  413. package/dist/util/streamSpawnToFile.js +110 -0
  414. package/dist/util/streamSpawnToFile.js.map +1 -0
  415. package/dist/util/toolsetLock.d.ts +2 -0
  416. package/dist/util/toolsetLock.d.ts.map +1 -1
  417. package/dist/util/toolsetLock.js +31 -5
  418. package/dist/util/toolsetLock.js.map +1 -1
  419. package/dist/version.d.ts +1 -1
  420. package/dist/version.d.ts.map +1 -1
  421. package/dist/version.js +1 -1
  422. package/dist/version.js.map +1 -1
  423. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  424. package/dist/vm/ParallelsVm.js +29 -3
  425. package/dist/vm/ParallelsVm.js.map +1 -1
  426. package/dist/vm/vm.d.ts +2 -0
  427. package/dist/vm/vm.d.ts.map +1 -1
  428. package/dist/vm/vm.js +29 -6
  429. package/dist/vm/vm.js.map +1 -1
  430. package/dist/winPackager.d.ts +6 -5
  431. package/dist/winPackager.d.ts.map +1 -1
  432. package/dist/winPackager.js +45 -39
  433. package/dist/winPackager.js.map +1 -1
  434. package/package.json +19 -18
  435. package/scheme.json +1731 -961
  436. package/templates/appx/appxmanifest.xml +2 -3
  437. package/templates/entitlements.mac.adhoc.plist +15 -0
  438. package/templates/entitlements.mac.plist +9 -6
  439. package/templates/msix/appxmanifest.xml +45 -0
  440. package/templates/nsis/assistedMessages.yml +17 -0
  441. package/templates/nsis/common.nsh +2 -2
  442. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +96 -13
  443. package/templates/nsis/include/extractAppPackage.nsh +5 -2
  444. package/templates/nsis/include/installUtil.nsh +2 -2
  445. package/templates/nsis/include/installer.nsh +88 -50
  446. package/templates/nsis/include/webPackage.nsh +52 -27
  447. package/templates/nsis/installSection.nsh +29 -0
  448. package/templates/nsis/installer.nsi +1 -1
  449. package/templates/nsis/messages.yml +5 -0
  450. package/templates/nsis/multiUserUi.nsh +1 -1
  451. package/dist/codeSign/signManager.d.ts +0 -14
  452. package/dist/codeSign/signManager.d.ts.map +0 -1
  453. package/dist/codeSign/signManager.js +0 -2
  454. package/dist/codeSign/signManager.js.map +0 -1
  455. package/dist/util/yarn.d.ts +0 -23
  456. package/dist/util/yarn.d.ts.map +0 -1
  457. package/dist/util/yarn.js +0 -153
  458. package/dist/util/yarn.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAI3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa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AM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QAEhI,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport { SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport type { Identity } from \"@electron/osx-sign/dist/cjs/util-identities\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { dynamicImport } from \"./util/dynamicImport.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\ninterface PlatformConfig {\n type: PlatformType\n config: MacConfiguration | MasConfiguration\n isDevelopment: boolean\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n // Set/cleared in doPack so applyCommonInfo can read the per-pack platformSpecificBuildOptions\n // (the framework call chain doesn't thread it through to applyCommonInfo). Fixes #8909.\n private _activePackConfig: MacConfiguration | MasConfiguration | null = null\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type\n */\n private getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let isDevelopment = false\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n isDevelopment = false\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev, {\n type: \"development\",\n })\n isDevelopment = true\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n isDevelopment = false\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, isDevelopment, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // codesign requires the filename to be normalized to the NFD form\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true)\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n // Bridge the per-pack platformSpecificBuildOptions to applyCommonInfo, which is called deep in the\n // framework stack (doPack → beforeCopyExtraFiles → createMacApp → applyCommonInfo) without it.\n this._activePackConfig = config.platformSpecificBuildOptions\n try {\n return await super.doPack(config)\n } finally {\n this._activePackConfig = null\n }\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n this._activePackConfig = config.platformSpecificBuildOptions\n try {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const { makeUniversalApp } = await dynamicImport<typeof import(\"@electron/universal\")>(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true, // must be ?? to allow false\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles || undefined,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles || undefined,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that signMas() is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n } finally {\n this._activePackConfig = null\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n if (prepackaged == null) {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n await this.signMas(path.resolve(targetOutDir, `${path.basename(this.appInfo.productFilename)}.app`), targetOutDir, platformConfig, arch)\n } else {\n await this.signMas(prepackaged, targetOutDir, platformConfig, arch)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n private async signMas(appPath: string, outDir: string, platformConfig: PlatformConfig, arch: Arch): Promise<boolean> {\n const signed = await this.sign(appPath, outDir, platformConfig.config as MasConfiguration, arch, true)\n return signed\n }\n\n /**\n * Main signing method with platform awareness\n */\n private async sign(appPath: string, outDir: string | null, options: MasConfiguration | MacConfiguration | null, arch: Arch, isMas: boolean = false): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const config = options ?? this.platformSpecificBuildOptions\n const qualifier = config.identity\n\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = config.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n\n const identity = await this.helper.findSigningIdentity(isMas, isDevelopment, qualifier, keychainFile, config)\n\n if (!identity) {\n return false\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, type, isMas, config, keychainFile, arch)\n await this.doSign(signOptions, config, identity)\n\n // Handle MAS installer creation\n if (isMas && !isDevelopment && outDir) {\n await this.helper.createMasInstaller(appPath, outDir, config as MasConfiguration, keychainFile, isDevelopment, arch)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return true\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration | MasConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n const activeOpts = this._activePackConfig ?? this.platformSpecificBuildOptions\n appPlist.CFBundleShortVersionString = activeOpts.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = activeOpts.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const isMas = packContext.electronPlatformName === \"mas\"\n const activeConfig = this._activePackConfig ?? this.platformSpecificBuildOptions\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n await this.sign(safeSignTarget, null, isMas ? activeConfig : null, packContext.arch, isMas)\n }\n })\n )\n return true\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return true\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa,EACb,yBAAyB,EACzB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAmB,cAAc,EAAmC,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACrJ,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAiB,MAAM,0BA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AAC,UAAU,EAAE,yBAAyB,CAAC,CAAA;gBAC7E,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;YAC1E,CAAC,CAAC,CACL,CAAA;QACH,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,MAAM,CAAA;QACzD,+GAA+G;QAC/G,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrI,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;QACpC,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAEnJ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport type { SignOptions } from \"@electron/osx-sign\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { assertSafeHelperName } from \"./electron/mac/electronMacUtils.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, Identity, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { combineSignResults, isSignResultSigned, SigningResult } from \"./codeSign/signResult.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, MasPlatformType, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { ElectronSignOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from \"./util/archCompatibility.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nfunction isElectronSignOptions(sign: MacConfiguration[\"sign\"]): sign is ElectronSignOptions {\n return typeof sign === \"object\" && sign !== null\n}\n\ninterface PlatformConfig<C extends MacConfiguration | MasConfiguration = MacConfiguration | MasConfiguration> {\n type: PlatformType\n config: C\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type. Calls statically known to be a MAS\n * flavor (`mas` / `mas-dev`) get a `MasConfiguration` back, so no cast is needed downstream.\n */\n getPlatformConfig(platformType: MasPlatformType): PlatformConfig<MasConfiguration>\n getPlatformConfig(platformType: PlatformType): PlatformConfig\n getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer\n // carried as a config field; it is derived from `platformType` wherever signing happens.\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev)\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n const macAppInfo = new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n // Electron discovers its helper apps via `${CFBundleName} Helper.app`. We use the product name\n // verbatim for `CFBundleName` and for the on-disk helper/app bundle names, so a name that\n // filename sanitization would change must be rejected (otherwise the two would diverge and break\n // helper discovery). Fail fast during setup.\n assertSafeHelperName(macAppInfo.productName, \"productName\")\n const executableName = this.platformSpecificBuildOptions.executableName ?? this.info.config.executableName\n if (executableName != null) {\n assertSafeHelperName(executableName, \"executableName\")\n }\n return macAppInfo\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n return await super.doPack(config)\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n // Keep both slices symmetric: don't drop platform-mismatched modules per-arch (that asymmetry breaks\n // the universal merge). Single-arch binaries are reconciled below via `computeSingleArchFiles`.\n disableArchFilter: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const universalOpts = platformSpecificBuildOptions.universal\n\n // Single-arch binaries that can't be merged into a universal Mach-O. Two sources:\n // 1. `cpu`/`os`-declared platform packages (e.g. `@esbuild/darwin-arm64`), which the collection filter\n // confines to their native slice — mark the whole package so unique non-binary siblings don't trip the merge.\n // 2. Host binaries identical in both slices inside packages that declare no `cpu`/`os` (e.g. esbuild's\n // install script overwriting `esbuild/bin/esbuild` with the platform binary) — mark the file.\n // Both are reported to `@electron/universal` via `singleArchFiles`; otherwise it aborts on the arch mismatch.\n const singleArchFiles = await this.computeSingleArchFiles(\n path.join(safeX64AppOutDir, appFile),\n path.join(safeArm64AppOutPath, appFile),\n universalOpts?.singleArchFiles ?? undefined\n )\n\n await makeUniversalApp({\n mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs\n ...universalOpts,\n singleArchFiles,\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n /**\n * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for\n * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.\n */\n private async computeSingleArchFiles(x64AppPath: string, arm64AppPath: string, userPattern: string | undefined): Promise<string | undefined> {\n const unpacked = (appPath: string) => path.join(appPath, \"Contents\", \"Resources\", \"app.asar.unpacked\")\n const x64Unpacked = unpacked(x64AppPath)\n const arm64Unpacked = unpacked(arm64AppPath)\n\n // (1) `cpu`/`os`-declared platform packages confined to one slice — mark the whole package.\n const packageNames = new Set<string>()\n await collectSingleArchPackageNames(path.join(x64Unpacked, \"node_modules\"), packageNames)\n await collectSingleArchPackageNames(path.join(arm64Unpacked, \"node_modules\"), packageNames)\n\n // (2) undeclared host binaries identical in both slices (e.g. `esbuild/bin/esbuild`) — mark the file.\n const machOFiles = await collectIdenticalSingleArchMachOFiles(x64Unpacked, arm64Unpacked)\n\n const patterns = [...Array.from(packageNames).map(name => `**/${name}/**`), ...machOFiles]\n if (patterns.length === 0) {\n return userPattern\n }\n\n log.warn(\n { packages: Array.from(packageNames).sort().join(\", \") || \"(none)\", files: machOFiles.sort().join(\", \") || \"(none)\" },\n \"Universal build contains single-architecture binaries; they are copied as-is per slice (not lipo-merged), so each is only usable on architectures whose platform package was installed on this build host. \" +\n \"If these are build-only tools (e.g. esbuild), move them to `devDependencies` or exclude them via `files` to omit them entirely. \" +\n \"If they are needed at runtime, install every target architecture's variant so the universal app works on both Intel and Apple Silicon (pnpm/yarn: `supportedArchitectures`; npm: `--cpu`/`--os`).\"\n )\n return buildSingleArchFilesPattern(patterns, userPattern)\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n let appPath: string = path.join(targetOutDir, `${this.appInfo.productFilename}.app`)\n if (prepackaged != null) {\n appPath = prepackaged\n } else {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n }\n const signResult = await this.sign(appPath, arch, platformType)\n const signed = isSignResultSigned(signResult)\n\n // The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other\n // emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before\n // the .pkg installer is built, and warn when signing was skipped (#9997).\n const packContext: AfterPackContext = {\n appOutDir: path.dirname(appPath),\n outDir: resolvedOutDir,\n arch,\n targets: [target],\n packager: this,\n electronPlatformName: platformConfig.platformName,\n }\n if (signed) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (await this.info.shouldSkipTargetsAfterPack(packContext)) {\n continue\n }\n\n // A development-signed build (mas-dev, or an explicit sign.type \"development\" — see\n // MacTargetHelper.shouldCreateMasInstaller) produces no installer\n const masSignConfig = platformConfig.config.sign\n const masSignOpts = isElectronSignOptions(masSignConfig) ? masSignConfig : undefined\n if (signed && MacTargetHelper.shouldCreateMasInstaller(platformType, masSignOpts?.type)) {\n await this.createMasInstaller(appPath, targetOutDir, arch, platformType)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (\n await this.info.shouldSkipTargetsAfterPack({\n appOutDir: path.dirname(appPath),\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: this.platform.nodeName,\n })\n ) {\n return\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n /**\n * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`\n * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).\n */\n protected async createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: MasPlatformType): Promise<void> {\n const config = this.getPlatformConfig(targetPlatform).config\n const signConfig = config.sign\n const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, targetPlatform, arch, signOpts?.identity)\n }\n\n /**\n * Main signing method with platform awareness. Protected so tests can stub signing\n * (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.\n */\n protected async sign(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<SigningResult> {\n if (!isSignAllowed()) {\n // non-mac host, or the pull-request CI guard — signing cannot happen in this environment\n return \"skipped:unsupported\"\n }\n\n // getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.\n const config = this.getPlatformConfig(targetPlatform).config.sign\n\n // sign: null → user explicitly disabled signing\n if (config === null) {\n return this.helper.handleNullIdentity()\n }\n\n const signOpts = isElectronSignOptions(config) ? config : undefined\n // sign.identity: null → explicit skip; undefined → auto-discover\n const qualifier = signOpts?.identity\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n // `config` is a custom fn/string module path when it's non-null and not an options object\n const hasCustomSign = config != null && !signOpts\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n\n const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts)\n\n if (!identity) {\n return \"skipped:no-certificate\"\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform, hasCustomSign)\n await this.doSign(signOptions, config, identity)\n\n // now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would\n // fail library validation at launch — the case the old blanket entitlements default used to mask\n if (!hasCustomSign) {\n await this.helper.warnAboutForeignSignedBinaries(appPath, identity, targetPlatform, signOpts)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return hasCustomSign ? \"signed:custom\" : \"signed\"\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, signConfig: MacConfiguration[\"sign\"], identity: Identity | null): Promise<void> {\n // Resolve a custom signer only when signConfig is a function or string module path.\n // ElectronSignOptions objects and undefined use @electron/osx-sign directly.\n const customSign =\n signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n // `opts.identity` is resolved once, in MacTargetHelper.resolveSignIdentity — never re-derive it here, or a\n // custom signer and @electron/osx-sign end up signing with different forms of the same certificate\n return customSign ? Promise.resolve(customSign(opts, this)) : sign(opts)\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void> {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name. The product name is used verbatim (it is validated in `prepareAppInfo` to\n // require no filename sanitization), so `CFBundleName` matches the on-disk helper bundle names\n // that Electron resolves as `${CFBundleName} Helper.app`.\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n // const activeOpts = this.getPlatformConfig(distType).config\n appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<SigningResult> {\n const targetPlatform: PlatformType = platformType ?? (packContext.electronPlatformName === \"mas\" ? \"mas\" : \"mac\")\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<Array<SigningResult>> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n return await Promise.all(\n directories\n .filter(file => shouldSign(file))\n .map(async (file: string) => {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n return await this.sign(safeSignTarget, packContext.arch, targetPlatform)\n })\n )\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n // the combined result gates the `afterSign` hook — a signed result wins (see PlatformPackager.doSignAfterPack)\n const results = await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return combineSignResults(results)\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n results.push(...(await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))))\n\n return combineSignResults(results)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node-module-collector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE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BAA+B,CAAA;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAI/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAElF,OAAO,EAAE,wBAAwB,EAAE,EAAE,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,CAAA;AAElL,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gHAe3F;AAED,eAAO,MAAM,0BAA0B,GAAI,uCAAuC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE;;;EAkCrJ,CAAA"}
@@ -33,6 +33,16 @@ export const determinePackageManagerEnv = ({ projectDir, appDir, workspaceRoot }
33
33
  if (root != null) {
34
34
  // re-detect package manager from workspace root, this seems particularly necessary for pnpm workspaces
35
35
  const actualPm = await detectPackageManager([root]);
36
+ if (actualPm.resolvedDirectory == null) {
37
+ // The root was located from the workspace config (e.g. `pnpm-workspace.yaml`) but carries neither a lockfile nor a
38
+ // `packageManager` field, so detection fell through to the process environment and resolved no directory. Dropping the
39
+ // root here silently confines `@electron/rebuild` to the app dir (#10187), so keep the located directory instead.
40
+ log.warn({ root: log.filePath(root), pm: pm.pm, projectDir: log.filePath(projectDir) }, "workspace root located, but no lockfile or `packageManager` field was found there to re-detect the package manager; using it as-is");
41
+ return {
42
+ pm: pm.pm,
43
+ workspaceRoot: Promise.resolve(root),
44
+ };
45
+ }
36
46
  log.info({ pm: actualPm.pm, config: actualPm.corepackConfig, resolved: actualPm.resolvedDirectory, projectDir }, `detected workspace root for project using ${actualPm.detectionMethod}`);
37
47
  return {
38
48
  pm: actualPm.pm,
@@ -44,12 +54,23 @@ export const determinePackageManagerEnv = ({ projectDir, appDir, workspaceRoot }
44
54
  workspaceRoot: Promise.resolve(pm.resolvedDirectory),
45
55
  };
46
56
  });
47
- async function findWorkspaceRoot(pm, cwd) {
57
+ /** @internal exported for tests */
58
+ export async function findWorkspaceRoot(pm, cwd) {
59
+ if (pm === PM.PNPM) {
60
+ // pnpm itself locates the workspace root with a plain upward search for `pnpm-workspace.yaml` (@pnpm/find-workspace-dir), so
61
+ // mirror that on disk instead of shelling out to `pnpm --workspace-root exec pwd`. `pwd` is a POSIX command: on Windows it is
62
+ // either missing (so detection fell back to a `package.json#workspaces` walk, which pnpm workspaces do not use) or resolves to
63
+ // the Git-for-Windows binary, whose MSYS-style `/d/a/repo` output is not a usable path. Either way the root was lost and
64
+ // `@electron/rebuild` never reached native modules stored under the root `node_modules/.pnpm` (#10187).
65
+ const root = await findNearestDir(cwd, dir => exists(path.join(dir, "pnpm-workspace.yaml")));
66
+ if (root != null) {
67
+ log.debug({ path: root }, "identified pnpm workspace root");
68
+ return root;
69
+ }
70
+ return findNearestPackageJsonWithWorkspacesField(cwd);
71
+ }
48
72
  let command;
49
73
  switch (pm) {
50
- case PM.PNPM:
51
- command = { command: "pnpm", args: ["--workspace-root", "exec", "pwd"] };
52
- break;
53
74
  case PM.YARN_BERRY:
54
75
  command = { command: "yarn", args: ["workspaces", "list", "--json"] };
55
76
  break;
@@ -96,29 +117,39 @@ async function findWorkspaceRoot(pm, cwd) {
96
117
  }
97
118
  return out.length === 0 || out === "undefined" ? undefined : out;
98
119
  })
99
- .catch(() => findNearestPackageJsonWithWorkspacesField(cwd));
120
+ .catch((error) => {
121
+ log.debug({ command: `${command.command} ${command.args.join(" ")}`, error: error?.message ?? error }, "workspace root command failed, falling back to package.json walk");
122
+ return findNearestPackageJsonWithWorkspacesField(cwd);
123
+ });
100
124
  return output;
101
125
  }
102
126
  async function findNearestPackageJsonWithWorkspacesField(dir) {
103
- let current = dir;
104
- while (true) {
105
- const pkgPath = path.join(current, "package.json");
127
+ const root = await findNearestDir(dir, async (current) => {
106
128
  try {
107
- const pkg = JSON.parse(await fs.readFile(pkgPath, "utf8"));
108
- if (pkg.workspaces) {
109
- log.debug({ path: current }, "identified workspace root");
110
- return current;
111
- }
129
+ const pkg = JSON.parse(await fs.readFile(path.join(current, "package.json"), "utf8"));
130
+ return !!pkg.workspaces;
112
131
  }
113
132
  catch {
114
- // ignore
133
+ return false;
134
+ }
135
+ });
136
+ if (root != null) {
137
+ log.debug({ path: root }, "identified workspace root");
138
+ }
139
+ return root;
140
+ }
141
+ /** Walks from `dir` up to the filesystem root and returns the first directory for which `isRoot` holds. */
142
+ async function findNearestDir(dir, isRoot) {
143
+ let current = dir;
144
+ while (true) {
145
+ if (await isRoot(current)) {
146
+ return current;
115
147
  }
116
148
  const parent = path.dirname(current);
117
149
  if (parent === current) {
118
- break;
150
+ return undefined;
119
151
  }
120
152
  current = parent;
121
153
  }
122
- return undefined;
123
154
  }
124
155
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-module-collector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE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,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;YAC1D,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;gBACnB,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,2BAA2B,CAAC,CAAA;gBACzD,OAAO,OAAO,CAAA;YAChB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACpC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,MAAK;QACP,CAAC;QACD,OAAO,GAAG,MAAM,CAAA;IAClB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC","sourcesContent":["import { Nullish } from \"builder-util-runtime\"\nimport { TmpDir } from \"temp-file\"\nimport { NpmNodeModulesCollector } from \"./npmNodeModulesCollector.js\"\nimport { detectPackageManager, getPackageManagerCommand, PM } from \"./packageManager.js\"\nimport { PnpmNodeModulesCollector } from \"./pnpmNodeModulesCollector.js\"\nimport { YarnBerryNodeModulesCollector } from \"./yarnBerryNodeModulesCollector.js\"\nimport { YarnNodeModulesCollector } from \"./yarnNodeModulesCollector.js\"\nimport { BunNodeModulesCollector } from \"./bunNodeModulesCollector.js\"\nimport { Lazy } from \"lazy-val\"\nimport { spawn, log, exists, isEmptyOrSpaces } from \"builder-util\"\nimport fs from \"fs-extra\"\nimport * as path from \"path\"\nimport { TraversalNodeModulesCollector } from \"./traversalNodeModulesCollector.js\"\n\nexport { getPackageManagerCommand, PM, PnpmNodeModulesCollector, YarnNodeModulesCollector, YarnBerryNodeModulesCollector, BunNodeModulesCollector, TraversalNodeModulesCollector }\n\nexport function getCollectorByPackageManager(pm: PM, rootDir: string, tempDirManager: TmpDir) {\n switch (pm) {\n case PM.PNPM:\n return new PnpmNodeModulesCollector(rootDir, tempDirManager)\n case PM.YARN:\n return new YarnNodeModulesCollector(rootDir, tempDirManager)\n case PM.YARN_BERRY:\n return new YarnBerryNodeModulesCollector(rootDir, tempDirManager)\n case PM.BUN:\n return new BunNodeModulesCollector(rootDir, tempDirManager)\n case PM.NPM:\n return new NpmNodeModulesCollector(rootDir, tempDirManager)\n case PM.TRAVERSAL:\n return new TraversalNodeModulesCollector(rootDir, tempDirManager)\n }\n}\n\nexport const determinePackageManagerEnv = ({ projectDir, appDir, workspaceRoot }: { projectDir: string; appDir: string; workspaceRoot: string | Nullish }) =>\n new Lazy(async () => {\n const availableDirs = [workspaceRoot, projectDir, appDir].filter((it): it is string => !isEmptyOrSpaces(it))\n const pm = await detectPackageManager(availableDirs)\n const root = await findWorkspaceRoot(pm.pm, projectDir)\n if (root != null) {\n // re-detect package manager from workspace root, this seems particularly necessary for pnpm workspaces\n const actualPm = await detectPackageManager([root])\n log.info(\n { pm: actualPm.pm, config: actualPm.corepackConfig, resolved: actualPm.resolvedDirectory, projectDir },\n `detected workspace root for project using ${actualPm.detectionMethod}`\n )\n return {\n pm: actualPm.pm,\n workspaceRoot: Promise.resolve(actualPm.resolvedDirectory),\n }\n }\n return {\n pm: pm.pm,\n workspaceRoot: Promise.resolve(pm.resolvedDirectory),\n }\n })\n\nasync function findWorkspaceRoot(pm: PM, cwd: string): Promise<string | undefined> {\n let command: { command: string; args: string[] }\n\n switch (pm) {\n case PM.PNPM:\n command = { command: \"pnpm\", args: [\"--workspace-root\", \"exec\", \"pwd\"] }\n break\n case PM.YARN_BERRY:\n command = { command: \"yarn\", args: [\"workspaces\", \"list\", \"--json\"] }\n break\n case PM.YARN: {\n command = { command: \"yarn\", args: [\"workspaces\", \"info\", \"--silent\"] }\n break\n }\n case PM.BUN:\n command = { command: \"bun\", args: [\"pm\", \"ls\", \"--json\"] }\n break\n case PM.NPM:\n default:\n command = { command: \"npm\", args: [\"prefix\", \"-w\"] }\n break\n }\n\n const output = await spawn(command.command, command.args, { cwd, stdio: [\"ignore\", \"pipe\", \"ignore\"] })\n .then(async it => {\n const out: string | undefined = it?.trim()\n if (!out) {\n return undefined\n }\n if (pm === PM.YARN) {\n JSON.parse(out) // if JSON valid, workspace detected\n return findNearestPackageJsonWithWorkspacesField(cwd)\n } else if (pm === PM.BUN) {\n const json = JSON.parse(out)\n if (Array.isArray(json) && json.length > 0) {\n return findNearestPackageJsonWithWorkspacesField(cwd)\n }\n } else if (pm === PM.YARN_BERRY) {\n const lines = out\n .split(\"\\n\")\n .map(l => l.trim())\n .filter(Boolean)\n for (const line of lines) {\n const parsed = JSON.parse(line)\n if (parsed.location != null) {\n const potential = path.resolve(cwd, parsed.location)\n return (await exists(potential)) ? findNearestPackageJsonWithWorkspacesField(potential) : undefined\n }\n }\n }\n return out.length === 0 || out === \"undefined\" ? undefined : out\n })\n .catch(() => findNearestPackageJsonWithWorkspacesField(cwd))\n return output\n}\n\nasync function findNearestPackageJsonWithWorkspacesField(dir: string): Promise<string | undefined> {\n let current = dir\n while (true) {\n const pkgPath = path.join(current, \"package.json\")\n try {\n const pkg = JSON.parse(await fs.readFile(pkgPath, \"utf8\"))\n if (pkg.workspaces) {\n log.debug({ path: current }, \"identified workspace root\")\n return current\n }\n } catch {\n // ignore\n }\n const parent = path.dirname(current)\n if (parent === current) {\n break\n }\n current = parent\n }\n return undefined\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-module-collector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE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,GAAG,CAAC,UAAU,CAAA;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC,CAAC,CAAA;IACF,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,2BAA2B,CAAC,CAAA;IACxD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,2GAA2G;AAC3G,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,MAAyC;IAClF,IAAI,OAAO,GAAG,GAAG,CAAA;IACjB,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACpC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,OAAO,GAAG,MAAM,CAAA;IAClB,CAAC;AACH,CAAC","sourcesContent":["import { Nullish } from \"builder-util-runtime\"\nimport { TmpDir } from \"temp-file\"\nimport { NpmNodeModulesCollector } from \"./npmNodeModulesCollector.js\"\nimport { detectPackageManager, getPackageManagerCommand, PM } from \"./packageManager.js\"\nimport { PnpmNodeModulesCollector } from \"./pnpmNodeModulesCollector.js\"\nimport { YarnBerryNodeModulesCollector } from \"./yarnBerryNodeModulesCollector.js\"\nimport { YarnNodeModulesCollector } from \"./yarnNodeModulesCollector.js\"\nimport { BunNodeModulesCollector } from \"./bunNodeModulesCollector.js\"\nimport { Lazy } from \"lazy-val\"\nimport { spawn, log, exists, isEmptyOrSpaces } from \"builder-util\"\nimport fs from \"fs-extra\"\nimport * as path from \"path\"\nimport { TraversalNodeModulesCollector } from \"./traversalNodeModulesCollector.js\"\n\nexport { getPackageManagerCommand, PM, PnpmNodeModulesCollector, YarnNodeModulesCollector, YarnBerryNodeModulesCollector, BunNodeModulesCollector, TraversalNodeModulesCollector }\n\nexport function getCollectorByPackageManager(pm: PM, rootDir: string, tempDirManager: TmpDir) {\n switch (pm) {\n case PM.PNPM:\n return new PnpmNodeModulesCollector(rootDir, tempDirManager)\n case PM.YARN:\n return new YarnNodeModulesCollector(rootDir, tempDirManager)\n case PM.YARN_BERRY:\n return new YarnBerryNodeModulesCollector(rootDir, tempDirManager)\n case PM.BUN:\n return new BunNodeModulesCollector(rootDir, tempDirManager)\n case PM.NPM:\n return new NpmNodeModulesCollector(rootDir, tempDirManager)\n case PM.TRAVERSAL:\n return new TraversalNodeModulesCollector(rootDir, tempDirManager)\n }\n}\n\nexport const determinePackageManagerEnv = ({ projectDir, appDir, workspaceRoot }: { projectDir: string; appDir: string; workspaceRoot: string | Nullish }) =>\n new Lazy(async () => {\n const availableDirs = [workspaceRoot, projectDir, appDir].filter((it): it is string => !isEmptyOrSpaces(it))\n const pm = await detectPackageManager(availableDirs)\n const root = await findWorkspaceRoot(pm.pm, projectDir)\n if (root != null) {\n // re-detect package manager from workspace root, this seems particularly necessary for pnpm workspaces\n const actualPm = await detectPackageManager([root])\n if (actualPm.resolvedDirectory == null) {\n // The root was located from the workspace config (e.g. `pnpm-workspace.yaml`) but carries neither a lockfile nor a\n // `packageManager` field, so detection fell through to the process environment and resolved no directory. Dropping the\n // root here silently confines `@electron/rebuild` to the app dir (#10187), so keep the located directory instead.\n log.warn(\n { root: log.filePath(root), pm: pm.pm, projectDir: log.filePath(projectDir) },\n \"workspace root located, but no lockfile or `packageManager` field was found there to re-detect the package manager; using it as-is\"\n )\n return {\n pm: pm.pm,\n workspaceRoot: Promise.resolve(root),\n }\n }\n log.info(\n { pm: actualPm.pm, config: actualPm.corepackConfig, resolved: actualPm.resolvedDirectory, projectDir },\n `detected workspace root for project using ${actualPm.detectionMethod}`\n )\n return {\n pm: actualPm.pm,\n workspaceRoot: Promise.resolve(actualPm.resolvedDirectory),\n }\n }\n return {\n pm: pm.pm,\n workspaceRoot: Promise.resolve(pm.resolvedDirectory),\n }\n })\n\n/** @internal exported for tests */\nexport async function findWorkspaceRoot(pm: PM, cwd: string): Promise<string | undefined> {\n if (pm === PM.PNPM) {\n // pnpm itself locates the workspace root with a plain upward search for `pnpm-workspace.yaml` (@pnpm/find-workspace-dir), so\n // mirror that on disk instead of shelling out to `pnpm --workspace-root exec pwd`. `pwd` is a POSIX command: on Windows it is\n // either missing (so detection fell back to a `package.json#workspaces` walk, which pnpm workspaces do not use) or resolves to\n // the Git-for-Windows binary, whose MSYS-style `/d/a/repo` output is not a usable path. Either way the root was lost and\n // `@electron/rebuild` never reached native modules stored under the root `node_modules/.pnpm` (#10187).\n const root = await findNearestDir(cwd, dir => exists(path.join(dir, \"pnpm-workspace.yaml\")))\n if (root != null) {\n log.debug({ path: root }, \"identified pnpm workspace root\")\n return root\n }\n return findNearestPackageJsonWithWorkspacesField(cwd)\n }\n\n let command: { command: string; args: string[] }\n\n switch (pm) {\n case PM.YARN_BERRY:\n command = { command: \"yarn\", args: [\"workspaces\", \"list\", \"--json\"] }\n break\n case PM.YARN: {\n command = { command: \"yarn\", args: [\"workspaces\", \"info\", \"--silent\"] }\n break\n }\n case PM.BUN:\n command = { command: \"bun\", args: [\"pm\", \"ls\", \"--json\"] }\n break\n case PM.NPM:\n default:\n command = { command: \"npm\", args: [\"prefix\", \"-w\"] }\n break\n }\n\n const output = await spawn(command.command, command.args, { cwd, stdio: [\"ignore\", \"pipe\", \"ignore\"] })\n .then(async it => {\n const out: string | undefined = it?.trim()\n if (!out) {\n return undefined\n }\n if (pm === PM.YARN) {\n JSON.parse(out) // if JSON valid, workspace detected\n return findNearestPackageJsonWithWorkspacesField(cwd)\n } else if (pm === PM.BUN) {\n const json = JSON.parse(out)\n if (Array.isArray(json) && json.length > 0) {\n return findNearestPackageJsonWithWorkspacesField(cwd)\n }\n } else if (pm === PM.YARN_BERRY) {\n const lines = out\n .split(\"\\n\")\n .map(l => l.trim())\n .filter(Boolean)\n for (const line of lines) {\n const parsed = JSON.parse(line)\n if (parsed.location != null) {\n const potential = path.resolve(cwd, parsed.location)\n return (await exists(potential)) ? findNearestPackageJsonWithWorkspacesField(potential) : undefined\n }\n }\n }\n return out.length === 0 || out === \"undefined\" ? undefined : out\n })\n .catch((error: any) => {\n log.debug({ command: `${command.command} ${command.args.join(\" \")}`, error: error?.message ?? error }, \"workspace root command failed, falling back to package.json walk\")\n return findNearestPackageJsonWithWorkspacesField(cwd)\n })\n return output\n}\n\nasync function findNearestPackageJsonWithWorkspacesField(dir: string): Promise<string | undefined> {\n const root = await findNearestDir(dir, async current => {\n try {\n const pkg = JSON.parse(await fs.readFile(path.join(current, \"package.json\"), \"utf8\"))\n return !!pkg.workspaces\n } catch {\n return false\n }\n })\n if (root != null) {\n log.debug({ path: root }, \"identified workspace root\")\n }\n return root\n}\n\n/** Walks from `dir` up to the filesystem root and returns the first directory for which `isRoot` holds. */\nasync function findNearestDir(dir: string, isRoot: (dir: string) => Promise<boolean>): Promise<string | undefined> {\n let current = dir\n while (true) {\n if (await isRoot(current)) {\n return current\n }\n const parent = path.dirname(current)\n if (parent === current) {\n return undefined\n }\n current = parent\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { LogLevel } from "builder-util";
2
2
  import { PackageJson } from "./types.js";
3
3
  import fs from "fs-extra";
4
+ export declare function readJsonOrNull<T = any>(file: string): Promise<T | null>;
4
5
  export declare enum LogMessageByKey {
5
6
  PKG_DUPLICATE_REF = "duplicate dependency references",
6
7
  PKG_DUPLICATE_REF_UNRESOLVED = "unresolved duplicate dependency references",
@@ -10,7 +11,9 @@ export declare enum LogMessageByKey {
10
11
  PKG_OPTIONAL_NOT_INSTALLED = "missing optional dependencies",
11
12
  PKG_OPTIONAL_PLATFORM_NOT_INSTALLED = "platform-specific optional dependencies not bundled \u2014 add them to your project's optionalDependencies if your app requires them (pnpm 10+ does not auto-install transitive platform binaries)",
12
13
  PKG_COLLECTOR_OUTPUT = "collector stderr output",
13
- PKG_VERSION_OVERRIDDEN = "dependencies resolved to a version outside the declared range (installed version accepted \u2014 likely resolved via package manager overrides)"
14
+ PKG_VERSION_OVERRIDDEN = "dependencies resolved to a version outside the declared range (installed version accepted \u2014 likely resolved via package manager overrides)",
15
+ PKG_INCOMPATIBLE_PLATFORM = "excluded platform-incompatible dependencies (package.json `cpu`/`os` does not match the target arch/platform)",
16
+ PKG_EXCLUDED_IGNORED = "excluded production dependencies from the app's node_modules (see ignoredProductionDependencies)"
14
17
  }
15
18
  export declare const logMessageLevelByKey: Record<LogMessageByKey, LogLevel>;
16
19
  export type Package = {
@@ -51,7 +54,7 @@ export declare class ModuleManager {
51
54
  semver?: string;
52
55
  }): string;
53
56
  protected locatePackageVersionFromCacheKey(key: string): Promise<Package | null>;
54
- locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch, }: {
57
+ locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch, skipOverrideFallback, }: {
55
58
  /**
56
59
  * The directory to start searching from. Typed optional because pnpm JSON output can omit
57
60
  * the `path` field at runtime even when the TypeScript type says `string`. An undefined
@@ -71,6 +74,12 @@ export declare class ModuleManager {
71
74
  * / `lstat` calls and finds nothing.
72
75
  */
73
76
  skipDownwardSearch?: boolean;
77
+ /**
78
+ * When true, return null instead of falling back to an out-of-range (override) version.
79
+ * Callers that search several locations use this to find a range-satisfying version in any
80
+ * location before settling for an override version from the first location searched.
81
+ */
82
+ skipOverrideFallback?: boolean;
74
83
  }): Promise<Package | null>;
75
84
  private searchForPackage;
76
85
  private semverSatisfies;
@@ -1 +1 @@
1
- {"version":3,"file":"moduleManager.d.ts","sourceRoot":"","sources":["../../src/node-module-collector/moduleManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,cAAc,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,MAAM,UAAU,CAAA;AAIzB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EAAE,OAAO,CAAA;QAC5B;;;;WAIG;QACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAC/B,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;YA6Bb,gBAAgB;IAqB9B,OAAO,CAAC,eAAe;IAmCvB;;OAEG;YACW,YAAY;IAwB1B;;;OAGG;YACW,cAAc;IA+C5B,wEAAwE;YAC1D,YAAY;IAmC1B,+EAA+E;YACjE,YAAY;IA+B1B,kGAAkG;YACpF,eAAe;CAM9B"}
@@ -2,6 +2,12 @@ import { exists, isEmptyOrSpaces, log } from "builder-util";
2
2
  import fs from "fs-extra";
3
3
  import * as path from "path";
4
4
  import * as semver from "semver";
5
+ // Tolerant package.json read for the node-module collectors: swallows ALL errors (not just ENOENT) to
6
+ // null, since the collectors intentionally skip unreadable entries (e.g. cross-drive Windows junctions
7
+ // whose failures are not ENOENT). Distinct from builder-util's orNullIfFileNotExist, which rethrows non-ENOENT.
8
+ export function readJsonOrNull(file) {
9
+ return fs.readJson(file).catch(() => null);
10
+ }
5
11
  export var LogMessageByKey;
6
12
  (function (LogMessageByKey) {
7
13
  LogMessageByKey["PKG_DUPLICATE_REF"] = "duplicate dependency references";
@@ -13,6 +19,8 @@ export var LogMessageByKey;
13
19
  LogMessageByKey["PKG_OPTIONAL_PLATFORM_NOT_INSTALLED"] = "platform-specific optional dependencies not bundled \u2014 add them to your project's optionalDependencies if your app requires them (pnpm 10+ does not auto-install transitive platform binaries)";
14
20
  LogMessageByKey["PKG_COLLECTOR_OUTPUT"] = "collector stderr output";
15
21
  LogMessageByKey["PKG_VERSION_OVERRIDDEN"] = "dependencies resolved to a version outside the declared range (installed version accepted \u2014 likely resolved via package manager overrides)";
22
+ LogMessageByKey["PKG_INCOMPATIBLE_PLATFORM"] = "excluded platform-incompatible dependencies (package.json `cpu`/`os` does not match the target arch/platform)";
23
+ LogMessageByKey["PKG_EXCLUDED_IGNORED"] = "excluded production dependencies from the app's node_modules (see ignoredProductionDependencies)";
16
24
  })(LogMessageByKey || (LogMessageByKey = {}));
17
25
  export const logMessageLevelByKey = {
18
26
  [LogMessageByKey.PKG_DUPLICATE_REF]: "info",
@@ -24,6 +32,8 @@ export const logMessageLevelByKey = {
24
32
  [LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED]: "warn",
25
33
  [LogMessageByKey.PKG_COLLECTOR_OUTPUT]: "warn",
26
34
  [LogMessageByKey.PKG_VERSION_OVERRIDDEN]: "debug",
35
+ [LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM]: "info",
36
+ [LogMessageByKey.PKG_EXCLUDED_IGNORED]: "info",
27
37
  };
28
38
  export class ModuleManager {
29
39
  constructor() {
@@ -35,13 +45,16 @@ export class ModuleManager {
35
45
  this.logSummaryMap = new Map();
36
46
  this.logSummary = this.createLogSummarySyncProxy();
37
47
  this.exists = this.createAsyncProxy(this.existsMap, (p) => exists(p));
38
- this.json = this.createAsyncProxy(this.jsonMap, (p) => fs.readJson(p).catch(() => null));
48
+ this.json = this.createAsyncProxy(this.jsonMap, (p) => readJsonOrNull(p));
39
49
  this.lstat = this.createAsyncProxy(this.lstatMap, (p) => fs.lstat(p).catch(() => null));
40
50
  this.packageData = this.createAsyncProxy(this.packageDataMap, (p) => this.locatePackageVersionFromCacheKey(p).catch(() => null));
41
51
  this.realPath = this.createAsyncProxy(this.realPathMap, async (p) => {
42
52
  const filePath = path.resolve(p);
43
53
  const stat = await this.lstat[filePath];
44
- return stat?.isSymbolicLink() ? fs.realpath(filePath) : filePath;
54
+ // A dangling link, or a Windows junction pointing at another drive, makes `realpath` throw.
55
+ // Degrading to the path we were given keeps collection going with the next-best answer
56
+ // instead of failing the whole build.
57
+ return stat?.isSymbolicLink() ? fs.realpath(filePath).catch(() => filePath) : filePath;
45
58
  });
46
59
  }
47
60
  createLogSummarySyncProxy() {
@@ -77,18 +90,24 @@ export class ModuleManager {
77
90
  // this allows dot-notation access while still supporting async retrieval
78
91
  // e.g., cache.packageJson[somePath] returns Promise<PackageJson>
79
92
  createAsyncProxy(map, compute) {
80
- return new Proxy({}, {
81
- async get(_, key) {
82
- if (map.has(key)) {
83
- return Promise.resolve(map.get(key));
93
+ const target = {};
94
+ return new Proxy(target, {
95
+ get(_, key) {
96
+ const cached = map.get(key);
97
+ if (cached != null) {
98
+ return cached;
84
99
  }
85
- return await Promise.resolve(compute(key)).then(value => {
86
- map.set(key, value);
87
- return value;
100
+ const pending = Promise.resolve()
101
+ .then(() => compute(key))
102
+ .catch(error => {
103
+ map.delete(key);
104
+ throw error;
88
105
  });
106
+ map.set(key, pending);
107
+ return pending;
89
108
  },
90
109
  set(_, key, value) {
91
- map.set(key, value);
110
+ map.set(key, Promise.resolve(value));
92
111
  return true;
93
112
  },
94
113
  has(_, key) {
@@ -107,7 +126,7 @@ export class ModuleManager {
107
126
  }
108
127
  return { ...result, packageDir: await this.realPath[result.packageDir] };
109
128
  }
110
- async locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch = false, }) {
129
+ async locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch = false, skipOverrideFallback = false, }) {
111
130
  if (!parentDir || !pkgName) {
112
131
  return null;
113
132
  }
@@ -119,7 +138,7 @@ export class ModuleManager {
119
138
  // returns nothing. This handles package manager `overrides` (Bun, npm, pnpm, Yarn) that
120
139
  // resolve a transitive dependency to a version intentionally outside its declared range.
121
140
  // File-system results are already cached, so this pass costs only JS overhead.
122
- if (requiredRange) {
141
+ if (requiredRange && !skipOverrideFallback) {
123
142
  const overrideResult = await this.searchForPackage(parentDir, pkgName, undefined, skipDownwardSearch);
124
143
  if (overrideResult) {
125
144
  log.debug({ pkg: pkgName, declared: requiredRange, installed: overrideResult.packageJson.version }, "accepting installed package version that doesn't satisfy the declared range");
@@ -218,8 +237,9 @@ export class ModuleManager {
218
237
  const visited = new Set();
219
238
  const queue = [{ dir: start, depth: 0 }];
220
239
  let explored = 0;
221
- while (queue.length > 0) {
222
- const { dir, depth } = queue.shift();
240
+ let queueIndex = 0;
241
+ while (queueIndex < queue.length) {
242
+ const { dir, depth } = queue[queueIndex++];
223
243
  if (explored++ > maxExplored) {
224
244
  break;
225
245
  }