sun-sword 0.0.11 → 0.0.12

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -2
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +114 -55
  5. data/README.md +35 -13
  6. data/Rakefile +6 -10
  7. data/lib/generators/sun_sword/USAGE +22 -3
  8. data/lib/generators/sun_sword/frontend_generator.rb +77 -39
  9. data/lib/generators/sun_sword/frontend_generator_spec.rb +539 -0
  10. data/lib/generators/sun_sword/init_generator.rb +2 -0
  11. data/lib/generators/sun_sword/init_generator_spec.rb +82 -0
  12. data/lib/generators/sun_sword/scaffold_generator.rb +189 -24
  13. data/lib/generators/sun_sword/scaffold_generator_spec.rb +1414 -0
  14. data/lib/generators/sun_sword/templates_frontend/{Procfile.dev → Procfile.dev.tt} +1 -0
  15. data/lib/generators/sun_sword/templates_frontend/bin/{watch → watch.tt} +2 -1
  16. data/lib/generators/sun_sword/templates_frontend/config/{vite.json → vite.json.tt} +2 -1
  17. data/lib/generators/sun_sword/templates_frontend/controllers/application_controller.rb.tt +2 -2
  18. data/lib/generators/sun_sword/templates_frontend/controllers/tests_controller.rb +36 -0
  19. data/lib/generators/sun_sword/templates_frontend/controllers/tests_controller_spec.rb +62 -0
  20. data/lib/generators/sun_sword/templates_frontend/env.development +1 -1
  21. data/lib/generators/sun_sword/templates_frontend/frontend/entrypoints/application.js +2 -2
  22. data/lib/generators/sun_sword/templates_frontend/frontend/pages/tests-stimulus.js +31 -0
  23. data/lib/generators/sun_sword/templates_frontend/frontend/pages/web.js +12 -0
  24. data/lib/generators/sun_sword/templates_frontend/frontend/stylesheets/application.css +1 -3
  25. data/lib/generators/sun_sword/templates_frontend/helpers/application_helper.rb +17 -0
  26. data/lib/generators/sun_sword/templates_frontend/helpers/application_helper_spec.rb +30 -0
  27. data/lib/generators/sun_sword/templates_frontend/package.json.tt +14 -0
  28. data/lib/generators/sun_sword/templates_frontend/views/components/_action_destroy.html.erb.tt +1 -1
  29. data/lib/generators/sun_sword/templates_frontend/views/components/_alert.html.erb.tt +1 -1
  30. data/lib/generators/sun_sword/templates_frontend/views/layouts/application.html.erb.tt +3 -3
  31. data/lib/generators/sun_sword/templates_frontend/views/tests/_frame_content.html.erb +9 -0
  32. data/lib/generators/sun_sword/templates_frontend/views/tests/_log_entry.html.erb +4 -0
  33. data/lib/generators/sun_sword/templates_frontend/views/tests/_updated_content.html.erb +6 -0
  34. data/lib/generators/sun_sword/templates_frontend/views/tests/stimulus.html.erb +45 -0
  35. data/lib/generators/sun_sword/templates_frontend/views/tests/turbo_drive.html.erb +55 -0
  36. data/lib/generators/sun_sword/templates_frontend/views/tests/turbo_frame.html.erb +87 -0
  37. data/lib/generators/sun_sword/templates_frontend/vite.config.ts.tt +1 -1
  38. data/lib/generators/sun_sword/templates_init/config/initializers/sun_sword.rb +1 -0
  39. data/lib/generators/sun_sword/templates_scaffold/controllers/controller.rb.tt +24 -24
  40. data/lib/generators/sun_sword/templates_scaffold/controllers/controller_spec.rb.tt +398 -0
  41. data/lib/generators/sun_sword/templates_scaffold/views/index.html.erb.tt +5 -5
  42. data/lib/generators/sun_sword/templates_scaffold/views/show.html.erb.tt +3 -0
  43. data/lib/generators/tmp/db/structures/test_structure.yaml +42 -0
  44. data/lib/sun-sword.rb +1 -0
  45. data/lib/sun_sword/configuration_spec.rb +77 -0
  46. data/lib/sun_sword/version.rb +1 -1
  47. metadata +84 -30
  48. data/lib/generators/sun_sword/templates_frontend/controllers/site_controller.rb +0 -16
  49. data/lib/generators/sun_sword/templates_frontend/db/seeds.rb +0 -3
  50. data/lib/generators/sun_sword/templates_frontend/db/structures/example.yaml.tt +0 -106
  51. data/lib/generators/sun_sword/templates_frontend/frontend/pages/stimulus.js +0 -10
  52. data/lib/generators/sun_sword/templates_frontend/package.json +0 -7
  53. data/lib/generators/sun_sword/templates_frontend/views/site/_comment.html.erb.tt +0 -3
  54. data/lib/generators/sun_sword/templates_frontend/views/site/stimulus.html.erb.tt +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d07154e1285345a247e59933071b6c40906ed2e4fa3c61f95274cec3bbacebfe
