hanamismith 0.38.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +2 -2
- data/hanamismith.gemspec +8 -8
- data/lib/hanamismith/builders/asset.rb +2 -2
- data/lib/hanamismith/builders/binstub.rb +2 -2
- data/lib/hanamismith/builders/bundler.rb +3 -3
- data/lib/hanamismith/builders/caliber.rb +3 -3
- data/lib/hanamismith/builders/circle_ci.rb +20 -0
- data/lib/hanamismith/builders/console.rb +4 -4
- data/lib/hanamismith/builders/core.rb +11 -14
- data/lib/hanamismith/builders/documentation/readme.rb +3 -3
- data/lib/hanamismith/builders/environments/development.rb +2 -2
- data/lib/hanamismith/builders/environments/test.rb +2 -2
- data/lib/hanamismith/builders/git/ignore.rb +3 -3
- data/lib/hanamismith/builders/{ci/git_hub.rb → git_hub/ci.rb} +5 -5
- data/lib/hanamismith/builders/guard.rb +3 -3
- data/lib/hanamismith/builders/icon.rb +2 -2
- data/lib/hanamismith/builders/javascript.rb +2 -2
- data/lib/hanamismith/builders/node.rb +3 -3
- data/lib/hanamismith/builders/providers/persistence.rb +2 -2
- data/lib/hanamismith/builders/providers/yjit.rb +2 -2
- data/lib/hanamismith/builders/puma/configuration.rb +2 -3
- data/lib/hanamismith/builders/puma/procfile.rb +3 -3
- data/lib/hanamismith/builders/pwa.rb +2 -2
- data/lib/hanamismith/builders/rack/attack.rb +3 -3
- data/lib/hanamismith/builders/rack/configuration.rb +2 -2
- data/lib/hanamismith/builders/rack/deflater.rb +2 -2
- data/lib/hanamismith/builders/rake/configuration.rb +25 -0
- data/lib/hanamismith/builders/refinement.rb +2 -2
- data/lib/hanamismith/builders/rspec/application_shared_context.rb +3 -3
- data/lib/hanamismith/builders/rspec/database.rb +3 -3
- data/lib/hanamismith/builders/rspec/factory.rb +3 -3
- data/lib/hanamismith/builders/rspec/hanami.rb +3 -3
- data/lib/hanamismith/builders/rspec/helper.rb +4 -4
- data/lib/hanamismith/builders/setup.rb +3 -3
- data/lib/hanamismith/builders/slices/health.rb +12 -12
- data/lib/hanamismith/builders/slices/home.rb +15 -15
- data/lib/hanamismith/builders/stylesheet.rb +2 -2
- data/lib/hanamismith/cli/commands/build.rb +37 -35
- data/lib/hanamismith/container.rb +31 -21
- data/lib/hanamismith/extensions/asset.rb +3 -12
- data/lib/hanamismith/extensions/npm.rb +3 -12
- data/lib/hanamismith/templates/%project_name%/.circleci/config.yml.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/.github/workflows/ci.yml.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/.node-version.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/app/assets/pwa/manifest.webmanifest.erb +2 -2
- data/lib/hanamismith/templates/%project_name%/config/providers/persistence.rb.erb +2 -2
- data/lib/hanamismith/templates/%project_name%/env.development.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/env.test.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/package.json.erb +4 -4
- data/lib/hanamismith/templates/%project_name%/slices/health/action.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/health/templates/layouts/app.html.erb.erb +2 -2
- data/lib/hanamismith/templates/%project_name%/slices/health/view.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/home/action.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/home/repository.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/home/templates/layouts/app.html.erb.erb +2 -2
- data/lib/hanamismith/templates/%project_name%/slices/home/templates/show.html.erb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/slices/home/view.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/spec/features/home_spec.rb.erb +1 -1
- data/lib/hanamismith/templates/%project_name%/spec/lib/%project_path%/refines/actions/response_spec.rb.erb +1 -1
- data/lib/hanamismith.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +20 -20
- metadata.gz.sig +0 -0
- data/lib/hanamismith/builders/ci/circle.rb +0 -22
- data/lib/hanamismith/builders/rake.rb +0 -23
@@ -11,18 +11,18 @@ module Hanamismith
|
|
11
11
|
|
12
12
|
def initialize(...)
|
13
13
|
super
|
14
|
-
@template = builder.call
|
14
|
+
@template = builder.call settings.merge(
|
15
15
|
template_path: "%project_name%/spec/spec_helper.rb.erb"
|
16
16
|
)
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
return
|
20
|
+
return false unless settings.build_rspec
|
21
21
|
|
22
22
|
super
|
23
23
|
remove_project_requirement
|
24
24
|
disable_simple_cov_eval
|
25
|
-
|
25
|
+
true
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
@@ -30,7 +30,7 @@ module Hanamismith
|
|
30
30
|
attr_reader :template
|
31
31
|
|
32
32
|
def remove_project_requirement
|
33
|
-
template.replace(/require.+#{
|
33
|
+
template.replace(/require.+#{settings.project_name}.+\n/, "")
|
34
34
|
end
|
35
35
|
|
36
36
|
def disable_simple_cov_eval
|
@@ -9,17 +9,17 @@ module Hanamismith
|
|
9
9
|
using Refinements::Struct
|
10
10
|
|
11
11
|
def call
|
12
|
-
return
|
12
|
+
return false unless settings.build_setup
|
13
13
|
|
14
14
|
super
|
15
15
|
append
|
16
|
-
|
16
|
+
true
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def append
|
22
|
-
builder.call(
|
22
|
+
builder.call(settings.merge(template_path: "%project_name%/bin/setup.erb"))
|
23
23
|
.insert_after(%(Runner.call "bundle install"\n), <<~CONTENT.gsub(/^(?=\w)/, " "))
|
24
24
|
|
25
25
|
puts "Installing packages..."
|
@@ -11,29 +11,29 @@ module Hanamismith
|
|
11
11
|
|
12
12
|
def call
|
13
13
|
private_methods.grep(/\Aadd_/).sort.each { |method| __send__ method }
|
14
|
-
|
14
|
+
true
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def add_configuration
|
20
20
|
path = "%project_name%/config/slices/health.rb.erb"
|
21
|
-
builder.call(
|
21
|
+
builder.call(settings.merge(template_path: path)).render
|
22
22
|
end
|
23
23
|
|
24
24
|
def add_action
|
25
25
|
path = "%project_name%/slices/health/action.rb.erb"
|
26
|
-
builder.call(
|
26
|
+
builder.call(settings.merge(template_path: path)).render
|
27
27
|
end
|
28
28
|
|
29
29
|
def add_view
|
30
30
|
path = "%project_name%/slices/health/view.rb.erb"
|
31
|
-
builder.call(
|
31
|
+
builder.call(settings.merge(template_path: path)).render
|
32
32
|
end
|
33
33
|
|
34
34
|
def add_layout
|
35
35
|
path = "%project_name%/slices/health/templates/layouts/app.html.erb.erb"
|
36
|
-
builder.call(
|
36
|
+
builder.call(settings.merge(template_path: path))
|
37
37
|
.render
|
38
38
|
.replace("<!-- title -->", "<%= content_for :title %>")
|
39
39
|
.replace("<!-- favicon -->", favicon)
|
@@ -42,7 +42,7 @@ module Hanamismith
|
|
42
42
|
|
43
43
|
def favicon
|
44
44
|
%(<%= favicon_tag app_assets["icon.svg"],\n) +
|
45
|
-
%( title: "#{
|
45
|
+
%( title: "#{settings.project_label}: Icon",\n) +
|
46
46
|
%( rel: :icon,\n) +
|
47
47
|
%( type: "image/svg+xml" %>)
|
48
48
|
end
|
@@ -50,33 +50,33 @@ module Hanamismith
|
|
50
50
|
def add_show_template
|
51
51
|
path = "%project_name%/slices/health/templates/show.html.erb.erb"
|
52
52
|
|
53
|
-
builder.call(
|
53
|
+
builder.call(settings.merge(template_path: path))
|
54
54
|
.render
|
55
55
|
.replace(
|
56
56
|
"<!-- title -->",
|
57
|
-
%(<% content_for :title, "Health | #{
|
57
|
+
%(<% content_for :title, "Health | #{settings.project_label}" %>)
|
58
58
|
)
|
59
59
|
.replace("<!-- color -->", %(<%= color %>))
|
60
60
|
end
|
61
61
|
|
62
62
|
def add_context
|
63
63
|
path = "%project_name%/slices/health/views/context.rb.erb"
|
64
|
-
builder.call(
|
64
|
+
builder.call(settings.merge(template_path: path)).render
|
65
65
|
end
|
66
66
|
|
67
67
|
def add_show_view
|
68
68
|
path = "%project_name%/slices/health/views/show.rb.erb"
|
69
|
-
builder.call(
|
69
|
+
builder.call(settings.merge(template_path: path)).render
|
70
70
|
end
|
71
71
|
|
72
72
|
def add_show_action
|
73
73
|
path = "%project_name%/slices/health/actions/show.rb.erb"
|
74
|
-
builder.call(
|
74
|
+
builder.call(settings.merge(template_path: path)).render
|
75
75
|
end
|
76
76
|
|
77
77
|
def add_show_action_spec
|
78
78
|
path = "%project_name%/spec/slices/health/actions/show_spec.rb.erb"
|
79
|
-
builder.call(
|
79
|
+
builder.call(settings.merge(template_path: path)).render
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
@@ -11,34 +11,34 @@ module Hanamismith
|
|
11
11
|
|
12
12
|
def call
|
13
13
|
private_methods.grep(/\Aadd_/).sort.each { |method| __send__ method }
|
14
|
-
|
14
|
+
true
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def add_configuration
|
20
20
|
path = "%project_name%/config/slices/home.rb.erb"
|
21
|
-
builder.call(
|
21
|
+
builder.call(settings.merge(template_path: path)).render
|
22
22
|
end
|
23
23
|
|
24
24
|
def add_action
|
25
25
|
path = "%project_name%/slices/home/action.rb.erb"
|
26
|
-
builder.call(
|
26
|
+
builder.call(settings.merge(template_path: path)).render
|
27
27
|
end
|
28
28
|
|
29
29
|
def add_repository
|
30
30
|
path = "%project_name%/slices/home/repository.rb.erb"
|
31
|
-
builder.call(
|
31
|
+
builder.call(settings.merge(template_path: path)).render
|
32
32
|
end
|
33
33
|
|
34
34
|
def add_view
|
35
35
|
path = "%project_name%/slices/home/view.rb.erb"
|
36
|
-
builder.call(
|
36
|
+
builder.call(settings.merge(template_path: path)).render
|
37
37
|
end
|
38
38
|
|
39
39
|
def add_layout_template
|
40
40
|
path = "%project_name%/slices/home/templates/layouts/app.html.erb.erb"
|
41
|
-
builder.call(
|
41
|
+
builder.call(settings.merge(template_path: path))
|
42
42
|
.render
|
43
43
|
.replace("<!-- title -->", "<%= content_for :title %>")
|
44
44
|
.replace("<!-- favicon -->", favicon)
|
@@ -49,34 +49,34 @@ module Hanamismith
|
|
49
49
|
|
50
50
|
def favicon
|
51
51
|
%(<%= favicon_tag app_assets["icon.svg"],\n) +
|
52
|
-
%( title: "#{
|
52
|
+
%( title: "#{settings.project_label}: Icon",\n) +
|
53
53
|
%( rel: :icon,\n) +
|
54
54
|
%( type: "image/svg+xml" %>)
|
55
55
|
end
|
56
56
|
|
57
57
|
def manifest
|
58
|
-
%(<%= tag.link title: "#{
|
58
|
+
%(<%= tag.link title: "#{settings.project_label}: Manifest",\n) +
|
59
59
|
%( rel: :manifest,\n) +
|
60
60
|
%( href: app_assets["manifest.webmanifest"] %>)
|
61
61
|
end
|
62
62
|
|
63
63
|
def stylesheet
|
64
|
-
%(<%= stylesheet_tag "app", title: "#{
|
64
|
+
%(<%= stylesheet_tag "app", title: "#{settings.project_label}: Stylesheet" %>)
|
65
65
|
end
|
66
66
|
|
67
67
|
def add_context
|
68
68
|
path = "%project_name%/slices/home/views/context.rb.erb"
|
69
|
-
builder.call(
|
69
|
+
builder.call(settings.merge(template_path: path)).render
|
70
70
|
end
|
71
71
|
|
72
72
|
def add_show_template
|
73
73
|
path = "%project_name%/slices/home/templates/show.html.erb.erb"
|
74
74
|
|
75
|
-
builder.call(
|
75
|
+
builder.call(settings.merge(template_path: path))
|
76
76
|
.render
|
77
77
|
.replace(
|
78
78
|
"<!-- title -->",
|
79
|
-
%(<% content_for :title, "#{
|
79
|
+
%(<% content_for :title, "#{settings.project_label}" %>)
|
80
80
|
)
|
81
81
|
.replace("<!-- ruby_version -->", "<%= ruby_version %>")
|
82
82
|
.replace("<!-- hanami_version -->", "<%= hanami_version %>")
|
@@ -84,17 +84,17 @@ module Hanamismith
|
|
84
84
|
|
85
85
|
def add_show_view
|
86
86
|
path = "%project_name%/slices/home/views/show.rb.erb"
|
87
|
-
builder.call(
|
87
|
+
builder.call(settings.merge(template_path: path)).render
|
88
88
|
end
|
89
89
|
|
90
90
|
def add_show_action
|
91
91
|
path = "%project_name%/slices/home/actions/show.rb.erb"
|
92
|
-
builder.call(
|
92
|
+
builder.call(settings.merge(template_path: path)).render
|
93
93
|
end
|
94
94
|
|
95
95
|
def add_request_spec
|
96
96
|
path = "%project_name%/spec/features/home_spec.rb.erb"
|
97
|
-
builder.call(
|
97
|
+
builder.call(settings.merge(template_path: path)).render
|
98
98
|
end
|
99
99
|
end
|
100
100
|
end
|
@@ -10,8 +10,8 @@ module Hanamismith
|
|
10
10
|
|
11
11
|
def call
|
12
12
|
path = "%project_name%/slices/home/assets/css/app.css.erb"
|
13
|
-
builder.call(
|
14
|
-
|
13
|
+
builder.call(settings.merge(template_path: path)).render
|
14
|
+
true
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -7,7 +7,7 @@ module Hanamismith
|
|
7
7
|
module Commands
|
8
8
|
# Handles the build command.
|
9
9
|
class Build < Sod::Command
|
10
|
-
include Hanamismith::Import[:
|
10
|
+
include Hanamismith::Import[:settings, :logger]
|
11
11
|
|
12
12
|
# Order matters.
|
13
13
|
BUILDERS = [
|
@@ -33,13 +33,15 @@ module Hanamismith
|
|
33
33
|
Builders::Bundler,
|
34
34
|
Builders::Node,
|
35
35
|
Builders::Asset,
|
36
|
-
Builders::Rake,
|
36
|
+
Rubysmith::Builders::Rake::Binstub,
|
37
|
+
Builders::Rake::Configuration,
|
37
38
|
Builders::Binstub,
|
38
39
|
Builders::Console,
|
39
|
-
Builders::
|
40
|
-
Builders::
|
40
|
+
Builders::CircleCI,
|
41
|
+
Rubysmith::Builders::GitHub::Template,
|
42
|
+
Rubysmith::Builders::GitHub::Funding,
|
43
|
+
Builders::GitHub::CI,
|
41
44
|
Builders::Setup,
|
42
|
-
Rubysmith::Builders::GitHub,
|
43
45
|
Builders::Guard,
|
44
46
|
Rubysmith::Builders::Reek,
|
45
47
|
Rubysmith::Builders::RSpec::Binstub,
|
@@ -70,34 +72,34 @@ module Hanamismith
|
|
70
72
|
|
71
73
|
description "Build new project."
|
72
74
|
|
73
|
-
on Rubysmith::CLI::Actions::Name,
|
74
|
-
on Rubysmith::CLI::Actions::AmazingPrint,
|
75
|
-
on Rubysmith::CLI::Actions::Caliber,
|
76
|
-
on Rubysmith::CLI::Actions::CircleCI,
|
77
|
-
on Rubysmith::CLI::Actions::Citation,
|
78
|
-
on Rubysmith::CLI::Actions::Community,
|
79
|
-
on Rubysmith::CLI::Actions::Conduct,
|
80
|
-
on Rubysmith::CLI::Actions::Console,
|
81
|
-
on Rubysmith::CLI::Actions::Contributions,
|
82
|
-
on Rubysmith::CLI::Actions::Debug,
|
83
|
-
on Rubysmith::CLI::Actions::Funding,
|
84
|
-
on Rubysmith::CLI::Actions::Git,
|
85
|
-
on Rubysmith::CLI::Actions::GitHub,
|
86
|
-
on Rubysmith::CLI::Actions::GitHubCI,
|
87
|
-
on Rubysmith::CLI::Actions::GitLint,
|
88
|
-
on Rubysmith::CLI::Actions::Guard,
|
89
|
-
on Rubysmith::CLI::Actions::License,
|
90
|
-
on Rubysmith::CLI::Actions::Maximum,
|
91
|
-
on Rubysmith::CLI::Actions::Minimum,
|
92
|
-
on Rubysmith::CLI::Actions::Rake,
|
93
|
-
on Rubysmith::CLI::Actions::Readme,
|
94
|
-
on Rubysmith::CLI::Actions::Reek,
|
95
|
-
on Rubysmith::CLI::Actions::Refinements,
|
96
|
-
on Rubysmith::CLI::Actions::RSpec,
|
97
|
-
on Rubysmith::CLI::Actions::Security,
|
98
|
-
on Rubysmith::CLI::Actions::Setup,
|
99
|
-
on Rubysmith::CLI::Actions::SimpleCov,
|
100
|
-
on Rubysmith::CLI::Actions::Versions,
|
75
|
+
on Rubysmith::CLI::Actions::Name, settings: Container[:settings]
|
76
|
+
on Rubysmith::CLI::Actions::AmazingPrint, settings: Container[:settings]
|
77
|
+
on Rubysmith::CLI::Actions::Caliber, settings: Container[:settings]
|
78
|
+
on Rubysmith::CLI::Actions::CircleCI, settings: Container[:settings]
|
79
|
+
on Rubysmith::CLI::Actions::Citation, settings: Container[:settings]
|
80
|
+
on Rubysmith::CLI::Actions::Community, settings: Container[:settings]
|
81
|
+
on Rubysmith::CLI::Actions::Conduct, settings: Container[:settings]
|
82
|
+
on Rubysmith::CLI::Actions::Console, settings: Container[:settings]
|
83
|
+
on Rubysmith::CLI::Actions::Contributions, settings: Container[:settings]
|
84
|
+
on Rubysmith::CLI::Actions::Debug, settings: Container[:settings]
|
85
|
+
on Rubysmith::CLI::Actions::Funding, settings: Container[:settings]
|
86
|
+
on Rubysmith::CLI::Actions::Git, settings: Container[:settings]
|
87
|
+
on Rubysmith::CLI::Actions::GitHub, settings: Container[:settings]
|
88
|
+
on Rubysmith::CLI::Actions::GitHubCI, settings: Container[:settings]
|
89
|
+
on Rubysmith::CLI::Actions::GitLint, settings: Container[:settings]
|
90
|
+
on Rubysmith::CLI::Actions::Guard, settings: Container[:settings]
|
91
|
+
on Rubysmith::CLI::Actions::License, settings: Container[:settings]
|
92
|
+
on Rubysmith::CLI::Actions::Maximum, settings: Container[:settings]
|
93
|
+
on Rubysmith::CLI::Actions::Minimum, settings: Container[:settings]
|
94
|
+
on Rubysmith::CLI::Actions::Rake, settings: Container[:settings]
|
95
|
+
on Rubysmith::CLI::Actions::Readme, settings: Container[:settings]
|
96
|
+
on Rubysmith::CLI::Actions::Reek, settings: Container[:settings]
|
97
|
+
on Rubysmith::CLI::Actions::Refinements, settings: Container[:settings]
|
98
|
+
on Rubysmith::CLI::Actions::RSpec, settings: Container[:settings]
|
99
|
+
on Rubysmith::CLI::Actions::Security, settings: Container[:settings]
|
100
|
+
on Rubysmith::CLI::Actions::Setup, settings: Container[:settings]
|
101
|
+
on Rubysmith::CLI::Actions::SimpleCov, settings: Container[:settings]
|
102
|
+
on Rubysmith::CLI::Actions::Versions, settings: Container[:settings]
|
101
103
|
|
102
104
|
def initialize(builders: BUILDERS, **)
|
103
105
|
super(**)
|
@@ -105,8 +107,8 @@ module Hanamismith
|
|
105
107
|
end
|
106
108
|
|
107
109
|
def call
|
108
|
-
log_info "Building project skeleton: #{
|
109
|
-
builders.each { |
|
110
|
+
log_info "Building project skeleton: #{settings.project_name}..."
|
111
|
+
builders.each { |constant| constant.new(settings:).call }
|
110
112
|
log_info "Project skeleton complete!"
|
111
113
|
end
|
112
114
|
|
@@ -11,34 +11,44 @@ module Hanamismith
|
|
11
11
|
module Container
|
12
12
|
extend Containable
|
13
13
|
|
14
|
-
register :
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
register :defaults do
|
20
|
-
registry = Etcher::Registry.new contract: Rubysmith::Configuration::Contract,
|
21
|
-
model: Rubysmith::Configuration::Model
|
14
|
+
register :registry do
|
15
|
+
contract = Rubysmith::Configuration::Contract
|
16
|
+
model = Rubysmith::Configuration::Model
|
22
17
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
18
|
+
Etcher::Registry.new(contract:, model:)
|
19
|
+
.add_loader(:yaml, self[:defaults_path])
|
20
|
+
.add_loader(:yaml, self[:xdg_config].active)
|
21
|
+
.add_transformer(Rubysmith::Configuration::Transformers::GitHubUser.new)
|
22
|
+
.add_transformer(Rubysmith::Configuration::Transformers::GitEmail.new)
|
23
|
+
.add_transformer(Rubysmith::Configuration::Transformers::GitUser.new)
|
24
|
+
.add_transformer(Rubysmith::Configuration::Transformers::TemplateRoot.new)
|
25
|
+
.add_transformer(
|
26
|
+
Rubysmith::Configuration::Transformers::TemplateRoot.new(
|
27
|
+
default: Pathname(__dir__).join("templates")
|
28
|
+
)
|
29
|
+
)
|
30
|
+
.add_transformer(:root, :target_root)
|
31
|
+
.add_transformer(:format, :author_uri)
|
32
|
+
.add_transformer(:format, :project_uri_community)
|
33
|
+
.add_transformer(:format, :project_uri_conduct)
|
34
|
+
.add_transformer(:format, :project_uri_contributions)
|
35
|
+
.add_transformer(:format, :project_uri_download, :project_name)
|
36
|
+
.add_transformer(:format, :project_uri_funding)
|
37
|
+
.add_transformer(:format, :project_uri_home, :project_name)
|
38
|
+
.add_transformer(:format, :project_uri_issues, :project_name)
|
39
|
+
.add_transformer(:format, :project_uri_license)
|
40
|
+
.add_transformer(:format, :project_uri_security)
|
41
|
+
.add_transformer(:format, :project_uri_source, :project_name)
|
42
|
+
.add_transformer(:format, :project_uri_versions, :project_name)
|
43
|
+
.add_transformer(:time, :loaded_at)
|
35
44
|
end
|
36
45
|
|
46
|
+
register(:settings) { Etcher.call(self[:registry]).dup }
|
37
47
|
register(:specification) { Spek::Loader.call "#{__dir__}/../../hanamismith.gemspec" }
|
38
|
-
register(:input) { self[:configuration].dup }
|
39
48
|
register(:defaults_path) { Rubysmith::Container[:defaults_path] }
|
40
49
|
register(:xdg_config) { Runcom::Config.new "hanamismith/configuration.yml" }
|
41
50
|
register(:logger) { Cogger.new id: :hanamismith }
|
42
51
|
register :kernel, Kernel
|
52
|
+
register :io, STDOUT
|
43
53
|
end
|
44
54
|
end
|
@@ -6,29 +6,20 @@ module Hanamismith
|
|
6
6
|
module Extensions
|
7
7
|
# Ensures assets are compiled.
|
8
8
|
class Asset
|
9
|
-
include Import[:kernel, :logger]
|
9
|
+
include Import[:settings, :kernel, :logger]
|
10
10
|
|
11
11
|
using Refinements::Pathname
|
12
12
|
|
13
|
-
def self.call(...) = new(...).call
|
14
|
-
|
15
|
-
def initialize(configuration, **)
|
16
|
-
super(**)
|
17
|
-
@configuration = configuration
|
18
|
-
end
|
19
|
-
|
20
13
|
def call
|
21
14
|
logger.error { "Unable to compile assets. Try: `hanami assets compile`." } unless run
|
22
|
-
|
15
|
+
true
|
23
16
|
end
|
24
17
|
|
25
18
|
private
|
26
19
|
|
27
|
-
attr_reader :configuration
|
28
|
-
|
29
20
|
def run
|
30
21
|
success = false
|
31
|
-
|
22
|
+
settings.project_root.change_dir { success = compile_app && compile_home }
|
32
23
|
success
|
33
24
|
end
|
34
25
|
|
@@ -7,31 +7,22 @@ module Hanamismith
|
|
7
7
|
module Extensions
|
8
8
|
# Ensures NPM packages are installed if NPM is available.
|
9
9
|
class NPM
|
10
|
-
include Import[:kernel, :logger]
|
10
|
+
include Import[:settings, :kernel, :logger]
|
11
11
|
|
12
12
|
using Refinements::IO
|
13
13
|
using Refinements::Pathname
|
14
14
|
|
15
|
-
def self.call(...) = new(...).call
|
16
|
-
|
17
|
-
def initialize(configuration, **)
|
18
|
-
super(**)
|
19
|
-
@configuration = configuration
|
20
|
-
end
|
21
|
-
|
22
15
|
def call
|
23
16
|
logger.error { "Unable to detect NPM. Install NPM and run: `npm install`." } unless run
|
24
|
-
|
17
|
+
true
|
25
18
|
end
|
26
19
|
|
27
20
|
private
|
28
21
|
|
29
|
-
attr_reader :configuration
|
30
|
-
|
31
22
|
def run
|
32
23
|
success = false
|
33
24
|
|
34
|
-
|
25
|
+
settings.project_root.change_dir do
|
35
26
|
STDOUT.squelch { success = kernel.system "command -v npm && npm install" }
|
36
27
|
end
|
37
28
|
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
22.3.0
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
|
-
"name": "<%=
|
3
|
-
"short_name": "<%=
|
2
|
+
"name": "<%= settings.project_label %>",
|
3
|
+
"short_name": "<%= settings.project_label %>",
|
4
4
|
"description": "A Hanamismith skeleton application.",
|
5
5
|
"icons": [
|
6
6
|
{
|
@@ -34,8 +34,8 @@ Hanami.app.register_provider :persistence, namespace: true do
|
|
34
34
|
configuration = target["persistence.config"]
|
35
35
|
|
36
36
|
configuration.auto_registration(
|
37
|
-
target.root.join("lib/<%=
|
38
|
-
namespace: "<%=
|
37
|
+
target.root.join("lib/<%= settings.project_path %>/persistence"),
|
38
|
+
namespace: "<%= settings.project_namespaced_class %>::Persistence"
|
39
39
|
)
|
40
40
|
|
41
41
|
register "rom", ROM.container(configuration)
|
@@ -1 +1 @@
|
|
1
|
-
DATABASE_URL=postgres://localhost/<%=
|
1
|
+
DATABASE_URL=postgres://localhost/<%= settings.project_name %>_development
|
@@ -1 +1 @@
|
|
1
|
-
DATABASE_URL=postgres://localhost/<%=
|
1
|
+
DATABASE_URL=postgres://localhost/<%= settings.project_name %>_test
|
@@ -1,9 +1,9 @@
|
|
1
1
|
{
|
2
|
-
"name": "<%=
|
2
|
+
"name": "<%= settings.project_name %>",
|
3
3
|
"description": "",
|
4
|
-
"version": "<%=
|
5
|
-
"author": "<%=
|
6
|
-
"license": "<%=
|
4
|
+
"version": "<%= settings.project_version %>",
|
5
|
+
"author": "<%= settings.author_name %>",
|
6
|
+
"license": "<%= settings.license_label_version %>",
|
7
7
|
"private": true,
|
8
8
|
"type": "module",
|
9
9
|
"keywords": ["ruby", "hanami"],
|
data/lib/hanamismith/templates/%project_name%/slices/health/templates/layouts/app.html.erb.erb
CHANGED
@@ -12,12 +12,12 @@
|
|
12
12
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
13
13
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
14
14
|
|
15
|
-
<link title="<%=
|
15
|
+
<link title="<%= settings.project_label %>: Favorite Icon"
|
16
16
|
rel="icon"
|
17
17
|
href="https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
|
18
18
|
sizes="32x32">
|
19
19
|
<!-- favicon -->
|
20
|
-
<link title="<%=
|
20
|
+
<link title="<%= settings.project_label %>: Apple Icon"
|
21
21
|
rel="apple-touch-icon"
|
22
22
|
href="https://alchemists.io/images/projects/hanamismith/icons/apple.png"
|
23
23
|
type="image/png">
|
data/lib/hanamismith/templates/%project_name%/slices/home/templates/layouts/app.html.erb.erb
CHANGED
@@ -12,12 +12,12 @@
|
|
12
12
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
13
13
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
14
14
|
|
15
|
-
<link title="<%=
|
15
|
+
<link title="<%= settings.project_label %>: Favorite Icon"
|
16
16
|
rel="icon"
|
17
17
|
href="https://alchemists.io/images/projects/hanamismith/icons/favicon.ico"
|
18
18
|
sizes="32x32">
|
19
19
|
<!-- favicon -->
|
20
|
-
<link title="<%=
|
20
|
+
<link title="<%= settings.project_label %>: Apple Icon"
|
21
21
|
rel="apple-touch-icon"
|
22
22
|
href="https://alchemists.io/images/projects/hanamismith/icons/apple.png"
|
23
23
|
type="image/png">
|