@noldova/desktop.build 0.0.0-stage → 0.0.2

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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/api/index.d.ts +58 -0
  4. package/api/index.js +9 -0
  5. package/api/index.js.map +1 -0
  6. package/assets/installer/installer.nsh +154 -0
  7. package/assets/licenses/fonts/INCONSOLATA-OFL.txt +93 -0
  8. package/assets/licenses/fonts/INTER-OFL.txt +92 -0
  9. package/assets/licenses/third-party/@xterm+addon-serialize-0.14.0.txt +21 -0
  10. package/assets/licenses/third-party/@xterm+headless-6.0.0.txt +21 -0
  11. package/assets/licenses/third-party/lazy-val-1.0.5.txt +21 -0
  12. package/assets/licenses/third-party/standardwebhooks-1.1.1.txt +21 -0
  13. package/assets/macos/entitlements.plist +15 -0
  14. package/exceptions/build.exception.js +14 -0
  15. package/exceptions/build.exception.js.map +1 -0
  16. package/exceptions/github-request.exception.js +23 -0
  17. package/exceptions/github-request.exception.js.map +1 -0
  18. package/exceptions/process-timeout.exception.js +19 -0
  19. package/exceptions/process-timeout.exception.js.map +1 -0
  20. package/interfaces/i-feed-file.js +9 -0
  21. package/interfaces/i-feed-file.js.map +1 -0
  22. package/interfaces/i-fixture-package.js +9 -0
  23. package/interfaces/i-fixture-package.js.map +1 -0
  24. package/interfaces/i-killed-copy-session.js +9 -0
  25. package/interfaces/i-killed-copy-session.js.map +1 -0
  26. package/interfaces/i-listed-module.js +9 -0
  27. package/interfaces/i-listed-module.js.map +1 -0
  28. package/interfaces/i-module-declaration-json.js +9 -0
  29. package/interfaces/i-module-declaration-json.js.map +1 -0
  30. package/interfaces/i-module-settings-file.js +9 -0
  31. package/interfaces/i-module-settings-file.js.map +1 -0
  32. package/interfaces/i-package-signing.js +9 -0
  33. package/interfaces/i-package-signing.js.map +1 -0
  34. package/interfaces/i-process-record.js +9 -0
  35. package/interfaces/i-process-record.js.map +1 -0
  36. package/interfaces/i-retry-clock.js +9 -0
  37. package/interfaces/i-retry-clock.js.map +1 -0
  38. package/interfaces/i-settings-page-json.js +9 -0
  39. package/interfaces/i-settings-page-json.js.map +1 -0
  40. package/interfaces/i-smoke-copy.js +9 -0
  41. package/interfaces/i-smoke-copy.js.map +1 -0
  42. package/interfaces/i-web-view-key-json.js +9 -0
  43. package/interfaces/i-web-view-key-json.js.map +1 -0
  44. package/interfaces/i-window-wait.js +9 -0
  45. package/interfaces/i-window-wait.js.map +1 -0
  46. package/models/modules/build-variant.js +21 -0
  47. package/models/modules/build-variant.js.map +1 -0
  48. package/models/modules/menu-group.js +27 -0
  49. package/models/modules/menu-group.js.map +1 -0
  50. package/models/modules/menu-item.js +30 -0
  51. package/models/modules/menu-item.js.map +1 -0
  52. package/models/modules/menu-place.js +27 -0
  53. package/models/modules/menu-place.js.map +1 -0
  54. package/models/modules/module-declaration.js +273 -0
  55. package/models/modules/module-declaration.js.map +1 -0
  56. package/models/modules/module-inventory.js +16 -0
  57. package/models/modules/module-inventory.js.map +1 -0
  58. package/models/modules/toolbar-placement.js +29 -0
  59. package/models/modules/toolbar-placement.js.map +1 -0
  60. package/models/modules/version-range.js +60 -0
  61. package/models/modules/version-range.js.map +1 -0
  62. package/models/modules/web-view-keys.js +36 -0
  63. package/models/modules/web-view-keys.js.map +1 -0
  64. package/models/packages/build-record.js +30 -0
  65. package/models/packages/build-record.js.map +1 -0
  66. package/models/packages/package-manifest.js +141 -0
  67. package/models/packages/package-manifest.js.map +1 -0
  68. package/models/packages/package-versions.js +57 -0
  69. package/models/packages/package-versions.js.map +1 -0
  70. package/models/packages/product-about.js +24 -0
  71. package/models/packages/product-about.js.map +1 -0
  72. package/models/packages/product-identity.js +141 -0
  73. package/models/packages/product-identity.js.map +1 -0
  74. package/models/packages/root-manifest.js +86 -0
  75. package/models/packages/root-manifest.js.map +1 -0
  76. package/models/packaging/accepted-licenses.js +36 -0
  77. package/models/packaging/accepted-licenses.js.map +1 -0
  78. package/models/packaging/company-package.js +117 -0
  79. package/models/packaging/company-package.js.map +1 -0
  80. package/models/packaging/installed-package.js +20 -0
  81. package/models/packaging/installed-package.js.map +1 -0
  82. package/models/packaging/license-expression.js +39 -0
  83. package/models/packaging/license-expression.js.map +1 -0
  84. package/models/packaging/locked-package.js +65 -0
  85. package/models/packaging/locked-package.js.map +1 -0
  86. package/models/packaging/omitted-optionals.js +29 -0
  87. package/models/packaging/omitted-optionals.js.map +1 -0
  88. package/models/packaging/package-report.js +35 -0
  89. package/models/packaging/package-report.js.map +1 -0
  90. package/models/packaging/package-target.js +50 -0
  91. package/models/packaging/package-target.js.map +1 -0
  92. package/models/packaging/packaging-section.js +55 -0
  93. package/models/packaging/packaging-section.js.map +1 -0
  94. package/models/packaging/pinned-package.js +18 -0
  95. package/models/packaging/pinned-package.js.map +1 -0
  96. package/models/packaging/tar-archive.js +96 -0
  97. package/models/packaging/tar-archive.js.map +1 -0
  98. package/models/packaging/tar-file.js +20 -0
  99. package/models/packaging/tar-file.js.map +1 -0
  100. package/models/packaging/third-party-package.js +94 -0
  101. package/models/packaging/third-party-package.js.map +1 -0
  102. package/models/packaging/type-only-peers.js +39 -0
  103. package/models/packaging/type-only-peers.js.map +1 -0
  104. package/models/packaging/windows-publisher.js +19 -0
  105. package/models/packaging/windows-publisher.js.map +1 -0
  106. package/models/packaging/windows-signing-account.js +40 -0
  107. package/models/packaging/windows-signing-account.js.map +1 -0
  108. package/models/processes/process-result.js +24 -0
  109. package/models/processes/process-result.js.map +1 -0
  110. package/models/release/github-release-asset.js +28 -0
  111. package/models/release/github-release-asset.js.map +1 -0
  112. package/models/release/github-release.js +30 -0
  113. package/models/release/github-release.js.map +1 -0
  114. package/models/release/package-digest.js +38 -0
  115. package/models/release/package-digest.js.map +1 -0
  116. package/models/release/release-file.js +16 -0
  117. package/models/release/release-file.js.map +1 -0
  118. package/models/release/release-request.js +32 -0
  119. package/models/release/release-request.js.map +1 -0
  120. package/models/release/release-version.js +44 -0
  121. package/models/release/release-version.js.map +1 -0
  122. package/models/structure/scanned-source.js +22 -0
  123. package/models/structure/scanned-source.js.map +1 -0
  124. package/models/structure/source-literal.js +16 -0
  125. package/models/structure/source-literal.js.map +1 -0
  126. package/models/workflows/build-matrix.js +20 -0
  127. package/models/workflows/build-matrix.js.map +1 -0
  128. package/models/workflows/build-target.js +24 -0
  129. package/models/workflows/build-target.js.map +1 -0
  130. package/package.json +53 -3
  131. package/resources.js +3659 -0
  132. package/resources.js.map +1 -0
  133. package/services/angular/about-logo.js +39 -0
  134. package/services/angular/about-logo.js.map +1 -0
  135. package/services/angular/angular-project.js +170 -0
  136. package/services/angular/angular-project.js.map +1 -0
  137. package/services/angular/gallery-file.js +31 -0
  138. package/services/angular/gallery-file.js.map +1 -0
  139. package/services/angular/installed-copies.js +44 -0
  140. package/services/angular/installed-copies.js.map +1 -0
  141. package/services/angular/product-file.js +35 -0
  142. package/services/angular/product-file.js.map +1 -0
  143. package/services/build-command-line.js +96 -0
  144. package/services/build-command-line.js.map +1 -0
  145. package/services/commands/build.js +98 -0
  146. package/services/commands/build.js.map +1 -0
  147. package/services/commands/choose-feed.js +61 -0
  148. package/services/commands/choose-feed.js.map +1 -0
  149. package/services/commands/desktop-tools-command.js +31 -0
  150. package/services/commands/desktop-tools-command.js.map +1 -0
  151. package/services/commands/feed-check.js +180 -0
  152. package/services/commands/feed-check.js.map +1 -0
  153. package/services/commands/install.js +34 -0
  154. package/services/commands/install.js.map +1 -0
  155. package/services/commands/list-targets.js +66 -0
  156. package/services/commands/list-targets.js.map +1 -0
  157. package/services/commands/module-range.js +84 -0
  158. package/services/commands/module-range.js.map +1 -0
  159. package/services/commands/noldova-desktop-range.js +33 -0
  160. package/services/commands/noldova-desktop-range.js.map +1 -0
  161. package/services/commands/package-smoke.js +537 -0
  162. package/services/commands/package-smoke.js.map +1 -0
  163. package/services/commands/package.js +146 -0
  164. package/services/commands/package.js.map +1 -0
  165. package/services/commands/release-assets.js +67 -0
  166. package/services/commands/release-assets.js.map +1 -0
  167. package/services/commands/release-check.js +86 -0
  168. package/services/commands/release-check.js.map +1 -0
  169. package/services/commands/release-publish.js +91 -0
  170. package/services/commands/release-publish.js.map +1 -0
  171. package/services/commands/start.js +36 -0
  172. package/services/commands/start.js.map +1 -0
  173. package/services/desktop/development-binary.js +162 -0
  174. package/services/desktop/development-binary.js.map +1 -0
  175. package/services/desktop/electron-binary.js +38 -0
  176. package/services/desktop/electron-binary.js.map +1 -0
  177. package/services/desktop/sandbox.validator.js +39 -0
  178. package/services/desktop/sandbox.validator.js.map +1 -0
  179. package/services/desktop/user-namespaces.js +28 -0
  180. package/services/desktop/user-namespaces.js.map +1 -0
  181. package/services/files/file-errors.js +22 -0
  182. package/services/files/file-errors.js.map +1 -0
  183. package/services/modules/module-artifacts.js +46 -0
  184. package/services/modules/module-artifacts.js.map +1 -0
  185. package/services/modules/module-catalog.js +374 -0
  186. package/services/modules/module-catalog.js.map +1 -0
  187. package/services/modules/module-cli-commands.js +127 -0
  188. package/services/modules/module-cli-commands.js.map +1 -0
  189. package/services/modules/module-menus.js +195 -0
  190. package/services/modules/module-menus.js.map +1 -0
  191. package/services/modules/module-settings.js +140 -0
  192. package/services/modules/module-settings.js.map +1 -0
  193. package/services/modules/module-web-views.js +136 -0
  194. package/services/modules/module-web-views.js.map +1 -0
  195. package/services/ordering/dependency-order.js +34 -0
  196. package/services/ordering/dependency-order.js.map +1 -0
  197. package/services/packages/addon-builder.js +83 -0
  198. package/services/packages/addon-builder.js.map +1 -0
  199. package/services/packages/archive.reader.js +52 -0
  200. package/services/packages/archive.reader.js.map +1 -0
  201. package/services/packages/build-layout.js +67 -0
  202. package/services/packages/build-layout.js.map +1 -0
  203. package/services/packages/build-product.js +51 -0
  204. package/services/packages/build-product.js.map +1 -0
  205. package/services/packages/content-hash.js +34 -0
  206. package/services/packages/content-hash.js.map +1 -0
  207. package/services/packages/import-closure.js +42 -0
  208. package/services/packages/import-closure.js.map +1 -0
  209. package/services/packages/installed-packages.js +73 -0
  210. package/services/packages/installed-packages.js.map +1 -0
  211. package/services/packages/installed-tree-check.js +53 -0
  212. package/services/packages/installed-tree-check.js.map +1 -0
  213. package/services/packages/module-window-imports.js +69 -0
  214. package/services/packages/module-window-imports.js.map +1 -0
  215. package/services/packages/once-hash.js +22 -0
  216. package/services/packages/once-hash.js.map +1 -0
  217. package/services/packages/package-build.js +336 -0
  218. package/services/packages/package-build.js.map +1 -0
  219. package/services/packages/package-builder.js +194 -0
  220. package/services/packages/package-builder.js.map +1 -0
  221. package/services/packages/package-catalog.js +57 -0
  222. package/services/packages/package-catalog.js.map +1 -0
  223. package/services/packages/package-naming.js +93 -0
  224. package/services/packages/package-naming.js.map +1 -0
  225. package/services/packages/update-feed.js +26 -0
  226. package/services/packages/update-feed.js.map +1 -0
  227. package/services/packaging/apple-signature-check.js +90 -0
  228. package/services/packaging/apple-signature-check.js.map +1 -0
  229. package/services/packaging/asar-archive.js +79 -0
  230. package/services/packaging/asar-archive.js.map +1 -0
  231. package/services/packaging/authenticode-check.js +62 -0
  232. package/services/packaging/authenticode-check.js.map +1 -0
  233. package/services/packaging/debian-install.js +94 -0
  234. package/services/packaging/debian-install.js.map +1 -0
  235. package/services/packaging/electron-distribution.js +43 -0
  236. package/services/packaging/electron-distribution.js.map +1 -0
  237. package/services/packaging/extracted-copy.js +24 -0
  238. package/services/packaging/extracted-copy.js.map +1 -0
  239. package/services/packaging/file-holders.js +26 -0
  240. package/services/packaging/file-holders.js.map +1 -0
  241. package/services/packaging/foreign-addons.js +66 -0
  242. package/services/packaging/foreign-addons.js.map +1 -0
  243. package/services/packaging/mac-signing.js +72 -0
  244. package/services/packaging/mac-signing.js.map +1 -0
  245. package/services/packaging/mac-update-archive-check.js +76 -0
  246. package/services/packaging/mac-update-archive-check.js.map +1 -0
  247. package/services/packaging/mounted-app-image.js +75 -0
  248. package/services/packaging/mounted-app-image.js.map +1 -0
  249. package/services/packaging/native-binaries.js +51 -0
  250. package/services/packaging/native-binaries.js.map +1 -0
  251. package/services/packaging/package-assets.js +33 -0
  252. package/services/packaging/package-assets.js.map +1 -0
  253. package/services/packaging/package-configuration.js +197 -0
  254. package/services/packaging/package-configuration.js.map +1 -0
  255. package/services/packaging/package-installer.js +171 -0
  256. package/services/packaging/package-installer.js.map +1 -0
  257. package/services/packaging/package-layout.js +61 -0
  258. package/services/packaging/package-layout.js.map +1 -0
  259. package/services/packaging/package-stage.js +146 -0
  260. package/services/packaging/package-stage.js.map +1 -0
  261. package/services/packaging/packaged-architecture.js +59 -0
  262. package/services/packaging/packaged-architecture.js.map +1 -0
  263. package/services/packaging/packaged-build.js +41 -0
  264. package/services/packaging/packaged-build.js.map +1 -0
  265. package/services/packaging/packaged-modules.js +55 -0
  266. package/services/packaging/packaged-modules.js.map +1 -0
  267. package/services/packaging/packaged-publisher-check.js +43 -0
  268. package/services/packaging/packaged-publisher-check.js.map +1 -0
  269. package/services/packaging/packaged-sandbox.js +86 -0
  270. package/services/packaging/packaged-sandbox.js.map +1 -0
  271. package/services/packaging/packaged-unpacked-files.js +60 -0
  272. package/services/packaging/packaged-unpacked-files.js.map +1 -0
  273. package/services/packaging/packaged-window.js +68 -0
  274. package/services/packaging/packaged-window.js.map +1 -0
  275. package/services/packaging/runtime-mount-check.js +33 -0
  276. package/services/packaging/runtime-mount-check.js.map +1 -0
  277. package/services/packaging/shipped-files.js +67 -0
  278. package/services/packaging/shipped-files.js.map +1 -0
  279. package/services/packaging/signing-credentials.js +18 -0
  280. package/services/packaging/signing-credentials.js.map +1 -0
  281. package/services/packaging/smoke-answer.js +22 -0
  282. package/services/packaging/smoke-answer.js.map +1 -0
  283. package/services/packaging/third-party-closure.js +175 -0
  284. package/services/packaging/third-party-closure.js.map +1 -0
  285. package/services/packaging/trusted-signing-module.js +118 -0
  286. package/services/packaging/trusted-signing-module.js.map +1 -0
  287. package/services/packaging/unpacked-files.js +108 -0
  288. package/services/packaging/unpacked-files.js.map +1 -0
  289. package/services/packaging/user-path.js +46 -0
  290. package/services/packaging/user-path.js.map +1 -0
  291. package/services/packaging/windows-sign-hook.js +14 -0
  292. package/services/packaging/windows-sign-hook.js.map +1 -0
  293. package/services/packaging/windows-signing.js +64 -0
  294. package/services/packaging/windows-signing.js.map +1 -0
  295. package/services/processes/executable-locator.js +36 -0
  296. package/services/processes/executable-locator.js.map +1 -0
  297. package/services/processes/process-runner.js +104 -0
  298. package/services/processes/process-runner.js.map +1 -0
  299. package/services/processes/retried-download.js +28 -0
  300. package/services/processes/retried-download.js.map +1 -0
  301. package/services/processes/started-process.js +50 -0
  302. package/services/processes/started-process.js.map +1 -0
  303. package/services/processes/temporary-folder.js +23 -0
  304. package/services/processes/temporary-folder.js.map +1 -0
  305. package/services/release/release-file-set.js +86 -0
  306. package/services/release/release-file-set.js.map +1 -0
  307. package/services/release/release-notes.js +45 -0
  308. package/services/release/release-notes.js.map +1 -0
  309. package/services/release/release-publisher.js +135 -0
  310. package/services/release/release-publisher.js.map +1 -0
  311. package/services/release/release-reports.js +84 -0
  312. package/services/release/release-reports.js.map +1 -0
  313. package/services/release/release-settings.js +31 -0
  314. package/services/release/release-settings.js.map +1 -0
  315. package/services/release/release-signing.js +36 -0
  316. package/services/release/release-signing.js.map +1 -0
  317. package/services/release/release-tag.js +28 -0
  318. package/services/release/release-tag.js.map +1 -0
  319. package/services/release/release-targets.js +34 -0
  320. package/services/release/release-targets.js.map +1 -0
  321. package/services/release/supported-targets.js +39 -0
  322. package/services/release/supported-targets.js.map +1 -0
  323. package/services/release/update-metadata.js +38 -0
  324. package/services/release/update-metadata.js.map +1 -0
  325. package/services/release-command-line.js +55 -0
  326. package/services/release-command-line.js.map +1 -0
  327. package/services/repository/git.js +30 -0
  328. package/services/repository/git.js.map +1 -0
  329. package/services/repository/github-api.js +93 -0
  330. package/services/repository/github-api.js.map +1 -0
  331. package/services/repository/github-json.js +50 -0
  332. package/services/repository/github-json.js.map +1 -0
  333. package/services/structure/source-scanner.js +197 -0
  334. package/services/structure/source-scanner.js.map +1 -0
  335. package/services/toolchain/node-gyp.js +26 -0
  336. package/services/toolchain/node-gyp.js.map +1 -0
  337. package/services/toolchain/npm-command.js +25 -0
  338. package/services/toolchain/npm-command.js.map +1 -0
  339. package/services/toolchain/typescript-compiler.js +16 -0
  340. package/services/toolchain/typescript-compiler.js.map +1 -0
