sun-sword 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +1141 -0
  4. data/CHANGELOG.md +5 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +96 -0
  7. data/Rakefile +12 -0
  8. data/lib/generators/sun_sword/USAGE +9 -0
  9. data/lib/generators/sun_sword/frontend_generator.rb +148 -0
  10. data/lib/generators/sun_sword/scaffold_generator.rb +97 -0
  11. data/lib/generators/sun_sword/templates_frontend/Procfile.dev +1 -0
  12. data/lib/generators/sun_sword/templates_frontend/assets/config/manifest.js +1 -0
  13. data/lib/generators/sun_sword/templates_frontend/bin/watch +3 -0
  14. data/lib/generators/sun_sword/templates_frontend/config/database.yml +21 -0
  15. data/lib/generators/sun_sword/templates_frontend/config/vite.json +17 -0
  16. data/lib/generators/sun_sword/templates_frontend/controllers/application_controller.rb.tt +36 -0
  17. data/lib/generators/sun_sword/templates_frontend/controllers/dashboard/site_controller.rb +6 -0
  18. data/lib/generators/sun_sword/templates_frontend/controllers/site_controller.rb +15 -0
  19. data/lib/generators/sun_sword/templates_frontend/env.development +14 -0
  20. data/lib/generators/sun_sword/templates_frontend/frontend/assets/images/.keep +0 -0
  21. data/lib/generators/sun_sword/templates_frontend/frontend/assets/images/kotaro.ico +0 -0
  22. data/lib/generators/sun_sword/templates_frontend/frontend/assets/images/logo.svg +16 -0
  23. data/lib/generators/sun_sword/templates_frontend/frontend/assets/images/profile.jpeg +0 -0
  24. data/lib/generators/sun_sword/templates_frontend/frontend/entrypoints/application.js +17 -0
  25. data/lib/generators/sun_sword/templates_frontend/frontend/entrypoints/stimulus.js +9 -0
  26. data/lib/generators/sun_sword/templates_frontend/frontend/pages/stimulus.js +10 -0
  27. data/lib/generators/sun_sword/templates_frontend/frontend/pages/web.js +122 -0
  28. data/lib/generators/sun_sword/templates_frontend/frontend/stylesheets/application.scss +198 -0
  29. data/lib/generators/sun_sword/templates_frontend/helpers/application_helper.rb +5 -0
  30. data/lib/generators/sun_sword/templates_frontend/package.json +7 -0
  31. data/lib/generators/sun_sword/templates_frontend/postcss.config.js +6 -0
  32. data/lib/generators/sun_sword/templates_frontend/rubocop.yml.tt +1141 -0
  33. data/lib/generators/sun_sword/templates_frontend/tailwind.config.js +39 -0
  34. data/lib/generators/sun_sword/templates_frontend/views/components/_action_destroy.html.erb.tt +48 -0
  35. data/lib/generators/sun_sword/templates_frontend/views/components/_action_edit.html.erb.tt +7 -0
  36. data/lib/generators/sun_sword/templates_frontend/views/components/_action_show.html.erb.tt +8 -0
  37. data/lib/generators/sun_sword/templates_frontend/views/components/_alert.html.erb.tt +66 -0
  38. data/lib/generators/sun_sword/templates_frontend/views/components/_error_form_submit.html.erb.tt +20 -0
  39. data/lib/generators/sun_sword/templates_frontend/views/components/_link_action.html.erb.tt +9 -0
  40. data/lib/generators/sun_sword/templates_frontend/views/components/layouts/_sidebar_logo.html.erb +18 -0
  41. data/lib/generators/sun_sword/templates_frontend/views/layouts/application.html.erb.tt +42 -0
  42. data/lib/generators/sun_sword/templates_frontend/views/layouts/dashboard/_sidebar.html.erb.tt +60 -0
  43. data/lib/generators/sun_sword/templates_frontend/views/layouts/dashboard/application.html.erb.tt +71 -0
  44. data/lib/generators/sun_sword/templates_frontend/views/site/_comment.html.erb.tt +3 -0
  45. data/lib/generators/sun_sword/templates_frontend/views/site/stimulus.html.erb.tt +26 -0
  46. data/lib/generators/sun_sword/templates_frontend/vite.config.ts.tt +27 -0
  47. data/lib/generators/sun_sword/templates_scaffold/controllers/controller.rb.tt +90 -0
  48. data/lib/generators/sun_sword/templates_scaffold/example.rb.tt +2 -0
  49. data/lib/generators/sun_sword/templates_scaffold/views/_form.html.erb.tt +22 -0
  50. data/lib/generators/sun_sword/templates_scaffold/views/components/menu/link.html.erb.tt +1 -0
  51. data/lib/generators/sun_sword/templates_scaffold/views/edit.html.erb.tt +10 -0
  52. data/lib/generators/sun_sword/templates_scaffold/views/index.html.erb.tt +50 -0
  53. data/lib/generators/sun_sword/templates_scaffold/views/new.html.erb.tt +10 -0
  54. data/lib/generators/sun_sword/templates_scaffold/views/show.html.erb.tt +26 -0
  55. data/lib/sun-sword.rb +7 -0
  56. data/lib/sun_sword/version.rb +6 -0
  57. metadata +141 -0
