plutonium 0.34.1 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/plutonium/skill.md +53 -0
  3. data/.claude/skills/{assets → plutonium-assets}/SKILL.md +13 -8
  4. data/.claude/skills/{connect-resource → plutonium-connect-resource}/SKILL.md +1 -1
  5. data/.claude/skills/{controller → plutonium-controller}/SKILL.md +27 -13
  6. data/.claude/skills/{create-resource → plutonium-create-resource}/SKILL.md +1 -1
  7. data/.claude/skills/{definition → plutonium-definition}/SKILL.md +10 -10
  8. data/.claude/skills/{definition-actions → plutonium-definition-actions}/SKILL.md +34 -9
  9. data/.claude/skills/{definition-fields → plutonium-definition-fields}/SKILL.md +38 -10
  10. data/.claude/skills/plutonium-definition-query/SKILL.md +356 -0
  11. data/.claude/skills/{forms → plutonium-forms}/SKILL.md +6 -6
  12. data/.claude/skills/{installation → plutonium-installation}/SKILL.md +9 -9
  13. data/.claude/skills/{interaction → plutonium-interaction}/SKILL.md +20 -19
  14. data/.claude/skills/{model → plutonium-model}/SKILL.md +3 -3
  15. data/.claude/skills/{model-features → plutonium-model-features}/SKILL.md +3 -3
  16. data/.claude/skills/{nested-resources → plutonium-nested-resources}/SKILL.md +5 -5
  17. data/.claude/skills/{package → plutonium-package}/SKILL.md +7 -8
  18. data/.claude/skills/{policy → plutonium-policy}/SKILL.md +26 -4
  19. data/.claude/skills/{portal → plutonium-portal}/SKILL.md +33 -31
  20. data/.claude/skills/{resource → plutonium-resource}/SKILL.md +27 -27
  21. data/.claude/skills/{rodauth → plutonium-rodauth}/SKILL.md +5 -5
  22. data/.claude/skills/plutonium-theming/SKILL.md +424 -0
  23. data/.claude/skills/{views → plutonium-views}/SKILL.md +7 -7
  24. data/CHANGELOG.md +52 -0
  25. data/CLAUDE.md +215 -0
  26. data/CONTRIBUTING.md +72 -18
  27. data/README.md +100 -19
  28. data/app/assets/plutonium.css +1 -11
  29. data/app/assets/plutonium.js +1685 -1146
  30. data/app/assets/plutonium.js.map +4 -4
  31. data/app/assets/plutonium.min.js +70 -70
  32. data/app/assets/plutonium.min.js.map +4 -4
  33. data/app/views/resource/interactive_bulk_action.html.erb +1 -5
  34. data/app/views/rodauth/_email_auth_request_form.html.erb +1 -1
  35. data/app/views/rodauth/_login_form.html.erb +15 -55
  36. data/app/views/rodauth/_login_form_footer.html.erb +2 -2
  37. data/app/views/rodauth/_password_visibility.html.erb +2 -8
  38. data/app/views/rodauth/add_recovery_codes.html.erb +2 -2
  39. data/app/views/rodauth/change_login.html.erb +36 -19
  40. data/app/views/rodauth/change_password.html.erb +34 -10
  41. data/app/views/rodauth/close_account.html.erb +12 -4
  42. data/app/views/rodauth/confirm_password.html.erb +19 -17
  43. data/app/views/rodauth/create_account.html.erb +30 -109
  44. data/app/views/rodauth/email_auth.html.erb +1 -1
  45. data/app/views/rodauth/logout.html.erb +4 -4
  46. data/app/views/rodauth/otp_auth.html.erb +13 -4
  47. data/app/views/rodauth/otp_disable.html.erb +12 -4
  48. data/app/views/rodauth/otp_setup.html.erb +29 -12
  49. data/app/views/rodauth/otp_unlock.html.erb +19 -10
  50. data/app/views/rodauth/otp_unlock_not_available.html.erb +7 -7
  51. data/app/views/rodauth/recovery_auth.html.erb +12 -4
  52. data/app/views/rodauth/recovery_codes.html.erb +12 -4
  53. data/app/views/rodauth/remember.html.erb +7 -7
  54. data/app/views/rodauth/reset_password.html.erb +23 -7
  55. data/app/views/rodauth/reset_password_request.html.erb +14 -10
  56. data/app/views/rodauth/sms_auth.html.erb +13 -4
  57. data/app/views/rodauth/sms_confirm.html.erb +13 -4
  58. data/app/views/rodauth/sms_disable.html.erb +12 -4
  59. data/app/views/rodauth/sms_request.html.erb +1 -1
  60. data/app/views/rodauth/sms_setup.html.erb +23 -7
  61. data/app/views/rodauth/two_factor_auth.html.erb +2 -2
  62. data/app/views/rodauth/two_factor_disable.html.erb +12 -4
  63. data/app/views/rodauth/two_factor_manage.html.erb +7 -7
  64. data/app/views/rodauth/unlock_account.html.erb +13 -5
  65. data/app/views/rodauth/unlock_account_request.html.erb +2 -2
  66. data/app/views/rodauth/verify_account.html.erb +25 -7
  67. data/app/views/rodauth/verify_account_resend.html.erb +14 -10
  68. data/app/views/rodauth/verify_login_change.html.erb +1 -1
  69. data/app/views/rodauth/webauthn_auth.html.erb +1 -1
  70. data/app/views/rodauth/webauthn_remove.html.erb +18 -8
  71. data/app/views/rodauth/webauthn_setup.html.erb +12 -4
  72. data/docs/.vitepress/config.ts +15 -26
  73. data/docs/.vitepress/theme/custom.css +388 -29
  74. data/docs/getting-started/index.md +1 -1
  75. data/docs/getting-started/tutorial/02-first-resource.md +9 -0
  76. data/docs/getting-started/tutorial/06-nested-resources.md +2 -2
  77. data/docs/getting-started/tutorial/07-author-portal.md +191 -0
  78. data/docs/getting-started/tutorial/{07-customizing-ui.md → 08-customizing-ui.md} +7 -7
  79. data/docs/getting-started/tutorial/index.md +5 -2
  80. data/docs/guides/authorization.md +33 -0
  81. data/docs/guides/creating-packages.md +12 -16
  82. data/docs/guides/custom-actions.md +36 -0
  83. data/docs/guides/search-filtering.md +121 -42
  84. data/docs/guides/theming.md +232 -36
  85. data/docs/index.md +203 -57
  86. data/docs/public/og-image.png +0 -0
  87. data/docs/reference/controller/index.md +14 -16
  88. data/docs/reference/definition/actions.md +38 -3
  89. data/docs/reference/definition/fields.md +3 -3
  90. data/docs/reference/definition/index.md +2 -2
  91. data/docs/reference/generators/index.md +0 -1
  92. data/docs/reference/interaction/index.md +14 -10
  93. data/docs/reference/model/index.md +0 -1
  94. data/docs/reference/portal/index.md +13 -27
  95. data/gemfiles/rails_7.gemfile.lock +1 -1
  96. data/gemfiles/rails_8.0.gemfile.lock +1 -1
  97. data/gemfiles/rails_8.1.gemfile.lock +1 -1
  98. data/lib/generators/pu/pkg/portal/portal_generator.rb +0 -2
  99. data/lib/generators/pu/pkg/portal/templates/app/views/package/dashboard/index.html.erb +28 -72
  100. data/lib/plutonium/action/interactive.rb +2 -2
  101. data/lib/plutonium/core/controller.rb +2 -1
  102. data/lib/plutonium/definition/actions.rb +2 -2
  103. data/lib/plutonium/lib/deep_freezer.rb +3 -7
  104. data/lib/plutonium/query/filter.rb +14 -0
  105. data/lib/plutonium/query/filters/association.rb +49 -0
  106. data/lib/plutonium/query/filters/boolean.rb +35 -0
  107. data/lib/plutonium/query/filters/date.rb +97 -0
  108. data/lib/plutonium/query/filters/date_range.rb +58 -0
  109. data/lib/plutonium/query/filters/select.rb +55 -0
  110. data/lib/plutonium/resource/controllers/crud_actions.rb +24 -6
  111. data/lib/plutonium/resource/controllers/interactive_actions.rb +76 -58
  112. data/lib/plutonium/resource/controllers/queryable.rb +4 -2
  113. data/lib/plutonium/resource/query_object.rb +1 -1
  114. data/lib/plutonium/ui/action_button.rb +23 -65
  115. data/lib/plutonium/ui/actions_dropdown.rb +103 -0
  116. data/lib/plutonium/ui/block.rb +1 -1
  117. data/lib/plutonium/ui/breadcrumbs.rb +12 -19
  118. data/lib/plutonium/ui/color_mode_selector.rb +1 -1
  119. data/lib/plutonium/ui/component/kit.rb +6 -0
  120. data/lib/plutonium/ui/component_classes.rb +102 -0
  121. data/lib/plutonium/ui/display/base.rb +15 -0
  122. data/lib/plutonium/ui/display/components/attachment.rb +6 -5
  123. data/lib/plutonium/ui/display/components/boolean.rb +23 -0
  124. data/lib/plutonium/ui/display/components/color.rb +23 -0
  125. data/lib/plutonium/ui/display/resource.rb +1 -1
  126. data/lib/plutonium/ui/display/theme.rb +29 -15
  127. data/lib/plutonium/ui/empty_card.rb +3 -3
  128. data/lib/plutonium/ui/form/base.rb +20 -0
  129. data/lib/plutonium/ui/form/components/key_value_store.rb +11 -11
  130. data/lib/plutonium/ui/form/components/resource_select.rb +31 -0
  131. data/lib/plutonium/ui/form/components/secure_association.rb +1 -2
  132. data/lib/plutonium/ui/form/components/uppy.rb +5 -4
  133. data/lib/plutonium/ui/form/concerns/renders_nested_resource_fields.rb +4 -4
  134. data/lib/plutonium/ui/form/interaction.rb +17 -1
  135. data/lib/plutonium/ui/form/query.rb +133 -80
  136. data/lib/plutonium/ui/form/theme.rb +50 -35
  137. data/lib/plutonium/ui/frame_navigator_panel.rb +2 -2
  138. data/lib/plutonium/ui/layout/base.rb +1 -1
  139. data/lib/plutonium/ui/layout/header.rb +4 -7
  140. data/lib/plutonium/ui/layout/rodauth_layout.rb +7 -7
  141. data/lib/plutonium/ui/layout/sidebar.rb +1 -1
  142. data/lib/plutonium/ui/nav_grid_menu.rb +7 -6
  143. data/lib/plutonium/ui/nav_user.rb +9 -8
  144. data/lib/plutonium/ui/page/interactive_action.rb +5 -5
  145. data/lib/plutonium/ui/page_header.rb +29 -10
  146. data/lib/plutonium/ui/panel.rb +4 -4
  147. data/lib/plutonium/ui/sidebar_menu.rb +8 -8
  148. data/lib/plutonium/ui/skeleton_table.rb +7 -8
  149. data/lib/plutonium/ui/tab_list.rb +5 -5
  150. data/lib/plutonium/ui/table/base.rb +3 -0
  151. data/lib/plutonium/ui/table/components/attachment.rb +4 -3
  152. data/lib/plutonium/ui/table/components/bulk_actions_toolbar.rb +82 -0
  153. data/lib/plutonium/ui/table/components/pagy_info.rb +2 -2
  154. data/lib/plutonium/ui/table/components/pagy_pagination.rb +13 -8
  155. data/lib/plutonium/ui/table/components/row_actions_dropdown.rb +101 -0
  156. data/lib/plutonium/ui/table/components/scopes_bar.rb +2 -2
  157. data/lib/plutonium/ui/table/components/selection_column.rb +100 -0
  158. data/lib/plutonium/ui/table/display_theme.rb +6 -6
  159. data/lib/plutonium/ui/table/resource.rb +93 -52
  160. data/lib/plutonium/ui/table/theme.rb +28 -15
  161. data/lib/plutonium/version.rb +1 -1
  162. data/package.json +2 -2
  163. data/plutonium.gemspec +5 -4
  164. data/src/css/components.css +471 -0
  165. data/src/css/intl_tel_input.css +2 -2
  166. data/src/css/plutonium.css +2 -0
  167. data/src/css/tokens.css +149 -0
  168. data/src/js/controllers/bulk_actions_controller.js +109 -0
  169. data/src/js/controllers/filter_panel_controller.js +35 -0
  170. data/src/js/controllers/register_controllers.js +5 -1
  171. data/src/js/controllers/resource_drop_down_controller.js +25 -1
  172. data/src/js/controllers/slim_select_controller.js +6 -2
  173. data/src/js/turbo/turbo_actions.js +1 -1
  174. metadata +52 -39
  175. data/.claude/skills/definition-query/SKILL.md +0 -334
  176. data/docs/concepts/architecture.md +0 -226
  177. data/docs/concepts/auto-detection.md +0 -254
  178. data/docs/concepts/index.md +0 -61
  179. data/docs/concepts/packages-portals.md +0 -304
  180. data/docs/concepts/resources.md +0 -224
  181. data/docs/cookbook/blog.md +0 -411
  182. data/docs/cookbook/index.md +0 -289
  183. data/docs/cookbook/saas.md +0 -481
  184. data/docs/public/CLAUDE.md +0 -578
  185. data/lib/generators/pu/pkg/portal/templates/app/controllers/resource_controller.rb.tt +0 -5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,55 @@
