plutonium 0.50.0 → 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 (132) 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 +27 -2
  11. data/Rakefile +2 -1
  12. data/app/assets/plutonium.css +1 -11
  13. data/app/assets/plutonium.js +1009 -1214
  14. data/app/assets/plutonium.js.map +3 -3
  15. data/app/assets/plutonium.min.js +52 -51
  16. data/app/assets/plutonium.min.js.map +3 -3
  17. data/docs/.vitepress/config.ts +37 -27
  18. data/docs/getting-started/index.md +22 -29
  19. data/docs/getting-started/installation.md +37 -80
  20. data/docs/getting-started/tutorial/index.md +4 -5
  21. data/docs/guides/adding-resources.md +66 -377
  22. data/docs/guides/authentication.md +94 -463
  23. data/docs/guides/authorization.md +124 -370
  24. data/docs/guides/creating-packages.md +94 -296
  25. data/docs/guides/custom-actions.md +121 -441
  26. data/docs/guides/index.md +22 -42
  27. data/docs/guides/multi-tenancy.md +116 -187
  28. data/docs/guides/nested-resources.md +103 -431
  29. data/docs/guides/search-filtering.md +123 -240
  30. data/docs/guides/testing.md +5 -4
  31. data/docs/guides/theming.md +157 -407
  32. data/docs/guides/troubleshooting.md +5 -3
  33. data/docs/guides/user-invites.md +106 -425
  34. data/docs/guides/user-profile.md +76 -243
  35. data/docs/index.md +1 -1
  36. data/docs/reference/app/generators.md +517 -0
  37. data/docs/reference/app/index.md +158 -0
  38. data/docs/reference/app/packages.md +146 -0
  39. data/docs/reference/app/portals.md +377 -0
  40. data/docs/reference/auth/accounts.md +230 -0
  41. data/docs/reference/auth/index.md +88 -0
  42. data/docs/reference/auth/profile.md +185 -0
  43. data/docs/reference/behavior/controllers.md +395 -0
  44. data/docs/reference/behavior/index.md +22 -0
  45. data/docs/reference/behavior/interactions.md +341 -0
  46. data/docs/reference/behavior/policies.md +417 -0
  47. data/docs/reference/index.md +56 -49
  48. data/docs/reference/resource/actions.md +423 -0
  49. data/docs/reference/resource/definition.md +508 -0
  50. data/docs/reference/resource/index.md +50 -0
  51. data/docs/reference/resource/model.md +348 -0
  52. data/docs/reference/resource/query.md +305 -0
  53. data/docs/reference/tenancy/entity-scoping.md +361 -0
  54. data/docs/reference/tenancy/index.md +36 -0
  55. data/docs/reference/tenancy/invites.md +393 -0
  56. data/docs/reference/tenancy/nested-resources.md +267 -0
  57. data/docs/reference/testing/index.md +287 -0
  58. data/docs/reference/ui/assets.md +400 -0
  59. data/docs/reference/ui/components.md +165 -0
  60. data/docs/reference/ui/displays.md +104 -0
  61. data/docs/reference/ui/forms.md +284 -0
  62. data/docs/reference/ui/index.md +30 -0
  63. data/docs/reference/ui/layouts.md +106 -0
  64. data/docs/reference/ui/pages.md +189 -0
  65. data/docs/reference/ui/tables.md +117 -0
  66. data/docs/superpowers/specs/2026-05-09-typeahead-endpoint-design.md +203 -0
  67. data/docs/superpowers/specs/2026-05-12-skill-compaction-design.md +99 -0
  68. data/docs/superpowers/specs/2026-05-13-docs-restructure-design.md +186 -0
  69. data/gemfiles/rails_7.gemfile.lock +1 -1
  70. data/gemfiles/rails_8.0.gemfile.lock +1 -1
  71. data/gemfiles/rails_8.1.gemfile.lock +1 -1
  72. data/lib/generators/pu/core/update/update_generator.rb +0 -20
  73. data/lib/generators/pu/invites/install_generator.rb +1 -0
  74. data/lib/plutonium/definition/base.rb +1 -1
  75. data/lib/plutonium/definition/{views.rb → index_views.rb} +21 -20
  76. data/lib/plutonium/helpers/turbo_helper.rb +11 -0
  77. data/lib/plutonium/helpers/turbo_stream_actions_helper.rb +14 -0
  78. data/lib/plutonium/resource/controller.rb +1 -0
  79. data/lib/plutonium/resource/controllers/crud_actions.rb +19 -1
  80. data/lib/plutonium/resource/controllers/typeahead.rb +180 -0
  81. data/lib/plutonium/resource/policy.rb +7 -0
  82. data/lib/plutonium/routing/mapper_extensions.rb +15 -0
  83. data/lib/plutonium/ui/component/methods.rb +4 -0
  84. data/lib/plutonium/ui/form/base.rb +6 -2
  85. data/lib/plutonium/ui/form/components/json.rb +58 -0
  86. data/lib/plutonium/ui/form/components/resource_select.rb +62 -8
  87. data/lib/plutonium/ui/form/components/secure_association.rb +98 -22
  88. data/lib/plutonium/ui/form/concerns/typeahead_attributes.rb +83 -0
  89. data/lib/plutonium/ui/form/resource.rb +0 -4
  90. data/lib/plutonium/ui/grid/resource.rb +1 -1
  91. data/lib/plutonium/ui/layout/base.rb +1 -0
  92. data/lib/plutonium/ui/page/base.rb +0 -7
  93. data/lib/plutonium/ui/page/index.rb +4 -4
  94. data/lib/plutonium/ui/table/resource.rb +1 -1
  95. data/lib/plutonium/version.rb +1 -1
  96. data/lib/plutonium.rb +8 -0
  97. data/lib/tasks/release.rake +15 -1
  98. data/package.json +10 -10
  99. data/src/css/slim_select.css +4 -0
  100. data/src/js/controllers/slim_select_controller.js +61 -0
  101. data/src/js/turbo/turbo_actions.js +33 -0
  102. data/yarn.lock +553 -543
  103. metadata +44 -33
  104. data/.claude/skills/plutonium-assets/SKILL.md +0 -512
  105. data/.claude/skills/plutonium-controller/SKILL.md +0 -396
  106. data/.claude/skills/plutonium-create-resource/SKILL.md +0 -303
  107. data/.claude/skills/plutonium-definition/SKILL.md +0 -1223
  108. data/.claude/skills/plutonium-entity-scoping/SKILL.md +0 -317
  109. data/.claude/skills/plutonium-forms/SKILL.md +0 -465
  110. data/.claude/skills/plutonium-installation/SKILL.md +0 -331
  111. data/.claude/skills/plutonium-interaction/SKILL.md +0 -413
  112. data/.claude/skills/plutonium-invites/SKILL.md +0 -408
  113. data/.claude/skills/plutonium-model/SKILL.md +0 -440
  114. data/.claude/skills/plutonium-nested-resources/SKILL.md +0 -360
  115. data/.claude/skills/plutonium-package/SKILL.md +0 -198
  116. data/.claude/skills/plutonium-policy/SKILL.md +0 -456
  117. data/.claude/skills/plutonium-portal/SKILL.md +0 -410
  118. data/.claude/skills/plutonium-views/SKILL.md +0 -651
  119. data/docs/reference/assets/index.md +0 -496
  120. data/docs/reference/controller/index.md +0 -412
  121. data/docs/reference/definition/actions.md +0 -462
  122. data/docs/reference/definition/fields.md +0 -383
  123. data/docs/reference/definition/index.md +0 -326
  124. data/docs/reference/definition/query.md +0 -351
  125. data/docs/reference/generators/index.md +0 -648
  126. data/docs/reference/interaction/index.md +0 -449
  127. data/docs/reference/model/features.md +0 -248
  128. data/docs/reference/model/index.md +0 -218
  129. data/docs/reference/policy/index.md +0 -456
  130. data/docs/reference/portal/index.md +0 -379
  131. data/docs/reference/views/forms.md +0 -411
  132. data/docs/reference/views/index.md +0 -544
@@ -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)