@@ -0,0 +1,50 @@
1
+ <div>
2
+ <div>
3
+ <%%= render "components/alert" %>
4
+ </div>
5
+ <div class="flow-root class-card-container">
6
+ <div class="flex items-center p-2 mb-10">
7
+ <div class="flex-auto">
8
+ <h1 class="font-semibold text-gray-900">List <%= @subject_class %></h1>
9
+ <p class="mt-2 text-sm text-gray-700">A list of all the <%= @subject_class %>.</p>
10
+ </div>
11
+ <div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
12
+ <%%= link_to new_<%= [@route_scope_path, @scope_path.singularize].join("_") %>_path do %>
13
+ <button type="button" class="block class-button">Add user</button>
14
+ <%% end %>
15
+ </div>
16
+ </div>
17
+ <div class="overflow-x-auto sm:flex-auto">
18
+ <div class="inline-block min-w-full align-middle">
19
+ <table class="min-w-full divide-y divide-gray-300">
20
+ <thead>
21
+ <tr>
22
+ <%% <%= @controllers.list_fields.map { |tc| [tc.titleize.to_s, ''] + [["Action", "text-center"]]}%>.each do |title, attr_class| %>
23
+ <th scope="col" class="class-tr attr-class"><%%= title %></th>
24
+ <%% end %>
25
+ </th>
26
+ </tr>
27
+ </thead>
28
+ <tbody class="divide-y bg-white">
29
+ <%% @<%= @scope_path %>.response.each do |<%= @variable_subject %>| %>
30
+ <tr>
31
+ <%@controllers.list_fields.each do |col| -%>
32
+ <td class="class-td">
33
+ <div class="flex items-center">
34
+ <div>
35
+ <div class="text-sm text-gray-900"><%%= <%= @variable_subject %>.name %></div>
36
+ </div>
37
+ </div>
38
+ </td>
39
+ <%end-%>
40
+ <td class="class-td text-center">
41
+ <%%= render "components/link_action", key: "<%= [@route_scope_path, @variable_subject].join("_") %>", value: user, actions: [:show, :edit, :destroy] %>
42
+ </td>
43
+ </tr>
44
+ <%% end %>
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
@@ -0,0 +1,10 @@
1
+ <div>
2
+ <div class="flow-root class-card-container">
3
+ <div class="flex items-center p-2 mb-10">
4
+ <div class="flex-auto">
5
+ <h1 class="font-semibold text-gray-900">Creating User</h1>
6
+ </div>
7
+ </div>
8
+ <%%= render "form", <%= @variable_subject %>: @<%= @variable_subject %> %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,26 @@
1
+ <div>
2
+ <div class="flow-root class-card-container">
3
+ <div class="flex items-center p-2 mb-10">
4
+ <div class="flex-auto">
5
+ <h1 class="font-semibold text-gray-900">Information</h1>
6
+ <p class="mt-1 max-w-2xl text-sm leading-6 text-gray-500">Details info from <%= @subject_class %> .</p>
7
+ </div>
8
+ <div class="mt-4 sm:ml-16 sm:mt-0 sm:flex-none">
9
+ <%%= render "components/link_action", key: "<%= [@route_scope_path, @variable_subject].join("_") %>", value: @<%= @variable_subject %>, actions: [:edit, :destroy] %>
10
+ </div>
11
+ </div>
12
+ <div class="border-t border-gray-100">
13
+ <dl class="divide-y divide-gray-100">
14
+ <%@controllers.show_fields.each do |col| -%>
15
+ <div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
16
+ <dt class="text-sm font-medium text-gray-900"><%=col.titleize%></dt>
17
+ <dd class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"><%%= @<%=@variable_subject%>.<%=col%> %></dd>
18
+ </div>
19
+ <%end-%>
20
+ </dl>
21
+ </div>
22
+ <div class="mt-6 flex items-center justify-end gap-x-6">
23
+ <%%= link_to "Back", <%= [@route_scope_path, @scope_path].join("_") %>_path, class: "inline-flex justify-center class-button" %>
24
+ </div>
25
+ </div>
26
+ </div>
data/lib/sun-sword.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'sun_sword/version'
4
+
5
+ module SunSword
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SunSword
4
+ VERSION = '0.0.1'
5
+ public_constant :VERSION
6
+ end
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sun-sword
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - kotarominami
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.5.18
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.5.18
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 13.2.1
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 13.2.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.13.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.13.0
55
+ description: Sun Sword is a Generator for Clean Architecture.
56
+ email:
57
+ - kotaroisme@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".rspec"
63
+ - ".rubocop.yml"
64
+ - CHANGELOG.md
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - lib/generators/sun_sword/USAGE
69
+ - lib/generators/sun_sword/frontend_generator.rb
70
+ - lib/generators/sun_sword/scaffold_generator.rb
71
+ - lib/generators/sun_sword/templates_frontend/Procfile.dev
72
+ - lib/generators/sun_sword/templates_frontend/assets/config/manifest.js
73
+ - lib/generators/sun_sword/templates_frontend/bin/watch
74
+ - lib/generators/sun_sword/templates_frontend/config/database.yml
75
+ - lib/generators/sun_sword/templates_frontend/config/vite.json
76
+ - lib/generators/sun_sword/templates_frontend/controllers/application_controller.rb.tt
77
+ - lib/generators/sun_sword/templates_frontend/controllers/dashboard/site_controller.rb
78
+ - lib/generators/sun_sword/templates_frontend/controllers/site_controller.rb
79
+ - lib/generators/sun_sword/templates_frontend/env.development
80
+ - lib/generators/sun_sword/templates_frontend/frontend/assets/images/.keep
81
+ - lib/generators/sun_sword/templates_frontend/frontend/assets/images/kotaro.ico
82
+ - lib/generators/sun_sword/templates_frontend/frontend/assets/images/logo.svg
83
+ - lib/generators/sun_sword/templates_frontend/frontend/assets/images/profile.jpeg
84
+ - lib/generators/sun_sword/templates_frontend/frontend/entrypoints/application.js
85
+ - lib/generators/sun_sword/templates_frontend/frontend/entrypoints/stimulus.js
86
+ - lib/generators/sun_sword/templates_frontend/frontend/pages/stimulus.js
87
+ - lib/generators/sun_sword/templates_frontend/frontend/pages/web.js
88
+ - lib/generators/sun_sword/templates_frontend/frontend/stylesheets/application.scss
89
+ - lib/generators/sun_sword/templates_frontend/helpers/application_helper.rb
90
+ - lib/generators/sun_sword/templates_frontend/package.json
91
+ - lib/generators/sun_sword/templates_frontend/postcss.config.js
92
+ - lib/generators/sun_sword/templates_frontend/rubocop.yml.tt
93
+ - lib/generators/sun_sword/templates_frontend/tailwind.config.js
94
+ - lib/generators/sun_sword/templates_frontend/views/components/_action_destroy.html.erb.tt
95
+ - lib/generators/sun_sword/templates_frontend/views/components/_action_edit.html.erb.tt
96
+ - lib/generators/sun_sword/templates_frontend/views/components/_action_show.html.erb.tt
97
+ - lib/generators/sun_sword/templates_frontend/views/components/_alert.html.erb.tt
98
+ - lib/generators/sun_sword/templates_frontend/views/components/_error_form_submit.html.erb.tt
99
+ - lib/generators/sun_sword/templates_frontend/views/components/_link_action.html.erb.tt
100
+ - lib/generators/sun_sword/templates_frontend/views/components/layouts/_sidebar_logo.html.erb
101
+ - lib/generators/sun_sword/templates_frontend/views/layouts/application.html.erb.tt
102
+ - lib/generators/sun_sword/templates_frontend/views/layouts/dashboard/_sidebar.html.erb.tt
103
+ - lib/generators/sun_sword/templates_frontend/views/layouts/dashboard/application.html.erb.tt
104
+ - lib/generators/sun_sword/templates_frontend/views/site/_comment.html.erb.tt
105
+ - lib/generators/sun_sword/templates_frontend/views/site/stimulus.html.erb.tt
106
+ - lib/generators/sun_sword/templates_frontend/vite.config.ts.tt
107
+ - lib/generators/sun_sword/templates_scaffold/controllers/controller.rb.tt
108
+ - lib/generators/sun_sword/templates_scaffold/example.rb.tt
109
+ - lib/generators/sun_sword/templates_scaffold/views/_form.html.erb.tt
110
+ - lib/generators/sun_sword/templates_scaffold/views/components/menu/link.html.erb.tt
111
+ - lib/generators/sun_sword/templates_scaffold/views/edit.html.erb.tt
112
+ - lib/generators/sun_sword/templates_scaffold/views/index.html.erb.tt
113
+ - lib/generators/sun_sword/templates_scaffold/views/new.html.erb.tt
114
+ - lib/generators/sun_sword/templates_scaffold/views/show.html.erb.tt
115
+ - lib/sun-sword.rb
116
+ - lib/sun_sword/version.rb
117
+ homepage: https://github.com/kotaroisme/sun-sword
118
+ licenses:
119
+ - MIT
120
+ metadata:
121
+ source_code_uri: https://github.com/kotaroisme/sun-sword
122
+ post_install_message:
123
+ rdoc_options: []
124
+ require_paths:
125
+ - lib
126
+ required_ruby_version: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: 3.0.0
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubygems_version: 3.5.22
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: Sun Sword is a Generator for Clean Architecture
141
+ test_files: []