hanami-cli 2.2.0.rc1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/hanami/cli/commands/app/generate/component.rb +4 -4
- data/lib/hanami/cli/commands/app/generate/relation.rb +20 -0
- data/lib/hanami/cli/generators/app/component.rb +1 -0
- data/lib/hanami/cli/generators/app/migration.rb +1 -1
- data/lib/hanami/cli/generators/app/relation.rb +5 -2
- data/lib/hanami/cli/generators/gem/app/gemfile.erb +2 -2
- data/lib/hanami/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af8c95d39ccda17c32851a787f8ef309b6af8936d1bb1eca4780a8f57969af66
|
4
|
+
data.tar.gz: a4aff54793a12526acf3919a16657fea36d496645fad596f2d214f3baf00e974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a82b7839e9890b5dc3ed61b6e95ba3cc42dc1ba217d8d2f60b77fe2dd09a566331a1164f3ea8236ecb25f303bc64203388c5d1803ae38f0f5bffc18a9d9c60d
|
7
|
+
data.tar.gz: a3b6a3321bab8c5089c601849e47f159efe839413ac40292042c75f78b1ffd43d976ffc8615ed1ade575aba1e8b8a01fb299ac0cf2265e122cbb509c2dd497f3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
Hanami Command Line Interface
|
4
4
|
|
5
|
+
## v2.2.0 - 2024-11-05
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- [Kyle Plump] Add `--gateway` optiopn to `generate relation` (#261)
|
10
|
+
- [Tim Riley] Depend on stable release of dry-operation in new app `Gemfile` (#262)
|
11
|
+
- [Tim Riley] Depend on newser dry-types with a simpler version constraint in new app `Gemfile` (#263)
|
12
|
+
- [Adam Lassek] Point to Hanami's own migrations guide from generated migration files (#264)
|
13
|
+
|
5
14
|
## v2.2.0.rc1 - 2024-10-29
|
6
15
|
|
7
16
|
### Added
|
@@ -15,10 +15,10 @@ module Hanami
|
|
15
15
|
option :slice, required: false, desc: "Slice name"
|
16
16
|
|
17
17
|
example [
|
18
|
-
%(
|
19
|
-
%(
|
20
|
-
%(
|
21
|
-
%(
|
18
|
+
%(isbn_decoder (MyApp::IsbnDecoder)),
|
19
|
+
%(recommenders.fiction (MyApp::Recommenders::Fiction)),
|
20
|
+
%(isbn_decoder --slice=admin (Admin::IsbnDecoder)),
|
21
|
+
%(Exporters::Complete::CSV (MyApp::Exporters::Complete::CSV)),
|
22
22
|
]
|
23
23
|
attr_reader :generator
|
24
24
|
private :generator
|
@@ -9,11 +9,13 @@ module Hanami
|
|
9
9
|
# @api private
|
10
10
|
class Relation < Command
|
11
11
|
argument :name, required: true, desc: "Relation name"
|
12
|
+
option :gateway, desc: "Generate relation for gateway"
|
12
13
|
|
13
14
|
example [
|
14
15
|
%(books (MyApp::Relation::Book)),
|
15
16
|
%(books/drafts (MyApp::Relations::Books::Drafts)),
|
16
17
|
%(books --slice=admin (Admin::Relations::Books)),
|
18
|
+
%(books --slice=admin --gateway=extra (Admin::Relations::Books)),
|
17
19
|
]
|
18
20
|
|
19
21
|
# @since 2.2.0
|
@@ -21,6 +23,24 @@ module Hanami
|
|
21
23
|
def generator_class
|
22
24
|
Generators::App::Relation
|
23
25
|
end
|
26
|
+
|
27
|
+
def call(name:, slice: nil, gateway: nil)
|
28
|
+
if slice
|
29
|
+
generator.call(
|
30
|
+
key: name,
|
31
|
+
namespace: slice,
|
32
|
+
base_path: fs.join("slices", inflector.underscore(slice)),
|
33
|
+
gateway: gateway
|
34
|
+
)
|
35
|
+
else
|
36
|
+
generator.call(
|
37
|
+
key: name,
|
38
|
+
namespace: app.namespace,
|
39
|
+
base_path: "app",
|
40
|
+
gateway: gateway
|
41
|
+
)
|
42
|
+
end
|
43
|
+
end
|
24
44
|
end
|
25
45
|
end
|
26
46
|
end
|
@@ -55,7 +55,7 @@ module Hanami
|
|
55
55
|
ROM::SQL.migration do
|
56
56
|
# Add your migration here.
|
57
57
|
#
|
58
|
-
# See https://
|
58
|
+
# See https://guides.hanamirb.org/v2.2/database/migrations/ for details.
|
59
59
|
change do
|
60
60
|
end
|
61
61
|
end
|
@@ -19,8 +19,11 @@ module Hanami
|
|
19
19
|
|
20
20
|
# @since 2.2.0
|
21
21
|
# @api private
|
22
|
-
def call(key:, namespace:, base_path:)
|
22
|
+
def call(key:, namespace:, base_path:, gateway:)
|
23
23
|
schema_name = key.split(KEY_SEPARATOR).last
|
24
|
+
body_content = ["schema :#{schema_name}, infer: true"]
|
25
|
+
|
26
|
+
body_content.prepend("gateway :#{gateway}") if gateway
|
24
27
|
|
25
28
|
RubyFileWriter.new(
|
26
29
|
fs: fs,
|
@@ -31,7 +34,7 @@ module Hanami
|
|
31
34
|
base_path: base_path,
|
32
35
|
extra_namespace: "Relations",
|
33
36
|
relative_parent_class: "DB::Relation",
|
34
|
-
body:
|
37
|
+
body: body_content,
|
35
38
|
)
|
36
39
|
end
|
37
40
|
|
@@ -14,8 +14,8 @@ source "https://rubygems.org"
|
|
14
14
|
<%= hanami_gem("validations") %>
|
15
15
|
<%= hanami_gem("view") %>
|
16
16
|
|
17
|
-
gem "dry-types", "~> 1.
|
18
|
-
gem "dry-operation"
|
17
|
+
gem "dry-types", "~> 1.7"
|
18
|
+
gem "dry-operation"
|
19
19
|
gem "puma"
|
20
20
|
gem "rake"
|
21
21
|
<%- if generate_sqlite? -%>
|
data/lib/hanami/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.0
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|