hanamismith 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +13 -13
  4. data/hanamismith.gemspec +2 -2
  5. data/lib/hanamismith/builders/bundler.rb +1 -1
  6. data/lib/hanamismith/builders/documentation/readme.rb +52 -0
  7. data/lib/hanamismith/builders/icon.rb +29 -0
  8. data/lib/hanamismith/builders/pwa.rb +29 -0
  9. data/lib/hanamismith/builders/rspec/helper.rb +26 -3
  10. data/lib/hanamismith/builders/slices/health.rb +1 -1
  11. data/lib/hanamismith/builders/slices/{main.rb → home.rb} +19 -10
  12. data/lib/hanamismith/builders/stylesheet.rb +1 -1
  13. data/lib/hanamismith/cli/commands/build.rb +3 -1
  14. data/lib/hanamismith/templates/%project_name%/config/app.rb.erb +10 -2
  15. data/lib/hanamismith/templates/%project_name%/config/providers/persistence.rb.erb +1 -0
  16. data/lib/hanamismith/templates/%project_name%/config/routes.rb.erb +1 -1
  17. data/lib/hanamismith/templates/%project_name%/public/icon.svg.erb +4 -0
  18. data/lib/hanamismith/templates/%project_name%/public/manifest.webmanifest.erb +15 -0
  19. data/lib/hanamismith/templates/%project_name%/public/stylesheets/home.css.erb +85 -0
  20. data/lib/hanamismith/templates/%project_name%/slices/{main → home}/action.rb.erb +2 -2
  21. data/lib/hanamismith/templates/%project_name%/slices/home/actions/show.rb.erb +8 -0
  22. data/lib/hanamismith/templates/%project_name%/slices/{main → home}/repository.rb.erb +2 -2
  23. data/lib/hanamismith/templates/%project_name%/slices/home/templates/layouts/app.html.erb.erb +28 -0
  24. data/lib/hanamismith/templates/%project_name%/slices/home/templates/show.html.erb.erb +41 -0
  25. data/lib/hanamismith/templates/%project_name%/slices/{main → home}/view.rb.erb +2 -3
  26. data/lib/hanamismith/templates/%project_name%/slices/home/views/show.rb.erb +9 -0
  27. data/lib/hanamismith.rb +5 -1
  28. data.tar.gz.sig +3 -3
  29. metadata +18 -14
  30. metadata.gz.sig +0 -0
  31. data/lib/hanamismith/templates/%project_name%/public/stylesheets/site.css.erb +0 -11
  32. data/lib/hanamismith/templates/%project_name%/slices/main/actions/home/show.rb.erb +0 -10
  33. data/lib/hanamismith/templates/%project_name%/slices/main/templates/home/show.html.erb.erb +0 -3
  34. data/lib/hanamismith/templates/%project_name%/slices/main/templates/layouts/app.html.erb.erb +0 -13
  35. data/lib/hanamismith/templates/%project_name%/slices/main/views/home/show.rb.erb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40e0c634190f5a78058591a2b70106e9fe3bcde0bbff5ba8e4878cf34fcd60fc
4
- data.tar.gz: 0d87a1fdc95085ca178c54a32d0d91ce733fa32e99734429be36d814ba4b2bbd
3
+ metadata.gz: 7a2f9fdfaa67a10936995d911ad76db83f51fe1b37ef28fec90d0ddb806efa77
4
+ data.tar.gz: 03e473810747a25f2ef846c8f1f00aa93fe0c443065e34e037f529f57816381b
5
5
  SHA512:
6
- metadata.gz: 064d74478e029e8a7ee5fcf8b1e8ff9d9d57ceddfd2bd52c78bc999530ef9f4042d243e8666e5c9e65435aa57da18265cb35a116e4497090f3a93c80f82c18c0
7
- data.tar.gz: 8004d9955311885ceeaea58490d55115f5b2d9c15347115427ab4e26e06a4b8997a27717336543aedcc51abe75567bc02958d328a73ee5b15df5dbdc3980c5d9
6
+ metadata.gz: fe4fb1bd2e08990b590163c4b711d2c5fc3da26b9194e987d8a4811ef471e1e82c1ac5de5c42d11b1fecb01a29c45f83f50d860bc90f48330f6847dcae023f6b
7
+ data.tar.gz: ac0e4e0f38801660aee10cd52e022b1fb935903ea098ac43ba2762675a733e9462ed5c5981df93099d9f35031b145e5e41beef1661ef4c64ccfaed3f4717978e
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -17,11 +17,9 @@
17
17
 
18
18
  = Hanamismith
19
19
 
