waybetter/packages/create-waybetter
CRT 5bf1cbf865 App menu: the titlebar's "Settings and more" (Alt+F, F10, the palette, the account menu's last row) with rows from the site config; page zoom per tab in the host
Frame: AppMenu.tsx is a menu at the end of the titlebar cluster (before the caption buttons; macOS has none there). Its rows are `ShellSite.menu`: ordered groups of built-in rows by name and the app's own ({id, label, icon, shortcut, hint, when, checked, run | submenu}); `DEFAULT_MENU`, `menuWith` and `menuWithout` order, add and remove. A built-in row shows only when the app serves it (decks, `menu.languages`, themes, `menu.modes`, and `features`: zoom, store, workspaces, developer, updates), so no app gets a dead row. Language, Theme, Mode, Workspaces and Developer are submenus; Language and Theme apply live and keep the menu open, Mode asks the same keep-my-changes question as Settings (panel `menuModes()`). Keyboard: arrows, Home/End, type-ahead, the arrow along the reading direction opens a submenu, Esc closes one level; ARIA menu roles; submenus stay inside the window; one highlight for pointer and keys. It is an overlay like the other shell menus (the shell is raised, panes stay visible, nothing is dimmed).

Words: menuMessages.en.json (`wb.menu.*`), read through the framework i18n with that English as the fallback until the catalogs have them; words the panel already has are reused.

Host: `tab_zoom {id, factor}` (shell-only) sets a tab's page zoom with the engine's own zoom, clamped to 25%..500% and remembered per tab id in app data `zoom.json` (a number per tab id, nothing else; a closed tab's entry goes); without a factor it reads. A tab may forward four more shortcut names: `app-menu`, `zoom-in`, `zoom-out`, `zoom-reset`. The titlebar shows a zoom chip only while the pane in front is not at 100%.

create-waybetter: `tab_zoom` in the shell capability list; the template says which panel sections it lacks (store, updates) and how to add menu rows.
2026-09-30 14:52:51 +00:00
..
bin create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps 2026-09-28 16:17:32 +00:00
src App menu: the titlebar's "Settings and more" (Alt+F, F10, the palette, the account menu's last row) with rows from the site config; page zoom per tab in the host 2026-09-30 14:52:51 +00:00
tests Feature modules in a new app, i18n rename, and what the first area port needed 2026-09-30 12:25:15 +00:00
LICENSE create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps 2026-09-28 16:17:32 +00:00
package.json create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps 2026-09-28 16:17:32 +00:00
README.md create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps 2026-09-28 16:17:32 +00:00
tsconfig.json create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps 2026-09-28 16:17:32 +00:00

create-waybetter

npm create waybetter

Scaffolds something for wayBetter, the framework behind wayBetter for X: a plugin, a theme, or a whole new wayBetter app for another site. It asks what it needs when run in a terminal; every answer is also a flag. No dependencies, Node 18.3+.

Plugin

npm create waybetter plugin -- --name "Hide Trends"
npm create waybetter plugin -- --name "Word Badges" --ts          # TypeScript project

One *.plugin.js file with the header the plugin store reads (@name, @description, @version, @author) and a class with start() / stop(). The example uses the real plugin API: api.scope() for cleanup, api.storage(), scope.observe(), scope.onKey(), the UI kit (scope.ui.toast with an action, a settings ui.dialog built with ui.h) and the theme API (api.theme.current(), --wb-* CSS variables). --ts makes a small TypeScript project typed by the waybetter package; npm run build writes the loadable dist/<name>.plugin.js with the header first. --app any targets another wayBetter app (core API only; wayBetter for X adds api.tweet, api.account, api.users).

Install: wayBetter → Plugins → Open folder, copy the file in, Rescan, turn it on.

Theme

npm create waybetter theme -- --name "Midnight Mint" --accent "#3ddc97" --font "Geist, system-ui"

A theme JSON with "$schema": "https://unpkg.com/waybetter/theme.schema.json" (editor completion and checks), a full palette derived from --bg, --text and --accent the way the runtime derives missing roles, and the font roles (font.family for the interface, font.tweet for post text). Presets: midnight, paper, dusk. Import it in wayBetter → Appearance → Import.

App

npm create waybetter app -- --site kick.com
npm create waybetter app -- --site youtube.com --name "wayBetter for YouTube"

A wayBetter app skeleton, the same system as wayBetter for X: a Tauri 2 window with a trusted local shell and one native child webview per site tab (waybetter-host), the page runtime and shell models from the waybetter package, and the site adapter in its three parts:

  • src-tauri/src/site.rs: the native SiteSpec (hosts, runtime global, account rules);
  • src/site.ts: the page SiteAdapter (plugin API settings, account reader, link rules);
  • src-tauri/capabilities/: shell, tab-chrome and site-tab, keyed by webview label.

Presets for youtube.com, kick.com and twitch.tv (any host works); every selector and handle rule is a marked PLACEHOLDER to check against the live site. The host crate comes from a git submodule at waybetter/ (default), a local path (--host-source path --host-path <dir>) or git (--host-source git).

Options

npm create waybetter -- --help lists every flag. --yes takes defaults for anything not given, --dry-run prints the files, --force writes into a non-empty directory.

License

GPL-3.0-or-later. See LICENSE.