1
+ ## [0.35.0] - 2026-01-20
2
+
3
+ ### 🚀 Features
4
+
5
+ - Add demo_features package and demo_portal for testing
6
+ - Implement bulk actions for resource tables
7
+ - Modernize UI with design token system and component classes
8
+ - Add actions dropdown for secondary and danger actions
9
+ - Add form input type aliases for explicit field type declarations
10
+ - Add built-in filter types with dropdown filter panel UI
11
+ - *(display)* Add boolean and color components with type aliases
12
+ - *(filters)* Add clear all button with filter-panel controller
13
+
14
+ ### 🐛 Bug Fixes
15
+
16
+ - Use turbo stream redirect action instead of HTTP 302 for form submissions
17
+ - Exclude turbo_stream format from URL preservation
18
+ - Improve table container scroll and telephone input padding
19
+ - Pass unwrapped record into custom column blocks
20
+ - *(docs)* Prevent h2 text cutoff in VitePress docs
21
+
22
+ ### 🚜 Refactor
23
+
24
+ - Remove ResourceController from portal generator
25
+ - Rename skills with plutonium- prefix to avoid conflicts
26
+ - Simplify dashboard templates with design system classes
27
+ - *(ui)* Update auth pages with new design tokens
28
+
29
+ ### 📚 Documentation
30
+
31
+ - Improve interaction docs
32
+ - Overhaul README, CONTRIBUTING, and add CLAUDE.md for development
33
+ - Redesign landing page with modern layout and AI messaging
34
+ - Unify branding and add social preview meta tags
35
+ - Fix broken links
36
+ - Add Author Portal tutorial chapter
37
+ - Fix minimum rails version
38
+ - Fix drafts scope for posts
39
+ - Remove cookbooks
40
+ - Reorganize features section of homepage
41
+ - Clean up docs and fix misc issues
42
+ - Rewrite theming guide with design tokens and component classes
43
+ - Removed potentially misleading section on per portal themes
44
+ - Document authorization methods
45
+ - Add skills for themeing specifically
46
+
47
+ ### ⚙️ Miscellaneous Tasks
48
+
49
+ - Optimize og graph title and images
50
+ - Realign marketing material
51
+ - Add seeds for demo models and fix foreign keys
52
+ - Standardrb
1
53
  ## [0.34.1] - 2026-01-18