20
- Hanamismith is a Command Line Interface (CLI) for smithing Hanami projects. Perfect for when you need a professional and robust tool for building new project skeletons. To quote from the {dry_link} and {hanami_link} teams:
20
+ Hanamismith is a Command Line Interface (CLI) for smithing Hanami projects. Perfect when you need a professional and robust tool for building new project skeletons. To quote from the {dry_link} and {hanami_link} teams:
21
21
  ____
22
22
  If you're looking for new ways to build maintainable, secure, faster and testable Ruby applications, you're in for a treat. *Hanami is built for people like you*.
23
-
24
- Whether you're a total beginner or an experienced developer, *this learning process may still be hard*. Over time, we become used to certain things, and it can be painful to change. *But without change, there is no challenge* and without challenge, there is no growth.
25
23
  ____
26
24
 
27
25
  Welcome to the modern age of web development. This gem will help you get up and running as quickly as possible. 🚀
@@ -33,7 +31,7 @@ toc::[]
33
31
  * Built atop {rubysmith_link} for building project skeleton.
34
32
  * Uses {dry_link} for functional programming.
35
33
  * Uses {hanami_link} for web application development.
36
- * Uses {htmx_link} for proper Hypermedia REST APIs (i.e. HTML over the wire) so you can write less code and avoid bloated JavaScript stacks.
34
+ * Uses {htmx_link} for Hypermedia REST APIs (i.e. HTML over the wire) so you can write less code and avoid bloated JavaScript stacks.
37
35
  * Uses {pg_link} coupled with {rom_link} for database management.
38
36
  * Uses {rack_link}, specifically: `Rack::Deflater`, `Rack::Static`, and link:https://github.com/rack/rack-attack[Rack::Attack].
39
37
  * Uses {puma_link} as the default web server and fully configured for local and production environments.
@@ -43,6 +41,14 @@ toc::[]
43
41
  * Provides the `/up` health check endpoint via the `Health` slice.
44
42
  * Disables link:https://github.com/ruby/irb[IRB] console autocomplete when used in production-like environments. You can re-enable IRB autocomplete by setting `IRB_USE_AUTOCOMPLETE=true` before launching your console in non development or test environments.
45
43
 
44
+ == Screenshots/Screencasts
45
+
46
+ image:https://alchemists.io/images/projects/hanamismith/screenshots/home.png[Home,width=802,height=813,role=focal_point]
47
+
48
+ The above is a screenshot of a _Demo_ project that was generated and run locally. For a fully working demonstration application -- as built by this gem -- check out the link:https://github.com/bkuhlmann/hemo[Hemo] project. Here's a quick screencast overview of this demonstration application in action:
49
+
50
+ video::https://alchemists.io/videos/projects/hemo/demo.mp4[poster=https://alchemists.io/images/projects/hemo/demo.png,width=800,height=450,role=focal_point]
51
+
46
52
  == Requirements
47
53
 
48
54
  . link:https://www.ruby-lang.org[Ruby].
@@ -93,7 +99,7 @@ link:https://alchemists.io/projects/rubysmith/#_configuration[Rubysmith]. It is
93
99
  ----
94
100
  :project:
95
101
  :url:
96
- # Add sub-key values here.
102
+ # Add key/value pairs here.
97
103
  ----
98
104
 
99
105
  When these values exist, you'll benefit from having this information added to your generated project documentation. Otherwise -- if these values are empty -- they are removed from new project generation entirely.
@@ -133,12 +139,12 @@ bin/hanami --help
133
139
 
134
140
  Once the server is running you can visit (or ping) the following endpoints:
135
141
 
136
- * `/`: The default welcome page.
142
+ * `/`: The home page.
137
143
  * `/up`: The health status of the application. This will be _green_ (200 OK) when the server is up or _red_ (503 Service Unavailable) when the server is down.
138
144
 
139
145
  === Aliases
140
146
 
141
- For link:https://www.gnu.org/software/bash[Bash] users -- or other shell users -- you might find the following aliases helpful in reducing terminal keystrokes when using this gem:
147
+ For link:https://www.gnu.org/software/bash[Bash] users -- or other shell users -- you might find these suggested aliases helpful in reducing keystrokes when using this gem:
142
148
 
143
149
  [source,bash]
144
150
  ----
@@ -149,12 +155,6 @@ alias hsh="hanamismith --help"
149
155
 
150
156
  The above is what I use via my {dotfiles_link} project.
151
157
 
152
- === Demonstrations
153
-
154
- For a fully working demonstration application -- as built by this gem -- check out the link:https://github.com/bkuhlmann/hemo[Hemo] project. Here's a quick screencast overview of this demonstration application in action:
155
-
156
- video::https://alchemists.io/videos/projects/hemo/demo.mp4[poster=https://alchemists.io/images/projects/hemo/demo.png,width=800,height=450,role=focal_point]
157
-
158
158
  == Development
159
159
 
160
160
  To contribute, run:
