@tarve/core 0.5.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +54 -2
  3. package/dist/npm/build.js +714 -138
  4. package/dist/npm/cli.js +1013 -161
  5. package/dist/npm/embedded-assets.js +7 -2
  6. package/dist/npm/index.js +3096 -1084
  7. package/dist/npm/jsx-dev-runtime.js +1268 -0
  8. package/dist/npm/jsx-runtime.js +1268 -0
  9. package/dist/npm/native-runtime.json +3 -3
  10. package/dist/npm/node-build.js +299 -5
  11. package/dist/npm/protocol.js +1 -1
  12. package/dist/npm/txiki/fetch.ts +228 -0
  13. package/dist/npm/txiki/intl-data.ts +7 -0
  14. package/dist/npm/txiki/intl.test.ts +53 -0
  15. package/dist/npm/txiki/intl.ts +249 -0
  16. package/dist/npm/txiki/prelude.ts +132 -0
  17. package/dist/npm/txiki/runtime.ts +6 -0
  18. package/dist/npm/txiki/shims/buffer.ts +112 -0
  19. package/dist/npm/txiki/shims/child-process.ts +151 -0
  20. package/dist/npm/txiki/shims/crypto.ts +30 -0
  21. package/dist/npm/txiki/shims/events.ts +75 -0
  22. package/dist/npm/txiki/shims/fs-promises.ts +77 -0
  23. package/dist/npm/txiki/shims/fs.ts +231 -0
  24. package/dist/npm/txiki/shims/module.ts +8 -0
  25. package/dist/npm/txiki/shims/net.ts +69 -0
  26. package/dist/npm/txiki/shims/os.ts +72 -0
  27. package/dist/npm/txiki/shims/path.ts +4 -0
  28. package/dist/npm/txiki/shims/timers-promises.ts +9 -0
  29. package/dist/npm/txiki/shims/zlib.ts +9 -0
  30. package/dist/npm/txiki/tjs.d.ts +58 -0
  31. package/dist/npm/txiki/unavailable.ts +10 -0
  32. package/dist/types/core/build.d.ts +5 -2
  33. package/dist/types/core/jsx-compile.d.ts +7 -0
  34. package/dist/types/core/src/advanced-controls.d.ts +1 -1
  35. package/dist/types/core/src/app/element-events.d.ts +18 -0
  36. package/dist/types/core/src/app/media.d.ts +15 -0
  37. package/dist/types/core/src/app/requests.d.ts +25 -0
  38. package/dist/types/core/src/app/shadow.d.ts +7 -0
  39. package/dist/types/core/src/app/stats.d.ts +12 -0
  40. package/dist/types/core/src/app/tray.d.ts +40 -0
  41. package/dist/types/core/src/app-metadata.d.ts +2 -0
  42. package/dist/types/core/src/app.d.ts +29 -27
  43. package/dist/types/core/src/bridge/index.d.ts +1 -1
  44. package/dist/types/core/src/chat-controls.d.ts +2 -1
  45. package/dist/types/core/src/components/button.d.ts +1 -1
  46. package/dist/types/core/src/components/glass.d.ts +52 -0
  47. package/dist/types/core/src/components/icon.d.ts +1 -1
  48. package/dist/types/core/src/components/image.d.ts +1 -1
  49. package/dist/types/core/src/components/layout.d.ts +1 -1
  50. package/dist/types/core/src/components/pressable.d.ts +1 -1
  51. package/dist/types/core/src/components/rich-content.d.ts +1 -1
  52. package/dist/types/core/src/components/scroll.d.ts +2 -2
  53. package/dist/types/core/src/components/svg.d.ts +1 -1
  54. package/dist/types/core/src/components/titlebar.d.ts +15 -1
  55. package/dist/types/core/src/components/window.d.ts +21 -1
  56. package/dist/types/core/src/components.d.ts +2 -0
  57. package/dist/types/core/src/css-shadow.d.ts +1 -1
  58. package/dist/types/core/src/desktop-controls.d.ts +2 -2
  59. package/dist/types/core/src/embedded-assets.d.ts +3 -2
  60. package/dist/types/core/src/extra-controls.d.ts +1 -1
  61. package/dist/types/core/src/form-controls.d.ts +1 -1
  62. package/dist/types/core/src/index.d.ts +20 -11
  63. package/dist/types/core/src/inline-text.d.ts +7 -3
  64. package/dist/types/core/src/intrinsic-style.d.ts +1 -1
  65. package/dist/types/core/src/jsx-runtime.d.ts +10 -4
  66. package/dist/types/core/src/media-element.d.ts +3 -4
  67. package/dist/types/core/src/memo.d.ts +10 -0
  68. package/dist/types/core/src/motion.d.ts +1 -1
  69. package/dist/types/core/src/popups.d.ts +1 -1
  70. package/dist/types/core/src/protocol.d.ts +6 -0
  71. package/dist/types/core/src/reconciler/diff.d.ts +11 -0
  72. package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
  73. package/dist/types/core/src/reconciler.d.ts +10 -11
  74. package/dist/types/core/src/render-scope.d.ts +8 -0
  75. package/dist/types/core/src/style.d.ts +1 -1
  76. package/dist/types/core/src/tailwind-palette.d.ts +1 -0
  77. package/dist/types/core/src/tailwind.d.ts +8 -0
  78. package/dist/types/core/src/test-renderer.d.ts +1 -1
  79. package/dist/types/core/src/text-search.d.ts +1 -1
  80. package/dist/types/core/src/theme.d.ts +8 -1
  81. package/dist/types/core/src/updates.d.ts +87 -0
  82. package/dist/types/core/src/virtual-list.d.ts +3 -1
  83. package/dist/types/core/txiki/fetch.d.ts +1 -0
  84. package/dist/types/core/txiki/intl-data.d.ts +6 -0
  85. package/dist/types/core/txiki/intl.d.ts +92 -0
  86. package/dist/types/core/txiki/prelude.d.ts +1 -0
  87. package/dist/types/core/txiki/runtime.d.ts +2 -0
  88. package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
  89. package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
  90. package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
  91. package/dist/types/core/txiki/shims/events.d.ts +21 -0
  92. package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
  93. package/dist/types/core/txiki/shims/fs.d.ts +44 -0
  94. package/dist/types/core/txiki/shims/module.d.ts +5 -0
  95. package/dist/types/core/txiki/shims/net.d.ts +22 -0
  96. package/dist/types/core/txiki/shims/os.d.ts +52 -0
  97. package/dist/types/core/txiki/shims/path.d.ts +3 -0
  98. package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
  99. package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
  100. package/dist/types/core/txiki/unavailable.d.ts +5 -0
  101. package/dist/types/core/txiki-build.d.ts +23 -0
  102. package/dist/types/core/updates-build.d.ts +35 -0
  103. package/dist/types/protocol/src/index.d.ts +159 -8
  104. package/native/linux-x64/libtarve_native.so +0 -0
  105. package/native/linux-x64/runtime.json +4 -4
  106. package/native/win32-x64/runtime.json +4 -4
  107. package/native/win32-x64/tarve_native.dll +0 -0
  108. package/package.json +3 -2
  109. /package/dist/types/core/{app-metadata.d.ts → package-metadata.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,52 @@ All notable changes to `@tarve/core`, `@tarve/react-icons` and `@tarve/headless`
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.6.0 — 2026-10-15
8
+
9
+ ### Added
10
+ - Signed auto-updates: `tarve keygen` creates an Ed25519 key pair, `tarve release` copies built executables and writes a signed `latest.json` (size and SHA-256 per platform), and `checkForUpdate`, `downloadUpdate`, `installUpdate` and `canInstallUpdate` let a built app update and restart itself. Manifests, URLs (HTTPS only), versions (newer only), app names, sizes, hashes and executable formats are validated on both sides. `tarve release --sign "<command> {file}"` (or `TARVE_SIGN_COMMAND`) Authenticode-signs Windows executables before hashing. `tarve build` now bakes the app version into the executable. See `/docs/updates`.
11
+ - Tailwind utility classes on native views, with no CSS and no DOM: `class` (or `className`) on any element compiles to its native `style` at the JSX call site, and `tw("…")` returns the same `Style` for component `style` props (falsy arguments are skipped, as with `clsx`; an inline `style` wins). Covered: layout (`flex`, `grid`, `items-*`, `justify-*` including `around`/`evenly`, `gap-*`, `gap-x-*`/`gap-y-*`, `inset-*`, `z-*`), spacing and sizing (fractions, `full`, arbitrary `[12px]`/`[50%]`), the full colour palette with `/opacity` modifiers, theme tokens (`bg-primary`, `text-muted-foreground`, `border-border`, also with `/opacity`), typography (`text-sm/6`, `font-*`, `leading-*`, `tracking-*`, `truncate`, `line-clamp-*`, decorations), borders and radii (`rounded-t-lg`, `rounded-tl-*`…), `shadow-*`, `ring-*`, `outline-*`, `opacity-*`, `cursor-*`, `select-*`, `overflow-*`, transforms (`scale-*`, `translate-*`), transitions (`transition`, `duration-*`, `delay-*`, `ease-*`), gradients (`bg-gradient-to-r from-… via-… to-…`) and the `hover:`, `focus:`, `focus-visible:`, `active:`, `disabled:` and `dark:` variants. Also `mx-auto` and friends (auto margins, new in the protocol: `Margins` sides take `"auto"` and percentages), `start-*`/`end-*`, the container scale on widths (`w-xs`, `min-w-sm`), `space-x/y-*` (as a flex gap), `object-*`, `bg-radial`/`bg-conic`/`bg-linear-<angle>` with `from-10%`-style stop positions, coloured shadows (`shadow-red-500/50`), `inset-shadow-*`, `text-shadow-*`, `backdrop-blur-*`/`backdrop-saturate-*` (as the glass material), `animate-spin`, `sr-only`, `outline`, `aspect-3/2`. Breakpoints and `group-hover:` have no native counterpart and are dropped. New `examples/tailwind`: a live playground that shows the style a class list compiles to, a palette with a shade slider, per-corner radius controls, tabs, a gap slider, gradients and a runtime theme switch.
12
+ - A parity suite (`packages/core/src/tailwind-parity.test.tsx`) compiles ~230 utility classes, variants, arbitrary values, gradient and coloured-shadow combinations with the Tailwind CSS 4 compiler itself (`@tailwindcss/node`) and compares every declaration with what `tw()` produces, after resolving its theme variables, `calc()`, `oklch()` and `color-mix()`; the few intentional differences (`inline-flex`, `static`, viewport units, generic font families, `space-*` as a flex gap, `ease-*`/`delay-*` without a duration, Tailwind's transition property list) are listed and asserted there. The colour palette is Tailwind 4's OKLCH palette mapped into sRGB as browsers paint it, generated into `packages/core/src/tailwind-palette.ts` by `bun scripts/tailwind-palette.ts` (`bun run check` fails when it is stale).
13
+ - `Style.dark`: overrides applied when the window theme is dark (its background luminance below 0.5), folded by the reconciler so the native tree never sees the key; also inside inline spans.
14
+ - `Style.radius` takes an object, `{ topLeft, topRight, bottomRight, bottomLeft }`, for per-corner radii. The box, its clip, the solid border and the inner padding-box radii (shrunk by the adjacent border widths, as CSS does) follow each corner; `radius` still transitions, corner by corner. Shadows, glass and outlines use the largest corner for now.
15
+ - `Style.rowGap`/`columnGap` (CSS `row-gap`/`column-gap`), each falling back to `gap`; `justify` accepts `"around"` and `"evenly"`.
16
+ - Layout and paint keys the CSS vocabulary needed: `alignSelf`, `alignContent`, `justifyItems`, `justifySelf` (Taffy had them; the protocol now exposes them), `align: "baseline"`, `justify: "stretch"`, `textAlign: "justify"`, `pointerEvents: "none"` (the pointer falls through the box and its children) and `transform.rotate`/`skewX`/`skewY` in degrees about `originX`/`originY` (fractions of the box), all animating with `transition`.
17
+ - Style variants beyond the pointer states: `group: true` marks a box and `groupHover` applies to its descendants while it is hovered (Tailwind's `group-hover:`); `focusWithin` applies while the box or a descendant has focus; `first`/`last`/`odd`/`even` apply by position among the parent's element children; `sm`/`md`/`lg`/`xl`/`2xl` apply when the window is at least 640/768/1024/1280/1536 px wide, and the app re-renders when the width crosses a breakpoint (the root reports its size only while some style uses one). The position and width variants are folded by the reconciler, side by side (`first:pt-0` over `p-2` keeps the other three sides), so the native tree never sees them. `tw()` emits all of them: `group-hover:`, `focus-within:`, `first:`, `md:hover:`, `dark:md:`…
18
+ - `Icon` names `play`, `pause`, `skip-back` and `skip-forward`, so a transport needs no stand-in glyphs. `over(top, bottom)` composites one hex colour over another (source-over), the operation `Glass` applies to its tint.
19
+ - Glass that flows: `<Glass merge="…">` names a surface, and every glass box of one frame with the same key is drawn as one — where two come within `blend` px of each other (default 32) their shapes bridge with a smooth union, like drops of liquid, and a box fading out (`opacity`) shrinks away out of the surface. `GlassMaterial.merge`/`blend` on `style.glass` for other nodes; the D3D11 renderer fuses up to 8 shapes per surface (the first box's tint, clip and material; later ones paint where the first does). New `examples/liquid`: a weather card and a big lens over a vivid wallpaper, a dock the drops fall into and part from, and a drop that follows the pointer. The `smoke:glass` script checks that merged drops bridge their gap.
20
+ - Liquid Glass, as in iOS 26: `<Glass>` is a container whose backdrop shows through blurred and bent at its rounded edge (a lens, with a trace of chromatic aberration), saturated, under a light veil, with a bright rim on top. `variant` (`regular`, `clear`, `tinted`), `appearance` (`light`, `dark`), `tint`, `radius`, `material` overrides (`blur`, `saturate`, `refraction`, `highlight`, `magnify`) and `shadow`. The glass is a thick slab with a quarter-round edge: the flat part enlarges the backdrop slightly, the edge bends it outward (what lies past the edge is pulled into the rim, with a trace of dispersion) and reflects (a Fresnel glow, a bright edge line, a sheen top-left); the blur is light, the lens is what reads as glass. The material is the new `style.glass` (`GlassMaterial`) on any node, with `background` as its tint; the D3D11 renderer paints it (the backdrop under the box is copied, blurred in two passes and sampled through the edge's distance field; with `msaa` on, tint only), wgpu and the CPU renderer paint the tint, so a glass UI degrades to a translucent one. New `examples/glass`: a music screen with a glass tab bar, floating toolbar, search that morphs out of a button, now-playing card with a pointer-following sheen and a settings sheet; `bun run smoke:glass` checks the blur.
21
+ - `TitleBar` takes `buttonStyle`, merged into each window control (minimize, maximize, close): round 36 px controls inside a glass capsule, as in the glass example, without giving up the standard `showMinimize`/`showMaximize`/`showClose`.
22
+ - `<TitleBar glass>` (or `glass="clear" | "tinted"`, with `appearance="light" | "dark"`) is the ordinary title bar made of Liquid Glass: veil, material, rim, round controls and the appearance's ink, while `title`, `children`, `showMinimize`/`showMaximize`/`showClose` and `buttonStyle` work as before. Lay it over content for the backdrop to show. `glassSurface(variant, appearance, options)` returns the style `Glass` uses, for any node.
23
+ - `TrayOptions`, `TrayHandle`, `TrayMenuItem`, `NotifyOptions` and `SystemMediaSession` are exported from `@tarve/core`; they were the types of `app.tray()`, `app.notify()` and `app.systemMedia()` but could not be named.
24
+ - `onScroll` (Scroll, ScrollArea, VirtualList, DataGrid, MessageScroller) gets a third argument, `{ source }`: `"user"` for the wheel, scrollbar, keyboard and assistive technology, `"program"` for `scrollToItem` and every step of a smooth one, `"layout"` when rows around the anchor change height. `onScrollPosition` carries the same `source`. A view that follows something (lyrics, a log, a "fly to" animation) can now step aside when the user scrolls, without guessing from timing. Runtimes that predate it report `"user"`.
25
+ - `Window`'s `level` can change while the app runs (a `windowLevel` command follows the re-render), and `"alwaysOnBottom"` now holds on Windows: the system placed the window at the bottom only once, so showing, clicking or dragging it brought it forward. A desktop widget takes `level` too, to switch "always behind" off.
26
+ - `Window` desktop widgets: `desktopWidget={{ columns, rows }}` (Windows) makes the window a widget on the desktop icon grid, like a home-screen widget. It is sized to whole icon cells, sits below every window, off the taskbar and Alt+Tab, and when dragged (by a `dragRegion`) it drops into the nearest cells free of icons, never over one; icons that later land under it (a file saved to the desktop, an icon dragged onto it) are moved to the nearest free cell. `position` picks where it first looks for room. The parts are also separate options: `level` (`"normal"`, `"alwaysOnTop"`, `"alwaysOnBottom"`), `skipTaskbar` (Windows: no taskbar button and no Alt+Tab entry) and `frameless` (no native frame without a `TitleBar`). New `examples/widget`: a 3 × 2 clock with CPU and memory. On Linux (X11, or XWayland on a Wayland session) a widget, `skipTaskbar` and `level` set the EWMH window states (`_NET_WM_STATE_BELOW`/`ABOVE`, `SKIP_TASKBAR`, `SKIP_PAGER`, `STICKY` for widgets), and a widget takes cells of a typical icon (80 × 100); there is no desktop icon grid to follow there.
27
+
28
+ ### Fixed
29
+ - `<div onClick>` never fired: the handler was registered but the div compiled to a plain `view`, and only buttons and pressables receive native clicks. A div with `onClick` is now a `pressable`, out of the tab order unless `focusable` says otherwise, as in HTML.
30
+ - Contiguous text children of a box (`Mark {count} as read`) are one anonymous text node, as in CSS; each JSX expression used to become its own text box.
31
+ - A border with different widths per side (`borderWidth: { top: 1, right: 1, bottom: 0, left: 1 }`) on a rounded box lost its corner arcs: the sides were painted as straight rectangles clipped to the rounded shape. It is now the ring between the border box and the padding box, and the D3D11 renderer paints that ring from its distance fields (per-corner radii, antialiased on both edges) instead of the feathered path, which left a hard, jagged inner edge.
32
+ - `Glass` `tint` is laid over the variant's veil instead of replacing it: a tinted `regular` box stays frosted and legible, a tinted `clear` one shows the tint nearly alone, and `tinted` reads as its name says. A gradient tint still passes through as is.
33
+ - `<TitleBar glass>` with a `radius` in `style` is a floating capsule: full rim, drop shadow and clipped corners; without one it stays an edge-to-edge bar with a hairline at the bottom. The glass example built its controls capsule by hand from `glassChrome` and copied veil colours; it now uses the prop.
34
+ - `GlassProps.merge` documents what the renderer does: the first box of a key in tree order paints the surface (tint, material, `blend`), later ones add only their shape; `StateStyle.lineHeight` documents that it is a multiple of the font size, not px (the liquid example passed 64 and the degrees vanished).
35
+ - `app.openFileDialog`/`openFilesDialog`/`openFolderDialog`/`saveFileDialog` rejected with `Native request timed out: fileDialog` when the dialog stayed open for more than 10 s: the request meant to wait forever fell back to the default timeout. A dialog now waits for the user.
36
+ - Uncontrolled state (`<input type="checkbox">` without `checked`, `<details>`, an open `<Select>`, a hovered `Tooltip`, `<audio>` playback) belongs to the app that rendered it: `app.remount()` and a second `createApp` in the same process (tests) start clean instead of inheriting it.
37
+ - `dragRegion` on a plain `View`/`Column` now moves the window from anywhere on it, its plain text included; it only worked on `TitleBar`, which also blocks pointer events. Controls inside still get their own presses.
38
+ - An update sent right as the window closed (a timer ticking while the user clicks ✕) reported `Tried to wake up a closed EventLoop`: commands that reach a closed window are now dropped, as `closed` is already on its way.
39
+ - `skipTaskbar` on Windows stays in effect after the window is hidden, shown or changes `level`: winit rewrote the extended window style on each of those and the window came back in Alt+Tab.
40
+ - A `Window` smaller than 780×580 without `minWidth`/`minHeight` opened at 780×580: the default minimum now never exceeds the requested size. Double-clicking a drag region no longer maximizes a non-resizable window.
41
+ - A hotkey made of a typing key (`Space`, a letter, `Enter`, an arrow…, alone or with Shift) no longer fires while a text field has focus: typing a space in a search box also toggled playback in the player and YouTube Music examples. Chords (`Ctrl+K`), F-keys and `Escape` still fire.
42
+ - `app.focus` and `app.scrollToItem` called right after `app.update()` (or a state change in an event handler) reach the nodes that render adds: they used to go out before the queued render and miss a field or list it was about to create.
43
+ - `app.scrollToItem` on a list that is not mounted (another page, a hidden panel) does nothing, like `scrollIntoView` on a detached element, instead of reporting an error. A mounted node that is not a variable `VirtualList` still errors.
44
+ - `<audio src="https://…">` from googlevideo (YouTube) failed on many songs: the CDN answers 403 to a second request to a file while one is in flight, and to a range behind what it already served, and the stream used four parallel connections plus jumps for seeks. A remote file now downloads in one forward pass (4 MB ranges, one connection; a seek more than 8 MB ahead, as in a long podcast, starts a pass there), retrying 403, 429, 5xx and network errors with backoff (not 404). A 40-song soak went from 32 errors to none, in a third of the time; first sound ~0.6 s.
45
+ - `<audio>` follows the output device: when it goes away (unplugged, sleep, a driver restart) or the default output changes, a new output stream plays on from the same sample. Tracks are mixed (in the first device's own format, so samples are converted once) into one mix that outlives output streams, so nothing is reopened, reloaded or sought (a switch used to restart the song, and failing to seek could skip it).
46
+ - `<audio>` never blocks the window on the audio thread: rodio's `try_seek` and `clear` wait for the audio thread to acknowledge, so a stalled network read or a lost device froze the whole app on the next seek or song change. Seeks now run on a helper thread (`seeked` fires once done) and a replay swaps in a new player.
47
+ - A remote `<audio>` whose network stalls for 30 s reports an error (the page can reload it) instead of ending as if the track were over.
48
+
49
+ ### Performance
50
+ - Each update no longer copies every native node into the shadow tree the reconciler diffs against; nodes are shared with the compiled tree and copied only when native edited them (typed text, a dragged slider). Nodes without handlers no longer allocate a 32-slot handler record. On a 2 000-row list (6 000 nodes) one update went from ~23 ms to ~19 ms of TypeScript time and the retained heap from 12.5 MB to 7.2 MB; at 30 000 nodes, 140 ms → 112 ms and 54 MB → 26 MB (`bun run bench:reconcile`). Rendering a list through `memo` stays the real win: 2.9 ms → 2.0 ms on the same tree.
51
+ - A window hidden with `app.hide()` (close to tray) drops its GPU device, swap chain and textures, stops animation ticks and layout, and trims its working set; `app.show()` builds them again and paints before the window appears. Measured on Windows with an animated window: GPU memory 29 MB → 0, CPU 3–10% → 0, threads 48 → 25, working set 39 → 20 MB; showing again takes ~80–130 ms. Minimized windows also stop animation ticks. `capture()` of a hidden window still works: it builds a renderer for that frame and gives it back.
52
+
7
53
  ## 0.5.0 — 2026-10-12
8
54
 
9
55
  ### Performance
package/README.md CHANGED
@@ -6,7 +6,7 @@ Tarve turns a TSX tree into a retained native interface. It does not use a brows
6
6
 
7
7
  > **Current supported targets:** Windows x64 and Linux x64
8
8
  >
9
- > **Runtime:** Bun 1.4+
9
+ > **Runtime:** Bun 1.4+ or Node.js 26.10+
10
10
  >
11
11
  > **Package:** [`@tarve/core`](https://www.npmjs.com/package/@tarve/core) (CLI: `tarve`)
12
12
  >
@@ -120,6 +120,27 @@ await build({
120
120
  });
121
121
  ```
122
122
 
123
+ ## Auto-updates
124
+
125
+ Built apps can update themselves from signed releases hosted on any HTTPS server (GitHub Releases, S3/R2, a CDN). The full guide is at [tarve.dev/docs/updates](https://tarve.dev/docs/updates).
126
+
127
+ ```bash
128
+ bunx tarve keygen # once: ./tarve-update.key (secret) + the public key
129
+ bunx tarve build app.tsx --version 1.2.0 --outfile dist/App.exe
130
+ bunx tarve release --version 1.2.0 --artifact win32-x64=dist/App.exe --out dist/updates \
131
+ --sign "signtool sign /fd sha256 /tr http://timestamp.digicert.com /td sha256 /a {file}" # optional Authenticode
132
+ # upload dist/updates: the executables first, latest.json last
133
+ ```
134
+
135
+ ```ts
136
+ import { canInstallUpdate, checkForUpdate, downloadUpdate, installUpdate } from "@tarve/core";
137
+
138
+ const update = await checkForUpdate({ url: "https://example.com/app/latest.json", publicKey: "…" });
139
+ if (update && canInstallUpdate()) installUpdate(await downloadUpdate(update, { onProgress: (n, total) => {} }));
140
+ ```
141
+
142
+ `latest.json` is signed with Ed25519 and lists the size and SHA-256 of each platform's executable; the app checks the signature, only accepts newer versions, HTTPS URLs and a matching app name, and verifies the download before `installUpdate` swaps the executable and restarts. `--sign` (or `TARVE_SIGN_COMMAND`) runs your Authenticode tool on each Windows executable before it is hashed. Self-updating needs a writable install folder (per-user or portable); `canInstallUpdate()` is false under `Program Files` or a package manager. txiki.js builds are not supported yet.
143
+
123
144
  ## Node.js runtime
124
145
 
125
146
  The same TSX components, desktop APIs, renderer modes and native bridge run on Node.js 26.10+ with the same `tarve run|dev|build` commands; a Node-only project needs neither Bun nor Rust:
@@ -197,7 +218,7 @@ function App() {
197
218
 
198
219
  Every colour property (`background`, `foreground`, `borderColor`, `outlineColor`, rich-content and diff colours, state styles and the window background) accepts hex (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`), `rgb()`/`rgba()`, `hsl()`/`hsla()`, common names such as `transparent` or `white`, and theme tokens. Unsupported colour strings throw when the view is compiled instead of rendering black.
199
220
 
200
- `transform` translates and scales a node and its subtree about the box centre: `{ x, y, scale, scaleX, scaleY }` or CSS syntax such as `"translateY(-2px) scale(1.02)"`. It is paint-only (layout does not move) but hit testing and hover follow the transformed box, and it transitions like other paint properties. Rotation is not supported yet.
221
+ `transform` translates, scales, rotates and skews a node and its subtree: `{ x, y, scale, scaleX, scaleY, rotate, skewX, skewY, originX, originY }` (angles in degrees; the origin is a fraction of the box, the centre by default) or CSS syntax such as `"translateY(-2px) scale(1.02)"`. It is paint-only (layout does not move) but hit testing and hover follow the transformed box, and it transitions like other paint properties. `radius` takes a number or per-corner `{ topLeft, topRight, bottomRight, bottomLeft }`; `margin` sides take `"auto"` to centre a box or push it aside, as CSS auto margins do.
201
222
 
202
223
  Borders accept `borderStyle` with the same values as `outlineStyle` (`dashed`, `dotted`, `double`, `groove`, `ridge`, `inset`, `outset`, `none`); non-solid styles apply when all four border widths are equal. Text, button labels, `Input` and `TextArea` accept `textShadow: { x, y, blur, color }`, an offset copy of the glyphs (`blur` is the CSS blur radius; 0 is a solid copy, larger values blur it identically on every renderer); it also works inside state styles such as `hover`.
203
224
 
@@ -220,6 +241,36 @@ Both shadows also accept CSS syntax: `boxShadow: "inset 0 1px 2px rgba(0,0,0,.2)
220
241
 
221
242
  Create derived themes with `createTheme` or `Theme.create`. Theme tokens cover surfaces, foregrounds, borders, focus outlines, selection, caret, scrollbars, modal overlays, rich-content colors, and control states.
222
243
 
244
+ Besides `hover`, `focus`, `focusVisible`, `active` and `disabled`, a style can carry `groupHover` (applied while an ancestor with `group: true` is hovered), `focusWithin` (while the box or a descendant has focus), `dark` (under a dark window theme), `first`/`last`/`odd`/`even` (by position among the parent's element children) and `sm`/`md`/`lg`/`xl`/`2xl` (window at least 640/768/1024/1280/1536 px wide; the app re-renders when the width crosses a breakpoint). The last three groups are folded by the reconciler, so the native tree never sees them.
245
+
246
+ ## Tailwind classes
247
+
248
+ Tailwind CSS utility classes work on every element, with no CSS and no DOM: `class` (or `className`) compiles to the element's native `style` at the JSX call site, and `tw("…")` returns the same `Style` for component `style` props. Later classes win and an inline `style` wins over classes, as in CSS.
249
+
250
+ ```tsx
251
+ import { Column, Text, Window, tw } from "@tarve/core";
252
+
253
+ function Card({ active }: { active: boolean }) {
254
+ return (
255
+ <Window>
256
+ <div class="group flex flex-col gap-2 p-4 rounded-xl bg-card border border-border shadow-md hover:shadow-lg dark:bg-zinc-900 md:flex-row">
257
+ <span class="text-sm font-semibold text-foreground group-hover:text-primary">Title</span>
258
+ <div class={`px-3 py-1.5 rounded-md text-sm transition active:scale-95 ${active ? "bg-primary text-primary-foreground" : "bg-muted text-muted-foreground"}`} onClick={() => {}}>
259
+ Action
260
+ </div>
261
+ </div>
262
+ <Column style={tw("gap-1 p-3 rounded-lg border border-border", active && "bg-primary/10")}>
263
+ <Text style={tw("text-xs text-muted-foreground")}>tw() composes like clsx</Text>
264
+ </Column>
265
+ </Window>
266
+ );
267
+ }
268
+ ```
269
+
270
+ The vocabulary follows Tailwind CSS 4 and is checked class by class against the real compiler (`packages/core/src/tailwind-parity.test.tsx`): layout (`flex`, `grid`, `items-*`, `self-*`, `content-*`, `justify-*`, `place-*`, `gap-*`, `gap-x/y-*`, `space-x/y-*`, `inset-*`, `start-*`/`end-*`, `z-*`), spacing and sizing (the 4 px scale, fractions, `full`, the container scale on `w-*`/`min-w-*`/`max-w-*`, `mx-auto`, arbitrary `[12px]`/`[50%]`), the full colour palette (Tailwind 4's OKLCH colours mapped into sRGB) with `/opacity` modifiers, theme tokens (`bg-primary`, `text-muted-foreground`, `border-border`, also with `/opacity`), typography (`text-sm/6`, `font-*`, `leading-*`, `tracking-*`, `text-justify`, `truncate`, `line-clamp-*`, decorations), borders and radii per side and corner, `shadow-*` and `inset-shadow-*` with colours, `text-shadow-*`, `ring-*`, `outline-*`, `opacity-*`, `cursor-*`, `select-*`, `pointer-events-*`, `overflow-*`, `object-*`, `aspect-*`, transforms (`scale-*`, `translate-*`, `rotate-*`, `skew-*`, `origin-*`), transitions (`transition`, `duration-*`, `delay-*`, `ease-*`), `animate-spin`, gradients (`bg-linear-to-r`, `bg-linear-45`, `bg-radial`, `bg-conic`, `from-*`/`via-*`/`to-*` with positions), `backdrop-blur-*`/`backdrop-saturate-*` (as the Liquid Glass material) and the variants `hover:`, `focus:`, `focus-visible:`, `focus-within:`, `active:`, `disabled:`, `group-hover:` (with `group`), `dark:`, `first:`/`last:`/`odd:`/`even:` and `sm:`…`2xl:`.
271
+
272
+ What has no native counterpart is dropped rather than approximated: `inline`/`table`/`float` layouts, `fixed`/`sticky`, min/max-content widths, viewport units, CSS filters (`blur`, `grayscale`, `drop-shadow`), blend modes, lists, columns, pseudo-elements (`before:`, `placeholder:`, `selection:`), `print:`/`motion-*:`/`rtl:`, `peer-*`, `has-[]`, arbitrary properties (`[mask-type:luminance]`) and `calc()` lengths. A few classes map to the closest native notion: `inline-flex` is `flex`, `static` is `relative`, `space-x/y-*` is a flex gap, `ring-*`/`outline-*` are both the outline, `backdrop-*` needs the D3D11 renderer (others paint the tint), and `ease-*`/`delay-*` animate nothing without a duration, as CSS does. The `tailwind` example is a live playground.
273
+
223
274
  ## Native motion
224
275
 
225
276
  Tarve transitions retained native values without a Bun timer or per-frame TSX render. Bun sends the new target once; Rust owns interpolation, layout/paint invalidation, frame scheduling, retargeting, and completion.
@@ -585,6 +636,7 @@ bun run diff
585
636
  bun run motion
586
637
  bun run studio
587
638
  bun run performance
639
+ bun run tailwind
588
640
  ```
589
641
 
590
642
  From the repository root, `bun run dev --entry examples/<name>/<name>.tsx` runs an example with hot reload and the development tools enabled.