plutonium 0.49.1 → 0.51.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 (206) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/skills/plutonium/SKILL.md +85 -102
  3. data/.claude/skills/plutonium-app/SKILL.md +572 -0
  4. data/.claude/skills/plutonium-auth/SKILL.md +163 -300
  5. data/.claude/skills/plutonium-behavior/SKILL.md +838 -0
  6. data/.claude/skills/plutonium-resource/SKILL.md +1176 -0
  7. data/.claude/skills/plutonium-tenancy/SKILL.md +655 -0
  8. data/.claude/skills/plutonium-testing/SKILL.md +6 -5
  9. data/.claude/skills/plutonium-ui/SKILL.md +900 -0
  10. data/CHANGELOG.md +37 -0
  11. data/Rakefile +2 -1
  12. data/app/assets/plutonium.css +1 -11
  13. data/app/assets/plutonium.js +1323 -1184
  14. data/app/assets/plutonium.js.map +4 -4
  15. data/app/assets/plutonium.min.js +50 -49
  16. data/app/assets/plutonium.min.js.map +4 -4
  17. data/app/views/plutonium/_resource_header.html.erb +4 -4
  18. data/app/views/plutonium/_resource_sidebar.html.erb +9 -9
  19. data/app/views/resource/_resource_grid.html.erb +1 -0
  20. data/config/brakeman.ignore +25 -2
  21. data/docs/.vitepress/config.ts +37 -27
  22. data/docs/getting-started/index.md +22 -29
  23. data/docs/getting-started/installation.md +37 -80
  24. data/docs/getting-started/tutorial/index.md +4 -5
  25. data/docs/guides/adding-resources.md +66 -377
  26. data/docs/guides/authentication.md +94 -463
  27. data/docs/guides/authorization.md +124 -370
  28. data/docs/guides/creating-packages.md +94 -296
  29. data/docs/guides/custom-actions.md +121 -441
  30. data/docs/guides/index.md +22 -42
  31. data/docs/guides/multi-tenancy.md +116 -187
  32. data/docs/guides/nested-resources.md +103 -431
  33. data/docs/guides/search-filtering.md +123 -240
  34. data/docs/guides/testing.md +5 -4
  35. data/docs/guides/theming.md +157 -407
  36. data/docs/guides/troubleshooting.md +5 -3
  37. data/docs/guides/user-invites.md +106 -425
  38. data/docs/guides/user-profile.md +76 -243
  39. data/docs/index.md +1 -1
  40. data/docs/reference/app/generators.md +517 -0
  41. data/docs/reference/app/index.md +158 -0
  42. data/docs/reference/app/packages.md +146 -0
  43. data/docs/reference/app/portals.md +377 -0
  44. data/docs/reference/auth/accounts.md +230 -0
  45. data/docs/reference/auth/index.md +88 -0
  46. data/docs/reference/auth/profile.md +185 -0
  47. data/docs/reference/behavior/controllers.md +395 -0
  48. data/docs/reference/behavior/index.md +22 -0
  49. data/docs/reference/behavior/interactions.md +341 -0
  50. data/docs/reference/behavior/policies.md +417 -0
  51. data/docs/reference/index.md +56 -49
  52. data/docs/reference/resource/actions.md +423 -0
  53. data/docs/reference/resource/definition.md +508 -0
  54. data/docs/reference/resource/index.md +50 -0
  55. data/docs/reference/resource/model.md +348 -0
  56. data/docs/reference/resource/query.md +305 -0
  57. data/docs/reference/tenancy/entity-scoping.md +361 -0
  58. data/docs/reference/tenancy/index.md +36 -0
  59. data/docs/reference/tenancy/invites.md +393 -0
  60. data/docs/reference/tenancy/nested-resources.md +267 -0
  61. data/docs/reference/testing/index.md +287 -0
  62. data/docs/reference/ui/assets.md +400 -0
  63. data/docs/reference/ui/components.md +165 -0
  64. data/docs/reference/ui/displays.md +104 -0
  65. data/docs/reference/ui/forms.md +284 -0
  66. data/docs/reference/ui/index.md +30 -0
  67. data/docs/reference/ui/layouts.md +106 -0
  68. data/docs/reference/ui/pages.md +189 -0
  69. data/docs/reference/ui/tables.md +117 -0
  70. data/docs/superpowers/plans/2026-05-07-ui-layout-overhaul.md +841 -0
  71. data/docs/superpowers/plans/2026-05-07-ui-layout-overhaul.md.tasks.json +103 -0
  72. data/docs/superpowers/specs/2026-05-07-ui-layout-overhaul-design.md +270 -0
  73. data/docs/superpowers/specs/2026-05-09-typeahead-endpoint-design.md +203 -0
  74. data/docs/superpowers/specs/2026-05-12-skill-compaction-design.md +99 -0
  75. data/docs/superpowers/specs/2026-05-13-docs-restructure-design.md +186 -0
  76. data/gemfiles/rails_7.gemfile.lock +1 -1
  77. data/gemfiles/rails_8.0.gemfile.lock +1 -1
  78. data/gemfiles/rails_8.1.gemfile.lock +1 -1
  79. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +1 -0
  80. data/lib/generators/pu/invites/install_generator.rb +1 -0
  81. data/lib/generators/pu/lite/rails_pulse/rails_pulse_generator.rb +54 -5
  82. data/lib/plutonium/action/base.rb +44 -1
  83. data/lib/plutonium/action/interactive.rb +1 -1
  84. data/lib/plutonium/configuration.rb +4 -0
  85. data/lib/plutonium/definition/actions.rb +3 -0
  86. data/lib/plutonium/definition/base.rb +8 -0
  87. data/lib/plutonium/definition/index_views.rb +95 -0
  88. data/lib/plutonium/definition/metadata.rb +40 -0
  89. data/lib/plutonium/helpers/turbo_helper.rb +12 -1
  90. data/lib/plutonium/helpers/turbo_stream_actions_helper.rb +14 -0
  91. data/lib/plutonium/interaction/response/redirect.rb +1 -1
  92. data/lib/plutonium/query/base.rb +8 -0
  93. data/lib/plutonium/query/filters/association.rb +30 -8
  94. data/lib/plutonium/query/filters/boolean.rb +5 -0
  95. data/lib/plutonium/resource/controller.rb +1 -0
  96. data/lib/plutonium/resource/controllers/crud_actions.rb +19 -1
  97. data/lib/plutonium/resource/controllers/presentable.rb +11 -2
  98. data/lib/plutonium/resource/controllers/typeahead.rb +180 -0
  99. data/lib/plutonium/resource/definition.rb +42 -0
  100. data/lib/plutonium/resource/policy.rb +7 -0
  101. data/lib/plutonium/resource/query_object.rb +64 -6
  102. data/lib/plutonium/routing/mapper_extensions.rb +15 -0
  103. data/lib/plutonium/testing/resource_definition.rb +2 -2
  104. data/lib/plutonium/ui/action_button.rb +4 -2
  105. data/lib/plutonium/ui/component/kit.rb +12 -0
  106. data/lib/plutonium/ui/component/methods.rb +4 -0
  107. data/lib/plutonium/ui/display/base.rb +3 -1
  108. data/lib/plutonium/ui/display/resource.rb +109 -25
  109. data/lib/plutonium/ui/display/theme.rb +2 -1
  110. data/lib/plutonium/ui/dyna_frame/content.rb +8 -14
  111. data/lib/plutonium/ui/empty_card.rb +1 -1
  112. data/lib/plutonium/ui/form/base.rb +35 -3
  113. data/lib/plutonium/ui/form/components/hidden_wrapper.rb +25 -0
  114. data/lib/plutonium/ui/form/components/json.rb +58 -0
  115. data/lib/plutonium/ui/form/components/resource_select.rb +133 -1
  116. data/lib/plutonium/ui/form/components/secure_association.rb +105 -24
  117. data/lib/plutonium/ui/form/components/sticky_footer.rb +17 -0
  118. data/lib/plutonium/ui/form/concerns/typeahead_attributes.rb +83 -0
  119. data/lib/plutonium/ui/form/resource.rb +45 -10
  120. data/lib/plutonium/ui/form/theme.rb +1 -1
  121. data/lib/plutonium/ui/frame_navigator_panel.rb +7 -4
  122. data/lib/plutonium/ui/grid/card.rb +235 -0
  123. data/lib/plutonium/ui/grid/resource.rb +149 -0
  124. data/lib/plutonium/ui/layout/base.rb +38 -1
  125. data/lib/plutonium/ui/layout/header.rb +1 -2
  126. data/lib/plutonium/ui/layout/icon_rail.rb +212 -0
  127. data/lib/plutonium/ui/layout/resource_layout.rb +10 -3
  128. data/lib/plutonium/ui/layout/sidebar.rb +12 -24
  129. data/lib/plutonium/ui/layout/topbar.rb +100 -0
  130. data/lib/plutonium/ui/modal/base.rb +109 -0
  131. data/lib/plutonium/ui/modal/centered.rb +21 -0
  132. data/lib/plutonium/ui/modal/slideover.rb +26 -0
  133. data/lib/plutonium/ui/page/base.rb +18 -6
  134. data/lib/plutonium/ui/page/edit.rb +13 -1
  135. data/lib/plutonium/ui/page/index.rb +40 -1
  136. data/lib/plutonium/ui/page/interactive_action.rb +8 -39
  137. data/lib/plutonium/ui/page/new.rb +13 -1
  138. data/lib/plutonium/ui/page/show.rb +8 -1
  139. data/lib/plutonium/ui/page_header.rb +8 -13
  140. data/lib/plutonium/ui/panel.rb +10 -19
  141. data/lib/plutonium/ui/sidebar_menu.rb +2 -25
  142. data/lib/plutonium/ui/tab_list.rb +29 -7
  143. data/lib/plutonium/ui/table/base.rb +106 -0
  144. data/lib/plutonium/ui/table/components/bulk_actions_toolbar.rb +12 -4
  145. data/lib/plutonium/ui/table/components/filter_form.rb +171 -0
  146. data/lib/plutonium/ui/table/components/filter_pills.rb +89 -0
  147. data/lib/plutonium/ui/table/components/row_actions_dropdown.rb +13 -12
  148. data/lib/plutonium/ui/table/components/scopes_pills.rb +67 -0
  149. data/lib/plutonium/ui/table/components/selection_column.rb +2 -11
  150. data/lib/plutonium/ui/table/components/toolbar.rb +104 -0
  151. data/lib/plutonium/ui/table/components/view_switcher.rb +81 -0
  152. data/lib/plutonium/ui/table/resource.rb +158 -89
  153. data/lib/plutonium/ui/table/theme.rb +14 -5
  154. data/lib/plutonium/version.rb +1 -1
  155. data/lib/plutonium.rb +14 -0
  156. data/lib/tasks/release.rake +15 -1
  157. data/package.json +10 -10
  158. data/src/css/components.css +304 -131
  159. data/src/css/slim_select.css +4 -0
  160. data/src/css/tokens.css +101 -85
  161. data/src/js/controllers/autosubmit_controller.js +24 -0
  162. data/src/js/controllers/bulk_actions_controller.js +15 -16
  163. data/src/js/controllers/capture_url_controller.js +14 -0
  164. data/src/js/controllers/filter_panel_controller.js +77 -19
  165. data/src/js/controllers/frame_navigator_controller.js +34 -6
  166. data/src/js/controllers/icon_rail_controller.js +22 -0
  167. data/src/js/controllers/icon_rail_flyout_controller.js +128 -0
  168. data/src/js/controllers/register_controllers.js +16 -0
  169. data/src/js/controllers/resource_tab_list_controller.js +56 -3
  170. data/src/js/controllers/row_click_controller.js +21 -0
  171. data/src/js/controllers/slim_select_controller.js +61 -0
  172. data/src/js/controllers/table_column_menu_controller.js +43 -0
  173. data/src/js/controllers/table_header_controller.js +16 -0
  174. data/src/js/controllers/view_switcher_controller.js +29 -0
  175. data/src/js/turbo/turbo_actions.js +33 -0
  176. data/yarn.lock +553 -543
  177. metadata +71 -32
  178. data/.claude/skills/plutonium-assets/SKILL.md +0 -512
  179. data/.claude/skills/plutonium-controller/SKILL.md +0 -396
  180. data/.claude/skills/plutonium-create-resource/SKILL.md +0 -303
  181. data/.claude/skills/plutonium-definition/SKILL.md +0 -1138
  182. data/.claude/skills/plutonium-entity-scoping/SKILL.md +0 -317
  183. data/.claude/skills/plutonium-forms/SKILL.md +0 -465
  184. data/.claude/skills/plutonium-installation/SKILL.md +0 -325
  185. data/.claude/skills/plutonium-interaction/SKILL.md +0 -413
  186. data/.claude/skills/plutonium-invites/SKILL.md +0 -408
  187. data/.claude/skills/plutonium-model/SKILL.md +0 -440
  188. data/.claude/skills/plutonium-nested-resources/SKILL.md +0 -360
  189. data/.claude/skills/plutonium-package/SKILL.md +0 -198
  190. data/.claude/skills/plutonium-policy/SKILL.md +0 -456
  191. data/.claude/skills/plutonium-portal/SKILL.md +0 -410
  192. data/.claude/skills/plutonium-views/SKILL.md +0 -592
  193. data/docs/reference/assets/index.md +0 -496
  194. data/docs/reference/controller/index.md +0 -412
  195. data/docs/reference/definition/actions.md +0 -449
  196. data/docs/reference/definition/fields.md +0 -383
  197. data/docs/reference/definition/index.md +0 -268
  198. data/docs/reference/definition/query.md +0 -351
  199. data/docs/reference/generators/index.md +0 -648
  200. data/docs/reference/interaction/index.md +0 -449
  201. data/docs/reference/model/features.md +0 -248
  202. data/docs/reference/model/index.md +0 -218
  203. data/docs/reference/policy/index.md +0 -456
  204. data/docs/reference/portal/index.md +0 -379
  205. data/docs/reference/views/forms.md +0 -411
  206. data/docs/reference/views/index.md +0 -501