data/hanamismith.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "hanamismith"
5
- spec.version = "0.15.0"
5
+ spec.version = "0.17.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/hanamismith"
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "dry-schema", "~> 1.13"
30
30
  spec.add_dependency "etcher", "~> 0.2"
31
31
  spec.add_dependency "hanami", "~> 2.0"
32
- spec.add_dependency "htmx", "~> 0.2"
32
+ spec.add_dependency "htmx", "~> 0.3"
33
33
  spec.add_dependency "infusible", "~> 2.0"
34
34
  spec.add_dependency "refinements", "~> 11.0"
35
35
  spec.add_dependency "rubysmith", "~> 5.5"
@@ -56,7 +56,7 @@ module Hanamismith
56
56
  "source",
57
57
  %(gem "hanami-view", github: "hanami/view", branch: "main"\n)
58
58
  )
59
- .insert_after("source", %(gem "htmx", "~> 0.1"\n))
59
+ .insert_after("source", %(gem "htmx", "~> 0.3"\n))
60
60
  .insert_after("source", %(gem "puma", "~> 6.3"\n))
61
61
  .insert_after("source", %(gem "rack-attack", "~> 6.6"\n))
62
62
  end
@@ -14,6 +14,7 @@ module Hanamismith
14
14
 
15
15
  super
16
16
  builder.call(configuration.merge(template_path: "%project_name%/README.#{kind}.erb"))
17
+ .replace(/Setup.+Usage/m, setup)
17
18
  .replace("Rubysmith", "Hanamismith")
18
19
  .replace("rubysmith", "hanamismith")
19
20
 
@@ -25,6 +26,57 @@ module Hanamismith
25
26
  attr_reader :configuration, :builder
26
27
 
27
28
  def kind = configuration.documentation_format
29
+
30
+ def setup = kind == "adoc" ? ascii_setup : markdown_setup
31
+
32
+ # rubocop:disable Metrics/MethodLength
33
+ def ascii_setup
34
+ <<~CONTENT.strip
35
+ Setup
36
+
37
+ To set up the project, run:
38
+
39
+ [source,bash]
40
+ ----
41
+ git clone #{configuration.computed_project_url_source}
42
+ cd #{configuration.project_name}
43
+ bin/setup
44
+
45
+ bin/hanami db create
46
+ bin/hanami db migrate
47
+ bin/hanami db seed
48
+
49
+ HANAMI_ENV=test bin/hanami db create
50
+ HANAMI_ENV=test bin/hanami db migrate
51
+ ----
52
+
53
+ == Usage
54
+ CONTENT
55
+ end
56
+
57
+ def markdown_setup
58
+ <<~CONTENT.strip
59
+ Setup
60
+
61
+ To set up the project, run:
62
+
63
+ ``` bash
64
+ git clone #{configuration.computed_project_url_source}
65
+ cd #{configuration.project_name}
66
+ bin/setup
67
+
68
+ bin/hanami db create
69
+ bin/hanami db migrate
70
+ bin/hanami db seed
71
+
72
+ HANAMI_ENV=test bin/hanami db create
73
+ HANAMI_ENV=test bin/hanami db migrate
74
+ ```
75
+
76
+ ## Usage
77
+ CONTENT
78
+ end
79
+ # rubocop:enable Metrics/MethodLength
28
80
  end
29
81
  end
30
82
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/structs"
4
+
5
+ module Hanamismith
6
+ module Builders
7
+ # Builds project skeleton SVG icon.
8
+ class Icon
9
+ using Refinements::Structs
10
+
11
+ def self.call(...) = new(...).call
12
+
13
+ def initialize configuration, builder: Rubysmith::Builder
14
+ @configuration = configuration
15
+ @builder = builder
16
+ end
17
+
18
+ def call
19
+ path = "%project_name%/public/icon.svg.erb"
20
+ builder.call(configuration.merge(template_path: path)).render
21
+ configuration
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/structs"
4
+
5
+ module Hanamismith
6
+ module Builders
7
+ # Builds project skeleton Progressive Web Application (PWA) manifest.
8
+ class PWA
9
+ using Refinements::Structs
10
+
11
+ def self.call(...) = new(...).call
12
+
13
+ def initialize configuration, builder: Rubysmith::Builder
14
+ @configuration = configuration
15
+ @builder = builder
16
+ end
17
+
18
+ def call
19
+ path = "%project_name%/public/manifest.webmanifest.erb"
20
+ builder.call(configuration.merge(template_path: path)).render
21
+ configuration
22
+ end
23
+
24
+ private
25
+
26
+ attr_reader :configuration, :builder
27
+ end
28
+ end
29
+ end
@@ -9,15 +9,38 @@ module Hanamismith
9
9
  class Helper < Rubysmith::Builders::RSpec::Helper