package/resources.js ADDED
@@ -0,0 +1,3659 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import "@noldova/context.core";
9
+ export class Resources {
10
+ static commandName = "noldova-desktop-build";
11
+ static buildCommand = "build";
12
+ static installCommand = "install";
13
+ static startCommand = "start";
14
+ static desktopToolsCommand = "desktop-tools";
15
+ static packageCommand = "package";
16
+ static packageSmokeCommand = "package-smoke";
17
+ static listTargetsCommand = "list-targets";
18
+ static releaseCheckCommand = "release-check";
19
+ static chooseFeedCommand = "choose-feed";
20
+ static feedCheckCommand = "feed-check";
21
+ static moduleRangeCommand = "module-range";
22
+ static noldovaDesktopRangeCommand = "noldova-desktop-range";
23
+ static releaseAssetsCommand = "release-assets";
24
+ static releasePublishCommand = "release-publish";
25
+ static commands = [
26
+ Resources.installCommand,
27
+ Resources.buildCommand,
28
+ Resources.startCommand,
29
+ Resources.desktopToolsCommand,
30
+ Resources.packageCommand,
31
+ Resources.packageSmokeCommand,
32
+ Resources.listTargetsCommand,
33
+ Resources.releaseCheckCommand,
34
+ Resources.releaseAssetsCommand,
35
+ Resources.releasePublishCommand
36
+ ];
37
+ static usage = `Usage: ${Resources.commandName} <command> [<argument>...], where the command is one of ${Resources.commands.join(", ")}.\n`;
38
+ static usageExitCode = 2;
39
+ static releaseCommandName = "noldova-desktop-release";
40
+ static releaseCommands = [
41
+ Resources.listTargetsCommand,
42
+ Resources.releaseCheckCommand,
43
+ Resources.chooseFeedCommand,
44
+ Resources.releasePublishCommand,
45
+ Resources.feedCheckCommand,
46
+ Resources.moduleRangeCommand,
47
+ Resources.noldovaDesktopRangeCommand
48
+ ];
49
+ static releaseUsage = `Usage: ${Resources.releaseCommandName} <command> [<argument>...], where the command is one of ${Resources.releaseCommands.join(", ")}.`
50
+ + " It loads only Node.js's own modules and context's core, exceptions and json packages, so it runs from desktop.build's archive with those three beside it, without an install.\n";
51
+ static licenseNotice = [
52
+ "@license",
53
+ "Copyright (c) Noldova.",
54
+ String.empty,
55
+ "This source code is licensed under the license found in the",
56
+ "LICENSE file in the root directory of this source tree."
57
+ ];
58
+ static licenseHeaderBlock = ["/**", ...Resources.licenseNotice.map(t => ` *${Resources.indentNoticeLine(t)}`), " */", String.empty].join("\n");
59
+ static packageManifestFileName = "package.json";
60
+ static windowsTarget = "windows";
61
+ static macosTarget = "macos";
62
+ static linuxTarget = "linux";
63
+ static installerTarget = "exe";
64
+ static diskImageTarget = "dmg";
65
+ static appImageTarget = "AppImage";
66
+ static debianPackageTarget = "deb";
67
+ static modulesPrefix = "@noldova/desktop.";
68
+ static modulesPrefixPattern = /^@[a-z0-9][a-z0-9._-]*\/(?:[a-z0-9][a-z0-9._-]*[-.])?$/;
69
+ static versionRangeForm = ">=<lowest version> <first version refused>, such as >=0.0.70 <0.1.0";
70
+ static runtimePart = "runtime";
71
+ static windowPart = "window";
72
+ static cliPart = "cli";
73
+ static moduleParts = [Resources.runtimePart, Resources.windowPart, Resources.cliPart];
74
+ static moduleFixtureFolder = "src/noldova.desktop.electron/tests/e2e/fixtures/modules";
75
+ static settingsFileName = "settings.json";
76
+ static settingsKind = "settings";
77
+ static settingScopesKind = "settingScopes";
78
+ static settingsPagesKind = "settingsPages";
79
+ static webViewsFileName = "webViews.json";
80
+ static shellMenuPlaces = ["desktop.file", "desktop.edit", "desktop.view", "desktop.window", "desktop.help", "desktop.tab"];
81
+ static cliCommandsKind = "cliCommands";
82
+ static galleryMarkers = ["nol-gallery-scope-frame", "nol-gallery-forms", "Plate, center chosen", "\"data-nol-state\""];
83
+ static updateFeedOption = "--update-feed";
84
+ static downloadAttemptTimeout = 600_000;
85
+ static compileTimeout = 300_000;
86
+ static carryTimeout = 300_000;
87
+ static carryScriptSegments = ["scripts", "carry-docs.ts"];
88
+ static inputsOption = "--inputs";
89
+ static addonOutputFolder = "native";
90
+ static addonExtension = ".node";
91
+ static releaseAddonsVariable = "RELEASE_ADDONS";
92
+ static addonWindowsTargets = ["win32-x64", "win32-arm64"];
93
+ static addonPosixTargets = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64"];
94
+ static addonTargets = [...Resources.addonWindowsTargets, ...Resources.addonPosixTargets];
95
+ static desktopToolsEntrySegments = ["node_modules", "@noldova", "desktop.cli", "services", "cli-entry.js"];
96
+ static runAsNodeVariable = "ELECTRON_RUN_AS_NODE";
97
+ static runAsNodeValue = "1";
98
+ static electronMainSegments = ["node_modules", "@noldova", "desktop.electron", "main.js"];
99
+ static userNamespacesProbeCommand = "unshare";
100
+ static userNamespacesProbeArguments = ["-Ur", "true"];
101
+ static windowsIconFile = "icon-dark.ico";
102
+ static macIconFile = "icon-dock-512.png";
103
+ static linuxIconFile = "icon-dark-512.png";
104
+ static commandFolder = "bin";
105
+ static windowsCommandExtension = ".cmd";
106
+ static installerIncludeSegments = ["assets", "installer", "installer.nsh"];
107
+ static entitlementsSegments = ["assets", "macos", "entitlements.plist"];
108
+ static fontLicensesSegments = ["assets", "licenses", "fonts"];
109
+ static reviewedLicensesSegments = ["assets", "licenses", "third-party"];
110
+ static dictionariesSegments = ["assets", "dictionaries"];
111
+ static licenseSegments = ["LICENSE"];
112
+ static omittedOptionalsSection = "desktop.packaging.omittedOptionals";
113
+ static typeOnlyPeersSection = "desktop.packaging.typeOnlyPeers";
114
+ static acceptedLicensesSection = "desktop.packaging.acceptedLicenses";
115
+ static tarFileTypes = ["0", String.empty, "7"];
116
+ static tarFolderType = "5";
117
+ static windowsPublisherVariable = "WINDOWS_PUBLISHER";
118
+ static windowsSigningSection = "desktop.product.windowsSigning";
119
+ static windowsSigningCredentials = ["AZURE_TENANT_ID", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET"];
120
+ static macSigningCredentials = ["MAC_CERTIFICATE", "MAC_CERTIFICATE_PASSWORD", "APPLE_API_KEY_P8", "APPLE_API_KEY_ID", "APPLE_API_ISSUER"];
121
+ static staplerAttempts = 3;
122
+ static releaseTargetsVariable = "RELEASE_TARGETS";
123
+ static powershellStopLine = "$ErrorActionPreference = 'Stop'";
124
+ static lineSeparator = "\n";
125
+ static pathSegmentSeparator = "/";
126
+ static textEncoding = "utf8";
127
+ static listSeparator = ", ";
128
+ static diskImageExtension = ".dmg";
129
+ static appBundleExtension = ".app";
130
+ static hdiutilCommand = "hdiutil";
131
+ static hdiutilAttachArgument = "attach";
132
+ static hdiutilReadonlyOption = "-readonly";
133
+ static hdiutilNoBrowseOption = "-nobrowse";
134
+ static hdiutilNoAutoOpenOption = "-noautoopen";
135
+ static hdiutilMountpointOption = "-mountpoint";
136
+ static hdiutilAttachArguments = [Resources.hdiutilAttachArgument, Resources.hdiutilReadonlyOption, Resources.hdiutilNoBrowseOption,
137
+ Resources.hdiutilNoAutoOpenOption, Resources.hdiutilMountpointOption];
138
+ static hdiutilDetachArgument = "detach";
139
+ static hdiutilForceOption = "-force";
140
+ static dittoCommand = "ditto";
141
+ static dittoExtractArguments = ["-x", "-k"];
142
+ static codesignCommand = "codesign";
143
+ static codesignVerifyOption = "--verify";
144
+ static codesignDeepOption = "--deep";
145
+ static codesignStrictOption = "--strict";
146
+ static codesignDisplayOption = "--display";
147
+ static appleVerboseOption = "--verbose=2";
148
+ static spctlCommand = "spctl";
149
+ static spctlAssessOption = "--assess";
150
+ static spctlTypeOption = "--type";
151
+ static spctlAppAssessment = [Resources.spctlTypeOption, "execute"];
152
+ static spctlDiskImageAssessment = [Resources.spctlTypeOption, "open", "--context", "context:primary-signature"];
153
+ static xcrunCommand = "xcrun";
154
+ static staplerCommand = "stapler";
155
+ static staplerValidateArguments = [Resources.staplerCommand, "validate"];
156
+ static appleSignatureTimeout = 300_000;
157
+ static appleDeveloperIdPattern = /^Authority=Developer ID Application: /m;
158
+ static appleNotarizedPattern = /^source=Notarized Developer ID$/m;
159
+ static appleNetworkErrorPattern = /NSURLErrorDomain/;
160
+ static staplerPause = 5_000;
161
+ static appleValidSignatureRequirement = "a valid signature";
162
+ static appleDeveloperIdRequirement = "a Developer ID Application signature";
163
+ static appleNotarizationRequirement = "notarization";
164
+ static appleStapledRequirement = "a stapled ticket";
165
+ static appleStapledOfflineRequirement = `a stapled ticket confirmed by stapler validate, which lost its network connection on all ${Resources.staplerAttempts} attempts`;
166
+ static fileReadFlag = "r";
167
+ static asarSizeLength = 8;
168
+ static asarHeaderSizeOffset = 4;
169
+ static asarHeaderLengthOffset = 4;
170
+ static asarHeaderOffset = 8;
171
+ static asarFilesField = "files";
172
+ static asarSizeField = "size";
173
+ static asarOffsetField = "offset";
174
+ static asarUnpackedField = "unpacked";
175
+ static authenticodeMicrosoft = "Microsoft Corporation";
176
+ static authenticodeGitForWindows = "Git for Windows' signer";
177
+ static authenticodeGitForWindowsOrganization = "Johannes Schindelin";
178
+ static authenticodeLibraryVendors = [Resources.authenticodeMicrosoft];
179
+ static authenticodeProgramVendors = [Resources.authenticodeMicrosoft, Resources.authenticodeGitForWindows];
180
+ static authenticodeOrganizations = new Map([
181
+ [Resources.authenticodeMicrosoft, Resources.authenticodeMicrosoft],
182
+ [Resources.authenticodeGitForWindowsOrganization, Resources.authenticodeGitForWindows]
183
+ ]);
184
+ static powershellCommand = "pwsh";
185
+ static powershellOptions = ["-NoProfile", "-NonInteractive", "-EncodedCommand"];
186
+ static powershellScriptEncoding = "utf16le";
187
+ static powershellCommandEncoding = "base64";
188
+ static authenticodeFilesVariable = "NOLDOVA_DESKTOP_SIGNED_FILES";
189
+ static authenticodePublisherVariable = "NOLDOVA_DESKTOP_WINDOWS_PUBLISHER";
190
+ static authenticodeVendorsVariable = "NOLDOVA_DESKTOP_SIGNING_VENDORS";
191
+ static authenticodeFieldSeparator = "\t";
192
+ static lineBreakPattern = /\r?\n/;
193
+ static authenticodeTimeout = 120_000;
194
+ static windowsProgramExtension = ".exe";
195
+ static authenticodeValidStatus = "Valid";
196
+ static authenticodeTimestamped = "yes";
197
+ static authenticodePublisherSigner = "*";
198
+ static authenticodeOtherSigner = "?";
199
+ static authenticodeNoSigner = String.empty;
200
+ static authenticodeReportFieldCount = 4;
201
+ static authenticodePublisherLabel = "the publisher";
202
+ static authenticodeOtherSignerLabel = "another signer";
203
+ static authenticodeNoSignerLabel = "no one";
204
+ static authenticodeScript = [
205
+ Resources.powershellStopLine,
206
+ "$flags = [System.Security.Cryptography.X509Certificates.X500DistinguishedNameFlags]::UseNewLines",
207
+ "function Get-Fields($name) { @($name.Decode($flags).Split([char]10) | Microsoft.PowerShell.Core\\ForEach-Object { $_.Trim() } | Microsoft.PowerShell.Core\\Where-Object { $_ }) }",
208
+ `$publisher = Get-Fields ([System.Security.Cryptography.X509Certificates.X500DistinguishedName]::new($env:${Resources.authenticodePublisherVariable}))`,
209
+ `$vendors = @($env:${Resources.authenticodeVendorsVariable}.Split([char]10))`,
210
+ `foreach ($file in @($env:${Resources.authenticodeFilesVariable}.Split([char]10))) {`,
211
+ " $signature = Microsoft.PowerShell.Security\\Get-AuthenticodeSignature -LiteralPath $file",
212
+ " $subject = if ($null -eq $signature.SignerCertificate) { @() } else { Get-Fields $signature.SignerCertificate.SubjectName }",
213
+ " $vendor = @($vendors | Microsoft.PowerShell.Core\\Where-Object { $subject -ccontains \"O=$_\" }) | Microsoft.PowerShell.Utility\\Select-Object -First 1",
214
+ " $signer = if ($subject.Count -eq 0) { '' } "
215
+ + "elseif (@($publisher | Microsoft.PowerShell.Core\\Where-Object { $subject -cnotcontains $_ }).Count -eq 0) { '*' } "
216
+ + "elseif ($vendor) { $vendor } else { '?' }",
217
+ " $timestamped = if ($null -ne $signature.TimeStamperCertificate) { 'yes' } else { 'no' }",
218
+ " \"$file`t$($signature.Status)`t$timestamped`t$signer\"",
219
+ "}"
220
+ ].join(Resources.lineSeparator);
221
+ static packageScopePrefix = "@";
222
+ static electronPackageName = "electron";
223
+ static nodeModulesFolder = "node_modules";
224
+ static electronPackageSegments = [Resources.nodeModulesFolder, Resources.electronPackageName];
225
+ static electronDistributionFolder = "dist";
226
+ static electronDefaultAppFile = "default_app.asar";
227
+ static electronVersionFile = "version";
228
+ static windowsPowershellCommand = "powershell.exe";
229
+ static fileHoldersFilesVariable = "NOLDOVA_DESKTOP_LEFT_FILES";
230
+ static fileHoldersTimeout = 120_000;
231
+ static fileHoldersScript = [
232
+ Resources.powershellStopLine,
233
+ "Microsoft.PowerShell.Utility\\Add-Type -TypeDefinition @'",
234
+ "using System;",
235
+ "using System.Collections.Generic;",
236
+ "using System.Runtime.InteropServices;",
237
+ "using System.Text;",
238
+ "public static class ShellFileHolders {",
239
+ " private const int MoreData = 234;",
240
+ " [StructLayout(LayoutKind.Sequential)]",
241
+ " private struct UniqueProcess { public uint ProcessId; public uint StartLow; public uint StartHigh; }",
242
+ " [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]",
243
+ " private struct ProcessInfo {",
244
+ " public UniqueProcess Process;",
245
+ " [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string AppName;",
246
+ " [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string ServiceName;",
247
+ " public int ApplicationType;",
248
+ " public uint AppStatus;",
249
+ " public uint SessionId;",
250
+ " [MarshalAs(UnmanagedType.Bool)] public bool Restartable;",
251
+ " }",
252
+ " [DllImport(\"rstrtmgr.dll\", CharSet = CharSet.Unicode)]",
253
+ " private static extern int RmStartSession(out uint session, int flags, StringBuilder key);",
254
+ " [DllImport(\"rstrtmgr.dll\", CharSet = CharSet.Unicode)]",
255
+ " private static extern int RmRegisterResources(uint session, uint fileCount, string[] files, uint processCount, IntPtr processes, uint serviceCount, IntPtr services);",
256
+ " [DllImport(\"rstrtmgr.dll\")]",
257
+ " private static extern int RmGetList(uint session, out uint needed, ref uint count, [In, Out] ProcessInfo[] infos, out uint reasons);",
258
+ " [DllImport(\"rstrtmgr.dll\")]",
259
+ " private static extern int RmEndSession(uint session);",
260
+ " public static string[] Describe(string file) {",
261
+ " uint session;",
262
+ " int error = RmStartSession(out session, 0, new StringBuilder(64));",
263
+ " if (error != 0)",
264
+ " return new[] { \"Restart Manager could not start, error \" + error };",
265
+ " try {",
266
+ " error = RmRegisterResources(session, 1, new[] { file }, 0, IntPtr.Zero, 0, IntPtr.Zero);",
267
+ " if (error != 0)",
268
+ " return new[] { \"Restart Manager could not register it, error \" + error };",
269
+ " uint needed;",
270
+ " uint count = 0;",
271
+ " uint reasons;",
272
+ " ProcessInfo[] infos = new ProcessInfo[0];",
273
+ " error = RmGetList(session, out needed, ref count, infos, out reasons);",
274
+ " while (error == MoreData) {",
275
+ " infos = new ProcessInfo[needed];",
276
+ " count = needed;",
277
+ " error = RmGetList(session, out needed, ref count, infos, out reasons);",
278
+ " }",
279
+ " if (error != 0)",
280
+ " return new[] { \"Restart Manager could not list what uses it, error \" + error };",
281
+ " List<string> holders = new List<string>();",
282
+ " for (int i = 0; i < count; i++)",
283
+ " holders.Add(\"process \" + infos[i].Process.ProcessId + \" \" + infos[i].AppName + (string.IsNullOrEmpty(infos[i].ServiceName) ? \"\" : \", service \" + infos[i].ServiceName));",
284
+ " return holders.ToArray();",
285
+ " }",
286
+ " finally {",
287
+ " RmEndSession(session);",
288
+ " }",
289
+ " }",
290
+ "}",
291
+ "'@",
292
+ `foreach ($file in $env:${Resources.fileHoldersFilesVariable}.Split([char]10)) {`,
293
+ " $holders = @([ShellFileHolders]::Describe($file))",
294
+ " if ($holders.Count -eq 0) { \"${file}: no process holds it now.\" }",
295
+ " foreach ($holder in $holders) { \"${file}: $holder.\" }",
296
+ "}",
297
+ "$since = (Microsoft.PowerShell.Utility\\Get-Date).AddMinutes(-5)",
298
+ "$records = @(Microsoft.PowerShell.Diagnostics\\Get-WinEvent -MaxEvents 20 -ErrorAction SilentlyContinue -FilterHashtable @{ LogName = 'Microsoft-Windows-Windows Defender/Operational'; StartTime = $since })",
299
+ "if ($records.Count -eq 0) { 'Defender logged no event in the last 5 minutes.' }",
300
+ "foreach ($record in $records) { \"Defender event $($record.Id) at $($record.TimeCreated.ToString('o')): $(\"$($record.Message)\".Split([char]10)[0].Trim())\" }"
301
+ ].join(Resources.lineSeparator);
302
+ static addonPrebuildsFolder = "prebuilds";
303
+ static addonBuildFolders = [Resources.addonOutputFolder, Resources.addonPrebuildsFolder];
304
+ static conptyFolderSegments = ["third_party", "conpty"];
305
+ static conptyTargets = ["win10-x64", "win10-arm64"];
306
+ static conptyTargetPrefix = "win10-";
307
+ static macCertificateVariable = "MAC_CERTIFICATE";
308
+ static macCertificatePasswordVariable = "MAC_CERTIFICATE_PASSWORD";
309
+ static appleApiKeyVariable = "APPLE_API_KEY_P8";
310
+ static appleApiKeyIdVariable = "APPLE_API_KEY_ID";
311
+ static appleApiIssuerVariable = "APPLE_API_ISSUER";
312
+ static builderIdentityDiscoveryVariable = "CSC_IDENTITY_AUTO_DISCOVERY";
313
+ static builderIdentityDiscoveryValue = "true";
314
+ static builderCertificateVariable = "CSC_LINK";
315
+ static builderCertificatePasswordVariable = "CSC_KEY_PASSWORD";
316
+ static builderAppleKeyVariable = "APPLE_API_KEY";
317
+ static macNotarizationKeyFile = "notarization-key.p8";
318
+ static macSigningCheckFolder = "check";
319
+ static macNotarizationTimeout = 3_900_000;
320
+ static macNotarizationWait = "1h";
321
+ static macStapleTimeout = 300_000;
322
+ static macNotarizationAcceptedPattern = /"status"\s*:\s*"Accepted"/;
323
+ static macNotarizationSubmissionPattern = /"id"\s*:\s*"([^"]+)"/;
324
+ static privateFolderMode = 0o700;
325
+ static privateFileMode = 0o600;
326
+ static notarytoolSubmitArguments = ["notarytool", "submit"];
327
+ static notarytoolKeyOption = "--key";
328
+ static notarytoolKeyIdOption = "--key-id";
329
+ static notarytoolIssuerOption = "--issuer";
330
+ static notarytoolWaitArguments = ["--wait", "--timeout"];
331
+ static notarytoolOutputArguments = ["--output-format", "json"];
332
+ static staplerStapleArguments = [Resources.staplerCommand, "staple"];
333
+ static macUpdateArchiveTimeout = 300_000;
334
+ static frameworkExtension = ".framework";
335
+ static frameworkCurrentVersionSegments = ["Versions", "Current"];
336
+ static macUpdateShownDifferences = 10;
337
+ static macUpdateFolderEntry = "folder";
338
+ static macUpdateLinkPrefix = "link to ";
339
+ static macUpdateMissingEntry = "missing";
340
+ static nativeHeaderLength = 64;
341
+ static nativePeOffsetPosition = 0x3c;
342
+ static nativeMagicEncoding = "latin1";
343
+ static nativeMagicHexEncoding = "hex";
344
+ static nativeDosMagic = Buffer.from("MZ", Resources.nativeMagicEncoding);
345
+ static nativePeMagic = Buffer.from("PE\0\0", Resources.nativeMagicEncoding);
346
+ static nativeMagics = ["7f454c46", "feedface", "feedfacf", "cefaedfe", "cffaedfe", "cafebabf"].map(t => Buffer.from(t, Resources.nativeMagicHexEncoding));
347
+ static nativeUniversalMagic = Buffer.from("cafebabe", Resources.nativeMagicHexEncoding);
348
+ static nativeUniversalHeaderLength = 8;
349
+ static nativeJavaFirstVersion = 45;
350
+ static filePatternCharacters = /[*?[\]{}()\\]/u;
351
+ static packageAssetsDefaultsUrl = "../..";
352
+ static windowsLibraryExtension = ".dll";
353
+ static licenseTextFilter = ["*.txt"];
354
+ static buildFolder = "_build";
355
+ static windowLicensesSegments = [Resources.buildFolder, "window", "3rdpartylicenses.txt"];
356
+ static packagedLicensesFolder = "licenses";
357
+ static windowLicensesFile = "window-third-party.txt";
358
+ static builderExtensionMacro = "${ext}";
359
+ static addonsPattern = `**/*${Resources.addonExtension}`;
360
+ static appImageToolset = "1.0.3";
361
+ static windowsSignedExtensions = [Resources.addonExtension, Resources.windowsLibraryExtension, Resources.windowsProgramExtension];
362
+ static windowsCommandFolder = "%~dp0..";
363
+ static packagedResourcesFolder = "resources";
364
+ static packagedArchiveFile = "app.asar";
365
+ static packagedUnpackedFolder = `${Resources.packagedArchiveFile}.unpacked`;
366
+ static packagedThirdPartySegments = [Resources.packagedResourcesFolder, Resources.packagedUnpackedFolder, Resources.nodeModulesFolder];
367
+ static windowsLineSeparator = "\r\n";
368
+ static macResourcesVariable = "$resources";
369
+ static parentFolderSegment = "..";
370
+ static macProgramSegments = [Resources.parentFolderSegment, "MacOS"];
371
+ static executableMode = 0o755;
372
+ static windowsSigningHash = "sha256";
373
+ static windowsSignHookName = "windows-sign-hook";
374
+ static packageFuses = {
375
+ runAsNode: true,
376
+ enableCookieEncryption: false,
377
+ enableNodeOptionsEnvironmentVariable: false,
378
+ enableNodeCliInspectArguments: false,
379
+ enableEmbeddedAsarIntegrityValidation: true,
380
+ onlyLoadAppFromAsar: true,
381
+ loadBrowserProcessSpecificV8Snapshot: false,
382
+ grantFileProtocolExtraPrivileges: true
383
+ };
384
+ static installerTimeout = 120_000;
385
+ static localAppDataVariable = "LOCALAPPDATA";
386
+ static windowsProgramsFolder = "Programs";
387
+ static silentInstallArguments = ["/S"];
388
+ static uninstallerPrefix = "Uninstall ";
389
+ static uninstallerInPlaceOption = "_?=";
390
+ static removeRetries = 20;
391
+ static removeRetryDelay = 500;
392
+ static powershellModulePathVariable = "PSModulePath";
393
+ static systemRootVariable = "SystemRoot";
394
+ static windowsPowershellModulesSegments = ["System32", "WindowsPowerShell", "v1.0", "Modules"];
395
+ static installerAttachOptions = [Resources.hdiutilNoBrowseOption, Resources.hdiutilReadonlyOption, Resources.hdiutilMountpointOption];
396
+ static hdiutilDetachArguments = [Resources.hdiutilDetachArgument, Resources.hdiutilForceOption];
397
+ static installerMountFolder = "mount";
398
+ static macBundleContentsFolder = "Contents";
399
+ static macBundleProgramSegments = [Resources.macBundleContentsFolder, "MacOS"];
400
+ static macBundleResourcesSegments = [Resources.macBundleContentsFolder, "Resources"];
401
+ static appImageExtractArguments = ["--appimage-extract"];
402
+ static appImageExtractedFolder = "squashfs-root";
403
+ static systemRootMissing = `${Resources.systemRootVariable} must name the Windows folder, whose PowerShell modules the installer's checks search first.`;
404
+ static localAppDataMissing = `${Resources.localAppDataVariable} must name the folder the installer installs into for the user.`;
405
+ static packageLayoutFolderSegments = [Resources.buildFolder, "package"];
406
+ static packageStageFolder = "app";
407
+ static packageStagedProductSegments = [Resources.buildFolder, "product.json"];
408
+ static packageNpmCacheFolder = "npm-cache";
409
+ static packageToolCacheFolder = "tool-cache";
410
+ static packageOutputFolder = "out";
411
+ static packageSmokeFolder = "smoke";
412
+ static packageCommandFolder = "command";
413
+ static packageSigningFolder = "signing";
414
+ static packageArchiveCheckFolder = "archive-check";
415
+ static packageConfigurationFile = "electron-builder.json";
416
+ static packageReportFile = "package-report.json";
417
+ static packageThirdPartyFolder = "third-party";
418
+ static packageCompanyFolder = "company";
419
+ static packageThirdPartyLicensesFile = "runtime-third-party.txt";
420
+ static noneLabel = "none";
421
+ static stageEntryPackages = ["@noldova/desktop.electron", "@noldova/desktop.cli"];
422
+ static desktopFileExtension = ".desktop";
423
+ static stageNoticeRuleWidth = 80;
424
+ static stageNoticeSeparator = `\n${"-".repeat(Resources.stageNoticeRuleWidth)}\n\n`;
425
+ static stageUnreachableRegistry = "http://127.0.0.1:9/";
426
+ static stageOverridesInvalid = "The root package.json's overrides must be an object, as npm reads them.";
427
+ static stageOverrideConflictMarker = "code EOVERRIDE";
428
+ static stageOverrideAdvice = "\nThe stage installs each shipped package from its archive as a direct dependency, and npm refuses a top-level override of a direct dependency; "
429
+ + "write the override nested under the dependent it is for, as { \"<dependent>\": { \"<package>\": \"<version>\" } }.";
430
+ static stageInstallArguments = [
431
+ "install", "--offline", "--no-save", "--no-package-lock", "--omit=dev", "--legacy-peer-deps", "--ignore-scripts", "--no-audit", "--no-fund", "--loglevel=error",
432
+ `--registry=${Resources.stageUnreachableRegistry}`, "--cache"
433
+ ];
434
+ static stageLicenseRole = "the license the package ships";
435
+ static stageIconsRole = "the icons folder that desktop.product.icons names";
436
+ static stageDictionariesRole = "the spelling dictionaries the window checks text with";
437
+ static stageNoGallery = "The packaged window holds no Gallery.\n";
438
+ static machHeaderLength = 8;
439
+ static machCpuTypeOffset = 4;
440
+ static machUniversalCountOffset = 4;
441
+ static machThinMagic = 0xfeedfacf;
442
+ static machThin32Magic = 0xfeedface;
443
+ static machUniversalMagics = [0xcafebabe, 0xcafebabf];
444
+ static machUniversalArchitectureLimit = 30;
445
+ static machCpuTypes = { arm64: 0x0100000c, x64: 0x01000007 };
446
+ static machUniversalFile = "a universal Mach-O file";
447
+ static mach32BitFile = "a 32-bit Mach-O file";
448
+ static packagedBuildCommandLineName = "../build-command-line";
449
+ static packagedBuildOptions = [Resources.buildCommand, "--packaged", "--output"];
450
+ static packagedWindowFolder = "window";
451
+ static packagedBuildGalleryLeft = "The packaged build's Gallery file still brings in the Gallery.";
452
+ static statusModulesField = "modules";
453
+ static statusIdField = "id";
454
+ static statusStateField = "state";
455
+ static statusCauseField = "cause";
456
+ static moduleActiveState = "Active";
457
+ static moduleUnavailableState = "Unavailable";
458
+ static moduleBlockedState = "Blocked";
459
+ static moduleOffState = "Off";
460
+ static packagedModulesNone = "The installed app has no modules.";
461
+ static packagedModuleWithoutId = "a module without an id";
462
+ static packagedModuleWithoutState = "in no state";
463
+ static productWindowsPublisherField = "windowsPublisher";
464
+ static publisherNoneVerified = `The installed package has no Windows publisher, and ${Resources.windowsPublisherVariable} is not set.`;
465
+ static publisherMatchVerified = `The installed package's Windows publisher matches ${Resources.windowsPublisherVariable}.`;
466
+ static errorCodeField = "code";
467
+ static chromiumNoSandboxOption = "--no-sandbox";
468
+ static chromiumTypePrefix = "--type=";
469
+ static chromiumRendererType = "renderer";
470
+ static seccompFilterMode = 2;
471
+ static processIdPattern = /^[1-9]\d*$/u;
472
+ static processParentLinePattern = /^PPid:\s+(\d+)$/mu;
473
+ static processSeccompLinePattern = /^Seccomp:\s+(\d+)$/mu;
474
+ static processStatusFile = "status";
475
+ static processCommandLineFile = "cmdline";
476
+ static processArgumentSeparator = /[\0 ]+/u;
477
+ static processEndedCodes = new Set(["ENOENT", "ESRCH", "EACCES"]);
478
+ static sandboxFilterWait = 5000;
479
+ static sandboxPause = 250;
480
+ static sandboxUntypedProcess = "untyped";
481
+ static sandboxWithOption = "with";
482
+ static sandboxWithoutOption = "without";
483
+ static builderUnpackField = "asarUnpack";
484
+ static unpackedPatternCharacters = /[*?[\]{}()!\\]/u;
485
+ static unpackedPackagesFolder = `${Resources.nodeModulesFolder}${Resources.pathSegmentSeparator}`;
486
+ static unpackedPackagePrefix = `**/${Resources.unpackedPackagesFolder}`;
487
+ static unpackedNoneVerified = "The package's configuration keeps no named file outside app.asar.";
488
+ static statusWindowField = "window";
489
+ static statusTitleField = "title";
490
+ static statusIsVisibleField = "isVisible";
491
+ static statusIsPaintedField = "isPainted";
492
+ static windowTitlePageSeparator = " — ";
493
+ static gypMakeExtension = ".mk";
494
+ static shippedBuildFolder = "build";
495
+ static shippedSourceFolder = "src";
496
+ static shippedResourceForkPrefix = "._";
497
+ static packageLockFileName = "package-lock.json";
498
+ static shippedIgnoredNames = new Set([
499
+ ".git", ".hg", ".svn", "CVS", "RCS", "SCCS", "__pycache__", ".DS_Store", "thumbs.db", ".gitignore", ".gitkeep", ".gitattributes", ".npmignore", ".idea", ".vs",
500
+ ".flowconfig", ".jshintrc", ".eslintrc", ".circleci", ".yarn-integrity", ".yarn-metadata.json", "yarn-error.log", "yarn.lock", Resources.packageLockFileName, "npm-debug.log",
501
+ "pnpm-lock.yaml", "bun.lock", "bun.lockb", "appveyor.yml", ".travis.yml", "circle.yml", ".nyc_output", ".husky", ".github", "electron-builder.env"
502
+ ]);
503
+ static shippedAppIgnoredNames = new Set([
504
+ "electron-builder.yaml", "electron-builder.yml", Resources.packageConfigurationFile, "electron-builder.json5", "electron-builder.toml", "electron-builder.ts"
505
+ ]);
506
+ static shippedIgnoredExtensions = [
507
+ ".iml", ".hprof", ".orig", ".pyc", ".pyo", ".rbc", ".swp", ".csproj", ".sln", ".suo", ".xproj", ".cc", ".d.ts", Resources.gypMakeExtension, ".a", ".o", ".obj", ".forge-meta",
508
+ ".pdb"
509
+ ];
510
+ static shippedTopIgnoredNames = new Set([".yarn", ".editorconfig", ".yarnrc.yml"]);
511
+ static shippedPackageIgnoredNames = new Set([
512
+ "CHANGELOG.md", "ChangeLog", "changelog.md", "Changelog.md", "Changelog", "binding.gyp", "node_gyp_bins"
513
+ ]);
514
+ static shippedWindowsExtensions = [Resources.windowsLibraryExtension, Resources.windowsProgramExtension];
515
+ static shippedPackageTopIgnoredNames = new Set([
516
+ "karma.conf.js", ".coveralls.yml", "README.md", "readme.markdown", "README", "readme.md", "Readme.md", "Readme", "readme", "test", "tests", "__tests__", "powered-test",
517
+ "example", "examples", ".bin"
518
+ ]);
519
+ static shippedBuildIgnoredNames = new Set(["gyp-mac-tool", "Makefile"]);
520
+ static shippedBuildIgnoredExtensions = [Resources.gypMakeExtension, ".gypi", ".Makefile"];
521
+ static shippedReleaseFolder = "Release";
522
+ static shippedReleaseIgnoredNames = new Set([".deps", "obj.target"]);
523
+ static shippedPackageIgnoredFolders = new Map([
524
+ ["keytar", new Set([Resources.shippedSourceFolder])], ["keytar-prebuild", new Set([Resources.shippedSourceFolder])],
525
+ ["lzma-native", new Set([Resources.shippedBuildFolder, "deps"])]
526
+ ]);
527
+ static shippedPackageTopIgnoredFolders = new Map([
528
+ ["libui-node", new Set([Resources.shippedBuildFolder, "docs", Resources.shippedSourceFolder])]
529
+ ]);
530
+ static shippedScopedPackageOffset = 3;
531
+ static shippedPackageOffset = 2;
532
+ static shippedWindowsFilesOmission = "it leaves a package's .exe and .dll files out of macOS and Linux packages.";
533
+ static shippedResourceForkOmission = `it leaves out every file and folder whose name starts with ${Resources.shippedResourceForkPrefix}.`;
534
+ static signingCredentialNames = [...Resources.windowsSigningCredentials, Resources.windowsPublisherVariable, ...Resources.macSigningCredentials];
535
+ static installedLockfileSegments = [Resources.nodeModulesFolder, ".package-lock.json"];
536
+ static lockfileVersion = 3;
537
+ static lockfileRootLocation = String.empty;
538
+ static lockfileNestedFolder = `${Resources.pathSegmentSeparator}${Resources.nodeModulesFolder}${Resources.pathSegmentSeparator}`;
539
+ static lockfileNegation = "!";
540
+ static lockfilePlatforms = new Map([[Resources.windowsTarget, "win32"], [Resources.macosTarget, "darwin"], [Resources.linuxTarget, "linux"]]);
541
+ static lockfileLinuxLibrary = "glibc";
542
+ static lockfileVersionField = "lockfileVersion";
543
+ static lockfilePackagesField = "packages";
544
+ static lockfileDependenciesField = "dependencies";
545
+ static lockfileOptionalDependenciesField = "optionalDependencies";
546
+ static lockfilePeerDependenciesField = "peerDependencies";
547
+ static lockfileOsField = "os";
548
+ static lockfileCpuField = "cpu";
549
+ static lockfileLibcField = "libc";
550
+ static rootLockfileTitle = `The root ${Resources.packageLockFileName}`;
551
+ static installedLockfileTitle = `npm's ${Resources.installedLockfileSegments.join(Resources.pathSegmentSeparator)}`;
552
+ static trustedSigningModuleName = "TrustedSigning";
553
+ static trustedSigningModuleVersion = "0.5.8";
554
+ static trustedSigningModuleFolder = "module";
555
+ static trustedSigningToolsFolder = "tools";
556
+ static nugetFlatContainerUrl = "https://api.nuget.org/v3-flatcontainer";
557
+ static nugetPackageExtension = ".nupkg";
558
+ static trustedSigningTimeout = 300_000;
559
+ static trustedSigningDownloadTimeout = 120_000;
560
+ static pinnedPackageHashAlgorithm = "sha512";
561
+ static powershellManifestExtension = ".psd1";
562
+ static trustedSigningArchivesVariable = "NOLDOVA_DESKTOP_SIGNING_ARCHIVES";
563
+ static trustedSigningDestinationsVariable = "NOLDOVA_DESKTOP_SIGNING_DESTINATIONS";
564
+ static trustedSigningFolderVariable = "NOLDOVA_DESKTOP_SIGNING_FOLDER";
565
+ static trustedSigningFileVariable = "NOLDOVA_DESKTOP_SIGNING_FILE";
566
+ static trustedSigningEndpointVariable = "NOLDOVA_DESKTOP_SIGNING_ENDPOINT";
567
+ static trustedSigningAccountVariable = "NOLDOVA_DESKTOP_SIGNING_ACCOUNT";
568
+ static trustedSigningProfileVariable = "NOLDOVA_DESKTOP_SIGNING_PROFILE";
569
+ static trustedSigningAccountVariables = [
570
+ Resources.trustedSigningEndpointVariable, Resources.trustedSigningAccountVariable, Resources.trustedSigningProfileVariable
571
+ ];
572
+ static trustedSigningFileSeparator = ",";
573
+ static trustedSigningTimestampServer = "http://timestamp.acs.microsoft.com";
574
+ static trustedSigningDigest = "SHA256";
575
+ static trustedSigningImportLine = `Microsoft.PowerShell.Core\\Import-Module (Microsoft.PowerShell.Management\\Join-Path $env:${Resources.trustedSigningFolderVariable} `
576
+ + `'${Resources.trustedSigningModuleFolder}' '${Resources.trustedSigningModuleName}${Resources.powershellManifestExtension}')`;
577
+ static trustedSigningExpandScript = [
578
+ Resources.powershellStopLine,
579
+ `$archives = $env:${Resources.trustedSigningArchivesVariable}.Split([char]10)`,
580
+ `$destinations = $env:${Resources.trustedSigningDestinationsVariable}.Split([char]10)`,
581
+ "for ($index = 0; $index -lt $archives.Count; $index++) { Microsoft.PowerShell.Archive\\Expand-Archive -LiteralPath $archives[$index] -DestinationPath $destinations[$index] }",
582
+ Resources.trustedSigningImportLine,
583
+ `$module = Microsoft.PowerShell.Core\\Get-Module -Name ${Resources.trustedSigningModuleName}`,
584
+ `if ($module.Version -ne [version]'${Resources.trustedSigningModuleVersion}') { throw "${Resources.trustedSigningModuleName} $($module.Version) loaded instead of ${Resources.trustedSigningModuleVersion}." }`
585
+ ].join(Resources.lineSeparator);
586
+ static trustedSigningSignLines = [
587
+ Resources.trustedSigningImportLine,
588
+ `${Resources.trustedSigningModuleName}\\Invoke-TrustedSigning -Endpoint $env:${Resources.trustedSigningEndpointVariable} `
589
+ + `-CodeSigningAccountName $env:${Resources.trustedSigningAccountVariable} -CertificateProfileName $env:${Resources.trustedSigningProfileVariable} -FileDigest '${Resources.trustedSigningDigest}' `
590
+ + `-TimestampRfc3161 '${Resources.trustedSigningTimestampServer}' -TimestampDigest '${Resources.trustedSigningDigest}' -Files $env:${Resources.trustedSigningFileVariable}`
591
+ ];
592
+ static trustedSigningSignScript = [Resources.powershellStopLine, ...Resources.trustedSigningSignLines].join(Resources.lineSeparator);
593
+ static trustedSigningLibrarySignScript = [
594
+ Resources.powershellStopLine,
595
+ `if ((Microsoft.PowerShell.Security\\Get-AuthenticodeSignature -LiteralPath $env:${Resources.trustedSigningFileVariable}).Status -eq 'Valid') { exit 0 }`,
596
+ ...Resources.trustedSigningSignLines
597
+ ].join(Resources.lineSeparator);
598
+ static hashDigestEncoding = "base64";
599
+ static trustedSigningModuleSha512 = "h3QX13+As/6i8v7rSUhgDWg033GklH5JiVLGFV0Rl3CipfT6/0XQPqEhI2uOogGTFkxiqXOTCeQc4zTSt2v6KQ==";
600
+ static buildToolsPackageName = "Microsoft.Windows.SDK.BuildTools";
601
+ static buildToolsPackageVersion = "10.0.26100.4188";
602
+ static buildToolsPackageSha512 = "OkiRhdDr0ngD6+wm0Ezdu1mgV8ZuknXdHwjzeHVZjYSXi9bCkYkq9Ns/X/ab9BoHb+Tq/5/RmXbdNWtC0qHipQ==";
603
+ static signingClientPackageName = "Microsoft.Trusted.Signing.Client";
604
+ static signingClientPackageVersion = "1.0.95";
605
+ static signingClientPackageSha512 = "uTRnbWSg1agZUh8J5bqJXhJr4LZ9dzs6Xy9PNxK4yA9ubpGuPq71bz1AZMmiKs/HVbQc3NUChtGMVexqmuV+kA==";
606
+ static signToolPackageName = "sign";
607
+ static signToolPackageVersion = "0.9.1-beta.24469.1";
608
+ static signToolPackageSha512 = "JftL2Fv9TwqfQdxh3Sjq/iqPb8lWEIMgDfa32KCXFqkebD1iadk10eRTjagVQgoxxRQiOp39eCd0ufs5cPD93A==";
609
+ static trustedSigningExpandAction = "expanding and loading";
610
+ static trustedSigningModuleUrl = `https://www.powershellgallery.com/api/v2/package/${Resources.trustedSigningModuleName}/${Resources.trustedSigningModuleVersion}`;
611
+ static desktopUnpackedField = "unpacked";
612
+ static installedPackageFolderPattern = /(?:^|\/)node_modules\/(?:@[^/]+\/)?[^@/][^/]*$/u;
613
+ static absolutePathPattern = /^(?:\/|[A-Za-z]:)/u;
614
+ static currentFolderSegment = ".";
615
+ static unpackedRelativeSegments = [String.empty, Resources.currentFolderSegment, Resources.parentFolderSegment];
616
+ static unpackedNamedTwice = "it names that file twice; name each file once.";
617
+ static unpackedWildcardPath = "its path holds a character a file pattern reads as a wildcard; name the file with / between folders.";
618
+ static unpackedAbsolutePath = "it is an absolute path; name the file from the package's folder.";
619
+ static unpackedRelativePath = "its path has an empty, . or .. segment; name the file from the package's folder without one.";
620
+ static unpackedPackagesPath = `its path goes into ${Resources.nodeModulesFolder}, which holds other packages; each package names only its own files.`;
621
+ static unpackedNoFile = "the package holds no file there.";
622
+ static unpackedLinkOutside = "a symbolic link on its path leads outside the package's own files; name a file the package holds itself.";
623
+ static registryCommand = "reg.exe";
624
+ static userEnvironmentKey = "HKCU\\Environment";
625
+ static userPathName = "Path";
626
+ static registryValueOption = "/v";
627
+ static registryForceOption = "/f";
628
+ static registryTypeOption = "/t";
629
+ static registryDataOption = "/d";
630
+ static userPathQueryArguments = ["query", Resources.userEnvironmentKey, Resources.registryValueOption, Resources.userPathName];
631
+ static userPathDeleteArguments = ["delete", Resources.userEnvironmentKey, Resources.registryValueOption, Resources.userPathName,
632
+ Resources.registryForceOption];
633
+ static userPathAddArguments = ["add", Resources.userEnvironmentKey, Resources.registryValueOption, Resources.userPathName];
634
+ static registryMissingExitCode = 1;
635
+ static registryTimeout = 30_000;
636
+ static userPathValuePattern = /^ {4}Path {4}(REG_(?:EXPAND_)?SZ) {4}([^\r\n]*)$/im;
637
+ static userPathSeparator = ";";
638
+ static windowsUnpackedFolderPrefix = "win";
639
+ static windowsUnpackedFolderSuffix = "unpacked";
640
+ static windowsUnpackedFolderSeparator = "-";
641
+ static windowsDefaultArchitecture = "x64";
642
+ static sourceFolder = "src";
643
+ static jsonIndent = 2;
644
+ static qualifiedNameSeparator = ".";
645
+ static qualifiedNameForm = "<id>.<name>";
646
+ static kebabSeparator = "-";
647
+ static snakeSeparator = "_";
648
+ static camelCaseNamePattern = /^[a-z][a-zA-Z0-9]*$/;
649
+ static qualifiedNamePattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*\.[a-z][a-zA-Z0-9]*$/;
650
+ static upperCaseLetterPattern = /[A-Z]/g;
651
+ static modulePartsExpected = `${Resources.runtimePart}, ${Resources.windowPart} or ${Resources.cliPart}`;
652
+ static methodsKind = "methods";
653
+ static eventsKind = "events";
654
+ static commandsKind = "commands";
655
+ static notificationsKind = "notifications";
656
+ static viewsKind = "views";
657
+ static documentsKind = "documents";
658
+ static placeholdersKind = "placeholders";
659
+ static statusBarItemsKind = "statusBarItems";
660
+ static topBarActionsKind = "topBarActions";
661
+ static menusKind = "menus";
662
+ static themesKind = "themes";
663
+ static toolsKind = "tools";
664
+ static moduleContributionKinds = [
665
+ Resources.methodsKind, Resources.eventsKind, Resources.commandsKind, Resources.notificationsKind, Resources.viewsKind, Resources.documentsKind, Resources.placeholdersKind,
666
+ Resources.statusBarItemsKind, Resources.topBarActionsKind, Resources.menusKind, Resources.themesKind, Resources.settingsKind, Resources.settingScopesKind,
667
+ Resources.settingsPagesKind, Resources.cliCommandsKind, Resources.toolsKind
668
+ ];
669
+ static idField = "id";
670
+ static versionField = "version";
671
+ static displayNameField = "displayName";
672
+ static descriptionField = "description";
673
+ static partsField = "parts";
674
+ static dependenciesField = "dependencies";
675
+ static optionalDependenciesField = "optionalDependencies";
676
+ static contributesField = "contributes";
677
+ static pseudoTerminalsField = "pseudoTerminals";
678
+ static switchSettingField = "switchSetting";
679
+ static platformsField = "platforms";
680
+ static noldovaDesktopField = "noldovaDesktop";
681
+ static nameField = "name";
682
+ static typeField = "type";
683
+ static kindField = "kind";
684
+ static localityField = "locality";
685
+ static scopesField = "scopes";
686
+ static summaryField = "summary";
687
+ static argumentsField = "arguments";
688
+ static optionsField = "options";
689
+ static examplesField = "examples";
690
+ static requiredField = "required";
691
+ static variadicField = "variadic";
692
+ static repeatedField = "repeated";
693
+ static defaultField = "default";
694
+ static keysField = "keys";
695
+ static macKeysField = "macKeys";
696
+ static newWindowsField = "newWindows";
697
+ static parametersField = "parameters";
698
+ static valuesField = "values";
699
+ static minimumField = "minimum";
700
+ static maximumField = "maximum";
701
+ static maxLengthField = "maxLength";
702
+ static fieldsField = "fields";
703
+ static placesField = "places";
704
+ static groupsField = "groups";
705
+ static titleField = "title";
706
+ static showsField = "shows";
707
+ static shownField = "shown";
708
+ static afterField = "after";
709
+ static beforeField = "before";
710
+ static newRowField = "newRow";
711
+ static placeField = "place";
712
+ static exclusiveField = "exclusive";
713
+ static dynamicField = "dynamic";
714
+ static itemsField = "items";
715
+ static commandField = "command";
716
+ static labelField = "label";
717
+ static submenuField = "submenu";
718
+ static choiceField = "choice";
719
+ static pagesField = "pages";
720
+ static pageField = "page";
721
+ static groupField = "group";
722
+ static stepField = "step";
723
+ static checkedField = "checked";
724
+ static valueField = "value";
725
+ static peerDependenciesField = "peerDependencies";
726
+ static peerDependenciesMetaField = "peerDependenciesMeta";
727
+ static optionalField = "optional";
728
+ static packageField = "package";
729
+ static desktopField = "desktop";
730
+ static modulesField = "modules";
731
+ static productField = "product";
732
+ static permissionsModuleField = "permissionsModule";
733
+ static modulesListSection = `${Resources.desktopField}.${Resources.modulesField}`;
734
+ static textType = "Text";
735
+ static numberType = "Number";
736
+ static booleanType = "Boolean";
737
+ static choiceType = "Choice";
738
+ static modulesType = "Modules";
739
+ static actionType = "Action";
740
+ static deviceLocality = "Device";
741
+ static sharedLocality = "Shared";
742
+ static reservedCommands = ["status", "commands", "run", "open", "quit", "help"];
743
+ static reservedOptions = ["data-dir", "device-dir", "timeout", "args-file", "json", "no-start", "take-over", "help"];
744
+ static windowsDeviceNames = [
745
+ "con", "prn", "aux", "nul",
746
+ "com0", "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9",
747
+ "lpt0", "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9"
748
+ ];
749
+ static moduleDeclarationFileName = "module.json";
750
+ static moduleShellId = "desktop";
751
+ static moduleReservedIds = [Resources.moduleShellId, ...Resources.reservedCommands];
752
+ static moduleIdPattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
753
+ static moduleToolPattern = /^[a-z][a-z0-9_]{0,63}$/;
754
+ static moduleToolNameLimit = 64;
755
+ static moduleDeclarationFields = [
756
+ Resources.idField, Resources.versionField, Resources.displayNameField, Resources.descriptionField, Resources.partsField, Resources.dependenciesField,
757
+ Resources.optionalDependenciesField, Resources.contributesField, Resources.pseudoTerminalsField, Resources.switchSettingField, Resources.platformsField,
758
+ Resources.noldovaDesktopField
759
+ ];
760
+ static modulePlatforms = [Resources.windowsTarget, Resources.macosTarget, Resources.linuxTarget];
761
+ static modulePlatformsExpected = `${Resources.windowsTarget}, ${Resources.macosTarget} or ${Resources.linuxTarget}`;
762
+ static moduleWindowEntry = "window/src/api/index";
763
+ static moduleDependsOn = "depends on";
764
+ static moduleOptionallyDependsOn = "optionally depends on";
765
+ static moduleOptionalDependenciesLabel = "optional dependencies";
766
+ static moduleVersionInvalid = "must have a version of the form <major>.<minor>.<patch>: three whole numbers of up to nine digits without leading zeros, such as 0.0.1";
767
+ static moduleDisplayNameMissing = "must have a display name";
768
+ static moduleDescriptionMissing = "must have a description";
769
+ static moduleContributesNotObject = "must list its contributions as an object";
770
+ static modulePlaceholderRepeated = "declares more than one placeholder, and a window shows one";
771
+ static modulePlaceholderWithoutWindow = "declares a placeholder without a window part, which registers it";
772
+ static moduleSettingsPagesWithoutWindow = "declares settings pages without a window part, which registers them";
773
+ static moduleCliCommandsWithoutCli = "declares command-line commands without a cli part";
774
+ static moduleWebViewsWithoutWindow = `declares web views in ${Resources.webViewsFileName} without a window part, which opens them`;
775
+ static modulePseudoTerminalsNotBoolean = `must declare ${Resources.pseudoTerminalsField} as true or false`;
776
+ static modulePseudoTerminalsWithoutRuntime = "declares pseudo-terminals without a runtime part, which starts them";
777
+ static moduleSwitchSettingUnknown = `must name one of its own settings, which ${Resources.settingsFileName} defines, as its ${Resources.switchSettingField}`;
778
+ static modulePlatformsEmpty = `must name at least one platform as its ${Resources.platformsField}, or leave the field out to run on every platform`;
779
+ static versionPattern = /^(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})$/;
780
+ static versionRangePattern = /^>=(\S+) <(\S+)$/;
781
+ static versionSeparator = ".";
782
+ static versionPartCount = 3;
783
+ static moduleArtifactsFolder = "modules";
784
+ static moduleDeclarationsFileName = "declarations.json";
785
+ static moduleDeclarationsFile = `${Resources.buildFolder}/${Resources.moduleArtifactsFolder}/${Resources.moduleDeclarationsFileName}`;
786
+ static moduleOutputDeclarationsSegments = [Resources.moduleArtifactsFolder, Resources.moduleDeclarationsFileName];
787
+ static moduleWindowPartsFile = `${Resources.buildFolder}/generated/window-parts.ts`;
788
+ static moduleDeclarationsFormatVersion = 2;
789
+ static windowPartSourceKinds = [
790
+ Resources.viewsKind, Resources.documentsKind, Resources.commandsKind, Resources.statusBarItemsKind, Resources.topBarActionsKind, Resources.notificationsKind
791
+ ];
792
+ static windowPartsSourceImport = "import { type IWindowInputs, WindowPartSource } from \"@noldova/desktop.window/build\";\n";
793
+ static cliFileName = "cli.json";
794
+ static cliCommandFields = [
795
+ Resources.nameField, Resources.summaryField, Resources.descriptionField, Resources.argumentsField, Resources.optionsField, Resources.examplesField
796
+ ];
797
+ static cliOptionalCommandFields = [Resources.descriptionField, Resources.examplesField];
798
+ static cliArgumentFields = [Resources.nameField, Resources.descriptionField, Resources.requiredField, Resources.variadicField];
799
+ static cliArgumentOptionalFields = [Resources.requiredField, Resources.variadicField];
800
+ static cliValueFields = [
801
+ Resources.nameField, Resources.descriptionField, Resources.typeField, Resources.requiredField, Resources.repeatedField, Resources.defaultField
802
+ ];
803
+ static cliValueOptionalFields = [Resources.requiredField, Resources.repeatedField, Resources.defaultField];
804
+ static cliBooleanFields = [Resources.nameField, Resources.descriptionField, Resources.typeField];
805
+ static cliExampleFields = [Resources.argumentsField, Resources.descriptionField];
806
+ static cliOptionTypes = [Resources.textType, Resources.numberType, Resources.booleanType];
807
+ static cliNameOrSummaryBlank = "must have a name and a summary that are not blank";
808
+ static cliDescriptionBlank = "must have a description that is not blank, or none";
809
+ static cliNamesRepeated = "must name each of its arguments and options once";
810
+ static cliRequiredAfterOptional = "must not have a required argument after an optional one";
811
+ static cliVariadicNotLast = "must have only its last argument variadic";
812
+ static cliArgumentFlagsNotBoolean = "must have a required and a variadic that are true or false";
813
+ static cliOptionTypeInvalid = `must have the type ${Resources.textType}, ${Resources.numberType} or ${Resources.booleanType}`;
814
+ static cliValueFlagsNotBoolean = "must have a required and a repeated that are true or false";
815
+ static cliDefaultInvalid = "must have a default its type accepts, or none, and none when it is required or repeated";
816
+ static cliExampleInvalid = "must have arguments as text and a description that is not blank";
817
+ static cliMemberInvalid = "must have a camelCase name and a description that is not blank";
818
+ static menusFileName = "menus.json";
819
+ static menuShowsMenu = "menu";
820
+ static menuShowsMenuBar = "menuBar";
821
+ static menuShowsToolbar = "toolbar";
822
+ static menuShows = [Resources.menuShowsMenu, Resources.menuShowsMenuBar, Resources.menuShowsToolbar];
823
+ static menusFields = [Resources.placesField, Resources.groupsField];
824
+ static menuToolbarFields = [Resources.shownField, Resources.afterField, Resources.beforeField, Resources.newRowField];
825
+ static menuAnchorFields = [Resources.afterField, Resources.beforeField];
826
+ static menuPlaceFields = [Resources.nameField, Resources.titleField, Resources.showsField, ...Resources.menuToolbarFields];
827
+ static menuGroupFields = [Resources.nameField, Resources.placeField, Resources.exclusiveField, Resources.dynamicField, Resources.itemsField];
828
+ static menuCommandFields = [Resources.commandField, Resources.argumentsField, Resources.labelField];
829
+ static menuSubmenuFields = [Resources.submenuField];
830
+ static menuChoiceFields = [Resources.choiceField];
831
+ static menusFileInvalid = `must be a JSON object with ${Resources.placesField} and ${Resources.groupsField}`;
832
+ static menusPlaceRepeated = "describes a place more than once";
833
+ static menusGroupRepeated = "names a group more than once";
834
+ static menusPlaceInvalid = "must describe each place with a name, a title and optionally shows";
835
+ static menusGroupInvalid = "must describe each group with a name, a place, its items or dynamic, and optionally exclusive";
836
+ static settingsFileFields = [Resources.settingsKind, Resources.pagesField];
837
+ static settingsPageFields = [Resources.nameField, Resources.titleField];
838
+ static settingFields = [
839
+ Resources.nameField, Resources.titleField, Resources.descriptionField, Resources.typeField, Resources.defaultField, Resources.localityField, Resources.scopesField,
840
+ Resources.pageField, Resources.groupField
841
+ ];
842
+ static settingTextFields = [Resources.titleField, Resources.descriptionField, Resources.pageField, Resources.groupField];
843
+ static settingLocalities = [Resources.deviceLocality, Resources.sharedLocality];
844
+ static settingKindFields = new Map([
845
+ [Resources.booleanType, []],
846
+ [Resources.choiceType, [Resources.optionsField]],
847
+ [Resources.numberType, [Resources.minimumField, Resources.maximumField, Resources.stepField]],
848
+ [Resources.textType, [Resources.maxLengthField]],
849
+ [Resources.modulesType, []],
850
+ [Resources.actionType, [Resources.commandField, Resources.labelField]]
851
+ ]);
852
+ static settingDynamicChoiceFields = [Resources.dynamicField];
853
+ static settingCheckedTextFields = [Resources.maxLengthField, Resources.checkedField];
854
+ static settingStepTolerance = 1e-9;
855
+ static settingChoiceOptionFieldCount = 2;
856
+ static settingFieldsInvalid = `must have exactly the fields ${Resources.settingFields.join(", ")}`;
857
+ static settingTextsBlank = "must have a title, description, page and group that are not blank";
858
+ static settingDefaultInvalid = "must have a default its type accepts";
859
+ static settingLocalityInvalid = `must have the locality ${Resources.settingLocalities.join(" or ")}`;
860
+ static settingScopesInvalid = `must list distinct scopes, each one its module declares among its ${Resources.settingScopesKind} or a dependency's, and none for a device setting`;
861
+ static settingTypeInvalid = "must have a type of kind Boolean, Choice, Number, Text, Modules or Action, with exactly that kind's fields, a choice either options or dynamic, and a text optionally checked";
862
+ static settingDynamicChoiceInvalid = "must have a dynamic choice type whose dynamic is true";
863
+ static settingTextMaxLengthInvalid = "must have a text type whose maxLength is a positive integer";
864
+ static settingCheckedTextInvalid = "must have a checked text type whose checked is true";
865
+ static settingActionInvalid = "must have an action type whose command is one its module declares and whose label is not blank";
866
+ static settingChoiceInvalid = "must have a choice type with options, each with a distinct value, empty or not blank, and a title that is not blank";
867
+ static settingNumberInvalid = "must have a number type whose minimum is no greater than its maximum and whose step is positive";
868
+ static modKey = "Mod";
869
+ static ctrlKey = "Ctrl";
870
+ static altKey = "Alt";
871
+ static shiftKey = "Shift";
872
+ static keyChordSeparator = "+";
873
+ static functionKeyPattern = /^F\d+$/;
874
+ static functionKeyCount = 24;
875
+ static webViewKeyModifiers = [Resources.modKey, Resources.ctrlKey, Resources.altKey, Resources.shiftKey];
876
+ static webViewKeyNames = [
877
+ ..."ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
878
+ "Backquote", "Minus", "Equal", "BracketLeft", "BracketRight", "Backslash", "Semicolon", "Quote", "Comma", "Period", "Slash",
879
+ "Enter", "Escape", "Tab", "Space", "Backspace", "Delete", "Insert", "Home", "End", "PageUp", "PageDown", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight",
880
+ ...Array.from({ length: Resources.functionKeyCount }, (_, index) => Resources.formatFunctionKey(index + 1))
881
+ ];
882
+ static webViewEditingKeys = ["Mod+A", "Mod+C", "Mod+V", "Mod+X", "Mod+Z", "Mod+Y", "Mod+Shift+Z"];
883
+ static webViewMacSystemKeys = ["Mod+Q", "Mod+W", "Mod+H", "Mod+M", "Mod+Comma", "Mod+Tab", "Mod+Space", "Mod+Alt+Escape"];
884
+ static webViewStandardSystemKeys = ["Alt+F4", "Alt+Tab", "Mod+Escape"];
885
+ static webViewShellKeys = [
886
+ ["desktop.search", ["Mod+K"], ["Mod+K"]],
887
+ ["desktop.showCommands", ["Mod+Shift+P"], ["Mod+Shift+P"]],
888
+ ["desktop.goBack", ["Alt+ArrowLeft"], ["Mod+BracketLeft"]],
889
+ ["desktop.goForward", ["Alt+ArrowRight"], ["Mod+BracketRight"]],
890
+ ["desktop.openSettings", ["Mod+Comma"], ["Mod+Comma"]],
891
+ ["desktop.closeTab", ["Mod+W"], ["Mod+W"]],
892
+ ["desktop.nextTab", ["Ctrl+Tab", "Ctrl+PageDown"], ["Ctrl+Tab", "Mod+Alt+ArrowRight"]],
893
+ ["desktop.previousTab", ["Ctrl+Shift+Tab", "Ctrl+PageUp"], ["Ctrl+Shift+Tab", "Mod+Alt+ArrowLeft"]],
894
+ ["desktop.toggleLeftDock", ["Mod+B"], ["Mod+B"]],
895
+ ["desktop.toggleBottomDock", ["Mod+J"], ["Mod+J"]],
896
+ ["desktop.toggleRightDock", ["Mod+Alt+B"], ["Mod+Alt+B"]]
897
+ ];
898
+ static webViewStopAgentControlKey = "Mod+Shift+Period";
899
+ static webViewKeysLimit = 32;
900
+ static webViewChordsLimit = 4;
901
+ static webViewMethodPattern = /^[A-Z][A-Za-z]*\.[a-z][A-Za-z]*$/;
902
+ static webViewRefusedMethods = [
903
+ "Page.navigate", "Page.navigateToHistoryEntry", "Page.reload", "Page.setDocumentContent", "Page.resetNavigationHistory",
904
+ "Page.setInterceptFileChooserDialog", "Page.disable", "Page.setDownloadBehavior", "Page.close", "Page.crash",
905
+ "Network.setRequestInterception", "Network.continueInterceptedRequest"
906
+ ];
907
+ static webViewRefusedDomains = ["Target", "Browser", "Fetch", "Security"];
908
+ static webViewFields = [Resources.methodsKind, Resources.eventsKind, Resources.keysField, Resources.newWindowsField];
909
+ static webViewMethodFields = [Resources.nameField, Resources.parametersField];
910
+ static webViewKeyFields = [Resources.nameField, Resources.keysField, Resources.macKeysField];
911
+ static webViewRuleFields = [
912
+ Resources.requiredField, Resources.valuesField, Resources.minimumField, Resources.maximumField, Resources.maxLengthField, Resources.fieldsField
913
+ ];
914
+ static webViewStandardPlatforms = "Windows and Linux";
915
+ static webViewMacPlatform = "macOS";
916
+ static webViewFileInvalid = `must be an object with optional ${Resources.methodsKind}, ${Resources.eventsKind}, ${Resources.keysField} and ${Resources.newWindowsField}`;
917
+ static webViewMethodRepeated = "names a method more than once";
918
+ static webViewEventsInvalid = "must list its events once each as a debugging protocol domain, a dot and a name, such as Page.loadEventFired";
919
+ static webViewNewWindowsNotBoolean = `must say ${Resources.newWindowsField} as true or false`;
920
+ static webViewKeysInvalid = `must name each of its keys once, with at most ${Resources.webViewKeysLimit} names`;
921
+ static modulePackageFixturesFolder = `${Resources.moduleFixtureFolder}/packages`;
922
+ static modulesSourceFolder = `${Resources.sourceFolder}/modules`;
923
+ static angularCorePackage = "@angular/core";
924
+ static angularPeerRangeForm = ">=<the Angular it builds with> <the next Angular major>, such as >=22.2.5 <23.0.0";
925
+ static desktopRuntimePackage = "@noldova/desktop.runtime";
926
+ static catalogPeerFields = [Resources.peerDependenciesField];
927
+ static shellSettingsPages = ["General", "Appearance", "Notifications", "Keyboard shortcuts", "Gallery", "About"];
928
+ static moduleListRequired = `The root ${Resources.packageManifestFileName} must list the build's modules once each in ${Resources.modulesListSection}, each as its id or as { "id": "<id>", "package": "<package name>" }.`;
929
+ static moduleListEntryFieldCount = 2;
930
+ static packageNamePattern = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
931
+ static catalogAppHolder = "the app has";
932
+ static catalogBuildHolder = "the build gives it";
933
+ static catalogWorkspaceHolder = "the app's install has";
934
+ static npmExecPathVariable = "npm_execpath";
935
+ static npmUnavailable = `${Resources.npmExecPathVariable} is not set; run this through npm, such as npm run build or npm test.`;
936
+ static npmCommandTimeout = 600_000;
937
+ static nodeGypScriptSegments = ["..", Resources.nodeModulesFolder, "node-gyp", "bin", "node-gyp.js"];
938
+ static nodeGypTimeout = 600_000;
939
+ static typeScriptManifestPath = "typescript/package.json";
940
+ static typeScriptCompilerPath = "bin/tsc";
941
+ static aboutLogoFolder = "about";
942
+ static windowBrowserFolder = "browser";
943
+ static aboutLogoLightFile = "icon-light-512.png";
944
+ static aboutLogoSeparator = "/";
945
+ static allFilesPattern = "**/*";
946
+ static angularWorkspaceFile = "angular.json";
947
+ static angularProjectsField = "projects";
948
+ static angularArchitectField = "architect";
949
+ static angularInstallRecord = `${Resources.nodeModulesFolder}/.noldova-install`;
950
+ static angularDependencyCache = `${Resources.nodeModulesFolder}/.vite`;
951
+ static angularCli = `${Resources.nodeModulesFolder}/@angular/cli/bin/ng.js`;
952
+ static playwrightCli = `${Resources.nodeModulesFolder}/playwright/cli.js`;
953
+ static angularInstallArguments = ["ci", "--ignore-scripts", "--no-audit", "--no-fund"];
954
+ static angularSingleCopyPackage = "@angular/cdk";
955
+ static angularListArguments = ["ls", Resources.angularSingleCopyPackage, "--all", "--long", "--json"];
956
+ static angularBrowserArguments = ["install", "--only-shell", "chromium"];
957
+ static angularTestTarget = "test";
958
+ static angularBuildArguments = ["build"];
959
+ static angularOutputPathOption = "--output-path";
960
+ static windowFolder = "window";
961
+ static windowOutputSegments = [Resources.buildFolder, Resources.windowFolder];
962
+ static windowAppSuffix = ".window.app";
963
+ static angularNoProject = `No window app in ${Resources.sourceFolder}/, a folder whose name ends in ${Resources.windowAppSuffix} and holds an angular.json; there is nothing to prepare.\n`;
964
+ static angularInstalling = "Installing the app's packages from its package-lock.json...\n";
965
+ static angularInstallingBrowser = "Installing the browser for the Angular tests...\n";
966
+ static angularNotInstalled = `The app isn't installed for its package-lock.json; run ${Resources.commandName} ${Resources.installCommand} first, `
967
+ + "with the token for the registry its packages come from.";
968
+ static angularNoBrowser = `No test target in an angular.json of a folder in ${Resources.sourceFolder}/, so no browser for the Angular tests.\n`;
969
+ static angularBrowserSubject = "The browser for the Angular tests";
970
+ static angularBuilding = "Building the window...\n";
971
+ static generatedFolder = "generated";
972
+ static galleryFileSegments = [Resources.buildFolder, Resources.generatedFolder, "gallery.ts"];
973
+ static galleryTypeImport = "import type { Type } from \"@angular/core\";\n";
974
+ static galleryComponentImport = "import { GalleryComponent } from \"@noldova/ui.components.angular/gallery\";\n";
975
+ static productFileSegments = [Resources.buildFolder, Resources.generatedFolder, "product.ts"];
976
+ static productAboutTypeImport = "import type { IProductAbout } from \"@noldova/desktop.window/build\";";
977
+ static installedCopiesTrailSeparator = " > ";
978
+ static npmListErrorField = "error";
979
+ static npmListDependenciesField = "dependencies";
980
+ static npmListVersionField = "version";
981
+ static npmListPathField = "path";
982
+ static windowsPlatform = "win32";
983
+ static macPlatform = "darwin";
984
+ static linuxPlatform = "linux";
985
+ static developmentOutputSegments = [Resources.buildFolder, "development-app"];
986
+ static developmentPackageSegments = [Resources.buildFolder, "development-package"];
987
+ static developmentStampFile = "development-app.sha256";
988
+ static developmentStampHash = "sha256";
989
+ static developmentStampDigest = "hex";
990
+ static developmentCommandTimeout = 60_000;
991
+ static developmentUnsupportedPlatform = "The development binary is supported on Windows, macOS and Linux only.";
992
+ static developmentNoVersionInfo = "Electron's executable carries no version information to relabel.";
993
+ static electronInstallerFile = "install.js";
994
+ static electronPathFile = "path.txt";
995
+ static electronDistributionSegments = [...Resources.electronPackageSegments, Resources.electronDistributionFolder];
996
+ static electronManifestSegments = [...Resources.electronPackageSegments, Resources.packageManifestFileName];
997
+ static electronInstallerSegments = [...Resources.electronPackageSegments, Resources.electronInstallerFile];
998
+ static electronInstallTimeout = 600_000;
999
+ static electronName = "Electron";
1000
+ static electronWindowsExecutable = "electron.exe";
1001
+ static electronMacBundle = "Electron.app";
1002
+ static electronLinuxExecutable = "electron";
1003
+ static electronMacIconFile = "electron.icns";
1004
+ static electronMacHelperPrefix = "Electron Helper";
1005
+ static electronSubject = "Electron's binary";
1006
+ static electronInstalling = "Installing Electron's binary...\n";
1007
+ static electronStillMissing = "it reported success, but the binary is still missing";
1008
+ static windowsIconGroup = 1;
1009
+ static macIconExtension = ".icns";
1010
+ static macIconsetExtension = ".iconset";
1011
+ static macIconsetSizes = [
1012
+ ["icon_16x16.png", 16], ["icon_16x16@2x.png", 32], ["icon_32x32.png", 32], ["icon_32x32@2x.png", 64], ["icon_128x128.png", 128],
1013
+ ["icon_128x128@2x.png", 256], ["icon_256x256.png", 256], ["icon_256x256@2x.png", 512], ["icon_512x512.png", 512]
1014
+ ];
1015
+ static macResourcesSegments = ["Contents", "Resources"];
1016
+ static macExecutableSegments = ["Contents", "MacOS"];
1017
+ static macFrameworksSegments = ["Contents", "Frameworks"];
1018
+ static macPlistSegments = ["Contents", "Info.plist"];
1019
+ static macHelperIdentifierSuffix = ".helper";
1020
+ static macHelperRolePattern = /[()]/g;
1021
+ static macResizeCommand = "sips";
1022
+ static macResizeSizeOption = "-z";
1023
+ static macResizeOutputOption = "--out";
1024
+ static macIconsetCommand = "iconutil";
1025
+ static macIconsetArguments = ["--convert", "icns", "--output"];
1026
+ static macPlistCommand = "plutil";
1027
+ static macPlistReplaceOption = "-replace";
1028
+ static macPlistStringOption = "-string";
1029
+ static macPlistIconKey = "CFBundleIconFile";
1030
+ static macAdHocSignArguments = ["--force", "--deep", "--sign", "-"];
1031
+ static chromeSandboxFile = "chrome-sandbox";
1032
+ static rootUserId = 0;
1033
+ static chromeSandboxMode = 0o4755;
1034
+ static userNamespaceRestrictions = [
1035
+ ["/proc/sys/kernel/apparmor_restrict_unprivileged_userns", "1"],
1036
+ ["/proc/sys/kernel/unprivileged_userns_clone", "0"],
1037
+ ["/proc/sys/user/max_user_namespaces", "0"]
1038
+ ];
1039
+ static failureExitCode = 1;
1040
+ static githubErrorPrefix = "::error::";
1041
+ static outputOption = "--output";
1042
+ static buildUsage = `Usage: ${Resources.commandName} ${Resources.buildCommand} [--test [--without <module id>]... [--output <folder> [--update-feed <URL>]] | --packaged [--output <folder> [--update-feed <URL>]] | --list-copies], where a URL is an https URL, or an http URL of localhost, ending in /\n`;
1043
+ static buildNoPackages = "No packages under src/; there is nothing to build.\n";
1044
+ static buildTestOption = "--test";
1045
+ static buildPackagedOption = "--packaged";
1046
+ static buildWithoutOption = "--without";
1047
+ static buildListCopiesOption = "--list-copies";
1048
+ static buildEndOfCopies = "end of copies\n";
1049
+ static installUsage = `Usage: ${Resources.commandName} ${Resources.installCommand}\n`;
1050
+ static npmStartingFolderVariable = "INIT_CWD";
1051
+ static githubOutputVariable = "GITHUB_OUTPUT";
1052
+ static whitespacePattern = /\s+/;
1053
+ static internalFeedVariable = "INTERNAL_FEED";
1054
+ static internalFeedUrlVariable = "INTERNAL_FEED_URL";
1055
+ static updateFeedVariable = "UPDATE_FEED";
1056
+ static packageVersionVariable = "PACKAGE_VERSION";
1057
+ static releaseVersionVariable = "RELEASE_VERSION";
1058
+ static runNumberVariable = "RUN_NUMBER";
1059
+ static runAttemptVariable = "RUN_ATTEMPT";
1060
+ static signingVariable = "SIGNING";
1061
+ static internalFeedBuildKind = "build";
1062
+ static internalFeedCopyKind = "copy";
1063
+ static internalFeedKinds = [String.empty, Resources.internalFeedBuildKind, Resources.internalFeedCopyKind];
1064
+ static internalFeedSignedTargets = [Resources.windowsTarget, Resources.macosTarget];
1065
+ static firstRunAttempt = "1";
1066
+ static chooseFeedNoOutputFile = `${Resources.githubOutputVariable} names no file for the step's update-feed and package-version outputs.`;
1067
+ static chooseFeedInternalWithTest = "A release for the internal update feed takes no update-feed or package-version of a test of updating.";
1068
+ static chooseFeedNoInternalUrl = `The variable ${Resources.internalFeedUrlVariable} names no internal update feed.`;
1069
+ static chooseFeedNotSigned = "Only the app's release repository, which signs Windows and macOS, builds for the internal update feed.";
1070
+ static targetCellSeparator = "|";
1071
+ static targetEachNight = "nightly";
1072
+ static targetByHand = "manual";
1073
+ static runnerVariablePrefix = "RUNS_ON_";
1074
+ static architectureArm64 = "arm64";
1075
+ static optionalTargetArchitecture = Resources.architectureArm64;
1076
+ static publishedVersionsVariable = "PUBLISHED_VERSIONS";
1077
+ static moduleRangeNoOutputFile = `${Resources.githubOutputVariable} names no file for the step's range and version outputs.`;
1078
+ static moduleRangeNoPublished = `${Resources.publishedVersionsVariable} holds no list of versions as npm view's JSON gives it.`;
1079
+ static feedSkipVariable = "SKIP_FEED_CHECK";
1080
+ static feedVersionVariable = "FEED_VERSION";
1081
+ static feedUrlVariable = "FEED_URL";
1082
+ static releaseRepositoryVariable = "RELEASE_REPOSITORY";
1083
+ static feedWaitVariable = "FEED_WAIT_SECONDS";
1084
+ static feedSkipValue = "true";
1085
+ static feedSkipValues = [String.empty, "false", Resources.feedSkipValue];
1086
+ static feedSkipped = `${Resources.feedSkipVariable} is true, so the release skips the update feed check, and nothing is checked.\n`;
1087
+ static feedVersionPattern = /^(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})(?:-internal\.(?:0|[1-9]\d{0,8}))?$/u;
1088
+ static feedWaitPattern = /^(?:0|[1-9]\d{0,3})$/u;
1089
+ static feedDefaultWaitSeconds = 600;
1090
+ static feedMaximumWaitSeconds = 3600;
1091
+ static millisecondsPerSecond = 1000;
1092
+ static feedRetryInterval = 15_000;
1093
+ static feedDownloadLimit = 600_000;
1094
+ static feedMinimumRequestTimeout = 1;
1095
+ static feedMaximumRedirects = 5;
1096
+ static feedRedirectMode = "manual";
1097
+ static redirectStatuses = [301, 302, 303, 307, 308];
1098
+ static locationHeader = "location";
1099
+ static contentTypeHeader = "content-type";
1100
+ static releaseAssetOrigins = ["https://release-assets.githubusercontent.com", "https://objects.githubusercontent.com"];
1101
+ static commaSeparator = ",";
1102
+ static webPageContentType = "text/html";
1103
+ static feedFileHash = "sha512";
1104
+ static feedFileDigest = "base64";
1105
+ static yamlQuote = "'";
1106
+ static yamlEscapedQuote = "''";
1107
+ static yamlQuotedPattern = /^'(.*)'$/u;
1108
+ static feedVersionLinePattern = /^version: (.+)$/mu;
1109
+ static feedEntryStartPattern = /^ {2}- url: /gmu;
1110
+ static feedFileEntryPattern = /^ {2}- url: (.+)\n {4}sha512: (.+)\n {4}size: (\d+)$/gmu;
1111
+ static feedUrlCarriesSecret = `${Resources.feedUrlVariable} must not carry user info, a query or a fragment, which could hold a secret, so it is not shown here.`;
1112
+ static releaseRevisionVariable = "RELEASE_REVISION";
1113
+ static productUpdateFeedField = "updateFeed";
1114
+ static releaseAssetsUsage = `Usage: ${Resources.commandName} ${Resources.releaseAssetsCommand} [${Resources.updateFeedOption} <https URL, or http URL of localhost, ending in />]\n`;
1115
+ static mainBranch = "main";
1116
+ static onMainStatuses = ["identical", "ahead"];
1117
+ static buildRunsRoute = `/actions/workflows/build-and-test.yml/runs?event=push&branch=${Resources.mainBranch}&per_page=1&head_sha=`;
1118
+ static successConclusion = "success";
1119
+ static gitHubStatusField = "status";
1120
+ static gitHubConclusionField = "conclusion";
1121
+ static gitHubWorkflowRunsField = "workflow_runs";
1122
+ static comparisonLabel = `the comparison with ${Resources.mainBranch}`;
1123
+ static buildRunsLabel = "Build and test runs";
1124
+ static buildRunLabel = "the Build and test run";
1125
+ static signedOutput = "signed";
1126
+ static productFeedOutput = "product-feed";
1127
+ static signedPlatformsSeparator = " ";
1128
+ static noSignedPlatforms = "none";
1129
+ static releaseFolderVariable = "RELEASE_FOLDER";
1130
+ static releaseReportsVariable = "RELEASE_REPORTS";
1131
+ static releaseRunVariable = "RELEASE_RUN_URL";
1132
+ static releaseUpdateFeedVariable = "RELEASE_UPDATE_FEED";
1133
+ static releaseInternalVariable = "RELEASE_INTERNAL_VERSION";
1134
+ static uploadLabelMark = "#";
1135
+ static releaseInternalPattern = /^((?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8}))-internal\.(?:0|[1-9]\d{0,8})$/u;
1136
+ static packageSignedOption = "--signed";
1137
+ static packageUsage = `Usage: ${Resources.commandName} ${Resources.packageCommand} [${Resources.packageSignedOption}] [${Resources.updateFeedOption} <https URL, or http URL of localhost, ending in />]\n`;
1138
+ static commonJsScope = `${JSON.stringify({ type: "commonjs" })}\n`;
1139
+ static builderSegments = [Resources.nodeModulesFolder, "electron-builder", "cli.js"];
1140
+ static builderOptions = ["--publish", "never", "--config"];
1141
+ static diskImageDetachFailure = "Unable to detach device cleanly";
1142
+ static builderDetachRetry = "electron-builder could not detach the disk image it was making while macOS still held its volume; building the packages again, once.\n";
1143
+ static builderVariables = new Set([
1144
+ "PATH", "PATHEXT", "COMSPEC", "SYSTEMROOT", "SYSTEMDRIVE", "WINDIR", "PROCESSOR_ARCHITECTURE", "NUMBER_OF_PROCESSORS",
1145
+ "HOME", "USERPROFILE", "HOMEDRIVE", "HOMEPATH", "APPDATA", "LOCALAPPDATA", "USER", "USERNAME", "LOGNAME",
1146
+ "TEMP", "TMP", "TMPDIR", "LANG", "LC_ALL", "LC_CTYPE", "HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"
1147
+ ]);
1148
+ static builderCacheVariable = "ELECTRON_BUILDER_CACHE";
1149
+ static builderIdentityDiscoveryOff = "false";
1150
+ static builderCompressionFilterVariable = "ELECTRON_BUILDER_7Z_FILTER";
1151
+ static builderX86Filter = "BCJ";
1152
+ static zipExtension = ".zip";
1153
+ static smokeRemoveLeftoverOption = "--remove-leftover";
1154
+ static smokeRequireSandboxOption = "--require-sandbox";
1155
+ static smokeRequireFallbackOption = "--require-fallback";
1156
+ static smokeDebianOption = "--deb";
1157
+ static smokeSandboxOptions = [Resources.smokeRequireSandboxOption, Resources.smokeRequireFallbackOption, Resources.chromiumNoSandboxOption];
1158
+ static smokeOptions = [Resources.smokeRemoveLeftoverOption, ...Resources.smokeSandboxOptions];
1159
+ static smokeUsage = `Usage: ${Resources.commandName} ${Resources.packageSmokeCommand} [${Resources.smokeDebianOption}] [${Resources.smokeSandboxOptions.join(" | ")}]\n`
1160
+ + ` ${Resources.commandName} ${Resources.packageSmokeCommand} ${Resources.smokeRemoveLeftoverOption}\n`;
1161
+ static smokeDebianNotLinux = `Only the Linux package is also a Debian package, so ${Resources.smokeDebianOption} smokes it on Linux alone.`;
1162
+ static sudoCommand = "sudo";
1163
+ static sudoNonInteractiveOption = "--non-interactive";
1164
+ static aptGetCommand = "apt-get";
1165
+ static aptGetInstallArguments = ["install", "--yes"];
1166
+ static aptGetRemoveArguments = ["remove", "--yes"];
1167
+ static dpkgDebCommand = "dpkg-deb";
1168
+ static dpkgDebFieldOption = "--field";
1169
+ static debianPackageField = "Package";
1170
+ static readlinkCommand = "readlink";
1171
+ static readlinkCanonicalOption = "--canonicalize-existing";
1172
+ static linuxCommandFolder = "/usr/bin";
1173
+ static bashCommand = "bash";
1174
+ static bashCommandOption = "-c";
1175
+ static debianNamespaceProbe = "[[ -L /proc/self/ns/user ]] && unshare --user true";
1176
+ static statCommand = "stat";
1177
+ static statOwnerAndModeOption = "--format=%u:%a";
1178
+ static sandboxHelperPlainMode = "755";
1179
+ static sandboxHelperSetuidMode = "4755";
1180
+ static apparmorStatusCommand = "apparmor_status";
1181
+ static apparmorEnabledOption = "--enabled";
1182
+ static apparmorParserCommand = "apparmor_parser";
1183
+ static apparmorDryRunOptions = ["--skip-kernel-load", "--debug"];
1184
+ static apparmorProfileFile = "apparmor-profile";
1185
+ static apparmorProfilesFolder = "/etc/apparmor.d";
1186
+ static apparmorLoadedProfiles = "/sys/kernel/security/apparmor/profiles";
1187
+ static testCommand = "test";
1188
+ static testMissingOption = "!";
1189
+ static testExistsOption = "-e";
1190
+ static cmpCommand = "cmp";
1191
+ static cmpSilentOption = "--silent";
1192
+ static grepCommand = "grep";
1193
+ static grepWholeLineOptions = ["--quiet", "--fixed-strings", "--line-regexp"];
1194
+ static smokeNothingLeft = "Nothing an earlier run installed was left.";
1195
+ static smokeNoRuntimeExitCode = 3;
1196
+ static smokeCommandLimit = 30_000;
1197
+ static smokeStartLimit = 60_000;
1198
+ static smokeQuitLimit = 30_000;
1199
+ static smokeStopLimit = 90_000;
1200
+ static smokeKillLimit = 10_000;
1201
+ static smokeNamespaceProbeLimit = 10_000;
1202
+ static smokePollInterval = 500;
1203
+ static smokeFolderPrefix = "nol-smoke-";
1204
+ static smokeDataFolder = "data";
1205
+ static smokeDeviceFolder = "device";
1206
+ static logsFolder = "logs";
1207
+ static smokeMainLogFile = "main.log";
1208
+ static smokeKilledMainLogFile = "main-killed.log";
1209
+ static smokeDataLogSegments = [Resources.logsFolder, Resources.smokeMainLogFile];
1210
+ static smokeRuntimeLogSegments = [Resources.logsFolder, "runtime.log"];
1211
+ static runtimeDiscoverySegments = ["discovery", "runtime.json"];
1212
+ static dataDirectoryOption = "--data-dir";
1213
+ static deviceDirectoryOption = "--device-dir";
1214
+ static discoveryProcessIdField = "processId";
1215
+ static statusBuildField = "build";
1216
+ static statusVersionField = "productVersion";
1217
+ static statusDataDirectoryField = "dataDirectory";
1218
+ static smokeJsonOption = "--json";
1219
+ static smokeStatusCommand = "status";
1220
+ static smokeStatusArguments = [Resources.smokeStatusCommand, Resources.smokeJsonOption];
1221
+ static smokeQuitArguments = ["quit", Resources.smokeJsonOption, "--timeout", String(Resources.smokeQuitLimit / Resources.millisecondsPerSecond)];
1222
+ static quitOutcomeField = "outcome";
1223
+ static quitOutcome = "Quit";
1224
+ static smokeLogTailLength = 4_000;
1225
+ static smokeScreenCaptureCommand = "screencapture";
1226
+ static smokeSilentCaptureOption = "-x";
1227
+ static pngExtension = ".png";
1228
+ static githubStepSummaryVariable = "GITHUB_STEP_SUMMARY";
1229
+ static killSignal = "SIGKILL";
1230
+ static ignoreStdio = "ignore";
1231
+ static pipeStdio = "pipe";
1232
+ static inheritStdio = "inherit";
1233
+ static dataEvent = "data";
1234
+ static errorEvent = "error";
1235
+ static closeEvent = "close";
1236
+ static exitEvent = "exit";
1237
+ static spawnEvent = "spawn";
1238
+ static windowsCommandShell = "cmd.exe";
1239
+ static windowsCommandShellOptions = ["/d", "/c"];
1240
+ static powerShellOptions = ["-NoProfile", "-NonInteractive", "-Command"];
1241
+ static pathVariable = "PATH";
1242
+ static linkCommand = "ln";
1243
+ static linkSymbolicOption = "-s";
1244
+ static smokeCopyRecordPattern = /^copy-[0-9a-f-]{36}\.log$/;
1245
+ static smokeStartLogPattern = /^start-[0-9a-f-]{36}\.log$/;
1246
+ static copyRecordExtractionField = "extraction";
1247
+ static procFolder = "/proc";
1248
+ static procProgramLink = "exe";
1249
+ static procInputLinkSegments = ["fd", "0"];
1250
+ static pipeLinkPrefix = "pipe:";
1251
+ static mountTableSegments = ["self", "mountinfo"];
1252
+ static fuseMountPattern = / - fuse[. ]/;
1253
+ static mountFieldSeparator = " ";
1254
+ static mountPointField = 4;
1255
+ static smokeReplacementSuffix = ".replacement";
1256
+ static elfMagic = "\x7fELF";
1257
+ static elfMagicEncoding = "latin1";
1258
+ static appImageExtractAndRunVariable = "APPIMAGE_EXTRACT_AND_RUN";
1259
+ static appImageExtractAndRunValue = "1";
1260
+ static bytesPerMebibyte = 1_048_576;
1261
+ static electronFuseSentinel = Buffer.from("dL7pKGdnNz796PbbjQWNKmHXBZaB9tsX");
1262
+ static electronFuseWireVersion = 1;
1263
+ static electronFuseHeaderLength = 2;
1264
+ static cookieEncryptionFuse = 1;
1265
+ static electronFuseEnabled = 0x31;
1266
+ static electronFuseDisabled = 0x30;
1267
+ static macBundleFromProgram = ["..", "..", ".."];
1268
+ static macFuseBinarySegments = ["..", "Frameworks", "Electron Framework.framework", "Electron Framework"];
1269
+ static smokePathHoldsIntro = "The user's Path holds";
1270
+ static smokePathHoldsAgainIntro = "Installed again over itself, the user's Path still holds";
1271
+ static smokeMomentBeforeStart = "before the start";
1272
+ static smokeMomentAfterStart = "after the start";
1273
+ static smokeMomentQuit = "quit";
1274
+ static smokeMomentAfterRuntimeStopped = "after the runtime stopped";
1275
+ static smokeMomentStopped = "stopped";
1276
+ static smokeMomentKilled = "was killed";
1277
+ static smokeMomentPowerShell = "through PowerShell";
1278
+ static smokeMomentLink = "through a link to the app's command";
1279
+ static smokeMomentReplaced = "after the AppImage was replaced";
1280
+ static smokeMainQuit = "The main process quit.\n";
1281
+ static smokeRuntimeStopped = "The runtime stopped once idle.\n";
1282
+ static smokeUninstalled = "Uninstalled: the program and its command are gone, and the user's Path is as it was before the install.\n";
1283
+ static smokeCookiesOn = "on, for the app's web views";
1284
+ static smokeCookiesOff = "off, as the app has no web views";
1285
+ static smokeNoSandboxNotice = `With ${Resources.chromiumNoSandboxOption}, the app starts without Chromium's sandbox.\n`;
1286
+ static smokeRequireSandboxNotice = `With ${Resources.smokeRequireSandboxOption}, the app must start with Chromium's sandbox, as its own processes show, whatever the probe here says.\n`;
1287
+ static smokeRequireFallbackNotice = `With ${Resources.smokeRequireFallbackOption}, the AppImage's launcher must start the app with ${Resources.chromiumNoSandboxOption}, `
1288
+ + "as its own processes show, whatever the probe here says.\n";
1289
+ static smokeDebianSandboxNotice = "The Debian package's after-install script sets Chromium's sandbox up, so the app must start with it, as its own processes show.\n";
1290
+ static smokeMainStillRunning = `The main process was still running ${Resources.smokeKillLimit} ms after it was killed.`;
1291
+ static userNamespacesProbeLine = `${Resources.userNamespacesProbeCommand} ${Resources.userNamespacesProbeArguments.join(" ")}`;
1292
+ static smokeNoProcRefusal = ", though no setting in /proc/sys refuses unprivileged user namespaces";
1293
+ static fieldPathSeparator = ".";
1294
+ static packageSegmentSeparator = ".";
1295
+ static hashEntrySeparator = " ";
1296
+ static problemSeparator = " ";
1297
+ static relativeSpecifierPrefix = ".";
1298
+ static hiddenEntryPrefix = ".";
1299
+ static packageScopeMark = "@";
1300
+ static architectureX64 = "x64";
1301
+ static targetNameWordSeparator = " ";
1302
+ static buildTargetLinuxX64 = "Linux x64";
1303
+ static buildTargetLinuxArm64 = "Linux ARM64";
1304
+ static buildTargetWindowsX64 = "Windows x64";
1305
+ static buildTargetWindowsArm64 = "Windows ARM64";
1306
+ static buildTargetMacosX64 = "macOS x64";
1307
+ static buildTargetMacosArm64 = "macOS ARM64";
1308
+ static buildRunnerLinux = "LINUX";
1309
+ static buildRunnerLinuxArm64 = "LINUX_ARM64";
1310
+ static buildRunnerWindows = "WINDOWS";
1311
+ static buildRunnerWindowsArm64 = "WINDOWS_ARM64";
1312
+ static buildRunnerMacos = "MACOS";
1313
+ static buildRunnerMacosArm64 = "MACOS_ARM64";
1314
+ static testsFolder = "tests";
1315
+ static scriptsFolder = "scripts";
1316
+ static assetsFolder = "assets";
1317
+ static gitFolder = ".git";
1318
+ static sourceFolderPrefix = `${Resources.sourceFolder}${Resources.pathSegmentSeparator}`;
1319
+ static sourceModulesFolder = "src/modules";
1320
+ static moduleFixturePrefix = `${Resources.moduleFixtureFolder}${Resources.pathSegmentSeparator}`;
1321
+ static projectFile = "tsconfig.json";
1322
+ static baseProjectFile = "tsconfig-base.json";
1323
+ static licenseFile = "LICENSE";
1324
+ static readmeFile = "README.md";
1325
+ static modulePackageFiles = [Resources.moduleDeclarationFileName, Resources.settingsFileName, Resources.menusFileName, Resources.cliFileName, Resources.webViewsFileName];
1326
+ static packageResourcesFile = "resources.js";
1327
+ static buildScriptFile = "build.ts";
1328
+ static buildScriptSegments = [Resources.scriptsFolder, Resources.buildScriptFile];
1329
+ static declarationSegments = ["api", "index.d.ts"];
1330
+ static declarationExtension = ".d.ts";
1331
+ static archivePackageFolder = "package";
1332
+ static archiveScopePattern = /^@([^/]+)\/(.+)$/;
1333
+ static archiveScopeReplacement = "$1-$2";
1334
+ static recordExtension = ".txt";
1335
+ static testRecordExtension = ".tests.txt";
1336
+ static archivesFolder = "_packages";
1337
+ static buildPackagesFolder = "packages";
1338
+ static recordsFolder = "records";
1339
+ static nodeGypFolder = "node-gyp";
1340
+ static windowInstallRecordFile = "window-install.txt";
1341
+ static productFile = "product.json";
1342
+ static productBuildFileSegments = [Resources.buildFolder, Resources.productFile];
1343
+ static manifestNameField = "name";
1344
+ static manifestVersionField = "version";
1345
+ static manifestDependenciesField = "dependencies";
1346
+ static manifestOptionalDependenciesField = "optionalDependencies";
1347
+ static manifestFilesField = "files";
1348
+ static manifestExportsField = "exports";
1349
+ static manifestCommitField = "gitHead";
1350
+ static manifestNoldovaField = "noldova";
1351
+ static manifestDesktopField = "desktop";
1352
+ static manifestOverridesField = "overrides";
1353
+ static coverageExclusionsField = "coverageExclusions";
1354
+ static windowsAddonsField = "windowsAddons";
1355
+ static posixAddonsField = "posixAddons";
1356
+ static modulePackagePrefixField = "modulePackagePrefix";
1357
+ static protocolVersionField = "protocolVersion";
1358
+ static installedDependencyFields = [Resources.manifestDependenciesField, Resources.manifestOptionalDependenciesField];
1359
+ static stampedDependencyFields = [Resources.manifestDependenciesField, Resources.peerDependenciesField];
1360
+ static lockIntegrityField = "integrity";
1361
+ static windowExportPath = "./window";
1362
+ static windowImportFields = [Resources.manifestDependenciesField, Resources.manifestOptionalDependenciesField, Resources.peerDependenciesField];
1363
+ static nodeSideDependencyFields = [Resources.manifestDependenciesField, Resources.manifestOptionalDependenciesField, Resources.peerDependenciesField];
1364
+ static windowSideKey = "window:";
1365
+ static nodeSideKey = "node:";
1366
+ static windowExportConditions = ["import", "default"];
1367
+ static scopedPackageNameSegments = 2;
1368
+ static packageNameSegments = 1;
1369
+ static packageVersionPlaceholder = "__VERSION__";
1370
+ static packageNextMinorPlaceholder = "__NEXT_MINOR__";
1371
+ static packagePeerRangePlaceholder = Resources.formatVersionRange(Resources.packageVersionPlaceholder, Resources.packageNextMinorPlaceholder);
1372
+ static protocolVersionPlaceholder = ["__PROTOCOL", "VERSION__"].join("_");
1373
+ static packageNoCoverageExclusions = "[]";
1374
+ static angularScope = "@angular/";
1375
+ static packageAddonNamePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
1376
+ static fixturePackageIdPrefix = "fixture-";
1377
+ static noldovaScope = "@noldova/";
1378
+ static noldovaCompanyScope = "@noldova-com/";
1379
+ static lowerCasePackageFolderPattern = /^noldova(?:\.[a-z][a-z0-9]*)+$/;
1380
+ static titleCasePackageFolderPattern = /^Noldova(?:\.[A-Z][A-Za-z0-9]*)+$/;
1381
+ static desktopLibraryPackage = "@noldova/desktop";
1382
+ static companyDesktopLibraryPackage = "@noldova-com/desktop";
1383
+ static corePackageParts = ["build", "cli", "electron", "protocol", "runtime", "window"];
1384
+ static nodeSidePackages = ["build", "cli", "electron", "protocol", "runtime"].map(t => `${Resources.modulesPrefix}${t}`);
1385
+ static fixturePackagePrefix = "@noldova/desktop.fixture.";
1386
+ static contextPackagePrefix = "@noldova/context.";
1387
+ static kitPackage = "@noldova/ui.components.angular";
1388
+ static windowPackage = "@noldova/desktop.window";
1389
+ static windowPackageSuffix = ".window";
1390
+ static addonSourceSegments = [Resources.sourceFolder, Resources.addonOutputFolder];
1391
+ static addonSourceExtension = ".c";
1392
+ static addonProjectFile = "binding.gyp";
1393
+ static addonBuiltSegments = ["build", "Release"];
1394
+ static addonNodeApiVersion = 8;
1395
+ static addonNodeApiDefine = `NAPI_VERSION=${Resources.addonNodeApiVersion}`;
1396
+ static addonRebuildArguments = ["rebuild", "--loglevel=error", "--enable-lto=false", "--enable-thin-lto=false", "--devdir"];
1397
+ static addonNoToolchainText = "Could not find any Visual Studio installation to use";
1398
+ static addonKindWindows = "Windows";
1399
+ static addonKindPosix = "POSIX";
1400
+ static addonToolchainWorkload = "the \"Desktop development with C++\" workload of Visual Studio or the Visual Studio Build Tools, 2022 or later";
1401
+ static addonToolchainWorkloadArm64 = `${Resources.addonToolchainWorkload}, with its C++ ARM64 build tools component`;
1402
+ static tarBlockSize = 512;
1403
+ static tarNameEnd = 100;
1404
+ static tarSizeStart = 124;
1405
+ static tarSizeEnd = 136;
1406
+ static tarTypeAt = 156;
1407
+ static tarPrefixStart = 345;
1408
+ static tarPrefixEnd = 500;
1409
+ static tarSizeRadix = 8;
1410
+ static tarReadFileTypes = ["0", "\0"];
1411
+ static tarExtendedType = "x";
1412
+ static tarTypeEncoding = "latin1";
1413
+ static tarPathRecordPattern = /^\d+ path=(.*)$/m;
1414
+ static tarFieldEndPattern = /\0.*$/s;
1415
+ static hashAlgorithm = "sha256";
1416
+ static hashEncoding = "hex";
1417
+ static hashPartSeparator = "\0";
1418
+ static localUrlProtocol = "http:";
1419
+ static updateFeedLocalHosts = new Set(["localhost", "127.0.0.1", "[::1]"]);
1420
+ static updateFeedUnsafePattern = /[\s?#]/u;
1421
+ static buildRootInputs = [Resources.packageManifestFileName, Resources.packageLockFileName, Resources.baseProjectFile];
1422
+ static angularInputs = [Resources.packageManifestFileName, Resources.projectFile];
1423
+ static buildToolFolderUrl = "../../";
1424
+ static angularInstallSubject = "the Angular packages";
1425
+ static rootInstallSubject = "the packages built on Angular packages";
1426
+ static fixtureTestBuildOnly = "left to the test build, since it builds on an Angular package";
1427
+ static fixtureTypeChecked = "type-checked";
1428
+ static packageReused = "reused";
1429
+ static packageBuilt = "built";
1430
+ static packageTestsCompiled = "compiled";
1431
+ static staleHash = "stale";
1432
+ static absentLockfileHash = "none";
1433
+ static missingInputHash = "missing";
1434
+ static gitCommitArguments = ["rev-parse", "--verify", "--quiet", "HEAD"];
1435
+ static gitCommitExitCodes = [0, 1];
1436
+ static gitStatusArguments = ["status", "--porcelain"];
1437
+ static buildScriptTimeoutMargin = 60_000;
1438
+ static buildScriptTimeout = Resources.compileTimeout + Resources.carryTimeout + Resources.buildScriptTimeoutMargin;
1439
+ static compilerProjectOption = "--project";
1440
+ static compilerNoEmitOption = "--noEmit";
1441
+ static compilerRootOption = "--rootDir";
1442
+ static compilerOutputOption = "--outDir";
1443
+ static compilerSourceMapOption = "--sourceMap";
1444
+ static testSourceLinkType = "junction";
1445
+ static alwaysPackedPattern = /^(?:readme|license|licence)(?:\.[^/]*)?$/i;
1446
+ static trailingSlashesPattern = /\/+$/;
1447
+ static globDescendantsSuffix = "/**";
1448
+ static npmPackArguments = ["pack", "--ignore-scripts", "--loglevel=error", "--pack-destination"];
1449
+ static npmInstallArguments = ["install", "--no-save", "--ignore-scripts", "--no-audit", "--no-fund", "--loglevel=error"];
1450
+ static buildScriptInputsRule = `A build script lists with ${Resources.inputsOption} only what the build copies into the package from outside it, each under its own name.`;
1451
+ static rootVersionPattern = /^\d+\.\d+\.\d+(-(0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(\.(0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*)?$/;
1452
+ static rootVersionInvalid = "The root package.json must declare a version of the form major.minor.patch, with an optional prerelease such as -rc.1.";
1453
+ static rootProtocolVersionInvalid = "The root package.json's desktop.protocolVersion must be a positive whole number.";
1454
+ static rootModulesPrefixInvalid = "The root package.json's desktop.modulePackagePrefix must be a scope and a slash, then optionally a name ending in - or ., such as @example/ or @example/app.";
1455
+ static productAboutField = "about";
1456
+ static productNameField = "name";
1457
+ static productPublisherField = "publisher";
1458
+ static productSlugField = "slug";
1459
+ static productApplicationIdField = "applicationId";
1460
+ static productDevelopmentApplicationIdField = "developmentApplicationId";
1461
+ static productDataFolderField = "dataFolder";
1462
+ static productDeviceFoldersField = "deviceFolders";
1463
+ static productDataDirectoryVariableField = "dataDirectoryVariable";
1464
+ static productIconsField = "icons";
1465
+ static productReleaseRepositoryField = "releaseRepository";
1466
+ static productCategoriesField = "categories";
1467
+ static productWindowsSigningField = "windowsSigning";
1468
+ static productPermissionsModuleField = "permissionsModule";
1469
+ static productDescriptionField = "description";
1470
+ static productWebsiteField = "website";
1471
+ static productReleasesField = "releases";
1472
+ static productLicensesField = "licenses";
1473
+ static productWindowsDeviceFolderPath = Resources.formatFieldPath(Resources.productDeviceFoldersField, Resources.windowsTarget);
1474
+ static productMacosDeviceFolderPath = Resources.formatFieldPath(Resources.productDeviceFoldersField, Resources.macosTarget);
1475
+ static productLinuxDeviceFolderPath = Resources.formatFieldPath(Resources.productDeviceFoldersField, Resources.linuxTarget);
1476
+ static productMacCategoryPath = Resources.formatFieldPath(Resources.productCategoriesField, Resources.macosTarget);
1477
+ static productLinuxCategoryPath = Resources.formatFieldPath(Resources.productCategoriesField, Resources.linuxTarget);
1478
+ static productDescriptionPath = Resources.formatFieldPath(Resources.productAboutField, Resources.productDescriptionField);
1479
+ static productWebsitePath = Resources.formatFieldPath(Resources.productAboutField, Resources.productWebsiteField);
1480
+ static productReleasesPath = Resources.formatFieldPath(Resources.productAboutField, Resources.productReleasesField);
1481
+ static productLicensesPath = Resources.formatFieldPath(Resources.productAboutField, Resources.productLicensesField);
1482
+ static productDefaultMacCategory = "public.app-category.developer-tools";
1483
+ static productDefaultLinuxCategory = "Development";
1484
+ static productApplicationIdPattern = /^[a-z][a-z0-9]*(?:\.[a-z][a-z0-9-]*)+$/;
1485
+ static productSlugPattern = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
1486
+ static productVariablePattern = /^[A-Z][A-Z0-9_]*$/;
1487
+ static productRepositoryPattern = /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\/[A-Za-z0-9._-]+$/;
1488
+ static productUnsafeNamePattern = /["\\\n\r]/;
1489
+ static productLineBreakPattern = /[\n\r]/;
1490
+ static productWhitespacePattern = /\s/u;
1491
+ static productMacCategoryPattern = /^public\.app-category\.[a-z]+(?:-[a-z]+)*$/;
1492
+ static productLinuxCategoryPattern = /^[A-Z][A-Za-z]*$/;
1493
+ static productUnsafeSegmentPattern = /[\\:*?"<>|]/;
1494
+ static checkoutHashLength = 8;
1495
+ static checkoutVariableSuffix = "_CHECKOUT";
1496
+ static productNameExpected = "a name without quotes, backslashes or line breaks";
1497
+ static productSlugExpected = "lowercase kebab-case";
1498
+ static productApplicationIdExpected = "a lowercase reverse-DNS ID";
1499
+ static productDevelopmentApplicationIdExpected = "a lowercase reverse-DNS ID other than applicationId";
1500
+ static productFolderExpected = "a relative folder whose segments are separated by /";
1501
+ static productVariableExpected = "an uppercase environment variable name";
1502
+ static productRepositoryExpected = "a GitHub repository written as owner/name";
1503
+ static productMacCategoryExpected = "a macOS app category such as public.app-category.developer-tools";
1504
+ static productLinuxCategoryExpected = "a freedesktop.org main category such as Development";
1505
+ static productDescriptionExpected = "one line of text";
1506
+ static productAddressExpected = "an https address";
1507
+ static productLicensesExpected = "text";
1508
+ static productUpdateFeedExpected = "an https folder URL ending in /, with no user info, query or fragment";
1509
+ static productAboutExpected = "an object";
1510
+ static productMissing = `The root ${Resources.packageManifestFileName} must declare ${Resources.formatFieldPath(Resources.manifestDesktopField, Resources.productField)}.`;
1511
+ static productWindowsPublisherRemoved = `${Resources.formatFieldPath(Resources.manifestDesktopField, Resources.productField, Resources.productWindowsPublisherField)} no longer goes in ${Resources.packageManifestFileName}; remove it. A signed Windows package takes its publisher from the release's ${Resources.windowsPublisherVariable} secret.`;
1512
+ static manifestPackagingField = "packaging";
1513
+ static rootManifestUnreadable = `The root ${Resources.packageManifestFileName} could not be read as JSON.`;
1514
+ static acceptedLicensesField = "acceptedLicenses";
1515
+ static licenseField = "license";
1516
+ static packagingReasonField = "reason";
1517
+ static acceptedLicensesShape = `The root package.json's ${Resources.acceptedLicensesSection} must map each package, as <name>@<version>, to { "license": "<the exact license in its package.json>", "reason": "<why the app may ship it>" }.`;
1518
+ static packageVersionSeparator = "@";
1519
+ static packageIdPattern = /^(?:@[^@/\s]+\/)?[^@/\s]+@[^@/\s]+$/;
1520
+ static companyPackageSourcesFolder = "sources";
1521
+ static companyPackageUnsafeSegments = [String.empty, ".", ".."];
1522
+ static windowsUnsafeSegment = /[\\:*?"<>|\p{Cc}]|[. ]$|^(?:con|conin\$|conout\$|prn|aux|nul|com[0-9¹²³]|lpt[0-9¹²³])(?:\..*)?$/iu;
1523
+ static tarPackagePath = /^[^/]+\/(.+)$/;
1524
+ static unicodeNormalForm = "NFC";
1525
+ static filePermissionsMask = 0o777;
1526
+ static allowedLicenses = ["MIT", "ISC", "BSD-2-Clause", "BSD-3-Clause", "Apache-2.0", "0BSD", "BlueOak-1.0.0", "Python-2.0", "Unlicense"];
1527
+ static licenseGroup = /^\((.*)\)$/s;
1528
+ static licenseAlternative = /\s+OR\s+/;
1529
+ static licenseIdentifier = /^[A-Za-z0-9.-]+$/;
1530
+ static lockedPackageFolder = `${Resources.nodeModulesFolder}${Resources.pathSegmentSeparator}`;
1531
+ static secureProtocol = "https:";
1532
+ static insecureProtocol = "http:";
1533
+ static registrySchemes = [Resources.secureProtocol, Resources.insecureProtocol];
1534
+ static archiveScheme = "file:";
1535
+ static integrityAlgorithm = "sha512";
1536
+ static integrityPrefix = `${Resources.integrityAlgorithm}-`;
1537
+ static integritySeparator = /\s+/;
1538
+ static integrityDigestEncoding = "base64";
1539
+ static archiveScopeSeparator = "+";
1540
+ static packageArchiveExtension = ".tgz";
1541
+ static lockedPackageName = /^(?:@[a-z0-9~-][a-z0-9._~-]*\/)?[A-Za-z0-9~-][A-Za-z0-9._~-]*$/;
1542
+ static lockedPackageVersion = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.+-]+)?$/;
1543
+ static lockResolvedField = "resolved";
1544
+ static lockInBundleField = "inBundle";
1545
+ static omittedOptionalsField = "omittedOptionals";
1546
+ static omittedOptionalsShape = `The root package.json's ${Resources.omittedOptionalsSection} must map each package, as <name>@<version>, to `
1547
+ + "{ \"dependencies\": [<optional dependency name>, ...], \"reason\": \"<why the app never loads them>\" }.";
1548
+ static typeOnlyPeersField = "typeOnlyPeers";
1549
+ static typeOnlyPeersListField = "peers";
1550
+ static typeOnlyPeersShape = `The root package.json's ${Resources.typeOnlyPeersSection} must map each package, as <name>@<version>, to { "peers": [<peer name>, ...], "reason": "<why the package never loads them>" }.`;
1551
+ static packageReportFieldCount = 3;
1552
+ static packageReportTargetField = "target";
1553
+ static packageReportSignedField = "signed";
1554
+ static packageReportCheckedField = "checked";
1555
+ static zipArchiveTarget = "zip";
1556
+ static packagePlatforms = new Map([
1557
+ [Resources.windowsPlatform, Resources.windowsTarget], [Resources.macPlatform, Resources.macosTarget], [Resources.linuxPlatform, Resources.linuxTarget]
1558
+ ]);
1559
+ static packageArchitectures = [Resources.architectureX64, Resources.architectureArm64];
1560
+ static builderFormatNsis = "nsis";
1561
+ static builderFormatDmg = "dmg";
1562
+ static builderFormatZip = "zip";
1563
+ static builderFormatAppImage = "AppImage";
1564
+ static builderFormatDeb = "deb";
1565
+ static packageFormats = new Map([
1566
+ [Resources.windowsTarget, new Map([[Resources.builderFormatNsis, Resources.installerTarget]])],
1567
+ [Resources.macosTarget, new Map([[Resources.builderFormatDmg, Resources.diskImageTarget], [Resources.builderFormatZip, Resources.zipArchiveTarget]])],
1568
+ [Resources.linuxTarget, new Map([[Resources.builderFormatAppImage, Resources.appImageTarget], [Resources.builderFormatDeb, Resources.debianPackageTarget]])]
1569
+ ]);
1570
+ static packageUpdateExtensions = new Map([
1571
+ [Resources.windowsTarget, Resources.installerTarget], [Resources.macosTarget, Resources.zipArchiveTarget], [Resources.linuxTarget, Resources.appImageTarget]
1572
+ ]);
1573
+ static tarModeEnd = 108;
1574
+ static tarChecksumStart = 148;
1575
+ static tarChecksumEnd = 156;
1576
+ static tarTypeStart = 156;
1577
+ static tarMagicStart = 257;
1578
+ static tarMagicEnd = 263;
1579
+ static octalRadix = 8;
1580
+ static decimalRadix = 10;
1581
+ static tarSpace = 0x20;
1582
+ static tarNul = String.fromCharCode(0);
1583
+ static tarUstarMagic = `ustar${Resources.tarNul}`;
1584
+ static tarGlobalType = "g";
1585
+ static tarLongNameType = "L";
1586
+ static tarLongLinkType = "K";
1587
+ static tarExtendedPath = "path=";
1588
+ static tarOctalField = /^[0-7]+$/;
1589
+ static tarFieldPadding = /^[ \0]+|[ \0]+$/g;
1590
+ static tarEntryKinds = new Map([["1", "a hard link"], ["2", "a symbolic link"]]);
1591
+ static tarSizeField = "size";
1592
+ static tarModeField = "mode";
1593
+ static tarHeaderEncoding = "latin1";
1594
+ static thirdPartyDownloadTimeout = 120_000;
1595
+ static licenseFilePattern = /^(?:(?:licen[cs]e|copying|unlicense)(?:[-_][a-z0-9+-]+(?:\.\d+)*)?|[a-z0-9+-]+(?:\.\d+)*[-_]licen[cs]e)(?:\.(?:md|txt|markdown))?$/i;
1596
+ static scriptFilePattern = /\.[cm]?js$/;
1597
+ static regexSpecialCharacters = /[.*+?^${}()|[\]\\]/g;
1598
+ static regexEscapeReplacement = String.raw `\$&`;
1599
+ static namedLicenseFile = /^SEE LICENSE IN (\S+)$/;
1600
+ static paragraphSeparator = "\n\n";
1601
+ static reviewedLicenseExtension = ".txt";
1602
+ static windowsPublisherPattern = /^CN=[^,=+"\\<>;\n\r]+(?:, [A-Z]+=[^,=+"\\<>;\n\r]+)*$/;
1603
+ static windowsSigningEndpointPattern = /^https:\/\/[a-z0-9]+(?:[.-][a-z0-9]+)*\/$/;
1604
+ static windowsSigningNamePattern = /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/;
1605
+ static windowsSigningEndpointField = "endpoint";
1606
+ static windowsSigningAccountField = "account";
1607
+ static windowsSigningProfileField = "profile";
1608
+ static windowsSigningEndpointExpected = "the HTTPS URL of the Artifact Signing endpoint, ending in /";
1609
+ static windowsSigningNameExpected = "a name of letters, digits and hyphens that starts and ends with a letter or digit";
1610
+ static windowsSigningMissing = `Signing Windows packages needs ${Resources.windowsSigningSection} in the root package.json, with the Artifact Signing endpoint, account and certificate profile.`;
1611
+ static checksumAlgorithm = "sha256";
1612
+ static checksumDigestEncoding = "hex";
1613
+ static checksumSeparator = " ";
1614
+ static releasePlatformNames = new Map([
1615
+ [Resources.windowsTarget, "Windows"], [Resources.macosTarget, "macOS"], [Resources.linuxTarget, "Linux"]
1616
+ ]);
1617
+ static releaseArchitectureNames = new Map([[Resources.architectureX64, "x64"], [Resources.architectureArm64, "ARM64"]]);
1618
+ static releaseNoneSupported = "No target has passed its native acceptance yet, so every target was accepted by a CI run only.";
1619
+ static releasePackagesSigned = "Its packages are signed.";
1620
+ static releasePackagesUnsigned = "Its packages are unsigned.";
1621
+ static releaseUploadAttempts = 3;
1622
+ static releaseRetryPause = 10_000;
1623
+ static assetDigestPrefix = `${Resources.checksumAlgorithm}:`;
1624
+ static githubRetriedStatuses = [408, 429];
1625
+ static httpServerErrorStatus = 500;
1626
+ static githubExistingReferenceStatus = 422;
1627
+ static releaseMakeLatestValue = "true";
1628
+ static tagReferencePrefix = "refs/tags/";
1629
+ static githubReleasesPath = "/releases";
1630
+ static githubReferencesPath = "/git/refs";
1631
+ static httpPatchMethod = "PATCH";
1632
+ static httpPostMethod = "POST";
1633
+ static githubMakeLatestField = "make_latest";
1634
+ static githubDraftField = "draft";
1635
+ static githubTagNameField = "tag_name";
1636
+ static githubTargetCommitishField = "target_commitish";
1637
+ static githubNameField = "name";
1638
+ static githubBodyField = "body";
1639
+ static githubRefField = "ref";
1640
+ static githubShaField = "sha";
1641
+ static githubObjectField = "object";
1642
+ static githubTypeField = "type";
1643
+ static githubCommitType = "commit";
1644
+ static publishedReleaseContext = "the published release";
1645
+ static newReleaseContext = "the new release";
1646
+ static fileNotFoundCode = "ENOENT";
1647
+ static missingFileCodes = new Set(["ENOENT", "ENOTDIR"]);
1648
+ static unreachableFileCodes = new Set(["ENOENT", "ENOTDIR", "EACCES", "EPERM"]);
1649
+ static reportSignedChecked = "signed and checked";
1650
+ static reportSignedUnchecked = "signed but not checked";
1651
+ static reportUnsignedChecked = "unsigned but marked checked";
1652
+ static reportUnsigned = "unsigned";
1653
+ static signedPlatformsField = "signedPlatforms";
1654
+ static signablePlatforms = [Resources.windowsTarget, Resources.macosTarget];
1655
+ static signedPlatformsInvalid = `The root ${Resources.packageManifestFileName}'s desktop.signedPlatforms must list distinct platforms among ${Resources.signablePlatforms.join(", ")}.`;
1656
+ static releaseTargetsSeparator = ",";
1657
+ static releaseAlwaysBuiltTargets = ["linux-x64", "windows-x64"];
1658
+ static supportedTargetsField = "supportedTargets";
1659
+ static updateMetadataPrefix = "latest";
1660
+ static updateMetadataExtension = "yml";
1661
+ static updateMetadataReleaseDate = /^releaseDate: '([^'\n]+)'$/mu;
1662
+ static githubIdField = "id";
1663
+ static githubAssetsField = "assets";
1664
+ static githubSizeField = "size";
1665
+ static githubStateField = "state";
1666
+ static githubDigestField = "digest";
1667
+ static githubUploadedState = "uploaded";
1668
+ static releaseRepositoryPattern = /^[A-Za-z0-9-]+\/(?!\.+$)[A-Za-z0-9._-]+$/u;
1669
+ static releaseRevisionPattern = /^[0-9a-f]{40}$/u;
1670
+ static releaseVersionPattern = /^(0|[1-9]\d{0,8})\.(0|[1-9]\d{0,8})\.(0|[1-9]\d{0,8})$/u;
1671
+ static releaseTagPrefix = "v";
1672
+ static gitCommand = "git";
1673
+ static gitTimeout = 60_000;
1674
+ static successExitCodes = [0];
1675
+ static githubCommand = "gh";
1676
+ static githubTimeout = 60_000;
1677
+ static githubUploadTimeout = 900_000;
1678
+ static httpNotFoundStatus = 404;
1679
+ static githubStatusPattern = /\bHTTP (\d{3})\b/u;
1680
+ static githubTagReferencesPath = "/git/matching-refs/tags/";
1681
+ static httpDeleteMethod = "DELETE";
1682
+ static ghApiCommand = "api";
1683
+ static ghPaginateOption = "--paginate";
1684
+ static ghSlurpOption = "--slurp";
1685
+ static ghMethodOption = "--method";
1686
+ static ghRawFieldOption = "--raw-field";
1687
+ static ghFieldOption = "--field";
1688
+ static ghReleaseCommand = "release";
1689
+ static ghUploadCommand = "upload";
1690
+ static ghRepoOption = "--repo";
1691
+ static processOutputLimit = 16 * 1024 * 1024;
1692
+ static missingProcessCode = "ESRCH";
1693
+ static logFileFlag = "w";
1694
+ static processWithoutId = "The process has no process ID, because it never started.";
1695
+ static downloadAttempts = 4;
1696
+ static downloadRetryPause = 15_000;
1697
+ static shortTemporaryRoot = "/tmp";
1698
+ static scannerLineFeed = "\n";
1699
+ static scannerBackslash = "\\";
1700
+ static scannerBacktick = "`";
1701
+ static scannerSubstitutionStart = "${";
1702
+ static scannerLineCommentStart = "//";
1703
+ static scannerBlockCommentStart = "/*";
1704
+ static scannerBlockCommentEnd = "*/";
1705
+ static scannerSlash = "/";
1706
+ static scannerOpeningBrace = "{";
1707
+ static scannerClosingBrace = "}";
1708
+ static scannerOpeningBracket = "[";
1709
+ static scannerClosingBracket = "]";
1710
+ static scannerOpeningParenthesis = "(";
1711
+ static scannerColon = ":";
1712
+ static scannerClosingParenthesis = ")";
1713
+ static scannerEquals = "=";
1714
+ static scannerGreaterThan = ">";
1715
+ static scannerPropertyAccess = ".";
1716
+ static scannerFunctionKeyword = "function";
1717
+ static scannerOperand = "0";
1718
+ static scannerQuotes = new Set(["\"", "'"]);
1719
+ static scannerWhitespace = /\s/;
1720
+ static scannerIdentifierStart = /[A-Za-z_$]/;
1721
+ static scannerWordPart = /[\w$]/;
1722
+ static scannerDigit = /\d/;
1723
+ static scannerOperandEnd = /[\w$)\]]$/;
1724
+ static scannerRegularExpressionKeywords = new Set([
1725
+ "await", "case", "delete", "do", "else", "in", "instanceof", "new", "of", "return", "throw", "typeof", "void", "yield"
1726
+ ]);
1727
+ static scannerImportKeywords = new Set(["from", "import"]);
1728
+ static scannerImportCalls = new Set(["import", "require"]);
1729
+ static scannerSelectorKey = "selector";
1730
+ static scannerEscapeLength = 2;
1731
+ static commandArgumentsOffset = 2;
1732
+ static formatAppleSignatureLacks(subject, failed, outputs) {
1733
+ return `${subject} lacks ${failed.join(Resources.listSeparator)}:\n${outputs.join(Resources.lineSeparator)}`;
1734
+ }
1735
+ static formatAsarEntryNotFile(archive, segments) {
1736
+ return `${archive} holds ${segments.join(Resources.pathSegmentSeparator)} as no file of its own.`;
1737
+ }
1738
+ static formatAuthenticodeRefused(refused) {
1739
+ return `Not every program and addon is signed by the publisher in ${Resources.windowsPublisherVariable}, every library by it or `
1740
+ + `${Resources.authenticodeLibraryVendors.join(Resources.listSeparator)}, and every program a package brings by it or ${Resources.authenticodeProgramVendors.join(Resources.listSeparator)}, `
1741
+ + `with a valid, timestamped signature. Refused:\n${refused.join(Resources.lineSeparator)}`;
1742
+ }
1743
+ static formatMacSigningCredentialsMissing(missing) {
1744
+ return `Signing macOS packages needs ${missing.join(Resources.listSeparator)}, the Developer ID Application certificate and the App Store Connect key that notarizes.`;
1745
+ }
1746
+ static formatMacUpdateUnlinked(archive, frameworks) {
1747
+ return `The app in ${archive} extracts with Versions/Current as no link in ${frameworks.join(Resources.listSeparator)}, so its signature would not hold.`;
1748
+ }
1749
+ static formatMacUpdateDifferences(archive, count, shown) {
1750
+ return `The app in ${archive} extracts unlike the packaged app in ${count} entries:\n` + shown.join(Resources.lineSeparator);
1751
+ }
1752
+ static formatPackageAssetMissing(segments, role) {
1753
+ return `The app has no ${segments.join(Resources.pathSegmentSeparator)}, ${role}; Noldova Desktop brings no default for it, so the package cannot be built.`;
1754
+ }
1755
+ static formatUninstallerLeft(names, folder, holders) {
1756
+ return `The uninstaller left ${names.join(Resources.listSeparator)} in ${folder}.${Object.isNull(holders) ? String.empty : `\n${holders}`}`;
1757
+ }
1758
+ static formatLeftoverRemoved(removed) {
1759
+ return `Removed what an earlier run left installed: ${removed.join(" and ")}.`;
1760
+ }
1761
+ static formatInstallerStoppedFiles(folder, count, lines) {
1762
+ return [`${folder} held ${count} files when the installer was stopped:`, ...lines].join(Resources.lineSeparator);
1763
+ }
1764
+ static formatInstalledFilesMissing(missing) {
1765
+ return `The installed package has no ${missing.join(Resources.listSeparator)}.`;
1766
+ }
1767
+ static formatStageOptionalsLeftOut(leftOut) {
1768
+ return `Optional dependencies left out: ${[...leftOut].map(([id, names]) => `${id}'s ${names.join(Resources.listSeparator)}`).join("; ") || Resources.noneLabel}.\n`;
1769
+ }
1770
+ static formatStagePackages(names) {
1771
+ return `Packages in the stage: ${names.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1772
+ }
1773
+ static formatStageForeignAddons(addons) {
1774
+ return `Addons for other targets left out: ${addons.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1775
+ }
1776
+ static formatStageCompanyPackages(ids) {
1777
+ return `The company's packages in the stage: ${ids.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1778
+ }
1779
+ static formatStageWindowPackages(names) {
1780
+ return `Window packages left to the window build: ${names.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1781
+ }
1782
+ static formatStageAcceptedLicenses(packages) {
1783
+ return `Licenses the app accepted: ${packages.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1784
+ }
1785
+ static formatStageThirdPartyPackages(packages) {
1786
+ return `Third-party packages in the stage: ${packages.join(Resources.listSeparator) || Resources.noneLabel}.\n`;
1787
+ }
1788
+ static formatStagePartsMissing(missing) {
1789
+ return `The stage needs ${missing.join(Resources.listSeparator)}, which is not a package under src/.`;
1790
+ }
1791
+ static formatMachArchitectureUnknown(architecture, known) {
1792
+ return `The package's architecture ${architecture} is none of ${known.join(Resources.listSeparator)}.`;
1793
+ }
1794
+ static formatPackagedModulesNotActive(problems) {
1795
+ return `The installed app's modules are not all active: ${problems.join("; ")}.`;
1796
+ }
1797
+ static formatPackagedModulesActive(active, unavailable, blocked, off, platform) {
1798
+ return `The installed app's modules are active: ${active.length === 0 ? Resources.noneLabel : active.join(Resources.listSeparator)}`
1799
+ + `${unavailable.length === 0 ? String.empty : `; ${unavailable.join(Resources.listSeparator)} unavailable on ${platform}, which ${unavailable.length === 1 ? "it leaves" : "they leave"} out`}`
1800
+ + `${blocked.length === 0 ? String.empty : `; ${blocked.join(Resources.listSeparator)} blocked by a dependency ${platform} leaves out`}`
1801
+ + `${off.length === 0 ? String.empty : `; ${off.join(Resources.listSeparator)} off by ${off.length === 1 ? "its" : "their"} switch setting`}.`;
1802
+ }
1803
+ static formatSandboxMainProcesses(started, count, family) {
1804
+ return `The started process ${started} has ${count} Electron main processes among its descendants instead of one, so its sandbox cannot be checked; they are ${family.join(Resources.listSeparator)}.`;
1805
+ }
1806
+ static formatSandboxModes(modes) {
1807
+ return modes.map(([type, seccomp]) => `${type} ${seccomp}`).join(Resources.listSeparator);
1808
+ }
1809
+ static formatUnpackedVerified(files) {
1810
+ return `The installed package keeps outside app.asar, each marked unpacked and readable: ${files.join(Resources.listSeparator)}.`;
1811
+ }
1812
+ static formatClosurePeerMissing(id, location, missing, others) {
1813
+ return `${id} at ${location} needs the peer dependency ${missing}, which no shipped package brings and Electron does not provide, so it would fail at runtime.`
1814
+ + (others.length === 0 ? String.empty : ` The app names types-only peers only for ${others.join(Resources.listSeparator)}.`);
1815
+ }
1816
+ static formatTrustedSigningAccountMissing(missing) {
1817
+ return `Signing a Windows file needs ${missing.join(Resources.listSeparator)}, which packaging sets from ${Resources.windowsSigningSection}.`;
1818
+ }
1819
+ static formatWindowsSigningCredentialsMissing(missing) {
1820
+ return `Signing Windows packages needs ${missing.join(Resources.listSeparator)}, the Azure service principal for the signing account in ${Resources.windowsSigningSection}.`;
1821
+ }
1822
+ static formatUnknownFields(fields) {
1823
+ return `has unknown fields: ${fields.join(", ")}`;
1824
+ }
1825
+ static formatModulePartsWithoutFolder(missing) {
1826
+ return `declares parts without a folder: ${missing.join(", ")}`;
1827
+ }
1828
+ static formatModuleDependencyRepeated(both) {
1829
+ return `names ${both.join(", ")} as both a dependency and an optional dependency`;
1830
+ }
1831
+ static formatModulePartsNotExported(packageName, missing) {
1832
+ return `declares parts its package does not export at ${packageName}/<part>: ${missing.join(", ")}`;
1833
+ }
1834
+ static formatModulePartsNotDeclared(undeclared) {
1835
+ return `does not declare parts its package exports: ${undeclared.join(", ")}`;
1836
+ }
1837
+ static formatModuleToolPrefixes(id) {
1838
+ return [
1839
+ `${id.replaceAll(Resources.kebabSeparator, Resources.snakeSeparator)}${Resources.snakeSeparator}`,
1840
+ `${id.split(Resources.kebabSeparator)[0]}${Resources.snakeSeparator}`
1841
+ ];
1842
+ }
1843
+ static formatModuleToolNamesExpected(prefixes) {
1844
+ return `snake_case names of at most ${Resources.moduleToolNameLimit} characters starting with ${[...new Set(prefixes)].join(" or ")}`;
1845
+ }
1846
+ static formatWindowPartTail(lists) {
1847
+ const length = lists.findLastIndex(t => t.length > 0) + 1;
1848
+ return lists.slice(0, length).map(t => `, ${JSON.stringify(t)}`).join(String.empty);
1849
+ }
1850
+ static formatWindowPartList(lines) {
1851
+ return lines.length === 0 ? "[]" : `[\n${lines.join(",\n")}\n]`;
1852
+ }
1853
+ static formatWindowPartsFile(sources, menus) {
1854
+ return `${Resources.licenseHeaderBlock}\n${Resources.windowPartsSourceImport}\n`
1855
+ + `export const windowPartSources: readonly WindowPartSource[] = ${Resources.formatWindowPartList(sources)};\n\n`
1856
+ + `export const moduleMenus: IWindowInputs["menus"] = ${menus.length === 0 ? "{}" : `{\n${menus.join(",\n")}\n}`};\n`;
1857
+ }
1858
+ static formatCliGlobalOptions(options) {
1859
+ return `must not have options the command line has itself: ${options.map(t => `--${t}`).join(", ")}`;
1860
+ }
1861
+ static formatCliFieldsExpected(fields, optional) {
1862
+ const optionalText = optional.length > 0 ? `, and optionally ${optional.join(", ")}` : String.empty;
1863
+ return `must be an object with the fields ${fields.filter(t => !optional.includes(t)).join(", ")}${optionalText}`;
1864
+ }
1865
+ static formatMenusPlacesUndescribed(undescribed) {
1866
+ return `does not describe the declared places ${undescribed.join(", ")}`;
1867
+ }
1868
+ static formatMenusCycle(place, path) {
1869
+ return `opens ${place} inside itself: ${[...path, place].join(" > ")}`;
1870
+ }
1871
+ static formatCatalogIdsRepeated(folders) {
1872
+ return `Module ids repeat in the build: ${folders.join(", ")}.`;
1873
+ }
1874
+ static formatCatalogExcludedAbsent(absent) {
1875
+ return `The build has no module ${absent.join(", ")} to leave out.`;
1876
+ }
1877
+ static formatCatalogDependenciesMissing(id, missing) {
1878
+ return `${id} ${Resources.moduleDependsOn} ${missing.join(", ")}, which the build does not include.`;
1879
+ }
1880
+ static formatCatalogCycle(names) {
1881
+ return `The dependencies of ${names.join(", ")} form a cycle.`;
1882
+ }
1883
+ static formatCatalogPlaceholdersRepeated(placeholders) {
1884
+ return `Placeholders repeat in the build, which shows one: ${placeholders.join(", ")}.`;
1885
+ }
1886
+ static formatCatalogSettingsPagesRepeated(pages) {
1887
+ return `Settings page titles repeat in the build, and a title names one page: ${pages.map(([title, owner]) => `${title} for ${owner}`).join(", ")}.`;
1888
+ }
1889
+ static formatCatalogNamesRepeated(repeated) {
1890
+ return `Contributed names repeat in the build: ${repeated.map(([name, files]) => Resources.formatNameInFile(name, files.join(", "))).join("; ")}.`;
1891
+ }
1892
+ static formatCatalogNoldovaDesktopOutside(outside, version) {
1893
+ return `${outside.join("; ")}, but the app has ${Object.isNull(version) ? "no Noldova Desktop" : `Noldova Desktop ${version}`}, as ${Resources.desktopRuntimePackage} shows.`;
1894
+ }
1895
+ static formatAngularCopies(name, copies) {
1896
+ return `More than one copy of ${name} is installed in the app, so the kit and Noldova Desktop would each run their own overlay container and focus handling: ${copies.join("; ")}.`;
1897
+ }
1898
+ static formatWindowAppsClash(folders) {
1899
+ return `${Resources.sourceFolder}/ holds more than one window app, a folder whose name ends in ${Resources.windowAppSuffix}: ${folders.join(", ")}; an app has one.`;
1900
+ }
1901
+ static formatInstalledCopy(version, trail) {
1902
+ return `${version} (${trail.join(Resources.installedCopiesTrailSeparator)})`;
1903
+ }
1904
+ static formatCommandFailed(command, commandArguments, exitCode, errorOutput) {
1905
+ return `"${command} ${commandArguments.join(" ")}" failed with ${exitCode}: ${errorOutput.trim()}`;
1906
+ }
1907
+ static formatCopyLine(fields) {
1908
+ return `${fields.join("\t")}\n`;
1909
+ }
1910
+ static formatOptionalDependenciesAbsent(id, absent) {
1911
+ return `${id} runs without ${absent.join(", ")}, optional for it and left out of the build.\n`;
1912
+ }
1913
+ static formatTargetRow(cells) {
1914
+ return `${cells.join(Resources.targetCellSeparator)}\n`;
1915
+ }
1916
+ static formatFeedServes(feed, version, targetIds) {
1917
+ return `The update feed ${feed} serves ${version} for ${targetIds.join(", ")}.\n`;
1918
+ }
1919
+ static formatFeedFilesMatch(targetId, metadata, version, names) {
1920
+ return `${targetId}: ${metadata} names ${version}, and ${names.join(", ")} match its SHA-512 and size.`;
1921
+ }
1922
+ static formatFeedTargetsInvalid(targetIds, text) {
1923
+ return `${Resources.releaseTargetsVariable} must list the targets the feed serves, distinct and among ${targetIds.join(", ")}, separated by commas, not "${text}".`;
1924
+ }
1925
+ static formatReleaseFiles(platform, architecture, version, names) {
1926
+ return `The release files of ${platform} ${architecture} for ${version}:\n${names.join("\n")}\n`;
1927
+ }
1928
+ static formatReleaseCheckOutputs(signed, feed) {
1929
+ return `${Resources.signedOutput}=${signed.join(Resources.signedPlatformsSeparator)}\n${Resources.productFeedOutput}=${feed}\n`;
1930
+ }
1931
+ static formatReleaseChecked(tag, repository, revision, signed) {
1932
+ return `${tag} of ${repository} from ${revision}: the version is new, the revision is on ${Resources.mainBranch} `
1933
+ + `and its Build and test run there passed. Signed platforms: ${signed.length === 0 ? Resources.noSignedPlatforms : signed.join(", ")}.\n`;
1934
+ }
1935
+ static formatBuilderMissingFiles(missing) {
1936
+ return `electron-builder finished without making ${missing.join(", ")}.`;
1937
+ }
1938
+ static formatPackagesMade(files) {
1939
+ return `Packages made:\n${files.map(t => ` ${t}\n`).join(String.empty)}`;
1940
+ }
1941
+ static formatSmokeMountedCopyRecords(logs, count, texts) {
1942
+ return `While the main process ran, ${logs} held ${count} copy records of the runtime's AppImage, although its mounted copy needs none:\n${texts.join(Resources.lineSeparator)}`;
1943
+ }
1944
+ static formatSmokeCopyLingered(moment, entries, tail) {
1945
+ return `The runtime's copy of the AppImage was still there ${Resources.smokeKillLimit} ms after the runtime ${moment}: ${entries.join(" ")}\n${tail}`;
1946
+ }
1947
+ static formatSmokeCleanUpFailed(problems) {
1948
+ return `Cleaning up failed:\n${problems.join(Resources.lineSeparator)}\n`;
1949
+ }
1950
+ static formatFieldPath(...fields) {
1951
+ return fields.join(Resources.fieldPathSeparator);
1952
+ }
1953
+ static formatFolderPath(...segments) {
1954
+ return segments.join(Resources.pathSegmentSeparator);
1955
+ }
1956
+ static formatLines(lines) {
1957
+ return lines.join(Resources.lineSeparator);
1958
+ }
1959
+ static formatBuildRecord(inputs, outputs) {
1960
+ return `inputs ${inputs}\n${outputs.map(t => `output ${t}\n`).join(String.empty)}`;
1961
+ }
1962
+ static formatManifestUnpinned(file, names) {
1963
+ return `${file} must pin ${names.join(Resources.listSeparator)} to an exact version.`;
1964
+ }
1965
+ static formatManifestOwnUnstamped(file, names) {
1966
+ return `${file} must depend on ${names.join(Resources.listSeparator)} at version "${Resources.packageVersionPlaceholder}".`;
1967
+ }
1968
+ static formatManifestOwnPeerUnranged(file, names) {
1969
+ return `${file} must take ${names.join(Resources.listSeparator)} as a peer at "${Resources.packagePeerRangePlaceholder}"; the build stamps the version and its next minor.`;
1970
+ }
1971
+ static formatModuleVersionsUnreadable(problems) {
1972
+ return `The build cannot version the module packages: ${problems.join(Resources.problemSeparator)}`;
1973
+ }
1974
+ static formatPackageNamesClash(directories) {
1975
+ return `Package paths produce the same name: ${directories.join(Resources.listSeparator)}.`;
1976
+ }
1977
+ static formatPackageDependsOnUnknown(directory, names) {
1978
+ return `${directory} depends on ${names.join(Resources.listSeparator)}, which is not a package under src/.`;
1979
+ }
1980
+ static formatPackageCycle(names) {
1981
+ return `The dependencies of ${names.join(Resources.listSeparator)} form a cycle.`;
1982
+ }
1983
+ static formatArtifactsStale(names) {
1984
+ return `The built artifacts of ${names.join(Resources.listSeparator)} are missing or stale; run npm run build.`;
1985
+ }
1986
+ static formatLicenseRefused(packageId, expression, otherAccepted) {
1987
+ return `${packageId} is licensed under "${expression}"; a third-party runtime package needs ${Resources.formatAllowedLicenses()}.`
1988
+ + (otherAccepted.length === 0 ? String.empty : ` The app accepts another license only for ${otherAccepted.join(", ")}, so this version's terms need accepting again.`);
1989
+ }
1990
+ static formatReviewedLicenseMissing(id, files) {
1991
+ return `${id} has no license file in its tarball, such as LICENSE, LICENCE or COPYING, and neither ${files.join(" nor ")} holds a reviewed license text for it, so its license cannot ship.`;
1992
+ }
1993
+ static formatReleaseFilesDiffer(folder, missing, unexpected) {
1994
+ return `The release's files in ${folder} differ from the files a release has. Missing: ${missing.join(", ") || "none"}. Not part of a release: ${unexpected.join(", ") || "none"}.`;
1995
+ }
1996
+ static formatUpdateMetadataMismatch(metadata, version, names) {
1997
+ return `${metadata} does not describe version ${version} with ${names.join(" and ")} as they are.`;
1998
+ }
1999
+ static formatReleasePartlySigned(signed, unsigned) {
2000
+ return `The ${signed.join(" and ")} packages are signed; the ${unsigned.join(" and ")} packages are unsigned.`;
2001
+ }
2002
+ static formatReleaseTargetNames(names) {
2003
+ return names.length < 2 ? names.join(String.empty) : `${names.slice(0, -1).join(", ")} and ${names.at(-1)}`;
2004
+ }
2005
+ static formatReleaseAssetsDiffer(tag, missing, unexpected) {
2006
+ return `${tag} on GitHub differs from the built files. Missing: ${missing.join(Resources.listSeparator) || Resources.noneLabel}. Not part of the release: ${unexpected.join(Resources.listSeparator) || Resources.noneLabel}.`;
2007
+ }
2008
+ static formatReportsMismatch(problems) {
2009
+ return `The package reports do not match the release's signing, so nothing was published:\n${problems.join("\n")}`;
2010
+ }
2011
+ static formatReportsVerified(signedPlatforms) {
2012
+ return `Every target of the release has one package report, and the signed ones were signed and checked: ${signedPlatforms.length === 0 ? "none" : signedPlatforms.join(", ")}.`;
2013
+ }
2014
+ static formatUpdateFeedNeedsSigning(repository, productName, unsigned) {
2015
+ return `${repository} is ${productName}'s update feed, which gets only signed ${Resources.signablePlatforms.join(" and ")} packages, `
2016
+ + `but desktop.signedPlatforms leaves out ${unsigned.join(" and ")}.`;
2017
+ }
2018
+ static formatReleaseTargetsInvalid(ids, text) {
2019
+ return `${Resources.releaseTargetsVariable} must list the targets the release built, distinct and among ${ids.join(", ")}, separated by commas, not "${text}".`;
2020
+ }
2021
+ static formatReleaseTargetsMissing(required, missing) {
2022
+ return `This release builds ${required.join(", ")}, but ${Resources.releaseTargetsVariable} leaves out ${missing.join(", ")}.`;
2023
+ }
2024
+ static formatReleaseTargetsUnbuilt(unbuilt) {
2025
+ return `The root package.json's desktop.supportedTargets lists ${unbuilt.join(", ")}, which this release did not build, so it cannot call them supported.`;
2026
+ }
2027
+ static formatSupportedTargetsInvalid(ids) {
2028
+ return `The root ${Resources.packageManifestFileName}'s desktop.supportedTargets must list distinct targets among `
2029
+ + `${ids.join(", ")}.`;
2030
+ }
2031
+ static formatUpdateMetadataEntry(name, sha512, size) {
2032
+ return [` - url: ${Resources.formatYamlQuoted(name)}`, ` sha512: ${sha512}`, ` size: ${size}`];
2033
+ }
2034
+ static formatUpdateMetadata(version, entries, updateName, sha512, releaseDate) {
2035
+ return [
2036
+ `version: ${version}`,
2037
+ "files:",
2038
+ ...entries,
2039
+ `path: ${Resources.formatYamlQuoted(updateName)}`,
2040
+ `sha512: ${sha512}`,
2041
+ `releaseDate: ${Resources.formatYamlQuoted(releaseDate)}`,
2042
+ String.empty
2043
+ ].join("\n");
2044
+ }
2045
+ static formatGitFailed(gitArguments, exitCode, errorOutput) {
2046
+ return `"git ${gitArguments.join(" ")}" failed with exit code ${exitCode}: ${errorOutput.trim()}`;
2047
+ }
2048
+ static formatGhFailed(gitHubArguments, exitCode, errorOutput) {
2049
+ return `"gh ${gitHubArguments.join(" ")}" failed with exit code ${exitCode}: ${errorOutput.trim()}`;
2050
+ }
2051
+ static formatProcessFailed(commandName, commandArguments, exitCode, text) {
2052
+ return `${commandName} ${commandArguments.join(" ")} failed with exit code ${exitCode}:\n${text}`;
2053
+ }
2054
+ static formatAppleDiskImageSubject(image) {
2055
+ return `The disk image ${image}`;
2056
+ }
2057
+ static formatAppleAppSubject(container) {
2058
+ return `The app in ${container}`;
2059
+ }
2060
+ static formatAppleDiskImageVerified(image) {
2061
+ return `${image}: the disk image and its app each have a valid Developer ID Application signature, notarized and stapled.`;
2062
+ }
2063
+ static formatAppleArchiveVerified(archive) {
2064
+ return `${archive}: a valid Developer ID Application signature, notarized and stapled.`;
2065
+ }
2066
+ static formatAsarTruncated(archive, length, position) {
2067
+ return `${archive} ends before the ${length} bytes at ${position} that its header names.`;
2068
+ }
2069
+ static formatAuthenticodeReadFailed(exitCode, output) {
2070
+ return `${Resources.powershellCommand} failed reading the Windows signatures with exit code ${exitCode}:\n${output}`;
2071
+ }
2072
+ static formatAuthenticodeReportIncomplete(count) {
2073
+ return `${Resources.powershellCommand} did not report one signature for each of the ${count} files it checked.`;
2074
+ }
2075
+ static formatAuthenticodeLine(file, status, timestamped, signer) {
2076
+ return `${file}: ${status}, timestamped: ${timestamped}, signed by: ${signer}`;
2077
+ }
2078
+ static formatAuthenticodeRefusedLine(line) {
2079
+ return ` ${line}`;
2080
+ }
2081
+ static formatElectronVersionMissing(manifest) {
2082
+ return `${manifest} has no version for Electron.`;
2083
+ }
2084
+ static formatFileHoldersReadFailed(exitCode, output) {
2085
+ return `What holds them could not be read: ${Resources.windowsPowershellCommand} exited with ${exitCode}:\n${output}`;
2086
+ }
2087
+ static formatFileHolders(output) {
2088
+ return `What holds them now:\n${output}`;
2089
+ }
2090
+ static formatMacNotarizationRefused(image, output) {
2091
+ return `Apple did not notarize the disk image ${image}:\n${output}`;
2092
+ }
2093
+ static formatMacStapleFailed(image, isOffline, output) {
2094
+ return `The notarization ticket could not be stapled to the disk image ${image}${isOffline
2095
+ ? `, as stapler staple lost its network connection on all ${Resources.staplerAttempts} attempts` : String.empty}:\n${output}`;
2096
+ }
2097
+ static formatMacNotarized(image, submission) {
2098
+ return `${image}: Apple accepted notarization submission ${submission}, and its ticket is stapled.\n`;
2099
+ }
2100
+ static formatMacUpdateCopies(count, bundle, output, archive) {
2101
+ return `electron-builder left ${count} copies of ${bundle} in ${output}, so ${archive} has no one app to match.`;
2102
+ }
2103
+ static formatMacUpdateDifference(entry, expected, actual) {
2104
+ return ` ${entry}: ${expected} in the app, ${actual} in the archive`;
2105
+ }
2106
+ static formatMacUpdateVerified(archive, entries, frameworks) {
2107
+ return `${archive}: the app extracts with ditto as packaged, ${entries} entries, with Versions/Current a link in each of its ${frameworks} frameworks.`;
2108
+ }
2109
+ static formatMacUpdateLink(target) {
2110
+ return `${Resources.macUpdateLinkPrefix}${target}`;
2111
+ }
2112
+ static formatMacUpdateFileEntry(size) {
2113
+ return `file of ${size} bytes`;
2114
+ }
2115
+ static formatNativeBinaryWildcard(relative) {
2116
+ return `${relative} is a native program or library the app must keep outside app.asar, but its path holds a character a file pattern reads as a wildcard.`;
2117
+ }
2118
+ static formatJsonFile(value) {
2119
+ return `${JSON.stringify(value, null, Resources.jsonIndent)}\n`;
2120
+ }
2121
+ static formatPackageCopyright(publisher) {
2122
+ return `Copyright (c) ${publisher}`;
2123
+ }
2124
+ static formatPackagedCommandPath(name) {
2125
+ return `${Resources.commandFolder}${Resources.pathSegmentSeparator}${name}`;
2126
+ }
2127
+ static formatPackagedLicensePath(name) {
2128
+ return `${Resources.packagedLicensesFolder}${Resources.pathSegmentSeparator}${name}`;
2129
+ }
2130
+ static formatWindowsCommandScript(program, entry) {
2131
+ return [
2132
+ "@echo off",
2133
+ "setlocal",
2134
+ `set ${Resources.runAsNodeVariable}=${Resources.runAsNodeValue}`,
2135
+ `"${program}" "${entry}" %*`,
2136
+ "exit /b %ERRORLEVEL%"
2137
+ ].map(t => `${t}${Resources.windowsLineSeparator}`).join(String.empty);
2138
+ }
2139
+ static formatMacCommandScript(program, entry) {
2140
+ return [
2141
+ "#!/bin/sh",
2142
+ "link=\"$0\"",
2143
+ "while [ -h \"$link\" ]; do",
2144
+ " target=$(readlink \"$link\")",
2145
+ " case \"$target\" in",
2146
+ " /*) link=\"$target\" ;;",
2147
+ " *) link=\"$(dirname \"$link\")/$target\" ;;",
2148
+ " esac",
2149
+ "done",
2150
+ "resources=$(cd -P \"$(dirname \"$link\")/..\" && pwd)",
2151
+ `export ${Resources.runAsNodeVariable}=${Resources.runAsNodeValue}`,
2152
+ `exec "${program}" "${entry}" "$@"`
2153
+ ].map(t => `${t}\n`).join(String.empty);
2154
+ }
2155
+ static formatUninstallerNotRemoved(uninstaller, error) {
2156
+ return `The uninstaller ${uninstaller} could not be removed after it ran: ${String(error)}`;
2157
+ }
2158
+ static formatUserPathEntry(entry) {
2159
+ return `${entry} on the user's Path`;
2160
+ }
2161
+ static formatInstallerCreatedNothing(folder) {
2162
+ return `The installer had not created ${folder}.`;
2163
+ }
2164
+ static formatInstalledFileSize(file, size) {
2165
+ return `${file}: ${size} bytes`;
2166
+ }
2167
+ static formatInstallerTimedOut(message, description) {
2168
+ return `${message}\n${description}`;
2169
+ }
2170
+ static formatDetachAfterCopyFailed(error, detachError) {
2171
+ return `${String(error)}\nDetaching the disk image after the failed copy failed too: ${String(detachError)}`;
2172
+ }
2173
+ static formatStageInstallFailed(exitCode, output) {
2174
+ return `Installing the packages into the stage failed with exit code ${exitCode}; it uses only the build's archives and never the registry:\n${output}`;
2175
+ }
2176
+ static formatStageUnshippedWarning(section, id) {
2177
+ return `Warning: ${section} names ${id}, which the app does not ship; remove it.\n`;
2178
+ }
2179
+ static formatStageSkippedEntryWarning(id, entry) {
2180
+ return `Warning: The tarball of ${id} holds ${entry}, which the stage's checks of its scripts and license do not read.\n`;
2181
+ }
2182
+ static formatStageTypeOnlyPeers(description) {
2183
+ return `Peers passed over as types-only: ${description || Resources.noneLabel}.\n`;
2184
+ }
2185
+ static formatStageLicensedPackage(id, license) {
2186
+ return `${id} (${license})`;
2187
+ }
2188
+ static formatMachArchitectureMismatch(file, found, architecture) {
2189
+ return `The installed ${file} is ${found}, not an ${architecture}-only Mach-O file, so it would not run natively on ${architecture}.`;
2190
+ }
2191
+ static formatMachArchitectureVerified(application, count, architecture) {
2192
+ return `Every Mach-O file in ${application}, ${count} in all, is ${architecture} alone.`;
2193
+ }
2194
+ static formatMachCpuType(type) {
2195
+ return `a Mach-O file for CPU type 0x${type.toString(16)}`;
2196
+ }
2197
+ static formatPackagedBuildFailed(exitCode) {
2198
+ return `The packaged build failed with exit code ${exitCode}.`;
2199
+ }
2200
+ static formatPackagedModulesUnlisted(status) {
2201
+ return `The installed app's status --json answered without its modules: ${JSON.stringify(status)}`;
2202
+ }
2203
+ static formatPackagedModuleMissing(id) {
2204
+ return `${id} is missing from status`;
2205
+ }
2206
+ static formatPackagedModuleInactive(id, state, cause) {
2207
+ return `${id.length === 0 ? Resources.packagedModuleWithoutId : id} is ${state.length === 0 ? Resources.packagedModuleWithoutState : state}${cause.length === 0 ? String.empty : ` (${cause})`}`;
2208
+ }
2209
+ static formatPublisherFieldMissing(product) {
2210
+ return `The installed ${product} has no ${Resources.productWindowsPublisherField} field to check against ${Resources.windowsPublisherVariable}.`;
2211
+ }
2212
+ static formatPublisherNotText(product) {
2213
+ return `The installed ${product}'s Windows publisher is not a string, so it can't be checked against ${Resources.windowsPublisherVariable}.`;
2214
+ }
2215
+ static formatPublisherUnexpected(product) {
2216
+ return `The installed ${product} has a Windows publisher set, but ${Resources.windowsPublisherVariable} is not set.`;
2217
+ }
2218
+ static formatPublisherMissing(product) {
2219
+ return `The installed ${product} is missing its Windows publisher, but ${Resources.windowsPublisherVariable} is set.`;
2220
+ }
2221
+ static formatPublisherDiffers(product) {
2222
+ return `The installed ${product}'s Windows publisher differs from ${Resources.windowsPublisherVariable}.`;
2223
+ }
2224
+ static formatSandboxProcess(id, type) {
2225
+ return `${id} ${type}`;
2226
+ }
2227
+ static formatSandboxNoRenderer(main) {
2228
+ return `The main process ${main} has no renderer, so its sandbox cannot be checked.`;
2229
+ }
2230
+ static formatSandboxMustBeOn(main, isOff, modes) {
2231
+ return `Chromium's sandbox must be on, but the main process ${main} runs ${isOff ? Resources.sandboxWithOption : Resources.sandboxWithoutOption} --no-sandbox, and its processes' seccomp modes are: ${modes}.`;
2232
+ }
2233
+ static formatSandboxOn(modes) {
2234
+ return `Chromium's sandbox is on: the main process runs without --no-sandbox, and every renderer runs under a seccomp filter, mode 2 (${modes}).`;
2235
+ }
2236
+ static formatSandboxMustBeOff(main, modes) {
2237
+ return `Chromium's sandbox must be off here, but the main process ${main} runs without --no-sandbox, and its processes' seccomp modes are: ${modes}.`;
2238
+ }
2239
+ static formatSandboxOff(modes) {
2240
+ return `Chromium's sandbox is off: the main process runs with --no-sandbox (${modes}).`;
2241
+ }
2242
+ static formatUnpackedPatternUnmatched(archive, pattern) {
2243
+ return `The installed ${archive} has no entry that ${pattern} matches, which the package's configuration keeps outside app.asar.`;
2244
+ }
2245
+ static formatUnpackedEntryMissing(archive, file) {
2246
+ return `The installed ${archive} has no entry for ${file}, which the package's configuration keeps outside app.asar.`;
2247
+ }
2248
+ static formatUnpackedEntryPacked(archive, file) {
2249
+ return `The installed ${archive} holds ${file} inside it, though the package's configuration keeps it outside app.asar.`;
2250
+ }
2251
+ static formatUnpackedFileUnreadable(file, unpacked) {
2252
+ return `The installed package's ${file} can't be read in ${unpacked}, though the package's configuration keeps it outside app.asar.`;
2253
+ }
2254
+ static formatUnpackedListMissing(configuration) {
2255
+ return `${configuration} gives no ${Resources.builderUnpackField} list of paths and patterns.`;
2256
+ }
2257
+ static formatWindowUnreported(window) {
2258
+ return `The installed app's status --json reported no main window: ${JSON.stringify(window ?? null)}`;
2259
+ }
2260
+ static formatWindowPageSuffix(productName) {
2261
+ return `${Resources.windowTitlePageSeparator}${productName}`;
2262
+ }
2263
+ static formatWindowMistitled(title, productName, pageSuffix) {
2264
+ return `The installed app's main window is titled ${JSON.stringify(title)} instead of ${JSON.stringify(productName)} or a page's title and ${JSON.stringify(pageSuffix)}.`;
2265
+ }
2266
+ static formatWindowHidden(title) {
2267
+ return `The installed app's main window ${JSON.stringify(title)} is not shown.`;
2268
+ }
2269
+ static formatWindowUnpainted(title) {
2270
+ return `The installed app's main window ${JSON.stringify(title)} is shown, but its page hasn't painted.`;
2271
+ }
2272
+ static formatWindowShown(title) {
2273
+ return `The installed app's main window is shown, titled ${JSON.stringify(title)}.`;
2274
+ }
2275
+ static formatWindowMainEnded(ending, failure, tail) {
2276
+ return `The main process ${ending} before its main window was shown. ${failure}\n${tail}`;
2277
+ }
2278
+ static formatWindowTimedOut(limit, failure, exitCode, output, tail) {
2279
+ return `The installed app's main window was not shown within ${limit} ms. ${failure}\nThe last status --json exited with ${exitCode}:\n${output}\n${tail}`;
2280
+ }
2281
+ static formatMountOutlived(moment) {
2282
+ return `The runtime's mount of the AppImage outlived the main process, which ${moment}.\n`;
2283
+ }
2284
+ static formatMountEndedEarly(mount, moment, runtime) {
2285
+ return `The runtime's mount of the AppImage at ${mount} ended once the main process ${moment}, while the runtime, process ${runtime}, still ran and still named itself in its discovery file.`;
2286
+ }
2287
+ static formatMountEndedAfterRuntime(runtime, moment) {
2288
+ return `The runtime's mount of the AppImage ended after the runtime, process ${runtime}, withdrew its discovery file to stop once the main process ${moment}.\n`;
2289
+ }
2290
+ static formatShippedIgnoredName(name) {
2291
+ return `it leaves out every file and folder named ${name}.`;
2292
+ }
2293
+ static formatShippedIgnoredExtension(extension) {
2294
+ return `it leaves out every ${extension} file.`;
2295
+ }
2296
+ static formatShippedTopIgnored(name) {
2297
+ return `it leaves out the app's top-level ${name}.`;
2298
+ }
2299
+ static formatShippedAppConfiguration(name) {
2300
+ return `it leaves out every file and folder named ${name} outside the packages.`;
2301
+ }
2302
+ static formatShippedPackageIgnoredName(name) {
2303
+ return `it leaves out every file and folder named ${name} in a package.`;
2304
+ }
2305
+ static formatShippedPackageTopIgnored(name) {
2306
+ return `it leaves out a package's top-level ${name}.`;
2307
+ }
2308
+ static formatShippedModuleTopIgnored(module, name) {
2309
+ return `it leaves out ${module}'s top-level ${name}.`;
2310
+ }
2311
+ static formatShippedGypOutput(name, end) {
2312
+ return `it leaves out gyp's ${name} in a package's folders whose names end in ${end}.`;
2313
+ }
2314
+ static formatShippedPackageFolderIgnored(name, end) {
2315
+ return `it leaves out ${name} in a package's folders whose names end in ${end}.`;
2316
+ }
2317
+ static formatClosureManifestUnlocked(directory, name) {
2318
+ return `${directory}/package.json needs ${name}, which the root ${Resources.packageLockFileName} does not lock; pin it in the root package.json and run npm install.`;
2319
+ }
2320
+ static formatClosureRootUnlocked(name) {
2321
+ return `The build ships ${name}, which the root ${Resources.packageLockFileName} does not lock; pin it in the root package.json and run npm install.`;
2322
+ }
2323
+ static formatClosureVersionConflict(otherId, otherLocation, id, location) {
2324
+ return `The stage installs one version of each third-party package, but the shipped packages need ${otherId} at ${otherLocation} and ${id} at ${location}.`;
2325
+ }
2326
+ static formatClosureNotOptional(notOptional, id) {
2327
+ return `${Resources.omittedOptionalsSection} leaves out ${notOptional} of ${id}, which is not one of its optional dependencies; an app leaves out only an optional dependency it never loads.`;
2328
+ }
2329
+ static formatLockfileUnreadable(title) {
2330
+ return `${title} could not be read as JSON.`;
2331
+ }
2332
+ static formatLockfileVersionInvalid(title) {
2333
+ return `${title} must be a lockfile of version ${Resources.lockfileVersion} with its packages.`;
2334
+ }
2335
+ static formatClosureDependencyUnlocked(from, name) {
2336
+ return `${from} needs ${name}, which ${Resources.packageLockFileName} does not lock.`;
2337
+ }
2338
+ static formatClosureUnfit(location, target) {
2339
+ return `${location} in ${Resources.packageLockFileName} does not run on ${target}, yet a shipped package needs it.`;
2340
+ }
2341
+ static formatTrustedSigningFolderInvalid(folder) {
2342
+ return `${Resources.trustedSigningFolderVariable} must name the folder that holds the prepared ${Resources.trustedSigningModuleName} module, not "${folder}".`;
2343
+ }
2344
+ static formatPinnedPackageHashMismatch(url, hash, recorded) {
2345
+ return `The package from ${url} has the SHA-512 ${hash}, not the recorded ${recorded}, so no signing package was expanded.`;
2346
+ }
2347
+ static formatTrustedSigningFileListed(file) {
2348
+ return `${Resources.trustedSigningModuleName} takes a comma-separated list of files, so it cannot sign ${file}.`;
2349
+ }
2350
+ static formatTrustedSigningSignAction(file) {
2351
+ return `signing ${file} with`;
2352
+ }
2353
+ static formatNugetPackageUrl(id, release) {
2354
+ return `${Resources.nugetFlatContainerUrl}/${id}/${release}/${id}.${release}${Resources.nugetPackageExtension}`;
2355
+ }
2356
+ static formatTrustedSigningToolFolder(name, version) {
2357
+ return [Resources.trustedSigningToolsFolder, Resources.trustedSigningModuleName, name, `${name}.${version}`].join(Resources.pathSegmentSeparator);
2358
+ }
2359
+ static formatSigningPackageDownloadFailed(url, error) {
2360
+ return `A signing package could not be downloaded from ${url}: ${String(error)}`;
2361
+ }
2362
+ static formatSigningPackageHttpFailed(url, status) {
2363
+ return `A signing package could not be downloaded from ${url}: HTTP ${status}.`;
2364
+ }
2365
+ static formatTrustedSigningRunFailed(action, exitCode, output) {
2366
+ return `${Resources.powershellCommand} failed ${action} the ${Resources.trustedSigningModuleName} module with exit code ${exitCode}:\n${output}`;
2367
+ }
2368
+ static formatUnpackedFieldInvalid(name) {
2369
+ return `${name}'s package.json must give ${Resources.noldovaDesktopField}.${Resources.desktopUnpackedField} as a list of paths of the package's own files, with / between folders.`;
2370
+ }
2371
+ static formatUnpackedNeverShipped(omission) {
2372
+ return `electron-builder never ships it, since ${omission}`;
2373
+ }
2374
+ static formatUnpackedWrongCase(other, segment) {
2375
+ return `the package holds ${other}, not ${segment}; name each folder and file in its own case.`;
2376
+ }
2377
+ static formatUnpackedRefused(name, file, reason) {
2378
+ return `${name} names ${file} to keep outside app.asar, but ${reason}`;
2379
+ }
2380
+ static formatUserPathUnreadable(exitCode, output) {
2381
+ return `${Resources.registryCommand} ${Resources.userPathQueryArguments.join(" ")} did not answer with the user's Path; it exited with ${exitCode}:\n${output}`;
2382
+ }
2383
+ static formatWindowsUnpackedProgramMissing(program) {
2384
+ return `electron-builder finished without the unpacked program ${program}, whose signature the check reads.`;
2385
+ }
2386
+ static formatFunctionKey(ordinal) {
2387
+ return `F${ordinal}`;
2388
+ }
2389
+ static formatFolderFile(folder, file) {
2390
+ return `${folder}${Resources.pathSegmentSeparator}${file}`;
2391
+ }
2392
+ static formatPackageSubpath(packageName, part) {
2393
+ return `${packageName}${Resources.pathSegmentSeparator}${part}`;
2394
+ }
2395
+ static formatPackageExportPath(part) {
2396
+ return `./${part}`;
2397
+ }
2398
+ static formatModuleFileProblem(file, problem) {
2399
+ return `${file} ${problem}.`;
2400
+ }
2401
+ static formatJsonFileUnreadable(file) {
2402
+ return `${file} could not be read as JSON.`;
2403
+ }
2404
+ static formatJsonDocument(document) {
2405
+ return `${JSON.stringify(document, null, Resources.jsonIndent)}\n`;
2406
+ }
2407
+ static formatMemberPath(owner, member) {
2408
+ return `${owner}${Resources.qualifiedNameSeparator}${member}`;
2409
+ }
2410
+ static formatQualifiedPrefix(id) {
2411
+ return `${id}${Resources.qualifiedNameSeparator}`;
2412
+ }
2413
+ static formatIndexedProblem(field, index, problem) {
2414
+ return `${field}[${index}] ${problem}`;
2415
+ }
2416
+ static formatModuleListMissing(field) {
2417
+ return `must list its ${field}`;
2418
+ }
2419
+ static formatNameInFile(name, file) {
2420
+ return `${name} in ${file}`;
2421
+ }
2422
+ static formatModuleIdInvalid(listedId, isListedPackage) {
2423
+ const owner = isListedPackage ? `as ${Resources.modulesListSection} lists it` : "its folder's name";
2424
+ return `must have the id "${listedId}", ${owner}: lowercase kebab-case and none of ${Resources.moduleReservedIds.join(", ")}`;
2425
+ }
2426
+ static formatModuleIdWindowsDevice(id) {
2427
+ return `has the id "${id}", which names a device on Windows, so it is refused on every platform; a module id is none of ${Resources.windowsDeviceNames.join(", ")}`;
2428
+ }
2429
+ static formatModuleUnknownKind(kind) {
2430
+ return `contributes an unknown kind: ${kind}`;
2431
+ }
2432
+ static formatModuleSwitchSettingNotBoolean(value) {
2433
+ return `has the ${Resources.switchSettingField} ${value}, which must be a ${Resources.booleanType} setting`;
2434
+ }
2435
+ static formatModuleSwitchSettingNotShared(value) {
2436
+ return `has the ${Resources.switchSettingField} ${value}, which must have the locality ${Resources.sharedLocality} and no scopes, so one value holds for the whole app`;
2437
+ }
2438
+ static formatModuleNoldovaDesktopInvalid(value) {
2439
+ return `must name the Noldova Desktop versions it accepts as its ${Resources.noldovaDesktopField}, in the one form ${Resources.versionRangeForm}, not ${JSON.stringify(value)}`;
2440
+ }
2441
+ static formatModuleVersionsNotObject(field) {
2442
+ return `must list its ${field} as an object from each module's id to the one exact version of it that it needs, such as 1.2.3`;
2443
+ }
2444
+ static formatModuleDependencyNotModule(relation, dependency) {
2445
+ return `${relation} "${dependency}", which is not another module's id`;
2446
+ }
2447
+ static formatModuleDependencyVersionInvalid(version, dependency) {
2448
+ return `names ${JSON.stringify(version)} for ${dependency}, which is not one exact version such as 1.2.3; a dependency names no range`;
2449
+ }
2450
+ static formatModulePackageNameMismatch(file, packageName, actual) {
2451
+ return `${file} must have the name ${packageName}, as ${Resources.modulesListSection} lists it, not ${String(actual)}.`;
2452
+ }
2453
+ static formatModulePackageVersionMismatch(packageName, actual) {
2454
+ return `must have the version of its package ${packageName}, ${String(actual)}`;
2455
+ }
2456
+ static formatModuleListInvalid(field, expected) {
2457
+ return `must list its ${field} once each as ${expected}`;
2458
+ }
2459
+ static formatModuleNamesInvalid(kind, id) {
2460
+ return `must list its ${kind} as "${id}.<name>", with a camelCase name`;
2461
+ }
2462
+ static formatVersion(major, minor, patch) {
2463
+ return [major, minor, patch].map(t => String(t)).join(Resources.versionSeparator);
2464
+ }
2465
+ static formatVersionRange(minimum, below) {
2466
+ return `>=${minimum} <${below}`;
2467
+ }
2468
+ static formatWindowPartSource(id, dependencies, contributions, windowImport, tail) {
2469
+ return ` new WindowPartSource(${JSON.stringify(id)}, ${JSON.stringify(dependencies)}, `
2470
+ + contributions.map(t => `${JSON.stringify(t)}, `).join(String.empty)
2471
+ + `() => import(${JSON.stringify(windowImport)}).then(t => t.windowPart)`
2472
+ + `${Resources.formatWindowPartTail(tail)})`;
2473
+ }
2474
+ static formatModuleMenusEntry(id, menus) {
2475
+ return ` ${JSON.stringify(id)}: ${JSON.stringify(menus)}`;
2476
+ }
2477
+ static formatCliCommandsMissing(folder, file) {
2478
+ return `${Resources.formatFolderFile(folder, Resources.moduleDeclarationFileName)} declares command-line commands, but ${file} is missing.`;
2479
+ }
2480
+ static formatCliFileNotCommands(file) {
2481
+ return `${file} must be an object whose only field, "${Resources.commandsKind}", lists the module's command-line commands.`;
2482
+ }
2483
+ static formatCliCommandsMismatch(file) {
2484
+ return `${file} must define each command-line command that ${Resources.moduleDeclarationFileName} declares, once, and no other.`;
2485
+ }
2486
+ static formatKebabSegment(letter) {
2487
+ return `${Resources.kebabSeparator}${letter.toLowerCase()}`;
2488
+ }
2489
+ static formatMenusMissing(folder, file) {
2490
+ return `${Resources.formatFolderFile(folder, Resources.moduleDeclarationFileName)} declares menus, but ${file} does not exist.`;
2491
+ }
2492
+ static formatMenusOwner(id) {
2493
+ return `${id}'s ${Resources.menusFileName}`;
2494
+ }
2495
+ static formatMenusToolbarAnchorUnknown(file, place, anchor) {
2496
+ return `${file} puts the toolbar ${place} next to ${anchor}, which is not a toolbar of its own or of a module it depends on.`;
2497
+ }
2498
+ static formatMenusGroupPlaceUnknown(file, group, place) {
2499
+ return `${file} adds the group ${group} to ${place}, which is neither the shell's place nor its own or a dependency's.`;
2500
+ }
2501
+ static formatMenusCommandUnknown(file, command) {
2502
+ return `${file} runs ${command}, which neither it nor a module it depends on declares.`;
2503
+ }
2504
+ static formatMenusToolbarAsMenu(file, opened, group) {
2505
+ return `${file} opens the toolbar ${opened} as a menu in the group ${group}, which a toolbar cannot be.`;
2506
+ }
2507
+ static formatMenusPlaceUndeclared(name) {
2508
+ return `describes the place ${String(name)}, which ${Resources.moduleDeclarationFileName} does not declare in ${Resources.formatMemberPath(Resources.contributesField, Resources.menusKind)}`;
2509
+ }
2510
+ static formatMenusPlaceTitleMissing(name) {
2511
+ return `must give the place ${name} a title`;
2512
+ }
2513
+ static formatMenusPlaceShowsInvalid(name) {
2514
+ return `must give the place ${name} a shows of ${Resources.menuShows.join(", ")}`;
2515
+ }
2516
+ static formatMenusToolbarFieldsMisplaced(name) {
2517
+ return `must give ${Resources.shownField}, ${Resources.afterField}, ${Resources.beforeField} and ${Resources.newRowField} only to a place that shows as a toolbar, not ${name}`;
2518
+ }
2519
+ static formatMenusToolbarShownInvalid(name) {
2520
+ return `must give the toolbar ${name} a ${Resources.shownField} of true or false`;
2521
+ }
2522
+ static formatMenusToolbarNewRowInvalid(name) {
2523
+ return `must give the toolbar ${name} a ${Resources.newRowField} of true or false`;
2524
+ }
2525
+ static formatMenusToolbarAnchorsRepeated(name) {
2526
+ return `must give the toolbar ${name} at most one of ${Resources.afterField}, ${Resources.beforeField} and ${Resources.newRowField}`;
2527
+ }
2528
+ static formatMenusToolbarAnchorInvalid(name, field) {
2529
+ return `must give the toolbar ${name} an ${field} naming another toolbar as "${Resources.qualifiedNameForm}"`;
2530
+ }
2531
+ static formatMenusGroupNameInvalid(id) {
2532
+ return `must name each group "${id}.<name>", with a camelCase name`;
2533
+ }
2534
+ static formatMenusGroupPlaceInvalid(name) {
2535
+ return `must put the group ${name} in a place named "${Resources.qualifiedNameForm}"`;
2536
+ }
2537
+ static formatMenusGroupExclusiveInvalid(name) {
2538
+ return `must give the group ${name} an ${Resources.exclusiveField} of true or false`;
2539
+ }
2540
+ static formatMenusGroupDynamicInvalid(name) {
2541
+ return `must give the group ${name} a ${Resources.dynamicField} of true or false`;
2542
+ }
2543
+ static formatMenusDynamicGroupItems(name) {
2544
+ return `must not give the dynamic group ${name} items, since its window part supplies them`;
2545
+ }
2546
+ static formatMenusGroupItemsLabel(name) {
2547
+ return `items of the group ${name}`;
2548
+ }
2549
+ static formatMenusGroupEmpty(name) {
2550
+ return `must give the group ${name} at least one item`;
2551
+ }
2552
+ static formatMenusItemInvalid(group) {
2553
+ return `must make each item of the group ${group} either a command with optional arguments and label, a submenu, or a choice`;
2554
+ }
2555
+ static formatMenusChoiceUnknown(choice, group) {
2556
+ return `opens ${String(choice)} as a choice in the group ${group}, which is not one of its own places`;
2557
+ }
2558
+ static formatMenusSubmenuUnknown(submenu, group) {
2559
+ return `opens ${String(submenu)} as a submenu in the group ${group}, which is not one of its own places`;
2560
+ }
2561
+ static formatMenusItemCommandInvalid(group) {
2562
+ return `must name a command "${Resources.qualifiedNameForm}" for each item of the group ${group}`;
2563
+ }
2564
+ static formatMenusItemArgumentsInvalid(command, group) {
2565
+ return `must give the arguments of ${command} in the group ${group} as a JSON object`;
2566
+ }
2567
+ static formatMenusItemLabelInvalid(command, group) {
2568
+ return `must give the label of ${command} in the group ${group} as text that is not blank`;
2569
+ }
2570
+ static formatSettingsMissing(folder, file) {
2571
+ return `${Resources.formatFolderFile(folder, Resources.moduleDeclarationFileName)} declares settings or settings pages, but ${file} is missing.`;
2572
+ }
2573
+ static formatSettingsFileInvalid(file) {
2574
+ return `${file} must be an object whose field "${Resources.settingsKind}" lists the module's settings, and whose only other field, "${Resources.pagesField}", lists its own pages.`;
2575
+ }
2576
+ static formatSettingsMismatch(file) {
2577
+ return `${file} must define each setting that ${Resources.moduleDeclarationFileName} declares, once, and no other.`;
2578
+ }
2579
+ static formatSettingsPageInvalid(file, index) {
2580
+ return Resources.formatModuleFileProblem(file, Resources.formatIndexedProblem(Resources.pagesField, index, `must have exactly the fields ${Resources.settingsPageFields.join(", ")}, with a title that is not blank`));
2581
+ }
2582
+ static formatSettingsPagesMismatch(file) {
2583
+ return `${file} must define each settings page that ${Resources.moduleDeclarationFileName} declares, once, and no other.`;
2584
+ }
2585
+ static formatWebViewKeyRepeated(platform) {
2586
+ return `gives a key more than once on ${platform}`;
2587
+ }
2588
+ static formatWebViewKeyInvalid(index) {
2589
+ return `must describe ${Resources.keysField}[${index}] with a name, its keys and optionally its macOS keys`;
2590
+ }
2591
+ static formatWebViewKeyNameInvalid(index) {
2592
+ return `must name ${Resources.keysField}[${index}] with a lowercase letter followed by letters and digits`;
2593
+ }
2594
+ static formatWebViewChordsInvalid(where) {
2595
+ return `must give ${where} one to ${Resources.webViewChordsLimit} keys`;
2596
+ }
2597
+ static formatWebViewKeyUnknown(where, text) {
2598
+ return `gives ${where} ${text}, which is not a key in Noldova Desktop's format, such as Mod+R or F5`;
2599
+ }
2600
+ static formatWebViewKeyRefused(where, text, platform) {
2601
+ return `gives ${where} ${text}, which cannot be declared on ${platform}: it needs Mod, Ctrl or Alt, or a function key, and it must not be a key that editing, the operating system or Noldova Desktop holds`;
2602
+ }
2603
+ static formatWebViewMethodInvalid(index) {
2604
+ return `must describe ${Resources.methodsKind}[${index}] with a name and optionally parameters`;
2605
+ }
2606
+ static formatWebViewMethodNameInvalid(index) {
2607
+ return `must name ${Resources.methodsKind}[${index}] as a debugging protocol domain, a dot and a name, such as Page.captureScreenshot`;
2608
+ }
2609
+ static formatWebViewMethodRefused(name) {
2610
+ return `declares ${name}, which is refused in a web view: it loads or replaces a document, which only a navigation the origin check sees may do, or it undoes what the host holds for the view`;
2611
+ }
2612
+ static formatWebViewParametersNotObject(where) {
2613
+ return `must give the parameters of ${where} as an object from each name to its rule`;
2614
+ }
2615
+ static formatWebViewParameterInvalid(where, name) {
2616
+ return `names the parameter ${Resources.formatMemberPath(where, name)}, which is not a lowercase letter followed by letters and digits`;
2617
+ }
2618
+ static formatWebViewRuleInvalid(where) {
2619
+ return `must give ${where} a rule of only ${Resources.webViewRuleFields.join(", ")}`;
2620
+ }
2621
+ static formatWebViewRuleKindsRepeated(where) {
2622
+ return `must give ${where} at most one of values, a minimum and maximum, a maxLength and fields`;
2623
+ }
2624
+ static formatWebViewRuleRequiredInvalid(where) {
2625
+ return `must give ${where} a required of true or false`;
2626
+ }
2627
+ static formatWebViewRuleValuesInvalid(where) {
2628
+ return `must give ${where} values that are distinct texts, numbers or booleans, at least one`;
2629
+ }
2630
+ static formatWebViewRuleRangeInvalid(where) {
2631
+ return `must give ${where} a minimum and maximum that are numbers, the minimum no greater than the maximum`;
2632
+ }
2633
+ static formatWebViewRuleMaxLengthInvalid(where) {
2634
+ return `must give ${where} a maxLength that is a positive whole number`;
2635
+ }
2636
+ static formatWebViewListNotArray(field) {
2637
+ return `must list its ${field} as an array`;
2638
+ }
2639
+ static formatCatalogDependencyVersion(id, dependency, needed, version) {
2640
+ return `${id} ${Resources.moduleDependsOn} ${dependency} ${needed}, but the build includes ${dependency} ${version}.`;
2641
+ }
2642
+ static formatCatalogOptionalDependencyVersion(id, dependency, needed, version) {
2643
+ return `${id} ${Resources.moduleOptionallyDependsOn} ${dependency} ${needed}, but the build includes ${dependency} ${version}.`;
2644
+ }
2645
+ static formatCatalogDeclarationMissing(id, folder, isPackage) {
2646
+ return `The build lists the module ${id}, but ${folder} has no ${Resources.moduleDeclarationFileName}${isPackage ? " at its package's root" : String.empty}.`;
2647
+ }
2648
+ static formatCatalogFixtureVersionMissing(file) {
2649
+ return `${file} must have a version, which its package takes.`;
2650
+ }
2651
+ static formatCatalogPermissionsModuleInvalid(name) {
2652
+ return `The root ${Resources.packageManifestFileName}'s ${Resources.desktopField}.${Resources.productField}.${Resources.permissionsModuleField} must be the id of a module in ${Resources.modulesListSection}, not ${JSON.stringify(name)}.`;
2653
+ }
2654
+ static formatContributionPlace(file, kind) {
2655
+ return `${file} (${kind})`;
2656
+ }
2657
+ static formatCatalogPinMissing(id, packageName) {
2658
+ return `The build lists the module ${id} from ${packageName}, which the root ${Resources.packageManifestFileName}'s ${Resources.dependenciesField} must pin to an exact version.`;
2659
+ }
2660
+ static formatCatalogInstalledMismatch(id, packageName, pin, installed) {
2661
+ return `The build lists the module ${id} from ${packageName} ${pin}, but ${Resources.nodeModulesFolder} holds ${installed ?? "no version of it"}; run npm install.`;
2662
+ }
2663
+ static formatCatalogPackageSubject(id, packageName) {
2664
+ return `${id}'s package ${String(packageName)}`;
2665
+ }
2666
+ static formatCatalogWindowPeer(id, packageName, peer) {
2667
+ return `${Resources.formatCatalogPackageSubject(id, packageName)} names ${peer} as a peer, which a module's package never does: the registry serves no ${Resources.peerDependenciesMetaField}, so npm takes even an optional peer as required and installs ${peer} at the app's root, where its exact Angular peers clash with a newer Angular; the module's window part package names it instead.`;
2668
+ }
2669
+ static formatCatalogDependencyListed(holder, name, installedName) {
2670
+ return `${holder} lists ${name} among its dependencies${installedName === name ? String.empty : `, which installs ${installedName}`}`;
2671
+ }
2672
+ static formatCatalogAngularDependency(id, packageName, holder, name, windowPackage) {
2673
+ return `${Resources.formatCatalogPackageSubject(id, packageName)} reaches the Angular package ${name} outside its window part: ${holder} lists it among its dependencies; only the module's own window part's package, named ${windowPackage}, and what it depends on may bring Angular, for a module with a window part.`;
2674
+ }
2675
+ static formatCatalogOwnCopy(name, folder) {
2676
+ return `it holds its own copy of ${name} at ${folder}`;
2677
+ }
2678
+ static formatCatalogWindowSubject(id, name) {
2679
+ return `${id}'s window part package ${name}`;
2680
+ }
2681
+ static formatCatalogWindowPinInvalid(subject, packageName) {
2682
+ return `${subject} must be pinned to one exact version among ${String(packageName)}'s dependencies, and installed at it; run npm install.`;
2683
+ }
2684
+ static formatCatalogWindowNotAngular(subject) {
2685
+ return `${subject} must be an Angular package, with ${Resources.angularCorePackage} among its peer dependencies.`;
2686
+ }
2687
+ static formatCatalogWindowPeerNotOptional(subject, peer) {
2688
+ return `${subject} must mark its peer ${peer} optional in ${Resources.peerDependenciesMetaField}, so that installing the module's package adds no second Angular, window package or kit; the app's install meets it.`;
2689
+ }
2690
+ static formatCatalogAngularPeerRange(subject, peer, needed, minimum) {
2691
+ return `${subject} needs ${peer} ${String(needed)}, a range that doesn't end at the next major after ${minimum}; an Angular peer takes ${Resources.angularPeerRangeForm}, since only a new Angular major may break a module.`;
2692
+ }
2693
+ static formatCatalogOrganizationPeerRange(subject, peer, needed, minimum) {
2694
+ return `${subject} needs ${peer} ${String(needed)}, a range that doesn't end at the first version refused after ${minimum}, the next minor below 1.0.0 and the next major from it; a peer on another of the organization's packages takes ${Resources.versionRangeForm}.`;
2695
+ }
2696
+ static formatCatalogCoreRangeUnnamed(subject, peer, needed, file) {
2697
+ return `${subject} needs ${peer} ${String(needed)}, a range, but ${file} names no ${Resources.noldovaDesktopField}; a module that accepts a range of Noldova Desktop versions names it there, and each of Noldova Desktop's packages it peers on takes that same range.`;
2698
+ }
2699
+ static formatCatalogCoreRangeMismatch(subject, peer, needed, file, range) {
2700
+ return `${subject} needs ${peer} ${String(needed)}, but ${file} accepts Noldova Desktop ${range}; each of Noldova Desktop's packages it peers on takes that same range.`;
2701
+ }
2702
+ static formatCatalogPeerMismatch(subject, peer, needed, holder, version) {
2703
+ return `${subject} needs ${peer} ${String(needed)}, but ${holder} ${version ?? "none"}; a peer names one exact version, such as 1.2.3, or, for the organization's packages, a range of the form ${Resources.versionRangeForm}, and, for Angular's packages in a window part, ${Resources.angularPeerRangeForm}.`;
2704
+ }
2705
+ static formatCatalogOutsideRange(id, version, range) {
2706
+ return `${id} ${version} accepts Noldova Desktop ${range}`;
2707
+ }
2708
+ static formatCatalogSecondCopy(id, packageName, cause) {
2709
+ return `${Resources.formatCatalogPackageSubject(id, packageName)} brings a second copy of a package the app holds once: ${cause}; a module's package takes Noldova Desktop's, context's and the kit's packages only as peer dependencies.`;
2710
+ }
2711
+ static formatAngularInstallFailed(exitCode, errorOutput) {
2712
+ return `"npm ci" in the app failed with exit code ${exitCode}: ${errorOutput.trim()}`;
2713
+ }
2714
+ static formatExitCodeProblem(exitCode, errorOutput) {
2715
+ return `exit code ${exitCode}: ${errorOutput.trim()}`;
2716
+ }
2717
+ static formatWindowBuildFailed(exitCode) {
2718
+ return `Building the window failed with exit code ${exitCode}.`;
2719
+ }
2720
+ static formatWindowContainsText(shown, found, file) {
2721
+ return `The window built in ${shown} contains ${JSON.stringify(found)} in ${file}.`;
2722
+ }
2723
+ static formatWindowHasNoFiles(shown) {
2724
+ return `The window built in ${shown} has no files to check.`;
2725
+ }
2726
+ static formatJsonUnreadable(file, error) {
2727
+ return `${file} could not be read as JSON: ${String(error)}.`;
2728
+ }
2729
+ static formatPackageLockKey(name) {
2730
+ return `${Resources.nodeModulesFolder}/${name}`;
2731
+ }
2732
+ static formatScopedPackageName(scope, name) {
2733
+ return `${scope}/${name}`;
2734
+ }
2735
+ static formatAngularInstallRecord(platform, arch, hash) {
2736
+ return `${platform} ${arch} ${hash}\n`;
2737
+ }
2738
+ static formatGalleryFileContent(imports, isPackaged) {
2739
+ return `${Resources.licenseHeaderBlock}\n${imports}\nexport const gallery: Type<unknown> | null = ${isPackaged ? "null" : "GalleryComponent"};\n`;
2740
+ }
2741
+ static formatProductNameLine(name) {
2742
+ return `export const productName: string = ${JSON.stringify(name)};`;
2743
+ }
2744
+ static formatProductAboutLine(about) {
2745
+ return `export const productAbout: IProductAbout = ${JSON.stringify(about)};`;
2746
+ }
2747
+ static formatInstalledCopiesRefusal(name, listing) {
2748
+ return `"npm ls ${name}" gave no list of copies to check:\n${listing.trim()}`;
2749
+ }
2750
+ static formatDevelopmentPreparing(productName) {
2751
+ return `Preparing the ${productName} development binary...\n`;
2752
+ }
2753
+ static formatDevelopmentCopyright(publisher) {
2754
+ return `Copyright (c) ${publisher}.`;
2755
+ }
2756
+ static formatMacHelperIdentifier(helperIdentifier, role) {
2757
+ return `${helperIdentifier}.${role}`;
2758
+ }
2759
+ static formatUserNamespaceRefusal(file, value) {
2760
+ return `${file} is ${value}`;
2761
+ }
2762
+ static formatShellQuoted(text) {
2763
+ return `'${text.replaceAll("'", "'\\''")}'`;
2764
+ }
2765
+ static formatSandboxProblem(helper) {
2766
+ const quoted = Resources.formatShellQuoted(helper);
2767
+ return [
2768
+ "This system restricts unprivileged user namespaces, so Chromium's sandbox needs its helper owned by root with the setuid bit. Set it up once:",
2769
+ ` sudo chown root:root ${quoted} && sudo chmod 4755 ${quoted}`,
2770
+ "Then run npm start again. Preparing the development app again, after a change to Electron, the version or the icons, needs the step again.",
2771
+ String.empty
2772
+ ].join(Resources.lineSeparator);
2773
+ }
2774
+ static formatOutputLine(text) {
2775
+ return `${text}\n`;
2776
+ }
2777
+ static formatPackagesBuilt(count) {
2778
+ return `Packages built and installed: ${count}.\n`;
2779
+ }
2780
+ static formatModulesInBuild(count) {
2781
+ return `Modules in the build: ${count}.\n`;
2782
+ }
2783
+ static formatNoldovaDesktopRangeUsage(command) {
2784
+ return `Usage: ${command} ${Resources.noldovaDesktopRangeCommand} <lowest Noldova Desktop version>\n`;
2785
+ }
2786
+ static formatNotOneExactVersion(version) {
2787
+ return `${Resources.githubErrorPrefix}${JSON.stringify(version)} is not one exact version, such as 0.0.71.\n`;
2788
+ }
2789
+ static formatGithubError(message) {
2790
+ return `${Resources.githubErrorPrefix}${message}\n`;
2791
+ }
2792
+ static formatChooseFeedUsage(command) {
2793
+ return `Usage: ${Resources.internalFeedVariable}=<empty, build or copy> ${Resources.internalFeedUrlVariable}=<URL> ${Resources.updateFeedVariable}=<URL> ${Resources.packageVersionVariable}=<version> `
2794
+ + `${Resources.releaseVersionVariable}=<N.N.N> ${Resources.runNumberVariable}=<number> ${Resources.runAttemptVariable}=<number> ${Resources.signingVariable}=<signed platforms> ${command} ${Resources.chooseFeedCommand}\n`;
2795
+ }
2796
+ static formatInternalFeedKindInvalid(kind) {
2797
+ return `internal-feed must be empty, build or copy, not ${kind}.`;
2798
+ }
2799
+ static formatInternalVersion(releaseVersion, runNumber) {
2800
+ return `${releaseVersion}-internal.${runNumber}`;
2801
+ }
2802
+ static formatInternalFeedRerun(version) {
2803
+ return `A build for the internal update feed runs once, since a re-run would build other packages as the same ${version}; start a new run.`;
2804
+ }
2805
+ static formatInternalFeedChosen(version) {
2806
+ return `The packages check the internal update feed as version ${version}.\n`;
2807
+ }
2808
+ static formatFeedOutputs(feed, version) {
2809
+ return `update-feed=${feed}\npackage-version=${version}\n`;
2810
+ }
2811
+ static formatListTargetsUsage(command) {
2812
+ return `Usage: ${command} ${Resources.listTargetsCommand} [<app folder>]\n`;
2813
+ }
2814
+ static formatRunnerVariable(runnerName) {
2815
+ return `${Resources.runnerVariablePrefix}${runnerName}`;
2816
+ }
2817
+ static formatRunnerMissing(variable, targetName, runner) {
2818
+ return `The variable ${variable} names no runner for ${targetName}, as JSON such as "ubuntu-24.04" or ["a-label","linux"]: ${JSON.stringify(runner)}.\n`;
2819
+ }
2820
+ static formatModuleRangeUsage(command) {
2821
+ return `Usage: ${Resources.publishedVersionsVariable}=<the versions npm view lists, as JSON> ${command} ${Resources.moduleRangeCommand} <module folder>\n`;
2822
+ }
2823
+ static formatDeclarationNotObject(file) {
2824
+ return `${file} could not be read as a JSON object.`;
2825
+ }
2826
+ static formatModuleRangeMissing(file) {
2827
+ return `${file} names no ${Resources.noldovaDesktopField} range, so there is no range to check; a module names one as MODULES.md's "Noldova Desktop versions" says.`;
2828
+ }
2829
+ static formatModuleRangeForm(file, declared) {
2830
+ return `${file}'s ${Resources.noldovaDesktopField} is ${JSON.stringify(declared)}, not of the one form ${Resources.versionRangeForm}.`;
2831
+ }
2832
+ static formatModuleRangeNotFollowing(file, range, minimum, following) {
2833
+ return `${file}'s ${Resources.noldovaDesktopField} is ${range}, but a range from ${minimum} ends below the next version that may break modules: ${following}.`;
2834
+ }
2835
+ static formatModuleRangeNoneInside(file, range) {
2836
+ return `No published Noldova Desktop version is inside ${file}'s ${Resources.noldovaDesktopField} range ${range}.`;
2837
+ }
2838
+ static formatModuleRangeHolds(range, count, newest) {
2839
+ return `The range ${range} holds ${count.toString()} published Noldova Desktop versions; the newest is ${newest}.\n`;
2840
+ }
2841
+ static formatModuleRangeOutputs(range, newest) {
2842
+ return `range=${range}\nversion=${newest}\n`;
2843
+ }
2844
+ static formatFeedCheckUsage(command) {
2845
+ return `Usage: [${Resources.feedSkipVariable}=<true or false>] ${Resources.feedVersionVariable}=<version> ${Resources.releaseTargetsVariable}=<target ids> `
2846
+ + `{${Resources.releaseRepositoryVariable}=<owner/name> | ${Resources.feedUrlVariable}=<URL>} [${Resources.feedWaitVariable}=<seconds>] ${command} ${Resources.feedCheckCommand}\n`;
2847
+ }
2848
+ static formatFeedSkipInvalid(value) {
2849
+ return `${Resources.feedSkipVariable} must be true or false, not "${value}".`;
2850
+ }
2851
+ static formatFeedVersionInvalid(version) {
2852
+ return `${Resources.feedVersionVariable} must be the version the feed serves, such as 0.0.2 or 0.0.2-internal.10, not "${version}".`;
2853
+ }
2854
+ static formatFeedHttpProblem(name, feed, status) {
2855
+ return `${name} could not be read from ${feed}: HTTP ${status}.`;
2856
+ }
2857
+ static formatFeedReadFailed(name, feed, error) {
2858
+ return `${name} could not be read from ${feed}: ${String(error)}`;
2859
+ }
2860
+ static formatFeedVersionMismatch(name, feed, found, version) {
2861
+ return `${name} in ${feed} names the version "${found}", not ${version}.`;
2862
+ }
2863
+ static formatFeedCatchingUp(problem) {
2864
+ return `${problem} The feed may still be catching up, so the check tries again.\n`;
2865
+ }
2866
+ static formatFeedListsNoFiles(metadata, feed) {
2867
+ return `${metadata} in ${feed} lists no files.`;
2868
+ }
2869
+ static formatFeedFileIncomplete(metadata, feed) {
2870
+ return `${metadata} in ${feed} lists a file without its url, sha512 and size, one to a line in that order.`;
2871
+ }
2872
+ static formatFeedHashMismatch(name, feed, sha512, metadata, expected) {
2873
+ return `${name} in ${feed} has the SHA-512 ${sha512}, but ${metadata} gives ${expected}.`;
2874
+ }
2875
+ static formatFeedSizeMismatch(name, feed, size, metadata, expected) {
2876
+ return `${name} in ${feed} has ${size} bytes, but ${metadata} gives ${expected}.`;
2877
+ }
2878
+ static formatFeedWebPage(name, feed, origin, pathname) {
2879
+ return `${name} could not be read from ${feed}: it led to a web page, such as a sign-in page, at ${origin}${pathname}, so the feed is not anonymous.`;
2880
+ }
2881
+ static formatFeedRedirectedAway(name, feed, origin) {
2882
+ return `${name} could not be read from ${feed}: it redirected to ${origin}, which is neither the feed's origin nor GitHub's release asset host.`;
2883
+ }
2884
+ static formatFeedTooManyRedirects(name, feed) {
2885
+ return `${name} could not be read from ${feed}: it redirected more than ${Resources.feedMaximumRedirects} times.`;
2886
+ }
2887
+ static formatFeedUrlInvalid(feed) {
2888
+ return `${Resources.feedUrlVariable} must be an HTTPS folder URL ending in /, or a loopback http one, not "${feed}".`;
2889
+ }
2890
+ static formatFeedRepositoryInvalid(repository) {
2891
+ return `Without ${Resources.feedUrlVariable}, ${Resources.releaseRepositoryVariable} must name the repository whose latest release is the feed, as owner/name, not "${repository}".`;
2892
+ }
2893
+ static formatFeedWaitInvalid(text) {
2894
+ return `${Resources.feedWaitVariable} must be the seconds to wait for a feed that is behind, from 0 to ${Resources.feedMaximumWaitSeconds}, not "${text}".`;
2895
+ }
2896
+ static formatPackagedProductUnreadable(file, error) {
2897
+ return `The packaged product file ${file} could not be read as JSON, so its update feed is unknown: ${String(error)}`;
2898
+ }
2899
+ static formatPackagedFeedMismatch(feed, expected) {
2900
+ return `The packaged product file names the update feed ${JSON.stringify(feed ?? null)}, not ${expected}, so its packages cannot be released.`;
2901
+ }
2902
+ static formatReleaseCheckUsage(command) {
2903
+ return `Usage: ${Resources.releaseRepositoryVariable}=<owner/name> ${Resources.releaseVersionVariable}=<N.N.N> ${Resources.releaseRevisionVariable}=<commit> ${command} ${Resources.releaseCheckCommand}\n`;
2904
+ }
2905
+ static formatRootVersionMismatch(rootVersion, version) {
2906
+ return `The root manifest's version is ${rootVersion}, not ${version}; raise it on ${Resources.mainBranch} first.`;
2907
+ }
2908
+ static formatReleaseLabel(index) {
2909
+ return `releases[${index}]`;
2910
+ }
2911
+ static formatReleaseTagLabel(id) {
2912
+ return `The tag of release ${id}`;
2913
+ }
2914
+ static formatReleaseNotNewer(version, highest) {
2915
+ return `${version} is not newer than the highest release, ${highest}.`;
2916
+ }
2917
+ static formatCompareRoute(revision) {
2918
+ return `/compare/${revision}...${Resources.mainBranch}`;
2919
+ }
2920
+ static formatRevisionNotCommit(revision, repository) {
2921
+ return `${revision} is not a commit of ${repository}.`;
2922
+ }
2923
+ static formatRevisionNotOnMain(revision, status) {
2924
+ return `${revision} is not on ${Resources.mainBranch}; ${Resources.mainBranch} is ${status} compared with it.`;
2925
+ }
2926
+ static formatBuildRunsRoute(revision) {
2927
+ return `${Resources.buildRunsRoute}${revision}`;
2928
+ }
2929
+ static formatNoBuildRun(revision) {
2930
+ return `No Build and test run on ${Resources.mainBranch} has checked ${revision}; release a revision whose run on ${Resources.mainBranch} passed.`;
2931
+ }
2932
+ static formatBuildRunFailed(revision, conclusion) {
2933
+ return `The Build and test run on ${Resources.mainBranch} for ${revision} is ${conclusion}, not ${Resources.successConclusion}; `
2934
+ + `release a revision whose run on ${Resources.mainBranch} passed.`;
2935
+ }
2936
+ static formatReleasePublishUsage(command) {
2937
+ return `Usage: ${Resources.releaseRepositoryVariable}=<owner/name> ${Resources.releaseVersionVariable}=<N.N.N> ${Resources.releaseRevisionVariable}=<commit> ${Resources.releaseFolderVariable}=<folder> `
2938
+ + `${Resources.releaseReportsVariable}=<folder> ${Resources.releaseRunVariable}=<url> [${Resources.releaseUpdateFeedVariable}=<loopback URL> | ${Resources.releaseInternalVariable}=<N.N.N-internal.N>] ${command} ${Resources.releasePublishCommand}\n`;
2939
+ }
2940
+ static formatTestFeedPublishesNothing(feed) {
2941
+ return `This run tests updating with the feed ${feed}, so it publishes nothing.\n`;
2942
+ }
2943
+ static formatReleaseFolderNotAbsolute(folder) {
2944
+ return `${Resources.releaseFolderVariable} must be the absolute path of the folder that holds the release's files, not "${folder}".`;
2945
+ }
2946
+ static formatReleaseFolderHasLabelMark(folder) {
2947
+ return `${Resources.releaseFolderVariable} must not contain ${Resources.uploadLabelMark}, which gh release upload reads as the start of a file's label: "${folder}".`;
2948
+ }
2949
+ static formatReleaseReportsNotAbsolute(reports) {
2950
+ return `${Resources.releaseReportsVariable} must be the absolute path of the folder that holds the targets' package reports, not "${reports}".`;
2951
+ }
2952
+ static formatInternalFilesChecked(internal) {
2953
+ return `The release files of ${internal} are checked for the internal update feed, so this run publishes nothing here.\n`;
2954
+ }
2955
+ static formatInternalVersionInvalid(version, internal) {
2956
+ return `${Resources.releaseInternalVariable} must be ${version}-internal.<run number>, an internal build before the release, not "${internal}".`;
2957
+ }
2958
+ static formatInternalUnsigned(repository) {
2959
+ return `${repository} is not the app's release repository, so its packages are unsigned and cannot go to the internal update feed.`;
2960
+ }
2961
+ static formatSignedTargetUnsupported(targetId) {
2962
+ return `${Resources.packageSignedOption} signs Windows and macOS packages only, so it cannot sign the ${targetId} package.`;
2963
+ }
2964
+ static formatBuilderFailed(exitCode) {
2965
+ return `electron-builder failed with exit code ${exitCode}.`;
2966
+ }
2967
+ static formatSignatures(verification) {
2968
+ return `Signatures:\n${verification}\n`;
2969
+ }
2970
+ static formatOptionValue(option, value) {
2971
+ return `${option}=${value}`;
2972
+ }
2973
+ static formatFolderPrefix(folder) {
2974
+ return `${folder}/`;
2975
+ }
2976
+ static formatSmokeInstalled(seconds, mainProcess) {
2977
+ return `Installed in ${seconds.toFixed(1)} s: ${mainProcess}\n`;
2978
+ }
2979
+ static formatSmokeNoRuntimeBeforeStart(slug) {
2980
+ return `${slug} status ${Resources.smokeMomentBeforeStart}: no runtime.\n`;
2981
+ }
2982
+ static formatSmokeDiscoveryNamesNoProcess(file) {
2983
+ return `The runtime's discovery file ${file} names no process.`;
2984
+ }
2985
+ static formatSmokeMainDidNotExit(slug, tail) {
2986
+ return `The main process did not exit within ${Resources.smokeQuitLimit} ms after ${slug} quit said it quit:\n${tail}`;
2987
+ }
2988
+ static formatSmokeMainQuitBadly(ending, tail) {
2989
+ return `The main process quit but ${ending}:\n${tail}`;
2990
+ }
2991
+ static formatSmokeRuntimeOutlived(runtime, tail) {
2992
+ return `The runtime, process ${runtime}, did not stop within ${Resources.smokeStopLimit} ms after the main process quit, although nothing used it:\n${tail}`;
2993
+ }
2994
+ static formatSmokePathChanged(after, before) {
2995
+ return `After the uninstall the user's Path is ${JSON.stringify(after)} instead of ${JSON.stringify(before)}, as it was before the install.`;
2996
+ }
2997
+ static formatSmokeCookiesUnencrypted(binary) {
2998
+ return `The installed ${binary} keeps cookies unencrypted, although the app's modules declare web views, whose profiles keep their cookies encrypted.`;
2999
+ }
3000
+ static formatSmokeCookiesEncrypted(binary) {
3001
+ return `The installed ${binary} encrypts cookies, although no module of the app declares web views, the only reason to turn it on.`;
3002
+ }
3003
+ static formatSmokeCookieEncryption(isEncrypted) {
3004
+ return `Cookie encryption: ${isEncrypted ? Resources.smokeCookiesOn : Resources.smokeCookiesOff}.\n`;
3005
+ }
3006
+ static formatSmokePathCount(entry, count, value) {
3007
+ return `The user's Path holds ${entry} ${count} times instead of once: ${JSON.stringify(value)}`;
3008
+ }
3009
+ static formatSmokePathHolds(intro, entry) {
3010
+ return `${intro} ${entry} once.\n`;
3011
+ }
3012
+ static formatPowerShellStatusLine(commandName, deviceFolder, data) {
3013
+ return ["&", commandName, ...Resources.smokeStatusArguments, Resources.deviceDirectoryOption, `'${deviceFolder}'`,
3014
+ Resources.dataDirectoryOption, `'${data}';`, "exit", "$LASTEXITCODE"].join(" ");
3015
+ }
3016
+ static formatSmokePowerShellFailed(slug, exitCode, text) {
3017
+ return `${slug} status ${Resources.smokeMomentPowerShell} exited with ${exitCode}:\n${text}`;
3018
+ }
3019
+ static formatSmokeLinkFailed(slug, command, exitCode, text) {
3020
+ return `${slug} status through a link to ${command} exited with ${exitCode}:\n${text}`;
3021
+ }
3022
+ static formatSmokeProbeFails(refusal) {
3023
+ return `\`${Resources.userNamespacesProbeLine}\` fails here${Object.isNull(refusal) ? Resources.smokeNoProcRefusal : `, as ${refusal}`}, so the AppImage's launcher starts it without Chromium's sandbox.\n`;
3024
+ }
3025
+ static formatSmokeProbeRuns(refusal) {
3026
+ return `\`${Resources.userNamespacesProbeLine}\` runs here though ${refusal}, so the AppImage's launcher starts it with Chromium's sandbox.\n`;
3027
+ }
3028
+ static formatSmokeExtractionRecords(logs, count) {
3029
+ return `While the main process ran, ${logs} held ${count} copy records of the runtime's AppImage instead of one naming an extraction that is still there.`;
3030
+ }
3031
+ static formatSmokeExtraction(extraction, bytes) {
3032
+ return `The runtime holds its own extraction of the AppImage in ${extraction}, ${(bytes / Resources.bytesPerMebibyte).toFixed(1)} MiB.\n`;
3033
+ }
3034
+ static formatSmokeNoMount(runtime, program, input) {
3035
+ return `The runtime, process ${runtime}, holds no mount of the AppImage through a pipe: it runs ${program} with the input ${input}.`;
3036
+ }
3037
+ static formatSmokeMounted(mount) {
3038
+ return `The runtime runs from its own mount of the AppImage at ${mount} and holds it through its input pipe.\n`;
3039
+ }
3040
+ static formatSmokeProgramUnreadable(program) {
3041
+ return `After the AppImage was replaced, the runtime's program ${program} could no longer be read.`;
3042
+ }
3043
+ static formatSmokeStatusAfterReplace(slug, exitCode, text) {
3044
+ return `After the AppImage was replaced, ${slug} status exited with ${exitCode}:\n${text}`;
3045
+ }
3046
+ static formatSmokeCopyEnded(moment) {
3047
+ return `The runtime's copy of the AppImage ended once the runtime ${moment}.\n`;
3048
+ }
3049
+ static formatSmokeRuntimeStillRunning(runtime) {
3050
+ return `The runtime, process ${runtime}, was still running ${Resources.smokeKillLimit} ms after it was killed.`;
3051
+ }
3052
+ static formatSmokeFolderNotRemoved(folder, error) {
3053
+ return `The smoke's folder ${folder} could not be removed: ${String(error)}`;
3054
+ }
3055
+ static formatSmokeDebianNotRemoved(packageName, error) {
3056
+ return `The smoke's Debian package ${packageName} could not be removed: ${String(error)}`;
3057
+ }
3058
+ static formatSmokeRuntimeNotEnded(runtime) {
3059
+ return `The runtime, process ${runtime}, could not be ended: it was still running ${Resources.smokeKillLimit} ms after it was killed.`;
3060
+ }
3061
+ static formatSmokeDiscoveryUnreadable(folder, error) {
3062
+ return `The runtime's discovery file in ${folder} could not be read: ${String(error)}`;
3063
+ }
3064
+ static formatSmokeRuntimeEndFailed(runtime, error) {
3065
+ return `The runtime, process ${runtime}, could not be ended: ${String(error)}`;
3066
+ }
3067
+ static formatSmokeLogTail(log, tail) {
3068
+ return `${log}:\n${tail.trim()}`;
3069
+ }
3070
+ static formatSmokeNoFuseWire(binary, fuse) {
3071
+ return `${binary} holds no version ${Resources.electronFuseWireVersion} fuse wire with fuse ${fuse} set on or off.`;
3072
+ }
3073
+ static formatSmokeStatusNotNoRuntime(slug, moment, exitCode, text) {
3074
+ return `${slug} status ${moment} exited with ${exitCode} instead of ${Resources.smokeNoRuntimeExitCode}:\n${text}`;
3075
+ }
3076
+ static formatSmokeMainEndedBeforeRuntime(ending, tail) {
3077
+ return `The main process ${ending} before its runtime answered:\n${tail}`;
3078
+ }
3079
+ static formatSmokeRuntimeNoAnswer(slug, exitCode, text, tail) {
3080
+ return `The main process's runtime did not answer ${slug} status within ${Resources.smokeStartLimit} ms; the last answer was exit code ${exitCode}:\n${text}\n${tail}`;
3081
+ }
3082
+ static formatSmokeMainEndedBeforeLauncher(ending, tail) {
3083
+ return `The main process ${ending} before its launcher connected to the runtime:\n${tail}`;
3084
+ }
3085
+ static formatSmokeLogsUnwatchable(logs) {
3086
+ return `The launcher's logs folder ${logs} can't be watched for its start log.`;
3087
+ }
3088
+ static formatSmokeLauncherKeptStartLog(logs, tail) {
3089
+ return `The main process's launcher still kept its start log in ${logs} ${Resources.smokeStartLimit} ms after the runtime answered, so it never connected:\n${tail}`;
3090
+ }
3091
+ static formatSmokeStatusIncomplete(slug, answer) {
3092
+ return `${slug} status --json answered without a build version and a data directory:\n${answer.trim()}`;
3093
+ }
3094
+ static formatSmokeStatusMismatch(slug, reportedVersion, directory, version, data) {
3095
+ return `${slug} status reported version ${reportedVersion} in ${directory} instead of ${version} in ${data}.`;
3096
+ }
3097
+ static formatSmokeStatusReported(slug, moment, version, directory) {
3098
+ return `${slug} status ${moment}: version ${version} in ${directory}.\n`;
3099
+ }
3100
+ static formatSmokeScreenshotFile(platform, architecture) {
3101
+ return `window-${platform}-${architecture}${Resources.pngExtension}`;
3102
+ }
3103
+ static formatSmokeScreenCaptured(file) {
3104
+ return `The screen with the window: ${file}\n`;
3105
+ }
3106
+ static formatSmokeScreenNotCaptured(exitCode, text) {
3107
+ return `The screen could not be captured, so the run keeps no picture of the window; ${Resources.smokeScreenCaptureCommand} exited with ${exitCode}:\n${text}\n`;
3108
+ }
3109
+ static formatSmokeQuitOutcomeWrong(slug, exitCode, text) {
3110
+ return `${slug} quit did not answer the outcome ${Resources.quitOutcome}; it exited with ${exitCode}:\n${text}`;
3111
+ }
3112
+ static formatHashEntry(name, hash) {
3113
+ return `${name}${Resources.hashEntrySeparator}${hash}`;
3114
+ }
3115
+ static formatArchiveName(baseName, version) {
3116
+ return `${baseName}${Resources.kebabSeparator}${version}${Resources.packageArchiveExtension}`;
3117
+ }
3118
+ static formatRecordFile(name) {
3119
+ return `${name}${Resources.recordExtension}`;
3120
+ }
3121
+ static formatTestRecordFile(name) {
3122
+ return `${name}${Resources.testRecordExtension}`;
3123
+ }
3124
+ static formatAddonFile(addon) {
3125
+ return `${addon}${Resources.addonExtension}`;
3126
+ }
3127
+ static formatAddonTarget(platform, architecture) {
3128
+ return `${platform}${Resources.kebabSeparator}${architecture}`;
3129
+ }
3130
+ static formatAddonToolchainMissing(packageName, addon, toolchain) {
3131
+ return `Building ${packageName}'s Windows addon ${addon} needs ${toolchain}, and node-gyp found no Visual Studio with it. Install it and run npm run build again.`;
3132
+ }
3133
+ static formatAddonBuildFailed(packageName, kind, addon, exitCode, text) {
3134
+ return `Building ${packageName}'s ${kind} addon ${addon} failed with exit code ${exitCode}:\n${text}`;
3135
+ }
3136
+ static formatReleaseAddonMissing(target, packageName, addon, directory, build) {
3137
+ return `${Resources.releaseAddonsVariable} lacks the ${target} build of ${packageName}'s addon ${addon}, ${directory}/${build}.`;
3138
+ }
3139
+ static formatArchiveUnreadable(archive) {
3140
+ return `${archive} could not be read as a gzipped archive.`;
3141
+ }
3142
+ static formatArchiveEntryMalformed(archive, offset) {
3143
+ return `${archive} has a malformed or truncated entry at offset ${offset}.`;
3144
+ }
3145
+ static formatFixturePackageMisnamed(directory, expected) {
3146
+ return `${directory}/${Resources.packageManifestFileName} must be named "${expected}", the fixture package's path below ${Resources.moduleFixtureFolder}/ joined with dots.`;
3147
+ }
3148
+ static formatSourcePackageMisnamed(directory, expected) {
3149
+ return `${directory}/${Resources.packageManifestFileName} must be named "${expected}", the name its folder gives.`;
3150
+ }
3151
+ static formatManifestUnreadable(file) {
3152
+ return `${file} could not be read as JSON.`;
3153
+ }
3154
+ static formatManifestNameMissing(file) {
3155
+ return `${file} must have a name.`;
3156
+ }
3157
+ static formatManifestVersionUnstamped(file) {
3158
+ return `${file} must have the version "${Resources.packageVersionPlaceholder}"; the build stamps the root package.json's version.`;
3159
+ }
3160
+ static formatManifestDependenciesInvalid(file) {
3161
+ return `${file} must list its dependencies as an object.`;
3162
+ }
3163
+ static formatManifestPeersInvalid(file) {
3164
+ return `${file} must list its peer dependencies as an object.`;
3165
+ }
3166
+ static formatManifestPeersMetaInvalid(file) {
3167
+ return `${file} must describe each peer dependency in ${Resources.peerDependenciesMetaField} as an object, with ${Resources.optionalField}, when given, true or false.`;
3168
+ }
3169
+ static formatManifestSettingsInvalid(file) {
3170
+ return `${file} must keep its noldova settings in an object.`;
3171
+ }
3172
+ static formatManifestExclusionsInvalid(file) {
3173
+ return `${file} must list its coverage exclusions in an array.`;
3174
+ }
3175
+ static formatManifestAddonsInvalid(file, kind) {
3176
+ return `${file} must list its ${kind} addons in an array of kebab-case names.`;
3177
+ }
3178
+ static formatManifestFilesInvalid(file) {
3179
+ return `${file} must list its files in an array of patterns.`;
3180
+ }
3181
+ static formatProductFieldInvalid(field, expected) {
3182
+ return `The root ${Resources.packageManifestFileName}'s ${Resources.formatFieldPath(Resources.manifestDesktopField, Resources.productField, field)} must be ${expected}.`;
3183
+ }
3184
+ static formatCheckoutApplicationId(applicationId, hash) {
3185
+ return `${applicationId}${Resources.packageSegmentSeparator}${hash}`;
3186
+ }
3187
+ static formatRepositoryUpdateFeed(repository) {
3188
+ return `https://github.com/${repository}/releases/latest/download/`;
3189
+ }
3190
+ static formatRepositoryPage(repository) {
3191
+ return `https://github.com/${repository}`;
3192
+ }
3193
+ static formatDebianPackageUnnamed(file, exitCode, text) {
3194
+ return `dpkg-deb found no package name in ${file}, ${Resources.formatExitCodeProblem(exitCode, text)}`;
3195
+ }
3196
+ static formatDebianCommandUnresolved(command, exitCode, text) {
3197
+ return `The Debian package left no command at ${command} that leads to its program, ${Resources.formatExitCodeProblem(exitCode, text)}`;
3198
+ }
3199
+ static formatOwnerAndMode(owner, mode) {
3200
+ return `${owner}:${mode}`;
3201
+ }
3202
+ static formatDebianSandboxHelperWrong(helper, actual, expected, canCreate) {
3203
+ return `${helper} is ${actual}, not ${expected} as the package's after-install script leaves it where root ${canCreate ? "can" : "cannot"} create user namespaces.`;
3204
+ }
3205
+ static formatDebianSandboxHelperChecked(helper, expected, canCreate) {
3206
+ return `${helper} is ${expected}, as the package's after-install script leaves it where root ${canCreate ? "can" : "cannot"} create user namespaces.`;
3207
+ }
3208
+ static formatDebianProfileUnexpected(profile, isEnabled) {
3209
+ return `${profile} is installed, though ${isEnabled ? "AppArmor here refuses the package's profile" : "AppArmor is not enabled here"}, so the after-install script should have left it out.`;
3210
+ }
3211
+ static formatDebianProfileSkipped(profile, isEnabled) {
3212
+ return `${profile} is not installed, as the after-install script leaves it out where ${isEnabled ? "AppArmor refuses the package's profile" : "AppArmor is not enabled"}.`;
3213
+ }
3214
+ static formatDebianProfileNotCopied(profile, source) {
3215
+ return `${profile} is missing or differs from ${source}, which the after-install script copies there where AppArmor takes the profile.`;
3216
+ }
3217
+ static formatLoadedProfile(slug) {
3218
+ return `${slug} (unconfined)`;
3219
+ }
3220
+ static formatDebianProfileNotLoaded(slug, loaded) {
3221
+ return `${loaded} lists no profile ${Resources.formatLoadedProfile(slug)}, which the after-install script loads.`;
3222
+ }
3223
+ static formatDebianProfileInstalled(profile) {
3224
+ return `${profile} is the package's AppArmor profile, which allows the program user namespaces, and it is loaded.`;
3225
+ }
3226
+ static formatDebianRemoved(packageName, folder, profile) {
3227
+ return `Removing the Debian package ${packageName} left neither ${folder} nor ${profile}.`;
3228
+ }
3229
+ static formatDebianRemovalLeft(packageName, left) {
3230
+ return `Removing the Debian package ${packageName} left ${left.join(" and ")}.`;
3231
+ }
3232
+ static formatPackageFolderInvalid(directory) {
3233
+ return `${directory} is neither a package folder directly under src/, named noldova and its package's segments such as src/noldova.desktop.protocol, nor a module part under ${Resources.sourceModulesFolder}/.`;
3234
+ }
3235
+ static formatWindowExportMissing(name) {
3236
+ return `${name} has no file at its ${Resources.windowExportPath} export; the build reads the window part's entry there to check the packages it imports.`;
3237
+ }
3238
+ static formatWindowEntry(name) {
3239
+ return `${name}${Resources.windowExportPath.slice(1)}`;
3240
+ }
3241
+ static formatWindowImportUnlisted(name, specifier, imported) {
3242
+ return `${name}'s window part imports ${specifier}, but ${name} doesn't list ${imported} among its dependencies, optional dependencies or peer dependencies; a window part imports by name only what its module's package lists.`;
3243
+ }
3244
+ static formatWindowImportOtherModule(name, specifier, entry) {
3245
+ return `${name}'s window part imports ${specifier}, another module's package; a window part reaches another module only through its window entry, ${entry}.`;
3246
+ }
3247
+ static formatWalkKey(folder, isWindowSide) {
3248
+ return `${isWindowSide ? Resources.windowSideKey : Resources.nodeSideKey}${folder}`;
3249
+ }
3250
+ static formatPackageBuilt(name, isCurrent) {
3251
+ return `${name}: ${isCurrent ? Resources.packageReused : Resources.packageBuilt}\n`;
3252
+ }
3253
+ static formatTestsSubject(name) {
3254
+ return `${name} tests`;
3255
+ }
3256
+ static formatPackageTestsCompiled(name, isCurrent) {
3257
+ return `${Resources.formatTestsSubject(name)}: ${isCurrent ? Resources.packageReused : Resources.packageTestsCompiled}\n`;
3258
+ }
3259
+ static formatFixtureChecked(name, buildsOnAngular) {
3260
+ return `${name}: ${buildsOnAngular ? Resources.fixtureTestBuildOnly : Resources.fixtureTypeChecked}\n`;
3261
+ }
3262
+ static formatAngularPackagesInstalled(count, isCurrent) {
3263
+ return isCurrent
3264
+ ? `Angular packages built: ${count}; the app's install already holds them, unchanged since the last build.\n`
3265
+ : `Angular packages built and installed: ${count}.\n`;
3266
+ }
3267
+ static formatRootPackagesInstalled(count) {
3268
+ return `Packages built on Angular packages and installed: ${count}.\n`;
3269
+ }
3270
+ static formatSecondCopy(name, location) {
3271
+ return `The app's install holds a second copy of ${name}, at ${location}; the app holds one copy of each Angular, Noldova Desktop, context and kit package, at the top of its node_modules, so a package takes them only as peer dependencies.`;
3272
+ }
3273
+ static formatNodeSideAngular(name, trail) {
3274
+ return `${name} reaches the Angular package ${trail.at(-1)} through ${trail.join(" -> ")}; Angular belongs to the window alone, so no package of the runtime, the main process, the command line or the build depends on it.`;
3275
+ }
3276
+ static formatPackingOperation(name) {
3277
+ return `Packing ${name}`;
3278
+ }
3279
+ static formatInstallingOperation(subject) {
3280
+ return `Installing ${subject}`;
3281
+ }
3282
+ static formatTypeCheckOperation(directory) {
3283
+ return `Type-checking ${directory}/${Resources.sourceFolder}`;
3284
+ }
3285
+ static formatCompilingOperation(directory, folder) {
3286
+ return `Compiling ${directory}/${folder}`;
3287
+ }
3288
+ static formatListingInputsOperation(directory) {
3289
+ return `Listing the inputs of ${directory} with its ${Resources.buildScriptSegments.join(Resources.pathSegmentSeparator)}`;
3290
+ }
3291
+ static formatBuildScriptOperation(directory) {
3292
+ return `Building ${directory} with its ${Resources.buildScriptSegments.join(Resources.pathSegmentSeparator)}`;
3293
+ }
3294
+ static formatOperationFailed(operation, exitCode, text) {
3295
+ return `${operation} failed with exit code ${exitCode}:\n${text}`;
3296
+ }
3297
+ static formatProtocolVersionUndeclared(directory) {
3298
+ return `${directory} uses ${Resources.protocolVersionPlaceholder}, but the root package.json declares no desktop.protocolVersion.`;
3299
+ }
3300
+ static formatDeclarationsMissing(directory) {
3301
+ return `${directory} has no ${Resources.sourceFolder}/${Resources.declarationSegments.join(Resources.pathSegmentSeparator)}.`;
3302
+ }
3303
+ static formatArchiveCopyMissing(archive, entry, origin) {
3304
+ return `${archive} lacks ${entry}, the copy of ${origin}.`;
3305
+ }
3306
+ static formatArchiveCopyDiffers(archive, entry, origin) {
3307
+ return `${archive} holds a ${entry} that differs from ${origin}.`;
3308
+ }
3309
+ static formatCompanyPackageUnreadable(id, location) {
3310
+ return `${id} could not be read at ${location}, where npm ci installs it after checking it against package-lock.json; the stage takes the company's packages only from there.`;
3311
+ }
3312
+ static formatCompanyPackageMismatch(location, id) {
3313
+ return `${location} does not hold ${id}, which package-lock.json locks; run npm ci, so the stage takes the locked package.`;
3314
+ }
3315
+ static formatCompanyPackFailed(id, location, exitCode, text) {
3316
+ return `Packing ${id} from ${location} failed with exit code ${exitCode}:\n${text}`;
3317
+ }
3318
+ static formatCompanyArchiveUnreadable(id, archive) {
3319
+ return `${id} was installed from ${archive}, which can no longer be read; build the app's packages and install the app again.`;
3320
+ }
3321
+ static formatCompanyArchiveMismatch(archive, id) {
3322
+ return `${archive} no longer matches the integrity npm recorded when it installed ${id}; build the app's packages and install the app again.`;
3323
+ }
3324
+ static formatTarEntryTypeRefused(archive, name, description) {
3325
+ return `${archive} holds ${name} as ${description}, `
3326
+ + "and packaging takes only files and folders, so it cannot ship.";
3327
+ }
3328
+ static formatTarEntryOutside(archive, name, id) {
3329
+ return `${archive} holds ${name}, which would be written outside ${id}'s folder, so it cannot ship.`;
3330
+ }
3331
+ static formatTarEntryWindowsUnsafe(archive, name) {
3332
+ return `${archive} holds ${name}, a path that Windows reads as another file or refuses, so it cannot ship.`;
3333
+ }
3334
+ static formatTarEntryCaseClash(archive, other, prefix) {
3335
+ return `${archive} holds ${other} and ${prefix}, which differ only in case or Unicode form and are one name on Windows or macOS, so they cannot ship.`;
3336
+ }
3337
+ static formatCompanyManifestMissing(origin, id) {
3338
+ return `${origin} holds no package.json for ${id}, so it cannot ship.`;
3339
+ }
3340
+ static formatLicenseMissing(packageId) {
3341
+ return `${packageId} names no license in its package.json; a third-party runtime package needs ${Resources.formatAllowedLicenses()}.`;
3342
+ }
3343
+ static formatAllowedLicenses() {
3344
+ return `one of ${Resources.allowedLicenses.join(", ")}, or an OR expression with one of them`;
3345
+ }
3346
+ static formatLicenseAccepted(expression) {
3347
+ return `${expression}, accepted by the app`;
3348
+ }
3349
+ static formatLicenseChosen(chosen, expression) {
3350
+ return `${chosen}, chosen from "${expression}"`;
3351
+ }
3352
+ static formatPackageId(name, version) {
3353
+ return `${name}${Resources.packageVersionSeparator}${version}`;
3354
+ }
3355
+ static formatLockedArchiveName(name, version) {
3356
+ return `${name.split(Resources.pathSegmentSeparator).join(Resources.archiveScopeSeparator)}-${version}${Resources.packageArchiveExtension}`;
3357
+ }
3358
+ static formatLockedPackageInvalid(location) {
3359
+ return `${location} in package-lock.json has no valid package name and version.`;
3360
+ }
3361
+ static formatLockedPackageBundled(name, version, location) {
3362
+ return `${name}@${version} at ${location} in package-lock.json is bundled inside its parent's tarball; bundled dependencies are not supported, so it cannot ship.`;
3363
+ }
3364
+ static formatLockedPackageAlias(location, installed, name) {
3365
+ return `${location} in package-lock.json installs ${installed} under the alias ${name}; aliases are not supported, so it cannot ship.`;
3366
+ }
3367
+ static formatLockedPackageUnlocked(name, version, location) {
3368
+ return `${name}@${version} at ${location} is installed but not locked in package-lock.json, and only a package installed from the app's own archive may ship unlocked.`;
3369
+ }
3370
+ static formatLockedPackageUnresolved(name, version, location) {
3371
+ return `${name}@${version} at ${location} in package-lock.json is not resolved to a registry tarball, so it cannot ship.`;
3372
+ }
3373
+ static formatLockedPackageNoIntegrity(name, version, location) {
3374
+ return `${name}@${version} at ${location} in package-lock.json has no SHA-512 integrity, so its tarball cannot be verified.`;
3375
+ }
3376
+ static formatTypeOnlyPeers(peers) {
3377
+ return [...peers].map(([id, names]) => `${id}'s ${[...names].join(", ")}`).join("; ");
3378
+ }
3379
+ static formatPackageTargetUnsupported(platform, architecture) {
3380
+ return `Packages are made for windows, macos and linux on x64 and arm64, not for ${platform} on ${architecture}.`;
3381
+ }
3382
+ static formatTargetId(platform, architecture) {
3383
+ return `${platform}-${architecture}`;
3384
+ }
3385
+ static formatTargetFileName(productName, platform, architecture, extension) {
3386
+ return `${productName}-${platform}-${architecture}.${extension}`;
3387
+ }
3388
+ static formatTarEntryType(type) {
3389
+ return `a tar entry of type ${type}`;
3390
+ }
3391
+ static formatTarUnclosed(source) {
3392
+ return `${source} ends without the empty block that closes a tar archive, so it cannot ship.`;
3393
+ }
3394
+ static formatTarChecksumMismatch(source, offset) {
3395
+ return `${source} has a tar header at byte ${offset} whose checksum does not match, so it cannot ship.`;
3396
+ }
3397
+ static formatTarEntryOverrun(source, offset) {
3398
+ return `${source} has a tar entry at byte ${offset} that runs past the archive's end, so it cannot ship.`;
3399
+ }
3400
+ static formatTarLongLink(source, offset) {
3401
+ return `${source} has a GNU long link name at byte ${offset}, which packaging does not read, so it cannot ship.`;
3402
+ }
3403
+ static formatTarPaxUnreadable(source, header) {
3404
+ return `${source} has a pax header at byte ${header} whose records cannot be read, so it cannot ship.`;
3405
+ }
3406
+ static formatTarFieldNotOctal(source, field) {
3407
+ return `${source} has a tar header whose ${field} is not an octal number, so it cannot ship.`;
3408
+ }
3409
+ static formatTarballSource(id, resolved) {
3410
+ return `The tarball of ${id} from ${resolved}`;
3411
+ }
3412
+ static formatTarballHoldsOther(id, resolved, name, version) {
3413
+ return `The tarball of ${id} from ${resolved} holds ${name}@${version} instead, so it cannot ship.`;
3414
+ }
3415
+ static formatTypeOnlyPeerLoaded(id, peer, loader) {
3416
+ return `${id} loads ${peer} in ${loader}, so it would fail at runtime without it, but the app names ${peer} as a types-only peer of ${id}.`;
3417
+ }
3418
+ static formatNamedLicenseMissing(id, named) {
3419
+ return `${id} names its license in ${named}, which its tarball does not hold, so its license cannot ship.`;
3420
+ }
3421
+ static formatSkippedEntry(name, description) {
3422
+ return `${name} as ${description}`;
3423
+ }
3424
+ static formatThirdPartyNotice(id, license, text) {
3425
+ return `${id}\nLicense: ${license}\n\n${text}\n`;
3426
+ }
3427
+ static formatPackageLoadPattern(peer) {
3428
+ const name = peer.replace(Resources.regexSpecialCharacters, Resources.regexEscapeReplacement);
3429
+ return new RegExp(String.raw `(?:\brequire\s*\(\s*|\bimport\s*\(\s*|\bfrom\s*|\bimport\s*)(["'${"`"}])${name}(?:/[^"'${"`"}]*)?\1`);
3430
+ }
3431
+ static formatTarballNoManifest(id, resolved) {
3432
+ return `The tarball of ${id} from ${resolved} has no package.json, so it cannot ship.`;
3433
+ }
3434
+ static formatTarballManifestUnreadable(id) {
3435
+ return `The package.json in the tarball of ${id} could not be read as a JSON object, so it cannot ship.`;
3436
+ }
3437
+ static formatDownloadFailed(id, resolved, error) {
3438
+ return `${id} could not be downloaded from ${resolved}: ${error}`;
3439
+ }
3440
+ static formatDownloadStatus(id, resolved, status) {
3441
+ return `${id} could not be downloaded from ${resolved}: HTTP ${status}.`;
3442
+ }
3443
+ static formatTarballIntegrityMismatch(id, resolved) {
3444
+ return `The tarball of ${id} from ${resolved} does not match the SHA-512 integrity in package-lock.json, so it cannot ship.`;
3445
+ }
3446
+ static formatWindowsPublisherInvalid(publisher) {
3447
+ return `Signing Windows packages needs ${Resources.windowsPublisherVariable}, the distinguished name of the signing certificate's subject, starting with CN= and with its fields separated by ", "; ${publisher.length === 0 ? "it is not set" : "it is set to something else"}.`;
3448
+ }
3449
+ static formatWindowsSigningInvalid(field, expected) {
3450
+ return `${Resources.windowsSigningSection}.${field} in the root package.json must be ${expected}.`;
3451
+ }
3452
+ static formatChecksumName(packageName) {
3453
+ return `${packageName}.${Resources.checksumAlgorithm}`;
3454
+ }
3455
+ static formatChecksumLine(sha256, name) {
3456
+ return `${sha256}${Resources.checksumSeparator}${name}\n`;
3457
+ }
3458
+ static formatReleaseFileMissing(file) {
3459
+ return `${file} is missing; npm run package makes it.`;
3460
+ }
3461
+ static formatReleaseFolderMissing(folder) {
3462
+ return `The release's folder ${folder} does not exist.`;
3463
+ }
3464
+ static formatChecksumMismatch(checksum, name) {
3465
+ return `${checksum} does not match ${name}.`;
3466
+ }
3467
+ static formatReleaseRunInvalid(runUrl) {
3468
+ return `${Resources.releaseRunVariable} must be the https address of the run that built the release, not "${runUrl}".`;
3469
+ }
3470
+ static formatReleaseSummary(name, version, targets, signing) {
3471
+ return `${name} ${version} for ${targets}. ${signing}`;
3472
+ }
3473
+ static formatReleaseSupported(supported, ciOnly) {
3474
+ return `Supported after their native acceptance: ${supported}.`
3475
+ + (Object.isNull(ciOnly) ? String.empty : ` Accepted by a CI run only: ${ciOnly}.`);
3476
+ }
3477
+ static formatReleaseRunCheck(runUrl) {
3478
+ return `Each target's package passed its install check on that target's own runner in the run that built it: ${runUrl}`;
3479
+ }
3480
+ static formatUnsignedTestRelease(name, repository) {
3481
+ return `Unsigned test release of ${name}, published in ${repository}; an installed ${name} never updates from it.`;
3482
+ }
3483
+ static formatReleaseTargetName(platform, architecture) {
3484
+ return `${platform} ${architecture}`;
3485
+ }
3486
+ static formatAssetDigest(sha256) {
3487
+ return `${Resources.assetDigestPrefix}${sha256}`;
3488
+ }
3489
+ static formatAssetMismatch(name, size, digest, builtSize, expected) {
3490
+ return `${name} on GitHub has ${size} bytes and ${digest ?? "no digest"}, but the built file has ${builtSize} bytes and ${expected}. `
3491
+ + "A release's files are never replaced.";
3492
+ }
3493
+ static formatGitHubReleasesContext(index) {
3494
+ return `releases[${index}]`;
3495
+ }
3496
+ static formatReleaseTagShared(count, tag) {
3497
+ return `${count} releases use the tag ${tag}; delete all but one by hand before publishing.`;
3498
+ }
3499
+ static formatReleaseAlreadyPublished(tag) {
3500
+ return `${tag} is already published with every file as built; nothing changed.\n`;
3501
+ }
3502
+ static formatDraftForOtherRevision(tag, target, revision) {
3503
+ return `The draft release ${tag} is for ${target}, not for ${revision}; delete the draft by hand to publish ${revision}.`;
3504
+ }
3505
+ static formatGitHubReleasePath(id) {
3506
+ return `${Resources.githubReleasesPath}/${id}`;
3507
+ }
3508
+ static formatGitHubAssetPath(id) {
3509
+ return `${Resources.githubReleasesPath}/assets/${id}`;
3510
+ }
3511
+ static formatReleaseKeptDraft(tag) {
3512
+ return `GitHub kept ${tag} as a draft when it was published.`;
3513
+ }
3514
+ static formatReleaseCheckFailed(tag, error) {
3515
+ return `${tag} is public now, but checking it after publishing failed: ${error} Check it by hand; a published release is never replaced.`;
3516
+ }
3517
+ static formatReleasePublished(tag, revision, count) {
3518
+ return `Published ${tag} from ${revision} with ${count} files.\n`;
3519
+ }
3520
+ static formatDraftCreating(tag, revision) {
3521
+ return `Creating the draft release ${tag} for ${revision}.\n`;
3522
+ }
3523
+ static formatUploadRetry(name, attempt, message) {
3524
+ return `Uploading ${name} failed on attempt ${attempt} of ${Resources.releaseUploadAttempts}: ${message}\n`;
3525
+ }
3526
+ static formatUploadFailed(name) {
3527
+ return `${name} is still not uploaded after ${Resources.releaseUploadAttempts} attempts.`;
3528
+ }
3529
+ static formatIncompleteUploadDeleting(name) {
3530
+ return `Deleting the incomplete upload of ${name}.\n`;
3531
+ }
3532
+ static formatGitHubReleaseContext(id) {
3533
+ return `release ${id}`;
3534
+ }
3535
+ static formatTagReference(tag) {
3536
+ return `${Resources.tagReferencePrefix}${tag}`;
3537
+ }
3538
+ static formatTagAppearedElsewhere(tag, commit, revision) {
3539
+ return `The tag ${tag} appeared on ${commit}, not on ${revision}, so the draft stays unpublished.`;
3540
+ }
3541
+ static formatTagPointsElsewhere(tag, commit, revision) {
3542
+ return `The tag ${tag} points at ${commit ?? "nothing"}, not at ${revision}.`;
3543
+ }
3544
+ static formatReportsUnreadable(folder) {
3545
+ return `The package reports in ${folder} cannot be read.`;
3546
+ }
3547
+ static formatReportForeignTarget(target) {
3548
+ return `A package report covers ${target}, which is not a target of this release.`;
3549
+ }
3550
+ static formatReportMissing(target) {
3551
+ return `No package report covers ${target}.`;
3552
+ }
3553
+ static formatReportsDuplicated(count, target) {
3554
+ return `${count} package reports cover ${target}.`;
3555
+ }
3556
+ static formatReportSigningMismatch(target, description, isSigned, platform) {
3557
+ return `The ${target} package was ${description}, but the release ${isSigned ? "signs" : "does not sign"} ${platform} packages.`;
3558
+ }
3559
+ static formatReportFolderEmpty(name) {
3560
+ return `${name} holds no package report.`;
3561
+ }
3562
+ static formatReportUnreadable(name) {
3563
+ return `${name}'s package report cannot be read.`;
3564
+ }
3565
+ static formatTagContext(tag) {
3566
+ return `the tag ${tag}`;
3567
+ }
3568
+ static formatTagAnnotated(tag) {
3569
+ return `The tag ${tag} is annotated; a release's tag points straight at its commit.`;
3570
+ }
3571
+ static formatTagMoved(tag, commit, revision) {
3572
+ return `The tag ${tag} already points at ${commit}, not at ${revision}; a tag is never moved, so this release needs a new version.`;
3573
+ }
3574
+ static formatUpdateFileMissing(version, updateName) {
3575
+ return `The update metadata of ${version} needs its update file ${updateName} among its files.`;
3576
+ }
3577
+ static formatUpdateMetadataFileName(platform, architecture) {
3578
+ return `${Resources.updateMetadataPrefix}-${platform}-${architecture}.${Resources.updateMetadataExtension}`;
3579
+ }
3580
+ static formatReleaseDateMissing(file) {
3581
+ return `${file} names no release date.`;
3582
+ }
3583
+ static formatYamlQuoted(text) {
3584
+ return `'${text.replaceAll("'", "''")}'`;
3585
+ }
3586
+ static formatReleaseRepositoryInvalid(repository) {
3587
+ return `${Resources.releaseRepositoryVariable} must name a repository as owner/name, not "${repository}".`;
3588
+ }
3589
+ static formatReleaseRevisionInvalid(revision) {
3590
+ return `${Resources.releaseRevisionVariable} must be a full commit SHA of 40 lowercase hexadecimal digits, not "${revision}".`;
3591
+ }
3592
+ static formatReleaseVersionInvalid(source, text) {
3593
+ return `${source} must be a plain version such as 0.0.2, not "${text}".`;
3594
+ }
3595
+ static formatReleaseTagInvalid(source, tag) {
3596
+ return `${source} must be a tag such as v0.0.2, not "${tag}".`;
3597
+ }
3598
+ static formatTagReferencesContext(tag) {
3599
+ return `the references of the tag ${tag}`;
3600
+ }
3601
+ static formatGitHubTagReferencesPath(tag) {
3602
+ return `${Resources.githubTagReferencesPath}${tag}`;
3603
+ }
3604
+ static formatGhField(name, value) {
3605
+ return `${name}=${value}`;
3606
+ }
3607
+ static formatGitHubRepositoryPath(repository, resource) {
3608
+ return `repos/${repository}${resource}`;
3609
+ }
3610
+ static formatGitHubNotJson(resource) {
3611
+ return `GitHub's answer for ${resource} is not JSON.`;
3612
+ }
3613
+ static formatJsonNotObject(context) {
3614
+ return `${context} must be an object.`;
3615
+ }
3616
+ static formatJsonNotArray(context) {
3617
+ return `${context} must be an array.`;
3618
+ }
3619
+ static formatJsonChildContext(context, key) {
3620
+ return `${context}.${key}`;
3621
+ }
3622
+ static formatJsonItemContext(context, key, index) {
3623
+ return `${context}.${key}[${index}]`;
3624
+ }
3625
+ static formatJsonNotText(context, key) {
3626
+ return `${context}.${key} must be text.`;
3627
+ }
3628
+ static formatJsonNotWholeNumber(context, key) {
3629
+ return `${context}.${key} must be a whole number.`;
3630
+ }
3631
+ static formatJsonNotFlag(context, key) {
3632
+ return `${context}.${key} must be true or false.`;
3633
+ }
3634
+ static formatProcessOutputTooLarge(command) {
3635
+ return `"${command}" wrote more than ${Resources.processOutputLimit} bytes.`;
3636
+ }
3637
+ static formatProcessTimedOut(command, timeout) {
3638
+ return `"${command}" did not finish within ${timeout} ms.`;
3639
+ }
3640
+ static formatProcessNotStarted(command) {
3641
+ return `"${command}" could not start.`;
3642
+ }
3643
+ static formatProcessExited(exitCode) {
3644
+ return `exited with code ${exitCode}`;
3645
+ }
3646
+ static formatProcessSignalled(signal) {
3647
+ return `ended by ${signal}`;
3648
+ }
3649
+ static formatDownloadRetry(subject, attempt) {
3650
+ return `${subject} could not be installed (attempt ${attempt} of ${Resources.downloadAttempts}); trying again in ${Resources.downloadRetryPause / Resources.millisecondsPerSecond} seconds.\n`;
3651
+ }
3652
+ static formatDownloadGaveUp(subject, failure) {
3653
+ return `${subject} could not be installed in ${Resources.downloadAttempts} attempts; the last failed with ${failure}.`;
3654
+ }
3655
+ static indentNoticeLine(line) {
3656
+ return line === String.empty ? String.empty : ` ${line}`;
3657
+ }
3658
+ }
3659
+ //# sourceMappingURL=resources.js.map