app-builder-lib 27.0.0-alpha.1 → 27.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) 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.map +1 -1
  9. package/dist/asar/asarAlign.d.ts +35 -0
  10. package/dist/asar/asarAlign.d.ts.map +1 -0
  11. package/dist/asar/asarAlign.js +149 -0
  12. package/dist/asar/asarAlign.js.map +1 -0
  13. package/dist/asar/asarFileChecker.d.ts +4 -2
  14. package/dist/asar/asarFileChecker.d.ts.map +1 -1
  15. package/dist/asar/asarFileChecker.js +2 -3
  16. package/dist/asar/asarFileChecker.js.map +1 -1
  17. package/dist/asar/asarUtil.d.ts +15 -1
  18. package/dist/asar/asarUtil.d.ts.map +1 -1
  19. package/dist/asar/asarUtil.js +132 -72
  20. package/dist/asar/asarUtil.js.map +1 -1
  21. package/dist/codeSign/certInfo.d.ts +14 -0
  22. package/dist/codeSign/certInfo.d.ts.map +1 -1
  23. package/dist/codeSign/certInfo.js +49 -0
  24. package/dist/codeSign/certInfo.js.map +1 -1
  25. package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
  26. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  27. package/dist/codeSign/mac/macCodeSign.js +50 -25
  28. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  29. package/dist/codeSign/signResult.d.ts +26 -0
  30. package/dist/codeSign/signResult.d.ts.map +1 -0
  31. package/dist/codeSign/signResult.js +12 -0
  32. package/dist/codeSign/signResult.js.map +1 -0
  33. package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
  34. package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
  35. package/dist/codeSign/win/hsmSignManager.js +50 -0
  36. package/dist/codeSign/win/hsmSignManager.js.map +1 -0
  37. package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
  38. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
  39. package/dist/codeSign/win/pkcs11SignManager.js +82 -0
  40. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
  41. package/dist/codeSign/win/signManager.d.ts +17 -0
  42. package/dist/codeSign/win/signManager.d.ts.map +1 -0
  43. package/dist/codeSign/win/signManager.js +19 -0
  44. package/dist/codeSign/win/signManager.js.map +1 -0
  45. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +95 -0
  46. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
  47. package/dist/codeSign/win/signtoolBaseSignManager.js +507 -0
  48. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
  49. package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
  50. package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
  51. package/dist/codeSign/win/windowsCodeSign.js +22 -8
  52. package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
  53. package/dist/codeSign/win/windowsSignAzureManager.d.ts +11 -4
  54. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  55. package/dist/codeSign/win/windowsSignAzureManager.js +142 -37
  56. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  57. package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
  58. package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
  59. package/dist/codeSign/win/windowsSignToolManager.js +3 -363
  60. package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
  61. package/dist/configuration.d.ts +233 -166
  62. package/dist/configuration.d.ts.map +1 -1
  63. package/dist/configuration.js +11 -1
  64. package/dist/configuration.js.map +1 -1
  65. package/dist/core.d.ts +14 -0
  66. package/dist/core.d.ts.map +1 -1
  67. package/dist/core.js +11 -0
  68. package/dist/core.js.map +1 -1
  69. package/dist/electron/ElectronFramework.d.ts +3 -3
  70. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  71. package/dist/electron/ElectronFramework.js +60 -61
  72. package/dist/electron/ElectronFramework.js.map +1 -1
  73. package/dist/electron/electronArchSupport.d.ts +12 -0
  74. package/dist/electron/electronArchSupport.d.ts.map +1 -0
  75. package/dist/electron/electronArchSupport.js +58 -0
  76. package/dist/electron/electronArchSupport.js.map +1 -0
  77. package/dist/electron/electronVersion.d.ts.map +1 -1
  78. package/dist/electron/electronVersion.js +1 -11
  79. package/dist/electron/electronVersion.js.map +1 -1
  80. package/dist/electron/injectFFMPEG.js +2 -2
  81. package/dist/electron/injectFFMPEG.js.map +1 -1
  82. package/dist/electron/mac/electronMac.js +24 -35
  83. package/dist/electron/mac/electronMac.js.map +1 -1
  84. package/dist/electron/mac/electronMacUtils.d.ts +24 -0
  85. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
  86. package/dist/electron/mac/electronMacUtils.js +42 -0
  87. package/dist/electron/mac/electronMacUtils.js.map +1 -0
  88. package/dist/electron/win/electronWin.js +2 -2
  89. package/dist/electron/win/electronWin.js.map +1 -1
  90. package/dist/fileMatcher.d.ts +55 -3
  91. package/dist/fileMatcher.d.ts.map +1 -1
  92. package/dist/fileMatcher.js +274 -28
  93. package/dist/fileMatcher.js.map +1 -1
  94. package/dist/index.d.ts +13 -7
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +17 -1
  97. package/dist/index.js.map +1 -1
  98. package/dist/indexInternal.d.ts +20 -8
  99. package/dist/indexInternal.d.ts.map +1 -1
  100. package/dist/indexInternal.js +19 -7
  101. package/dist/indexInternal.js.map +1 -1
  102. package/dist/linuxPackager.d.ts.map +1 -1
  103. package/dist/linuxPackager.js +19 -1
  104. package/dist/linuxPackager.js.map +1 -1
  105. package/dist/macPackager.d.ts +31 -14
  106. package/dist/macPackager.d.ts.map +1 -1
  107. package/dist/macPackager.js +236 -147
  108. package/dist/macPackager.js.map +1 -1
  109. package/dist/node-module-collector/index.d.ts.map +1 -1
  110. package/dist/node-module-collector/index.js +47 -16
  111. package/dist/node-module-collector/index.js.map +1 -1
  112. package/dist/node-module-collector/moduleManager.d.ts +11 -2
  113. package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
  114. package/dist/node-module-collector/moduleManager.js +34 -14
  115. package/dist/node-module-collector/moduleManager.js.map +1 -1
  116. package/dist/node-module-collector/nodeModulesCollector.d.ts +47 -26
  117. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  118. package/dist/node-module-collector/nodeModulesCollector.js +157 -142
  119. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  120. package/dist/node-module-collector/packageManager.js +1 -1
  121. package/dist/node-module-collector/packageManager.js.map +1 -1
  122. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +90 -1
  123. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  124. package/dist/node-module-collector/pnpmNodeModulesCollector.js +325 -25
  125. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  126. package/dist/node-module-collector/types.d.ts +4 -0
  127. package/dist/node-module-collector/types.d.ts.map +1 -1
  128. package/dist/node-module-collector/types.js.map +1 -1
  129. package/dist/options/FuseOptionsV1.d.ts +137 -0
  130. package/dist/options/FuseOptionsV1.d.ts.map +1 -0
  131. package/dist/options/FuseOptionsV1.js +2 -0
  132. package/dist/options/FuseOptionsV1.js.map +1 -0
  133. package/dist/options/MsixOptions.d.ts +126 -0
  134. package/dist/options/MsixOptions.d.ts.map +1 -0
  135. package/dist/options/MsixOptions.js +2 -0
  136. package/dist/options/MsixOptions.js.map +1 -0
  137. package/dist/options/PlatformSpecificBuildOptions.d.ts +147 -12
  138. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  139. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  140. package/dist/options/SnapOptions.d.ts +59 -32
  141. package/dist/options/SnapOptions.d.ts.map +1 -1
  142. package/dist/options/SnapOptions.js.map +1 -1
  143. package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
  144. package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
  145. package/dist/options/SquirrelWindowsOptions.js.map +1 -1
  146. package/dist/options/linuxOptions.d.ts +61 -30
  147. package/dist/options/linuxOptions.d.ts.map +1 -1
  148. package/dist/options/linuxOptions.js.map +1 -1
  149. package/dist/options/macOptions.d.ts +113 -131
  150. package/dist/options/macOptions.d.ts.map +1 -1
  151. package/dist/options/macOptions.js.map +1 -1
  152. package/dist/options/pkgOptions.d.ts +1 -1
  153. package/dist/options/pkgOptions.js.map +1 -1
  154. package/dist/options/winOptions.d.ts +282 -70
  155. package/dist/options/winOptions.d.ts.map +1 -1
  156. package/dist/options/winOptions.js +12 -1
  157. package/dist/options/winOptions.js.map +1 -1
  158. package/dist/packager.d.ts +6 -1
  159. package/dist/packager.d.ts.map +1 -1
  160. package/dist/packager.js +123 -40
  161. package/dist/packager.js.map +1 -1
  162. package/dist/packagerApi.d.ts +10 -1
  163. package/dist/packagerApi.d.ts.map +1 -1
  164. package/dist/packagerApi.js.map +1 -1
  165. package/dist/platformPackager.d.ts +55 -4
  166. package/dist/platformPackager.d.ts.map +1 -1
  167. package/dist/platformPackager.js +160 -22
  168. package/dist/platformPackager.js.map +1 -1
  169. package/dist/presets/rectCra.js +3 -1
  170. package/dist/presets/rectCra.js.map +1 -1
  171. package/dist/publish/PublishManager.d.ts +40 -2
  172. package/dist/publish/PublishManager.d.ts.map +1 -1
  173. package/dist/publish/PublishManager.js +365 -23
  174. package/dist/publish/PublishManager.js.map +1 -1
  175. package/dist/publish/updateInfoBuilder.d.ts +1 -1
  176. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  177. package/dist/publish/updateInfoBuilder.js +108 -32
  178. package/dist/publish/updateInfoBuilder.js.map +1 -1
  179. package/dist/targets/ArchiveTarget.d.ts +1 -0
  180. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  181. package/dist/targets/ArchiveTarget.js +13 -4
  182. package/dist/targets/ArchiveTarget.js.map +1 -1
  183. package/dist/targets/archive.d.ts +39 -2
  184. package/dist/targets/archive.d.ts.map +1 -1
  185. package/dist/targets/archive.js +114 -30
  186. package/dist/targets/archive.js.map +1 -1
  187. package/dist/targets/blockmap/blockmap.d.ts +44 -3
  188. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  189. package/dist/targets/blockmap/blockmap.js +142 -15
  190. package/dist/targets/blockmap/blockmap.js.map +1 -1
  191. package/dist/targets/blockmap/verbatimRange.d.ts +44 -0
  192. package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -0
  193. package/dist/targets/blockmap/verbatimRange.js +117 -0
  194. package/dist/targets/blockmap/verbatimRange.js.map +1 -0
  195. package/dist/targets/differentialUpdateInfoBuilder.d.ts +28 -2
  196. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  197. package/dist/targets/differentialUpdateInfoBuilder.js +75 -6
  198. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  199. package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
  200. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  201. package/dist/targets/linux/FlatpakTarget.js +245 -45
  202. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  203. package/dist/targets/linux/FpmTarget.d.ts +14 -0
  204. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  205. package/dist/targets/linux/FpmTarget.js +92 -12
  206. package/dist/targets/linux/FpmTarget.js.map +1 -1
  207. package/dist/targets/linux/LinuxTargetHelper.d.ts +13 -0
  208. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  209. package/dist/targets/linux/LinuxTargetHelper.js +81 -61
  210. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  211. package/dist/targets/linux/appimage/AppImageTarget.d.ts +2 -0
  212. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  213. package/dist/targets/linux/appimage/AppImageTarget.js +20 -15
  214. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  215. package/dist/targets/linux/appimage/appImageUtil.d.ts +8 -2
  216. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  217. package/dist/targets/linux/appimage/appImageUtil.js +16 -9
  218. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  219. package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
  220. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  221. package/dist/targets/linux/appimage/appLauncher.js +18 -20
  222. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  223. package/dist/targets/linux/flatpakBundle.d.ts +43 -0
  224. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
  225. package/dist/targets/linux/flatpakBundle.js +210 -0
  226. package/dist/targets/linux/flatpakBundle.js.map +1 -0
  227. package/dist/targets/linux/launcherScript.d.ts +32 -0
  228. package/dist/targets/linux/launcherScript.d.ts.map +1 -0
  229. package/dist/targets/linux/launcherScript.js +24 -0
  230. package/dist/targets/linux/launcherScript.js.map +1 -0
  231. package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
  232. package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
  233. package/dist/targets/linux/snap/SnapTarget.js +23 -1
  234. package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
  235. package/dist/targets/linux/snap/core24.d.ts +13 -2
  236. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  237. package/dist/targets/linux/snap/core24.js +107 -95
  238. package/dist/targets/linux/snap/core24.js.map +1 -1
  239. package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
  240. package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
  241. package/dist/targets/linux/snap/coreCustom.js +2 -2
  242. package/dist/targets/linux/snap/coreCustom.js.map +1 -1
  243. package/dist/targets/linux/snap/coreLegacy.d.ts +10 -3
  244. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  245. package/dist/targets/linux/snap/coreLegacy.js +37 -18
  246. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  247. package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
  248. package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
  249. package/dist/targets/linux/snap/snapCommand.js +21 -0
  250. package/dist/targets/linux/snap/snapCommand.js.map +1 -0
  251. package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
  252. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
  253. package/dist/targets/linux/snap/snapPlugs.js +242 -0
  254. package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
  255. package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
  256. package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
  257. package/dist/targets/linux/snap/snapcraft.js +11 -0
  258. package/dist/targets/linux/snap/snapcraft.js.map +1 -0
  259. package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
  260. package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
  261. package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
  262. package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
  263. package/dist/targets/mac/MacTargetHelper.d.ts +146 -14
  264. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  265. package/dist/targets/mac/MacTargetHelper.js +485 -91
  266. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  267. package/dist/targets/mac/pkg.d.ts +16 -0
  268. package/dist/targets/mac/pkg.d.ts.map +1 -1
  269. package/dist/targets/mac/pkg.js +31 -5
  270. package/dist/targets/mac/pkg.js.map +1 -1
  271. package/dist/targets/targetFactory.d.ts +7 -0
  272. package/dist/targets/targetFactory.d.ts.map +1 -1
  273. package/dist/targets/targetFactory.js +28 -0
  274. package/dist/targets/targetFactory.js.map +1 -1
  275. package/dist/targets/win/AppxTarget.d.ts +1 -2
  276. package/dist/targets/win/AppxTarget.d.ts.map +1 -1
  277. package/dist/targets/win/AppxTarget.js +37 -314
  278. package/dist/targets/win/AppxTarget.js.map +1 -1
  279. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  280. package/dist/targets/win/MsiTarget.js +13 -13
  281. package/dist/targets/win/MsiTarget.js.map +1 -1
  282. package/dist/targets/win/MsixTarget.d.ts +22 -0
  283. package/dist/targets/win/MsixTarget.d.ts.map +1 -0
  284. package/dist/targets/win/MsixTarget.js +214 -0
  285. package/dist/targets/win/MsixTarget.js.map +1 -0
  286. package/dist/targets/win/nsis/Defines.d.ts +4 -0
  287. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  288. package/dist/targets/win/nsis/Defines.js.map +1 -1
  289. package/dist/targets/win/nsis/NsisTarget.d.ts +64 -3
  290. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  291. package/dist/targets/win/nsis/NsisTarget.js +277 -113
  292. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  293. package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
  294. package/dist/targets/win/nsis/WebInstallerTarget.js +23 -12
  295. package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
  296. package/dist/targets/win/nsis/nsisOptions.d.ts +58 -48
  297. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  298. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  299. package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
  300. package/dist/targets/win/nsis/nsisScriptGenerator.js +4 -3
  301. package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
  302. package/dist/targets/win/nsis/nsisUtil.d.ts +17 -2
  303. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  304. package/dist/targets/win/nsis/nsisUtil.js +148 -41
  305. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  306. package/dist/targets/win/nsis/progId.d.ts +21 -0
  307. package/dist/targets/win/nsis/progId.d.ts.map +1 -0
  308. package/dist/targets/win/nsis/progId.js +60 -0
  309. package/dist/targets/win/nsis/progId.js.map +1 -0
  310. package/dist/targets/win/winAppUtil.d.ts +115 -0
  311. package/dist/targets/win/winAppUtil.d.ts.map +1 -0
  312. package/dist/targets/win/winAppUtil.js +409 -0
  313. package/dist/targets/win/winAppUtil.js.map +1 -0
  314. package/dist/toolsets/7zip.d.ts +32 -0
  315. package/dist/toolsets/7zip.d.ts.map +1 -1
  316. package/dist/toolsets/7zip.js +39 -11
  317. package/dist/toolsets/7zip.js.map +1 -1
  318. package/dist/toolsets/appimage.d.ts +3 -3
  319. package/dist/toolsets/appimage.d.ts.map +1 -1
  320. package/dist/toolsets/appimage.js +24 -21
  321. package/dist/toolsets/appimage.js.map +1 -1
  322. package/dist/toolsets/custom.d.ts +2 -3
  323. package/dist/toolsets/custom.d.ts.map +1 -1
  324. package/dist/toolsets/custom.js +67 -149
  325. package/dist/toolsets/custom.js.map +1 -1
  326. package/dist/toolsets/fpm.d.ts.map +1 -1
  327. package/dist/toolsets/fpm.js +11 -5
  328. package/dist/toolsets/fpm.js.map +1 -1
  329. package/dist/toolsets/icons.d.ts.map +1 -1
  330. package/dist/toolsets/icons.js +17 -3
  331. package/dist/toolsets/icons.js.map +1 -1
  332. package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
  333. package/dist/toolsets/linuxToolsMac.js +17 -4
  334. package/dist/toolsets/linuxToolsMac.js.map +1 -1
  335. package/dist/toolsets/nsis.d.ts +5 -0
  336. package/dist/toolsets/nsis.d.ts.map +1 -1
  337. package/dist/toolsets/nsis.js +20 -4
  338. package/dist/toolsets/nsis.js.map +1 -1
  339. package/dist/toolsets/version.d.ts +12 -0
  340. package/dist/toolsets/version.d.ts.map +1 -0
  341. package/dist/toolsets/version.js +13 -0
  342. package/dist/toolsets/version.js.map +1 -0
  343. package/dist/toolsets/winCodeSign.d.ts +56 -3
  344. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  345. package/dist/toolsets/winCodeSign.js +125 -42
  346. package/dist/toolsets/winCodeSign.js.map +1 -1
  347. package/dist/toolsets/wine.d.ts +2 -1
  348. package/dist/toolsets/wine.d.ts.map +1 -1
  349. package/dist/toolsets/wine.js +31 -15
  350. package/dist/toolsets/wine.js.map +1 -1
  351. package/dist/util/AppFileWalker.js +9 -1
  352. package/dist/util/AppFileWalker.js.map +1 -1
  353. package/dist/util/NodeModuleCopyHelper.js +14 -6
  354. package/dist/util/NodeModuleCopyHelper.js.map +1 -1
  355. package/dist/util/appFileCopier.d.ts +67 -2
  356. package/dist/util/appFileCopier.d.ts.map +1 -1
  357. package/dist/util/appFileCopier.js +244 -32
  358. package/dist/util/appFileCopier.js.map +1 -1
  359. package/dist/util/archCompatibility.d.ts +42 -0
  360. package/dist/util/archCompatibility.d.ts.map +1 -0
  361. package/dist/util/archCompatibility.js +202 -0
  362. package/dist/util/archCompatibility.js.map +1 -0
  363. package/dist/util/checksum.d.ts +36 -0
  364. package/dist/util/checksum.d.ts.map +1 -0
  365. package/dist/util/checksum.js +48 -0
  366. package/dist/util/checksum.js.map +1 -0
  367. package/dist/util/config/config.d.ts +2 -1
  368. package/dist/util/config/config.d.ts.map +1 -1
  369. package/dist/util/config/config.js +42 -20
  370. package/dist/util/config/config.js.map +1 -1
  371. package/dist/util/config/fileOptions.d.ts +30 -0
  372. package/dist/util/config/fileOptions.d.ts.map +1 -0
  373. package/dist/util/config/fileOptions.js +120 -0
  374. package/dist/util/config/fileOptions.js.map +1 -0
  375. package/dist/util/config/legacyConfigGuard.d.ts +7 -0
  376. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
  377. package/dist/util/config/legacyConfigGuard.js +214 -0
  378. package/dist/util/config/legacyConfigGuard.js.map +1 -0
  379. package/dist/util/config/legacyOptions.d.ts +86 -0
  380. package/dist/util/config/legacyOptions.d.ts.map +1 -0
  381. package/dist/util/config/legacyOptions.js +413 -0
  382. package/dist/util/config/legacyOptions.js.map +1 -0
  383. package/dist/util/config/load.d.ts +2 -2
  384. package/dist/util/config/load.d.ts.map +1 -1
  385. package/dist/util/config/load.js +3 -12
  386. package/dist/util/config/load.js.map +1 -1
  387. package/dist/util/config/schemaValidator.d.ts.map +1 -1
  388. package/dist/util/config/schemaValidator.js +26 -3
  389. package/dist/util/config/schemaValidator.js.map +1 -1
  390. package/dist/util/electronGet.d.ts +43 -32
  391. package/dist/util/electronGet.d.ts.map +1 -1
  392. package/dist/util/electronGet.js +390 -137
  393. package/dist/util/electronGet.js.map +1 -1
  394. package/dist/util/flags.d.ts +5 -5
  395. package/dist/util/flags.d.ts.map +1 -1
  396. package/dist/util/flags.js +124 -16
  397. package/dist/util/flags.js.map +1 -1
  398. package/dist/util/hash.d.ts +1 -1
  399. package/dist/util/hash.d.ts.map +1 -1
  400. package/dist/util/hash.js +1 -15
  401. package/dist/util/hash.js.map +1 -1
  402. package/dist/util/installOrRebuild.d.ts +44 -0
  403. package/dist/util/installOrRebuild.d.ts.map +1 -0
  404. package/dist/util/installOrRebuild.js +276 -0
  405. package/dist/util/installOrRebuild.js.map +1 -0
  406. package/dist/util/langs.d.ts.map +1 -1
  407. package/dist/util/langs.js +1 -0
  408. package/dist/util/langs.js.map +1 -1
  409. package/dist/util/license.d.ts.map +1 -1
  410. package/dist/util/license.js +4 -1
  411. package/dist/util/license.js.map +1 -1
  412. package/dist/util/mac/macosIconComposer.d.ts +2 -1
  413. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  414. package/dist/util/mac/macosIconComposer.js +40 -58
  415. package/dist/util/mac/macosIconComposer.js.map +1 -1
  416. package/dist/util/mac/macosVersion.d.ts +0 -1
  417. package/dist/util/mac/macosVersion.d.ts.map +1 -1
  418. package/dist/util/mac/macosVersion.js +0 -3
  419. package/dist/util/mac/macosVersion.js.map +1 -1
  420. package/dist/util/mac/plist.d.ts +1 -1
  421. package/dist/util/mac/plist.d.ts.map +1 -1
  422. package/dist/util/mac/plist.js +5 -0
  423. package/dist/util/mac/plist.js.map +1 -1
  424. package/dist/util/nativeBinaryVerifier.d.ts +40 -0
  425. package/dist/util/nativeBinaryVerifier.d.ts.map +1 -0
  426. package/dist/util/nativeBinaryVerifier.js +381 -0
  427. package/dist/util/nativeBinaryVerifier.js.map +1 -0
  428. package/dist/util/packageMetadata.js +57 -31
  429. package/dist/util/packageMetadata.js.map +1 -1
  430. package/dist/util/removedEnvVars.d.ts +25 -0
  431. package/dist/util/removedEnvVars.d.ts.map +1 -0
  432. package/dist/util/removedEnvVars.js +54 -0
  433. package/dist/util/removedEnvVars.js.map +1 -0
  434. package/dist/util/repositoryInfo.js +6 -3
  435. package/dist/util/repositoryInfo.js.map +1 -1
  436. package/dist/util/resolve.js +1 -1
  437. package/dist/util/resolve.js.map +1 -1
  438. package/dist/util/streamSpawnToFile.d.ts +47 -0
  439. package/dist/util/streamSpawnToFile.d.ts.map +1 -0
  440. package/dist/util/streamSpawnToFile.js +110 -0
  441. package/dist/util/streamSpawnToFile.js.map +1 -0
  442. package/dist/util/toolsetLock.d.ts +2 -0
  443. package/dist/util/toolsetLock.d.ts.map +1 -1
  444. package/dist/util/toolsetLock.js +31 -5
  445. package/dist/util/toolsetLock.js.map +1 -1
  446. package/dist/util/trustedSourceRoots.d.ts +59 -0
  447. package/dist/util/trustedSourceRoots.d.ts.map +1 -0
  448. package/dist/util/trustedSourceRoots.js +127 -0
  449. package/dist/util/trustedSourceRoots.js.map +1 -0
  450. package/dist/version.d.ts +1 -1
  451. package/dist/version.d.ts.map +1 -1
  452. package/dist/version.js +1 -1
  453. package/dist/version.js.map +1 -1
  454. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  455. package/dist/vm/ParallelsVm.js +29 -3
  456. package/dist/vm/ParallelsVm.js.map +1 -1
  457. package/dist/vm/vm.d.ts +2 -0
  458. package/dist/vm/vm.d.ts.map +1 -1
  459. package/dist/vm/vm.js +29 -6
  460. package/dist/vm/vm.js.map +1 -1
  461. package/dist/winPackager.d.ts +6 -5
  462. package/dist/winPackager.d.ts.map +1 -1
  463. package/dist/winPackager.js +45 -39
  464. package/dist/winPackager.js.map +1 -1
  465. package/package.json +20 -20
  466. package/scheme.json +2112 -1495
  467. package/templates/appx/appxmanifest.xml +2 -3
  468. package/templates/entitlements.mac.adhoc.plist +15 -0
  469. package/templates/entitlements.mac.plist +9 -6
  470. package/templates/msix/appxmanifest.xml +45 -0
  471. package/templates/nsis/assistedMessages.yml +17 -0
  472. package/templates/nsis/common.nsh +2 -2
  473. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +96 -13
  474. package/templates/nsis/include/extractAppPackage.nsh +5 -2
  475. package/templates/nsis/include/installUtil.nsh +2 -2
  476. package/templates/nsis/include/installer.nsh +94 -53
  477. package/templates/nsis/include/webPackage.nsh +52 -27
  478. package/templates/nsis/installSection.nsh +29 -0
  479. package/templates/nsis/installer.nsi +1 -1
  480. package/templates/nsis/messages.yml +5 -0
  481. package/templates/nsis/multiUserUi.nsh +1 -1
  482. package/dist/codeSign/signManager.d.ts +0 -14
  483. package/dist/codeSign/signManager.d.ts.map +0 -1
  484. package/dist/codeSign/signManager.js +0 -2
  485. package/dist/codeSign/signManager.js.map +0 -1
  486. package/dist/util/yarn.d.ts +0 -23
  487. package/dist/util/yarn.d.ts.map +0 -1
  488. package/dist/util/yarn.js +0 -153
  489. package/dist/util/yarn.js.map +0 -1