4
- data.tar.gz: 95b7cee97b1bb5b4505e5cbe39e4f756ca5b9f65eab6b560df067f74645e75df
3
+ metadata.gz: e7f2301ad37844f511cef0f9439948ee35b7e74411e7a28989fcac4ff0ed3bb4
4
+ data.tar.gz: e37e5d005d3cb2fc82ce039570f9f6f5117c7347d4b1cc1c662df60b62fc85d3
5
5
  SHA512:
6
- metadata.gz: 47fb75a4bd69a876903071cf4521d9332f3ac727ff7a839eefd81a939d5576768396786bc5d9176118bc63e90c5a7137063aa059b52640f17fef80c199d5535e
7
- data.tar.gz: b1129c75fe08c8d8aaeb75f774dc828273653c648a6facb1e59b7899cc5b4e8e78898dbf58e475e44779fff6e29b9bc6e555e730ba7c04b01fd2897bf4a6b382
6
+ metadata.gz: cbc03f139610daf61f3c260efac697aa0229aba1bccd608a1d207fccdf74254e43f639870a09d0f6b8ae80b6c21f3436e1ec935368934c65accf25a5d5fd2646
7
+ data.tar.gz: 88ea0d19496ba67f716f7d1479b99e03efb8191c4609bc3c08c5d7131cac98204e4a9f634a2572e548873f1fca0cc612b4db9a0780f82fa355418c5ac76c9d5e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
1
8
  ## [Unreleased]
2
9
 
3
- ## [0.1.0] - 2024-09-08
10
+ ### Changed
11
+ - 🔄 Removed engine support from frontend generator only
12
+ - 🔄 Scaffold generator retains full engine support with `--engine` and `--engine_structure` options
13
+ - 📝 Updated documentation to clarify engine support differences
14
+
15
+ ## [0.0.12] - 2025-11-07
16
+
17
+ ### Added
18
+ - ✨ Engine support for frontend generator with `--engine` option
19
+ - ✨ Engine support for scaffold generator with `--engine` option
20
+ - ✨ `--engine_structure` option to load structure files from different engines
21
+ - ✨ Auto-detect engine paths (engines/, components/, gems/)
22
+ - ✨ Multiple engine support for modular Rails applications
23
+ - 📝 ENGINE_SUPPORT.md comprehensive documentation
24
+ - 📝 Updated USAGE with engine examples
25
+
26
+ ### Changed
27
+ - 🔄 Frontend generator now supports path_app helper for engine routing
28
+ - 🔄 Scaffold generator now supports engine-specific paths
29
+ - 🔄 Structure file path resolution supports engines
30
+ - 📝 Updated README with engine usage examples
31
+
32
+ ### Fixed
33
+ - 🐛 All path references now use helpers for engine compatibility
34
+
35
+ ## [0.0.11] - 2025-11-07
36
+
37
+ ### Changed
38
+ - 🔄 Migrated from Yarn/NPM to Bun for faster package management
39
+ - 🔄 Updated all `yarn` commands to `bun` commands
40
+ - 📦 All frontend dependencies now installed via Bun
41
+
42
+ ### Added
43
+ - ✨ RSpec structure matching rider-kick (co-located specs)
44
+ - ✨ generator_spec gem for better generator testing
45
+ - ✨ Support directory for test helpers
46
+ - 📝 MIGRATION_TO_BUN.md documentation
47
+
48
+ ### Fixed
49
+ - ✅ All 37 RSpec tests now passing
50
+ - 🧹 Cleaned up root-level development artifacts
51
+
52
+ ## [0.0.1] - 2024-01-01
53
+
54
+ ### Added
55
+ - 🎉 Initial release
56
+ - ⚡ Vite + Tailwind v4 + Hotwire (Turbo + Stimulus) integration
57
+ - 🎨 Frontend generator with modern stack
58
+ - 📝 Scaffold generator for Clean Architecture
59
+ - 🏗️ View scaffolds aligned with domain
4
60
 
