Something went wrong. Try again.
Node.js & Bun bindings for Zed’s GPUI. Build memory efficient native apps with React or Solid.js
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839#!/usr/bin/env node/** @jsxImportSource @gpuix/react *//** * disktree [dir]: scan `dir`, or the directory it runs from, and open the window. * * `bun --hot` re-runs this file on save. The store is kept on globalThis so a * save remounts the view on the finished tree instead of starting a second * full scan beside the first. */
import path from 'node:path'import { render } from '@gpuix/react'
import { DisktreeApp, createDisktreeStore, type DisktreeStore } from './app.tsx'
const root = path.resolve(process.argv[2] ?? process.cwd())const global = globalThis as { __disktreeStore?: DisktreeStore }let store = global.__disktreeStoreif (!store || store.get().root !== root) { store = createDisktreeStore(root) global.__disktreeStore = store void store.rescan()}
render(<DisktreeApp store={store} />, { title: 'disktree', appName: 'disktree', width: 1320, height: 840, minWidth: 1100, minHeight: 600, titlebarTransparent: true, windowBackground: 'blurred', trafficLightX: 18, trafficLightY: 20, // Agent checks need real GPU paint, not the user's keyboard. focus: process.env.GPUIX_BACKGROUND !== '1',})