Skip to content

refactor: one layout rule for crates, mirrored from packages - #78

Open
ivanbanov wants to merge 1 commit into
crate-namesfrom
layout
Open

ivanbanov wants to merge 1 commit into
crate-namesfrom
layout

Conversation

@ivanbanov

Copy link
Copy Markdown
Member

Stacks on #77 (crate-names). Moves and renames only; no behavior change.

The rule

crates/ mirrors packages/: the engine, then one flat directory per thing that touches a substrate. Sandboxes live under sandbox/.

packages/                     crates/
  core/                         core/
  shared/                         macros/    proc macros; a separate crate because the compiler demands it
    bindings/                   wasm/        bridge: JS runtimes with wasm
    utils/                      jsi/         bridge: React Native (uniffi today)
  react/ solid/                 bindings/    (later) twin of packages/shared/bindings
  native/ opentui/              iced/        (later) target
  wasm/     facade
                              sandbox/
                                shared/      TS palette + connector
                                rust/        Rust palette + dialog (was crates/sandbox)
                                jsi/         the turbo module built from crates/jsi (was sandbox/uniffi)

Moves

Before After Crate / package
crates/macros crates/core/macros dunky-state-machine-macros (unchanged)
crates/uniffi crates/jsi dunky-state-machine-jsi (was -uniffi)
crates/sandbox sandbox/rust dunky-sandbox (unchanged)
sandbox/uniffi sandbox/jsi @sandbox/jsi (was @sandbox/uniffi)
  • The bridge is named for the boundary it crosses, not the tool. uniffi is today's implementation; the contract is the push protocol in crates/wasm/SPEC.md, and a bridge built another way sits behind the same facade.
  • Docs keep two words apart: bridges cross a runtime boundary, bindings are the a11y and event vocabulary targets consume (packages/shared/bindings, Rust twin later). Written down once in ARCHITECTURE.md.
  • cargo package skips nested packages, so publishing dunky-state-machine does not pick up core/macros.

Verified: cargo lint, both cargo test suites, pnpm build:wasm, pnpm lint, pnpm typecheck, pnpm test (390), and pnpm --filter @sandbox/jsi ubrn:ios regenerates the turbo module from the new path.

🤖 Generated with Claude Code

crates/ holds what ships, flat, like packages/: the engine (core, with its proc macros
nested in core/macros because the compiler demands a separate crate) and its bridges
(wasm, jsi). The React Native bridge is named for the boundary it crosses, not the
tool: crates/jsi (dunky-state-machine-jsi), uniffi today. The sandbox machines in Rust
move next to the sandboxes, sandbox/rust, like benchmark/rust; the turbo module built
from the bridge is sandbox/jsi (@sandbox/jsi).

Docs name the role and keep "bridges" (a runtime boundary) apart from "bindings" (the
a11y and event vocabulary). CI paths, the workspace manifest, the wasm build and the
sandbox imports follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dunky-state-machine Ready Ready Preview Oct 12, 2026 9:39am UTC

This branch was successfully deployed

1 active deployment
Preview — c427b269 Deployed Oct 12, 2026 by vercel[bot]
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