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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6ace925a2c5186088911d5df3d309d72ee0359e4691f70199c3f53f99db0fc3
4
- data.tar.gz: 7fd1959ffcaf64ebc0b95a839a68ed1f052370ed6a7043863068087a1893489d
3
+ metadata.gz: af8c95d39ccda17c32851a787f8ef309b6af8936d1bb1eca4780a8f57969af66
4
+ data.tar.gz: a4aff54793a12526acf3919a16657fea36d496645fad596f2d214f3baf00e974
5
5
  SHA512:
6
- metadata.gz: 6133308e48b0623616598a23d1b0fe079b08f31e991791e6ae76867441eec1d25427deef5755e445fd8c3f2f2e294c143eeb58272e278721897ab290c48024cb
7
- data.tar.gz: '068ad2b891fa99e16ff6c0be6931e98d708ce3c7bab67e0dd3fd354ef00f4bdb110ad84007592ccc98e65ebbe643f7e4420b0406f8b0b76500968a5571718398'
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
- %(operations.create_user (MyApp::Operations::CreateUser)),
19
- %(operations.user.create (MyApp::Operations::Create::User)),
20
- %(operations.create_user --slice=admin (Admin::Operations::CreateUser)),
21
- %(Operations::CreateUser (MyApp::Operations::CreateUser)),
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
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "erb"
4
4
  require "dry/files"
5
+
5
6
  module Hanami
6
7
  module CLI
7
8
  module Generators
@@ -55,7 +55,7 @@ module Hanami
55
55
  ROM::SQL.migration do
56
56
  # Add your migration here.
57
57
  #
58
- # See https://sequel.jeremyevans.net/rdoc/files/doc/migration_rdoc.html for details.
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: ["schema :#{schema_name}, infer: true"],
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.0", ">= 1.6.1"
18
- gem "dry-operation", github: "dry-rb/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? -%>
@@ -6,6 +6,6 @@ module Hanami
6
6
  #
7
7
  # @api public
8
8
  # @since 2.0.0
9
- VERSION = "2.2.0.rc1"
9
+ VERSION = "2.2.0"
10
10
  end
11
11
  end
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.rc1
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-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler