Skip to content

Sofle Studio — bun-native dya-studio fork (web app) #30

Description

@rdlu

Goal

Fork cormoran/dya-studio into a clean bun-native project (local working dir ~/Projects/fork, e.g. published as rdlu/dya-studio), so mise run studio (and dev in general) needs no npm/run-script-os workarounds.

Why: running it locally today works but is finicky — bun blocks the two git-dependency client packages' npm-oriented postinstall builds, so our mise run studio task has to build them by hand with tsc (see PR #28 fix(dya): build cormoran Studio client packages). A bun-native fork removes that.

Not worth it? The hosted app (studio.dya.cormoran.works) and the now-fixed mise run studio both work without a fork. This issue is only for wanting a clean codebase to own/hack on.

Feasibility: YES

  • The app is React 19 + Vite + TypeScript — bun runs all of it (bun install, bun run dev, bun run build, bun test). packageManager is unpinned, so no Corepack fight.
  • Its own proto codegen uses buf generate (works under bun already).
  • License: AGPL-3.0 — a public fork must remain open-source + keep attribution. OK for a personal/public fork.

The only real friction (the 2 git-dep client packages)

  • @cormoran/zmk-studio-react-hookgithub:cormoran/react-zmk-studio, postinstall npm run build (tsc).
  • @zmkfirmware/zmk-studio-ts-clientgithub:cormoran/zmk-studio-ts-client#custom-studio-protocol+bluefy, postinstall run-script-os → git-submodule proto + protoc/ts-proto generate + tsc.
  • @types/web-bluetooth / @types/w3c-web-serial are missing → tsc type errors (non-fatal; lib/ still emits).

Plan — Option A (recommended, single fork)

  1. git clone https://github.com/cormoran/dya-studio ~/Projects/fork/dya-studio; set origin to your fork.
  2. Drop package-lock.json + pnpm-lock.yaml; commit bun.lock. Optionally pin "packageManager": "bun@1.3.x".
  3. Convert scripts npm→bun: dev/build/generate/test etc. (dev = bun run generate && vite, …).
  4. Tame the git-dep builds (pick one):
    • keep them as git deps + add a postinstall/prepare (or scripts/setup.ts) that builds both with tsc (ts-client first), mirroring the working step in our mise task; or
    • vendor prebuilt lib/ for each; or
    • replace run-script-os invocations with bun-friendly equivalents.
  5. Add @types/web-bluetooth + @types/w3c-web-serial devDeps so the client builds type-clean.
  6. Convert CI (.github/workflows/test.yml, release.yml) to oven-sh/setup-bun + bun install/bun run. Decide whether to keep the Cloudflare (wrangler.toml) deploy.
  7. Point zmk-sofle's mise run studio at the fork URL and drop the manual tsc build-loop once the fork builds cleanly under bun.

Option B (thorough, 3 forks)

Also fork cormoran/react-zmk-studio + cormoran/zmk-studio-ts-client, make each build bun-native (replace run-script-os, use bun build/tsc), and point the dya-studio fork at your forks. Cleanest long-term; more maintenance.

Decision needed

  • Option A (single fork + build wrapper) vs Option B (3 forks, fully bun-native)?
  • Publish the fork publicly (AGPL obligations) or keep local-only?

Refs: PR #28 (DYA Studio adoption), Issue #29 (v2.5.0 release).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions