53 lines
2.3 KiB
Markdown
53 lines
2.3 KiB
Markdown
# @waybetter/shell
|
|
|
|
Shell core for wayBetter: pure, unit-testable models for the app chrome around the pages it
|
|
extends — the address bar's breadcrumb chips, dock/split-pane placement rules, dragged-link
|
|
handling, account profiles, the titlebar update chip, command palette ranking, and native window
|
|
controls. Zero runtime dependencies (the Tauri window API is passed in by the caller, never
|
|
imported).
|
|
|
|
This package ships plain ESM with `.d.ts` types; there is no bundler-specific build step.
|
|
|
|
## Install
|
|
|
|
```sh
|
|
npm install @waybetter/shell
|
|
```
|
|
|
|
## Usage
|
|
|
|
Each module is a separate subpath export:
|
|
|
|
```ts
|
|
import { parseAddress, type AddressSite } from '@waybetter/shell/addressModel';
|
|
import { besideGroup, redundantNavPanes } from '@waybetter/shell/paneModel';
|
|
import { fuzzyScore, rankItems } from '@waybetter/shell/palette';
|
|
import { createWindowControls, type NativeWindow } from '@waybetter/shell/windowControls';
|
|
```
|
|
|
|
Most modules have no framework dependency (no React, no Tauri) so they are unit-tested directly
|
|
under Node; the app wires them into its own UI and native calls. See the source comments in
|
|
`src/` for the contract of each module.
|
|
|
|
## Modules
|
|
|
|
- `addressModel` — `parseAddress(url, site)` for the address bar's breadcrumb chips.
|
|
- `chrome` — layout constants for the custom titlebar/toolbar (mirrored in native code).
|
|
- `linkDrop` — accepting a dragged link dropped into the dock as a tab or split pane.
|
|
- `palette` — command palette fuzzy scoring, ranking and selection movement.
|
|
- `paneModel` — dock pane geometry: where a "beside" link opens, which panes keep the rail.
|
|
- `profileModel` — account profile model, mirrors native `ProfileSettings`.
|
|
- `updateModel` — titlebar update chip model, mirrors native `UpdateStatus`.
|
|
- `windowControls` — native window calls for the titlebar, resize grips and caption buttons.
|
|
|
|
## Projects using wayBetter
|
|
|
|
| Project | Target | What it is |
|
|
| --- | --- | --- |
|
|
| [wayBetter for X](https://waybetter.crt.fyi/twttr/) | x.com (website) | Desktop app around the live X: tabs, split panes, real accounts side by side, themes, plugins, drafts and fixes for X's own bugs. The first wayBetter app. |
|
|
|
|
Built something on wayBetter? Add it to this list with a pull request: name and link, what it extends, one line on what it does.
|
|
|
|
## License
|
|
|
|
GPL-3.0-or-later. See [LICENSE](./LICENSE).
|