hanamismith 1.10.0 → 1.12.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/README.adoc +8 -6
- data/hanamismith.gemspec +5 -5
- data/lib/hanamismith/builders/bundler.rb +1 -1
- data/lib/hanamismith/builders/circle_ci.rb +16 -1
- data/lib/hanamismith/builders/environments/all.rb +2 -1
- data/lib/hanamismith/builders/layout.rb +34 -0
- data/lib/hanamismith/builders/providers/htmx.rb +20 -0
- data/lib/hanamismith/builders/stylesheet.rb +10 -2
- data/lib/hanamismith/cli/commands/build.rb +1 -0
- data/lib/hanamismith/templates/%project_name%/.circleci/config.yml.erb +1 -0
- data/lib/hanamismith/templates/%project_name%/app/assets/css/colors.css.erb +4 -0
- data/lib/hanamismith/templates/%project_name%/app/assets/css/defaults.css.erb +120 -0
- data/lib/hanamismith/templates/%project_name%/app/assets/css/{app.css.erb → layout.css.erb} +16 -17
- data/lib/hanamismith/templates/%project_name%/app/assets/css/settings.css.erb +7 -0
- data/lib/hanamismith/templates/%project_name%/app/assets/css/view_transitions.css.erb +5 -0
- data/lib/hanamismith/templates/%project_name%/app/assets/js/app.js.erb +8 -1
- data/lib/hanamismith/templates/%project_name%/app/templates/layouts/app.html.erb.erb +10 -8
- data/lib/hanamismith/templates/%project_name%/config/app.rb.erb +13 -1
- data/lib/hanamismith/templates/%project_name%/config/providers/htmx.rb.erb +5 -0
- data/lib/hanamismith/templates/%project_name%/config/settings.rb.erb +1 -0
- data/lib/hanamismith/templates/%project_name%/env.erb +4 -1
- data/lib/hanamismith/templates/%project_name%/lib/%project_path%/refines/actions/response.rb.erb +3 -1
- data/lib/hanamismith/templates/%project_name%/package.json.erb +3 -2
- data/lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb +15 -3
- data.tar.gz.sig +0 -0
- metadata +16 -12
- metadata.gz.sig +0 -0
- data/lib/hanamismith/templates/%project_name%/config/providers/persistence.rb.erb +0 -44
- data/lib/hanamismith/templates/%project_name%/config/providers/yjit.rb.erb +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b5e8109a939f5ccabf64c02342735ef9f8ac8977d89b7afdf59b4da83abcabb
|
|
4
|
+
data.tar.gz: b98bdcdf6ea97b081cebab354d7708fc7a3a2ce13f4906e5fc2323622fde4854
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85d98a0302f03e9b52bf1f610eddff4669a39b201415f15785b89e5a51c96cfb70518917e2d58df44d75a43a2ff17993d253cfeeee6dda5eea98d8584dfe33ef
|
|
7
|
+
data.tar.gz: 13d1e2b5565352a970b265d8f0ee23d6ad84afe2e9cc938b9e4638bb896cf3805a19dd110fa3c82df774863ef3885b3a9d2fe052c1ce9a828ef198ff6cdab20c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/README.adoc
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
:dotenv_link: link:https://github.com/bkeepers/dotenv[Dotenv]
|
|
8
8
|
:dotfiles_link: link:https://alchemists.io/projects/dotfiles[Dotfiles]
|
|
9
9
|
:hanami_link: link:https://hanamirb.org[Hanami]
|
|
10
|
-
:
|
|
10
|
+
:htmx_gem_link: link:https://alchemists.io/projects/htmx[HTMX]
|
|
11
|
+
:htmx_link: link:https://htmx.org[htmx]
|
|
11
12
|
:pg_link: link:https://github.com/ged/ruby-pg[pg]
|
|
13
|
+
:postgresql_link: link:https://www.postgresql.org[PostgreSQL]
|
|
12
14
|
:puma_link: link:https://puma.io[Puma]
|
|
13
15
|
:rack_link: link:https://github.com/rack/rack[Rack]
|
|
14
16
|
:rom_link: link:https://rom-rb.org[ROM]
|
|
@@ -22,18 +24,18 @@ toc::[]
|
|
|
22
24
|
|
|
23
25
|
== Features
|
|
24
26
|
|
|
25
|
-
* Built atop {rubysmith_link} for building project
|
|
27
|
+
* Built atop {rubysmith_link} for building project skeletons.
|
|
26
28
|
* Uses {hanami_link} for web application development.
|
|
27
|
-
* Uses {htmx_link} for Hypermedia REST so you can write less code and avoid bloated JavaScript stacks.
|
|
28
|
-
* Uses {pg_link}
|
|
29
|
+
* Uses {htmx_link} (along with the {htmx_gem_link} gem) for Hypermedia REST so you can write less code and avoid bloated JavaScript stacks.
|
|
30
|
+
* Uses {postgresql_link} for the database, {pg_link} for the client, and {rom_link} Ruby object mapper.
|
|
29
31
|
* Uses {rack_link}, specifically: link:https://github.com/rack/rack-attack[Rack::Attack], `Rack::Deflater`, and `Rack::Static`.
|
|
30
|
-
* Uses {puma_link}
|
|
32
|
+
* Uses {puma_link} for the web server including being fully configured for local and production environments.
|
|
31
33
|
* Uses {capybara_link} with {cuprite_link} (driver) for full, headless, feature testing.
|
|
32
34
|
* Uses {dotenv_link} for managing your environment configurations.
|
|
33
35
|
* Provides support for Continuous Integration systems like link:https://circleci.com[Circle CI] (default) and link:https://docs.github.com/en/actions[GitHub Actions].
|
|
34
36
|
* Provides the `/up` health check endpoint via the `Health` slice.
|
|
35
37
|
* Configures link:https://github.com/ruby/ruby/blob/master/doc/yjit/yjit.md[YJIT] so you can deploy with YJIT disabled (i.e. `RUBYOPT=--yjit-disable --yjit-exec-mem-size=192`) and let the application enable upon boot.
|
|
36
|
-
*
|
|
38
|
+
* Ensures link:https://github.com/ruby/irb[IRB] console autocomplete is disabled 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.
|
|
37
39
|
|
|
38
40
|
== Screenshots/Screencasts
|
|
39
41
|
|
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 = "1.
|
|
5
|
+
spec.version = "1.12.0"
|
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
|
8
8
|
spec.homepage = "https://alchemists.io/projects/hanamismith"
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
|
24
24
|
|
|
25
|
-
spec.required_ruby_version = "
|
|
25
|
+
spec.required_ruby_version = ">= 3.4"
|
|
26
26
|
spec.add_dependency "cogger", "~> 1.0"
|
|
27
27
|
spec.add_dependency "containable", "~> 1.1"
|
|
28
28
|
spec.add_dependency "dry-monads", "~> 1.9"
|
|
@@ -30,10 +30,10 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.add_dependency "etcher", "~> 3.0"
|
|
31
31
|
spec.add_dependency "htmx", "~> 2.0"
|
|
32
32
|
spec.add_dependency "infusible", "~> 4.0"
|
|
33
|
-
spec.add_dependency "refinements", "~> 13.
|
|
34
|
-
spec.add_dependency "rubysmith", "~> 8.
|
|
33
|
+
spec.add_dependency "refinements", "~> 13.6"
|
|
34
|
+
spec.add_dependency "rubysmith", "~> 8.9"
|
|
35
35
|
spec.add_dependency "runcom", "~> 12.0"
|
|
36
|
-
spec.add_dependency "sod", "~> 1.
|
|
36
|
+
spec.add_dependency "sod", "~> 1.5"
|
|
37
37
|
spec.add_dependency "spek", "~> 4.0"
|
|
38
38
|
spec.add_dependency "zeitwerk", "~> 2.7"
|
|
39
39
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "refinements/struct"
|
|
4
|
+
require "securerandom"
|
|
4
5
|
|
|
5
6
|
module Hanamismith
|
|
6
7
|
module Builders
|
|
@@ -8,13 +9,27 @@ module Hanamismith
|
|
|
8
9
|
class CircleCI < Rubysmith::Builders::Abstract
|
|
9
10
|
using Refinements::Struct
|
|
10
11
|
|
|
12
|
+
def initialize(generator: SecureRandom, **)
|
|
13
|
+
@generator = generator
|
|
14
|
+
super(**)
|
|
15
|
+
end
|
|
16
|
+
|
|
11
17
|
def call
|
|
12
18
|
return false unless settings.build_circle_ci
|
|
13
19
|
|
|
14
20
|
path = "%project_name%/.circleci/config.yml.erb"
|
|
15
|
-
|
|
21
|
+
|
|
22
|
+
builder.call(settings.with(template_path: path))
|
|
23
|
+
.render
|
|
24
|
+
.replace("<app_secret>", generator.hex(30))
|
|
25
|
+
.replace(/\n\n\Z/, "\n")
|
|
26
|
+
|
|
16
27
|
true
|
|
17
28
|
end
|
|
29
|
+
|
|
30
|
+
private
|
|
31
|
+
|
|
32
|
+
attr_reader :generator
|
|
18
33
|
end
|
|
19
34
|
end
|
|
20
35
|
end
|
|
@@ -18,7 +18,8 @@ module Hanamismith
|
|
|
18
18
|
def call
|
|
19
19
|
builder.call(settings.with(template_path: "%project_name%/env.erb"))
|
|
20
20
|
.render
|
|
21
|
-
.replace("<
|
|
21
|
+
.replace("<app_secret>", generator.hex(40))
|
|
22
|
+
.replace("<pg_password>", generator.hex(15))
|
|
22
23
|
.rename(".env")
|
|
23
24
|
|
|
24
25
|
true
|
|
@@ -13,16 +13,30 @@ module Hanamismith
|
|
|
13
13
|
builder.call(settings.with(template_path: path))
|
|
14
14
|
.render
|
|
15
15
|
.replace("<!-- title -->", "<%= content_for :title %>")
|
|
16
|
+
.replace("<!-- favicon -->", favicon)
|
|
16
17
|
.replace("<!-- icon -->", icon)
|
|
18
|
+
.replace("<!-- apple_icon -->", apple_icon)
|
|
17
19
|
.replace("<!-- manifest -->", manifest)
|
|
18
20
|
.replace("<!-- stylesheet -->", stylesheet)
|
|
21
|
+
.replace("<!-- javascript -->", javascript)
|
|
19
22
|
.replace("<!-- yield -->", "<%= yield %>")
|
|
23
|
+
.replace("<!-- flash:alert -->", flash(:alert))
|
|
24
|
+
.replace("<!-- flash:notice -->", flash(:notice))
|
|
20
25
|
|
|
21
26
|
true
|
|
22
27
|
end
|
|
23
28
|
|
|
24
29
|
private
|
|
25
30
|
|
|
31
|
+
def favicon
|
|
32
|
+
uri = "https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
|
|
33
|
+
|
|
34
|
+
%(<%= tag.link title: "#{settings.project_label}: Favicon",\n) +
|
|
35
|
+
%( rel: :icon,\n) +
|
|
36
|
+
%( href: "#{uri}",\n) +
|
|
37
|
+
%( sizes: "32x32" %>)
|
|
38
|
+
end
|
|
39
|
+
|
|
26
40
|
def icon
|
|
27
41
|
%(<%= tag.link title: "#{settings.project_label}: Icon",\n) +
|
|
28
42
|
%( rel: :icon,\n) +
|
|
@@ -30,6 +44,24 @@ module Hanamismith
|
|
|
30
44
|
%( type: "image/svg+xml" %>)
|
|
31
45
|
end
|
|
32
46
|
|
|
47
|
+
def apple_icon
|
|
48
|
+
uri = "https://alchemists.io/images/projects/hanamismith/icons/apple.png"
|
|
49
|
+
|
|
50
|
+
%(<%= tag.link title: "#{settings.project_label}: Apple Icon",\n) +
|
|
51
|
+
%( rel: "apple-touch-icon",\n) +
|
|
52
|
+
%( href: "#{uri}",\n) +
|
|
53
|
+
%( type: "image/png" %>)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# :reek:UtilityFunction
|
|
57
|
+
def flash kind
|
|
58
|
+
%(<% if flash[:#{kind}] %>\n) +
|
|
59
|
+
%( <div class="site-#{kind}">\n) +
|
|
60
|
+
%( <p><%= flash[:#{kind}] %></p>\n) +
|
|
61
|
+
%( </div>\n) +
|
|
62
|
+
%( <% end %>\n)
|
|
63
|
+
end
|
|
64
|
+
|
|
33
65
|
def manifest
|
|
34
66
|
%(<%= tag.link title: "#{settings.project_label}: Manifest",\n) +
|
|
35
67
|
%( rel: :manifest,\n) +
|
|
@@ -40,6 +72,8 @@ module Hanamismith
|
|
|
40
72
|
%(<%= tag.link title: "#{settings.project_label}: Stylesheet", rel: :stylesheet, ) +
|
|
41
73
|
%(href: app_assets["app.css"] %>)
|
|
42
74
|
end
|
|
75
|
+
|
|
76
|
+
def javascript = %(<%= tag.script src: app_assets["app.js"], type: "text/javascript" %>)
|
|
43
77
|
end
|
|
44
78
|
end
|
|
45
79
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "refinements/struct"
|
|
4
|
+
|
|
5
|
+
module Hanamismith
|
|
6
|
+
module Builders
|
|
7
|
+
module Providers
|
|
8
|
+
# Builds project skeleton for HTMX provider.
|
|
9
|
+
class HTMX < Rubysmith::Builders::Abstract
|
|
10
|
+
using Refinements::Struct
|
|
11
|
+
|
|
12
|
+
def call
|
|
13
|
+
path = "%project_name%/config/providers/htmx.rb.erb"
|
|
14
|
+
builder.call(settings.with(template_path: path)).render
|
|
15
|
+
true
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -9,8 +9,16 @@ module Hanamismith
|
|
|
9
9
|
using Refinements::Struct
|
|
10
10
|
|
|
11
11
|
def call
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
%w[
|
|
13
|
+
%project_name%/app/assets/css/settings.css.erb
|
|
14
|
+
%project_name%/app/assets/css/colors.css.erb
|
|
15
|
+
%project_name%/app/assets/css/view_transitions.css.erb
|
|
16
|
+
%project_name%/app/assets/css/defaults.css.erb
|
|
17
|
+
%project_name%/app/assets/css/layout.css.erb
|
|
18
|
+
].each do |path|
|
|
19
|
+
builder.call(settings.with(template_path: path)).render
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
true
|
|
15
23
|
end
|
|
16
24
|
end
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
*, *::after, *::before {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
6
|
+
:where(html) {
|
|
7
|
+
interpolate-size: allow-keywords;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where(html) {
|
|
12
|
+
accent-color: var(--color-white);
|
|
13
|
+
background-color: var(--color-black);
|
|
14
|
+
font-family: var(--site-font-family);
|
|
15
|
+
height: 100%;
|
|
16
|
+
line-height: 1.5;
|
|
17
|
+
overscroll-behavior: none;
|
|
18
|
+
scrollbar-color: var(--color-white) var(--site-red);
|
|
19
|
+
scrollbar-gutter: stable;
|
|
20
|
+
text-size-adjust: none;
|
|
21
|
+
-moz-text-size-adjust: none;
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
-webkit-text-size-adjust: none;
|
|
24
|
+
|
|
25
|
+
::selection {
|
|
26
|
+
background-color: var(--color-white);
|
|
27
|
+
color: var(--color-black);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:where(audio, iframe, img, svg, video) {
|
|
32
|
+
max-block-size: 100%;
|
|
33
|
+
max-inline-size: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:where(button, input, select, textarea) {
|
|
37
|
+
font: inherit;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:where(a) {
|
|
41
|
+
color: var(--color-white);
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
text-decoration: underline;
|
|
46
|
+
text-underline-position: under;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:where(abbr[title]) {
|
|
51
|
+
cursor: help;
|
|
52
|
+
text-decoration-line: underline;
|
|
53
|
+
text-decoration-style: dotted;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:where(code) {
|
|
57
|
+
background-color: var(--color-black);
|
|
58
|
+
border-radius: 0.3rem;
|
|
59
|
+
color: var(--color-white);
|
|
60
|
+
font-size: 0.95rem;
|
|
61
|
+
padding: 0.1rem 0.3rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:where(h1, h2, h3, h4, h5, h6, p) {
|
|
65
|
+
overflow-wrap: break-word;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:where(h1, h2, h3, h4, h5, h6) {
|
|
69
|
+
text-wrap: balance;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where(h1, h2) {
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
font-size: 2.75em;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:where(img) {
|
|
78
|
+
display: block;
|
|
79
|
+
height: auto;
|
|
80
|
+
max-width: 100%;
|
|
81
|
+
object-fit: cover;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where(kbd) {
|
|
85
|
+
background-color: var(--color-white);
|
|
86
|
+
border-radius: 0.2rem;
|
|
87
|
+
border: 0.1rem solid var(--color-white);
|
|
88
|
+
color: var(--color-black);
|
|
89
|
+
font-size: 0.85em;
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
line-height: 1rem;
|
|
92
|
+
padding: 0.1rem 0.3rem;
|
|
93
|
+
white-space: nowrap;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where(label):has(+:where(textarea, input, select)) {
|
|
97
|
+
display: block;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:where(p) {
|
|
101
|
+
text-wrap: pretty;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:where(pre:not([class^=language])) {
|
|
105
|
+
background-color: var(--color-black);
|
|
106
|
+
color: var(--color-white);
|
|
107
|
+
padding: 0.5rem 1rem;
|
|
108
|
+
font-size: 0.9rem;
|
|
109
|
+
white-space: pre-wrap;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where(pre) {
|
|
113
|
+
border-radius: 0.5rem;
|
|
114
|
+
font-weight: 400;
|
|
115
|
+
padding: 0.5rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:where(textarea:not([rows])) {
|
|
119
|
+
min-block-size: 6em;
|
|
120
|
+
}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
2
|
-
@view-transition {
|
|
3
|
-
navigation: auto;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
html {
|
|
8
|
-
height: 100%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
1
|
.site-page {
|
|
12
|
-
--color-pink: hsl(306, 81%, 77%);
|
|
13
|
-
--color-red: hsl(11, 86%, 46%);
|
|
14
|
-
--color-rose: hsl(338, 27%, 88%);
|
|
15
|
-
--color-white: hsl(0, 0%, 100%);
|
|
16
|
-
--color-black: hsl(0, 0%, 0%);
|
|
17
|
-
--font-family: Verdana;
|
|
18
|
-
|
|
19
2
|
background-color: var(--color-black);
|
|
20
3
|
background-image: linear-gradient(
|
|
21
4
|
0deg,
|
|
@@ -99,3 +82,19 @@ html {
|
|
|
99
82
|
}
|
|
100
83
|
}
|
|
101
84
|
}
|
|
85
|
+
|
|
86
|
+
.site-alert, .site-notice {
|
|
87
|
+
border-radius: 0.5rem;
|
|
88
|
+
font-weight: 600;
|
|
89
|
+
padding: 0 1rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.site-alert {
|
|
93
|
+
background-color: var(--site-red);
|
|
94
|
+
color: var(--site-white);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.site-notice {
|
|
98
|
+
background-color: var(--site-blue);
|
|
99
|
+
color: var(--site-white);
|
|
100
|
+
}
|
|
@@ -11,23 +11,25 @@
|
|
|
11
11
|
<meta name="author" content="Hanamismith">
|
|
12
12
|
<meta name="mobile-web-app-capable" content="yes">
|
|
13
13
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
14
|
+
<meta name="htmx-config" content='{"allowScriptTags": false, "defaultSwapStyle": "outerHTML"}'>
|
|
14
15
|
<meta name="view-transition" content="same-origin">
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
href="https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
|
|
19
|
-
sizes="32x32">
|
|
17
|
+
<!-- favicon -->
|
|
18
|
+
|
|
20
19
|
<!-- icon -->
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type="image/png">
|
|
20
|
+
|
|
21
|
+
<!-- apple_icon -->
|
|
22
|
+
|
|
25
23
|
<!-- manifest -->
|
|
26
24
|
|
|
27
25
|
<!-- stylesheet -->
|
|
26
|
+
|
|
27
|
+
<!-- javascript -->
|
|
28
28
|
</head>
|
|
29
29
|
|
|
30
30
|
<body class="site-page">
|
|
31
|
+
<!-- flash:alert -->
|
|
32
|
+
<!-- flash:notice -->
|
|
31
33
|
<!-- yield -->
|
|
32
34
|
</body>
|
|
33
35
|
</html>
|
|
@@ -3,7 +3,10 @@ require "hanami"
|
|
|
3
3
|
<% namespace do %>
|
|
4
4
|
# The application base configuration.
|
|
5
5
|
class App < Hanami::App
|
|
6
|
+
# :nocov:
|
|
6
7
|
RubyVM::YJIT.enable
|
|
8
|
+
# :nocov:
|
|
9
|
+
|
|
7
10
|
Dry::Schema.load_extensions :monads
|
|
8
11
|
Dry::Validation.load_extensions :monads
|
|
9
12
|
|
|
@@ -15,9 +18,18 @@ require "hanami"
|
|
|
15
18
|
|
|
16
19
|
config.actions.content_security_policy.then do |csp|
|
|
17
20
|
csp[:manifest_src] = "'self'"
|
|
18
|
-
csp[:script_src] += " 'unsafe-eval' 'unsafe-inline'
|
|
21
|
+
csp[:script_src] += " 'unsafe-eval' 'unsafe-inline'"
|
|
19
22
|
end
|
|
20
23
|
|
|
24
|
+
# rubocop:todo Layout/FirstArrayElementLineBreak
|
|
25
|
+
config.actions.sessions = :cookie,
|
|
26
|
+
{
|
|
27
|
+
key: "<%= settings.project_name %>.session",
|
|
28
|
+
secret: settings.app_secret,
|
|
29
|
+
expire_after: 3_600 # 1 hour.
|
|
30
|
+
}
|
|
31
|
+
# rubocop:enable Layout/FirstArrayElementLineBreak
|
|
32
|
+
|
|
21
33
|
environment :development do
|
|
22
34
|
# :nocov:
|
|
23
35
|
config.logger.options[:colorize] = true
|
data/lib/hanamismith/templates/%project_name%/lib/%project_path%/refines/actions/response.rb.erb
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
# Modifies and enhances default Hanami action response behavior.
|
|
5
5
|
module Response
|
|
6
6
|
refine Hanami::Action::Response do
|
|
7
|
-
def with body:, status:
|
|
7
|
+
def with body:, format: nil, status: 200
|
|
8
8
|
@body = [body]
|
|
9
9
|
@status = status
|
|
10
|
+
|
|
11
|
+
self.format = format if format
|
|
10
12
|
self
|
|
11
13
|
end
|
|
12
14
|
end
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
"license": "<%= settings.license_label_version %>",
|
|
7
7
|
"private": true,
|
|
8
8
|
"type": "module",
|
|
9
|
-
"keywords": ["
|
|
9
|
+
"keywords": ["hanami", "htmx", "ruby"],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"hanami-assets": "^2.2.0"
|
|
11
|
+
"hanami-assets": "^2.2.0",
|
|
12
|
+
"htmx.org": "^2.0.8"
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -3,16 +3,28 @@ require "hanami_helper"
|
|
|
3
3
|
RSpec.describe <%= settings.project_namespaced_class %>::Refines::Actions::Response do
|
|
4
4
|
using described_class
|
|
5
5
|
|
|
6
|
-
subject
|
|
6
|
+
subject :response do
|
|
7
|
+
config = Class.new(Hanami::Action).config.tap { it.format :json }
|
|
8
|
+
Hanami::Action::Response.new request:, config:
|
|
9
|
+
end
|
|
7
10
|
|
|
8
11
|
let :request do
|
|
9
12
|
Rack::MockRequest.env_for("/").then { |env| Hanami::Action::Request.new env:, params: {} }
|
|
10
13
|
end
|
|
11
14
|
|
|
12
15
|
describe "#with" do
|
|
13
|
-
it "answers response with
|
|
14
|
-
expect(response.with(body: "
|
|
16
|
+
it "answers response with required body and status" do
|
|
17
|
+
expect(response.with(body: "A test.")).to have_attributes(
|
|
18
|
+
body: ["A test."],
|
|
19
|
+
format: nil,
|
|
20
|
+
status: 200
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "answers response with body, format, and status" do
|
|
25
|
+
expect(response.with(body: "Danger!", format: :json, status: 400)).to have_attributes(
|
|
15
26
|
body: ["Danger!"],
|
|
27
|
+
format: :json,
|
|
16
28
|
status: 400
|
|
17
29
|
)
|
|
18
30
|
end
|
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: 1.
|
|
4
|
+
version: 1.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -139,28 +139,28 @@ dependencies:
|
|
|
139
139
|
requirements:
|
|
140
140
|
- - "~>"
|
|
141
141
|
- !ruby/object:Gem::Version
|
|
142
|
-
version: '13.
|
|
142
|
+
version: '13.6'
|
|
143
143
|
type: :runtime
|
|
144
144
|
prerelease: false
|
|
145
145
|
version_requirements: !ruby/object:Gem::Requirement
|
|
146
146
|
requirements:
|
|
147
147
|
- - "~>"
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: '13.
|
|
149
|
+
version: '13.6'
|
|
150
150
|
- !ruby/object:Gem::Dependency
|
|
151
151
|
name: rubysmith
|
|
152
152
|
requirement: !ruby/object:Gem::Requirement
|
|
153
153
|
requirements:
|
|
154
154
|
- - "~>"
|
|
155
155
|
- !ruby/object:Gem::Version
|
|
156
|
-
version: '8.
|
|
156
|
+
version: '8.9'
|
|
157
157
|
type: :runtime
|
|
158
158
|
prerelease: false
|
|
159
159
|
version_requirements: !ruby/object:Gem::Requirement
|
|
160
160
|
requirements:
|
|
161
161
|
- - "~>"
|
|
162
162
|
- !ruby/object:Gem::Version
|
|
163
|
-
version: '8.
|
|
163
|
+
version: '8.9'
|
|
164
164
|
- !ruby/object:Gem::Dependency
|
|
165
165
|
name: runcom
|
|
166
166
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -181,14 +181,14 @@ dependencies:
|
|
|
181
181
|
requirements:
|
|
182
182
|
- - "~>"
|
|
183
183
|
- !ruby/object:Gem::Version
|
|
184
|
-
version: '1.
|
|
184
|
+
version: '1.5'
|
|
185
185
|
type: :runtime
|
|
186
186
|
prerelease: false
|
|
187
187
|
version_requirements: !ruby/object:Gem::Requirement
|
|
188
188
|
requirements:
|
|
189
189
|
- - "~>"
|
|
190
190
|
- !ruby/object:Gem::Version
|
|
191
|
-
version: '1.
|
|
191
|
+
version: '1.5'
|
|
192
192
|
- !ruby/object:Gem::Dependency
|
|
193
193
|
name: spek
|
|
194
194
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -251,6 +251,7 @@ files:
|
|
|
251
251
|
- lib/hanamismith/builders/javascript.rb
|
|
252
252
|
- lib/hanamismith/builders/layout.rb
|
|
253
253
|
- lib/hanamismith/builders/node.rb
|
|
254
|
+
- lib/hanamismith/builders/providers/htmx.rb
|
|
254
255
|
- lib/hanamismith/builders/puma/configuration.rb
|
|
255
256
|
- lib/hanamismith/builders/puma/procfile.rb
|
|
256
257
|
- lib/hanamismith/builders/pwa.rb
|
|
@@ -279,7 +280,11 @@ files:
|
|
|
279
280
|
- lib/hanamismith/templates/%project_name%/Procfile.dev.erb
|
|
280
281
|
- lib/hanamismith/templates/%project_name%/Procfile.erb
|
|
281
282
|
- lib/hanamismith/templates/%project_name%/app/action.rb.erb
|
|
282
|
-
- lib/hanamismith/templates/%project_name%/app/assets/css/
|
|
283
|
+
- lib/hanamismith/templates/%project_name%/app/assets/css/colors.css.erb
|
|
284
|
+
- lib/hanamismith/templates/%project_name%/app/assets/css/defaults.css.erb
|
|
285
|
+
- lib/hanamismith/templates/%project_name%/app/assets/css/layout.css.erb
|
|
286
|
+
- lib/hanamismith/templates/%project_name%/app/assets/css/settings.css.erb
|
|
287
|
+
- lib/hanamismith/templates/%project_name%/app/assets/css/view_transitions.css.erb
|
|
283
288
|
- lib/hanamismith/templates/%project_name%/app/assets/images/icon.svg.erb
|
|
284
289
|
- lib/hanamismith/templates/%project_name%/app/assets/js/app.js.erb
|
|
285
290
|
- lib/hanamismith/templates/%project_name%/app/assets/pwa/manifest.webmanifest.erb
|
|
@@ -294,8 +299,7 @@ files:
|
|
|
294
299
|
- lib/hanamismith/templates/%project_name%/config/app.rb.erb
|
|
295
300
|
- lib/hanamismith/templates/%project_name%/config/assets.js.erb
|
|
296
301
|
- lib/hanamismith/templates/%project_name%/config/initializers/rack_attack.rb.erb
|
|
297
|
-
- lib/hanamismith/templates/%project_name%/config/providers/
|
|
298
|
-
- lib/hanamismith/templates/%project_name%/config/providers/yjit.rb.erb
|
|
302
|
+
- lib/hanamismith/templates/%project_name%/config/providers/htmx.rb.erb
|
|
299
303
|
- lib/hanamismith/templates/%project_name%/config/puma.rb.erb
|
|
300
304
|
- lib/hanamismith/templates/%project_name%/config/routes.rb.erb
|
|
301
305
|
- lib/hanamismith/templates/%project_name%/config/settings.rb.erb
|
|
@@ -344,7 +348,7 @@ require_paths:
|
|
|
344
348
|
- lib
|
|
345
349
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
346
350
|
requirements:
|
|
347
|
-
- - "
|
|
351
|
+
- - ">="
|
|
348
352
|
- !ruby/object:Gem::Version
|
|
349
353
|
version: '3.4'
|
|
350
354
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -353,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
353
357
|
- !ruby/object:Gem::Version
|
|
354
358
|
version: '0'
|
|
355
359
|
requirements: []
|
|
356
|
-
rubygems_version: 3.7.
|
|
360
|
+
rubygems_version: 3.7.2
|
|
357
361
|
specification_version: 4
|
|
358
362
|
summary: A command line interface for smithing Hanami projects.
|
|
359
363
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# :nocov:
|
|
2
|
-
# rubocop:todo Metrics/BlockLength
|
|
3
|
-
Hanami.app.register_provider :persistence, namespace: true do
|
|
4
|
-
prepare do
|
|
5
|
-
require "rom-changeset"
|
|
6
|
-
require "rom/core"
|
|
7
|
-
require "rom/sql"
|
|
8
|
-
|
|
9
|
-
Sequel::Database.extension :constant_sql_override, :pg_enum
|
|
10
|
-
Sequel.database_timezone = :utc
|
|
11
|
-
Sequel.application_timezone = :local
|
|
12
|
-
|
|
13
|
-
configuration = ROM::Configuration.new :sql, target["settings"].database_url
|
|
14
|
-
|
|
15
|
-
configuration.plugin :sql, relations: :instrumentation do |plugin_config|
|
|
16
|
-
plugin_config.notifications = target["notifications"]
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
configuration.plugin :sql, relations: :auto_restrictions
|
|
20
|
-
|
|
21
|
-
database = configuration.gateways[:default].connection
|
|
22
|
-
database.set_constant_sql Sequel::CURRENT_TIMESTAMP, "(CURRENT_TIMESTAMP AT TIME ZONE 'UTC')"
|
|
23
|
-
|
|
24
|
-
register "config", configuration
|
|
25
|
-
register "db", database
|
|
26
|
-
|
|
27
|
-
Sequel::Migrator.is_current? database, Hanami.app.root.join("db/migrate")
|
|
28
|
-
rescue NoMethodError, Sequel::Migrator::Error => error
|
|
29
|
-
message = error.message
|
|
30
|
-
Hanami.logger.error message unless error.is_a?(NoMethodError) && message.include?("migration")
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
start do
|
|
34
|
-
configuration = target["persistence.config"]
|
|
35
|
-
|
|
36
|
-
configuration.auto_registration(
|
|
37
|
-
target.root.join("lib/<%= settings.project_path %>/persistence"),
|
|
38
|
-
namespace: "<%= settings.project_namespaced_class %>::Persistence"
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
register "rom", ROM.container(configuration)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
# rubocop:enable Metrics/BlockLength
|