Skip to content

AppKit example ​

examples/appkit runs the Directory Vue screens, route table, reactive store and asynchronous storage service of the creator as JavaScript, with native AppKit views and no WebView. It started as the experiment that proved the approach (#367). It now bundles @getcortexlabs/mavis-desktop from source and is where the Mac host is accepted before a release.

Run from the source checkout ​

Use macOS on Apple Silicon, Node 22.23.3 and Xcode command-line tools:

sh
npm ci
npm ci --prefix examples/appkit
npm run build --prefix examples/appkit
npm start --prefix examples/appkit

Search by name or city, open details, edit a place and save. Native menus provide Back/Forward, standard editing shortcuts and a theme toggle. Persistence is scoped to this example in ~/Library/Application Support/Mavis AppKit Experiment/directory.json.

The components, the layout engine and the AppKit host come from the desktop package; src/main.ts is the whole host of the app. The shared Directory sources are imported directly without edits. DOM-dependent code and arbitrary Nuxt modules do not become native merely because JavaScript runs in the app.

Motion and distribution ​

MReveal uses the public @rafaelaugusto/jolt/appkit driver to fade and settle into place with Core Animation. Hiding the content or removing its view interrupts playback. With Reduce Motion enabled the content appears at its final opacity.

The same driver moves a layout component's motionRegion. Mavis knows every frame it lays out, so keyed children glide from where they were, new ones fade in, a removed one fades out where it was before its view goes, and surfaces that come into the window together arrive one after another. The gallery check reads these tracks and the presented opacity from the layers. Regions lists what each region method does on desktop.

npm run package --prefix examples/appkit creates examples/appkit/artifacts/Mavis AppKit.app, including Node, Vue/Directory/Jolt JavaScript, the NativeScript runtime and licenses. It launches without Edge, npm, an installed Node or a preview server. The packager restores framework links omitted by npm and verifies an ad hoc signature. Developer ID signing, hardened-runtime policy, notarization and public distribution remain separate work.

The pinned runtime is @nativescript/macos-node-api@0.5.0-beta.0, with an arm64 binary declaring macOS 13.3 as its minimum. Acceptance on that oldest OS, Intel and Windows is not claimed. Runtime PR #105 is a reference; this build uses the published package.

node scripts/check-appkit.mjs packages and relocates the app, then drives AppKit mouse/keyboard events, editing, persistence, motion and cleanup. It requires a usable WindowServer session. The separate --host-only diagnostic exercises native control actions and the field editor; it does not replace visible UI acceptance, and with MAVIS_DESKTOP_OFFSCREEN=1 it runs with no window on screen. node scripts/check-desktop-gallery.mjs renders one screen that uses every accepted property through the AppKit host, also with no window, checks the native views and writes a picture to artifacts/desktop-gallery. Neither is a claim of physical-pointer or accessibility parity. Evidence is written under artifacts/appkit and collected by the AppKit packaged native acceptance CI job.

Jolt adapter tracking: rafaelaugustos/jolt#516.

Components for NativeScript and Web. Starting with Vue.