waybetter 0.1.1 → 0.6.0

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 (515) hide show
  1. package/README.md +140 -6
  2. package/bin/waybetter.mjs +46 -0
  3. package/build/runtime.mjs +105 -0
  4. package/cli/buildenv.mjs +130 -0
  5. package/cli/dev.mjs +97 -0
  6. package/cli/i18n.mjs +382 -0
  7. package/cli/manifests.mjs +383 -0
  8. package/cli/privacy.mjs +768 -0
  9. package/cli/release.mjs +444 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +326 -0
  12. package/cli/strings.mjs +121 -0
  13. package/dist/runtime/column.d.ts +93 -0
  14. package/dist/runtime/column.js +451 -0
  15. package/dist/runtime/column.js.map +1 -0
  16. package/dist/runtime/commandReport.d.ts +19 -0
  17. package/dist/runtime/commandReport.js +47 -0
  18. package/dist/runtime/commandReport.js.map +1 -0
  19. package/dist/runtime/commands.d.ts +72 -0
  20. package/dist/runtime/commands.js +214 -0
  21. package/dist/runtime/commands.js.map +1 -0
  22. package/dist/runtime/devErrors.d.ts +16 -0
  23. package/dist/runtime/devErrors.js +30 -0
  24. package/dist/runtime/devErrors.js.map +1 -0
  25. package/dist/runtime/domHub.d.ts +21 -0
  26. package/dist/runtime/domHub.js +139 -4
  27. package/dist/runtime/domHub.js.map +1 -1
  28. package/dist/runtime/featureModules.d.ts +157 -0
  29. package/dist/runtime/featureModules.js +484 -0
  30. package/dist/runtime/featureModules.js.map +1 -0
  31. package/dist/runtime/featureTable.d.ts +144 -0
  32. package/dist/runtime/featureTable.js +223 -0
  33. package/dist/runtime/featureTable.js.map +1 -0
  34. package/dist/runtime/fonts.d.ts +22 -0
  35. package/dist/runtime/fonts.js +72 -0
  36. package/dist/runtime/fonts.js.map +1 -0
  37. package/dist/runtime/i18n.d.ts +138 -0
  38. package/dist/runtime/i18n.js +614 -0
  39. package/dist/runtime/i18n.js.map +1 -0
  40. package/dist/runtime/i18nCheck.d.ts +30 -0
  41. package/dist/runtime/i18nCheck.js +224 -0
  42. package/dist/runtime/i18nCheck.js.map +1 -0
  43. package/dist/runtime/pageLang.d.ts +8 -0
  44. package/dist/runtime/pageLang.js +64 -0
  45. package/dist/runtime/pageLang.js.map +1 -0
  46. package/dist/runtime/pageStrings.d.ts +35 -0
  47. package/dist/runtime/pageStrings.js +76 -0
  48. package/dist/runtime/pageStrings.js.map +1 -0
  49. package/dist/runtime/panelButton.d.ts +33 -0
  50. package/dist/runtime/panelButton.js +83 -0
  51. package/dist/runtime/panelButton.js.map +1 -0
  52. package/dist/runtime/permissions.d.ts +47 -0
  53. package/dist/runtime/permissions.js +141 -0
  54. package/dist/runtime/permissions.js.map +1 -0
  55. package/dist/runtime/pluginApi.d.ts +51 -2
  56. package/dist/runtime/pluginApi.js +137 -22
  57. package/dist/runtime/pluginApi.js.map +1 -1
  58. package/dist/runtime/pluginI18n.d.ts +29 -0
  59. package/dist/runtime/pluginI18n.js +119 -0
  60. package/dist/runtime/pluginI18n.js.map +1 -0
  61. package/dist/runtime/settingsForm.d.ts +66 -0
  62. package/dist/runtime/settingsForm.js +114 -0
  63. package/dist/runtime/settingsForm.js.map +1 -0
  64. package/dist/runtime/site.d.ts +5 -0
  65. package/dist/runtime/site.js +1 -1
  66. package/dist/runtime/site.js.map +1 -1
  67. package/dist/runtime/siteRuntime.d.ts +144 -0
  68. package/dist/runtime/siteRuntime.js +175 -0
  69. package/dist/runtime/siteRuntime.js.map +1 -0
  70. package/dist/runtime/stringPackHook.d.ts +84 -0
  71. package/dist/runtime/stringPackHook.js +220 -0
  72. package/dist/runtime/stringPackHook.js.map +1 -0
  73. package/dist/runtime/stringPackTranslate.d.ts +59 -0
  74. package/dist/runtime/stringPackTranslate.js +264 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +200 -0
  77. package/dist/runtime/stringPacks.js +474 -0
  78. package/dist/runtime/stringPacks.js.map +1 -0
  79. package/dist/runtime/styles.d.ts +15 -0
  80. package/dist/runtime/styles.js +81 -0
  81. package/dist/runtime/styles.js.map +1 -0
  82. package/dist/runtime/textNet.d.ts +15 -0
  83. package/dist/runtime/textNet.js +131 -0
  84. package/dist/runtime/textNet.js.map +1 -0
  85. package/dist/runtime/themeApi.d.ts +121 -0
  86. package/dist/runtime/themeApi.js +220 -0
  87. package/dist/runtime/themeApi.js.map +1 -0
  88. package/dist/runtime/themeChoice.d.ts +52 -0
  89. package/dist/runtime/themeChoice.js +69 -0
  90. package/dist/runtime/themeChoice.js.map +1 -0
  91. package/dist/runtime/themeComponents.d.ts +435 -0
  92. package/dist/runtime/themeComponents.js +463 -0
  93. package/dist/runtime/themeComponents.js.map +1 -0
  94. package/dist/runtime/themeDecor.d.ts +73 -0
  95. package/dist/runtime/themeDecor.js +131 -0
  96. package/dist/runtime/themeDecor.js.map +1 -0
  97. package/dist/runtime/themeDoctor.d.ts +11 -0
  98. package/dist/runtime/themeDoctor.js +51 -0
  99. package/dist/runtime/themeDoctor.js.map +1 -0
  100. package/dist/runtime/themeIcons.d.ts +130 -0
  101. package/dist/runtime/themeIcons.js +263 -0
  102. package/dist/runtime/themeIcons.js.map +1 -0
  103. package/dist/runtime/themeRuntime.d.ts +100 -0
  104. package/dist/runtime/themeRuntime.js +497 -0
  105. package/dist/runtime/themeRuntime.js.map +1 -0
  106. package/dist/runtime/themeSchema.d.ts +10 -0
  107. package/dist/runtime/themeSchema.js +150 -0
  108. package/dist/runtime/themeSchema.js.map +1 -0
  109. package/dist/runtime/themeSpec.d.ts +259 -0
  110. package/dist/runtime/themeSpec.js +439 -0
  111. package/dist/runtime/themeSpec.js.map +1 -0
  112. package/dist/runtime/themeTokens.d.ts +12 -0
  113. package/dist/runtime/themeTokens.js +14 -6
  114. package/dist/runtime/themeTokens.js.map +1 -1
  115. package/dist/runtime/themeVariants.d.ts +30 -0
  116. package/dist/runtime/themeVariants.js +53 -0
  117. package/dist/runtime/themeVariants.js.map +1 -0
  118. package/dist/runtime/ui.d.ts +192 -0
  119. package/dist/runtime/ui.js +926 -0
  120. package/dist/runtime/ui.js.map +1 -0
  121. package/dist/shell/InstallDialog.d.ts +40 -0
  122. package/dist/shell/InstallDialog.js +170 -0
  123. package/dist/shell/InstallDialog.js.map +1 -0
  124. package/dist/shell/StoreView.d.ts +66 -0
  125. package/dist/shell/StoreView.js +103 -0
  126. package/dist/shell/StoreView.js.map +1 -0
  127. package/dist/shell/addressModel.js.map +1 -1
  128. package/dist/shell/chrome.js.map +1 -1
  129. package/dist/shell/deckModel.d.ts +117 -0
  130. package/dist/shell/deckModel.js +267 -0
  131. package/dist/shell/deckModel.js.map +1 -0
  132. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  133. package/dist/shell/frame/AccountSwitcher.js +243 -0
  134. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  135. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  136. package/dist/shell/frame/AddColumnDialog.js +81 -0
  137. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  138. package/dist/shell/frame/AppMenu.d.ts +21 -0
  139. package/dist/shell/frame/AppMenu.js +642 -0
  140. package/dist/shell/frame/AppMenu.js.map +1 -0
  141. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  142. package/dist/shell/frame/CommandPalette.js +118 -0
  143. package/dist/shell/frame/CommandPalette.js.map +1 -0
  144. package/dist/shell/frame/DeckView.d.ts +13 -0
  145. package/dist/shell/frame/DeckView.js +287 -0
  146. package/dist/shell/frame/DeckView.js.map +1 -0
  147. package/dist/shell/frame/FindBar.d.ts +10 -0
  148. package/dist/shell/frame/FindBar.js +108 -0
  149. package/dist/shell/frame/FindBar.js.map +1 -0
  150. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  151. package/dist/shell/frame/MediaPanel.js +76 -0
  152. package/dist/shell/frame/MediaPanel.js.map +1 -0
  153. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  154. package/dist/shell/frame/NewTabPage.js +71 -0
  155. package/dist/shell/frame/NewTabPage.js.map +1 -0
  156. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  157. package/dist/shell/frame/PaneTheme.js +67 -0
  158. package/dist/shell/frame/PaneTheme.js.map +1 -0
  159. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  160. package/dist/shell/frame/ReportDialog.js +95 -0
  161. package/dist/shell/frame/ReportDialog.js.map +1 -0
  162. package/dist/shell/frame/Shell.d.ts +8 -0
  163. package/dist/shell/frame/Shell.js +1131 -0
  164. package/dist/shell/frame/Shell.js.map +1 -0
  165. package/dist/shell/frame/Titlebar.d.ts +16 -0
  166. package/dist/shell/frame/Titlebar.js +77 -0
  167. package/dist/shell/frame/Titlebar.js.map +1 -0
  168. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  169. package/dist/shell/frame/TitlebarExtras.js +202 -0
  170. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  171. package/dist/shell/frame/WebPanel.d.ts +4 -0
  172. package/dist/shell/frame/WebPanel.js +182 -0
  173. package/dist/shell/frame/WebPanel.js.map +1 -0
  174. package/dist/shell/frame/accountModel.d.ts +49 -0
  175. package/dist/shell/frame/accountModel.js +67 -0
  176. package/dist/shell/frame/accountModel.js.map +1 -0
  177. package/dist/shell/frame/accountSwitcher.css +91 -0
  178. package/dist/shell/frame/appI18n.d.ts +44 -0
  179. package/dist/shell/frame/appI18n.js +64 -0
  180. package/dist/shell/frame/appI18n.js.map +1 -0
  181. package/dist/shell/frame/appMenu.css +121 -0
  182. package/dist/shell/frame/backupModel.d.ts +38 -0
  183. package/dist/shell/frame/backupModel.js +192 -0
  184. package/dist/shell/frame/backupModel.js.map +1 -0
  185. package/dist/shell/frame/boot.d.ts +8 -0
  186. package/dist/shell/frame/boot.js +35 -0
  187. package/dist/shell/frame/boot.js.map +1 -0
  188. package/dist/shell/frame/brand.d.ts +1 -0
  189. package/dist/shell/frame/brand.js +4 -0
  190. package/dist/shell/frame/brand.js.map +1 -0
  191. package/dist/shell/frame/bridge.d.ts +35 -0
  192. package/dist/shell/frame/bridge.js +70 -0
  193. package/dist/shell/frame/bridge.js.map +1 -0
  194. package/dist/shell/frame/chromeTheme.d.ts +29 -0
  195. package/dist/shell/frame/chromeTheme.js +81 -0
  196. package/dist/shell/frame/chromeTheme.js.map +1 -0
  197. package/dist/shell/frame/deck.css +209 -0
  198. package/dist/shell/frame/deckStore.d.ts +89 -0
  199. package/dist/shell/frame/deckStore.js +239 -0
  200. package/dist/shell/frame/deckStore.js.map +1 -0
  201. package/dist/shell/frame/devHost.d.ts +35 -0
  202. package/dist/shell/frame/devHost.js +80 -0
  203. package/dist/shell/frame/devHost.js.map +1 -0
  204. package/dist/shell/frame/devModel.d.ts +7 -0
  205. package/dist/shell/frame/devModel.js +17 -0
  206. package/dist/shell/frame/devModel.js.map +1 -0
  207. package/dist/shell/frame/diag.d.ts +7 -0
  208. package/dist/shell/frame/diag.js +39 -0
  209. package/dist/shell/frame/diag.js.map +1 -0
  210. package/dist/shell/frame/findBar.css +14 -0
  211. package/dist/shell/frame/frameMessages.d.ts +248 -0
  212. package/dist/shell/frame/frameMessages.js +252 -0
  213. package/dist/shell/frame/frameMessages.js.map +1 -0
  214. package/dist/shell/frame/hooks.d.ts +39 -0
  215. package/dist/shell/frame/hooks.js +97 -0
  216. package/dist/shell/frame/hooks.js.map +1 -0
  217. package/dist/shell/frame/i18n.d.ts +27 -0
  218. package/dist/shell/frame/i18n.js +66 -0
  219. package/dist/shell/frame/i18n.js.map +1 -0
  220. package/dist/shell/frame/iconPack.d.ts +11 -0
  221. package/dist/shell/frame/iconPack.js +45 -0
  222. package/dist/shell/frame/iconPack.js.map +1 -0
  223. package/dist/shell/frame/icons.d.ts +71 -0
  224. package/dist/shell/frame/icons.js +75 -0
  225. package/dist/shell/frame/icons.js.map +1 -0
  226. package/dist/shell/frame/index.d.ts +34 -0
  227. package/dist/shell/frame/index.js +43 -0
  228. package/dist/shell/frame/index.js.map +1 -0
  229. package/dist/shell/frame/language.d.ts +58 -0
  230. package/dist/shell/frame/language.js +165 -0
  231. package/dist/shell/frame/language.js.map +1 -0
  232. package/dist/shell/frame/mediaModel.d.ts +34 -0
  233. package/dist/shell/frame/mediaModel.js +53 -0
  234. package/dist/shell/frame/mediaModel.js.map +1 -0
  235. package/dist/shell/frame/menuMessages.en.json +54 -0
  236. package/dist/shell/frame/menuModel.d.ts +277 -0
  237. package/dist/shell/frame/menuModel.js +293 -0
  238. package/dist/shell/frame/menuModel.js.map +1 -0
  239. package/dist/shell/frame/paletteModel.d.ts +139 -0
  240. package/dist/shell/frame/paletteModel.js +112 -0
  241. package/dist/shell/frame/paletteModel.js.map +1 -0
  242. package/dist/shell/frame/paneTheme.css +9 -0
  243. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  244. package/dist/shell/frame/pluginCommandStore.js +70 -0
  245. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  246. package/dist/shell/frame/reportModel.d.ts +52 -0
  247. package/dist/shell/frame/reportModel.js +105 -0
  248. package/dist/shell/frame/reportModel.js.map +1 -0
  249. package/dist/shell/frame/safeStore.d.ts +7 -0
  250. package/dist/shell/frame/safeStore.js +40 -0
  251. package/dist/shell/frame/safeStore.js.map +1 -0
  252. package/dist/shell/frame/searchInput.d.ts +2 -0
  253. package/dist/shell/frame/searchInput.js +11 -0
  254. package/dist/shell/frame/searchInput.js.map +1 -0
  255. package/dist/shell/frame/shell.css +629 -0
  256. package/dist/shell/frame/site.d.ts +206 -0
  257. package/dist/shell/frame/site.js +22 -0
  258. package/dist/shell/frame/site.js.map +1 -0
  259. package/dist/shell/frame/state.d.ts +99 -0
  260. package/dist/shell/frame/state.js +284 -0
  261. package/dist/shell/frame/state.js.map +1 -0
  262. package/dist/shell/frame/syncGate.d.ts +10 -0
  263. package/dist/shell/frame/syncGate.js +36 -0
  264. package/dist/shell/frame/syncGate.js.map +1 -0
  265. package/dist/shell/frame/syncHost.d.ts +35 -0
  266. package/dist/shell/frame/syncHost.js +85 -0
  267. package/dist/shell/frame/syncHost.js.map +1 -0
  268. package/dist/shell/frame/tabStill.d.ts +2 -0
  269. package/dist/shell/frame/tabStill.js +62 -0
  270. package/dist/shell/frame/tabStill.js.map +1 -0
  271. package/dist/shell/frame/themeScopes.d.ts +29 -0
  272. package/dist/shell/frame/themeScopes.js +61 -0
  273. package/dist/shell/frame/themeScopes.js.map +1 -0
  274. package/dist/shell/frame/themeStore.d.ts +99 -0
  275. package/dist/shell/frame/themeStore.js +252 -0
  276. package/dist/shell/frame/themeStore.js.map +1 -0
  277. package/dist/shell/frame/windowBinding.d.ts +2 -0
  278. package/dist/shell/frame/windowBinding.js +7 -0
  279. package/dist/shell/frame/windowBinding.js.map +1 -0
  280. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  281. package/dist/shell/frame/workspaceModel.js +250 -0
  282. package/dist/shell/frame/workspaceModel.js.map +1 -0
  283. package/dist/shell/frame/workspaces.css +84 -0
  284. package/dist/shell/frame/workspaces.d.ts +22 -0
  285. package/dist/shell/frame/workspaces.js +125 -0
  286. package/dist/shell/frame/workspaces.js.map +1 -0
  287. package/dist/shell/frame/zoomStore.d.ts +10 -0
  288. package/dist/shell/frame/zoomStore.js +65 -0
  289. package/dist/shell/frame/zoomStore.js.map +1 -0
  290. package/dist/shell/installController.d.ts +122 -0
  291. package/dist/shell/installController.js +146 -0
  292. package/dist/shell/installController.js.map +1 -0
  293. package/dist/shell/installerMessages.d.ts +30 -0
  294. package/dist/shell/installerMessages.js +36 -0
  295. package/dist/shell/installerMessages.js.map +1 -0
  296. package/dist/shell/linkDrop.js.map +1 -1
  297. package/dist/shell/messages.d.ts +16 -0
  298. package/dist/shell/messages.js +27 -0
  299. package/dist/shell/messages.js.map +1 -0
  300. package/dist/shell/palette.js.map +1 -1
  301. package/dist/shell/paneModel.d.ts +22 -0
  302. package/dist/shell/paneModel.js +24 -1
  303. package/dist/shell/paneModel.js.map +1 -1
  304. package/dist/shell/panel/Appearance.d.ts +8 -0
  305. package/dist/shell/panel/Appearance.js +256 -0
  306. package/dist/shell/panel/Appearance.js.map +1 -0
  307. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  308. package/dist/shell/panel/BackupPanel.js +198 -0
  309. package/dist/shell/panel/BackupPanel.js.map +1 -0
  310. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  311. package/dist/shell/panel/DeveloperPanel.js +51 -0
  312. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  313. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  314. package/dist/shell/panel/FeatureToggles.js +42 -0
  315. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  316. package/dist/shell/panel/Home.d.ts +3 -0
  317. package/dist/shell/panel/Home.js +23 -0
  318. package/dist/shell/panel/Home.js.map +1 -0
  319. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  320. package/dist/shell/panel/IconPackInstall.js +41 -0
  321. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  322. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  323. package/dist/shell/panel/LanguageSettings.js +54 -0
  324. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  325. package/dist/shell/panel/MakePanel.d.ts +3 -0
  326. package/dist/shell/panel/MakePanel.js +237 -0
  327. package/dist/shell/panel/MakePanel.js.map +1 -0
  328. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  329. package/dist/shell/panel/MarkdownDoc.js +35 -0
  330. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  331. package/dist/shell/panel/Modes.d.ts +40 -0
  332. package/dist/shell/panel/Modes.js +270 -0
  333. package/dist/shell/panel/Modes.js.map +1 -0
  334. package/dist/shell/panel/NavIcon.d.ts +4 -0
  335. package/dist/shell/panel/NavIcon.js +6 -0
  336. package/dist/shell/panel/NavIcon.js.map +1 -0
  337. package/dist/shell/panel/Panel.d.ts +7 -0
  338. package/dist/shell/panel/Panel.js +139 -0
  339. package/dist/shell/panel/Panel.js.map +1 -0
  340. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  341. package/dist/shell/panel/PluginFeatures.js +165 -0
  342. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  343. package/dist/shell/panel/Plugins.d.ts +33 -0
  344. package/dist/shell/panel/Plugins.js +112 -0
  345. package/dist/shell/panel/Plugins.js.map +1 -0
  346. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  347. package/dist/shell/panel/PowerSettings.js +52 -0
  348. package/dist/shell/panel/PowerSettings.js.map +1 -0
  349. package/dist/shell/panel/Settings.d.ts +23 -0
  350. package/dist/shell/panel/Settings.js +116 -0
  351. package/dist/shell/panel/Settings.js.map +1 -0
  352. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  353. package/dist/shell/panel/ShareSetup.js +130 -0
  354. package/dist/shell/panel/ShareSetup.js.map +1 -0
  355. package/dist/shell/panel/StoreSection.d.ts +6 -0
  356. package/dist/shell/panel/StoreSection.js +48 -0
  357. package/dist/shell/panel/StoreSection.js.map +1 -0
  358. package/dist/shell/panel/StringPacks.d.ts +11 -0
  359. package/dist/shell/panel/StringPacks.js +106 -0
  360. package/dist/shell/panel/StringPacks.js.map +1 -0
  361. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  362. package/dist/shell/panel/ThemeBuilder.js +205 -0
  363. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  364. package/dist/shell/panel/backup.css +34 -0
  365. package/dist/shell/panel/builder.css +232 -0
  366. package/dist/shell/panel/builderModel.d.ts +55 -0
  367. package/dist/shell/panel/builderModel.js +95 -0
  368. package/dist/shell/panel/builderModel.js.map +1 -0
  369. package/dist/shell/panel/compare.d.ts +10 -0
  370. package/dist/shell/panel/compare.js +51 -0
  371. package/dist/shell/panel/compare.js.map +1 -0
  372. package/dist/shell/panel/controls.d.ts +135 -0
  373. package/dist/shell/panel/controls.js +213 -0
  374. package/dist/shell/panel/controls.js.map +1 -0
  375. package/dist/shell/panel/featureModel.d.ts +69 -0
  376. package/dist/shell/panel/featureModel.js +79 -0
  377. package/dist/shell/panel/featureModel.js.map +1 -0
  378. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  379. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  380. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  381. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  382. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  383. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  384. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  385. package/dist/shell/panel/fonts/catalog.js +68 -0
  386. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  387. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  388. package/dist/shell/panel/index.d.ts +20 -0
  389. package/dist/shell/panel/index.js +34 -0
  390. package/dist/shell/panel/index.js.map +1 -0
  391. package/dist/shell/panel/languageModel.d.ts +5 -0
  392. package/dist/shell/panel/languageModel.js +7 -0
  393. package/dist/shell/panel/languageModel.js.map +1 -0
  394. package/dist/shell/panel/make.css +72 -0
  395. package/dist/shell/panel/makeModel.d.ts +32 -0
  396. package/dist/shell/panel/makeModel.js +84 -0
  397. package/dist/shell/panel/makeModel.js.map +1 -0
  398. package/dist/shell/panel/markdown.d.ts +46 -0
  399. package/dist/shell/panel/markdown.js +100 -0
  400. package/dist/shell/panel/markdown.js.map +1 -0
  401. package/dist/shell/panel/nav.d.ts +12 -0
  402. package/dist/shell/panel/nav.js +50 -0
  403. package/dist/shell/panel/nav.js.map +1 -0
  404. package/dist/shell/panel/panel.css +401 -0
  405. package/dist/shell/panel/panelMessages.d.ts +763 -0
  406. package/dist/shell/panel/panelMessages.js +767 -0
  407. package/dist/shell/panel/panelMessages.js.map +1 -0
  408. package/dist/shell/panel/plugins.css +59 -0
  409. package/dist/shell/panel/setupModel.d.ts +87 -0
  410. package/dist/shell/panel/setupModel.js +152 -0
  411. package/dist/shell/panel/setupModel.js.map +1 -0
  412. package/dist/shell/panel/site.d.ts +259 -0
  413. package/dist/shell/panel/site.js +25 -0
  414. package/dist/shell/panel/site.js.map +1 -0
  415. package/dist/shell/panel/strings.css +7 -0
  416. package/dist/shell/panel/themes.d.ts +10 -0
  417. package/dist/shell/panel/themes.js +8 -0
  418. package/dist/shell/panel/themes.js.map +1 -0
  419. package/dist/shell/profileModel.d.ts +3 -2
  420. package/dist/shell/profileModel.js +7 -5
  421. package/dist/shell/profileModel.js.map +1 -1
  422. package/dist/shell/store.css +230 -0
  423. package/dist/shell/storeMessages.d.ts +169 -0
  424. package/dist/shell/storeMessages.js +172 -0
  425. package/dist/shell/storeMessages.js.map +1 -0
  426. package/dist/shell/storeModel.d.ts +181 -0
  427. package/dist/shell/storeModel.js +133 -0
  428. package/dist/shell/storeModel.js.map +1 -0
  429. package/dist/shell/stringPacksModel.d.ts +44 -0
  430. package/dist/shell/stringPacksModel.js +94 -0
  431. package/dist/shell/stringPacksModel.js.map +1 -0
  432. package/dist/shell/updateModel.d.ts +2 -1
  433. package/dist/shell/updateModel.js +5 -4
  434. package/dist/shell/updateModel.js.map +1 -1
  435. package/dist/shell/windowControls.d.ts +4 -0
  436. package/dist/shell/windowControls.js +5 -0
  437. package/dist/shell/windowControls.js.map +1 -1
  438. package/i18n-config.schema.json +29 -0
  439. package/i18n-meta.schema.json +26 -0
  440. package/i18n.schema.json +42 -0
  441. package/icons.schema.json +646 -0
  442. package/languages.schema.json +23 -0
  443. package/locales/ar-x-fm.json +11 -0
  444. package/locales/ar.json +1281 -0
  445. package/locales/bg.json +1280 -0
  446. package/locales/bn.json +1280 -0
  447. package/locales/ca.json +1280 -0
  448. package/locales/cs.json +1280 -0
  449. package/locales/da.json +1280 -0
  450. package/locales/de.json +1280 -0
  451. package/locales/el.json +1280 -0
  452. package/locales/en-GB.json +27 -0
  453. package/locales/en.json +1280 -0
  454. package/locales/en.meta.json +51 -0
  455. package/locales/es.json +1280 -0
  456. package/locales/eu.json +1280 -0
  457. package/locales/fa.json +1281 -0
  458. package/locales/fi.json +1280 -0
  459. package/locales/fil.json +1280 -0
  460. package/locales/fr.json +1280 -0
  461. package/locales/ga.json +1280 -0
  462. package/locales/gl.json +1280 -0
  463. package/locales/gu.json +1280 -0
  464. package/locales/ha.json +1280 -0
  465. package/locales/he.json +1281 -0
  466. package/locales/hi.json +1280 -0
  467. package/locales/hr.json +1280 -0
  468. package/locales/hu.json +1279 -0
  469. package/locales/id.json +1280 -0
  470. package/locales/ig.json +1280 -0
  471. package/locales/it.json +1280 -0
  472. package/locales/ja.json +1280 -0
  473. package/locales/kn.json +1280 -0
  474. package/locales/ko.json +1280 -0
  475. package/locales/mr.json +1280 -0
  476. package/locales/ms.json +1280 -0
  477. package/locales/nb.json +1280 -0
  478. package/locales/nl.json +1280 -0
  479. package/locales/pl.json +1280 -0
  480. package/locales/pt.json +1280 -0
  481. package/locales/ro.json +1280 -0
  482. package/locales/ru.json +1280 -0
  483. package/locales/sk.json +1280 -0
  484. package/locales/sr.json +1280 -0
  485. package/locales/sv.json +1280 -0
  486. package/locales/ta.json +1280 -0
  487. package/locales/th.json +1280 -0
  488. package/locales/tr.json +1280 -0
  489. package/locales/uk.json +1280 -0
  490. package/locales/ur.json +1281 -0
  491. package/locales/vi.json +1280 -0
  492. package/locales/yo.json +1280 -0
  493. package/locales/zh-Hans.json +1280 -0
  494. package/locales/zh-Hant.json +1280 -0
  495. package/package.json +139 -5
  496. package/store-catalog.schema.json +65 -0
  497. package/theme.schema.json +4659 -0
  498. package/windows/installer.nsi +926 -0
  499. package/windows/languages/Basque.nsh +28 -0
  500. package/windows/languages/Catalan.nsh +28 -0
  501. package/windows/languages/Croatian.nsh +28 -0
  502. package/windows/languages/Czech.nsh +28 -0
  503. package/windows/languages/Danish.nsh +28 -0
  504. package/windows/languages/Finnish.nsh +28 -0
  505. package/windows/languages/Galician.nsh +28 -0
  506. package/windows/languages/Greek.nsh +28 -0
  507. package/windows/languages/Hungarian.nsh +28 -0
  508. package/windows/languages/Indonesian.nsh +28 -0
  509. package/windows/languages/Irish.nsh +28 -0
  510. package/windows/languages/Malay.nsh +28 -0
  511. package/windows/languages/Polish.nsh +28 -0
  512. package/windows/languages/Romanian.nsh +28 -0
  513. package/windows/languages/Serbian.nsh +28 -0
  514. package/windows/languages/Slovak.nsh +28 -0
  515. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1,383 @@