@@ -1,9 +1,9 @@
1
- <%= render Plutonium::UI::Layout::Header.new do |header| %>
2
- <% header.with_brand_logo do %>
3
- <%= resource_logo_tag(classname: "h-10 rounded-md") %>
1
+ <%= render Plutonium::UI::Layout::Topbar.new do |bar| %>
2
+ <% bar.with_action do %>
3
+ <%= render Plutonium::UI::ColorModeSelector.new %>
4
4
  <% end %>
5
5
 
6
- <% header.with_action do %>
6
+ <% bar.with_action do %>
7
7
  <%=
8
8
  render Plutonium::UI::NavUser.new(
9
9
  name: nil,
@@ -1,10 +1,6 @@
1
- <%= render Plutonium::UI::Layout::Sidebar.new do %>
2
- <%=
3
- render Plutonium::UI::SidebarMenu.new(
4
- Phlexi::Menu::Builder.new do |m|
5
- m.item "Dashboard",
6
- url: root_path,
7
- icon: Phlex::TablerIcons::Home
1
+ <%= render Plutonium::UI::Layout::IconRail.new(
2
+ menu: Phlexi::Menu::Builder.new do |m|
3
+ m.item "Dashboard", url: root_path, icon: Phlex::TablerIcons::Home
8
4
 
9
5
  m.item "Resources", icon: Phlex::TablerIcons::GridDots do |n|
10
6
  registered_resources.each do |resource|
@@ -12,6 +8,10 @@
12
8
  end
13
9
  end
14
10
  end
15
- )
16
- %>
11
+ ) do |rail| %>
12
+ <% if respond_to?(:resource_logo_tag) %>
13
+ <% rail.with_brand do %>
14
+ <%= resource_logo_tag(classname: "h-8 w-8 rounded-md") %>
15
+ <% end %>
16
+ <% end %>
17
17
  <% end %>
@@ -0,0 +1 @@
1
+ <%= render build_grid_collection %>
@@ -120,13 +120,13 @@
120
120
  {
121
121
  "warning_type": "Dangerous Eval",
122
122
  "warning_code": 13,
123
- "fingerprint": "a14cf69ee743ba0aa405725f018c186d6fdfa3f3f57a381613de1b2048621170",
123
+ "fingerprint": "e5f68f8342a094ffd2124c1650428135e0549da39950158725414bfca0bb8f1e",
124
124
  "check_name": "Evaluation",
125
125
  "message": "Dynamic string evaluated as code",
126
126
  "file": "lib/plutonium/auth/rodauth.rb",
127
127
  "line": 6,
128
128
  "link": "https://brakemanscanner.org/docs/warning_types/dangerous_eval/",
129
- "code": "Module.new.module_eval(\" extend ActiveSupport::Concern\\n\\n included do\\n helper_method :current_user\\n helper_method :logout_url\\n end\\n\\n private\\n\\n def rodauth(name = :#{name})\\n instance = super(name)\\n instance.url_options = default_url_options.presence\\n instance\\n end\\n\\n def current_user\\n rodauth.rails_account\\n end\\n\\n def logout_url\\n rodauth.logout_path\\n end\\n\\n define_singleton_method(:to_s) { \\\"Plutonium::Auth::Rodauth(:#{name})\\\" }\\n define_singleton_method(:inspect) { \\\"Plutonium::Auth::Rodauth(:#{name})\\\" }\\n\", \"lib/plutonium/auth/rodauth.rb\", 7)",
129
+ "code": "Module.new.module_eval(\"...\", \"lib/plutonium/auth/rodauth.rb\", 7)",
130
130
  "render_path": null,
131
131
  "location": {
132
132
  "type": "method",
@@ -233,6 +233,29 @@
233
233
  89
234
234
  ],
235
235
  "note": "False positive: 'key' is the filter attribute name from definition code, not user input. User input (query) is parameterized."
236
+ },
237
+ {
238
+ "warning_type": "Redirect",
239
+ "warning_code": 18,
240
+ "fingerprint": "ce92f474802c81eb79c01577415a82ef604bddcb8072b68c5508260b2b0b7469",
241
+ "check_name": "Redirect",
242
+ "message": "Possible unprotected redirect",
243
+ "file": "lib/plutonium/invites/controller.rb",
244
+ "line": 76,
245
+ "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
246
+ "code": "redirect_to(invitation_path_for(params[:token]), :alert => \"Please sign in to accept this invitation\")",
247
+ "render_path": null,
248
+ "location": {
249
+ "type": "method",
250
+ "class": "Plutonium::Invites::Controller",
251
+ "method": "accept"
252
+ },
253
+ "user_input": "params[:token]",
254
+ "confidence": "Weak",
255
+ "cwe_id": [
256
+ 601
257
+ ],
258
+ "note": "False positive: params[:token] is interpolated into a route helper as a single path segment, not used as the redirect URL itself. The destination is a server-controlled named route."
236
259
  }
237
260
  ],
