hanamismith 0.15.0 → 0.16.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/hanamismith.gemspec +2 -2
- data/lib/hanamismith/builders/icon.rb +29 -0
- data/lib/hanamismith/builders/pwa.rb +29 -0
- data/lib/hanamismith/cli/commands/build.rb +2 -0
- data/lib/hanamismith/templates/%project_name%/config/app.rb.erb +9 -2
- data/lib/hanamismith/templates/%project_name%/public/icon.svg.erb +4 -0
- data/lib/hanamismith/templates/%project_name%/public/manifest.webmanifest.erb +15 -0
- data/lib/hanamismith/templates/%project_name%/public/stylesheets/site.css.erb +1 -3
- data/lib/hanamismith/templates/%project_name%/slices/main/templates/layouts/app.html.erb.erb +21 -4
- data/lib/hanamismith.rb +5 -1
- data.tar.gz.sig +0 -0
- metadata +9 -5
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b9f18ea3a2750d2452225cbb602db94787af77ae953a6283c496bdd1b977c255
         | 
| 4 | 
            +
              data.tar.gz: 969edd95ec4318d7f2b9d5eb0a882b8fb8284302de965bd9d860a82c126b87f1
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 436606c6e9ffc77cb47d5fb83a7097151ec02ac727ca3d95efa0f5497ae5b31d3fdb1ed4677488bb2e6914cb2e7bb62418711a3c3694fff542d3fa665e24ad6f
         | 
| 7 | 
            +
              data.tar.gz: 820584b45f86afd8d93b72f6b49fdae9f77bbffc389b29549f1283a6f30fb205a2e39a2e1eb6e42b727a87f48e44813cd3807732e2dbf640825cc6bc95126646
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        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. | 
| 5 | 
            +
              spec.version = "0.16.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. | 
| 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"
         | 
| @@ -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
         | 
| @@ -15,8 +15,10 @@ 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,
         | 
| 21 | 
            +
                      Builders::PWA,
         | 
| 20 22 | 
             
                      Builders::Slices::Main,
         | 
| 21 23 | 
             
                      Builders::Slices::Health,
         | 
| 22 24 | 
             
                      Rubysmith::Builders::Version,
         | 
| @@ -7,14 +7,21 @@ 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 | 
| 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, | 
| 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
         | 
| 20 27 | 
             
                  config.logger.options[:colorize] = true
         | 
| @@ -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 | 
            +
            }
         | 
    
        data/lib/hanamismith/templates/%project_name%/slices/main/templates/layouts/app.html.erb.erb
    CHANGED
    
    | @@ -1,13 +1,30 @@ | |
| 1 1 | 
             
            <!DOCTYPE html>
         | 
| 2 | 
            -
             | 
| 2 | 
            +
             | 
| 3 | 
            +
            <html lang="en">
         | 
| 3 4 | 
             
              <head>
         | 
| 4 5 | 
             
                <title><%= configuration.project_label %></title>
         | 
| 5 | 
            -
             | 
| 6 | 
            -
                < | 
| 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/site.css" type="text/css">
         | 
| 23 | 
            +
             | 
| 7 24 | 
             
                <script src="/javascripts/htmx.js"></script>
         | 
| 8 25 | 
             
              </head>
         | 
| 9 26 |  | 
| 10 | 
            -
              <body class=" | 
| 27 | 
            +
              <body class="site">
         | 
| 11 28 | 
             
                <!-- yield -->
         | 
| 12 29 | 
             
              </body>
         | 
| 13 30 | 
             
            </html>
         | 
    
        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", | 
| 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
    
    | Binary file | 
    
        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. | 
| 4 | 
            +
              version: 0.16.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- | 
| 38 | 
            +
            date: 2023-08-11 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. | 
| 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. | 
| 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
         | 
| @@ -298,7 +300,9 @@ 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
         | 
| 305 | 
            +
            - lib/hanamismith/templates/%project_name%/public/manifest.webmanifest.erb
         | 
| 302 306 | 
             
            - lib/hanamismith/templates/%project_name%/public/stylesheets/site.css.erb
         | 
| 303 307 | 
             
            - lib/hanamismith/templates/%project_name%/slices/health/actions/show.rb.erb
         | 
| 304 308 | 
             
            - lib/hanamismith/templates/%project_name%/slices/main/action.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. | 
| 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 |