1
+ // `waybetter manifests <file.json>`: distribution manifests for any app from one small JSON
2
+ // description: a winget manifest set, a Chocolatey package, a Homebrew cask for the publisher's
3
+ // OWN tap and an AUR package (PKGBUILD + .SRCINFO). Generic: nothing here knows wayBetter. Nothing
4
+ // is submitted anywhere and no account is needed; the files are what the owner submits or pushes
5
+ // (see the app's docs/DISTRIBUTION.md).
6
+ //
7
+ // The description (JSON):
8
+ //
9
+ // {
10
+ // "publisher": "CRT", // winget/choco publisher
11
+ // "id": "CRT.WayBetterForX", // winget PackageIdentifier: Publisher.Package[.Sub]
12
+ // "name": "wayBetter for X", // display name
13
+ // "slug": "waybetter-for-x", // optional lower-case name for choco/brew/aur (derived from name)
14
+ // "version": "1.0.0",
15
+ // "shortDescription": "...", "description": "...", // description optional (defaults to short)
16
+ // "homepage": "https://...", "license": "GPL-3.0-or-later", "licenseUrl": "https://...", // licenseUrl optional
17
+ // "releaseNotesUrl": "https://...", "tags": ["a", "b"], "copyright": "...",
18
+ // "windows": { "url": "https://.../setup.exe", "sha256": "<64 hex>", "silentSwitches": "/S",
19
+ // "scope": "user", "architecture": "x64" },
20
+ // "macos": { "url": "https://.../app.dmg", "sha256": "...", "app": "wayBetter for X.app", "zap": ["~/Library/..."] },
21
+ // "linux": { "deb": { "url": "...", "sha256": "..." }, "appImage": { "url": "...", "sha256": "..." },
22
+ // "depends": ["webkit2gtk-4.1", "gtk3"] }
23
+ // }
24
+ //
25
+ // An installer may give `"file": "<local path>"` instead of `sha256` (hashed here) and, with
26
+ // `--download-base <url>` (or "downloadBase" in the description), instead of `url` too
27
+ // (<base>/<file name>). Unknown URLs are inputs, never guessed. A platform section that is absent
28
+ // skips the channels that need it.
29
+ //
30
+ // waybetter manifests <file.json> [--out <dir>] [--download-base <url>] [--only winget,chocolatey,homebrew,aur]
31
+ import { createHash } from 'node:crypto';
32
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
33
+ import { basename, dirname, join, resolve } from 'node:path';
34
+
35
+ export const MANIFESTS_USAGE = `Usage:
36
+ waybetter manifests <file.json> [--out <dir>] [--download-base <url>] [--only winget,chocolatey,homebrew,aur]
37
+ Writes distribution manifests from a small JSON description (publisher, id, name, version,
38
+ installer URLs + sha256 or local files, silent switches, licence, homepage): a winget manifest
39
+ set (schema 1.28.0), a Chocolatey package, a Homebrew cask for your own tap and an AUR
40
+ PKGBUILD + .SRCINFO. Submits nothing.`;
41
+
42
+ export const WINGET_MANIFEST_VERSION = '1.28.0';
43
+ export const CHANNELS = ['winget', 'chocolatey', 'homebrew', 'aur'];
44
+
45
+ class ManifestError extends Error {}
46
+ const fail = message => { throw new ManifestError(message); };
47
+
48
+ const HTTPS = /^https:\/\/[^\s"'<>]+$/;
49
+ const SHA256 = /^[0-9a-fA-F]{64}$/;
50
+ const VERSION = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
51
+ const WINGET_ID = /^[^.\s\\/:*?"<>|\x01-\x1f]{1,32}(\.[^.\s\\/:*?"<>|\x01-\x1f]{1,32}){1,7}$/;
52
+ const SLUG = /^[a-z0-9][a-z0-9-]*$/;
53
+
54
+ export const slugOf = name => name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
55
+ const sha256File = file => createHash('sha256').update(readFileSync(file)).digest('hex');
56
+
57
+ /** Resolves `file` installers (hash, URL from the download base) and validates the description. */
58
+ export function resolveSpec(raw, { baseDir = process.cwd(), downloadBase } = {}) {
59
+ const spec = structuredClone(raw);
60
+ const text = (key, { optional = false } = {}) => {
61
+ const value = spec[key];
62
+ if (value === undefined && optional) return undefined;
63
+ if (typeof value !== 'string' || !value.trim()) fail(`"${key}" must be a non-empty string`);
64
+ return value.trim();
65
+ };
66
+ spec.publisher = text('publisher');
67
+ spec.id = text('id');
68
+ if (!WINGET_ID.test(spec.id)) fail('"id" must look like Publisher.Package (no spaces, at most 32 characters a part)');
69
+ spec.name = text('name');
70
+ spec.slug = text('slug', { optional: true }) ?? slugOf(spec.name);
71
+ if (!SLUG.test(spec.slug)) fail('"slug" must be lower-case letters, digits and hyphens');
72
+ spec.version = text('version');
73
+ if (!VERSION.test(spec.version)) fail(`"version" must be like 1.2.3, not ${spec.version}`);
74
+ spec.shortDescription = text('shortDescription');
75
+ spec.description = text('description', { optional: true }) ?? spec.shortDescription;
76
+ spec.homepage = text('homepage');
77
+ if (!HTTPS.test(spec.homepage)) fail('"homepage" must be an https URL');
78
+ spec.license = text('license');
79
+ spec.licenseUrl = text('licenseUrl', { optional: true }) ?? (/^[A-Za-z0-9.+-]+$/.test(spec.license) ? `https://spdx.org/licenses/${spec.license}.html` : undefined);
80
+ for (const key of ['releaseNotesUrl']) if (spec[key] !== undefined && !HTTPS.test(spec[key])) fail(`"${key}" must be an https URL`);
81
+ spec.tags = (spec.tags ?? []).map(String);
82
+
83
+ const base = (downloadBase ?? spec.downloadBase)?.replace(/\/+$/, '');
84
+ const installer = (where, entry) => {
85
+ if (!entry || typeof entry !== 'object') fail(`"${where}" must be an object`);
86
+ const file = entry.file && resolve(baseDir, entry.file);
87
+ if (file && !existsSync(file)) fail(`${where}: file not found: ${entry.file}`);
88
+ entry.sha256 = (entry.sha256 ?? (file && sha256File(file)))?.toLowerCase();
89
+ entry.url ??= file && base ? `${base}/${basename(file)}` : undefined;
90
+ if (!entry.url) fail(`${where}: needs "url" (or "file" with --download-base)`);
91
+ if (!HTTPS.test(entry.url)) fail(`${where}: url must be an https URL`);
92
+ if (!SHA256.test(entry.sha256 ?? '')) fail(`${where}: needs a 64-digit "sha256" (or "file" to hash)`);
93
+ return entry;
94
+ };
95
+ if (spec.windows) {
96
+ installer('windows', spec.windows);
97
+ spec.windows.architecture ??= 'x64';
98
+ if (!['x86', 'x64', 'arm', 'arm64', 'neutral'].includes(spec.windows.architecture)) fail('windows.architecture must be x86, x64, arm, arm64 or neutral');
99
+ spec.windows.scope ??= 'user';
100
+ if (!['user', 'machine'].includes(spec.windows.scope)) fail('windows.scope must be user or machine');
101
+ spec.windows.silentSwitches ??= '/S';
102
+ spec.windows.installerType ??= 'nullsoft';
103
+ if (!['nullsoft', 'inno', 'exe', 'msi', 'wix', 'burn'].includes(spec.windows.installerType)) fail('windows.installerType is not a winget installer type');
104
+ }
105
+ if (spec.macos) {
106
+ installer('macos', spec.macos);
107
+ spec.macos.app = spec.macos.app ? String(spec.macos.app) : `${spec.name}.app`;
108
+ if (!spec.macos.app.endsWith('.app') || /[/"\\]/.test(spec.macos.app)) fail('macos.app must be a bundle name like "Name.app"');
109
+ spec.macos.zap = (spec.macos.zap ?? []).map(String);
110
+ }
111
+ if (spec.linux) {
112
+ if (!spec.linux.deb && !spec.linux.appImage) fail('linux needs "deb" and/or "appImage"');
113
+ for (const kind of ['deb', 'appImage']) if (spec.linux[kind]) installer(`linux.${kind}`, spec.linux[kind]);
114
+ spec.linux.depends = (spec.linux.depends ?? ['webkit2gtk-4.1', 'gtk3']).map(String);
115
+ }
116
+ if (!spec.windows && !spec.macos && !spec.linux) fail('give at least one of "windows", "macos", "linux"');
117
+ return spec;
118
+ }
119
+
120
+ // ---- YAML (only the shapes winget needs: maps, lists, strings, numbers) ----
121
+
122
+ const plain = /^[A-Za-z0-9_][A-Za-z0-9_./ -]*$/;
123
+ function scalar(value) {
124
+ if (typeof value === 'number' || typeof value === 'boolean') return String(value);
125
+ const text = String(value);
126
+ // Quote anything YAML could read as something else (numbers, booleans, null, "a: b", "- x", "#").
127
+ if (plain.test(text) && !/^(true|false|null|yes|no|on|off|~|[-+]?[0-9.]+(e[0-9]+)?)$/i.test(text) && !/ $|: | #/.test(text) && !text.includes('- ') ) return text;
128
+ return JSON.stringify(text);
129
+ }
130
+ export function toYaml(value, indent = 0) {
131
+ const pad = ' '.repeat(indent);
132
+ const lines = [];
133
+ for (const [key, item] of Object.entries(value)) {
134
+ if (item === undefined || item === null) continue;
135
+ if (Array.isArray(item)) {
136
+ if (!item.length) continue;
137
+ lines.push(`${pad}${key}:`);
138
+ for (const entry of item) {
139
+ if (entry && typeof entry === 'object') {
140
+ const inner = toYaml(entry, indent + 2).split('\n');
141
+ lines.push(`${pad}- ${inner[0].trimStart()}`, ...inner.slice(1));
142
+ } else lines.push(`${pad}- ${scalar(entry)}`);
143
+ }
144
+ } else if (typeof item === 'object') {
145
+ lines.push(`${pad}${key}:`, toYaml(item, indent + 2));
146
+ } else if (typeof item === 'string' && item.includes('\n')) {
147
+ lines.push(`${pad}${key}: |-`, ...item.split('\n').map(line => `${pad} ${line}`));
148
+ } else lines.push(`${pad}${key}: ${scalar(item)}`);
149
+ }
150
+ return lines.join('\n');
151
+ }
152
+
153
+ // ---- winget ----
154
+
155
+ const WINGET_LOCALE = 'en-US';
156
+
157
+ export function wingetManifests(spec) {
158
+ if (!spec.windows) return undefined;
159
+ const w = spec.windows;
160
+ const header = name => `# Created by waybetter manifests\n# yaml-language-server: $schema=https://aka.ms/winget-manifest.${name}.${WINGET_MANIFEST_VERSION}.schema.json\n\n`;
161
+ const common = { PackageIdentifier: spec.id, PackageVersion: spec.version };
162
+ const installer = {
163
+ ...common,
164
+ InstallerLocale: WINGET_LOCALE,
165
+ InstallerType: w.installerType,
166
+ Scope: w.scope,
167
+ InstallModes: ['interactive', 'silent', 'silentWithProgress'],
168
+ InstallerSwitches: { Silent: w.silentSwitches, SilentWithProgress: w.silentWithProgress ?? w.silentSwitches },
169
+ UpgradeBehavior: 'install',
170
+ Installers: [{ Architecture: w.architecture, InstallerUrl: w.url, InstallerSha256: w.sha256.toUpperCase() }],
171
+ ManifestType: 'installer',
172
+ ManifestVersion: WINGET_MANIFEST_VERSION,
173
+ };
174
+ const locale = {
175
+ ...common,
176
+ PackageLocale: WINGET_LOCALE,
177
+ Publisher: spec.publisher,
178
+ PublisherUrl: spec.publisherUrl,
179
+ PackageName: spec.name,
180
+ PackageUrl: spec.homepage,
181
+ License: spec.license,
182
+ LicenseUrl: spec.licenseUrl,
183
+ Copyright: spec.copyright,
184
+ ShortDescription: spec.shortDescription,
185
+ Description: spec.description,
186
+ Tags: spec.tags.length ? spec.tags : undefined,
187
+ ReleaseNotesUrl: spec.releaseNotesUrl,
188
+ ManifestType: 'defaultLocale',
189
+ ManifestVersion: WINGET_MANIFEST_VERSION,
190
+ };
191
+ const version = { ...common, DefaultLocale: WINGET_LOCALE, ManifestType: 'version', ManifestVersion: WINGET_MANIFEST_VERSION };
192
+ // winget-pkgs layout: manifests/<first letter>/<Publisher>/<Package>/<version>/<Id>[.installer|.locale.<tag>].yaml
193
+ const dir = join('winget', 'manifests', spec.id[0].toLowerCase(), ...spec.id.split('.'), spec.version);
194
+ return {
195
+ [join(dir, `${spec.id}.yaml`)]: `${header('version')}${toYaml(version)}\n`,
196
+ [join(dir, `${spec.id}.installer.yaml`)]: `${header('installer')}${toYaml(installer)}\n`,
197
+ [join(dir, `${spec.id}.locale.${WINGET_LOCALE}.yaml`)]: `${header('defaultLocale')}${toYaml(locale)}\n`,
198
+ };
199
+ }
200
+
201
+ // ---- Chocolatey ----
202
+
203
+ const xml = value => String(value).replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;');
204
+ const psq = value => `'${String(value).replaceAll("'", "''")}'`;
205
+
206
+ export function chocolateyPackage(spec) {
207
+ if (!spec.windows) return undefined;
208
+ const w = spec.windows;
209
+ const dir = join('chocolatey', spec.slug);
210
+ const fileType = w.installerType === 'msi' || w.installerType === 'wix' ? 'msi' : 'exe';
211
+ const nuspec = `<?xml version="1.0" encoding="utf-8"?>
212
+ <package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
213
+ <metadata>
214
+ <id>${xml(spec.slug)}</id>
215
+ <version>${xml(spec.version)}</version>
216
+ <title>${xml(spec.name)}</title>
217
+ <authors>${xml(spec.publisher)}</authors>
218
+ <projectUrl>${xml(spec.homepage)}</projectUrl>${spec.licenseUrl ? `\n <licenseUrl>${xml(spec.licenseUrl)}</licenseUrl>` : ''}
219
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
220
+ <summary>${xml(spec.shortDescription)}</summary>
221
+ <description>${xml(spec.description)}</description>${spec.tags.length ? `\n <tags>${xml(spec.tags.join(' '))}</tags>` : ''}${spec.copyright ? `\n <copyright>${xml(spec.copyright)}</copyright>` : ''}${spec.releaseNotesUrl ? `\n <releaseNotes>${xml(spec.releaseNotesUrl)}</releaseNotes>` : ''}
222
+ </metadata>
223
+ <files>
224
+ <file src="tools\\**" target="tools" />
225
+ </files>
226
+ </package>
227
+ `;
228
+ const install = `$ErrorActionPreference = 'Stop'
229
+
230
+ $packageArgs = @{
231
+ packageName = $env:ChocolateyPackageName
232
+ fileType = ${psq(fileType)}
233
+ url64bit = ${psq(w.url)}
234
+ checksum64 = ${psq(w.sha256.toLowerCase())}
235
+ checksumType64 = 'sha256'
236
+ silentArgs = ${psq(w.silentSwitches)}
237
+ validExitCodes = @(0)
238
+ }
239
+
240
+ Install-ChocolateyPackage @packageArgs
241
+ `;
242
+ return {
243
+ [join(dir, `${spec.slug}.nuspec`)]: nuspec,
244
+ [join(dir, 'tools', 'chocolateyInstall.ps1')]: install,
245
+ };
246
+ }
247
+
248
+ // ---- Homebrew cask (the publisher's own tap: <tap>/Casks/<slug>.rb) ----
249
+
250
+ const rb = value => `"${String(value).replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('#{', '\\#{')}"`;
251
+
252
+ export function homebrewCask(spec) {
253
+ if (!spec.macos) return undefined;
254
+ const m = spec.macos;
255
+ // The version inside the URL becomes #{version}, so a bump edits one line.
256
+ const url = m.url.includes(spec.version) ? `"${m.url.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll(spec.version, '#{version}')}"` : rb(m.url);
257
+ const zap = m.zap.length ? `\n\n zap trash: [\n${m.zap.map(path => ` ${rb(path)},`).join('\n')}\n ]` : '';
258
+ const cask = `cask ${rb(spec.slug)} do
259
+ version ${rb(spec.version)}
260
+ sha256 ${rb(m.sha256)}
261
+
262
+ url ${url}
263
+ name ${rb(spec.name)}
264
+ desc ${rb(spec.shortDescription)}
265
+ homepage ${rb(spec.homepage)}
266
+
267
+ depends_on macos: ">= :big_sur"
268
+
269
+ app ${rb(m.app)}${zap}
270
+ end
271
+ `;
272
+ return { [join('homebrew', 'Casks', `${spec.slug}.rb`)]: cask };
273
+ }
274
+
275
+ // ---- AUR: <slug>-bin repackaging the .deb (or, without one, the AppImage) ----
276
+
277
+ const bash = value => `'${String(value).replaceAll("'", `'\\''`)}'`;
278
+ export function aurPackage(spec) {
279
+ const l = spec.linux;
280
+ if (!l) return undefined;
281
+ const name = `${spec.slug}-bin`;
282
+ const isDeb = Boolean(l.deb);
283
+ const source = l.deb ?? l.appImage;
284
+ const ext = isDeb ? 'deb' : 'AppImage';
285
+ const pkgver = spec.version.replaceAll('-', '_');
286
+ const file = `${name}-${pkgver}.${ext}`;
287
+ // The version in the URL becomes ${pkgver}; a release version with a hyphen keeps its URL literally.
288
+ const simple = !spec.version.includes('-');
289
+ const dq = value => value.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('$', '\\$');
290
+ const url = simple ? dq(source.url).replaceAll(spec.version, '${pkgver}') : dq(source.url);
291
+ const sourceEntry = simple ? `"\${pkgname}-\${pkgver}.${ext}::${url}"` : `"${file}::${url}"`;
292
+ const depends = isDeb ? l.depends : [];
293
+ const body = isDeb
294
+ ? ' bsdtar -xf "$srcdir"/data.tar.* -C "$pkgdir"'
295
+ : ` install -Dm755 "$srcdir/${file}" "$pkgdir/opt/${spec.slug}/${spec.slug}.AppImage"
296
+ install -d "$pkgdir/usr/bin"
297
+ ln -s "/opt/${spec.slug}/${spec.slug}.AppImage" "$pkgdir/usr/bin/${spec.slug}"`;
298
+ const pkgbuild = `# Maintainer: ${spec.publisher}
299
+ pkgname=${name}
300
+ pkgver=${pkgver}
301
+ pkgrel=1
302
+ pkgdesc=${bash(spec.shortDescription)}
303
+ arch=('x86_64')
304
+ url=${bash(spec.homepage)}
305
+ license=(${bash(spec.license)})
306
+ ${depends.length ? `depends=(${depends.map(bash).join(' ')})\n` : ''}provides=(${bash(spec.slug)})
307
+ conflicts=(${bash(spec.slug)})
308
+ options=(!strip !debug)
309
+ ${isDeb ? '' : `noextract=("${file}")\n`}source=(${sourceEntry})
310
+ sha256sums=(${bash(source.sha256.toLowerCase())})
311
+
312
+ package() {
313
+ ${body}
314
+ }
315
+ `;
316
+ const srcinfo = `pkgbase = ${name}
317
+ \tpkgdesc = ${spec.shortDescription}
318
+ \tpkgver = ${pkgver}
319
+ \tpkgrel = 1
320
+ \turl = ${spec.homepage}
321
+ \tarch = x86_64
322
+ \tlicense = ${spec.license}
323
+ ${depends.map(dep => `\tdepends = ${dep}\n`).join('')}\toptions = !strip
324
+ \toptions = !debug
325
+ \tprovides = ${spec.slug}
326
+ \tconflicts = ${spec.slug}
327
+ ${isDeb ? '' : `\tnoextract = ${file}\n`}\tsource = ${file}::${source.url}
328
+ \tsha256sums = ${source.sha256.toLowerCase()}
329
+
330
+ pkgname = ${name}
331
+ `;
332
+ return { [join('aur', name, 'PKGBUILD')]: pkgbuild, [join('aur', name, '.SRCINFO')]: srcinfo };
333
+ }
334
+
335
+ /** All manifests as `{ relative path: text }`; `only` limits the channels. */
336
+ export function buildManifests(spec, { only = CHANNELS } = {}) {
337
+ const builders = { winget: wingetManifests, chocolatey: chocolateyPackage, homebrew: homebrewCask, aur: aurPackage };
338
+ const files = {};
339
+ const skipped = [];
340
+ for (const channel of only) {
341
+ if (!builders[channel]) fail(`unknown channel ${channel} (${CHANNELS.join(', ')})`);
342
+ const made = builders[channel](spec);
343
+ if (made) Object.assign(files, made);
344
+ else skipped.push(channel);
345
+ }
346
+ return { files, skipped };
347
+ }
348
+
349
+ /** Writes them under `outDir` (LF line endings) and returns the written relative paths. */
350
+ export function writeManifests(spec, outDir, options) {
351
+ const { files, skipped } = buildManifests(spec, options);
352
+ for (const [path, text] of Object.entries(files)) {
353
+ const target = join(outDir, path);
354
+ mkdirSync(dirname(target), { recursive: true });
355
+ writeFileSync(target, text.replaceAll('\r\n', '\n'));
356
+ }
357
+ return { written: Object.keys(files), skipped };
358
+ }
359
+
360
+ function option(args, name) {
361
+ const i = args.indexOf(name);
362
+ return i >= 0 ? args[i + 1] : undefined;
363
+ }
364
+
365
+ /** `waybetter manifests ...`; returns the exit code. */
366
+ export function manifestsCommand(argv, { cwd = process.cwd(), log = console.log } = {}) {
367
+ const file = argv.find((arg, i) => !arg.startsWith('--') && !['--out', '--download-base', '--only'].includes(argv[i - 1]));
368
+ if (!file || argv.includes('--help') || argv.includes('-h')) {
369
+ log(MANIFESTS_USAGE);
370
+ return file ? 0 : 1;
371
+ }
372
+ const path = resolve(cwd, file);
373
+ if (!existsSync(path)) fail(`not found: ${path}`);
374
+ let raw;
375
+ try { raw = JSON.parse(readFileSync(path, 'utf8')); } catch (error) { fail(`${path}: ${error.message}`); }
376
+ const spec = resolveSpec(raw, { baseDir: dirname(path), downloadBase: option(argv, '--download-base') });
377
+ const only = option(argv, '--only')?.split(',').map(s => s.trim()).filter(Boolean);
378
+ const out = resolve(cwd, option(argv, '--out') ?? 'distribution');
379
+ const { written, skipped } = writeManifests(spec, out, { only: only ?? CHANNELS });
380
+ for (const name of written) log(`manifests: ${join(out, name)}`);
381
+ if (skipped.length) log(`manifests: skipped ${skipped.join(', ')} (no installer for that platform in the description)`);
382
+ return 0;
383
+ }