10
10
  using Refinements::Structs
11
11
 
12
+ def initialize(...)
13
+ super
14
+ @instance = builder.call configuration.merge(
15
+ template_path: "%project_name%/spec/spec_helper.rb.erb"
16
+ )
17
+ end
18
+
12
19
  def call
13
20
  return configuration unless configuration.build_rspec
14
21
 
15
22
  super
16
- path = "%project_name%/spec/spec_helper.rb.erb"
17
- builder.call(configuration.merge(template_path: path))
18
- .replace(/require.+#{configuration.project_name}.+\n/, "")
23
+ remove_project_requirement
24
+ disable_simple_cov_eval
19
25
  configuration
20
26
  end
27
+
28
+ private
29
+
30
+ attr_reader :instance
31
+
32
+ def remove_project_requirement
33
+ instance.replace(/require.+#{configuration.project_name}.+\n/, "")
34
+ end
35
+
36
+ def disable_simple_cov_eval
37
+ instance.replace(
38
+ /enable_coverage_for_eval\n/,
39
+ "# TODO: Enable once this issue is fixed: " \
40
+ "https://bugs.ruby-lang.org/issues/19363.\n " \
41
+ "# enable_coverage_for_eval\n"
42
+ )
43
+ end
21
44
  end
22
45
  end
23
46
  end
@@ -5,7 +5,7 @@ require "refinements/structs"
5
5
  module Hanamismith
6
6
  module Builders
7
7
  module Slices
8
- # Builds project health slice skeleton.
8
+ # Builds health slice skeleton.
9
9
  class Health
10
10
  using Refinements::Structs
11
11
 
@@ -5,8 +5,8 @@ require "refinements/structs"
5
5
  module Hanamismith
6
6
  module Builders
7
7
  module Slices
8
- # Builds project skeleton foundation.
9
- class Main
8
+ # Builds home slice skeleton.
9
+ class Home
10
10
  using Refinements::Structs
11
11
 
12
12
  def self.call(...) = new(...).call
@@ -26,39 +26,48 @@ module Hanamismith
26
26
  attr_reader :configuration, :builder
27
27
 
28
28
  def add_action
29
- path = "%project_name%/slices/main/action.rb.erb"
29
+ path = "%project_name%/slices/home/action.rb.erb"
30
30
  builder.call(configuration.merge(template_path: path)).render
31
31
  end
32
32
 
33
33
  def add_repository
34
- path = "%project_name%/slices/main/repository.rb.erb"
34
+ path = "%project_name%/slices/home/repository.rb.erb"
35
35
  builder.call(configuration.merge(template_path: path)).render
36
36
  end
37
37
 
38
38
  def add_view
39
- path = "%project_name%/slices/main/view.rb.erb"
39
+ path = "%project_name%/slices/home/view.rb.erb"
40
40
  builder.call(configuration.merge(template_path: path)).render
41
41
  end
42
42
 
43
43
  def add_layout_template
44
- path = "%project_name%/slices/main/templates/layouts/app.html.erb.erb"
44
+ path = "%project_name%/slices/home/templates/layouts/app.html.erb.erb"
45
45
  builder.call(configuration.merge(template_path: path))
46
46
  .render
47
+ .replace("<!-- title -->", "<%= content_for :title %>")
47
48
  .replace("<!-- yield -->", "<%= yield %>")
48
49
  end
49
50
 
50
51
  def add_show_template
51
- path = "%project_name%/slices/main/templates/home/show.html.erb.erb"
52
- builder.call(configuration.merge(template_path: path)).render
52
+ path = "%project_name%/slices/home/templates/show.html.erb.erb"
53
+
54
+ builder.call(configuration.merge(template_path: path))
55
+ .render
56
+ .replace(
57
+ "<!-- title -->",
58
+ %(<% content_for :title, "#{configuration.project_label}" %>)
59
+ )
60
+ .replace("<!-- ruby_version -->", "<%= ruby_version %>")
61
+ .replace("<!-- hanami_version -->", "<%= hanami_version %>")
53
62
  end
54
63
 
55
64
  def add_show_view
56
- path = "%project_name%/slices/main/views/home/show.rb.erb"
65
+ path = "%project_name%/slices/home/views/show.rb.erb"
57
66
  builder.call(configuration.merge(template_path: path)).render
58
67
  end
59
68
 
60
69
  def add_show_action
61
- path = "%project_name%/slices/main/actions/home/show.rb.erb"
70
+ path = "%project_name%/slices/home/actions/show.rb.erb"
62
71
  builder.call(configuration.merge(template_path: path)).render
63
72
  end
64
73
  end
@@ -16,7 +16,7 @@ module Hanamismith
16
16
  end
17
17
 
18
18
  def call
19
- path = "%project_name%/public/stylesheets/site.css.erb"
19
+ path = "%project_name%/public/stylesheets/home.css.erb"
20
20
  builder.call(configuration.merge(template_path: path)).render
21
21
  configuration
22
22
  end
@@ -15,9 +15,11 @@ module Hanamismith
15
15
  Builders::Core,
16
16
  Builders::Providers::Persistence,
17
17
  Builders::Refinement,
18
+ Builders::Icon,
18
19
  Builders::Stylesheet,
19
20
  Builders::HTMX,
20
- Builders::Slices::Main,
21
+ Builders::PWA,
22
+ Builders::Slices::Home,
21
23
  Builders::Slices::Health,
22
24
  Rubysmith::Builders::Version,
23
25
  Builders::Documentation::Readme,
@@ -7,16 +7,24 @@ require "rack/attack"
7
7
  Dry::Schema.load_extensions :monads
8
8
  Dry::Validation.load_extensions :monads
9
9
 
10
- config.actions.content_security_policy[:script_src] = "'self' 'unsafe-eval'"
10
+ config.actions.content_security_policy.then do |csp|
11
+ csp[:manifest_src] = "'self'"
12
+ csp[:script_src] += " 'unsafe-eval'"
13
+ end
11
14
 
12
15
  Rack::Attack.safelist("allow localhost") { |request| %w[127.0.0.1 ::1].include? request.ip }
13
16
  Rack::Attack.throttle("requests by IP", limit: 100, period: 60, &:ip)
14
17
 
15
18
  config.middleware.use Rack::Attack
16
19
  config.middleware.use Rack::Deflater
17
- config.middleware.use Rack::Static, {urls: %w[/stylesheets /javascripts], root: "public"}
20
+ config.middleware.use Rack::Static,
21
+ {
22
+ urls: %w[/icon.svg /manifest.webmanifest /stylesheets /javascripts],
23
+ root: "public"
24
+ }
18
25
 
19
26
  environment :development do
27
+ # :nocov:
20
28
  config.logger.options[:colorize] = true
21
29
 
22
30
  config.logger = config.logger.instance.add_backend(
@@ -26,6 +26,7 @@ Hanami.app.register_provider :persistence, namespace: true do
26
26
  Sequel::Migrator.is_current? database, Hanami.app.root.join("db/migrate")
27
27
  rescue NoMethodError, Sequel::Migrator::Error => error
28
28
  message = error.message
29
+ # :nocov:
29
30
  Hanami.logger.error message unless error.is_a?(NoMethodError) && message.include?("migration")
30
31
  end
31
32
 
@@ -2,6 +2,6 @@
2
2
  # Defines application routes.
3
3
  class Routes < Hanami::Routes
4
4
  slice(:health, at: "/up") { root to: "show" }
5
- slice(:main, at: "/") { root to: "home.show" }
5
+ slice(:home, at: "/") { root to: "show" }
6
6
  end
7
7
  <% end %>
@@ -0,0 +1,4 @@
1
+ <svg width="1600px" height="1600px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <g style=""> <ellipse cx="800.000000" cy="800.000000" rx="757.000000" ry="754.000000" stroke-linejoin="round" style="fill: rgba(220, 54, 16, 1.000000); stroke-width: 75.000000px; stroke: rgba(200, 48, 33, 1.000000); " fill="#dc3610" stroke="#c83021" stroke-width="75.000000" />
3
+ </g><g style=""> <ellipse cx="799.500000" cy="800.500000" rx="362.500000" ry="362.500000" stroke-linejoin="round" style="fill: none; stroke-width: 75.000000px; stroke: rgba(255, 255, 255, 1.000000); " fill="none" stroke="#ffffff" stroke-width="75.000000" />
4
+ </g></svg>
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "<%= configuration.project_label %>",
3
+ "icons": [
4
+ {
5
+ "src": "https://alchemists.io/images/projects/hanamismith/icons/small.png",
6
+ "type": "image/png",
7
+ "sizes": "192x192"
8
+ },
9
+ {
10
+ "src": "https://alchemists.io/images/projects/hanamismith/icons/large.png",
11
+ "type": "image/png",
12
+ "sizes": "512x512"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,85 @@
1
+ html {
2
+ height: 100%;
3
+ }
4
+
5
+ .home-page {
6
+ --font-family: Verdana;
7
+ --color-white: hsl(0, 0%, 100%);
8
+
9
+ background-color: var(--color-white);
10
+ background-image:
11
+ radial-gradient(at 17% 25%, hsla(337,26%,88%,1) 0px, transparent 50%),
12
+ radial-gradient(at 17% 68%, hsla(337,26%,88%,1) 0px, transparent 50%),
13
+ radial-gradient(at 50% 45%, hsla(306,81%,77%,1) 0px, transparent 50%),
14
+ radial-gradient(at 81% 25%, hsla(337,26%,88%,1) 0px, transparent 50%),
15
+ radial-gradient(at 81% 68%, hsla(337,26%,88%,1) 0px, transparent 50%),
16
+ radial-gradient(at 9% 7%, hsla(11,86%,46%,1) 0px, transparent 50%),
17
+ radial-gradient(at 9% 93%, hsla(11,86%,46%,1) 0px, transparent 50%),
18
+ radial-gradient(at 91% 7%, hsla(11,86%,46%,1) 0px, transparent 50%),
19
+ radial-gradient(at 91% 93%, hsla(11,86%,46%,1) 0px, transparent 50%);
20
+ background-repeat: no-repeat;
21
+ display: flex;
22
+ flex-direction: column;
23
+ font-family: var(--font-family);
24
+ justify-content: space-between;
25
+ min-height: 97vh;
26
+
27
+ .navigation {
28
+ display: flex;
29
+ flex-wrap: wrap;
30
+ align-items: center;
31
+ justify-content: center;
32
+ flex-direction: column;
33
+ gap: 1rem;
34
+ list-style: none;
35
+ padding: 0;
36
+ }
37
+
38
+ @media only screen and (min-width: 350px) {
39
+ .navigation {
40
+ flex-direction: row;
41
+ justify-content: normal;
42
+ margin: 1rem 2rem;
43
+ }
44
+ }
45
+
46
+ .label {
47
+ font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
48
+ }
49
+
50
+ .link {
51
+ color: var(--color-white);
52
+ font-weight: 600;
53
+ font-size: 1.5rem;
54
+ }
55
+
56
+ .body {
57
+ align-items: center;
58
+ display: flex;
59
+ flex-direction: column;
60
+ }
61
+
62
+ .logo {
63
+ max-width: 100%;
64
+ height: auto;
65
+ object-fit: cover;
66
+ }
67
+
68
+ .footer {
69
+ display: flex;
70
+ flex-direction: column;
71
+ gap: 1rem;
72
+ align-items: center;
73
+ }
74
+
75
+ .group {
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ gap: 1rem;
79
+ justify-content: center;
80
+ list-style: none;
81
+ margin: 0;
82
+ padding: 0;
83
+ text-align: center;
84
+ }
85
+ }
@@ -1,7 +1,7 @@
1
1
  # auto_register: false
2
2
 
3
- module Main
4
- # The main action.
3
+ module Home
4
+ # The home action.
5
5
  class Action < <%= configuration.project_namespaced_class %>::Action
6
6
  end
7
7
  end
@@ -0,0 +1,8 @@
1
+ module Home
2
+ module Actions
3
+ # Processes show action.
4
+ class Show < Home::Action
5
+ def handle(*, response) = response.render view
6
+ end
7
+ end
8
+ end
@@ -1,7 +1,7 @@
1
1
  # auto_register: false
2
2
 
3
- module Main
4
- # The main repository.
3
+ module Home
4
+ # The home repository.
5
5
  class Repository < <%= configuration.project_namespaced_class %>::Repository
6
6
  end
7
7
  end
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <title><!-- title --></title>
6
+
7
+ <meta charset="utf-8">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
9
+ <meta name="description" content="A Hanamismith skeleton application.">
10
+ <meta name="author" content="Hanamismith">
11
+
12
+ <link title="<%= configuration.project_label %>: Favorite Icon"
13
+ rel="icon"
14
+ href="https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
15
+ sizes="32x32">
16
+ <link title="<%= configuration.project_label %>: Icon" rel="icon" href="/icon.svg" type="image/svg+xml">
17
+ <link title="<%= configuration.project_label %>: Apple Icon"
18
+ rel="apple-touch-icon"
19
+ href="https://alchemists.io/images/projects/hanamismith/icons/apple.png"
20
+ type="image/png">
21
+ <link title="<%= configuration.project_label %>: Manifest" rel="manifest" href="/manifest.webmanifest">
22
+ <link title="<%= configuration.project_label %>: Stylesheet" rel="stylesheet" href="/stylesheets/home.css" type="text/css">
23
+ </head>
24
+
25
+ <body class="home-page">
26
+ <!-- yield -->
27
+ </body>
28
+ </html>
@@ -0,0 +1,41 @@
1
+ <!-- title -->
2
+
3
+ <header class="header">
4
+ <nav>
5
+ <ul class="navigation">
6
+ <li><a href="/" class="link">Home</a></li>
7
+ </ul>
8
+ </nav>
9
+ </header>
10
+
11
+ <main class="body">
12
+ <img src="https://alchemists.io/images/projects/hanamismith/icons/small.png"
13
+ alt="Icon"
14
+ class="logo"
15
+ width="192"
16
+ height="192">
17
+
18
+ <h1 class="label"><%= configuration.project_label %></h1>
19
+ </main>
20
+
21
+ <footer class="footer">
22
+ <ul class="group">
23
+ <li><a href="https://hanamirb.org">Hanami</a></li>
24
+ <li><a href="https://guides.hanamirb.org/v2.0/introduction/getting-started">Guides</a></li>
25
+ <li><a href="https://discourse.hanamirb.org">Forum</a></li>
26
+ <li><a href="https://github.com/hanami/hanami/issues">Issues</a></li>
27
+ <li><a href="https://hanamirb.org/status/">Status</a></li>
28
+ <li><a href="https://github.com/hanami/hanami">Source</a></li>
29
+ </ul>
30
+
31
+ <ul class="group">
32
+ <li><a href="https://alchemists.io/projects/hanamismith">Hanamismith</a></li>
33
+ <li><a href="https://github.com/bkuhlmann/hanamismith/issues">Issues</a></li>
34
+ <li><a href="https://github.com/bkuhlmann/hanamismith">Source</a></li>
35
+ </ul>
36
+
37
+ <ul class="group">
38
+ <li>Ruby <!-- ruby_version --></li>
39
+ <li>Hanami <!-- hanami_version --></li>
40
+ </ul>
41
+ </footer>
@@ -1,8 +1,7 @@
1
1
  # auto_register: false
2
2
 
3
- module Main
4
- # The main view.
3
+ module Home
4
+ # The home view.
5
5
  class View < <%= configuration.project_namespaced_class %>::View
6
- config.paths = [Pathname(__dir__).join("templates").expand_path]
7
6
  end
8
7
  end
@@ -0,0 +1,9 @@
1
+ module Home
2
+ module Views
3
+ # Renders show view.
4
+ class Show < Home::View
5
+ expose :ruby_version, default: RUBY_VERSION
6
+ expose :hanami_version, default: Hanami::VERSION
7
+ end
8
+ end
9
+ end
data/lib/hanamismith.rb CHANGED
@@ -4,7 +4,11 @@ require "rubysmith"
4
4
  require "zeitwerk"
5
5
 
6
6
  Zeitwerk::Loader.for_gem.then do |loader|
7
- loader.inflector.inflect "cli" => "CLI", "ci" => "CI", "htmx" => "HTMX", "rspec" => "RSpec"
7
+ loader.inflector.inflect "cli" => "CLI",
8
+ "ci" => "CI",
9
+ "htmx" => "HTMX",
10
+ "pwa" => "PWA",
11
+ "rspec" => "RSpec"
8
12
  loader.setup
9
13
  end
10
14
 
data.tar.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- q��/㾹O2��M��Eǰ7
2
- ��Fbn��ˈ���<"�#^��@�cF"niMW�)�����6�n�?a"�NT��\箴�.�$�� ��ب�in�';{�&��ه�8)��Y1��Pg"�����3~% +�}sg^�Q+ԃ��ASK�-X&
3
- NGf\�sc2u,g�yE�zt�5 H�2Z�`)u�PV�!)�|����kM涟`cć�#$�a_��_`IR�~1�E���W��<��URr�ǑKZ�Y��cLJ���9���� �w�<�^<]]-�F�D\�Ú/3q�\O}7a��r�V>�u'��߸B��s���H�<-S���9Tm,���tcTfS���K�p:���Њa��y� �&�W;��cK�6I#
1
+ QU��捤
2
+ ��(������/��Ǒ�Fx&��<�y���h�?jN�,g_�� ��q�����d4S��2�FѼ�I�����q�ո���Va׋3���l[I��a@CJrN��/ 9 �/r���
3
+ u�~^�g���
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanamismith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-07-29 00:00:00.000000000 Z
38
+ date: 2023-08-13 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -127,14 +127,14 @@ dependencies:
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '0.2'
130
+ version: '0.3'
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '0.2'
137
+ version: '0.3'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: infusible
140
140
  requirement: !ruby/object:Gem::Requirement
@@ -261,9 +261,11 @@ files:
261
261
  - lib/hanamismith/builders/git/commit.rb
262
262
  - lib/hanamismith/builders/guard.rb
263
263
  - lib/hanamismith/builders/htmx.rb
264
+ - lib/hanamismith/builders/icon.rb
264
265
  - lib/hanamismith/builders/providers/persistence.rb
265
266
  - lib/hanamismith/builders/puma/configuration.rb
266
267
  - lib/hanamismith/builders/puma/procfile.rb
268
+ - lib/hanamismith/builders/pwa.rb
267
269
  - lib/hanamismith/builders/rack.rb
268
270
  - lib/hanamismith/builders/rake.rb
269
271
  - lib/hanamismith/builders/refinement.rb
@@ -273,7 +275,7 @@ files:
273
275
  - lib/hanamismith/builders/rspec/hanami.rb
274
276
  - lib/hanamismith/builders/rspec/helper.rb
275
277
  - lib/hanamismith/builders/slices/health.rb
276
- - lib/hanamismith/builders/slices/main.rb
278
+ - lib/hanamismith/builders/slices/home.rb
277
279
  - lib/hanamismith/builders/stylesheet.rb
278
280
  - lib/hanamismith/cli/commands/build.rb
279
281
  - lib/hanamismith/cli/shell.rb
@@ -298,16 +300,18 @@ files:
298
300
  - lib/hanamismith/templates/%project_name%/env.test.erb
299
301
  - lib/hanamismith/templates/%project_name%/lib/%project_path%/refines/actions/response.rb.erb
300
302
  - lib/hanamismith/templates/%project_name%/lib/%project_path%/types.rb.erb
303
+ - lib/hanamismith/templates/%project_name%/public/icon.svg.erb
301
304
  - lib/hanamismith/templates/%project_name%/public/javascripts/htmx.js.erb
302
- - lib/hanamismith/templates/%project_name%/public/stylesheets/site.css.erb
305
+ - lib/hanamismith/templates/%project_name%/public/manifest.webmanifest.erb
306
+ - lib/hanamismith/templates/%project_name%/public/stylesheets/home.css.erb
303
307
  - lib/hanamismith/templates/%project_name%/slices/health/actions/show.rb.erb
304
- - lib/hanamismith/templates/%project_name%/slices/main/action.rb.erb
305
- - lib/hanamismith/templates/%project_name%/slices/main/actions/home/show.rb.erb
306
- - lib/hanamismith/templates/%project_name%/slices/main/repository.rb.erb
307
- - lib/hanamismith/templates/%project_name%/slices/main/templates/home/show.html.erb.erb
308
- - lib/hanamismith/templates/%project_name%/slices/main/templates/layouts/app.html.erb.erb
309
- - lib/hanamismith/templates/%project_name%/slices/main/view.rb.erb
310
- - lib/hanamismith/templates/%project_name%/slices/main/views/home/show.rb.erb
308
+ - lib/hanamismith/templates/%project_name%/slices/home/action.rb.erb
309
+ - lib/hanamismith/templates/%project_name%/slices/home/actions/show.rb.erb
310
+ - lib/hanamismith/templates/%project_name%/slices/home/repository.rb.erb
311
+ - lib/hanamismith/templates/%project_name%/slices/home/templates/layouts/app.html.erb.erb
312
+ - lib/hanamismith/templates/%project_name%/slices/home/templates/show.html.erb.erb
313
+ - lib/hanamismith/templates/%project_name%/slices/home/view.rb.erb
314
+ - lib/hanamismith/templates/%project_name%/slices/home/views/show.rb.erb
311
315
  - lib/hanamismith/templates/%project_name%/spec/hanami_helper.rb.erb
312
316
  - lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb
313
317
  - lib/hanamismith/templates/%project_name%/spec/slices/health/actions/show_spec.rb.erb
@@ -340,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
344
  - !ruby/object:Gem::Version
341
345
  version: '0'
342
346
  requirements: []
343
- rubygems_version: 3.4.17
347
+ rubygems_version: 3.4.18
344
348
  signing_key:
345
349
  specification_version: 4
346
350
  summary: A command line interface for smithing Hanami projects.
metadata.gz.sig CHANGED
Binary file
@@ -1,11 +0,0 @@
1
- :root {
2
- --site-font-family: Verdana;
3
- }
4
-
5
- .page {
6
- align-items: center;
7
- display: flex;
8
- flex-direction: column;
9
- font-family: var(--site-font-family);
10
- margin: 1rem 5rem;
11
- }
@@ -1,10 +0,0 @@
1
- module Main
2
- module Actions
3
- module Home
4
- # Processes show action.
5
- class Show < Main::Action
6
- def handle(*, response) = response.render view
7
- end
8
- end
9
- end
10
- end
@@ -1,3 +0,0 @@
1
- <h1>Home</h1>
2
-
3
- <p>Welcome!</p>
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= configuration.project_label %></title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <link title="<%= configuration.project_label %> - Stylesheet" rel="stylesheet" href="/stylesheets/site.css" type="text/css">
7
- <script src="/javascripts/htmx.js"></script>
8
- </head>
9
-
10
- <body class="page">
11
- <!-- yield -->
12
- </body>
13
- </html>
@@ -1,9 +0,0 @@
1
- module Main
2
- module Views
3
- module Home
4
- # Renders show view.
5
- class Show < Main::View
6
- end
7
- end
8
- end
9
- end