@@ -0,0 +1,42 @@
1
+ import { InvalidConfigurationError } from "builder-util";
2
+ import { sanitizeFileName } from "builder-util/internal";
3
+ /**
4
+ * At runtime Electron locates its helper apps relative to the main application name, resolving each
5
+ * one as `${CFBundleName} Helper.app` (see `electron_main_delegate_mac.mm`). electron-builder uses
6
+ * the product name verbatim for both `CFBundleName` and the on-disk helper/app bundle names, so the
7
+ * name must be usable as a filename without modification.
8
+ *
9
+ * If the name would be altered by filename sanitization, the on-disk bundle (sanitized) and
10
+ * `CFBundleName` (verbatim) would diverge and break helper discovery. Reject such names up front with
11
+ * a clear error so the user can choose a valid name, rather than silently changing it for them.
12
+ */
13
+ export function assertSafeHelperName(name, field) {
14
+ const sanitized = sanitizeFileName(name);
15
+ if (sanitized !== name) {
16
+ throw new InvalidConfigurationError(`${field} "${name}" is not a valid macOS app bundle name (it would be sanitized to "${sanitized}"). Set a ${field} that requires no filename sanitization.`);
17
+ }
18
+ }
19
+ /**
20
+ * Returns the helper bundle suffixes present in the current Electron distribution. The generic
21
+ * `" Helper"` bundle is always present; the remaining variants vary by Electron version.
22
+ */
23
+ export function getAvailableHelperSuffixes(present) {
24
+ const result = [" Helper"];
25
+ if (present.EH) {
26
+ result.push(" Helper EH");
27
+ }
28
+ if (present.NP) {
29
+ result.push(" Helper NP");
30
+ }
31
+ if (present.Renderer) {
32
+ result.push(" Helper (Renderer)");
33
+ }
34
+ if (present.Plugin) {
35
+ result.push(" Helper (Plugin)");
36
+ }
37
+ if (present.GPU) {
38
+ result.push(" Helper (GPU)");
39
+ }
40
+ return result;
41
+ }
42
+ //# sourceMappingURL=electronMacUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electronMacUtils.js","sourceRoot":"","sources":["../../../src/electron/mac/electronMacUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC9D,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,yBAAyB,CACjC,GAAG,KAAK,KAAK,IAAI,qEAAqE,SAAS,aAAa,KAAK,0CAA0C,CAC5J,CAAA;IACH,CAAC;AACH,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAyB;IAClE,MAAM,MAAM,GAAG,CAAC,SAAS,CAAC,CAAA;IAC1B,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/internal\"\n\n/**\n * At runtime Electron locates its helper apps relative to the main application name, resolving each\n * one as `${CFBundleName} Helper.app` (see `electron_main_delegate_mac.mm`). electron-builder uses\n * the product name verbatim for both `CFBundleName` and the on-disk helper/app bundle names, so the\n * name must be usable as a filename without modification.\n *\n * If the name would be altered by filename sanitization, the on-disk bundle (sanitized) and\n * `CFBundleName` (verbatim) would diverge and break helper discovery. Reject such names up front with\n * a clear error so the user can choose a valid name, rather than silently changing it for them.\n */\nexport function assertSafeHelperName(name: string, field: string): void {\n const sanitized = sanitizeFileName(name)\n if (sanitized !== name) {\n throw new InvalidConfigurationError(\n `${field} \"${name}\" is not a valid macOS app bundle name (it would be sanitized to \"${sanitized}\"). Set a ${field} that requires no filename sanitization.`\n )\n }\n}\n\nexport interface AvailableHelpers {\n EH?: boolean\n NP?: boolean\n Renderer?: boolean\n Plugin?: boolean\n GPU?: boolean\n}\n\n/**\n * Returns the helper bundle suffixes present in the current Electron distribution. The generic\n * `\" Helper\"` bundle is always present; the remaining variants vary by Electron version.\n */\nexport function getAvailableHelperSuffixes(present: AvailableHelpers): string[] {\n const result = [\" Helper\"]\n if (present.EH) {\n result.push(\" Helper EH\")\n }\n if (present.NP) {\n result.push(\" Helper NP\")\n }\n if (present.Renderer) {\n result.push(\" Helper (Renderer)\")\n }\n if (present.Plugin) {\n result.push(\" Helper (Plugin)\")\n }\n if (present.GPU) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n"]}
@@ -21,11 +21,11 @@ export async function addWinAsarIntegrity(executablePath, asarIntegrity) {
21
21
  alg,
22
22
  value,
23
23
  }));
