Unify gem and docs into a monorepo
Merged
CI
6mo ago+19114+19114+01234567890123456789012345678901234567890123456789-699-699-012345678901234567890123456789
Summary
Consolidates ruby-ui/ruby_ui (the gem) and ruby-ui/web (the docs Rails app at rubyui.com) into a single repository with a symmetric layout:
ruby_ui/
├── gem/ # the ruby_ui gem (lib/, generators, tests, gemspec)
└── docs/ # the Rails app powering rubyui.com, consumes the local gem via path: "../gem"
The motivating problem: every component change required two coordinated PRs (one in the gem, one in web), and the docs app already mirrored the entire gem under app/components/ruby_ui/. With this change, a single PR can touch both the component and its documentation example, and the docs app reads from gem/lib/ directly — no copy step, no version skew.
Key decisions
- Repo: kept
ruby-ui/ruby_uiso the gem URL, issues, and stars stay put.ruby-ui/webwill be archived after cutover. - History:
web/imported viagit subtree add(no squash).git log -- docs/preserves the original commits, authors, and dates fromweb. - Mirror eliminated: dropped
docs/app/components/ruby_ui/entirely. The docs app's autoloader pushes the gem'slib/ruby_ui/directory into theRubyUInamespace;*_docs.rbandlib/ruby_ui/docs/are ignored to avoid Zeitwerk namespace conflicts (the docs app keeps its own richerComponents::Docs::*andViews::Docs::*implementations). - CI unified: new
.github/workflows/ci.ymlat the root runs three jobs — gem (Ruby 3.3 + 3.4 matrix), docs (Rails app), and docker-build for the devcontainer image. The previousverify_componentsjob is deleted (no mirror to verify). - Docker build context is now the monorepo root so
gem/is visible tobundle install(resolvespath: "../gem"from inside/rails/). Run from the repo root:flyctl deploy --config docs/fly.toml --dockerfile docs/Dockerfile .. - Gemspec packaging unchanged:
s.files = Dir["README.md", "LICENSE.txt", "lib/**/*"]continues to be the explicit allowlist.gem buildfromgem/still ships exactly the same 289 files (onlylib/, README, LICENSE) — nothing fromdocs/leaks. A newgem/test/gemspec_test.rbregression test guards this.
What changed
- Move: all gem source (
lib/,test/,bin/,Gemfile*,ruby_ui.gemspec,Rakefile,.devcontainer/,.tool-versions, etc.) →gem/(preserves per-file blame). - Import: entire
ruby-ui/webhistory merged in underdocs/. docs/Gemfile:gem "ruby_ui", github: ...→gem "ruby_ui", path: "../gem".docs/config/initializers/ruby_ui.rb: push the gem's lib path into the autoloader, ignore*_docs.rbanddocs/subfolder.- URLs:
github.com/ruby-ui/ruby_ui/blob/main/lib/ruby_ui/...updated togem/lib/ruby_ui/...in views and theme grids (externalruby_ui_pro/ruby_ui_stimulusrefs left alone). - Root files: new
README.md(monorepo overview), newCONTRIBUTING.md(unified workflow),.github/CODEOWNERS,.github/dependabot.yml(covering bundler in/gemand/docs, npm in/docs, github-actions, devcontainers in both),.github/pull_request_template.md. gem/AGENTS.md/gem/CONTRIBUTING.md: updated to describe the monorepo context; dropped the obsolete instruction to also open a PR onruby-ui/web.
Verified locally
cd gem && bundle exec rake→ 106 runs, 469 assertions, 0 failures, 0 errors. Standardrb: 309 files, no offenses.cd gem && gem build ruby_ui.gemspec→ 289 files in the .gem; onlyREADME.md,LICENSE.txt, andlib/**/*. Nothing fromdocs/,test/, or.github/leaks.cd docs && bundle lock→ resolvesPATH remote: ../gemcorrectly. (Fullbundle installfailed locally on sqlite3 native build due to host env — CI will exercise this with proper system deps.)
Test plan
- CI is green on this PR (gem matrix on 3.3 + 3.4, docs Rails, docker-build).
-
cd docs && bin/devrenders the documentation site locally; spot-check/docs/button,/docs/combobox,/docs/changelog,/docs/getting_started/*. -
docker build -f docs/Dockerfile -t rubyui-docs .from the repo root completes successfully. - After merge, dry-run a Fly deploy from a branch:
flyctl deploy --config docs/fly.toml --dockerfile docs/Dockerfile . --build-only.
Cutover (post-merge, separate steps)
- Deploy
docs/to Fly (rubyui.com) and verify production. - Tag
v1.2.0of the gem fromgem/:cd gem && bundle exec rake release. - Archive
ruby-ui/webon GitHub and update its README to point here. Don't delete — preserves external links, issues, and PRs as read-only. - Coordinate with any open PRs on
ruby-ui/web(offer rebase paths intodocs/).
🤖 Generated with Claude Code