From 157176e2fbd01c7c77a5499718cc8265aad70a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 1 Oct 2026 11:25:34 -0400 Subject: [PATCH] CONTRIBUTING.md: setup, where things go, the house rules reviews catch, checks, license --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..90e7056 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing + +Thanks for helping. Bugs, component requests and pull requests are all welcome. + +## Before you start + +- Try the component live at https://elygpui.com/components/ first; it may already do what you need. +- Open an issue from a template (Bug Report, Component Request or Other) before a large change, so we agree on the shape first. + +## Setup + +- Rust 1.95 with `rustup target add wasm32-unknown-unknown`. No full Xcode needed: gpui compiles its shaders at runtime. +- For the website: Node 24 and pnpm 11. +- Development happens on macOS; the capture tool needs it. + +```sh +cargo run --example gallery # every chapter, light and dark +cargo run --example gallery -- --page forms +``` + +## Where things go + +- A component lives in `src//`, one folder per chapter. One component, one home; anything that duplicates another points to it. +- Its demo is a story on the chapter's page, `examples/gallery/pages/.rs`. After adding or renaming a story, run `python3 scripts/stories.py`. +- `TASKS.md` and `tasks/` track every component; tick its line when it lands. +- The website is `frontend/`; its README section has the commands. + +## House rules + +`AGENTS.md` holds them all. The ones reviews catch most: + +- Colors, sizes, radii and shadows come from `cx.theme()`; no raw `px()` in components. Spacing uses gpui's rem helpers. +- Every component works in light and dark, at 280px wide, by keyboard (Tab reaches it, a 1px focus ring shows, Enter and Space press it), and holds still under reduced motion. +- Fail fast and log state changes; no silent fallbacks. +- Files stay at or under 500 lines. Comments are one short line, and rare. +- A new rule or dependency gets a line in `AGENTS.md`. + +## Checks + +```sh +scripts/check.sh # fmt, clippy, tests, the web lint, house rules +cd frontend && pnpm test && pnpm build && pnpm e2e # when you touch the website +``` + +CI runs the same on every pull request. Fill in the pull request template: what and why, light and dark screenshots for anything that draws. + +## License + +Ely is MIT or Apache-2.0, at your option. Unless you say otherwise, what you contribute is licensed the same way. diff --git a/README.md b/README.md index 09eff1b..a6fd4d5 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Every component ships in light and dark. The palette is warm and quiet. Color ca Every component runs live at https://elygpui.com, compiled to WebAssembly. -Status: early. `TASKS.md` tracks every component, chapter by chapter. +Status: early. `TASKS.md` tracks every component, chapter by chapter. To help, see `CONTRIBUTING.md`. ## Use