24
- const encoder = new TextEncoder();
25
24
  resource.entries.push({
26
25
  type: "INTEGRITY",
27
26
  id: "ELECTRONASAR",
28
- bin: encoder.encode(JSON.stringify(integrityList)).buffer,
27
+ // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- needed under TS 5.8 (ArrayBufferLike); tsgolint's TS 7 lib types .buffer as ArrayBuffer
28
+ bin: new TextEncoder().encode(JSON.stringify(integrityList)).buffer,
29
29
  lang: languages[0].lang,
30
30
  codepage: languages[0].codepage,
31
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"electronWin.js","sourceRoot":"","sources":["../../../src/electron/win/electronWin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGtE,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,cAAsB,EAAE,aAA4B;IAC5F,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,CAAA;IAC7C,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAEtD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AI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IACnE,GAAG,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,6CAA6C,CAAC,CAAA;AAC3G,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { readFile, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { NtExecutable, NtExecutableResource, Resource } from \"resedit\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\n\n/** @internal */\nexport async function addWinAsarIntegrity(executablePath: string, asarIntegrity: AsarIntegrity) {\n const buffer = await readFile(executablePath)\n const executable = NtExecutable.from(buffer)\n const resource = NtExecutableResource.from(executable)\n\n const versionInfo = Resource.VersionInfo.fromEntries(resource.entries)\n if (versionInfo.length !== 1) {\n throw new Error(`Failed to parse version info in ${executablePath}`)\n }\n\n const languages = versionInfo[0].getAllLanguagesForStringValues()\n if (languages.length !== 1) {\n throw new Error(`Failed to locate languages in ${executablePath}`)\n }\n\n // See: https://github.com/electron/packager/blob/00d20b99cf4aa4621103dbbd09ff7de7d2f7f539/src/resedit.ts#L124\n const integrityList = Array.from(Object.entries(asarIntegrity)).map(([file, { algorithm: alg, hash: value }]) => ({\n file: path.win32.normalize(file),\n alg,\n value,\n }))\n\n const encoder = new TextEncoder()\n\n resource.entries.push({\n type: \"INTEGRITY\",\n id: \"ELECTRONASAR\",\n bin: encoder.encode(JSON.stringify(integrityList)).buffer as ArrayBuffer,\n lang: languages[0].lang,\n codepage: languages[0].codepage,\n })\n\n resource.outputResource(executable)\n\n await writeFile(executablePath, Buffer.from(executable.generate()))\n log.info({ executablePath: log.filePath(executablePath) }, \"updating asar integrity executable resource\")\n}\n"]}
1
+ {"version":3,"file":"electronWin.js","sourceRoot":"","sources":["../../../src/electron/win/electronWin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,Q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OAAO,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,WAAW;QACjB,EAAE,EAAE,cAAc;QAClB,+JAA+J;QAC/J,GAAG,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,MAAqB;QAClF,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;QACvB,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ;KAChC,CAAC,CAAA;IAEF,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;IAEnC,MAAM,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IACnE,GAAG,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,6CAA6C,CAAC,CAAA;AAC3G,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { readFile, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { NtExecutable, NtExecutableResource, Resource } from \"resedit\"\nimport { AsarIntegrity } from \"../../asar/integrity.js\"\n\n/** @internal */\nexport async function addWinAsarIntegrity(executablePath: string, asarIntegrity: AsarIntegrity) {\n const buffer = await readFile(executablePath)\n const executable = NtExecutable.from(buffer)\n const resource = NtExecutableResource.from(executable)\n\n const versionInfo = Resource.VersionInfo.fromEntries(resource.entries)\n if (versionInfo.length !== 1) {\n throw new Error(`Failed to parse version info in ${executablePath}`)\n }\n\n const languages = versionInfo[0].getAllLanguagesForStringValues()\n if (languages.length !== 1) {\n throw new Error(`Failed to locate languages in ${executablePath}`)\n }\n\n // See: https://github.com/electron/packager/blob/00d20b99cf4aa4621103dbbd09ff7de7d2f7f539/src/resedit.ts#L124\n const integrityList = Array.from(Object.entries(asarIntegrity)).map(([file, { algorithm: alg, hash: value }]) => ({\n file: path.win32.normalize(file),\n alg,\n value,\n }))\n\n resource.entries.push({\n type: \"INTEGRITY\",\n id: \"ELECTRONASAR\",\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- needed under TS 5.8 (ArrayBufferLike); tsgolint's TS 7 lib types .buffer as ArrayBuffer\n bin: new TextEncoder().encode(JSON.stringify(integrityList)).buffer as ArrayBuffer,\n lang: languages[0].lang,\n codepage: languages[0].codepage,\n })\n\n resource.outputResource(executable)\n\n await writeFile(executablePath, Buffer.from(executable.generate()))\n log.info({ executablePath: log.filePath(executablePath) }, \"updating asar integrity executable resource\")\n}\n"]}
@@ -1,9 +1,35 @@
1
- import { Filter } from "builder-util";
1
+ import { ExternalLinkPolicy, Filter } from "builder-util";
2
+ import { Nullish } from "builder-util-runtime";
2
3
  import { Minimatch } from "minimatch";
3
4
  import type { Configuration } from "./configuration.js";
4
5
  import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions.js";
5
- export declare const excludedNames: string;
6
- export declare const excludedExts: string;
6
+ export declare const DEFAULT_EXCLUDED_NAMES: ReadonlyArray<string>;
7
+ export declare const DEFAULT_EXCLUDED_EXTENSIONS: ReadonlyArray<string>;
8
+ /**
9
+ * Determines which default-excluded extensions and names a user has explicitly opted back in to via
10
+ * their `files` patterns, so the corresponding defaults are not re-applied.
11
+ *
12
+ * A default is treated as opted back in only when a non-negated pattern references it concretely:
13
+ * an extension when a pattern's basename ends with `.<ext>` (e.g. `**\/*.obj`, `assets/*.{obj,gltf}`,
14
+ * `**\/*.d.ts`); a name when any path segment equals it (e.g. `**\/.github/**`, `**\/yarn.lock`).
15
+ * Broad patterns such as `**\/*` reference nothing concrete and therefore opt nothing in.
16
+ */
17
+ export declare function collectExplicitReincludes(patterns: ReadonlyArray<string>): {
18
+ extensions: Set<string>;
19
+ names: Set<string>;
20
+ };
21
+ /**
22
+ * Builds the trailing list of default ignore globs appended to the main app file matcher. Extensions
23
+ * and names the user has explicitly re-included (see {@link collectExplicitReincludes}) are omitted,
24
+ * so a `files` entry like `**\/*.obj` overrides the matching built-in exclusion.
25
+ */
26
+ export declare function getDefaultIgnoredPatterns(userPatterns: ReadonlyArray<string>, includePdb: boolean): Array<string>;
27
+ /**
28
+ * Returns the default-excluded names/extensions that the given `files` patterns opt back in, formatted
29
+ * for display (extensions as `*.<ext>`, names verbatim). Empty when nothing default-excluded is
30
+ * re-included. Used to warn that files normally kept out of the package will now be included.
31
+ */
32
+ export declare function getReincludedDefaultExclusions(patterns: ReadonlyArray<string>): Array<string>;
7
33
  export declare class FileMatcher {
8
34
  readonly macroExpander: (pattern: string) => string;
9
35
  readonly from: string;
@@ -27,5 +53,31 @@ export interface GetFileMatchersOptions {
27
53
  readonly globalOutDir: string;
28
54
  readonly defaultSrc: string;
29
55
  }
56
+ /**
57
+ * Resolves a file set `to` to the destination a FileMatcher should copy into.
58
+ *
59
+ * - A missing `to` falls back to `defaultDestination`.
60
+ * - For file sets that are physically copied into the build output directory
61
+ * (see {@link VALIDATED_DESTINATION_NAMES}), the result is validated to stay inside it:
62
+ * absolute `to` values (POSIX, Windows drive-letter, or UNC — files would be copied to that
63
+ * literal path on the build machine) and relative values that escape `globalOutDir`
64
+ * (e.g. `../../usr/share`) throw. Relative hops that stay inside the build output directory
65
+ * (e.g. `to: "../Frameworks"` from `Contents/Resources` on macOS) remain valid.
66
+ * - `files` sets are exempt from validation: their `to` only participates in in-package (asar)
67
+ * relative math, so it is plainly resolved against `defaultDestination`.
68
+ */
69
+ export declare function resolveFileSetDestination(name: string, to: string | Nullish, defaultDestination: string, globalOutDir: string): string;
30
70
  export declare function getFileMatchers(config: Configuration, name: "files" | "extraFiles" | "extraResources" | "extraDistFiles", defaultDestination: string, options: GetFileMatchersOptions): Array<FileMatcher> | null;
71
+ /** Where {@link copyFiles} may write, and where a copied symlink may lead. */
72
+ export interface CopyFilesContainment {
73
+ /**
74
+ * The output directories the matchers copy into, most specific first (e.g. the app output directory, then the output directory).
75
+ * Each matcher is confined, by real path, to the first one its destination is in.
76
+ */
77
+ readonly roots: ReadonlyArray<string>;
78
+ /** Besides the root, the directories a copied symlink may lead into, such as the workspace root and the package-manager store. */
79
+ readonly allowedSymlinkRoots?: ReadonlyArray<string> | null;
80
+ /** The `fileOptions.allowExternalLinks` build option: a copied symlink that leads anywhere else is kept when it allows it. */
81
+ readonly externalLinks?: ExternalLinkPolicy | null;
82
+ }
31
83
  //# sourceMappingURL=fileMatcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fileMatcher.d.ts","sourceRoot":"","sources":["../src/fileMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,MAAM,EAAmC,MAAM,cAAc,CAAA;AAGzH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,EAAW,4BAA4B,EAAE,MAAM,2CAA2C,CAAA;AAQjG,eAAO,MAAM,aAAa,QAK6D,CAAA;AAEvF,eAAO,MAAM,YAAY,QAGA,CAAA;AAiBzB,qBAAa,WAAW;IAapB,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM;IAZrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAEnB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAEhC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,CAAO;IAE/C,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAA;gBAGvC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACD,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,EACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IAQ1C,gBAAgB,CAAC,OAAO,EAAE,MAAM;IAOhC,UAAU,CAAC,OAAO,EAA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yJD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IACnD,QAAQ,CAAC,kBAAkB,EAAE,4BAA4B,CAAA;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAUD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CA2BtI;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,EAClE,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,sBAAsB,GAC9B,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI,CAgD3B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACrC,kIAAkI;IAClI,QAAQ,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAC3D,8HAA8H;IAC9H,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACnD"}
@@ -1,19 +1,207 @@
1
- import { asArray, copyDir, copyOrLinkFile, log, statOrNull, USE_HARD_LINKS } from "builder-util";
2
- import { mkdir } from "fs/promises";
1
+ import { asArray, copyDir, copyOrLinkFile, InvalidConfigurationError, isPathWithin, log, statOrNull, USE_HARD_LINKS, WriteContainment, } from "builder-util";
3
2
  import { Minimatch } from "minimatch";
4
3
  import * as path from "path";
5
4
  import { createFilter, hasMagic } from "./util/filter.js";
6
5
  // https://github.com/electron-userland/electron-builder/issues/733
7
6
  const minimatchOptions = { dot: true };
8
7
  // noinspection SpellCheckingInspection
9
- export const excludedNames = ".git,.hg,.svn,CVS,RCS,SCCS," +
10
- "__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore," +
11
- ".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci," +
12
- ".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log,pnpm-lock.yaml,bun.lock,bun.lockb," +
13
- "appveyor.yml,.travis.yml,circle.yml,.nyc_output,.husky,.github,electron-builder.env";
14
- export const excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts," +
8
+ // File/dir names excluded by default from the packaged app. A `files` entry may opt any of these
9
+ // back in (see collectExplicitReincludes / getDefaultIgnoredPatterns).
10
+ export const DEFAULT_EXCLUDED_NAMES = [
11
+ ".git",
12
+ ".hg",
13
+ ".svn",
14
+ "CVS",
15
+ "RCS",
16
+ "SCCS",
17
+ "__pycache__",
18
+ ".DS_Store",
19
+ "thumbs.db",
20
+ ".gitignore",
21
+ ".gitkeep",
22
+ ".gitattributes",
23
+ ".npmignore",
24
+ ".idea",
25
+ ".vs",
26
+ ".flowconfig",
27
+ ".jshintrc",
28
+ ".eslintrc",
29
+ ".circleci",
30
+ ".yarn-integrity",
31
+ ".yarn-metadata.json",
32
+ "yarn-error.log",
33
+ "yarn.lock",
34
+ "package-lock.json",
35
+ "npm-debug.log",
36
+ "pnpm-lock.yaml",
37
+ "bun.lock",
38
+ "bun.lockb",
39
+ "appveyor.yml",
40
+ ".travis.yml",
41
+ "circle.yml",
42
+ ".nyc_output",
43
+ ".husky",
44
+ ".github",
45
+ "electron-builder.env",
46
+ ];
47
+ // File extensions (without leading dot) excluded by default from the packaged app.
48
+ export const DEFAULT_EXCLUDED_EXTENSIONS = [
49
+ "iml",
50
+ "hprof",
51
+ "orig",
52
+ "pyc",
53
+ "pyo",
54
+ "rbc",
55
+ "swp",
56
+ "csproj",
57
+ "sln",
58
+ "slnx",
59
+ "suo",
60
+ "xproj",
61
+ "cc",
62
+ "d.ts",
15
63
  // https://github.com/electron-userland/electron-builder/issues/7512
16
- "mk,a,o,obj,forge-meta";
64
+ "mk",
65
+ "a",
66
+ "o",
67
+ "obj",
68
+ "forge-meta",
69
+ ];
70
+ // Hard cap on the number of strings a single pattern may expand to. Real opt-in patterns expand to a
71
+ // handful (`{obj,gltf,glb}`); this bound makes the expansion provably finite so a pathological pattern
72
+ // (e.g. nested or many large `{...}` groups whose product is huge) degrades to "treated literally"
73
+ // rather than hanging/OOM-ing the build. minimatch performs the authoritative expansion downstream.
74
+ const MAX_BRACE_EXPANSIONS = 64;
75
+ // Expands `{a,b,c}` brace alternations in a pattern, honoring nesting. Returns the value unchanged
76
+ // when it has no braces or would expand beyond MAX_BRACE_EXPANSIONS. Used only to detect which
77
+ // extensions/names a `files` entry references — not for matching.
78
+ function expandBraces(value) {
79
+ const open = value.indexOf("{");
80
+ if (open === -1) {
81
+ return [value];
82
+ }
83
+ // Find the `}` that closes the first `{`, accounting for nested braces.
84
+ let depth = 0;
85
+ let close = -1;
86
+ for (let i = open; i < value.length; i++) {
87
+ if (value[i] === "{") {
88
+ depth++;
89
+ }
90
+ else if (value[i] === "}" && --depth === 0) {
91
+ close = i;
92
+ break;
93
+ }
94
+ }
95
+ if (close === -1) {
96
+ return [value];
97
+ }
98
+ const prefix = value.slice(0, open);
99
+ const suffix = value.slice(close + 1);
100
+ const result = [];
101
+ for (const alternative of splitTopLevel(value.slice(open + 1, close))) {
102
+ for (const expanded of expandBraces(`${prefix}${alternative}${suffix}`)) {
103
+ if (result.length >= MAX_BRACE_EXPANSIONS) {
104
+ return [value];
105
+ }
106
+ result.push(expanded);
107
+ }
108
+ }
109
+ return result;
110
+ }
111
+ // Splits on commas that are not inside a nested brace group, so `a,{b,c}` yields ["a", "{b,c}"].
112
+ function splitTopLevel(value) {
113
+ const parts = [];
114
+ let depth = 0;
115
+ let start = 0;
116
+ for (let i = 0; i < value.length; i++) {
117
+ const ch = value[i];
118
+ if (ch === "{") {
119
+ depth++;
120
+ }
121
+ else if (ch === "}") {
122
+ depth--;
123
+ }
124
+ else if (ch === "," && depth === 0) {
125
+ parts.push(value.slice(start, i));
126
+ start = i + 1;
127
+ }
128
+ }
129
+ parts.push(value.slice(start));
130
+ return parts;
131
+ }
132
+ /**
133
+ * Determines which default-excluded extensions and names a user has explicitly opted back in to via
134
+ * their `files` patterns, so the corresponding defaults are not re-applied.
135
+ *
136
+ * A default is treated as opted back in only when a non-negated pattern references it concretely:
137
+ * an extension when a pattern's basename ends with `.<ext>` (e.g. `**\/*.obj`, `assets/*.{obj,gltf}`,
138
+ * `**\/*.d.ts`); a name when any path segment equals it (e.g. `**\/.github/**`, `**\/yarn.lock`).
139
+ * Broad patterns such as `**\/*` reference nothing concrete and therefore opt nothing in.
140
+ */
141
+ export function collectExplicitReincludes(patterns) {
142
+ const segments = new Set();
143
+ const basenames = [];
144
+ for (const pattern of patterns) {
145
+ if (pattern.startsWith("!")) {
146
+ continue;
147
+ }
148
+ for (const expanded of expandBraces(pattern)) {
149
+ const parts = expanded.split("/");
150
+ for (const part of parts) {
151
+ segments.add(part);
152
+ }
153
+ basenames.push(parts[parts.length - 1]);
154
+ }
155
+ }
156
+ const extensions = new Set(DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => basenames.some(name => name.endsWith(`.${ext}`))));
157
+ const names = new Set(DEFAULT_EXCLUDED_NAMES.filter(name => segments.has(name)));
158
+ return { extensions, names };
159
+ }
160
+ /**
161
+ * Builds the trailing list of default ignore globs appended to the main app file matcher. Extensions
162
+ * and names the user has explicitly re-included (see {@link collectExplicitReincludes}) are omitted,
163
+ * so a `files` entry like `**\/*.obj` overrides the matching built-in exclusion.
164
+ */
165
+ export function getDefaultIgnoredPatterns(userPatterns, includePdb) {
166
+ const reincluded = collectExplicitReincludes(userPatterns);
167
+ const extensions = DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => !reincluded.extensions.has(ext));
168
+ if (!includePdb) {
169
+ extensions.push("pdb");
170
+ }
171
+ const names = DEFAULT_EXCLUDED_NAMES.filter(name => !reincluded.names.has(name));
172
+ const patterns = [];
173
+ // minimatch does not expand a single-member brace (`{x}` is matched literally), so emit a bare
174
+ // glob when only one extension/name survives the opt-in filtering.
175
+ if (extensions.length === 1) {
176
+ patterns.push(`!**/*.${extensions[0]}`);
177
+ }
178
+ else if (extensions.length > 1) {
179
+ patterns.push(`!**/*.{${extensions.join(",")}}`);
180
+ }
181
+ patterns.push("!**/._*");
182
+ patterns.push("!**/electron-builder.{yaml,yml,json,json5,toml,ts}");
183
+ if (names.length === 1) {
184
+ patterns.push(`!**/${names[0]}`);
185
+ }
186
+ else if (names.length > 1) {
187
+ patterns.push(`!**/{${names.join(",")}}`);
188
+ }
189
+ patterns.push("!.yarn{,/**/*}");
190
+ // https://github.com/electron-userland/electron-builder/issues/1969
191
+ // exclude only for app root, use .yarnclean to clean node_modules
192
+ patterns.push("!.editorconfig");
193
+ patterns.push("!.yarnrc.yml");
194
+ return patterns;
195
+ }
196
+ /**
197
+ * Returns the default-excluded names/extensions that the given `files` patterns opt back in, formatted
198
+ * for display (extensions as `*.<ext>`, names verbatim). Empty when nothing default-excluded is
199
+ * re-included. Used to warn that files normally kept out of the package will now be included.
200
+ */
201
+ export function getReincludedDefaultExclusions(patterns) {
202
+ const reincluded = collectExplicitReincludes(patterns);
203
+ return [...[...reincluded.extensions].map(ext => `*.${ext}`), ...reincluded.names];
204
+ }
17
205
  function ensureNoEndSlash(file) {
18
206
  if (path.sep !== "/") {
19
207
  file = file.replace(/\//g, path.sep);
@@ -106,6 +294,9 @@ export function getMainFileMatchers(appDir, destination, macroExpander, platform
106
294
  }
107
295
  // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns
108
296
  const patterns = matcher.patterns;
297
+ // Snapshot the user-specified patterns before the default/auto patterns are injected so a `files`
298
+ // entry can opt back in to a default-excluded extension/name (see getDefaultIgnoredPatterns).
299
+ const userSpecifiedPatterns = patterns.slice();
109
300
  const customFirstPatterns = [];
110
301
  // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified
111
302
  if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {
@@ -145,15 +336,12 @@ export function getMainFileMatchers(appDir, destination, macroExpander, platform
145
336
  }
146
337
  }
147
338
  patterns.splice(insertIndex, 0, ...customFirstPatterns);
148
- patterns.push(`!**/*.{${excludedExts}${platformPackager.config.includePdb === true ? "" : ",pdb"}}`);
149
- patterns.push("!**/._*");
150
- patterns.push("!**/electron-builder.{yaml,yml,json,json5,toml,ts}");
151
- patterns.push(`!**/{${excludedNames}}`);
152
- patterns.push("!.yarn{,/**/*}");
153
- // https://github.com/electron-userland/electron-builder/issues/1969
154
- // exclude ony for app root, use .yarnclean to clean node_modules
155
- patterns.push("!.editorconfig");
156
- patterns.push("!.yarnrc.yml");
339
+ const reincludedDefaults = getReincludedDefaultExclusions(userSpecifiedPatterns);
340
+ if (reincludedDefaults.length > 0) {
341
+ // These files are kept out of the package by default; a user `files` pattern is opting them back in.
342
+ log.warn({ files: reincludedDefaults.join(", ") }, "`files` configuration re-includes files that are excluded by default — verify this is intentional");
343
+ }
344
+ patterns.push(...getDefaultIgnoredPatterns(userSpecifiedPatterns, platformPackager.config.includePdb === true));
157
345
  const debugLogger = platformPackager.debugLogger;
158
346
  if (debugLogger.isEnabled) {
159
347
  //tslint:disable-next-line:no-invalid-template-strings
@@ -194,8 +382,8 @@ export function getNodeModuleFileMatcher(appDir, destination, macroExpander, pla
194
382
  }
195
383
  }
196
384
  }
197
- addPatterns(packager.config.files);
198
- addPatterns(platformSpecificBuildOptions.files);
385
+ addPatterns(packager.config.fileOptions?.files);
386
+ addPatterns(platformSpecificBuildOptions.fileOptions?.files);
199
387
  if (!matcher.isEmpty()) {
200
388
  matcher.prependPattern("**/*");
201
389
  }
@@ -206,6 +394,45 @@ export function getNodeModuleFileMatcher(appDir, destination, macroExpander, pla
206
394
  }
207
395
  return matcher;
208
396
  }
397
+ // The names whose file sets are physically copied into the build output directory, so a `to` that
398
+ // resolves outside of it writes onto the build machine itself (https://github.com/electron-userland/electron-builder/issues/1993).
399
+ // `files` is excluded: its `to` is only used for in-package (asar) relative math.
400
+ const VALIDATED_DESTINATION_NAMES = ["extraFiles", "extraResources", "extraDistFiles"];
401
+ const FPM_MAPPING_HINT = 'To install a file at an absolute path inside a deb/rpm package, use the fpm file-mapping syntax instead, e.g. "deb": { "fpm": ["build/file.xml=/usr/share/metainfo/file.xml"] }.';
402
+ /**
403
+ * Resolves a file set `to` to the destination a FileMatcher should copy into.
404
+ *
405
+ * - A missing `to` falls back to `defaultDestination`.
406
+ * - For file sets that are physically copied into the build output directory
407
+ * (see {@link VALIDATED_DESTINATION_NAMES}), the result is validated to stay inside it:
408
+ * absolute `to` values (POSIX, Windows drive-letter, or UNC — files would be copied to that
409
+ * literal path on the build machine) and relative values that escape `globalOutDir`
410
+ * (e.g. `../../usr/share`) throw. Relative hops that stay inside the build output directory
411
+ * (e.g. `to: "../Frameworks"` from `Contents/Resources` on macOS) remain valid.
412
+ * - `files` sets are exempt from validation: their `to` only participates in in-package (asar)
413
+ * relative math, so it is plainly resolved against `defaultDestination`.
414
+ */
415
+ export function resolveFileSetDestination(name, to, defaultDestination, globalOutDir) {
416
+ if (to == null) {
417
+ return defaultDestination;
418
+ }
419
+ if (!VALIDATED_DESTINATION_NAMES.includes(name)) {
420
+ return path.resolve(defaultDestination, to);
421
+ }
422
+ // path.win32.isAbsolute also covers POSIX absolute paths, and treats drive-letter (C:\) and
423
+ // UNC (\\server\share) paths as absolute no matter which OS the build runs on
424
+ if (path.win32.isAbsolute(to) || path.posix.isAbsolute(to)) {
425
+ throw new InvalidConfigurationError(`The "to" path "${to}" in "${name}" is absolute. Absolute destinations are not copied into the packaged app — they would be written to that literal path on the build machine. Use a relative path instead. ${FPM_MAPPING_HINT}`);
426
+ }
427
+ // FileMatcher later converts all separators to path.sep, so normalize before resolving to make
428
+ // sure `..\\..` segments written with backslashes are seen as parent hops here too
429
+ const resolved = path.resolve(defaultDestination, to.replace(/[/\\]/g, path.sep));
430
+ const relativeToOutDir = path.relative(path.resolve(globalOutDir), resolved);
431
+ if (relativeToOutDir.startsWith(`..${path.sep}`) || relativeToOutDir === ".." || path.isAbsolute(relativeToOutDir)) {
432
+ throw new InvalidConfigurationError(`The "to" path "${to}" in "${name}" resolves to "${resolved}", which is outside the build output directory "${path.resolve(globalOutDir)}". The files would be copied onto the build machine instead of into the packaged app. Use a relative path that stays within the package. ${FPM_MAPPING_HINT}`);
433
+ }
434
+ return resolved;
435
+ }
209
436
  export function getFileMatchers(config, name, defaultDestination, options) {
210
437
  const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander);
211
438
  const fileMatchers = [];
@@ -227,15 +454,20 @@ export function getFileMatchers(config, name, defaultDestination, options) {
227
454
  }
228
455
  else {
229
456
  const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from);
230
- const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to);
457
+ const to = resolveFileSetDestination(name, pattern.to, defaultDestination, options.globalOutDir);
231
458
  fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter));