5
- - Initial release
data/Gemfile CHANGED
@@ -10,3 +10,11 @@ group :development, :test do
10
10
  gem 'rubocop-performance'
11
11
  gem 'rubocop-rails-omakase', require: false
12
12
  end
13
+ # --- SunSword Package frontend
14
+ gem 'stimulus-rails'
15
+ gem 'turbo-rails'
16
+ gem 'vite_rails'
17
+
18
+ group :development do
19
+ gem 'listen'
20
+ end
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sun-sword (0.0.11)
5
- activesupport (>= 7.1, < 8.1)
6
- railties (>= 7.1, < 8.1)
4
+ sun-sword (0.0.12)
5
+ activesupport (>= 7.0, < 9.0)
6
+ hashie (>= 5.0, < 6.0)
7
7
  thor (>= 1.2, < 2.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionpack (8.0.2.1)
13
- actionview (= 8.0.2.1)
14
- activesupport (= 8.0.2.1)
12
+ actionpack (8.1.1)
13
+ actionview (= 8.1.1)
14
+ activesupport (= 8.1.1)
15
15
  nokogiri (>= 1.8.5)
16
16
  rack (>= 2.2.4)
17
17
  rack-session (>= 1.0.1)
@@ -19,20 +19,20 @@ GEM
19
19
  rails-dom-testing (~> 2.2)
20
20
  rails-html-sanitizer (~> 1.6)
21
21
  useragent (~> 0.16)
22
- actionview (8.0.2.1)
23
- activesupport (= 8.0.2.1)
22
+ actionview (8.1.1)
23
+ activesupport (= 8.1.1)
24
24
  builder (~> 3.1)
25
25
  erubi (~> 1.11)
26
26
  rails-dom-testing (~> 2.2)
27
27
  rails-html-sanitizer (~> 1.6)
28
- activesupport (8.0.2.1)
28
+ activesupport (8.1.1)
29
29
  base64
30
- benchmark (>= 0.3)
31
30
  bigdecimal
32
31
  concurrent-ruby (~> 1.0, >= 1.3.1)
33
32
  connection_pool (>= 2.2.5)
34
33
  drb
35
34
  i18n (>= 1.6, < 2)
35
+ json
36
36
  logger (>= 1.4.2)
37
37
  minitest (>= 5.1)
38
38
  securerandom (>= 0.3)
@@ -42,54 +42,82 @@ GEM
42
42
  bundler
43
43
  rake
44
44
  thor (>= 0.14.0)
45
- ast (2.4.2)
45
+ ast (2.4.3)
46
46
  base64 (0.3.0)
47
- benchmark (0.4.1)
48
- bigdecimal (3.2.3)
47
+ bigdecimal (3.3.1)
49
48
  builder (3.3.0)
50
- byebug (11.1.3)
49
+ byebug (12.0.0)
51
50
  concurrent-ruby (1.3.5)
52
- connection_pool (2.5.4)
51
+ connection_pool (2.5.5)
53
52
  crass (1.0.6)
54
- date (3.4.1)
55
- diff-lcs (1.5.1)
53
+ date (3.5.0)
54
+ diff-lcs (1.6.2)
56
55
  drb (2.2.3)
57
- erb (5.0.2)
56
+ dry-cli (1.3.0)
57
+ erb (6.0.0)
58
58
  erubi (1.13.1)
59
+ ffi (1.17.2-aarch64-linux-gnu)
60
+ ffi (1.17.2-aarch64-linux-musl)
61
+ ffi (1.17.2-arm-linux-gnu)
62
+ ffi (1.17.2-arm-linux-musl)
63
+ ffi (1.17.2-arm64-darwin)
64
+ ffi (1.17.2-x86_64-darwin)
65
+ ffi (1.17.2-x86_64-linux-gnu)
66
+ ffi (1.17.2-x86_64-linux-musl)
67
+ generator_spec (0.10.0)
68
+ activesupport (>= 3.0.0)
69
+ railties (>= 3.0.0)
70
+ hashie (5.0.0)
59
71
  i18n (1.14.7)
60
72
  concurrent-ruby (~> 1.0)
61
73
  io-console (0.8.1)
62
- irb (1.15.2)
74
+ irb (1.15.3)
63
75
  pp (>= 0.6.0)
64
76
  rdoc (>= 4.0.0)
65
77
  reline (>= 0.4.2)
66
- json (2.13.2)
78
+ json (2.16.0)
67
79
  language_server-protocol (3.17.0.5)
68
80
  lint_roller (1.1.0)
81
+ listen (3.9.0)
82
+ rb-fsevent (~> 0.10, >= 0.10.3)
83
+ rb-inotify (~> 0.9, >= 0.9.10)
69
84
  logger (1.7.0)
70
85
  loofah (2.24.1)
71
86
  crass (~> 1.0.2)
72
87
  nokogiri (>= 1.12.0)
73
- mini_portile2 (2.8.9)
74
- minitest (5.25.5)
75
- nokogiri (1.18.10)
76
- mini_portile2 (~> 2.8.2)
88
+ minitest (5.26.2)
89
+ mutex_m (0.3.0)
90
+ nokogiri (1.18.10-aarch64-linux-gnu)
91
+ racc (~> 1.4)
92
+ nokogiri (1.18.10-aarch64-linux-musl)
93
+ racc (~> 1.4)
94
+ nokogiri (1.18.10-arm-linux-gnu)
95
+ racc (~> 1.4)
96
+ nokogiri (1.18.10-arm-linux-musl)
77
97
  racc (~> 1.4)
78
98
  nokogiri (1.18.10-arm64-darwin)
79
99
  racc (~> 1.4)
100
+ nokogiri (1.18.10-x86_64-darwin)
101
+ racc (~> 1.4)
102
+ nokogiri (1.18.10-x86_64-linux-gnu)
103
+ racc (~> 1.4)
104
+ nokogiri (1.18.10-x86_64-linux-musl)
105
+ racc (~> 1.4)
80
106
  parallel (1.27.0)
81
- parser (3.3.9.0)
107
+ parser (3.3.10.0)
82
108
  ast (~> 2.4.1)
83
109
  racc
84
- pp (0.6.2)
110
+ pp (0.6.3)
85
111
  prettyprint
86
112
  prettyprint (0.2.0)
87
- prism (1.5.0)
113
+ prism (1.6.0)
88
114
  psych (5.2.6)
89
115
  date
90
116
  stringio
91
117
  racc (1.8.1)
92
- rack (3.2.1)
118
+ rack (3.2.4)
119
+ rack-proxy (0.7.7)
120
+ rack
93
121
  rack-session (2.1.1)
94
122
  base64 (>= 0.1.0)
95
123
  rack (>= 3.0.0)
@@ -104,36 +132,41 @@ GEM
104
132
  rails-html-sanitizer (1.6.2)
105
133
  loofah (~> 2.21)
106
134
  nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
107
- railties (8.0.2.1)
108
- actionpack (= 8.0.2.1)
109
- activesupport (= 8.0.2.1)
135
+ railties (8.1.1)
136
+ actionpack (= 8.1.1)
137
+ activesupport (= 8.1.1)
110
138
  irb (~> 1.13)
111
139
  rackup (>= 1.0.0)
112
140
  rake (>= 12.2)
113
141
  thor (~> 1.0, >= 1.2.2)
142
+ tsort (>= 0.2)
114
143
  zeitwerk (~> 2.6)
115
144
  rainbow (3.1.1)
116
- rake (13.2.1)
117
- rdoc (6.14.2)
145
+ rake (13.3.1)
146
+ rb-fsevent (0.11.2)
147
+ rb-inotify (0.11.1)
148
+ ffi (~> 1.0)
149
+ rdoc (6.16.1)
118
150
  erb
119
151
  psych (>= 4.0.0)
120
- regexp_parser (2.11.2)
121
- reline (0.6.2)
152
+ tsort
153
+ regexp_parser (2.11.3)
154
+ reline (0.6.3)
122
155
  io-console (~> 0.5)
123
- rspec (3.13.0)
156
+ rspec (3.13.2)
124
157
  rspec-core (~> 3.13.0)
125
158
  rspec-expectations (~> 3.13.0)
126
159
  rspec-mocks (~> 3.13.0)
127
- rspec-core (3.13.2)
160
+ rspec-core (3.13.6)
128
161
  rspec-support (~> 3.13.0)
129
- rspec-expectations (3.13.3)
162
+ rspec-expectations (3.13.5)
130
163
  diff-lcs (>= 1.2.0, < 2.0)
131
164
  rspec-support (~> 3.13.0)
132
- rspec-mocks (3.13.2)
165
+ rspec-mocks (3.13.7)
133
166
  diff-lcs (>= 1.2.0, < 2.0)
134
167
  rspec-support (~> 3.13.0)
135
- rspec-support (3.13.1)
136
- rubocop (1.80.2)
168
+ rspec-support (3.13.6)
169
+ rubocop (1.81.7)
137
170
  json (~> 2.3)
138
171
  language_server-protocol (~> 3.17.0.2)
139
172
  lint_roller (~> 1.1.0)
@@ -141,17 +174,17 @@ GEM
141
174
  parser (>= 3.3.0.2)
142
175
  rainbow (>= 2.2.2, < 4.0)
143
176
  regexp_parser (>= 2.9.3, < 3.0)
144
- rubocop-ast (>= 1.46.0, < 2.0)
177
+ rubocop-ast (>= 1.47.1, < 2.0)
145
178
  ruby-progressbar (~> 1.7)
146
179
  unicode-display_width (>= 2.4.0, < 4.0)
147
- rubocop-ast (1.46.0)
180
+ rubocop-ast (1.48.0)
148
181
  parser (>= 3.3.7.2)
149
182
  prism (~> 1.4)
150
- rubocop-performance (1.26.0)
183
+ rubocop-performance (1.26.1)
151
184
  lint_roller (~> 1.1)
152
185
  rubocop (>= 1.75.0, < 2.0)
153
- rubocop-ast (>= 1.44.0, < 2.0)
154
- rubocop-rails (2.33.3)
186
+ rubocop-ast (>= 1.47.1, < 2.0)
187
+ rubocop-rails (2.34.2)
155
188
  activesupport (>= 4.2.0)
156
189
  lint_roller (~> 1.1)
157
190
  rack (>= 1.1)
@@ -163,31 +196,57 @@ GEM
163
196
  rubocop-rails (>= 2.30)
164
197
  ruby-progressbar (1.13.0)
165
198
  securerandom (0.4.1)
166
- stringio (3.1.7)
199
+ stimulus-rails (1.3.4)
200
+ railties (>= 6.0.0)
201
+ stringio (3.1.9)
167
202
  thor (1.4.0)
203
+ tsort (0.2.0)
204
+ turbo-rails (2.0.20)
205
+ actionpack (>= 7.1.0)
206
+ railties (>= 7.1.0)
168
207
  tzinfo (2.0.6)
169
208
  concurrent-ruby (~> 1.0)
170
209
  unicode-display_width (3.2.0)
171
210
  unicode-emoji (~> 4.1)
172
211
  unicode-emoji (4.1.0)
173
- uri (1.0.3)
212
+ uri (1.1.1)
174
213
  useragent (0.16.11)
214
+ vite_rails (3.0.19)
215
+ railties (>= 5.1, < 9)
216
+ vite_ruby (~> 3.0, >= 3.2.2)
217
+ vite_ruby (3.9.2)
218
+ dry-cli (>= 0.7, < 2)
219
+ logger (~> 1.6)
220
+ mutex_m
221
+ rack-proxy (~> 0.6, >= 0.6.1)
222
+ zeitwerk (~> 2.2)
175
223
  zeitwerk (2.7.3)
176
224
 
177
225
  PLATFORMS
178
- arm64-darwin-23
179
- ruby
226
+ aarch64-linux-gnu
227
+ aarch64-linux-musl
228
+ arm-linux-gnu
229
+ arm-linux-musl
230
+ arm64-darwin
231
+ x86_64-darwin
232
+ x86_64-linux-gnu
233
+ x86_64-linux-musl
180
234
 
181
235
  DEPENDENCIES
182
236
  appraisal (~> 2.5)
183
- bundler (~> 2.4)
237
+ bundler (>= 2.4, < 3.0)
184
238
  byebug
185
- rake (~> 13.0)
186
- rspec (~> 3.12)
187
- rubocop (~> 1.65)
239
+ generator_spec (>= 0.9, < 1.0)
240
+ listen
241
+ rake (>= 13.0, < 14.0)
242
+ rspec (>= 3.12, < 4.0)
243
+ rubocop (>= 1.63, < 2.0)
188
244
  rubocop-performance
189
245
  rubocop-rails-omakase
246
+ stimulus-rails
190
247
  sun-sword!
248
+ turbo-rails
249
+ vite_rails
191
250
 
192
251
  BUNDLED WITH
193
- 2.5.18
252
+ 2.7.2
data/README.md CHANGED
@@ -8,15 +8,28 @@ Clean Architecture, as described in [Robert Martin's seminal book](https://www.a
8
8
  ## ✨ Features
9
9
 
10
10
  - **One-shot frontend setup**
11
- Installs and wires **Vite**, **Tailwind v4**, **Turbo**, **Stimulus**, HMR, and sensible defaults.
11
+ Installs and wires **Vite**, **Tailwind v4**, **Turbo**, **Stimulus**, HMR, and sensible defaults using **Bun**.
12
12
  - **Scaffolded views & components**
13
13
  Opinionated but flexible ERB views, partials, and Stimulus controllers.
14
14
  - **Clean integration with Rails 8 + Vite Ruby**
15
15
  Ships `vite.config.ts`, `config/vite.json`, `Procfile.dev`, `bin/watch`, and entrypoints.
16
+ - **Fast package management with Bun**
17
+ All frontend dependencies (Vite, Tailwind, Turbo, Stimulus) are installed via Bun for maximum speed.
16
18
 
17
19
  ---
18
20
  ## Installation
19
21
 
22
+ ### Prerequisites
23
+
24
+ Make sure you have **Bun** installed on your system:
25
+
26
+ ```bash
27
+ # Install Bun (if not already installed)
28
+ curl -fsSL https://bun.sh/install | bash
29
+ ```
30
+
31
+ ### Add to Gemfile
32
+
20
33
  Add this line to your application's Gemfile:
21
34
 
22
35
  ```ruby
@@ -24,25 +37,34 @@ gem 'rider-kick'
24
37
  gem 'sun-sword'
25
38
  ```
26
39
 
27
-
28
40
  And then execute:
29
41
  ```bash
30
- $ rails generate sun_sword:frontend
42
+ $ bundle install
43
+ $ rails generate sun_sword:frontend --setup
31
44
  $ rubocop -A
32
45
  ```
46
+
47
+ The generator will automatically install frontend dependencies using Bun.
33
48
  ---
34
49
  ## Usage
50
+
51
+ ### Basic Usage
35
52
  ```bash
36
- Description:
37
- Clean Architecture CRUD generator
38
-
39
- Example:
40
- To Generate Frontend:
41
- bin/rails generate sun_sword:init
42
- bin/rails generate sun_sword:frontend --setup
43
-
44
- To Generate scaffold:
45
- bin/rails generate sun_sword:scaffold Models::Contact actor:user
53
+ # Init configuration
54
+ bin/rails generate sun_sword:init
55
+
56
+ # Setup frontend (main app only)
57
+ bin/rails generate sun_sword:frontend --setup
58
+
59
+ # Generate scaffold (main app)
60
+ bin/rails generate sun_sword:scaffold user
61
+ bin/rails generate sun_sword:scaffold product scope:dashboard
62
+
63
+ # Generate scaffold (specific engine)
64
+ bin/rails generate sun_sword:scaffold user --engine=admin
65
+
66
+ # Generate to one engine, use structure from another
67
+ bin/rails generate sun_sword:scaffold product --engine=api --engine_structure=core
46
68
  ```
47
69
  ---
48
70
  ## Generated structure
data/Rakefile CHANGED
@@ -1,12 +1,8 @@
1
- # frozen_string_literal: true
1
+ # Rakefile
2
+ require 'rspec/core/rake_task'
2
3
 
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
4
+ RSpec::Core::RakeTask.new(:spec) do |t|
5
+ t.pattern = '{app,lib}/**/*_spec.rb'
6
+ end
5
7
 
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
8
+ task default: :spec
@@ -1,10 +1,29 @@
1
1
  Description:
2
- Clean Architecture CRUD generator
3
- rails new jendral_jack -d=postgresql -T --skip-javascript --skip-asset-pipeline
2
+ Clean Architecture CRUD generator with Engine support (scaffold only)
3
+ rails new jendral_jack -d=postgresql -T --skip-javascript
4
4
 
5
5
  Example:
6
+ # Init configuration
6
7
  bin/rails generate sun_sword:init
8
+
9
+ # Frontend setup (main app only)
7
10
  bin/rails generate sun_sword:frontend --setup
8
- bin/rails generate sun_sword:scaffold contacts<check in db/structure>
9
11
 
12
+ # Scaffold (main app)
13
+ bin/rails generate sun_sword:scaffold contacts
14
+ bin/rails generate sun_sword:scaffold products scope:dashboard
15
+
16
+ # Scaffold (specific engine)
17
+ bin/rails generate sun_sword:scaffold users --engine=admin
18
+
19
+ # Scaffold (engine with structure from another engine)
20
+ bin/rails generate sun_sword:scaffold products --engine=api --engine_structure=core
21
+
22
+ Available Options:
23
+ --scope=SCOPE_NAME # Generate files in specific scope directory
24
+ --engine=ENGINE_NAME # Generate scaffold files to specific engine
25
+ --engine_structure=ENGINE # Load structure file from specific engine
26
+
27
+ Note: Structure files must be in db/structures/[name]_structure.yaml
28
+ For engines: [engine_path]/db/structures/[name]_structure.yaml
10
29