lib/contains the Ruby framework code; tests live alongside source as*.test.rb(e.g.,lib/mayu/state.rb→lib/mayu/state.test.rb).lib/mayu/client/holds the browser runtime (Node workspace).example/is a runnable sample app plusmayu.tomlserver config.bin/andexe/provide CLI entry points and scripts.vendor/andnode_modules/are dependency/vendor directories.
- Server-rendered HTML with server-side state; the client runtime applies DOM patches over streaming updates.
- Components return VDOM descriptors; the server diffs component trees and sends patch instructions.
- Client stream and event serialization live under
lib/mayu/client/src/andlib/mayu/client/src/serializeEvent.ts.
bundle installinstalls Ruby dependencies.npm installinstalls Node dependencies (root workspace).npm run buildbuilds the browser runtime via thelib/mayu/clientworkspace.rake testruns the Minitest suite (glob:lib/**/*.test.rb).rake buildruns the client production build and builds the gem.cd example && bundle install && bin/mayu devstarts the example app athttps://localhost:9292/.
- Ruby code uses
.rbwith adjacent tests named*.test.rb. - Prettier is configured (with
@prettier/plugin-ruby) and is used vianpx prettier --write '**/*'. lint-stagedruns Prettier on common file types before commits; keep changes formatted.
- Test framework: Minitest (see
test_helper.rbandRakefile). - Prefer higher-level tests; add focused unit tests for tricky edge cases.
- Keep example app behavior up to date; it serves as a practical integration test.
- Commit messages in this repo are short, imperative sentences (e.g., “Fix margins”, “Update dependencies and modernize code”).
- Include a clear PR description, link issues when relevant, and add screenshots/gifs for UI changes.
- Confirm tests (
rake test) and build (npm run build) before opening a PR.
- Development HTTPS uses a self-signed certificate; follow README instructions if your browser blocks
https://localhost:9292/. - Server settings live in
example/mayu.toml; use[dev.server]options for local development.