232
459
  }
233
460
  }
234
461
  }
235
- if (name !== "extraDistFiles") {
236
- addPatterns(config[name]);
462
+ // `extraDistFiles` is a mac option of its own; the others are read from `fileOptions`, into which flat keys are
463
+ // normalized when the configuration is loaded (see util/config/fileOptions.ts)
464
+ if (name === "extraDistFiles") {
465
+ addPatterns(options.customBuildOptions.extraDistFiles);
466
+ }
467
+ else {
468
+ addPatterns(config.fileOptions?.[name]);
469
+ addPatterns(options.customBuildOptions.fileOptions?.[name]);
237
470
  }
238
- addPatterns(options.customBuildOptions[name]);
239
471
  if (!defaultMatcher.isEmpty()) {
240
472
  // default matcher should be first in the array
241
473
  fileMatchers.unshift(defaultMatcher);
@@ -247,8 +479,11 @@ export function getFileMatchers(config, name, defaultDestination, options) {
247
479
  }
248
480
  return fileMatchers.length === 0 ? null : fileMatchers;
249
481
  }
482
+ function containmentRootFor(destination, containment) {
483
+ return containment?.roots.find(root => isPathWithin(path.resolve(root), path.resolve(destination))) ?? destination;
484
+ }
250
485
  /** @internal */
251
- export function copyFiles(matchers, transformer, isUseHardLink) {
486
+ export function copyFiles(matchers, transformer, isUseHardLink, containment) {
252
487
  if (matchers == null || matchers.length === 0) {
253
488
  return Promise.resolve();
254
489
  }
@@ -258,20 +493,31 @@ export function copyFiles(matchers, transformer, isUseHardLink) {
258
493
  log.warn({ from: matcher.from }, `file source doesn't exist`);
259
494
  return;
260
495
  }
496
+ const containmentRoot = containmentRootFor(matcher.to, containment);
261
497
  if (fromStat.isFile()) {
498
+ const writes = new WriteContainment(containmentRoot, "copied file");
262
499
  const toStat = await statOrNull(matcher.to);
263
500
  // https://github.com/electron-userland/electron-builder/issues/1245
264
501
  if (toStat != null && toStat.isDirectory()) {
265
- return await copyOrLinkFile(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink);
502
+ const dest = path.join(matcher.to, path.basename(matcher.from));
503
+ await writes.prepareFile(dest);
504
+ return await copyOrLinkFile(matcher.from, dest, fromStat, isUseHardLink);
266
505
  }
267
- await mkdir(path.dirname(matcher.to), { recursive: true });
506
+ await writes.prepareFile(matcher.to);
268
507
  return await copyOrLinkFile(matcher.from, matcher.to, fromStat);
269
508
  }
270
509
  if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {
271
510
  matcher.prependPattern("**/*");
272
511
  }
273
512
  log.debug({ matcher }, "copying files using pattern");
274
- return await copyDir(matcher.from, matcher.to, { filter: matcher.createFilter(), transformer, isUseHardLink: isUseHardLink ? USE_HARD_LINKS : null });
513
+ return await copyDir(matcher.from, matcher.to, {
514
+ filter: matcher.createFilter(),
515
+ transformer,
516
+ isUseHardLink: isUseHardLink ? USE_HARD_LINKS : null,
517
+ containmentRoot,
518
+ allowedSymlinkRoots: containment?.allowedSymlinkRoots,
519
+ externalLinks: containment?.externalLinks,
520
+ });
275
521
  }));
276
522
  }
277
523
  //# sourceMappingURL=fileMatcher.js.map