238
261
  "brakeman_version": "7.1.1"
@@ -21,6 +21,7 @@ export default defineConfig(withMermaid({
21
21
  ["meta", { name: "twitter:image", content: "https://radioactive-labs.github.io/plutonium-core/og-image.png" }],
22
22
  ],
23
23
  ignoreDeadLinks: 'localhostLinks',
24
+ srcExclude: ['superpowers/**'],
24
25
  themeConfig: {
25
26
  // https://vitepress.dev/reference/default-theme-config
26
27
  logo: "/plutonium.png",
@@ -111,65 +112,74 @@ export default defineConfig(withMermaid({
111
112
  ]
112
113
  },
113
114
  {
114
- text: "Model",
115
+ text: "App",
115
116
  collapsed: false,
116
117
  items: [
117
- { text: "Model", link: "/reference/model/" },
118
- { text: "Features", link: "/reference/model/features" },
118
+ { text: "Overview", link: "/reference/app/" },
119
+ { text: "Packages", link: "/reference/app/packages" },
120
+ { text: "Portals", link: "/reference/app/portals" },
121
+ { text: "Generators", link: "/reference/app/generators" },
119
122
  ]
120
123
  },
121
124
  {
122
- text: "Definition",
125
+ text: "Resource",
123
126
  collapsed: false,
124
127
  items: [
125
- { text: "Definition", link: "/reference/definition/" },
126
- { text: "Fields", link: "/reference/definition/fields" },
127
- { text: "Actions", link: "/reference/definition/actions" },
128
- { text: "Query", link: "/reference/definition/query" },
128
+ { text: "Overview", link: "/reference/resource/" },
129
+ { text: "Model", link: "/reference/resource/model" },
130
+ { text: "Definition", link: "/reference/resource/definition" },
131
+ { text: "Query", link: "/reference/resource/query" },
132
+ { text: "Actions", link: "/reference/resource/actions" },
129
133
  ]
130
134
  },
131
135
  {
132
- text: "Policy",
136
+ text: "Behavior",
133
137
  collapsed: false,
134
138
  items: [
135
- { text: "Policy", link: "/reference/policy/" },
139
+ { text: "Overview", link: "/reference/behavior/" },
140
+ { text: "Controllers", link: "/reference/behavior/controllers" },
141
+ { text: "Policies", link: "/reference/behavior/policies" },
142
+ { text: "Interactions", link: "/reference/behavior/interactions" },
136
143
  ]
137
144
  },
138
145
  {
139
- text: "Controller",
146
+ text: "UI",
140
147
  collapsed: false,
141
148
  items: [
142
- { text: "Controller", link: "/reference/controller/" },
149
+ { text: "Overview", link: "/reference/ui/" },
150
+ { text: "Pages", link: "/reference/ui/pages" },
151
+ { text: "Forms", link: "/reference/ui/forms" },
152
+ { text: "Displays", link: "/reference/ui/displays" },
153
+ { text: "Tables", link: "/reference/ui/tables" },
154
+ { text: "Components", link: "/reference/ui/components" },
155
+ { text: "Layouts", link: "/reference/ui/layouts" },
156
+ { text: "Assets", link: "/reference/ui/assets" },
143
157
  ]
144
158
  },
145
159
  {
146
- text: "Interaction",
147
- collapsed: false,
148
- items: [
149
- { text: "Interaction", link: "/reference/interaction/" },
150
- ]
151
- },
152
- {
153
- text: "Views",
160
+ text: "Auth",
154
161
  collapsed: false,
155
162
  items: [
156
- { text: "Views", link: "/reference/views/" },
157
- { text: "Forms", link: "/reference/views/forms" },
163
+ { text: "Overview", link: "/reference/auth/" },
164
+ { text: "Accounts", link: "/reference/auth/accounts" },
165
+ { text: "Profile", link: "/reference/auth/profile" },
158
166
  ]
159
167
  },
160
168
  {
161
- text: "Assets",
169
+ text: "Tenancy",
162
170
  collapsed: false,
163
171
  items: [
164
- { text: "Assets", link: "/reference/assets/" },
172
+ { text: "Overview", link: "/reference/tenancy/" },
173
+ { text: "Entity scoping", link: "/reference/tenancy/entity-scoping" },
174
+ { text: "Nested resources", link: "/reference/tenancy/nested-resources" },
175
+ { text: "Invites", link: "/reference/tenancy/invites" },
165
176
  ]
166
177
  },
167
178
  {
168
- text: "Infrastructure",
179
+ text: "Testing",
169
180
  collapsed: false,
170
181
  items: [
171
- { text: "Generators", link: "/reference/generators/" },
172
- { text: "Portal", link: "/reference/portal/" },
182
+ { text: "Overview", link: "/reference/testing/" },
173
183
  ]
174
184
  }
175
185
  ],
@@ -1,57 +1,50 @@
1
1
  # Getting Started
2
2
 
3
- Welcome to Plutonium! This guide will help you get up and running quickly.
4
-
5
- ## What You'll Learn
6
-
7
- - How to install Plutonium in a new or existing Rails application
8
- - The basic concepts behind Plutonium's architecture
9
- - How to create your first resource and connect it to a portal
3
+ Welcome to Plutonium.
10
4
 
11
5
  ## Prerequisites
12
6
 
13
- Before you begin, make sure you have:
14
-
15
- - **Ruby 3.2+** installed
7
+ - **Ruby 3.2+**
16
8
  - **Rails 7.2+** (Rails 8 recommended)
17
9
  - **Node.js 18+** (for asset compilation)
18
10
  - Basic familiarity with Ruby on Rails
19
11
 
20
- ## Choose Your Path
12
+ ## Pick your starting point
21
13
 
22
- ### New Application
14
+ ### New Rails app
23
15
 
24
- If you're starting fresh, use our application template:
16
+ The fastest way use the application template:
25
17
 
26
18
  ```bash
27
19
  rails new myapp -a propshaft -j esbuild -c tailwind \
28
20
  -m https://radioactive-labs.github.io/plutonium-core/templates/plutonium.rb
29
21
  ```
30
22
 
31
- This creates a fully configured Plutonium application with authentication ready to go.
23
+ This sets up Rails + Propshaft + esbuild + TailwindCSS + Plutonium in one shot, with Rodauth ready to go.
32
24
 
33
- [Continue to Installation](./installation)
25
+ [ Installation](./installation)
34
26
 
35
- ### Existing Application
27
+ ### Existing Rails app
36
28
 
37
- Adding Plutonium to an existing Rails app requires a few more steps but is fully supported.
29
+ For pre-existing apps, use `base.rb` (not `plutonium.rb` that one runs full app bootstrap and clobbers history):
38
30
 
39
- [Continue to Installation →](./installation#existing-application)
31
+ ```bash
32
+ bin/rails app:template \
33
+ LOCATION=https://radioactive-labs.github.io/plutonium-core/templates/base.rb
34
+ ```
40
35
 
41
- ### Tutorial
36
+ [→ Installation › Existing app](./installation#existing-application)
42
37
 
43
- Want to learn by building? Follow our step-by-step tutorial to create a complete blog application.
38
+ ### Tutorial
44
39
 
45
- [Start the Tutorial ](./tutorial/)
40
+ Want to learn by building? The [8-step tutorial](./tutorial/) walks through a complete blog app — auth, authorization, custom actions, nested resources, multi-portal.
46
41
 
47
- ## Next Steps
42
+ [→ Tutorial](./tutorial/)
48
43
 
49
- After installation, you'll typically:
44
+ ## After installation
50
45
 
51
- 1. **Create a Feature Package** - Organize your business logic
52
- 2. **Generate Resources** - Create your models and scaffolds
53
- 3. **Create a Portal** - Set up the web interface
54
- 4. **Connect Resources** - Make resources accessible through the portal
55
- 5. **Customize** - Override defaults as needed
46
+ 1. **Create resources** with `pu:res:scaffold` (see [Adding resources](/guides/adding-resources))
47
+ 2. **Connect them to a portal** with `pu:res:conn`
48
+ 3. **Customize** the definition, policy, controller as needed
56
49
 
57
- Each of these steps is covered in detail in the [Tutorial](./tutorial/).
50
+ Reference for each layer: [App](/reference/app/), [Resource](/reference/resource/), [Behavior](/reference/behavior/), [UI](/reference/ui/), [Auth](/reference/auth/), [Tenancy](/reference/tenancy/), [Testing](/reference/testing/).
@@ -1,22 +1,15 @@
1
1
  # Installation
2
2
 
3
- This guide covers installing Plutonium in both new and existing Rails applications.
3
+ For full installation reference (configuration options, base classes, what `pu:core:install` creates), see [Reference › App](/reference/app/). This page covers the quickest path.
4
4
 
5
- ## New Application
6
-
7
- The fastest way to get started is with our application template:
5
+ ## New application
8
6
 
9
7
  ```bash
10
8
  rails new myapp -a propshaft -j esbuild -c tailwind \
11
9
  -m https://radioactive-labs.github.io/plutonium-core/templates/plutonium.rb
12
10
  ```
13
11
 
14
- This template:
15
- - Adds the Plutonium gem
16
- - Configures TailwindCSS 4 with Plutonium's theme
17
- - Sets up Rodauth for authentication
18
- - Creates initial migrations
19
- - Configures the asset pipeline
12
+ This sets up Rails with Propshaft, esbuild, TailwindCSS, and Plutonium — plus Rodauth auth, asset pipeline, and initial migrations.
20
13
 
21
14
  After the template completes:
22
15
 
@@ -26,122 +19,86 @@ rails db:migrate
26
19
  bin/dev
27
20
  ```
28
21
 
29
- Visit `http://localhost:3000` to see your new application.
22
+ Visit `http://localhost:3000`.
30
23
 
31
- ## Existing Application
24
+ ## Existing application
32
25
 
33
- ### Step 1: Add the Gem
26
+ ::: danger Use `base.rb`, not `plutonium.rb`
27
+ The `plutonium.rb` template re-runs full app bootstrap (dotenv, annotate, solid_*, asset config) and creates generic "initial commit" commits that clobber history. For any pre-existing app, always use `base.rb`.
28
+ :::
34
29
 
35
- Add Plutonium to your Gemfile:
30
+ ### Option 1: Template
36
31
 
37
- ```ruby
38
- gem "plutonium"
32
+ ```bash
33
+ bin/rails app:template \
34
+ LOCATION=https://radioactive-labs.github.io/plutonium-core/templates/base.rb
39
35
  ```
40
36
 
41
- Then install:
37
+ ### Option 2: Manual
42
38
 
43
- ```bash
44
- bundle install
39
+ ```ruby
40
+ # Gemfile
41
+ gem "plutonium"
45
42
  ```
46
43
 
47
- ### Step 2: Run the Installer
48
-
49
44
  ```bash
45
+ bundle install
50
46
  rails generate pu:core:install
51
47
  ```
52
48
 
53
- This generator:
54
- - Creates the Plutonium initializer
55
- - Adds required configurations
56
- - Sets up the asset pipeline integration
57
-
58
- ### Step 3: Install Rodauth (Optional)
59
-
60
- If you want Plutonium's built-in authentication:
49
+ ## Optional: authentication
61
50
 
62
51
  ```bash
63
52
  rails generate pu:rodauth:install
64
- ```
65
-
66
- This creates:
67
- - Rodauth configuration files
68
- - Account model and migrations
69
- - Email templates for authentication flows
70
-
71
- ### Step 4: Run Migrations
72
-
73
- ```bash
53
+ rails generate pu:rodauth:account user
74
54
  rails db:migrate
75
55
  ```
76
56
 
77
- ### Step 5: Configure Assets
57
+ For account options and customization, see [Reference › Auth](/reference/auth/) and [Guides › Authentication](/guides/authentication).
78
58
 
79
- Run the assets generator to set up TailwindCSS and Plutonium styles:
59
+ ## Optional: assets toolchain
80
60
 
81
61
  ```bash
82
62
  rails generate pu:core:assets
83
63
  ```
84
64
 
85
- This configures PostCSS, TailwindCSS, and imports Plutonium's styles into your application.
86
-
87
- ## Verifying Installation
65
+ Installs npm packages, creates `tailwind.config.js` extending Plutonium's config, imports Plutonium CSS, registers Stimulus controllers. Required if you want to customize the theme — see [Reference › UI › Assets](/reference/ui/assets) and [Guides › Theming](/guides/theming).
88
66
 
89
- After installation, verify everything is working:
67
+ ## Verify
90
68
 
91
69
  ```bash
92
70
  rails runner "puts Plutonium::VERSION"
93
71
  ```
94
72
 
95
- You should see the installed version number.
96
-
97
73
  ## Configuration
98
74
 
99
- Plutonium is configured in `config/initializers/plutonium.rb`:
100
-
101
75
  ```ruby
76
+ # config/initializers/plutonium.rb
102
77
  Plutonium.configure do |config|
103
- # Load default settings for version 1.0
104
78
  config.load_defaults 1.0
105
79
 
106
- # Development mode (auto-detected from PLUTONIUM_DEV env var)
107
- # config.development = true
108
-
109
- # Cache discovery (defaults to true in production, false in development)
110
- # config.cache_discovery = false
80
+ # config.shell = :classic # legacy chrome (only for upgrades)
111
81
 
112
- # Hot reloading (defaults to true in development)
113
- # config.enable_hotreload = true
114
-
115
- # Asset configuration
116
- # config.assets.logo = "custom_logo.png"
117
- # config.assets.favicon = "custom_favicon.ico"
118
- # config.assets.stylesheet = "plutonium.css"
119
- # config.assets.script = "plutonium.min.js"
82
+ # Custom assets (after running pu:core:assets)
83
+ # config.assets.stylesheet = "application"
84
+ # config.assets.script = "application"
85
+ # config.assets.logo = "custom_logo.png"
86
+ # config.assets.favicon = "custom_favicon.ico"
120
87
  end
121
88
  ```
122
89
 
123
- ## Development Setup
124
-
125
- For the best development experience:
90
+ Full configuration options: [Reference › App](/reference/app/#configuration).
126
91
 
127
- ### 1. Use bin/dev
92
+ ## `bin/dev` for development
128
93
 
129
- Plutonium includes a Procfile for `foreman`:
94
+ Plutonium ships a Procfile that runs Rails and the CSS watcher together:
130
95
 
131
96
  ```bash
132
97
  bin/dev
133
98
  ```
134
99
 
135
- This starts Rails and the CSS watcher together.
136
-
137
- ### 2. Enable Reloading
138
-
139
- In development, Plutonium automatically reloads definitions and policies when files change. This is controlled by `config.enable_hotreload` (enabled by default in development).
140
-
141
- ## Next Steps
142
-
143
- Now that Plutonium is installed:
100
+ ## Next steps
144
101
 
145
- - [Create your first Feature Package](/guides/creating-packages)
146
- - [Generate a Resource](/guides/adding-resources)
147
- - [Follow the Tutorial](/getting-started/tutorial/)
102
+ - [Tutorial](./tutorial/) build a complete blog application step-by-step
103
+ - [Adding resources](/guides/adding-resources) — create your first resource
104
+ - [Creating packages](/guides/creating-packages) — organize code into feature and portal packages
@@ -55,13 +55,12 @@ Create a second portal with different access levels for content authors.
55
55
  ### [8. Customizing the UI](./08-customizing-ui)
56
56
  Customize forms, tables, and views to match your requirements.
57
57
 
58
- ## Getting Help
58
+ ## Getting help
59
59
 
60
60
  If you get stuck:
61
- - Check the [Guides](/guides/) for detailed explanations
62
- - Browse the [Reference Documentation](/reference/) for API details
63
- - Visit our [GitHub Issues](https://github.com/radioactive-labs/plutonium-core/issues)
64
61
 
65
- Let's get started!
62
+ - Check the [Guides](/guides/) for task-oriented walkthroughs.
63
+ - Browse the [Reference](/reference/) for full API surface — [App](/reference/app/), [Resource](/reference/resource/), [Behavior](/reference/behavior/), [UI](/reference/ui/), [Auth](/reference/auth/), [Tenancy](/reference/tenancy/), [Testing](/reference/testing/).
64
+ - Visit [GitHub Issues](https://github.com/radioactive-labs/plutonium-core/issues).
66
65
 
67
66
  [Begin Chapter 1: Project Setup →](./01-setup)