hanamismith 0.14.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cace5a0462e4ec84bb5d6d5edcc0fa9c66bed704161a0e193e32c2f05c221412
4
- data.tar.gz: 62910b4441061d5d5060bda55576a681852d5fc820070d25e34f6754e06f7d71
3
+ metadata.gz: b9f18ea3a2750d2452225cbb602db94787af77ae953a6283c496bdd1b977c255
4
+ data.tar.gz: 969edd95ec4318d7f2b9d5eb0a882b8fb8284302de965bd9d860a82c126b87f1
5
5
  SHA512:
6
- metadata.gz: 5970838f4173c47092b06d4b18a6657291641df02872ebc6f927b5f7ca6976601f6ccf037c861b67d790d7d8118f6515146e017431ea7f2d956597f880aecb48
7
- data.tar.gz: bd72a3e02146fef0b6fb6828b664e5f14e176d6455ab221dcc793ffb587d2c19373eb97d50836ebf430deb48f1d9615dad11fd86fcddeef88b6c4f8adfe3ac20
6
+ metadata.gz: 436606c6e9ffc77cb47d5fb83a7097151ec02ac727ca3d95efa0f5497ae5b31d3fdb1ed4677488bb2e6914cb2e7bb62418711a3c3694fff542d3fa665e24ad6f
7
+ data.tar.gz: 820584b45f86afd8d93b72f6b49fdae9f77bbffc389b29549f1283a6f30fb205a2e39a2e1eb6e42b727a87f48e44813cd3807732e2dbf640825cc6bc95126646
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -71,20 +71,7 @@ gem install hanamismith
71
71
 
72
72
  From the command line, type: `hanamismith --help`
73
73
 
74
- ....
75
- USAGE
76
- hanamismith [OPTIONS]
77
- hanamismith COMMAND [OPTIONS]
78
-
79
- OPTIONS
80
- -v, --version Show version.
81
- -h, --help [COMMAND] Show this message.
82
-
83
- COMMANDS
84
- config Manage configuration.
85
- Path is dynamic per current directory.
86
- build Build new project.
87
- ....
74
+ image:https://alchemists.io/images/projects/hanamismith/screenshots/usage.png[Usage,width=586,height=333,role=focal_point]
88
75
 
89
76
  The core functionality of this gem centers around the `build` command and associated flags. The build options allow you to further customize the kind of gem you want to build. Most build options are enabled by default. For detailed documentation on all supported flags, see the link:https://alchemists.io/projects/rubysmith/#_build[Rubysmith] documentation.
90
77
 
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.14.1"
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,10 +29,10 @@ 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
- spec.add_dependency "rubysmith", "~> 5.3"
35
+ spec.add_dependency "rubysmith", "~> 5.5"
36
36
  spec.add_dependency "runcom", "~> 10.0"
37
37
  spec.add_dependency "sod", "~> 0.0"
38
38
  spec.add_dependency "spek", "~> 2.0"
@@ -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,
@@ -11,12 +11,12 @@ module Hanamismith
11
11
  module Container
12
12
  extend Dry::Container::Mixin
13
13
 
14
- register :configuration do
14
+ register :configuration, memoize: true do
15
15
  self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
16
16
  .then { |registry| Etcher.call registry }
17
17
  end
18
18
 
19
- register :defaults do
19
+ register :defaults, memoize: true do
20
20
  registry = Etcher::Registry.new contract: Rubysmith::Configuration::Contract,
21
21
  model: Rubysmith::Configuration::Model
22
22
 
@@ -28,17 +28,20 @@ module Hanamismith
28
28
  .add_transformer(Rubysmith::Configuration::Transformers::TemplateRoot.new)
29
29
  .add_transformer(
30
30
  Rubysmith::Configuration::Transformers::TemplateRoot.new(
31
- Pathname(__dir__).join("templates")
31
+ default: Pathname(__dir__).join("templates")
32
32
  )
33
33
  )
34
34
  .add_transformer(Rubysmith::Configuration::Transformers::TargetRoot)
35
35
  end
36
36
 
37
+ register :specification, memoize: true do
38
+ Spek::Loader.call "#{__dir__}/../../hanamismith.gemspec"
39
+ end
40
+
37
41
  register(:input, memoize: true) { self[:configuration].dup }
38
42
  register(:defaults_path) { Rubysmith::Container[:defaults_path] }
39
- register(:xdg_config) { Runcom::Config.new "hanamismith/configuration.yml" }
40
- register(:specification) { Spek::Loader.call "#{__dir__}/../../hanamismith.gemspec" }
41
- register(:kernel) { Kernel }
42
- register(:logger) { Cogger.new formatter: :emoji }
43
+ register(:xdg_config, memoize: true) { Runcom::Config.new "hanamismith/configuration.yml" }
44
+ register(:logger, memoize: true) { Cogger.new formatter: :emoji }
45
+ register :kernel, Kernel
43
46
  end
44
47
  end
@@ -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[: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
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
+ }
@@ -1,8 +1,6 @@
1
- :root {
1
+ .site {
2
2
  --site-font-family: Verdana;
3
- }
4
3
 
5
- .page {
6
4
  align-items: center;
7
5
  display: flex;
8
6
  flex-direction: column;
@@ -1,13 +1,30 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+
3
+ <html lang="en">
3
4
  <head>
4
5
  <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">
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="page">
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", "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
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.14.1
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-07-14 00:00:00.000000000 Z
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.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
@@ -169,14 +169,14 @@ dependencies:
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '5.3'
172
+ version: '5.5'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '5.3'
179
+ version: '5.5'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: runcom
182
182
  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.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