Commit af7d6ef
committed
[Improvement] Docs: symlink Stimulus controllers to gem source instead of copying
docs/app/javascript/controllers/ruby_ui/*_controller.js was a hand-maintained
copy of gem/lib/ruby_ui/<component>/*_controller.js. The two silently drifted:
the gem's accordion fix (0897b2a) never landed in the docs copy, breaking the
live accordion preview. Replace all 37 copies with relative symlinks into the
gem source, matching how docs already autoloads Phlex components straight
from gem/ (config/initializers/ruby_ui.rb) with no copy step.
- accordion_controller.js, avatar_controller.js, combobox_controller.js, and
sheet_controller.js had genuinely stale docs content pre-migration (beyond
just accordion) - the symlink now serves the gem's current, correct version.
- esbuild's default symlink handling resolves module imports relative to the
symlink's real (gem/) path, which breaks node_modules resolution since gem/
and docs/ are siblings with no shared ancestor node_modules. Build with
--preserve-symlinks so imports resolve against the symlink location instead.
- Add `rake ruby_ui:sync_controller_symlinks` (docs/lib/tasks/ruby_ui.rake):
scans gem/lib/ruby_ui for *_controller.js and creates/repairs the matching
symlink. Idempotent. Replaces the old "copy the file by hand" step for new
components; stimulus:manifest:update is still required separately to
register a brand-new controller in the manifest.
- Update CLAUDE.md, docs/CLAUDE.md, gem/AGENTS.md, and the ruby-ui-stimulus
skill to describe the symlink relationship and new workflow.
Rebased onto main after PR #490 and PR #495 merged. Both edited a docs
controller copy that this branch replaces with a symlink (accordion, popover),
so both conflicted as modify/delete. Resolved in favour of the symlink: on
main the docs copy and the gem source are byte-identical for each of the two,
so pointing at the gem loses neither fix, and #490's docs-side change becomes
moot now that the file is a symlink.1 parent ab0e420 commit af7d6ef
43 files changed
Lines changed: 99 additions & 3543 deletions
File tree
- .claude/skills/ruby-ui-stimulus
- docs
- app/javascript/controllers/ruby_ui
- lib/tasks
- gem
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
Lines changed: 0 additions & 112 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments