waybetter 0.1.0 → 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.
- package/README.md +143 -9
- package/bin/waybetter.mjs +46 -0
- package/build/runtime.mjs +105 -0
- package/cli/buildenv.mjs +130 -0
- package/cli/dev.mjs +97 -0
- package/cli/i18n.mjs +382 -0
- package/cli/manifests.mjs +383 -0
- package/cli/privacy.mjs +768 -0
- package/cli/release.mjs +444 -0
- package/cli/remote.mjs +260 -0
- package/cli/store.mjs +326 -0
- package/cli/strings.mjs +121 -0
- package/dist/runtime/column.d.ts +93 -0
- package/dist/runtime/column.js +451 -0
- package/dist/runtime/column.js.map +1 -0
- package/dist/runtime/commandReport.d.ts +19 -0
- package/dist/runtime/commandReport.js +47 -0
- package/dist/runtime/commandReport.js.map +1 -0
- package/dist/runtime/commands.d.ts +72 -0
- package/dist/runtime/commands.js +214 -0
- package/dist/runtime/commands.js.map +1 -0
- package/dist/runtime/devErrors.d.ts +16 -0
- package/dist/runtime/devErrors.js +30 -0
- package/dist/runtime/devErrors.js.map +1 -0
- package/dist/runtime/domHub.d.ts +21 -0
- package/dist/runtime/domHub.js +139 -4
- package/dist/runtime/domHub.js.map +1 -1
- package/dist/runtime/featureModules.d.ts +157 -0
- package/dist/runtime/featureModules.js +484 -0
- package/dist/runtime/featureModules.js.map +1 -0
- package/dist/runtime/featureTable.d.ts +144 -0
- package/dist/runtime/featureTable.js +223 -0
- package/dist/runtime/featureTable.js.map +1 -0
- package/dist/runtime/fonts.d.ts +22 -0
- package/dist/runtime/fonts.js +72 -0
- package/dist/runtime/fonts.js.map +1 -0
- package/dist/runtime/i18n.d.ts +138 -0
- package/dist/runtime/i18n.js +614 -0
- package/dist/runtime/i18n.js.map +1 -0
- package/dist/runtime/i18nCheck.d.ts +30 -0
- package/dist/runtime/i18nCheck.js +224 -0
- package/dist/runtime/i18nCheck.js.map +1 -0
- package/dist/runtime/pageLang.d.ts +8 -0
- package/dist/runtime/pageLang.js +64 -0
- package/dist/runtime/pageLang.js.map +1 -0
- package/dist/runtime/pageStrings.d.ts +35 -0
- package/dist/runtime/pageStrings.js +76 -0
- package/dist/runtime/pageStrings.js.map +1 -0
- package/dist/runtime/panelButton.d.ts +33 -0
- package/dist/runtime/panelButton.js +83 -0
- package/dist/runtime/panelButton.js.map +1 -0
- package/dist/runtime/permissions.d.ts +47 -0
- package/dist/runtime/permissions.js +141 -0
- package/dist/runtime/permissions.js.map +1 -0
- package/dist/runtime/pluginApi.d.ts +51 -2
- package/dist/runtime/pluginApi.js +137 -22
- package/dist/runtime/pluginApi.js.map +1 -1
- package/dist/runtime/pluginI18n.d.ts +29 -0
- package/dist/runtime/pluginI18n.js +119 -0
- package/dist/runtime/pluginI18n.js.map +1 -0
- package/dist/runtime/settingsForm.d.ts +66 -0
- package/dist/runtime/settingsForm.js +114 -0
- package/dist/runtime/settingsForm.js.map +1 -0
- package/dist/runtime/site.d.ts +5 -0
- package/dist/runtime/site.js +1 -1
- package/dist/runtime/site.js.map +1 -1
- package/dist/runtime/siteRuntime.d.ts +144 -0
- package/dist/runtime/siteRuntime.js +175 -0
- package/dist/runtime/siteRuntime.js.map +1 -0
- package/dist/runtime/stringPackHook.d.ts +84 -0
- package/dist/runtime/stringPackHook.js +220 -0
- package/dist/runtime/stringPackHook.js.map +1 -0
- package/dist/runtime/stringPackTranslate.d.ts +59 -0
- package/dist/runtime/stringPackTranslate.js +264 -0
- package/dist/runtime/stringPackTranslate.js.map +1 -0
- package/dist/runtime/stringPacks.d.ts +200 -0
- package/dist/runtime/stringPacks.js +474 -0
- package/dist/runtime/stringPacks.js.map +1 -0
- package/dist/runtime/styles.d.ts +15 -0
- package/dist/runtime/styles.js +81 -0
- package/dist/runtime/styles.js.map +1 -0
- package/dist/runtime/textNet.d.ts +15 -0
- package/dist/runtime/textNet.js +131 -0
- package/dist/runtime/textNet.js.map +1 -0
- package/dist/runtime/themeApi.d.ts +121 -0
- package/dist/runtime/themeApi.js +220 -0
- package/dist/runtime/themeApi.js.map +1 -0
- package/dist/runtime/themeChoice.d.ts +52 -0
- package/dist/runtime/themeChoice.js +69 -0
- package/dist/runtime/themeChoice.js.map +1 -0
- package/dist/runtime/themeComponents.d.ts +435 -0
- package/dist/runtime/themeComponents.js +463 -0
- package/dist/runtime/themeComponents.js.map +1 -0
- package/dist/runtime/themeDecor.d.ts +73 -0
- package/dist/runtime/themeDecor.js +131 -0
- package/dist/runtime/themeDecor.js.map +1 -0
- package/dist/runtime/themeDoctor.d.ts +11 -0
- package/dist/runtime/themeDoctor.js +51 -0
- package/dist/runtime/themeDoctor.js.map +1 -0
- package/dist/runtime/themeIcons.d.ts +130 -0
- package/dist/runtime/themeIcons.js +263 -0
- package/dist/runtime/themeIcons.js.map +1 -0
- package/dist/runtime/themeRuntime.d.ts +100 -0
- package/dist/runtime/themeRuntime.js +497 -0
- package/dist/runtime/themeRuntime.js.map +1 -0
- package/dist/runtime/themeSchema.d.ts +10 -0
- package/dist/runtime/themeSchema.js +150 -0
- package/dist/runtime/themeSchema.js.map +1 -0
- package/dist/runtime/themeSpec.d.ts +259 -0
- package/dist/runtime/themeSpec.js +439 -0
- package/dist/runtime/themeSpec.js.map +1 -0
- package/dist/runtime/themeTokens.d.ts +12 -0
- package/dist/runtime/themeTokens.js +14 -6
- package/dist/runtime/themeTokens.js.map +1 -1
- package/dist/runtime/themeVariants.d.ts +30 -0
- package/dist/runtime/themeVariants.js +53 -0
- package/dist/runtime/themeVariants.js.map +1 -0
- package/dist/runtime/ui.d.ts +192 -0
- package/dist/runtime/ui.js +926 -0
- package/dist/runtime/ui.js.map +1 -0
- package/dist/shell/InstallDialog.d.ts +40 -0
- package/dist/shell/InstallDialog.js +170 -0
- package/dist/shell/InstallDialog.js.map +1 -0
- package/dist/shell/StoreView.d.ts +66 -0
- package/dist/shell/StoreView.js +103 -0
- package/dist/shell/StoreView.js.map +1 -0
- package/dist/shell/addressModel.js.map +1 -1
- package/dist/shell/chrome.js.map +1 -1
- package/dist/shell/deckModel.d.ts +117 -0
- package/dist/shell/deckModel.js +267 -0
- package/dist/shell/deckModel.js.map +1 -0
- package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
- package/dist/shell/frame/AccountSwitcher.js +243 -0
- package/dist/shell/frame/AccountSwitcher.js.map +1 -0
- package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
- package/dist/shell/frame/AddColumnDialog.js +81 -0
- package/dist/shell/frame/AddColumnDialog.js.map +1 -0
- package/dist/shell/frame/AppMenu.d.ts +21 -0
- package/dist/shell/frame/AppMenu.js +642 -0
- package/dist/shell/frame/AppMenu.js.map +1 -0
- package/dist/shell/frame/CommandPalette.d.ts +7 -0
- package/dist/shell/frame/CommandPalette.js +118 -0
- package/dist/shell/frame/CommandPalette.js.map +1 -0
- package/dist/shell/frame/DeckView.d.ts +13 -0
- package/dist/shell/frame/DeckView.js +287 -0
- package/dist/shell/frame/DeckView.js.map +1 -0
- package/dist/shell/frame/FindBar.d.ts +10 -0
- package/dist/shell/frame/FindBar.js +108 -0
- package/dist/shell/frame/FindBar.js.map +1 -0
- package/dist/shell/frame/MediaPanel.d.ts +8 -0
- package/dist/shell/frame/MediaPanel.js +76 -0
- package/dist/shell/frame/MediaPanel.js.map +1 -0
- package/dist/shell/frame/NewTabPage.d.ts +9 -0
- package/dist/shell/frame/NewTabPage.js +71 -0
- package/dist/shell/frame/NewTabPage.js.map +1 -0
- package/dist/shell/frame/PaneTheme.d.ts +16 -0
- package/dist/shell/frame/PaneTheme.js +67 -0
- package/dist/shell/frame/PaneTheme.js.map +1 -0
- package/dist/shell/frame/ReportDialog.d.ts +3 -0
- package/dist/shell/frame/ReportDialog.js +95 -0
- package/dist/shell/frame/ReportDialog.js.map +1 -0
- package/dist/shell/frame/Shell.d.ts +8 -0
- package/dist/shell/frame/Shell.js +1131 -0
- package/dist/shell/frame/Shell.js.map +1 -0
- package/dist/shell/frame/Titlebar.d.ts +16 -0
- package/dist/shell/frame/Titlebar.js +77 -0
- package/dist/shell/frame/Titlebar.js.map +1 -0
- package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
- package/dist/shell/frame/TitlebarExtras.js +202 -0
- package/dist/shell/frame/TitlebarExtras.js.map +1 -0
- package/dist/shell/frame/WebPanel.d.ts +4 -0
- package/dist/shell/frame/WebPanel.js +182 -0
- package/dist/shell/frame/WebPanel.js.map +1 -0
- package/dist/shell/frame/accountModel.d.ts +49 -0
- package/dist/shell/frame/accountModel.js +67 -0
- package/dist/shell/frame/accountModel.js.map +1 -0
- package/dist/shell/frame/accountSwitcher.css +91 -0
- package/dist/shell/frame/appI18n.d.ts +44 -0
- package/dist/shell/frame/appI18n.js +64 -0
- package/dist/shell/frame/appI18n.js.map +1 -0
- package/dist/shell/frame/appMenu.css +121 -0
- package/dist/shell/frame/backupModel.d.ts +38 -0
- package/dist/shell/frame/backupModel.js +192 -0
- package/dist/shell/frame/backupModel.js.map +1 -0
- package/dist/shell/frame/boot.d.ts +8 -0
- package/dist/shell/frame/boot.js +35 -0
- package/dist/shell/frame/boot.js.map +1 -0
- package/dist/shell/frame/brand.d.ts +1 -0
- package/dist/shell/frame/brand.js +4 -0
- package/dist/shell/frame/brand.js.map +1 -0
- package/dist/shell/frame/bridge.d.ts +35 -0
- package/dist/shell/frame/bridge.js +70 -0
- package/dist/shell/frame/bridge.js.map +1 -0
- package/dist/shell/frame/chromeTheme.d.ts +29 -0
- package/dist/shell/frame/chromeTheme.js +81 -0
- package/dist/shell/frame/chromeTheme.js.map +1 -0
- package/dist/shell/frame/deck.css +209 -0
- package/dist/shell/frame/deckStore.d.ts +89 -0
- package/dist/shell/frame/deckStore.js +239 -0
- package/dist/shell/frame/deckStore.js.map +1 -0
- package/dist/shell/frame/devHost.d.ts +35 -0
- package/dist/shell/frame/devHost.js +80 -0
- package/dist/shell/frame/devHost.js.map +1 -0
- package/dist/shell/frame/devModel.d.ts +7 -0
- package/dist/shell/frame/devModel.js +17 -0
- package/dist/shell/frame/devModel.js.map +1 -0
- package/dist/shell/frame/diag.d.ts +7 -0
- package/dist/shell/frame/diag.js +39 -0
- package/dist/shell/frame/diag.js.map +1 -0
- package/dist/shell/frame/findBar.css +14 -0
- package/dist/shell/frame/frameMessages.d.ts +248 -0
- package/dist/shell/frame/frameMessages.js +252 -0
- package/dist/shell/frame/frameMessages.js.map +1 -0
- package/dist/shell/frame/hooks.d.ts +39 -0
- package/dist/shell/frame/hooks.js +97 -0
- package/dist/shell/frame/hooks.js.map +1 -0
- package/dist/shell/frame/i18n.d.ts +27 -0
- package/dist/shell/frame/i18n.js +66 -0
- package/dist/shell/frame/i18n.js.map +1 -0
- package/dist/shell/frame/iconPack.d.ts +11 -0
- package/dist/shell/frame/iconPack.js +45 -0
- package/dist/shell/frame/iconPack.js.map +1 -0
- package/dist/shell/frame/icons.d.ts +71 -0
- package/dist/shell/frame/icons.js +75 -0
- package/dist/shell/frame/icons.js.map +1 -0
- package/dist/shell/frame/index.d.ts +34 -0
- package/dist/shell/frame/index.js +43 -0
- package/dist/shell/frame/index.js.map +1 -0
- package/dist/shell/frame/language.d.ts +58 -0
- package/dist/shell/frame/language.js +165 -0
- package/dist/shell/frame/language.js.map +1 -0
- package/dist/shell/frame/mediaModel.d.ts +34 -0
- package/dist/shell/frame/mediaModel.js +53 -0
- package/dist/shell/frame/mediaModel.js.map +1 -0
- package/dist/shell/frame/menuMessages.en.json +54 -0
- package/dist/shell/frame/menuModel.d.ts +277 -0
- package/dist/shell/frame/menuModel.js +293 -0
- package/dist/shell/frame/menuModel.js.map +1 -0
- package/dist/shell/frame/paletteModel.d.ts +139 -0
- package/dist/shell/frame/paletteModel.js +112 -0
- package/dist/shell/frame/paletteModel.js.map +1 -0
- package/dist/shell/frame/paneTheme.css +9 -0
- package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
- package/dist/shell/frame/pluginCommandStore.js +70 -0
- package/dist/shell/frame/pluginCommandStore.js.map +1 -0
- package/dist/shell/frame/reportModel.d.ts +52 -0
- package/dist/shell/frame/reportModel.js +105 -0
- package/dist/shell/frame/reportModel.js.map +1 -0
- package/dist/shell/frame/safeStore.d.ts +7 -0
- package/dist/shell/frame/safeStore.js +40 -0
- package/dist/shell/frame/safeStore.js.map +1 -0
- package/dist/shell/frame/searchInput.d.ts +2 -0
- package/dist/shell/frame/searchInput.js +11 -0
- package/dist/shell/frame/searchInput.js.map +1 -0
- package/dist/shell/frame/shell.css +629 -0
- package/dist/shell/frame/site.d.ts +206 -0
- package/dist/shell/frame/site.js +22 -0
- package/dist/shell/frame/site.js.map +1 -0
- package/dist/shell/frame/state.d.ts +99 -0
- package/dist/shell/frame/state.js +284 -0
- package/dist/shell/frame/state.js.map +1 -0
- package/dist/shell/frame/syncGate.d.ts +10 -0
- package/dist/shell/frame/syncGate.js +36 -0
- package/dist/shell/frame/syncGate.js.map +1 -0
- package/dist/shell/frame/syncHost.d.ts +35 -0
- package/dist/shell/frame/syncHost.js +85 -0
- package/dist/shell/frame/syncHost.js.map +1 -0
- package/dist/shell/frame/tabStill.d.ts +2 -0
- package/dist/shell/frame/tabStill.js +62 -0
- package/dist/shell/frame/tabStill.js.map +1 -0
- package/dist/shell/frame/themeScopes.d.ts +29 -0
- package/dist/shell/frame/themeScopes.js +61 -0
- package/dist/shell/frame/themeScopes.js.map +1 -0
- package/dist/shell/frame/themeStore.d.ts +99 -0
- package/dist/shell/frame/themeStore.js +252 -0
- package/dist/shell/frame/themeStore.js.map +1 -0
- package/dist/shell/frame/windowBinding.d.ts +2 -0
- package/dist/shell/frame/windowBinding.js +7 -0
- package/dist/shell/frame/windowBinding.js.map +1 -0
- package/dist/shell/frame/workspaceModel.d.ts +82 -0
- package/dist/shell/frame/workspaceModel.js +250 -0
- package/dist/shell/frame/workspaceModel.js.map +1 -0
- package/dist/shell/frame/workspaces.css +84 -0
- package/dist/shell/frame/workspaces.d.ts +22 -0
- package/dist/shell/frame/workspaces.js +125 -0
- package/dist/shell/frame/workspaces.js.map +1 -0
- package/dist/shell/frame/zoomStore.d.ts +10 -0
- package/dist/shell/frame/zoomStore.js +65 -0
- package/dist/shell/frame/zoomStore.js.map +1 -0
- package/dist/shell/installController.d.ts +122 -0
- package/dist/shell/installController.js +146 -0
- package/dist/shell/installController.js.map +1 -0
- package/dist/shell/installerMessages.d.ts +30 -0
- package/dist/shell/installerMessages.js +36 -0
- package/dist/shell/installerMessages.js.map +1 -0
- package/dist/shell/linkDrop.js.map +1 -1
- package/dist/shell/messages.d.ts +16 -0
- package/dist/shell/messages.js +27 -0
- package/dist/shell/messages.js.map +1 -0
- package/dist/shell/palette.js.map +1 -1
- package/dist/shell/paneModel.d.ts +22 -0
- package/dist/shell/paneModel.js +24 -1
- package/dist/shell/paneModel.js.map +1 -1
- package/dist/shell/panel/Appearance.d.ts +8 -0
- package/dist/shell/panel/Appearance.js +256 -0
- package/dist/shell/panel/Appearance.js.map +1 -0
- package/dist/shell/panel/BackupPanel.d.ts +5 -0
- package/dist/shell/panel/BackupPanel.js +198 -0
- package/dist/shell/panel/BackupPanel.js.map +1 -0
- package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
- package/dist/shell/panel/DeveloperPanel.js +51 -0
- package/dist/shell/panel/DeveloperPanel.js.map +1 -0
- package/dist/shell/panel/FeatureToggles.d.ts +13 -0
- package/dist/shell/panel/FeatureToggles.js +42 -0
- package/dist/shell/panel/FeatureToggles.js.map +1 -0
- package/dist/shell/panel/Home.d.ts +3 -0
- package/dist/shell/panel/Home.js +23 -0
- package/dist/shell/panel/Home.js.map +1 -0
- package/dist/shell/panel/IconPackInstall.d.ts +15 -0
- package/dist/shell/panel/IconPackInstall.js +41 -0
- package/dist/shell/panel/IconPackInstall.js.map +1 -0
- package/dist/shell/panel/LanguageSettings.d.ts +1 -0
- package/dist/shell/panel/LanguageSettings.js +54 -0
- package/dist/shell/panel/LanguageSettings.js.map +1 -0
- package/dist/shell/panel/MakePanel.d.ts +3 -0
- package/dist/shell/panel/MakePanel.js +237 -0
- package/dist/shell/panel/MakePanel.js.map +1 -0
- package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
- package/dist/shell/panel/MarkdownDoc.js +35 -0
- package/dist/shell/panel/MarkdownDoc.js.map +1 -0
- package/dist/shell/panel/Modes.d.ts +40 -0
- package/dist/shell/panel/Modes.js +270 -0
- package/dist/shell/panel/Modes.js.map +1 -0
- package/dist/shell/panel/NavIcon.d.ts +4 -0
- package/dist/shell/panel/NavIcon.js +6 -0
- package/dist/shell/panel/NavIcon.js.map +1 -0
- package/dist/shell/panel/Panel.d.ts +7 -0
- package/dist/shell/panel/Panel.js +139 -0
- package/dist/shell/panel/Panel.js.map +1 -0
- package/dist/shell/panel/PluginFeatures.d.ts +24 -0
- package/dist/shell/panel/PluginFeatures.js +165 -0
- package/dist/shell/panel/PluginFeatures.js.map +1 -0
- package/dist/shell/panel/Plugins.d.ts +33 -0
- package/dist/shell/panel/Plugins.js +112 -0
- package/dist/shell/panel/Plugins.js.map +1 -0
- package/dist/shell/panel/PowerSettings.d.ts +4 -0
- package/dist/shell/panel/PowerSettings.js +52 -0
- package/dist/shell/panel/PowerSettings.js.map +1 -0
- package/dist/shell/panel/Settings.d.ts +23 -0
- package/dist/shell/panel/Settings.js +116 -0
- package/dist/shell/panel/Settings.js.map +1 -0
- package/dist/shell/panel/ShareSetup.d.ts +8 -0
- package/dist/shell/panel/ShareSetup.js +130 -0
- package/dist/shell/panel/ShareSetup.js.map +1 -0
- package/dist/shell/panel/StoreSection.d.ts +6 -0
- package/dist/shell/panel/StoreSection.js +48 -0
- package/dist/shell/panel/StoreSection.js.map +1 -0
- package/dist/shell/panel/StringPacks.d.ts +11 -0
- package/dist/shell/panel/StringPacks.js +106 -0
- package/dist/shell/panel/StringPacks.js.map +1 -0
- package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
- package/dist/shell/panel/ThemeBuilder.js +205 -0
- package/dist/shell/panel/ThemeBuilder.js.map +1 -0
- package/dist/shell/panel/backup.css +34 -0
- package/dist/shell/panel/builder.css +232 -0
- package/dist/shell/panel/builderModel.d.ts +55 -0
- package/dist/shell/panel/builderModel.js +95 -0
- package/dist/shell/panel/builderModel.js.map +1 -0
- package/dist/shell/panel/compare.d.ts +10 -0
- package/dist/shell/panel/compare.js +51 -0
- package/dist/shell/panel/compare.js.map +1 -0
- package/dist/shell/panel/controls.d.ts +135 -0
- package/dist/shell/panel/controls.js +213 -0
- package/dist/shell/panel/controls.js.map +1 -0
- package/dist/shell/panel/featureModel.d.ts +69 -0
- package/dist/shell/panel/featureModel.js +79 -0
- package/dist/shell/panel/featureModel.js.map +1 -0
- package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
- package/dist/shell/panel/fonts/FontBrowser.js +189 -0
- package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
- package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
- package/dist/shell/panel/fonts/FontRoles.js +77 -0
- package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
- package/dist/shell/panel/fonts/catalog.d.ts +37 -0
- package/dist/shell/panel/fonts/catalog.js +68 -0
- package/dist/shell/panel/fonts/catalog.js.map +1 -0
- package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
- package/dist/shell/panel/index.d.ts +20 -0
- package/dist/shell/panel/index.js +34 -0
- package/dist/shell/panel/index.js.map +1 -0
- package/dist/shell/panel/languageModel.d.ts +5 -0
- package/dist/shell/panel/languageModel.js +7 -0
- package/dist/shell/panel/languageModel.js.map +1 -0
- package/dist/shell/panel/make.css +72 -0
- package/dist/shell/panel/makeModel.d.ts +32 -0
- package/dist/shell/panel/makeModel.js +84 -0
- package/dist/shell/panel/makeModel.js.map +1 -0
- package/dist/shell/panel/markdown.d.ts +46 -0
- package/dist/shell/panel/markdown.js +100 -0
- package/dist/shell/panel/markdown.js.map +1 -0
- package/dist/shell/panel/nav.d.ts +12 -0
- package/dist/shell/panel/nav.js +50 -0
- package/dist/shell/panel/nav.js.map +1 -0
- package/dist/shell/panel/panel.css +401 -0
- package/dist/shell/panel/panelMessages.d.ts +763 -0
- package/dist/shell/panel/panelMessages.js +767 -0
- package/dist/shell/panel/panelMessages.js.map +1 -0
- package/dist/shell/panel/plugins.css +59 -0
- package/dist/shell/panel/setupModel.d.ts +87 -0
- package/dist/shell/panel/setupModel.js +152 -0
- package/dist/shell/panel/setupModel.js.map +1 -0
- package/dist/shell/panel/site.d.ts +259 -0
- package/dist/shell/panel/site.js +25 -0
- package/dist/shell/panel/site.js.map +1 -0
- package/dist/shell/panel/strings.css +7 -0
- package/dist/shell/panel/themes.d.ts +10 -0
- package/dist/shell/panel/themes.js +8 -0
- package/dist/shell/panel/themes.js.map +1 -0
- package/dist/shell/profileModel.d.ts +3 -2
- package/dist/shell/profileModel.js +7 -5
- package/dist/shell/profileModel.js.map +1 -1
- package/dist/shell/store.css +230 -0
- package/dist/shell/storeMessages.d.ts +169 -0
- package/dist/shell/storeMessages.js +172 -0
- package/dist/shell/storeMessages.js.map +1 -0
- package/dist/shell/storeModel.d.ts +181 -0
- package/dist/shell/storeModel.js +133 -0
- package/dist/shell/storeModel.js.map +1 -0
- package/dist/shell/stringPacksModel.d.ts +44 -0
- package/dist/shell/stringPacksModel.js +94 -0
- package/dist/shell/stringPacksModel.js.map +1 -0
- package/dist/shell/updateModel.d.ts +2 -1
- package/dist/shell/updateModel.js +5 -4
- package/dist/shell/updateModel.js.map +1 -1
- package/dist/shell/windowControls.d.ts +4 -0
- package/dist/shell/windowControls.js +5 -0
- package/dist/shell/windowControls.js.map +1 -1
- package/i18n-config.schema.json +29 -0
- package/i18n-meta.schema.json +26 -0
- package/i18n.schema.json +42 -0
- package/icons.schema.json +646 -0
- package/languages.schema.json +23 -0
- package/locales/ar-x-fm.json +11 -0
- package/locales/ar.json +1281 -0
- package/locales/bg.json +1280 -0
- package/locales/bn.json +1280 -0
- package/locales/ca.json +1280 -0
- package/locales/cs.json +1280 -0
- package/locales/da.json +1280 -0
- package/locales/de.json +1280 -0
- package/locales/el.json +1280 -0
- package/locales/en-GB.json +27 -0
- package/locales/en.json +1280 -0
- package/locales/en.meta.json +51 -0
- package/locales/es.json +1280 -0
- package/locales/eu.json +1280 -0
- package/locales/fa.json +1281 -0
- package/locales/fi.json +1280 -0
- package/locales/fil.json +1280 -0
- package/locales/fr.json +1280 -0
- package/locales/ga.json +1280 -0
- package/locales/gl.json +1280 -0
- package/locales/gu.json +1280 -0
- package/locales/ha.json +1280 -0
- package/locales/he.json +1281 -0
- package/locales/hi.json +1280 -0
- package/locales/hr.json +1280 -0
- package/locales/hu.json +1279 -0
- package/locales/id.json +1280 -0
- package/locales/ig.json +1280 -0
- package/locales/it.json +1280 -0
- package/locales/ja.json +1280 -0
- package/locales/kn.json +1280 -0
- package/locales/ko.json +1280 -0
- package/locales/mr.json +1280 -0
- package/locales/ms.json +1280 -0
- package/locales/nb.json +1280 -0
- package/locales/nl.json +1280 -0
- package/locales/pl.json +1280 -0
- package/locales/pt.json +1280 -0
- package/locales/ro.json +1280 -0
- package/locales/ru.json +1280 -0
- package/locales/sk.json +1280 -0
- package/locales/sr.json +1280 -0
- package/locales/sv.json +1280 -0
- package/locales/ta.json +1280 -0
- package/locales/th.json +1280 -0
- package/locales/tr.json +1280 -0
- package/locales/uk.json +1280 -0
- package/locales/ur.json +1281 -0
- package/locales/vi.json +1280 -0
- package/locales/yo.json +1280 -0
- package/locales/zh-Hans.json +1280 -0
- package/locales/zh-Hant.json +1280 -0
- package/package.json +148 -6
- package/store-catalog.schema.json +65 -0
- package/theme.schema.json +4659 -0
- package/windows/installer.nsi +926 -0
- package/windows/languages/Basque.nsh +28 -0
- package/windows/languages/Catalan.nsh +28 -0
- package/windows/languages/Croatian.nsh +28 -0
- package/windows/languages/Czech.nsh +28 -0
- package/windows/languages/Danish.nsh +28 -0
- package/windows/languages/Finnish.nsh +28 -0
- package/windows/languages/Galician.nsh +28 -0
- package/windows/languages/Greek.nsh +28 -0
- package/windows/languages/Hungarian.nsh +28 -0
- package/windows/languages/Indonesian.nsh +28 -0
- package/windows/languages/Irish.nsh +28 -0
- package/windows/languages/Malay.nsh +28 -0
- package/windows/languages/Polish.nsh +28 -0
- package/windows/languages/Romanian.nsh +28 -0
- package/windows/languages/Serbian.nsh +28 -0
- package/windows/languages/Slovak.nsh +28 -0
- 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('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"');
|
|
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
|
+
}
|