create-waybetter: npm create waybetter scaffolds plugins (JS/TS), themes and whole apps

- plugin: *.plugin.js with the store header and start/stop on api.scope, storage, observe,
  onKey, the UI kit (toast with action, ui.h settings dialog) and api.theme/--wb-* vars;
  --ts makes a TypeScript project typed by the waybetter package (build keeps the header first)
- theme: JSON with "$schema" -> theme.schema.json, palette derived like themeFromColors,
  font roles (family, tweet), presets
- app: Tauri 2 + waybetter-host + runtime + shell models: SiteSpec, SiteAdapter, shell/tab-chrome/
  site-tab capabilities, tabs_sync, plugin store, a site-only command; presets for youtube.com,
  kick.com, twitch.tv with placeholder selectors; host crate via submodule, path or git
- tests generate into temp dirs: headers via parse_meta (new plugin_meta example), plugin code
  against createCorePluginApi's members, themes against the schema, app TS with tsc against the
  built package, app Rust with cargo metadata/check/test
- wired into bun run check (typecheck incl. checkJs, build:packages, test:create) and pack:check
This commit is contained in:
CRTkafa 2026-09-28 23:17:32 +07:00
parent 376e74884e
commit 4bc8c6a933
17 changed files with 3510 additions and 6 deletions

View file

@ -120,6 +120,17 @@ out-of-range values when it imports a file). Point a theme at it for editor comp
or, in a project that installs the package, `"$schema": "./node_modules/waybetter/theme.schema.json"`.
## Build your own
```sh
npm create waybetter plugin # *.plugin.js (or --ts) using api.scope, storage, ui and theme
npm create waybetter theme # theme JSON with "$schema" pointing at theme.schema.json
npm create waybetter app -- --site youtube.com # a new wayBetter app (Tauri 2 + waybetter-host)
```
[`create-waybetter`](https://www.npmjs.com/package/create-waybetter) generates code against this
package's real API and schema; `--help` lists every option.
## Projects using wayBetter
| Project | Target | What it is |