Skip to content

refactor(orchestra): make @novus/orchestra a self-contained package#31

Open
feledori wants to merge 2 commits into
mainfrom
refactor/orchestra-standalone
Open

refactor(orchestra): make @novus/orchestra a self-contained package#31
feledori wants to merge 2 commits into
mainfrom
refactor/orchestra-standalone

Conversation

@feledori

@feledori feledori commented Jun 2, 2026

Copy link
Copy Markdown

Summary

Hardens @novus/orchestra (the dev debug panel) into a package that drops into any React app — no Tailwind, no UI-primitive dependency, no app-owned globals. Two commits:

1. Dependency correctness + decoupling

  • three → optional peerDependency (only a type import in the unexported R3F Group helper); added @react-three/fiber as an optional peer for the <group> it renders.

2. Self-contained panel

  • Base UI removedCmdo renders via createPortal + the existing keydown handler instead of @base-ui/react Dialog. (react-dom added as a peer.)
  • Tailwind removed — the command palette, toggles, and grid overlay are styled with CSS Modules (token-free neutral colors) instead of bg-primary/secondary utility classes.
  • clsx removed — classNames composed with template strings.
  • Owns its globaltheatre/index declares and writes the typed window.THEATRE_PROJECT_ID itself (and studio reads it directly), so the app's utils/types.d.ts no longer needs to declare it. Importing the Theatre runtime makes the global readable + typed anywhere.
  • Added a README documenting exports, peers, and the remaining soft host expectation (the grid overlay reads --columns / --gap, already overridable).

Dependency tally

  • Runtime: @theatre/core, @theatre/studio, hamo, stats-gl, tempus, zustand
  • Required peers: react, react-dom
  • Optional peers: three, @react-three/fiber
  • Removed: @base-ui/react, clsx, three (→ optional peer)

Test Plan

  • bun install@base-ui/react + clsx out of the lockfile; peers resolve
  • bun run check — lint 0/0, format, typecheck clean
  • bun run build — green

feledori added 2 commits June 2, 2026 16:37
- Move `three` to optional peerDependencies (used only as a type import
  in the unexported Theatre R3F `Group` helper); add `@react-three/fiber`
  as an optional peer for the `<group>` intrinsic it renders.
- Drop reliance on the app-declared `Window.THEATRE_PROJECT_ID` ambient:
  cast at the write site in theatre/index (matching the read in studio),
  and remove the now-orphaned global from the app's utils/types.d.ts.
- Add a README documenting exports, peers, and the soft host expectations
  (Tailwind tokens for the panel UI, `--columns` for the grid overlay).
Makes the dev panel self-contained so it drops into any React app:
- Cmdo renders via createPortal instead of @base-ui/react Dialog.
- Panel + grid overlay styled with CSS Modules, no Tailwind tokens.
- Remove clsx; classNames composed with template strings.
- Own the typed window.THEATRE_PROJECT_ID global in theatre/index
  (supersedes the prior cast/removal); studio reads it directly.
- Add react-dom peer (createPortal); README updated.
@feledori feledori changed the title refactor(orchestra): harden @novus/orchestra as a standalone package refactor(orchestra): make @novus/orchestra a self-contained package Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant