app-builder-lib 27.0.0-alpha.2 → 27.0.0-alpha.4

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 (247) 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/asar/asarFileChecker.d.ts +4 -2
  5. package/dist/asar/asarFileChecker.d.ts.map +1 -1
  6. package/dist/asar/asarFileChecker.js +2 -3
  7. package/dist/asar/asarFileChecker.js.map +1 -1
  8. package/dist/codeSign/certInfo.d.ts +14 -0
  9. package/dist/codeSign/certInfo.d.ts.map +1 -1
  10. package/dist/codeSign/certInfo.js +49 -0
  11. package/dist/codeSign/certInfo.js.map +1 -1
  12. package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
  13. package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
  14. package/dist/codeSign/mac/macCodeSign.js +40 -14
  15. package/dist/codeSign/mac/macCodeSign.js.map +1 -1
  16. package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
  17. package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
  18. package/dist/codeSign/win/hsmSignManager.js +50 -0
  19. package/dist/codeSign/win/hsmSignManager.js.map +1 -0
  20. package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
  21. package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
  22. package/dist/codeSign/win/pkcs11SignManager.js +82 -0
  23. package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
  24. package/dist/codeSign/{signManager.d.ts → win/signManager.d.ts} +8 -6
  25. package/dist/codeSign/win/signManager.d.ts.map +1 -0
  26. package/dist/codeSign/win/signManager.js +19 -0
  27. package/dist/codeSign/win/signManager.js.map +1 -0
  28. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +71 -0
  29. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
  30. package/dist/codeSign/win/signtoolBaseSignManager.js +414 -0
  31. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
  32. package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
  33. package/dist/codeSign/win/windowsCodeSign.js +9 -4
  34. package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
  35. package/dist/codeSign/win/windowsSignAzureManager.d.ts +9 -3
  36. package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
  37. package/dist/codeSign/win/windowsSignAzureManager.js +130 -36
  38. package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
  39. package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
  40. package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
  41. package/dist/codeSign/win/windowsSignToolManager.js +3 -363
  42. package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
  43. package/dist/configuration.d.ts +22 -123
  44. package/dist/configuration.d.ts.map +1 -1
  45. package/dist/configuration.js.map +1 -1
  46. package/dist/electron/ElectronFramework.d.ts +0 -2
  47. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  48. package/dist/electron/ElectronFramework.js +15 -27
  49. package/dist/electron/ElectronFramework.js.map +1 -1
  50. package/dist/electron/injectFFMPEG.js +2 -2
  51. package/dist/electron/injectFFMPEG.js.map +1 -1
  52. package/dist/electron/mac/electronMac.js +10 -8
  53. package/dist/electron/mac/electronMac.js.map +1 -1
  54. package/dist/electron/win/electronWin.js +1 -2
  55. package/dist/electron/win/electronWin.js.map +1 -1
  56. package/dist/index.d.ts +8 -4
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +3 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/indexInternal.d.ts +3 -3
  61. package/dist/indexInternal.d.ts.map +1 -1
  62. package/dist/indexInternal.js +2 -2
  63. package/dist/indexInternal.js.map +1 -1
  64. package/dist/macPackager.d.ts +19 -10
  65. package/dist/macPackager.d.ts.map +1 -1
  66. package/dist/macPackager.js +149 -121
  67. package/dist/macPackager.js.map +1 -1
  68. package/dist/node-module-collector/moduleManager.d.ts +9 -2
  69. package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
  70. package/dist/node-module-collector/moduleManager.js +4 -2
  71. package/dist/node-module-collector/moduleManager.js.map +1 -1
  72. package/dist/node-module-collector/nodeModulesCollector.d.ts +13 -23
  73. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  74. package/dist/node-module-collector/nodeModulesCollector.js +52 -122
  75. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  76. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +48 -1
  77. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  78. package/dist/node-module-collector/pnpmNodeModulesCollector.js +216 -17
  79. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  80. package/dist/node-module-collector/types.d.ts +2 -0
  81. package/dist/node-module-collector/types.d.ts.map +1 -1
  82. package/dist/node-module-collector/types.js.map +1 -1
  83. package/dist/options/FuseOptionsV1.d.ts +137 -0
  84. package/dist/options/FuseOptionsV1.d.ts.map +1 -0
  85. package/dist/options/FuseOptionsV1.js +2 -0
  86. package/dist/options/FuseOptionsV1.js.map +1 -0
  87. package/dist/options/PlatformSpecificBuildOptions.d.ts +1 -1
  88. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  89. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  90. package/dist/options/linuxOptions.d.ts +0 -10
  91. package/dist/options/linuxOptions.d.ts.map +1 -1
  92. package/dist/options/linuxOptions.js.map +1 -1
  93. package/dist/options/macOptions.d.ts +93 -126
  94. package/dist/options/macOptions.d.ts.map +1 -1
  95. package/dist/options/macOptions.js.map +1 -1
  96. package/dist/options/winOptions.d.ts +137 -63
  97. package/dist/options/winOptions.d.ts.map +1 -1
  98. package/dist/options/winOptions.js +12 -1
  99. package/dist/options/winOptions.js.map +1 -1
  100. package/dist/packager.js +1 -1
  101. package/dist/packager.js.map +1 -1
  102. package/dist/platformPackager.d.ts +5 -2
  103. package/dist/platformPackager.d.ts.map +1 -1
  104. package/dist/platformPackager.js +16 -13
  105. package/dist/platformPackager.js.map +1 -1
  106. package/dist/targets/ArchiveTarget.js +2 -2
  107. package/dist/targets/ArchiveTarget.js.map +1 -1
  108. package/dist/targets/archive.d.ts +10 -2
  109. package/dist/targets/archive.d.ts.map +1 -1
  110. package/dist/targets/archive.js +25 -6
  111. package/dist/targets/archive.js.map +1 -1
  112. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  113. package/dist/targets/linux/FlatpakTarget.js +4 -1
  114. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  115. package/dist/targets/linux/FpmTarget.d.ts +6 -0
  116. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  117. package/dist/targets/linux/FpmTarget.js +25 -3
  118. package/dist/targets/linux/FpmTarget.js.map +1 -1
  119. package/dist/targets/linux/LinuxTargetHelper.d.ts +14 -0
  120. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  121. package/dist/targets/linux/LinuxTargetHelper.js +38 -59
  122. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  123. package/dist/targets/linux/appimage/AppImageTarget.d.ts +1 -0
  124. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  125. package/dist/targets/linux/appimage/AppImageTarget.js +8 -9
  126. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  127. package/dist/targets/linux/appimage/appImageUtil.d.ts +4 -0
  128. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  129. package/dist/targets/linux/appimage/appImageUtil.js +11 -4
  130. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  131. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  132. package/dist/targets/linux/appimage/appLauncher.js +5 -11
  133. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  134. package/dist/targets/linux/launcherScript.d.ts +32 -0
  135. package/dist/targets/linux/launcherScript.d.ts.map +1 -0
  136. package/dist/targets/linux/launcherScript.js +24 -0
  137. package/dist/targets/linux/launcherScript.js.map +1 -0
  138. package/dist/targets/linux/snap/core24.d.ts +2 -0
  139. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  140. package/dist/targets/linux/snap/core24.js +48 -8
  141. package/dist/targets/linux/snap/core24.js.map +1 -1
  142. package/dist/targets/linux/snap/coreLegacy.d.ts +2 -2
  143. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  144. package/dist/targets/linux/snap/coreLegacy.js +9 -10
  145. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  146. package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
  147. package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
  148. package/dist/targets/linux/snap/snapCommand.js +21 -0
  149. package/dist/targets/linux/snap/snapCommand.js.map +1 -0
  150. package/dist/targets/mac/MacTargetHelper.d.ts +12 -12
  151. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  152. package/dist/targets/mac/MacTargetHelper.js +72 -67
  153. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  154. package/dist/targets/mac/pkg.d.ts.map +1 -1
  155. package/dist/targets/mac/pkg.js +4 -4
  156. package/dist/targets/mac/pkg.js.map +1 -1
  157. package/dist/targets/win/AppxTarget.d.ts.map +1 -1
  158. package/dist/targets/win/AppxTarget.js +9 -9
  159. package/dist/targets/win/AppxTarget.js.map +1 -1
  160. package/dist/targets/win/MsiTarget.d.ts.map +1 -1
  161. package/dist/targets/win/MsiTarget.js +8 -11
  162. package/dist/targets/win/MsiTarget.js.map +1 -1
  163. package/dist/targets/win/nsis/NsisTarget.js +5 -5
  164. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  165. package/dist/targets/win/nsis/nsisScriptGenerator.js +2 -2
  166. package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
  167. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  168. package/dist/targets/win/nsis/nsisUtil.js +2 -2
  169. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  170. package/dist/toolsets/custom.d.ts +1 -0
  171. package/dist/toolsets/custom.d.ts.map +1 -1
  172. package/dist/toolsets/custom.js +19 -8
  173. package/dist/toolsets/custom.js.map +1 -1
  174. package/dist/toolsets/icons.d.ts.map +1 -1
  175. package/dist/toolsets/icons.js +11 -3
  176. package/dist/toolsets/icons.js.map +1 -1
  177. package/dist/toolsets/winCodeSign.d.ts +36 -0
  178. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  179. package/dist/toolsets/winCodeSign.js +84 -30
  180. package/dist/toolsets/winCodeSign.js.map +1 -1
  181. package/dist/toolsets/wine.d.ts.map +1 -1
  182. package/dist/toolsets/wine.js +20 -12
  183. package/dist/toolsets/wine.js.map +1 -1
  184. package/dist/util/appFileCopier.d.ts.map +1 -1
  185. package/dist/util/appFileCopier.js +9 -4
  186. package/dist/util/appFileCopier.js.map +1 -1
  187. package/dist/util/archCompatibility.d.ts +42 -0
  188. package/dist/util/archCompatibility.d.ts.map +1 -0
  189. package/dist/util/archCompatibility.js +202 -0
  190. package/dist/util/archCompatibility.js.map +1 -0
  191. package/dist/util/config/schemaValidator.d.ts.map +1 -1
  192. package/dist/util/config/schemaValidator.js +1 -1
  193. package/dist/util/config/schemaValidator.js.map +1 -1
  194. package/dist/util/electronGet.d.ts +8 -25
  195. package/dist/util/electronGet.d.ts.map +1 -1
  196. package/dist/util/electronGet.js +107 -87
  197. package/dist/util/electronGet.js.map +1 -1
  198. package/dist/util/flags.d.ts +0 -3
  199. package/dist/util/flags.d.ts.map +1 -1
  200. package/dist/util/flags.js +0 -9
  201. package/dist/util/flags.js.map +1 -1
  202. package/dist/util/installOrRebuild.d.ts +38 -0
  203. package/dist/util/installOrRebuild.d.ts.map +1 -0
  204. package/dist/util/{yarn.js → installOrRebuild.js} +65 -14
  205. package/dist/util/installOrRebuild.js.map +1 -0
  206. package/dist/util/langs.d.ts.map +1 -1
  207. package/dist/util/langs.js +1 -0
  208. package/dist/util/langs.js.map +1 -1
  209. package/dist/util/license.d.ts.map +1 -1
  210. package/dist/util/license.js +4 -1
  211. package/dist/util/license.js.map +1 -1
  212. package/dist/util/mac/macosIconComposer.d.ts +2 -1
  213. package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
  214. package/dist/util/mac/macosIconComposer.js +40 -58
  215. package/dist/util/mac/macosIconComposer.js.map +1 -1
  216. package/dist/util/streamSpawnToFile.d.ts +47 -0
  217. package/dist/util/streamSpawnToFile.d.ts.map +1 -0
  218. package/dist/util/streamSpawnToFile.js +110 -0
  219. package/dist/util/streamSpawnToFile.js.map +1 -0
  220. package/dist/util/toolsetLock.d.ts +2 -0
  221. package/dist/util/toolsetLock.d.ts.map +1 -1
  222. package/dist/util/toolsetLock.js +31 -5
  223. package/dist/util/toolsetLock.js.map +1 -1
  224. package/dist/version.d.ts +1 -1
  225. package/dist/version.js +1 -1
  226. package/dist/version.js.map +1 -1
  227. package/dist/vm/ParallelsVm.d.ts.map +1 -1
  228. package/dist/vm/ParallelsVm.js +13 -2
  229. package/dist/vm/ParallelsVm.js.map +1 -1
  230. package/dist/vm/vm.d.ts.map +1 -1
  231. package/dist/vm/vm.js +4 -1
  232. package/dist/vm/vm.js.map +1 -1
  233. package/dist/winPackager.d.ts +1 -2
  234. package/dist/winPackager.d.ts.map +1 -1
  235. package/dist/winPackager.js +17 -22
  236. package/dist/winPackager.js.map +1 -1
  237. package/package.json +15 -14
  238. package/scheme.json +486 -439
  239. package/templates/appx/appxmanifest.xml +1 -2
  240. package/templates/nsis/assistedMessages.yml +17 -0
  241. package/templates/nsis/messages.yml +5 -0
  242. package/dist/codeSign/signManager.d.ts.map +0 -1
  243. package/dist/codeSign/signManager.js +0 -2
  244. package/dist/codeSign/signManager.js.map +0 -1
  245. package/dist/util/yarn.d.ts +0 -23
  246. package/dist/util/yarn.d.ts.map +0 -1
  247. package/dist/util/yarn.js.map +0 -1
