@quickgui/native 0.0.1

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 ADDED
@@ -0,0 +1,49 @@
1
+ # @quickgui/native
2
+
3
+ Low-level Bun/N-API host for QuickGUI. AppKit/Winit permanently owns the process main thread while
4
+ the application runs on Bun's ordinary Worker event loop. Bounded native command and event queues
5
+ connect the two; a Winit proxy wakes the main thread only when Worker work arrives. Settled
6
+ applications therefore block without a polling interval, timer shim, or descriptor scan. The host
7
+ retains a JavaScript node tree, sends bounded binary mutation batches to Rust, and routes bounded
8
+ native events to independent `Window` trees. Native input nodes route
9
+ controlled value payloads, including masked password fields, and native Markdown nodes retain
10
+ QuickGUI core parser/render state across mutations. `new Window({ anchor: node, ... })` creates a display-aware,
11
+ parent-owned native popover. Every window receives a renderer adapter through
12
+ `new Window({ renderer, ... })`, owns the returned cleanup function, and disposes it when the
13
+ window closes. Its initial renderer batch is committed before the native window opens, preserving
14
+ one content-complete first-frame boundary. The `Dialog` namespace exposes `showAlertDialog`, `showOpenDialog`, and
15
+ `showSaveDialog`; each accepts an optional leading `Window`, matching Electron's parented and
16
+ application-modal call shapes. Alert dialogs resolve with a button index, while file dialogs use
17
+ Electron-shaped result objects. The file-dialog backend uses QuickGUI's AppKit panels on macOS and
18
+ `rfd` on Windows and Linux. The portable alert backend supports up to three uniquely labelled
19
+ buttons. Linux file dialogs prefer XDG Desktop Portals (with RFD's Zenity fallback), while Linux
20
+ alert dialogs require Zenity because the portal API has no standardized message-dialog surface.
21
+
22
+ System services are core-first and exported from this package: singleton `app` lifecycle,
23
+ identity, paths, system information, relaunch, and single-instance locking; `Appearance`,
24
+ `AutoStart`, `Clipboard`, `DeepLink`, `Desktop`, `GlobalShortcut`, `Keyboard`, `Menu`,
25
+ `Notifications`, `Permissions`, `PowerAssertion`, `PowerMonitor`, `Screen`, `SecureStorage`,
26
+ `Shell`, `SystemPreferences`, `Tray`, `Updater`, and imperative `Window` controls. The updater
27
+ discovers, stages, re-verifies, and installs supported native artifacts through the Rust core.
28
+
29
+ Most applications should depend on this package and [`@quickgui/solid`](../solid/README.md)
30
+ directly. Import `app`, `Window`, dialogs, and platform APIs here, await `app.whenReady()`, then pass
31
+ Solid's `createRenderer(() => <App />)` to `Window`. The QuickGUI CLI owns the application loop for
32
+ packaged and development applications, so application code never calls `app.run()`. The native
33
+ package remains the renderer-neutral layer for additional JavaScript reconcilers.
34
+
35
+ From the repository root:
36
+
37
+ ```console
38
+ bun run build:native
39
+ bun test packages/native
40
+ ```
41
+
42
+ The native source declares macOS, Windows, and Linux targets. The 0.0.1 npm release contains and
43
+ supports macOS arm64 and x64 addons; later releases can add other platforms once their addons and
44
+ acceptance gates are ready. A source checkout only needs the host `.node` build for development.
45
+ The source protocol is versioned and malformed batches are rejected transactionally before the
46
+ committed retained tree changes.
47
+
48
+ On macOS, the build script detects a selected beta Xcode and prefers `/Applications/Xcode.app`
49
+ when it is available. Set `QUICKGUI_ALLOW_BETA_XCODE=1` to opt out of that fallback.