@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
@@ -0,0 +1,19 @@
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 { BuildException } from "./build.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ export class ProcessTimeoutException extends BuildException {
11
+ command;
12
+ timeout;
13
+ constructor(command, timeout) {
14
+ super(Resources.formatProcessTimedOut(command, timeout));
15
+ this.command = command;
16
+ this.timeout = timeout;
17
+ }
18
+ }
19
+ //# sourceMappingURL=process-timeout.exception.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-timeout.exception.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/exceptions/process-timeout.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IACzC,OAAO,CAAS;IAChB,OAAO,CAAS;IAEhC,YAAmB,OAAe,EAAE,OAAe;QACjD,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAEzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-feed-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-feed-file.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-feed-file.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-fixture-package.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-fixture-package.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-fixture-package.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-killed-copy-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-killed-copy-session.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-killed-copy-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-listed-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-listed-module.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-listed-module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-module-declaration-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-module-declaration-json.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-module-declaration-json.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-module-settings-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-module-settings-file.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-module-settings-file.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-package-signing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-package-signing.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-package-signing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-process-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-process-record.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-process-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-retry-clock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-retry-clock.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-retry-clock.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-settings-page-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-settings-page-json.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-settings-page-json.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-smoke-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-smoke-copy.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-smoke-copy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-web-view-key-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-web-view-key-json.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-web-view-key-json.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,9 @@
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
+ export {};
9
+ //# sourceMappingURL=i-window-wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i-window-wait.js","sourceRoot":"","sources":["../../../../src/noldova.desktop.build/src/interfaces/i-window-wait.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,21 @@
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
+ export class BuildVariant {
9
+ static REGULAR = new BuildVariant(false, []);
10
+ isTest;
11
+ excluded;
12
+ isPackaged;
13
+ updateFeed;
14
+ constructor(isTest, excluded, isPackaged = false, updateFeed = null) {
15
+ this.isTest = isTest;
16
+ this.excluded = excluded;
17
+ this.isPackaged = isPackaged;
18
+ this.updateFeed = updateFeed;
19
+ }
20
+ }
21
+ //# sourceMappingURL=build-variant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-variant.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.build/src/models/modules/build-variant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,OAAO,YAAY;IAChB,MAAM,CAAU,OAAO,GAAiB,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE3D,MAAM,CAAU;IAChB,QAAQ,CAAoB;IAC5B,UAAU,CAAU;IACpB,UAAU,CAAgB;IAE1C,YAAmB,MAAe,EAAE,QAA2B,EAAE,aAAsB,KAAK,EAAE,aAA4B,IAAI;QAC5H,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC"}
@@ -0,0 +1,27 @@
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
+ export class MenuGroup {
9
+ name;
10
+ place;
11
+ isExclusive;
12
+ items;
13
+ isDynamic;
14
+ constructor(name, place, isExclusive, items, isDynamic = false) {
15
+ this.name = name;
16
+ this.place = place;
17
+ this.isExclusive = isExclusive;
18
+ this.items = [...items];
19
+ this.isDynamic = isDynamic;
20
+ }
21
+ toJson() {
22
+ return this.isDynamic
23
+ ? { name: this.name, place: this.place, exclusive: this.isExclusive, dynamic: true }
24
+ : { name: this.name, place: this.place, exclusive: this.isExclusive, items: this.items.map(t => t.toJson()) };
25
+ }
26
+ }
27
+ //# sourceMappingURL=menu-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-group.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.build/src/models/modules/menu-group.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,OAAO,SAAS;IACJ,IAAI,CAAS;IACb,KAAK,CAAS;IACd,WAAW,CAAU;IACrB,KAAK,CAAsB;IAC3B,SAAS,CAAU;IAEnC,YAAmB,IAAY,EAAE,KAAa,EAAE,WAAoB,EAAE,KAA0B,EAAE,YAAqB,KAAK;QAC1H,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,SAAS;YACnB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE;YACpF,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;IAClH,CAAC;CACF"}
@@ -0,0 +1,30 @@
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 MenuItem {
10
+ command;
11
+ commandArguments;
12
+ submenu;
13
+ label;
14
+ choice;
15
+ constructor(command, commandArguments, submenu, label = null, choice = null) {
16
+ this.command = command;
17
+ this.commandArguments = commandArguments;
18
+ this.submenu = submenu;
19
+ this.label = label;
20
+ this.choice = choice;
21
+ }
22
+ toJson() {
23
+ if (!Object.isNull(this.submenu))
24
+ return { submenu: this.submenu };
25
+ if (!Object.isNull(this.choice))
26
+ return { choice: this.choice };
27
+ return Object.isNull(this.label) ? { command: this.command, arguments: this.commandArguments } : { command: this.command, arguments: this.commandArguments, label: this.label };
28
+ }
29
+ }
30
+ //# sourceMappingURL=menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.build/src/models/modules/menu-item.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,MAAM,OAAO,QAAQ;IACH,OAAO,CAAgB;IACvB,gBAAgB,CAAoC;IACpD,OAAO,CAAgB;IACvB,KAAK,CAAgB;IACrB,MAAM,CAAgB;IAEtC,YAAmB,OAAsB,EAAE,gBAAmD,EAAE,OAAsB,EAAE,QAAuB,IAAI,EAAE,SAAwB,IAAI;QAC/K,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;YAC7B,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAClL,CAAC;CACF"}
@@ -0,0 +1,27 @@
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
+ import { Resources } from "../../resources.js";
10
+ export class MenuPlace {
11
+ name;
12
+ title;
13
+ isMenuBar;
14
+ toolbar;
15
+ constructor(name, title, isMenuBar, toolbar = null) {
16
+ this.name = name;
17
+ this.title = title;
18
+ this.isMenuBar = isMenuBar;
19
+ this.toolbar = toolbar;
20
+ }
21
+ toJson() {
22
+ if (!Object.isNull(this.toolbar))
23
+ return { name: this.name, title: this.title, shows: Resources.menuShowsToolbar, ...this.toolbar.toJson() };
24
+ return { name: this.name, title: this.title, shows: this.isMenuBar ? Resources.menuShowsMenuBar : Resources.menuShowsMenu };
25
+ }
26
+ }
27
+ //# sourceMappingURL=menu-place.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-place.js","sourceRoot":"","sources":["../../../../../src/noldova.desktop.build/src/models/modules/menu-place.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,OAAO,SAAS;IACJ,IAAI,CAAS;IACb,KAAK,CAAS;IACd,SAAS,CAAU;IACnB,OAAO,CAA0B;IAEjD,YAAmB,IAAY,EAAE,KAAa,EAAE,SAAkB,EAAE,UAAmC,IAAI;QACzG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QAC7G,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IAC9H,CAAC;CACF"}
@@ -0,0 +1,273 @@
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 { existsSync } from "node:fs";
9
+ import { readFile } from "node:fs/promises";
10
+ import path from "node:path";
11
+ import "@noldova/context.core";
12
+ import { ExceptionOptions } from "@noldova/context.exceptions";
13
+ import { JsonReader } from "@noldova/context.json";
14
+ import { PackageNaming } from "../../services/packages/package-naming.js";
15
+ import { RootManifest } from "../packages/root-manifest.js";
16
+ import { VersionRange } from "./version-range.js";
17
+ import { ModuleCliCommands } from "../../services/modules/module-cli-commands.js";
18
+ import { ModuleMenus } from "../../services/modules/module-menus.js";
19
+ import { BuildException } from "../../exceptions/build.exception.js";
20
+ import { ModuleSettings } from "../../services/modules/module-settings.js";
21
+ import { ModuleWebViews } from "../../services/modules/module-web-views.js";
22
+ import { Resources } from "../../resources.js";
23
+ export class ModuleDeclaration {
24
+ folder;
25
+ id;
26
+ version;
27
+ displayName;
28
+ description;
29
+ parts;
30
+ dependencies;
31
+ dependencyVersions;
32
+ optionalDependencies;
33
+ optionalDependencyVersions;
34
+ packageName;
35
+ contributions;
36
+ menus;
37
+ settings;
38
+ settingsPages;
39
+ cliCommands;
40
+ webViews;
41
+ usesPseudoTerminals;
42
+ switchSetting;
43
+ platforms;
44
+ noldovaDesktop;
45
+ isFixture;
46
+ modulesPrefix;
47
+ constructor(folder, id, version, displayName, description, parts, dependencyVersions, optionalDependencyVersions, packageName, contributions, menus, settings, cliCommands, webViews, usesPseudoTerminals, switchSetting, platforms, noldovaDesktop, isFixture, modulesPrefix = Resources.modulesPrefix) {
48
+ this.folder = folder;
49
+ this.id = id;
50
+ this.version = version;
51
+ this.displayName = displayName;
52
+ this.description = description;
53
+ this.parts = parts;
54
+ this.dependencies = [...dependencyVersions.keys()];
55
+ this.dependencyVersions = dependencyVersions;
56
+ this.optionalDependencies = [...optionalDependencyVersions.keys()];
57
+ this.optionalDependencyVersions = optionalDependencyVersions;
58
+ this.packageName = packageName;
59
+ this.contributions = contributions;
60
+ this.menus = menus;
61
+ this.settings = settings.settings;
62
+ this.settingsPages = settings.pages;
63
+ this.cliCommands = cliCommands;
64
+ this.webViews = webViews;
65
+ this.usesPseudoTerminals = usesPseudoTerminals;
66
+ this.switchSetting = switchSetting;
67
+ this.platforms = platforms;
68
+ this.noldovaDesktop = noldovaDesktop;
69
+ this.isFixture = isFixture;
70
+ this.modulesPrefix = modulesPrefix;
71
+ }
72
+ static isVersion(text) {
73
+ return VersionRange.isVersion(text);
74
+ }
75
+ static hasDeclaration(root, folder) {
76
+ return existsSync(path.join(root, folder, Resources.moduleDeclarationFileName));
77
+ }
78
+ static async readAsync(root, folder, isFixture, packageName = null, listedId = path.posix.basename(folder)) {
79
+ const file = Resources.formatFolderFile(folder, Resources.moduleDeclarationFileName);
80
+ const fail = (problem) => new BuildException(Resources.formatModuleFileProblem(file, problem));
81
+ let value;
82
+ try {
83
+ value = JsonReader.parse(await readFile(path.join(root, file), Resources.textEncoding)).toJson();
84
+ }
85
+ catch (error) {
86
+ throw new BuildException(Resources.formatJsonFileUnreadable(file), new ExceptionOptions(error));
87
+ }
88
+ const record = new Map(Object.entries(value));
89
+ const unknown = [...record.keys()].filter(t => !Resources.moduleDeclarationFields.includes(t));
90
+ if (unknown.length > 0)
91
+ throw fail(Resources.formatUnknownFields(unknown));
92
+ const id = record.get(Resources.idField);
93
+ if (!Object.isString(id) || id !== listedId || !Resources.moduleIdPattern.test(id) || Resources.moduleReservedIds.includes(id))
94
+ throw fail(Resources.formatModuleIdInvalid(listedId, !Object.isNull(packageName)));
95
+ if (Resources.windowsDeviceNames.includes(id))
96
+ throw fail(Resources.formatModuleIdWindowsDevice(id));
97
+ const version = record.get(Resources.versionField);
98
+ if (!Object.isString(version) || !VersionRange.isVersion(version))
99
+ throw fail(Resources.moduleVersionInvalid);
100
+ const displayName = record.get(Resources.displayNameField);
101
+ if (!Object.isString(displayName) || String.isNullOrWhitespace(displayName))
102
+ throw fail(Resources.moduleDisplayNameMissing);
103
+ const description = record.get(Resources.descriptionField);
104
+ if (!Object.isString(description) || String.isNullOrWhitespace(description))
105
+ throw fail(Resources.moduleDescriptionMissing);
106
+ const parts = ModuleDeclaration.readList(record.get(Resources.partsField), t => Resources.moduleParts.includes(t), fail, Resources.partsField, Resources.modulePartsExpected);
107
+ if (Object.isNull(packageName)) {
108
+ const missing = parts.filter(t => !existsSync(path.join(root, folder, t)));
109
+ if (missing.length > 0)
110
+ throw fail(Resources.formatModulePartsWithoutFolder(missing));
111
+ }
112
+ else
113
+ await ModuleDeclaration.checkPackageAsync(root, folder, packageName, version, parts, fail);
114
+ const dependencyVersions = ModuleDeclaration.readVersions(record.get(Resources.dependenciesField), id, fail, Resources.dependenciesField, Resources.moduleDependsOn);
115
+ const dependencies = [...dependencyVersions.keys()];
116
+ const optionalDependencyVersions = record.has(Resources.optionalDependenciesField)
117
+ ? ModuleDeclaration.readVersions(record.get(Resources.optionalDependenciesField), id, fail, Resources.moduleOptionalDependenciesLabel, Resources.moduleOptionallyDependsOn)
118
+ : new Map();
119
+ const both = dependencies.filter(t => optionalDependencyVersions.has(t));
120
+ if (both.length > 0)
121
+ throw fail(Resources.formatModuleDependencyRepeated(both));
122
+ const contributes = record.get(Resources.contributesField);
123
+ if (!Object.isPlainObject(contributes))
124
+ throw fail(Resources.moduleContributesNotObject);
125
+ const contributions = new Map();
126
+ for (const [kind, names] of Object.entries(contributes)) {
127
+ if (!Resources.moduleContributionKinds.includes(kind))
128
+ throw fail(Resources.formatModuleUnknownKind(kind));
129
+ contributions.set(kind, ModuleDeclaration.readNames(names, id, fail, kind));
130
+ }
131
+ const placeholders = contributions.get(Resources.placeholdersKind) ?? [];
132
+ if (placeholders.length > 1)
133
+ throw fail(Resources.modulePlaceholderRepeated);
134
+ if (placeholders.length > 0 && !parts.includes(Resources.windowPart))
135
+ throw fail(Resources.modulePlaceholderWithoutWindow);
136
+ const menus = await ModuleMenus.readAsync(root, folder, id, contributions.get(Resources.menusKind) ?? []);
137
+ const settings = await ModuleSettings.readAsync(root, folder, dependencies, contributions);
138
+ if (settings.pages.length > 0 && !parts.includes(Resources.windowPart))
139
+ throw fail(Resources.moduleSettingsPagesWithoutWindow);
140
+ if ((contributions.get(Resources.cliCommandsKind) ?? []).length > 0 && !parts.includes(Resources.cliPart))
141
+ throw fail(Resources.moduleCliCommandsWithoutCli);
142
+ const cliCommands = await ModuleCliCommands.readAsync(root, folder, contributions);
143
+ const webViews = await ModuleWebViews.readAsync(root, folder);
144
+ if (!Object.isNull(webViews) && !parts.includes(Resources.windowPart))
145
+ throw fail(Resources.moduleWebViewsWithoutWindow);
146
+ const usesPseudoTerminals = record.has(Resources.pseudoTerminalsField) ? record.get(Resources.pseudoTerminalsField) : false;
147
+ if (!Object.isBoolean(usesPseudoTerminals))
148
+ throw fail(Resources.modulePseudoTerminalsNotBoolean);
149
+ if (usesPseudoTerminals && !parts.includes(Resources.runtimePart))
150
+ throw fail(Resources.modulePseudoTerminalsWithoutRuntime);
151
+ const switchSetting = record.has(Resources.switchSettingField) ? ModuleDeclaration.readSwitchSetting(record.get(Resources.switchSettingField), settings.settings, fail) : null;
152
+ const platforms = record.has(Resources.platformsField) ? ModuleDeclaration.readPlatforms(record.get(Resources.platformsField), fail) : null;
153
+ const noldovaDesktop = record.has(Resources.noldovaDesktopField) ? ModuleDeclaration.readNoldovaDesktop(record.get(Resources.noldovaDesktopField), fail) : null;
154
+ return new ModuleDeclaration(folder, id, version, displayName, description, parts, dependencyVersions, optionalDependencyVersions, packageName, contributions, menus, settings, cliCommands, webViews, usesPseudoTerminals, switchSetting, platforms, noldovaDesktop, isFixture, await RootManifest.readModulePackagePrefixAsync(root));
155
+ }
156
+ get file() {
157
+ return Resources.formatFolderFile(this.folder, Resources.moduleDeclarationFileName);
158
+ }
159
+ get runtimePackage() {
160
+ return this.locatePackage(Resources.runtimePart);
161
+ }
162
+ get cliPackage() {
163
+ return this.locatePackage(Resources.cliPart);
164
+ }
165
+ get windowEntry() {
166
+ if (!this.parts.includes(Resources.windowPart))
167
+ return null;
168
+ return Object.isNull(this.packageName) ? Resources.formatFolderFile(this.folder, Resources.moduleWindowEntry) : Resources.formatPackageSubpath(this.packageName, Resources.windowPart);
169
+ }
170
+ toJson() {
171
+ return {
172
+ id: this.id,
173
+ version: this.version,
174
+ displayName: this.displayName,
175
+ description: this.description,
176
+ dependencies: Object.fromEntries(this.dependencyVersions),
177
+ ...this.optionalDependencyVersions.size === 0 ? {} : { optionalDependencies: Object.fromEntries(this.optionalDependencyVersions) },
178
+ runtimePackage: this.runtimePackage,
179
+ cliPackage: this.cliPackage,
180
+ contributes: Object.fromEntries([...this.contributions].map(([kind, names]) => [kind, [...names]])),
181
+ settings: [...this.settings],
182
+ cliCommands: [...this.cliCommands],
183
+ ...Object.isNull(this.webViews) ? {} : { webViews: this.webViews },
184
+ ...this.usesPseudoTerminals ? { pseudoTerminals: true } : {},
185
+ ...Object.isNull(this.switchSetting) ? {} : { switchSetting: this.switchSetting },
186
+ ...Object.isNull(this.platforms) ? {} : { platforms: [...this.platforms] },
187
+ ...Object.isNull(this.noldovaDesktop) ? {} : { noldovaDesktop: this.noldovaDesktop.toString() }
188
+ };
189
+ }
190
+ static readSwitchSetting(value, settings, fail) {
191
+ const setting = settings.find(t => t[Resources.nameField] === value);
192
+ if (!Object.isString(value) || Object.isUndefined(setting))
193
+ throw fail(Resources.moduleSwitchSettingUnknown);
194
+ if (JsonReader.fromValue(setting).readObject(Resources.typeField).readString(Resources.kindField) !== Resources.booleanType)
195
+ throw fail(Resources.formatModuleSwitchSettingNotBoolean(value));
196
+ const scopes = setting[Resources.scopesField];
197
+ if (setting[Resources.localityField] !== Resources.sharedLocality || !Array.isArray(scopes) || scopes.length > 0)
198
+ throw fail(Resources.formatModuleSwitchSettingNotShared(value));
199
+ return value;
200
+ }
201
+ static readPlatforms(value, fail) {
202
+ const platforms = ModuleDeclaration.readList(value, t => Resources.modulePlatforms.includes(t), fail, Resources.platformsField, Resources.modulePlatformsExpected);
203
+ if (platforms.length === 0)
204
+ throw fail(Resources.modulePlatformsEmpty);
205
+ return platforms;
206
+ }
207
+ static readNoldovaDesktop(value, fail) {
208
+ const range = Object.isString(value) ? VersionRange.parse(value) : null;
209
+ if (Object.isNull(range))
210
+ throw fail(Resources.formatModuleNoldovaDesktopInvalid(value));
211
+ return range;
212
+ }
213
+ static readVersions(value, id, fail, field, relation) {
214
+ if (!Object.isPlainObject(value))
215
+ throw fail(Resources.formatModuleVersionsNotObject(field));
216
+ const versions = new Map();
217
+ for (const [dependency, version] of Object.entries(value)) {
218
+ if (!Resources.moduleIdPattern.test(dependency) || dependency === id)
219
+ throw fail(Resources.formatModuleDependencyNotModule(relation, dependency));
220
+ if (!Object.isString(version) || !ModuleDeclaration.isVersion(version))
221
+ throw fail(Resources.formatModuleDependencyVersionInvalid(version, dependency));
222
+ versions.set(dependency, version);
223
+ }
224
+ return versions;
225
+ }
226
+ static async checkPackageAsync(root, folder, packageName, version, parts, fail) {
227
+ const manifestFile = Resources.formatFolderFile(folder, Resources.packageManifestFileName);
228
+ let manifest;
229
+ try {
230
+ manifest = JsonReader.parse(await readFile(path.join(root, folder, Resources.packageManifestFileName), Resources.textEncoding)).toJson();
231
+ }
232
+ catch (error) {
233
+ throw new BuildException(Resources.formatJsonFileUnreadable(manifestFile), new ExceptionOptions(error));
234
+ }
235
+ const record = new Map(Object.entries(manifest));
236
+ if (record.get(Resources.nameField) !== packageName)
237
+ throw new BuildException(Resources.formatModulePackageNameMismatch(manifestFile, packageName, record.get(Resources.nameField)));
238
+ if (record.get(Resources.versionField) !== version)
239
+ throw fail(Resources.formatModulePackageVersionMismatch(packageName, record.get(Resources.versionField)));
240
+ const exports = record.get(Resources.manifestExportsField);
241
+ const exported = Object.isPlainObject(exports) ? Object.keys(exports) : [];
242
+ const missing = parts.filter(t => !exported.includes(Resources.formatPackageExportPath(t)));
243
+ if (missing.length > 0)
244
+ throw fail(Resources.formatModulePartsNotExported(packageName, missing));
245
+ const undeclared = Resources.moduleParts.filter(t => !parts.includes(t) && exported.includes(Resources.formatPackageExportPath(t)));
246
+ if (undeclared.length > 0)
247
+ throw fail(Resources.formatModulePartsNotDeclared(undeclared));
248
+ }
249
+ static readList(value, isValid, fail, field, expected) {
250
+ if (!Array.isArray(value) || !value.every(t => Object.isString(t) && isValid(t)) || new Set(value).size < value.length)
251
+ throw fail(Resources.formatModuleListInvalid(field, expected));
252
+ return value.map(t => String(t));
253
+ }
254
+ static readNames(value, id, fail, kind) {
255
+ if (kind === Resources.toolsKind)
256
+ return ModuleDeclaration.readToolNames(value, id, fail);
257
+ const isOwned = (name) => name.startsWith(Resources.formatQualifiedPrefix(id)) && Resources.camelCaseNamePattern.test(name.slice(id.length + 1));
258
+ if (!Array.isArray(value) || !value.every(t => Object.isString(t) && isOwned(t)))
259
+ throw fail(Resources.formatModuleNamesInvalid(kind, id));
260
+ return value.map(t => String(t));
261
+ }
262
+ static readToolNames(value, id, fail) {
263
+ const prefixes = Resources.formatModuleToolPrefixes(id);
264
+ const isOwned = (name) => Resources.moduleToolPattern.test(name) && prefixes.some(t => name.startsWith(t) && name.length > t.length);
265
+ return ModuleDeclaration.readList(value, isOwned, fail, Resources.toolsKind, Resources.formatModuleToolNamesExpected(prefixes));
266
+ }
267
+ locatePackage(part) {
268
+ if (!this.parts.includes(part))
269
+ return null;
270
+ return Object.isNull(this.packageName) ? PackageNaming.nameModulePackage(this.id, part, this.isFixture, this.modulesPrefix) : Resources.formatPackageSubpath(this.packageName, part);
271
+ }
272
+ }
273
+ //# sourceMappingURL=module-declaration.js.map