@@ -1 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E,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,iBAAiB;IACrB,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,MAAM;CACX,CAAA","sourcesContent":["export const bundledLanguages = [\n \"en_US\",\n \"de_DE\",\n \"fr_FR\",\n \"es_ES\",\n \"zh_CN\",\n \"zh_TW\",\n \"ja_JP\",\n \"ko_KR\",\n \"it_IT\",\n \"nl_NL\",\n \"da_DK\",\n \"sv_SE\",\n \"nb_NO\",\n \"fi_FI\",\n \"ru_RU\",\n \"pt_PT\",\n \"pt_BR\",\n \"pl_PL\",\n \"uk_UA\",\n \"cs_CZ\",\n \"sk_SK\",\n \"hu_HU\",\n \"ar_SA\",\n \"tr_TR\",\n \"th_TH\",\n \"vi_VN\",\n]\n\n// todo \"ro_RO\" \"el_GR\" \"et_EE\" \"ka_GE\"\n\nconst langToLangWithRegion = new Map<string, string>()\nfor (const id of bundledLanguages) {\n langToLangWithRegion.set(id.substring(0, id.indexOf(\"_\")), id)\n}\n\nexport function toLangWithRegion(lang: string): string {\n if (lang.includes(\"_\")) {\n return lang\n }\n\n lang = lang.toLowerCase()\n\n const result = langToLangWithRegion.get(lang)\n return result == null ? `${lang}_${lang.toUpperCase()}` : result\n}\n\nexport const lcid: any = {\n af_ZA: 1078,\n am_ET: 1118,\n ar_AE: 14337,\n ar_BH: 15361,\n ar_DZ: 5121,\n ar_EG: 3073,\n ar_IQ: 2049,\n ar_JO: 11265,\n ar_KW: 13313,\n ar_LB: 12289,\n ar_LY: 4097,\n ar_MA: 6145,\n ar_OM: 8193,\n ar_QA: 16385,\n ar_SA: 1025,\n ar_SY: 10241,\n ar_TN: 7169,\n ar_YE: 9217,\n arn_CL: 1146,\n as_IN: 1101,\n az_AZ: 2092,\n ba_RU: 1133,\n be_BY: 1059,\n bg_BG: 1026,\n bn_IN: 1093,\n bo_BT: 2129,\n bo_CN: 1105,\n br_FR: 1150,\n bs_BA: 8218,\n ca_ES: 1027,\n co_FR: 1155,\n cs_CZ: 1029,\n cy_GB: 1106,\n da_DK: 1030,\n de_AT: 3079,\n de_CH: 2055,\n de_DE: 1031,\n de_LI: 5127,\n de_LU: 4103,\n div_MV: 1125,\n dsb_DE: 2094,\n el_GR: 1032,\n en_AU: 3081,\n en_BZ: 10249,\n en_CA: 4105,\n en_CB: 9225,\n en_GB: 2057,\n en_IE: 6153,\n en_IN: 18441,\n en_JA: 8201,\n en_MY: 17417,\n en_NZ: 5129,\n en_PH: 13321,\n en_TT: 11273,\n en_US: 1033,\n en_ZA: 7177,\n en_ZW: 12297,\n es_AR: 11274,\n es_BO: 16394,\n es_CL: 13322,\n es_CO: 9226,\n es_CR: 5130,\n es_DO: 7178,\n es_EC: 12298,\n es_ES: 3082,\n es_GT: 4106,\n es_HN: 18442,\n es_MX: 2058,\n es_NI: 19466,\n es_PA: 6154,\n es_PE: 10250,\n es_PR: 20490,\n es_PY: 15370,\n es_SV: 17418,\n es_UR: 14346,\n es_US: 21514,\n es_VE: 8202,\n et_EE: 1061,\n eu_ES: 1069,\n fa_IR: 1065,\n fi_FI: 1035,\n fil_PH: 1124,\n fo_FO: 1080,\n fr_BE: 2060,\n fr_CA: 3084,\n fr_CH: 4108,\n fr_FR: 1036,\n fr_LU: 5132,\n fr_MC: 6156,\n fy_NL: 1122,\n ga_IE: 2108,\n gbz_AF: 1164,\n gl_ES: 1110,\n gsw_FR: 1156,\n gu_IN: 1095,\n ha_NG: 1128,\n he_IL: 1037,\n hi_IN: 1081,\n hr_BA: 4122,\n hr_HR: 1050,\n hu_HU: 1038,\n hy_AM: 1067,\n id_ID: 1057,\n ii_CN: 1144,\n is_IS: 1039,\n it_CH: 2064,\n it_IT: 1040,\n iu_CA: 2141,\n ja_JP: 1041,\n ka_GE: 1079,\n kh_KH: 1107,\n kk_KZ: 1087,\n kl_GL: 1135,\n kn_IN: 1099,\n ko_KR: 1042,\n kok_IN: 1111,\n ky_KG: 1088,\n lb_LU: 1134,\n lo_LA: 1108,\n lt_LT: 1063,\n lv_LV: 1062,\n mi_NZ: 1153,\n mk_MK: 1071,\n ml_IN: 1100,\n mn_CN: 2128,\n mn_MN: 1104,\n moh_CA: 1148,\n mr_IN: 1102,\n ms_BN: 2110,\n ms_MY: 1086,\n mt_MT: 1082,\n my_MM: 1109,\n nb_NO: 1044,\n ne_NP: 1121,\n nl_BE: 2067,\n nl_NL: 1043,\n nn_NO: 2068,\n ns_ZA: 1132,\n oc_FR: 1154,\n or_IN: 1096,\n pa_IN: 1094,\n pl_PL: 1045,\n ps_AF: 1123,\n pt_BR: 1046,\n pt_PT: 2070,\n qut_GT: 1158,\n quz_BO: 1131,\n quz_EC: 2155,\n quz_PE: 3179,\n rm_CH: 1047,\n ro_RO: 1048,\n ru_RU: 1049,\n rw_RW: 1159,\n sa_IN: 1103,\n sah_RU: 1157,\n se_FI: 3131,\n se_NO: 1083,\n se_SE: 2107,\n si_LK: 1115,\n sk_SK: 1051,\n sl_SI: 1060,\n sma_NO: 6203,\n sma_SE: 7227,\n smj_NO: 4155,\n smj_SE: 5179,\n smn_FI: 9275,\n sms_FI: 8251,\n sq_AL: 1052,\n sr_BA: 7194,\n sr_SP: 3098,\n sv_FI: 2077,\n sv_SE: 1053,\n sw_KE: 1089,\n syr_SY: 1114,\n ta_IN: 1097,\n te_IN: 1098,\n tg_TJ: 1064,\n th_TH: 1054,\n tk_TM: 1090,\n tmz_DZ: 2143,\n tn_ZA: 1074,\n tr_TR: 1055,\n tt_RU: 1092,\n ug_CN: 1152,\n uk_UA: 1058,\n ur_IN: 2080,\n ur_PK: 1056,\n uz_UZ: 2115,\n vi_VN: 1066,\n wen_DE: 1070,\n wo_SN: 1160,\n xh_ZA: 1076,\n yo_NG: 1130,\n zh_CHS: 4,\n zh_CHT: 31748,\n zh_CN: 2052,\n zh_HK: 3076,\n zh_MO: 5124,\n zh_SG: 4100,\n zh_TW: 1028,\n zu_ZA: 1077,\n}\n\n// noinspection SpellCheckingInspection\nexport const langIdToName = {\n ab: \"Abkhaz\",\n aa: \"Afar\",\n af: \"Afrikaans\",\n ak: \"Akan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n ar: \"Arabic\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n av: \"Avaric\",\n ae: \"Avestan\",\n ay: \"Aymara\",\n az: \"Azerbaijani\",\n bm: \"Bambara\",\n ba: \"Bashkir\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bh: \"Bihari\",\n bi: \"Bislama\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n ny: \"Chichewa\",\n zh: \"Chinese\",\n cv: \"Chuvash\",\n kw: \"Cornish\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n dv: \"Divehi\",\n nl: \"Dutch\",\n dz: \"Dzongkha\",\n en: \"English\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n ee: \"Ewe\",\n fo: \"Faroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French\",\n ff: \"Fula\",\n gl: \"Galician\",\n ka: \"Georgian\",\n de: \"German\",\n el: \"Greek\",\n gn: \"Guaraní\",\n gu: \"Gujarati\",\n ht: \"Haitian\",\n ha: \"Hausa\",\n he: \"Hebrew\",\n hz: \"Herero\",\n hi: \"Hindi\",\n ho: \"Hiri Motu\",\n hu: \"Hungarian\",\n ia: \"Interlingua\",\n id: \"Indonesian\",\n ie: \"Interlingue\",\n ga: \"Irish\",\n ig: \"Igbo\",\n ik: \"Inupiaq\",\n io: \"Ido\",\n is: \"Icelandic\",\n it: \"Italian\",\n iu: \"Inuktitut\",\n ja: \"Japanese\",\n jv: \"Javanese\",\n kl: \"Kalaallisut\",\n kn: \"Kannada\",\n kr: \"Kanuri\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ki: \"Kikuyu\",\n rw: \"Kinyarwanda\",\n ky: \"Kyrgyz\",\n kv: \"Komi\",\n kg: \"Kongo\",\n ko: \"Korean\",\n ku: \"Kurdish\",\n kj: \"Kwanyama\",\n la: \"Latin\",\n lb: \"Luxembourgish\",\n lg: \"Ganda\",\n li: \"Limburgish\",\n ln: \"Lingala\",\n lo: \"Lao\",\n lt: \"Lithuanian\",\n lu: \"Luba-Katanga\",\n lv: \"Latvian\",\n gv: \"Manx\",\n mk: \"Macedonian\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Māori\",\n mr: \"Marathi\",\n mh: \"Marshallese\",\n mn: \"Mongolian\",\n na: \"Nauru\",\n nv: \"Navajo\",\n nd: \"Northern Ndebele\",\n ne: \"Nepali\",\n ng: \"Ndonga\",\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n no: \"Norwegian\",\n ii: \"Nuosu\",\n nr: \"Southern Ndebele\",\n oc: \"Occitan\",\n oj: \"Ojibwe\",\n cu: \"Old Church Slavonic\",\n om: \"Oromo\",\n or: \"Oriya\",\n os: \"Ossetian\",\n pa: \"Panjabi\",\n pi: \"Pāli\",\n fa: \"Persian\",\n pl: \"Polish\",\n ps: \"Pashto\",\n pt: \"Portuguese\",\n qu: \"Quechua\",\n rm: \"Romansh\",\n rn: \"Kirundi\",\n ro: \"Romanian\",\n ru: \"Russian\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n se: \"Northern Sami\",\n sm: \"Samoan\",\n sg: \"Sango\",\n sr: \"Serbian\",\n gd: \"Gaelic\",\n sn: \"Shona\",\n si: \"Sinhala\",\n sk: \"Slovak\",\n sl: \"Slovene\",\n so: \"Somali\",\n st: \"Southern Sotho\",\n es: \"Spanish\",\n su: \"Sundanese\",\n sw: \"Swahili\",\n ss: \"Swati\",\n sv: \"Swedish\",\n ta: \"Tamil\",\n te: \"Telugu\",\n tg: \"Tajik\",\n th: \"Thai\",\n ti: \"Tigrinya\",\n bo: \"Tibetan Standard\",\n tk: \"Turkmen\",\n tl: \"Tagalog\",\n tn: \"Tswana\",\n to: \"Tonga\",\n tr: \"Turkish\",\n ts: \"Tsonga\",\n tt: \"Tatar\",\n tw: \"Twi\",\n ty: \"Tahitian\",\n ug: \"Uyghur\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n uz: \"Uzbek\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapük\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n wo: \"Wolof\",\n fy: \"Western Frisian\",\n xh: \"Xhosa\",\n yi: \"Yiddish\",\n yo: \"Yoruba\",\n za: \"Zhuang\",\n zu: \"Zulu\",\n}\n"]}
1
+ {"version":3,"file":"langs.js","sourceRoot":"","sources":["../../src/util/langs.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;CACR,CAAA;AAED,uCAAuC;AAEvC,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAA;AACtD,KAAK,MAAM,EAAE,IAAI,gBAAgB,EAAE,CAAC;IAClC,oBAAoB,CAAC,GAAG,CAAC,E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_PL\",\n \"uk_UA\",\n \"cs_CZ\",\n \"sk_SK\",\n \"hu_HU\",\n \"ar_SA\",\n \"he_IL\",\n \"tr_TR\",\n \"th_TH\",\n \"vi_VN\",\n]\n\n// todo \"ro_RO\" \"el_GR\" \"et_EE\" \"ka_GE\"\n\nconst langToLangWithRegion = new Map<string, string>()\nfor (const id of bundledLanguages) {\n langToLangWithRegion.set(id.substring(0, id.indexOf(\"_\")), id)\n}\n\nexport function toLangWithRegion(lang: string): string {\n if (lang.includes(\"_\")) {\n return lang\n }\n\n lang = lang.toLowerCase()\n\n const result = langToLangWithRegion.get(lang)\n return result == null ? `${lang}_${lang.toUpperCase()}` : result\n}\n\nexport const lcid: any = {\n af_ZA: 1078,\n am_ET: 1118,\n ar_AE: 14337,\n ar_BH: 15361,\n ar_DZ: 5121,\n ar_EG: 3073,\n ar_IQ: 2049,\n ar_JO: 11265,\n ar_KW: 13313,\n ar_LB: 12289,\n ar_LY: 4097,\n ar_MA: 6145,\n ar_OM: 8193,\n ar_QA: 16385,\n ar_SA: 1025,\n ar_SY: 10241,\n ar_TN: 7169,\n ar_YE: 9217,\n arn_CL: 1146,\n as_IN: 1101,\n az_AZ: 2092,\n ba_RU: 1133,\n be_BY: 1059,\n bg_BG: 1026,\n bn_IN: 1093,\n bo_BT: 2129,\n bo_CN: 1105,\n br_FR: 1150,\n bs_BA: 8218,\n ca_ES: 1027,\n co_FR: 1155,\n cs_CZ: 1029,\n cy_GB: 1106,\n da_DK: 1030,\n de_AT: 3079,\n de_CH: 2055,\n de_DE: 1031,\n de_LI: 5127,\n de_LU: 4103,\n div_MV: 1125,\n dsb_DE: 2094,\n el_GR: 1032,\n en_AU: 3081,\n en_BZ: 10249,\n en_CA: 4105,\n en_CB: 9225,\n en_GB: 2057,\n en_IE: 6153,\n en_IN: 18441,\n en_JA: 8201,\n en_MY: 17417,\n en_NZ: 5129,\n en_PH: 13321,\n en_TT: 11273,\n en_US: 1033,\n en_ZA: 7177,\n en_ZW: 12297,\n es_AR: 11274,\n es_BO: 16394,\n es_CL: 13322,\n es_CO: 9226,\n es_CR: 5130,\n es_DO: 7178,\n es_EC: 12298,\n es_ES: 3082,\n es_GT: 4106,\n es_HN: 18442,\n es_MX: 2058,\n es_NI: 19466,\n es_PA: 6154,\n es_PE: 10250,\n es_PR: 20490,\n es_PY: 15370,\n es_SV: 17418,\n es_UR: 14346,\n es_US: 21514,\n es_VE: 8202,\n et_EE: 1061,\n eu_ES: 1069,\n fa_IR: 1065,\n fi_FI: 1035,\n fil_PH: 1124,\n fo_FO: 1080,\n fr_BE: 2060,\n fr_CA: 3084,\n fr_CH: 4108,\n fr_FR: 1036,\n fr_LU: 5132,\n fr_MC: 6156,\n fy_NL: 1122,\n ga_IE: 2108,\n gbz_AF: 1164,\n gl_ES: 1110,\n gsw_FR: 1156,\n gu_IN: 1095,\n ha_NG: 1128,\n he_IL: 1037,\n hi_IN: 1081,\n hr_BA: 4122,\n hr_HR: 1050,\n hu_HU: 1038,\n hy_AM: 1067,\n id_ID: 1057,\n ii_CN: 1144,\n is_IS: 1039,\n it_CH: 2064,\n it_IT: 1040,\n iu_CA: 2141,\n ja_JP: 1041,\n ka_GE: 1079,\n kh_KH: 1107,\n kk_KZ: 1087,\n kl_GL: 1135,\n kn_IN: 1099,\n ko_KR: 1042,\n kok_IN: 1111,\n ky_KG: 1088,\n lb_LU: 1134,\n lo_LA: 1108,\n lt_LT: 1063,\n lv_LV: 1062,\n mi_NZ: 1153,\n mk_MK: 1071,\n ml_IN: 1100,\n mn_CN: 2128,\n mn_MN: 1104,\n moh_CA: 1148,\n mr_IN: 1102,\n ms_BN: 2110,\n ms_MY: 1086,\n mt_MT: 1082,\n my_MM: 1109,\n nb_NO: 1044,\n ne_NP: 1121,\n nl_BE: 2067,\n nl_NL: 1043,\n nn_NO: 2068,\n ns_ZA: 1132,\n oc_FR: 1154,\n or_IN: 1096,\n pa_IN: 1094,\n pl_PL: 1045,\n ps_AF: 1123,\n pt_BR: 1046,\n pt_PT: 2070,\n qut_GT: 1158,\n quz_BO: 1131,\n quz_EC: 2155,\n quz_PE: 3179,\n rm_CH: 1047,\n ro_RO: 1048,\n ru_RU: 1049,\n rw_RW: 1159,\n sa_IN: 1103,\n sah_RU: 1157,\n se_FI: 3131,\n se_NO: 1083,\n se_SE: 2107,\n si_LK: 1115,\n sk_SK: 1051,\n sl_SI: 1060,\n sma_NO: 6203,\n sma_SE: 7227,\n smj_NO: 4155,\n smj_SE: 5179,\n smn_FI: 9275,\n sms_FI: 8251,\n sq_AL: 1052,\n sr_BA: 7194,\n sr_SP: 3098,\n sv_FI: 2077,\n sv_SE: 1053,\n sw_KE: 1089,\n syr_SY: 1114,\n ta_IN: 1097,\n te_IN: 1098,\n tg_TJ: 1064,\n th_TH: 1054,\n tk_TM: 1090,\n tmz_DZ: 2143,\n tn_ZA: 1074,\n tr_TR: 1055,\n tt_RU: 1092,\n ug_CN: 1152,\n uk_UA: 1058,\n ur_IN: 2080,\n ur_PK: 1056,\n uz_UZ: 2115,\n vi_VN: 1066,\n wen_DE: 1070,\n wo_SN: 1160,\n xh_ZA: 1076,\n yo_NG: 1130,\n zh_CHS: 4,\n zh_CHT: 31748,\n zh_CN: 2052,\n zh_HK: 3076,\n zh_MO: 5124,\n zh_SG: 4100,\n zh_TW: 1028,\n zu_ZA: 1077,\n}\n\n// noinspection SpellCheckingInspection\nexport const langIdToName = {\n ab: \"Abkhaz\",\n aa: \"Afar\",\n af: \"Afrikaans\",\n ak: \"Akan\",\n sq: \"Albanian\",\n am: \"Amharic\",\n ar: \"Arabic\",\n an: \"Aragonese\",\n hy: \"Armenian\",\n as: \"Assamese\",\n av: \"Avaric\",\n ae: \"Avestan\",\n ay: \"Aymara\",\n az: \"Azerbaijani\",\n bm: \"Bambara\",\n ba: \"Bashkir\",\n eu: \"Basque\",\n be: \"Belarusian\",\n bn: \"Bengali\",\n bh: \"Bihari\",\n bi: \"Bislama\",\n bs: \"Bosnian\",\n br: \"Breton\",\n bg: \"Bulgarian\",\n my: \"Burmese\",\n ca: \"Catalan\",\n ch: \"Chamorro\",\n ce: \"Chechen\",\n ny: \"Chichewa\",\n zh: \"Chinese\",\n cv: \"Chuvash\",\n kw: \"Cornish\",\n co: \"Corsican\",\n cr: \"Cree\",\n hr: \"Croatian\",\n cs: \"Czech\",\n da: \"Danish\",\n dv: \"Divehi\",\n nl: \"Dutch\",\n dz: \"Dzongkha\",\n en: \"English\",\n eo: \"Esperanto\",\n et: \"Estonian\",\n ee: \"Ewe\",\n fo: \"Faroese\",\n fj: \"Fijian\",\n fi: \"Finnish\",\n fr: \"French\",\n ff: \"Fula\",\n gl: \"Galician\",\n ka: \"Georgian\",\n de: \"German\",\n el: \"Greek\",\n gn: \"Guaraní\",\n gu: \"Gujarati\",\n ht: \"Haitian\",\n ha: \"Hausa\",\n he: \"Hebrew\",\n hz: \"Herero\",\n hi: \"Hindi\",\n ho: \"Hiri Motu\",\n hu: \"Hungarian\",\n ia: \"Interlingua\",\n id: \"Indonesian\",\n ie: \"Interlingue\",\n ga: \"Irish\",\n ig: \"Igbo\",\n ik: \"Inupiaq\",\n io: \"Ido\",\n is: \"Icelandic\",\n it: \"Italian\",\n iu: \"Inuktitut\",\n ja: \"Japanese\",\n jv: \"Javanese\",\n kl: \"Kalaallisut\",\n kn: \"Kannada\",\n kr: \"Kanuri\",\n ks: \"Kashmiri\",\n kk: \"Kazakh\",\n km: \"Khmer\",\n ki: \"Kikuyu\",\n rw: \"Kinyarwanda\",\n ky: \"Kyrgyz\",\n kv: \"Komi\",\n kg: \"Kongo\",\n ko: \"Korean\",\n ku: \"Kurdish\",\n kj: \"Kwanyama\",\n la: \"Latin\",\n lb: \"Luxembourgish\",\n lg: \"Ganda\",\n li: \"Limburgish\",\n ln: \"Lingala\",\n lo: \"Lao\",\n lt: \"Lithuanian\",\n lu: \"Luba-Katanga\",\n lv: \"Latvian\",\n gv: \"Manx\",\n mk: \"Macedonian\",\n mg: \"Malagasy\",\n ms: \"Malay\",\n ml: \"Malayalam\",\n mt: \"Maltese\",\n mi: \"Māori\",\n mr: \"Marathi\",\n mh: \"Marshallese\",\n mn: \"Mongolian\",\n na: \"Nauru\",\n nv: \"Navajo\",\n nd: \"Northern Ndebele\",\n ne: \"Nepali\",\n ng: \"Ndonga\",\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n no: \"Norwegian\",\n ii: \"Nuosu\",\n nr: \"Southern Ndebele\",\n oc: \"Occitan\",\n oj: \"Ojibwe\",\n cu: \"Old Church Slavonic\",\n om: \"Oromo\",\n or: \"Oriya\",\n os: \"Ossetian\",\n pa: \"Panjabi\",\n pi: \"Pāli\",\n fa: \"Persian\",\n pl: \"Polish\",\n ps: \"Pashto\",\n pt: \"Portuguese\",\n qu: \"Quechua\",\n rm: \"Romansh\",\n rn: \"Kirundi\",\n ro: \"Romanian\",\n ru: \"Russian\",\n sa: \"Sanskrit\",\n sc: \"Sardinian\",\n sd: \"Sindhi\",\n se: \"Northern Sami\",\n sm: \"Samoan\",\n sg: \"Sango\",\n sr: \"Serbian\",\n gd: \"Gaelic\",\n sn: \"Shona\",\n si: \"Sinhala\",\n sk: \"Slovak\",\n sl: \"Slovene\",\n so: \"Somali\",\n st: \"Southern Sotho\",\n es: \"Spanish\",\n su: \"Sundanese\",\n sw: \"Swahili\",\n ss: \"Swati\",\n sv: \"Swedish\",\n ta: \"Tamil\",\n te: \"Telugu\",\n tg: \"Tajik\",\n th: \"Thai\",\n ti: \"Tigrinya\",\n bo: \"Tibetan Standard\",\n tk: \"Turkmen\",\n tl: \"Tagalog\",\n tn: \"Tswana\",\n to: \"Tonga\",\n tr: \"Turkish\",\n ts: \"Tsonga\",\n tt: \"Tatar\",\n tw: \"Twi\",\n ty: \"Tahitian\",\n ug: \"Uyghur\",\n uk: \"Ukrainian\",\n ur: \"Urdu\",\n uz: \"Uzbek\",\n ve: \"Venda\",\n vi: \"Vietnamese\",\n vo: \"Volapük\",\n wa: \"Walloon\",\n cy: \"Welsh\",\n wo: \"Wolof\",\n fy: \"Western Frisian\",\n xh: \"Xhosa\",\n yi: \"Yiddish\",\n yo: \"Yoruba\",\n za: \"Zhuang\",\n zu: \"Zulu\",\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/util/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC;;;;;IAmBzF;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAC/B,kBAAkB,GAAE,KAAK,CAAC,MAAM,CAA0B,GACzD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYxB;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAQlG;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
1
+ {"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/util/license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC;;;;;IAsBzF;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,GAAG,OAAO,EACxB,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAC/B,kBAAkB,GAAE,KAAK,CAAC,MAAM,CAA0B,GACzD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYxB;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAQlG;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
@@ -8,7 +8,10 @@ export function getLicenseAssets(fileNames, packager) {
8
8
  return aW === bW ? a.localeCompare(b) : aW - bW;
9
9
  })
10
10
  .map(file => {
11
- let lang = /_([^.]+)\./.exec(file)[1];
11
+ // Linear parse (first `_` → first `.` after it) avoids the polynomial backtracking of /_([^.]+)\./
12
+ const underscore = file.indexOf("_");
13
+ const dot = file.indexOf(".", underscore + 1);
14
+ let lang = file.substring(underscore + 1, dot);
12
15
  let langWithRegion;
13
16
  if (lang.includes("_")) {
14
17
  langWithRegion = lang;
@@ -1 +1 @@
1
- {"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/util/license.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,UAAU,gBAAgB,CAAC,SAAwB,EAAE,QAA+B;IACxF,OAAO,SAAS;SACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QACtC,MAAM,EAAE,GAAG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AG,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,EAAE,CAAC,CAAA;YAClD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;YAClD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAA+B;IACnE,OAAO,gBAAgB,CACrB,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,EAAE,CAAA;QAC7B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IAChJ,CAAC,CAAC,EACF,QAAQ,CACT,CAAA;AACH,CAAC","sourcesContent":["import { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { langIdToName, toLangWithRegion } from \"./langs.js\"\n\nexport function getLicenseAssets(fileNames: Array<string>, packager: PlatformPackager<any>) {\n return fileNames\n .sort((a, b) => {\n const aW = a.includes(\"_en\") ? 0 : 100\n const bW = b.includes(\"_en\") ? 0 : 100\n return aW === bW ? a.localeCompare(b) : aW - bW\n })\n .map(file => {\n let lang = /_([^.]+)\\./.exec(file)![1]\n let langWithRegion\n if (lang.includes(\"_\")) {\n langWithRegion = lang\n lang = langWithRegion.substring(0, lang.indexOf(\"_\"))\n } else {\n lang = lang.toLowerCase()\n langWithRegion = toLangWithRegion(lang)\n }\n return { file: path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (langIdToName as any)[lang] }\n })\n}\n\nexport async function getNotLocalizedLicenseFile(\n custom: string | Nullish,\n packager: PlatformPackager<any>,\n supportedExtension: Array<string> = [\"rtf\", \"txt\", \"html\"]\n): Promise<string | null> {\n const possibleFiles: Array<string> = []\n for (const name of [\"license\", \"eula\"]) {\n for (const ext of supportedExtension) {\n possibleFiles.push(`${name}.${ext}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext}`)\n possibleFiles.push(`${name}.${ext.toUpperCase()}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`)\n }\n }\n\n return await packager.getResource(custom, ...possibleFiles)\n}\n\nexport async function getLicenseFiles(packager: PlatformPackager<any>): Promise<Array<LicenseFile>> {\n return getLicenseAssets(\n (await packager.resourceList).filter(it => {\n const name = it.toLowerCase()\n return (name.startsWith(\"license_\") || name.startsWith(\"eula_\")) && (name.endsWith(\".rtf\") || name.endsWith(\".txt\") || name.endsWith(\".html\"))\n }),\n packager\n )\n}\n\nexport interface LicenseFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}\n"]}
1
+ {"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/util/license.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,UAAU,gBAAgB,CAAC,SAAwB,EAAE,QAA+B;IACxF,OAAO,SAAS;SACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ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":["import { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { langIdToName, toLangWithRegion } from \"./langs.js\"\n\nexport function getLicenseAssets(fileNames: Array<string>, packager: PlatformPackager<any>) {\n return fileNames\n .sort((a, b) => {\n const aW = a.includes(\"_en\") ? 0 : 100\n const bW = b.includes(\"_en\") ? 0 : 100\n return aW === bW ? a.localeCompare(b) : aW - bW\n })\n .map(file => {\n // Linear parse (first `_` → first `.` after it) avoids the polynomial backtracking of /_([^.]+)\\./\n const underscore = file.indexOf(\"_\")\n const dot = file.indexOf(\".\", underscore + 1)\n let lang = file.substring(underscore + 1, dot)\n let langWithRegion\n if (lang.includes(\"_\")) {\n langWithRegion = lang\n lang = langWithRegion.substring(0, lang.indexOf(\"_\"))\n } else {\n lang = lang.toLowerCase()\n langWithRegion = toLangWithRegion(lang)\n }\n return { file: path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (langIdToName as any)[lang] }\n })\n}\n\nexport async function getNotLocalizedLicenseFile(\n custom: string | Nullish,\n packager: PlatformPackager<any>,\n supportedExtension: Array<string> = [\"rtf\", \"txt\", \"html\"]\n): Promise<string | null> {\n const possibleFiles: Array<string> = []\n for (const name of [\"license\", \"eula\"]) {\n for (const ext of supportedExtension) {\n possibleFiles.push(`${name}.${ext}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext}`)\n possibleFiles.push(`${name}.${ext.toUpperCase()}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`)\n }\n }\n\n return await packager.getResource(custom, ...possibleFiles)\n}\n\nexport async function getLicenseFiles(packager: PlatformPackager<any>): Promise<Array<LicenseFile>> {\n return getLicenseAssets(\n (await packager.resourceList).filter(it => {\n const name = it.toLowerCase()\n return (name.startsWith(\"license_\") || name.startsWith(\"eula_\")) && (name.endsWith(\".rtf\") || name.endsWith(\".txt\") || name.endsWith(\".html\"))\n }),\n packager\n )\n}\n\nexport interface LicenseFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { TmpDir } from "builder-util";
1
2
  export interface AssetCatalogResult {
2
3
  assetCatalog: Buffer;
3
4
  icnsFile: Buffer;
@@ -7,5 +8,5 @@ export interface AssetCatalogResult {
7
8
  * @param inputPath The path to the `.icon` file
8
9
  * @returns The asset catalog and extra assets
9
10
  */
10
- export declare function generateAssetCatalogForIcon(inputPath: string): Promise<AssetCatalogResult>;
11
+ export declare function generateAssetCatalogForIcon(tmpDir: TmpDir, inputPath: string): Promise<AssetCatalogResult>;
11
12
  //# sourceMappingURL=macosIconComposer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"macosIconComposer.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAoCD;;;;GAIG;AACH,wBAAsB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8DhG"}
1
+ {"version":3,"file":"macosIconComposer.d.ts","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,MAAM,EAAE,MAAM,cAAc,CAAA;AAM5C,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAoCD;;;;GAIG;AACH,wBAAsB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+ChH"}
@@ -1,7 +1,6 @@
1
1
  // Adapted from https://github.com/electron/packager/pull/1806
2
2
  import { spawn } from "builder-util";
3
3
  import * as fs from "fs/promises";
4
- import * as os from "node:os";
5
4
  import * as path from "node:path";
6
5
  import plist from "plist";
7
6
  import * as semver from "semver";
@@ -38,62 +37,45 @@ async function checkActoolVersion(tmpDir) {
38
37
  * @param inputPath The path to the `.icon` file
39
38
  * @returns The asset catalog and extra assets
40
39
  */
41
- export async function generateAssetCatalogForIcon(inputPath) {
42
- const tmpDir = await fs.mkdtemp(path.resolve(os.tmpdir(), "icon-compile-"));
43
- const cleanup = async () => {
44
- await fs.rm(tmpDir, {
45
- recursive: true,
46
- force: true,
47
- });
48
- };
49
- try {
50
- await checkActoolVersion(tmpDir);
51
- }
52
- catch (error) {
53
- await cleanup();
54
- throw error;
55
- }
56
- const iconPath = path.resolve(tmpDir, "Icon.icon");
57
- const outputPath = path.resolve(tmpDir, "out");
58
- try {
59
- await fs.cp(inputPath, iconPath, {
60
- recursive: true,
61
- });
62
- await fs.mkdir(outputPath, {
63
- recursive: true,
64
- });
65
- await spawn("actool", [
66
- iconPath,
67
- "--compile",
68
- outputPath,
69
- "--output-format",
70
- "human-readable-text",
71
- "--notices",
72
- "--warnings",
73
- "--output-partial-info-plist",
74
- path.resolve(outputPath, "assetcatalog_generated_info.plist"),
75
- "--app-icon",
76
- "Icon",
77
- "--include-all-app-icons",
78
- "--accent-color",
79
- "AccentColor",
80
- "--enable-on-demand-resources",
81
- "NO",
82
- "--development-region",
83
- "en",
84
- "--target-device",
85
- "mac",
86
- "--minimum-deployment-target",
87
- "26.0",
88
- "--platform",
89
- "macosx",
90
- ]);
91
- const assetCatalog = await fs.readFile(path.resolve(outputPath, "Assets.car"));
92
- const icnsFile = await fs.readFile(path.resolve(outputPath, "Icon.icns"));
93
- return { assetCatalog, icnsFile };
94
- }
95
- finally {
96
- await cleanup();
97
- }
40
+ export async function generateAssetCatalogForIcon(tmpDir, inputPath) {
41
+ const tmpDirPath = await tmpDir.createTempDir({ prefix: "macos-icon-composer" });
42
+ await checkActoolVersion(tmpDirPath);
43
+ const iconPath = path.resolve(tmpDirPath, "Icon.icon");
44
+ const outputPath = path.resolve(tmpDirPath, "out");
45
+ await fs.cp(inputPath, iconPath, {
46
+ recursive: true,
47
+ });
48
+ await fs.mkdir(outputPath, {
49
+ recursive: true,
50
+ });
51
+ await spawn("actool", [
52
+ iconPath,
53
+ "--compile",
54
+ outputPath,
55
+ "--output-format",
56
+ "human-readable-text",
57
+ "--notices",
58
+ "--warnings",
59
+ "--output-partial-info-plist",
60
+ path.resolve(outputPath, "assetcatalog_generated_info.plist"),
61
+ "--app-icon",
62
+ "Icon",
63
+ "--include-all-app-icons",
64
+ "--accent-color",
65
+ "AccentColor",
66
+ "--enable-on-demand-resources",
67
+ "NO",
68
+ "--development-region",
69
+ "en",
70
+ "--target-device",
71
+ "mac",
72
+ "--minimum-deployment-target",
73
+ "26.0",
74
+ "--platform",
75
+ "macosx",
76
+ ]);
77
+ const assetCatalog = await fs.readFile(path.resolve(outputPath, "Assets.car"));
78
+ const icnsFile = await fs.readFile(path.resolve(outputPath, "Icon.icns"));
79
+ return { assetCatalog, icnsFile };
98
80
  }
99
81
  //# sourceMappingURL=macosIconComposer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"macosIconComposer.js","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAE9D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAOhC,MAAM,4BAA4B,GAAG,IAAI,KAAK,CAC5C,qIAAqI,CACtI,CAAA;AAED,KAAK,UAAU,kBAAkB,CAAC,MAAc;IAC9C,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAE/D,IAAI,WAAW,GAAuD,SAAS,CAAA;IAE/E,IAAI,gBAAgB,GAA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AAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;QAC9E,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;QAEzE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;IACnC,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAA;IACjB,CAAC;AACH,CAAC","sourcesContent":["// Adapted from https://github.com/electron/packager/pull/1806\n\nimport { spawn } from \"builder-util\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"node:os\"\nimport * as path from \"node:path\"\nimport plist from \"plist\"\nimport * as semver from \"semver\"\n\nexport interface AssetCatalogResult {\n assetCatalog: Buffer\n icnsFile: Buffer\n}\n\nconst INVALID_ACTOOL_VERSION_ERROR = new Error(\n \"Failed to check actool version. Is Xcode 26 or higher installed? See output of the `actool --version` CLI command for more details.\"\n)\n\nasync function checkActoolVersion(tmpDir: string) {\n const acToolOutputFileName = path.resolve(tmpDir, \"actool.log\")\n\n let versionInfo: Record<string, Record<string, string>> | undefined = undefined\n\n let acToolOutputFile: fs.FileHandle | null = null\n let errorQueued: Error | null = null\n try {\n acToolOutputFile = await fs.open(acToolOutputFileName, \"w\")\n await spawn(\"actool\", [\"--version\"], { stdio: [\"ignore\", acToolOutputFile.fd, acToolOutputFile.fd] })\n const acToolVersionOutput = await fs.readFile(acToolOutputFileName, \"utf8\")\n versionInfo = plist.parse(acToolVersionOutput) as Record<string, Record<string, string>>\n } catch (e: any) {\n errorQueued = e\n } finally {\n if (acToolOutputFile) {\n await acToolOutputFile.close()\n }\n }\n\n if (errorQueued || !versionInfo || !versionInfo[\"com.apple.actool.version\"] || !versionInfo[\"com.apple.actool.version\"][\"short-bundle-version\"]) {\n throw INVALID_ACTOOL_VERSION_ERROR\n }\n\n const acToolVersion = versionInfo[\"com.apple.actool.version\"][\"short-bundle-version\"]\n if (!semver.gte(semver.coerce(acToolVersion)!, \"26.0.0\")) {\n throw new Error(`Unsupported actool version. Must be on actool 26.0.0 or higher but found ${acToolVersion}. Install Xcode 26 or higher to get a supported version of actool.`)\n }\n}\n\n/**\n * Generates an asset catalog and extra assets that are useful for packaging the app.\n * @param inputPath The path to the `.icon` file\n * @returns The asset catalog and extra assets\n */\nexport async function generateAssetCatalogForIcon(inputPath: string): Promise<AssetCatalogResult> {\n const tmpDir = await fs.mkdtemp(path.resolve(os.tmpdir(), \"icon-compile-\"))\n const cleanup = async () => {\n await fs.rm(tmpDir, {\n recursive: true,\n force: true,\n })\n }\n\n try {\n await checkActoolVersion(tmpDir)\n } catch (error) {\n await cleanup()\n throw error\n }\n\n const iconPath = path.resolve(tmpDir, \"Icon.icon\")\n const outputPath = path.resolve(tmpDir, \"out\")\n\n try {\n await fs.cp(inputPath, iconPath, {\n recursive: true,\n })\n\n await fs.mkdir(outputPath, {\n recursive: true,\n })\n\n await spawn(\"actool\", [\n iconPath,\n \"--compile\",\n outputPath,\n \"--output-format\",\n \"human-readable-text\",\n \"--notices\",\n \"--warnings\",\n \"--output-partial-info-plist\",\n path.resolve(outputPath, \"assetcatalog_generated_info.plist\"),\n \"--app-icon\",\n \"Icon\",\n \"--include-all-app-icons\",\n \"--accent-color\",\n \"AccentColor\",\n \"--enable-on-demand-resources\",\n \"NO\",\n \"--development-region\",\n \"en\",\n \"--target-device\",\n \"mac\",\n \"--minimum-deployment-target\",\n \"26.0\",\n \"--platform\",\n \"macosx\",\n ])\n\n const assetCatalog = await fs.readFile(path.resolve(outputPath, \"Assets.car\"))\n const icnsFile = await fs.readFile(path.resolve(outputPath, \"Icon.icns\"))\n\n return { assetCatalog, icnsFile }\n } finally {\n await cleanup()\n }\n}\n"]}
1
+ {"version":3,"file":"macosIconComposer.js","sourceRoot":"","sources":["../../../src/util/mac/macosIconComposer.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAE9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sB;QACtB,IAAI;QACJ,iBAAiB;QACjB,KAAK;QACL,6BAA6B;QAC7B,MAAM;QACN,YAAY;QACZ,QAAQ;KACT,CAAC,CAAA;IAEF,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;IAC9E,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;IAEzE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AACnC,CAAC","sourcesContent":["// Adapted from https://github.com/electron/packager/pull/1806\n\nimport { spawn, TmpDir } from \"builder-util\"\nimport * as fs from \"fs/promises\"\nimport * as path from \"node:path\"\nimport plist from \"plist\"\nimport * as semver from \"semver\"\n\nexport interface AssetCatalogResult {\n assetCatalog: Buffer\n icnsFile: Buffer\n}\n\nconst INVALID_ACTOOL_VERSION_ERROR = new Error(\n \"Failed to check actool version. Is Xcode 26 or higher installed? See output of the `actool --version` CLI command for more details.\"\n)\n\nasync function checkActoolVersion(tmpDir: string) {\n const acToolOutputFileName = path.resolve(tmpDir, \"actool.log\")\n\n let versionInfo: Record<string, Record<string, string>> | undefined = undefined\n\n let acToolOutputFile: fs.FileHandle | null = null\n let errorQueued: Error | null = null\n try {\n acToolOutputFile = await fs.open(acToolOutputFileName, \"w\")\n await spawn(\"actool\", [\"--version\"], { stdio: [\"ignore\", acToolOutputFile.fd, acToolOutputFile.fd] })\n const acToolVersionOutput = await fs.readFile(acToolOutputFileName, \"utf8\")\n versionInfo = plist.parse(acToolVersionOutput) as Record<string, Record<string, string>>\n } catch (e: any) {\n errorQueued = e\n } finally {\n if (acToolOutputFile) {\n await acToolOutputFile.close()\n }\n }\n\n if (errorQueued || !versionInfo || !versionInfo[\"com.apple.actool.version\"] || !versionInfo[\"com.apple.actool.version\"][\"short-bundle-version\"]) {\n throw INVALID_ACTOOL_VERSION_ERROR\n }\n\n const acToolVersion = versionInfo[\"com.apple.actool.version\"][\"short-bundle-version\"]\n if (!semver.gte(semver.coerce(acToolVersion)!, \"26.0.0\")) {\n throw new Error(`Unsupported actool version. Must be on actool 26.0.0 or higher but found ${acToolVersion}. Install Xcode 26 or higher to get a supported version of actool.`)\n }\n}\n\n/**\n * Generates an asset catalog and extra assets that are useful for packaging the app.\n * @param inputPath The path to the `.icon` file\n * @returns The asset catalog and extra assets\n */\nexport async function generateAssetCatalogForIcon(tmpDir: TmpDir, inputPath: string): Promise<AssetCatalogResult> {\n const tmpDirPath = await tmpDir.createTempDir({ prefix: \"macos-icon-composer\" })\n\n await checkActoolVersion(tmpDirPath)\n\n const iconPath = path.resolve(tmpDirPath, \"Icon.icon\")\n const outputPath = path.resolve(tmpDirPath, \"out\")\n\n await fs.cp(inputPath, iconPath, {\n recursive: true,\n })\n\n await fs.mkdir(outputPath, {\n recursive: true,\n })\n\n await spawn(\"actool\", [\n iconPath,\n \"--compile\",\n outputPath,\n \"--output-format\",\n \"human-readable-text\",\n \"--notices\",\n \"--warnings\",\n \"--output-partial-info-plist\",\n path.resolve(outputPath, \"assetcatalog_generated_info.plist\"),\n \"--app-icon\",\n \"Icon\",\n \"--include-all-app-icons\",\n \"--accent-color\",\n \"AccentColor\",\n \"--enable-on-demand-resources\",\n \"NO\",\n \"--development-region\",\n \"en\",\n \"--target-device\",\n \"mac\",\n \"--minimum-deployment-target\",\n \"26.0\",\n \"--platform\",\n \"macosx\",\n ])\n\n const assetCatalog = await fs.readFile(path.resolve(outputPath, \"Assets.car\"))\n const icnsFile = await fs.readFile(path.resolve(outputPath, \"Icon.icns\"))\n\n return { assetCatalog, icnsFile }\n}\n"]}
@@ -0,0 +1,47 @@
1
+ export interface StreamSpawnResult {
2
+ /** The child's exit code (null if it was killed by a signal). */
3
+ code: number | null;
4
+ /** Everything the child wrote to stderr, accumulated. */
5
+ stderr: string;
6
+ }
7
+ /**
8
+ * Spawns a command and streams its stdout to a file, returning the exit code and captured stderr.
9
+ *
10
+ * stdout is piped straight to `outputFile` (never buffered in memory), so arbitrarily large output —
11
+ * a full dependency tree, a verbose `install` log — costs no heap. stderr is small by comparison and
12
+ * is accumulated so the caller can surface it on failure.
13
+ *
14
+ * On Windows the package-manager command is typically a `.cmd` shim (npm.cmd/pnpm.cmd/yarn.cmd),
15
+ * which Node can no longer spawn directly (CVE-2024-27980). Rather than spawn with `shell: true` —
16
+ * which emits the DEP0190 "args with shell" deprecation warning and forces manual metacharacter
17
+ * escaping — wrap the invocation in a single PowerShell `-EncodedCommand`. The base64 (UTF-16LE)
18
+ * payload sidesteps every shell-quoting layer, and `powershell.exe` is a real executable we spawn
19
+ * directly with no shell. See buildPowerShellEncodedArgs for the UTF-8 / exit-code handling. This
20
+ * also avoids the cmd.exe "The batch file cannot be found." re-open race that plagues `.cmd` shims.
21
+ *
22
+ * Resolves with `{ code, stderr }` for ANY exit code — interpreting a non-zero code is the caller's
23
+ * job (e.g. `npm list` returns 1 in expected scenarios). Only genuine infrastructure failures —
24
+ * spawn errors and write-stream errors — reject.
25
+ *
26
+ * @param command - The command to execute
27
+ * @param args - Array of command-line arguments
28
+ * @param cwd - The working directory to execute the command in
29
+ * @param outputFile - The path to the file where stdout will be streamed
30
+ * @param env - The environment for the child process (callers are responsible for stripping secrets)
31
+ */
32
+ export declare function streamSpawnToFile(command: string, args: string[], cwd: string, outputFile: string, env: NodeJS.ProcessEnv): Promise<StreamSpawnResult>;
33
+ /**
34
+ * Build the argv for invoking a Windows command through `powershell.exe -EncodedCommand`.
35
+ *
36
+ * Each token is wrapped in a PowerShell single-quoted string (with embedded single quotes doubled),
37
+ * so no character is interpreted by a shell. The script:
38
+ * - pins `[Console]::OutputEncoding` to UTF-8 *without* a BOM so the JSON dependency tree is not
39
+ * corrupted by the console's OEM code page (and no BOM is prepended to break `JSON.parse`),
40
+ * - invokes the command via the call operator `&`,
41
+ * - re-emits the command's own exit code via `exit $LASTEXITCODE` (e.g. `npm list` returns 1 in
42
+ * expected scenarios, which the caller's shouldIgnore logic relies on).
43
+ *
44
+ * The whole script is base64-encoded as UTF-16LE per PowerShell's `-EncodedCommand` contract.
45
+ */
46
+ export declare function buildPowerShellEncodedArgs(command: string, args: string[]): string[];
47
+ //# sourceMappingURL=streamSpawnToFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamSpawnToFile.d.ts","sourceRoot":"","sources":["../../src/util/streamSpawnToFile.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAkEtJ;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAMpF"}
@@ -0,0 +1,110 @@
1
+ import * as childProcess from "child_process";
2
+ import { createWriteStream } from "node:fs";
3
+ /**
4
+ * Spawns a command and streams its stdout to a file, returning the exit code and captured stderr.
5
+ *
6
+ * stdout is piped straight to `outputFile` (never buffered in memory), so arbitrarily large output —
7
+ * a full dependency tree, a verbose `install` log — costs no heap. stderr is small by comparison and
8
+ * is accumulated so the caller can surface it on failure.
9
+ *
10
+ * On Windows the package-manager command is typically a `.cmd` shim (npm.cmd/pnpm.cmd/yarn.cmd),
11
+ * which Node can no longer spawn directly (CVE-2024-27980). Rather than spawn with `shell: true` —
12
+ * which emits the DEP0190 "args with shell" deprecation warning and forces manual metacharacter
13
+ * escaping — wrap the invocation in a single PowerShell `-EncodedCommand`. The base64 (UTF-16LE)
14
+ * payload sidesteps every shell-quoting layer, and `powershell.exe` is a real executable we spawn
15
+ * directly with no shell. See buildPowerShellEncodedArgs for the UTF-8 / exit-code handling. This
16
+ * also avoids the cmd.exe "The batch file cannot be found." re-open race that plagues `.cmd` shims.
17
+ *
18
+ * Resolves with `{ code, stderr }` for ANY exit code — interpreting a non-zero code is the caller's
19
+ * job (e.g. `npm list` returns 1 in expected scenarios). Only genuine infrastructure failures —
20
+ * spawn errors and write-stream errors — reject.
21
+ *
22
+ * @param command - The command to execute
23
+ * @param args - Array of command-line arguments
24
+ * @param cwd - The working directory to execute the command in
25
+ * @param outputFile - The path to the file where stdout will be streamed
26
+ * @param env - The environment for the child process (callers are responsible for stripping secrets)
27
+ */
28
+ export function streamSpawnToFile(command, args, cwd, outputFile, env) {
29
+ const [spawnCommand, spawnArgs] = process.platform === "win32" ? ["powershell.exe", buildPowerShellEncodedArgs(command, args)] : [command, args];
30
+ return new Promise((resolve, reject) => {
31
+ const outStream = createWriteStream(outputFile);
32
+ const child = childProcess.spawn(spawnCommand, spawnArgs, { cwd, env });
33
+ let stderr = "";
34
+ // The process can close before all piped stdout has been flushed to disk. Resolving on the
35
+ // child's "close" alone races the write stream and lets the caller read a TRUNCATED file
36
+ // (manifesting as "No JSON content found in output"). Gate the settle on BOTH the child exit
37
+ // (for the code/stderr) and the write stream's "finish" (all bytes flushed).
38
+ let exitCode = null;
39
+ let childClosed = false;
40
+ let streamFinished = false;
41
+ let settled = false;
42
+ // `pipe` ends `outStream` when stdout EOFs, which triggers its "finish" once flushed.
43
+ child.stdout.pipe(outStream);
44
+ child.stderr.on("data", chunk => {
45
+ stderr += chunk.toString();
46
+ });
47
+ const fail = (err) => {
48
+ if (settled) {
49
+ return;
50
+ }
51
+ settled = true;
52
+ // Best-effort cleanup: stop the child and close the stream so we don't
53
+ // waste CPU writing to a broken fd after rejection.
54
+ try {
55
+ child.kill();
56
+ }
57
+ catch {
58
+ // ignore
59
+ }
60
+ try {
61
+ outStream.destroy();
62
+ }
63
+ catch {
64
+ // ignore
65
+ }
66
+ reject(err);
67
+ };
68
+ const settle = () => {
69
+ if (settled || !childClosed || !streamFinished) {
70
+ return;
71
+ }
72
+ settled = true;
73
+ resolve({ code: exitCode, stderr });
74
+ };
75
+ outStream.on("error", err => fail(new Error(`Failed writing process output (${command}): ${err.message}`)));
76
+ outStream.on("finish", () => {
77
+ streamFinished = true;
78
+ settle();
79
+ });
80
+ child.on("error", err => {
81
+ fail(new Error(`Process spawn (${command} ${JSON.stringify(args)}) failed: ${err.message}`));
82
+ });
83
+ child.on("close", code => {
84
+ exitCode = code;
85
+ childClosed = true;
86
+ settle();
87
+ });
88
+ });
89
+ }
90
+ /**
91
+ * Build the argv for invoking a Windows command through `powershell.exe -EncodedCommand`.
92
+ *
93
+ * Each token is wrapped in a PowerShell single-quoted string (with embedded single quotes doubled),
94
+ * so no character is interpreted by a shell. The script:
95
+ * - pins `[Console]::OutputEncoding` to UTF-8 *without* a BOM so the JSON dependency tree is not
96
+ * corrupted by the console's OEM code page (and no BOM is prepended to break `JSON.parse`),
97
+ * - invokes the command via the call operator `&`,
98
+ * - re-emits the command's own exit code via `exit $LASTEXITCODE` (e.g. `npm list` returns 1 in
99
+ * expected scenarios, which the caller's shouldIgnore logic relies on).
100
+ *
101
+ * The whole script is base64-encoded as UTF-16LE per PowerShell's `-EncodedCommand` contract.
102
+ */
103
+ export function buildPowerShellEncodedArgs(command, args) {
104
+ const psQuote = (value) => `'${value.replace(/'/g, "''")}'`;
105
+ const invocation = ["&", psQuote(command), ...args.map(psQuote)].join(" ");
106
+ const script = `[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new($false); ${invocation}; exit $LASTEXITCODE`;
107
+ const encoded = Buffer.from(script, "utf16le").toString("base64");
108
+ return ["-NoProfile", "-NonInteractive", "-EncodedCommand", encoded];
109
+ }
110
+ //# sourceMappingURL=streamSpaw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K,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;YACvB,QAAQ,GAAG,IAAI,CAAA;YACf,WAAW,GAAG,IAAI,CAAA;YAClB,MAAM,EAAE,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,IAAc;IACxE,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAA;IACnE,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC1E,MAAM,MAAM,GAAG,sEAAsE,UAAU,sBAAsB,CAAA;IACrH,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IACjE,OAAO,CAAC,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAA;AACtE,CAAC","sourcesContent":["import * as childProcess from \"child_process\"\nimport { createWriteStream } from \"node:fs\"\n\nexport interface StreamSpawnResult {\n /** The child's exit code (null if it was killed by a signal). */\n code: number | null\n /** Everything the child wrote to stderr, accumulated. */\n stderr: string\n}\n\n/**\n * Spawns a command and streams its stdout to a file, returning the exit code and captured stderr.\n *\n * stdout is piped straight to `outputFile` (never buffered in memory), so arbitrarily large output —\n * a full dependency tree, a verbose `install` log — costs no heap. stderr is small by comparison and\n * is accumulated so the caller can surface it on failure.\n *\n * On Windows the package-manager command is typically a `.cmd` shim (npm.cmd/pnpm.cmd/yarn.cmd),\n * which Node can no longer spawn directly (CVE-2024-27980). Rather than spawn with `shell: true` —\n * which emits the DEP0190 \"args with shell\" deprecation warning and forces manual metacharacter\n * escaping — wrap the invocation in a single PowerShell `-EncodedCommand`. The base64 (UTF-16LE)\n * payload sidesteps every shell-quoting layer, and `powershell.exe` is a real executable we spawn\n * directly with no shell. See buildPowerShellEncodedArgs for the UTF-8 / exit-code handling. This\n * also avoids the cmd.exe \"The batch file cannot be found.\" re-open race that plagues `.cmd` shims.\n *\n * Resolves with `{ code, stderr }` for ANY exit code — interpreting a non-zero code is the caller's\n * job (e.g. `npm list` returns 1 in expected scenarios). Only genuine infrastructure failures —\n * spawn errors and write-stream errors — reject.\n *\n * @param command - The command to execute\n * @param args - Array of command-line arguments\n * @param cwd - The working directory to execute the command in\n * @param outputFile - The path to the file where stdout will be streamed\n * @param env - The environment for the child process (callers are responsible for stripping secrets)\n */\nexport function streamSpawnToFile(command: string, args: string[], cwd: string, outputFile: string, env: NodeJS.ProcessEnv): Promise<StreamSpawnResult> {\n const [spawnCommand, spawnArgs] = process.platform === \"win32\" ? ([\"powershell.exe\", buildPowerShellEncodedArgs(command, args)] as const) : ([command, args] as const)\n\n return new Promise<StreamSpawnResult>((resolve, reject) => {\n const outStream = createWriteStream(outputFile)\n\n const child = childProcess.spawn(spawnCommand, spawnArgs, { cwd, env })\n\n let stderr = \"\"\n // The process can close before all piped stdout has been flushed to disk. Resolving on the\n // child's \"close\" alone races the write stream and lets the caller read a TRUNCATED file\n // (manifesting as \"No JSON content found in output\"). Gate the settle on BOTH the child exit\n // (for the code/stderr) and the write stream's \"finish\" (all bytes flushed).\n let exitCode: number | null = null\n let childClosed = false\n let streamFinished = false\n let settled = false\n\n // `pipe` ends `outStream` when stdout EOFs, which triggers its \"finish\" once flushed.\n child.stdout.pipe(outStream)\n child.stderr.on(\"data\", chunk => {\n stderr += chunk.toString()\n })\n\n const fail = (err: Error) => {\n if (settled) {\n return\n }\n settled = true\n // Best-effort cleanup: stop the child and close the stream so we don't\n // waste CPU writing to a broken fd after rejection.\n try {\n child.kill()\n } catch {\n // ignore\n }\n try {\n outStream.destroy()\n } catch {\n // ignore\n }\n reject(err)\n }\n\n const settle = () => {\n if (settled || !childClosed || !streamFinished) {\n return\n }\n settled = true\n resolve({ code: exitCode, stderr })\n }\n\n outStream.on(\"error\", err => fail(new Error(`Failed writing process output (${command}): ${err.message}`)))\n outStream.on(\"finish\", () => {\n streamFinished = true\n settle()\n })\n child.on(\"error\", err => {\n fail(new Error(`Process spawn (${command} ${JSON.stringify(args)}) failed: ${err.message}`))\n })\n child.on(\"close\", code => {\n exitCode = code\n childClosed = true\n settle()\n })\n })\n}\n\n/**\n * Build the argv for invoking a Windows command through `powershell.exe -EncodedCommand`.\n *\n * Each token is wrapped in a PowerShell single-quoted string (with embedded single quotes doubled),\n * so no character is interpreted by a shell. The script:\n * - pins `[Console]::OutputEncoding` to UTF-8 *without* a BOM so the JSON dependency tree is not\n * corrupted by the console's OEM code page (and no BOM is prepended to break `JSON.parse`),\n * - invokes the command via the call operator `&`,\n * - re-emits the command's own exit code via `exit $LASTEXITCODE` (e.g. `npm list` returns 1 in\n * expected scenarios, which the caller's shouldIgnore logic relies on).\n *\n * The whole script is base64-encoded as UTF-16LE per PowerShell's `-EncodedCommand` contract.\n */\nexport function buildPowerShellEncodedArgs(command: string, args: string[]): string[] {\n const psQuote = (value: string) => `'${value.replace(/'/g, \"''\")}'`\n const invocation = [\"&\", psQuote(command), ...args.map(psQuote)].join(\" \")\n const script = `[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new($false); ${invocation}; exit $LASTEXITCODE`\n const encoded = Buffer.from(script, \"utf16le\").toString(\"base64\")\n return [\"-NoProfile\", \"-NonInteractive\", \"-EncodedCommand\", encoded]\n}\n"]}
@@ -1,2 +1,4 @@
1
1
  export declare function withToolsetLock<T>(task: () => Promise<T>): Promise<T>;
2
+ export declare function withSigntoolLock<T>(task: () => Promise<T>): Promise<T>;
3
+ export declare function withIconsLock<T>(task: () => Promise<T>): Promise<T>;
2
4
  //# sourceMappingURL=toolsetLock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolsetLock.d.ts","sourceRoot":"","sources":["../../src/util/toolsetLock.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAW3E"}
1
+ {"version":3,"file":"toolsetLock.d.ts","sourceRoot":"","sources":["../../src/util/toolsetLock.ts"],"names":[],"mappings":"AAuBA,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAErE;AAUD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtE;AASD,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEnE"}
@@ -3,10 +3,12 @@ import { writeFile } from "fs/promises";
3
3
  import * as lockfile from "proper-lockfile";
4
4
  import * as os from "os";
5
5
  import * as path from "path";
6
- const LOCK_FILE = path.join(os.tmpdir(), ".electron-builder-toolset.lock");
7
- export async function withToolsetLock(task) {
8
- await writeFile(LOCK_FILE, "", { flag: "a" });
9
- const release = await lockfile.lock(LOCK_FILE, {
6
+ const TOOLSET_LOCK_FILE = path.join(os.tmpdir(), ".electron-builder-toolset.lock");
7
+ const SIGNTOOL_LOCK_FILE = path.join(os.tmpdir(), ".electron-builder-signtool.lock");
8
+ const ICONS_LOCK_FILE = path.join(os.tmpdir(), ".electron-builder-icons.lock");
9
+ async function withLock(lockFile, task) {
10
+ await writeFile(lockFile, "", { flag: "a" });
11
+ const release = await lockfile.lock(lockFile, {
10
12
  retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },
11
13
  stale: 120_000,
12
14
  });
@@ -14,7 +16,31 @@ export async function withToolsetLock(task) {
14
16
  return await task();
15
17
  }
16
18
  finally {
17
- await release().catch((err) => log.warn({ err }, "failed to release toolset lock"));
19
+ await release().catch((err) => log.warn({ err }, "failed to release lock"));
18
20
  }
19
21
  }
22
+ export function withToolsetLock(task) {
23
+ return withLock(TOOLSET_LOCK_FILE, task);
24
+ }
25
+ // `signtool sign /f <pfx>` imports the PFX via PFXImportCertStore, which mutates the per-user
26
+ // CryptoAPI/CNG key+cert storage — a process-global resource that is not safe for concurrent access.
27
+ // winPackager already serializes signing within a single packager (signingQueue), but parallel builds
28
+ // (e.g. the test harness running multiple packagers across vitest workers that share one Windows user
29
+ // profile) race on that shared store and intermittently fail, after cert selection, with
30
+ // "SignTool Error: An error occurred while attempting to load the signing certificate". A dedicated
31
+ // cross-process lock (separate from the toolset lock so it does not block MSI/Squirrel builds)
32
+ // serializes signtool invocations. No-op overhead for real single builds, which are already serial.
33
+ export function withSigntoolLock(task) {
34
+ return withLock(SIGNTOOL_LOCK_FILE, task);
35
+ }
36
+ // The icons toolset CLI (icon-tool.js) converts via a WebAssembly-backed image pipeline, and each
37
+ // invocation reserves a large `WebAssembly.Memory`. A single build converting one icon is fine, but
38
+ // parallel builds — most acutely the test harness running many packagers across forked vitest workers
39
+ // on one machine — spawn enough concurrent icon-tool processes to exhaust memory, failing with
40
+ // "WebAssembly.Memory(): could not allocate memory". A cross-process lock (separate from the toolset
41
+ // lock so it does not serialize against MSI/Squirrel/DMG builds) caps icon conversion at one at a
42
+ // time. No-op overhead for real single builds, which are already serial.
43
+ export function withIconsLock(task) {
44
+ return withLock(ICONS_LOCK_FILE, task);
45
+ }
20
46
  //# sourceMappingURL=toolsetLock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolsetLock.js","sourceRoot":"","sources":["../../src/util/toolsetLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,gCAAgC,CAAC,CAAA;AAE1E,MAAM,CAAC,KAAK,UAAU,eAAe,CAAI,IAAsB;IAC7D,MAAM,SAAS,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE;QAC7C,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC7D,KAAK,EAAE,OAAO;KACf,CAAC,CAAA;IACF,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAA;IACrB,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,gCAAgC,CAAC,CAAC,CAAA;IAC5F,CAAC;AACH,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { writeFile } from \"fs/promises\"\nimport * as lockfile from \"proper-lockfile\"\nimport * as os from \"os\"\nimport * as path from \"path\"\n\nconst LOCK_FILE = path.join(os.tmpdir(), \".electron-builder-toolset.lock\")\n\nexport async function withToolsetLock<T>(task: () => Promise<T>): Promise<T> {\n await writeFile(LOCK_FILE, \"\", { flag: \"a\" })\n const release = await lockfile.lock(LOCK_FILE, {\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120_000,\n })\n try {\n return await task()\n } finally {\n await release().catch((err: Error) => log.warn({ err }, \"failed to release toolset lock\"))\n }\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AAe,CAAI,IAAsB;IACvD,OAAO,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC;AAED,8FAA8F;AAC9F,qGAAqG;AACrG,sGAAsG;AACtG,sGAAsG;AACtG,yFAAyF;AACzF,oGAAoG;AACpG,+FAA+F;AAC/F,oGAAoG;AACpG,MAAM,UAAU,gBAAgB,CAAI,IAAsB;IACxD,OAAO,QAAQ,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAA;AAC3C,CAAC;AAED,kGAAkG;AAClG,oGAAoG;AACpG,sGAAsG;AACtG,+FAA+F;AAC/F,qGAAqG;AACrG,kGAAkG;AAClG,yEAAyE;AACzE,MAAM,UAAU,aAAa,CAAI,IAAsB;IACrD,OAAO,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;AACxC,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { writeFile } from \"fs/promises\"\nimport * as lockfile from \"proper-lockfile\"\nimport * as os from \"os\"\nimport * as path from \"path\"\n\nconst TOOLSET_LOCK_FILE = path.join(os.tmpdir(), \".electron-builder-toolset.lock\")\nconst SIGNTOOL_LOCK_FILE = path.join(os.tmpdir(), \".electron-builder-signtool.lock\")\nconst ICONS_LOCK_FILE = path.join(os.tmpdir(), \".electron-builder-icons.lock\")\n\nasync function withLock<T>(lockFile: string, task: () => Promise<T>): Promise<T> {\n await writeFile(lockFile, \"\", { flag: \"a\" })\n const release = await lockfile.lock(lockFile, {\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120_000,\n })\n try {\n return await task()\n } finally {\n await release().catch((err: Error) => log.warn({ err }, \"failed to release lock\"))\n }\n}\n\nexport function withToolsetLock<T>(task: () => Promise<T>): Promise<T> {\n return withLock(TOOLSET_LOCK_FILE, task)\n}\n\n// `signtool sign /f <pfx>` imports the PFX via PFXImportCertStore, which mutates the per-user\n// CryptoAPI/CNG key+cert storage — a process-global resource that is not safe for concurrent access.\n// winPackager already serializes signing within a single packager (signingQueue), but parallel builds\n// (e.g. the test harness running multiple packagers across vitest workers that share one Windows user\n// profile) race on that shared store and intermittently fail, after cert selection, with\n// \"SignTool Error: An error occurred while attempting to load the signing certificate\". A dedicated\n// cross-process lock (separate from the toolset lock so it does not block MSI/Squirrel builds)\n// serializes signtool invocations. No-op overhead for real single builds, which are already serial.\nexport function withSigntoolLock<T>(task: () => Promise<T>): Promise<T> {\n return withLock(SIGNTOOL_LOCK_FILE, task)\n}\n\n// The icons toolset CLI (icon-tool.js) converts via a WebAssembly-backed image pipeline, and each\n// invocation reserves a large `WebAssembly.Memory`. A single build converting one icon is fine, but\n// parallel builds — most acutely the test harness running many packagers across forked vitest workers\n// on one machine — spawn enough concurrent icon-tool processes to exhaust memory, failing with\n// \"WebAssembly.Memory(): could not allocate memory\". A cross-process lock (separate from the toolset\n// lock so it does not serialize against MSI/Squirrel/DMG builds) caps icon conversion at one at a\n// time. No-op overhead for real single builds, which are already serial.\nexport function withIconsLock<T>(task: () => Promise<T>): Promise<T> {\n return withLock(ICONS_LOCK_FILE, task)\n}\n"]}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PACKAGE_VERSION = "27.0.0-alpha.2";
1
+ export declare const PACKAGE_VERSION = "27.0.0-alpha.4";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const PACKAGE_VERSION = "27.0.0-alpha.2";
1
+ export const PACKAGE_VERSION = "27.0.0-alpha.4";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,gBAAgB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"27.0.0-alpha.2\"\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,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