2
54
 
3
55
  ### 🐛 Bug Fixes
data/CLAUDE.md ADDED
@@ -0,0 +1,215 @@
1
+ # Plutonium Core Development Guide
2
+
3
+ This guide helps AI assistants contribute to the Plutonium framework itself.
4
+
5
+ ## Project Overview
6
+
7
+ Plutonium is a Rails RAD framework distributed as a Ruby gem. It provides resource-oriented architecture with automatic CRUD, policies, definitions, and multi-tenancy.
8
+
9
+ ## Repository Structure
10
+
11
+ ```
12
+ plutonium-core/
13
+ ├── lib/plutonium/ # Core framework code
14
+ │ ├── resource/ # Resource system (controllers, policies, definitions)
15
+ │ ├── portal/ # Portal engines and multi-tenancy
16
+ │ ├── interaction/ # Business logic encapsulation
17
+ │ ├── ui/ # Phlex view components
18
+ │ ├── definition/ # Definition DSL and field types
19
+ │ ├── query/ # Search, filters, scopes
20
+ │ ├── auth/ # Authentication (Rodauth integration)
21
+ │ ├── routing/ # Route helpers and extensions
22
+ │ └── generators/ # Rails generators (pu:res:scaffold, etc.)
23
+ ├── app/ # Rails app components
24
+ │ ├── assets/ # JavaScript, CSS
25
+ │ ├── controllers/ # Base controllers
26
+ │ └── views/ # Phlex components
27
+ ├── test/ # Test suite
28
+ │ ├── plutonium/ # Unit tests mirroring lib/ structure
29
+ │ ├── dummy/ # Test Rails app
30
+ │ └── system/ # System/integration tests
31
+ ├── docs/ # VitePress documentation site
32
+ │ ├── getting-started/
33
+ │ ├── guides/
34
+ │ └── reference/
35
+ └── .claude/skills/ # AI assistant skills (documentation for Claude)
36
+ ```
37
+
38
+ ## Key Abstractions
39
+
40
+ ### Resource System
41
+ - `Plutonium::Resource::Record` - Model mixin with `associated_with` scopes
42
+ - `Plutonium::Resource::Policy` - ActionPolicy-based authorization
43
+ - `Plutonium::Resource::Definition` - Declarative UI configuration
44
+ - `Plutonium::Resource::Controller` - CRUD controller mixin
45
+ - `Plutonium::Resource::Interaction` - Business logic encapsulation
46
+
47
+ ### Portal System
48
+ - `Plutonium::Portal::Engine` - Rails engine mixin for web interfaces
49
+ - `Plutonium::Package::Engine` - Rails engine mixin for feature packages
50
+ - Entity scoping for multi-tenancy (path or custom strategy)
51
+
52
+ ### UI Components
53
+ Located in `lib/plutonium/ui/` - Phlex-based components:
54
+ - `page/` - Page layouts (index, show, new, edit)
55
+ - `form/` - Form builders and field components
56
+ - `table/` - Data tables with sorting, pagination
57
+ - `display/` - Field display components
58
+
59
+ ## Development Workflow
60
+
61
+ ### Environment Setup
62
+
63
+ When working on Plutonium itself, set:
64
+
65
+ ```bash
66
+ export PLUTONIUM_DEV=1
67
+ ```
68
+
69
+ This enables development mode which:
70
+ - Uses local assets instead of packaged ones
71
+ - Enables hot reloading of components
72
+ - Shows more detailed error messages
73
+
74
+ ### Building Assets
75
+
76
+ When working on JavaScript or CSS in `src/`:
77
+
78
+ ```bash
79
+ # Watch mode (rebuilds on changes to src/build/)
80
+ npm run dev
81
+
82
+ # Production build (to app/assets/)
83
+ npm run build
84
+ ```
85
+
86
+ - `npm run dev` - watches and rebuilds to `src/build/` for development
87
+ - `npm run build` - compiles to `app/assets/` for release
88
+
89
+ **Always run `npm run dev`** in a terminal when working on frontend code.
90
+
91
+ ### Running Tests
92
+
93
+ Tests use [Appraisal](https://github.com/thoughtbot/appraisal) for multiple Rails versions:
94
+
95
+ ```bash
96
+ # Full test suite (all Rails versions)
97
+ bundle exec appraisal rake test
98
+
99
+ # Specific Rails version
100
+ bundle exec appraisal rails-8.1 rake test
101
+
102
+ # Specific test file
103
+ bundle exec appraisal rails-8.1 ruby -Itest test/plutonium/resource/policy_test.rb
104
+ ```
105
+
106
+ Available: `rails-7`, `rails-8.0`, `rails-8.1`
107
+
108
+ ### Testing Generators
109
+
110
+ Generators are in `lib/generators/pu/`. Test by:
111
+ 1. Running in the dummy app: `cd test/dummy && rails g pu:res:scaffold ...`
112
+ 2. Generator tests in `test/generators/`
113
+
114
+ ### Documentation
115
+
116
+ ```bash
117
+ cd docs
118
+ pnpm install
119
+ pnpm dev # Local preview at localhost:5173
120
+ pnpm build # Build for production
121
+ ```
122
+
123
+ ## Code Conventions
124
+
125
+ ### Ruby Style
126
+ - Follow Rails conventions
127
+ - Use `with_connection` for database operations (fiber-safe)
128
+ - Avoid excessive defensive programming (no `respond_to?` checks)
129
+ - Use `Rails.logger.warn { "message" }` block syntax in production code
130
+
131
+ ### Generators
132
+ - Always provide `--dest=` flag support to avoid interactive prompts
133
+ - Use `--dest=main_app` for main application, `--dest=package_name` for packages
134
+ - Quote shell arguments with special characters: `'field:type?'`, `'field:decimal{10,2}'`
135
+
136
+ ### Migrations
137
+ - Inline indexes and constraints in `create_table` blocks
138
+ - Use `foreign_key: {on_delete: :cascade}` where appropriate
139
+
140
+ ### Frontend
141
+ - Stimulus controllers for interactivity (always register controllers)
142
+ - TailwindCSS 4 for styling
143
+ - Phlex for view components
144
+
145
+ ## Adding New Features
146
+
147
+ ### New Field Type
148
+ 1. Add renderer in `lib/plutonium/ui/display/components/`
149
+ 2. Add input in `lib/plutonium/ui/form/components/`
150
+ 3. Register in field type mappings
151
+ 4. Add tests and documentation
152
+
153
+ ### New Generator
154
+ 1. Create in `lib/generators/pu/category/name_generator.rb`
155
+ 2. Add templates in `lib/generators/pu/category/name/templates/`
156
+ 3. Add tests in `test/generators/`
157
+ 4. Document in `docs/reference/generators/`
158
+
159
+ ### New Interaction Response
160
+ 1. Add response class in `lib/plutonium/interaction/response/`
161
+ 2. Add helper method in `Plutonium::Interaction::Outcome::Success`
162
+ 3. Document usage
163
+
164
+ ## Skills System
165
+
166
+ The `.claude/skills/` directory contains documentation for AI assistants:
167
+ - Each skill is a focused guide on one concept
168
+ - Skills are loaded based on user queries
169
+ - Update skills when changing related functionality
170
+ - Skills require a gem release to take effect
171
+
172
+ ## Release Process
173
+
174
+ ```bash
175
+ bundle exec rake release:full
176
+ ```
177
+
178
+ This:
179
+ 1. Checks npm authentication
180
+ 2. Bumps version
181
+ 3. Builds and publishes npm package
182
+ 4. Builds and publishes gem
183
+ 5. Pushes git tags
184
+
185
+ ## Key Files Reference
186
+
187
+ | Purpose | Location |
188
+ |---------|----------|
189
+ | Gem version | `lib/plutonium/version.rb` |
190
+ | Main entry | `lib/plutonium.rb` |
191
+ | Configuration | `lib/plutonium/configuration.rb` |
192
+ | Base controller | `lib/plutonium/resource/controller.rb` |
193
+ | Base policy | `lib/plutonium/resource/policy.rb` |
194
+ | Base definition | `lib/plutonium/resource/definition.rb` |
195
+ | Interactions | `lib/plutonium/interaction/base.rb` |
196
+ | Generators | `lib/generators/pu/` |
197
+
198
+ ## Common Tasks
199
+
200
+ ### Fix a bug in policies
201
+ 1. Find the issue in `lib/plutonium/resource/policy.rb` or related
202
+ 2. Write a failing test in `test/plutonium/resource/policy_test.rb`
203
+ 3. Fix the bug
204
+ 4. Update docs if behavior changed
205
+
206
+ ### Add a generator option
207
+ 1. Add option in generator class
208
+ 2. Update templates to use option
209
+ 3. Test with dummy app
210
+ 4. Document in `docs/reference/generators/`
211
+
212
+ ### Update documentation
213
+ 1. Edit files in `docs/`
214
+ 2. If user-facing behavior, update relevant skill in `.claude/skills/`
215
+ 3. Run `pnpm build` to verify no broken links
data/CONTRIBUTING.md CHANGED
@@ -92,29 +92,83 @@ git push origin main --tags
92
92
  # 4. GitHub Actions will automatically publish to RubyGems
93
93
  ```
94
94
 
95
- ## Version Bumping Rules
96
-
97
- Following semantic versioning:
95
+ ## Development Setup
98
96
 
99
- - **MAJOR** (X.0.0): Breaking changes
100
- - **MINOR** (0.X.0): New features (backwards compatible)
101
- - **PATCH** (0.0.X): Bug fixes (backwards compatible)
97
+ ### Prerequisites
102
98
 
103
- The automation determines the version bump based on commits since the last tag:
104
- - Any commit with `BREAKING CHANGE:` or `!` after type → MAJOR
105
- - Any `feat:` commits → MINOR
106
- - Any `fix:` commits → PATCH
99
+ - Ruby 3.2+
100
+ - Node.js 18+
101
+ - PostgreSQL (for tests)
107
102
 
108
- ## Development Setup
103
+ ### Install Dependencies
109
104
 
110
105
  ```bash
111
- # Install dependencies
112
106
  bundle install
107
+ npm install
108
+ ```
109
+
110
+ ### Environment
111
+
112
+ Set this when working on Plutonium:
113
+
114
+ ```bash
115
+ export PLUTONIUM_DEV=1
116
+ ```
117
+
118
+ This uses local assets and enables hot reloading.
119
+
120
+ ### Building Assets
121
+
122
+ Frontend source is in `src/`. When making JS or CSS changes:
123
+
124
+ ```bash
125
+ # Watch mode - keeps rebuilding as you edit
126
+ npm run dev
127
+
128
+ # Production build - run before committing
129
+ npm run build
130
+ ```
131
+
132
+ ### Running Tests
113
133
 
114
- # Run tests
115
- bundle exec rspec
134
+ Tests run via [Appraisal](https://github.com/thoughtbot/appraisal) against multiple Rails versions:
116
135
 
117
- # Install git-cliff for changelog generation (optional)
136
+ ```bash
137
+ # Full test suite (all Rails versions)
138
+ bundle exec appraisal rake test
139
+
140
+ # Specific Rails version
141
+ bundle exec appraisal rails-8.1 rake test
142
+
143
+ # Specific test file
144
+ bundle exec appraisal rails-8.1 ruby -Itest test/plutonium/resource/policy_test.rb
145
+ ```
146
+
147
+ Available appraisals: `rails-7`, `rails-8.0`, `rails-8.1`
148
+
149
+ ### Testing Generators
150
+
151
+ Use the dummy app:
152
+
153
+ ```bash
154
+ cd test/dummy
155
+ rails g pu:res:scaffold TestModel name:string --dest=main_app
156
+ rails db:migrate
157
+ bin/dev
158
+ ```
159
+
160
+ ### Documentation
161
+
162
+ ```bash
163
+ cd docs
164
+ pnpm install
165
+ pnpm dev # Preview at localhost:5173
166
+ pnpm build # Check for errors
167
+ ```
168
+
169
+ ### Changelog Generation (optional)
170
+
171
+ ```bash
118
172
  brew install git-cliff # macOS
119
173
  # or
120
174
  cargo install git-cliff # via Rust
@@ -125,9 +179,9 @@ cargo install git-cliff # via Rust
125
179
  1. Fork the repository
126
180
  2. Create a feature branch: `git checkout -b feat/my-feature`
127
181
  3. Make your changes with conventional commits
128
- 4. Run tests: `bundle exec rspec`
129
- 5. Push and create a pull request
130
- 6. The PR title should also follow conventional commit format
182
+ 4. Run tests: `bundle exec appraisal rake test`
183
+ 5. Build assets: `npm run build`
184
+ 6. Push and create a pull request
131
185
 
132
186
  ## Questions?
133
187
 
data/README.md CHANGED
@@ -1,33 +1,114 @@
1
- # Plutonium: It's like Rails, but for Rails!
1
+ # Plutonium
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/plutonium.svg)](https://badge.fury.io/rb/plutonium)
3
4
  [![Ruby](https://github.com/radioactive-labs/plutonium-core/actions/workflows/main.yml/badge.svg)](https://github.com/radioactive-labs/plutonium-core/actions/workflows/main.yml)
4
5
 
5
- **Plutonium** is a powerful Rapid Application Development (RAD) toolkit for Rails that picks up where Rails left off, introducing application-level concepts and tooling that transform the way you build applications.
6
+ Build production-ready Rails apps in minutes, not days. Convention-driven, fully customizable, and AI-ready. Plutonium picks up where Rails left off, adding application-level concepts that make building complex apps faster.
6
7
 
7
- ## Overview
8
+ ## Quick Start
8
9
 
9
- Plutonium builds upon Rails' conventions and extends them with:
10
+ ```bash
11
+ rails new myapp -a propshaft -j esbuild -c tailwind \
12
+ -m https://radioactive-labs.github.io/plutonium-core/templates/plutonium.rb
13
+ ```
10
14
 
11
- - **Authentication & Authorization**: Integrates seamlessly with Rodauth or your existing auth system
12
- - **Complete CRUD Operations**: Rich fields, forms, tables, and nested resources out of the box
13
- - **Modular Architecture**: Package system based on Rails engines for better organization
14
- - **Entity Scoping**: Built-in multi-tenancy support that "just works"
15
- - **Smart Generators**: Eliminate boilerplate while maintaining flexibility
16
- - **Modern UI**: Beautiful, responsive interface powered by Tailwind CSS and Hotwire
15
+ Then create your first resource:
17
16
 
18
- ## Project Status
17
+ ```bash
18
+ cd myapp
19
+ rails g pu:res:scaffold Post title:string body:text --dest=main_app
20
+ rails db:migrate
21
+ bin/dev
22
+ ```
19
23
 
20
- > [!WARNING]
21
- > While Plutonium is actively used in production environments, it's still in early development. APIs may change, and some features are still evolving. We recommend thoroughly testing before deploying to production.
24
+ Visit `http://localhost:3000` - you have a complete CRUD interface.
25
+
26
+ ## What You Get
27
+
28
+ **Resource-oriented architecture** - Models, policies, definitions, and controllers that work together:
29
+
30
+ ```ruby
31
+ # Policy controls WHO can do WHAT
32
+ class PostPolicy < ResourcePolicy
33
+ def create? = user.present?
34
+ def update? = record.author == user || user.admin?
35
+
36
+ def permitted_attributes_for_create
37
+ %i[title body]
38
+ end
39
+ end
40
+
41
+ # Definition controls HOW it renders
42
+ class PostDefinition < ResourceDefinition
43
+ input :body, as: :markdown
44
+ search { |scope, q| scope.where("title ILIKE ?", "%#{q}%") }
45
+ scope :published
46
+ scope :drafts
47
+ end
48
+ ```
49
+
50
+ **Packages for organization** - Split your app into feature packages and portals:
51
+
52
+ ```bash
53
+ rails g pu:pkg:package blogging # Business logic
54
+ rails g pu:pkg:portal admin # Web interface
55
+ rails g pu:res:conn Post --dest=admin_portal
56
+ ```
57
+
58
+ **Built-in authentication** via Rodauth:
59
+
60
+ ```bash
61
+ rails g pu:rodauth:install
62
+ rails g pu:rodauth:account user
63
+ ```
64
+
65
+ **Multi-tenancy** with entity scoping:
66
+
67
+ ```ruby
68
+ # In portal engine
69
+ scope_to_entity Organization, strategy: :path
70
+ # Routes become /organizations/:organization_id/posts
71
+ ```
72
+
73
+ **Custom actions** with interactions:
74
+
75
+ ```ruby
76
+ class PublishInteraction < ResourceInteraction
77
+ attribute :resource
78
+ attribute :publish_at, :datetime
79
+
80
+ def execute
81
+ resource.update!(published_at: publish_at)
82
+ succeed(resource).with_message("Published!")
83
+ rescue ActiveRecord::RecordInvalid => e
84
+ failed(e.record.errors)
85
+ end
86
+ end
87
+ ```
22
88
 
23
89
  ## Documentation
24
90
 
25
- Visit our [documentation](https://radioactive-labs.github.io/plutonium-core/) for:
26
- - Getting started guide
27
- - Installation instructions
28
- - Core concepts
29
- - Tutorials
91
+ Full documentation at **[radioactive-labs.github.io/plutonium-core](https://radioactive-labs.github.io/plutonium-core/)**
92
+
93
+ - [Installation](https://radioactive-labs.github.io/plutonium-core/getting-started/installation)
94
+ - [Tutorial](https://radioactive-labs.github.io/plutonium-core/getting-started/tutorial/)
95
+ - [Guides](https://radioactive-labs.github.io/plutonium-core/guides/)
96
+ - [Reference](https://radioactive-labs.github.io/plutonium-core/reference/)
97
+
98
+ ## Requirements
99
+
100
+ - Ruby 3.2+
101
+ - Rails 7.1+ (Rails 8 recommended)
102
+ - Node.js 18+
103
+
104
+ ## Contributing
105
+
106
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
107
+
108
+ ## Status
109
+
110
+ Plutonium is used in production but still evolving. APIs may change between minor versions. Pin your version in Gemfile.
30
111
 
31
112
  ## License
32
113
 
33
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
114
+ MIT License - see [LICENSE](LICENSE).