tapioca 0.11.10 → 0.11.12

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: dd1124c2c3feac470d361a45577dc6384e85873e93f19a2bea4eb91b01da593c
4
- data.tar.gz: 0d6a664089314ff666abd93615dae440274af183b0a7ef2d60035cee73299de9
3
+ metadata.gz: c9bce9a6dcef31e80f1933bbc3528bf2d8c1328ec4c129b3d9609c8c053e095f
4
+ data.tar.gz: af1d5587e075471824d7c29fc5f90cae50ed1e401a21549fa8a2a2c6e390c158
5
5
  SHA512:
6
- metadata.gz: b599a8e5a0dbee29e0e64ff458eb7a6e7c85c3beb0ffae20ae3487fb1d080714e80490d0e0c089bc32ab9dd33670901692396fc2d25c2064d0ab8012158dbb4b
7
- data.tar.gz: b2a58b28c77a0b33c9f83f48f2663c106b9dc465ae137c6f71ac04601dbf3ec63ca8c6b7fde45820577c2d0bd237a65ce07a45f440195b5514a20614f33e80e5
6
+ metadata.gz: e25d29263e331bc34f67f46a9dd09629ab9cba280db30fe9c8e15679325162583908760b5e163dae09c269edad870c76916dd3195dbc066186c1952cf346acc2
7
+ data.tar.gz: 5add77a326f6a60a3f4b8c435b9b0d38e90d117e888aedcc1d48a15bded3c0d7c556a7d6c187020ac35e44709580e7bd9b53813e86cc78259ac9ca5c666561bc
@@ -28,7 +28,7 @@ module Tapioca
28
28
  type_for_constant(Float)
29
29
  when GraphQL::Types::ID.singleton_class, GraphQL::Types::String.singleton_class
30
30
  type_for_constant(String)
31
- when GraphQL::Types::Int.singleton_class
31
+ when GraphQL::Types::Int.singleton_class, GraphQL::Types::BigInt.singleton_class
32
32
  type_for_constant(Integer)
33
33
  when GraphQL::Types::ISO8601Date.singleton_class
34
34
  type_for_constant(Date)
@@ -45,6 +45,16 @@ module Tapioca
45
45
  else
46
46
  "T.any(#{value_types.join(", ")})"
47
47
  end
48
+ when GraphQL::Schema::Scalar.singleton_class
49
+ method = Runtime::Reflection.method_of(unwrapped_type, :coerce_input)
50
+ signature = Runtime::Reflection.signature_of(method)
51
+ return_type = signature&.return_type
52
+
53
+ if return_type && !(T::Private::Types::Void === return_type || T::Private::Types::NotTyped === return_type)
54
+ return_type.to_s
55
+ else
56
+ "T.untyped"
57
+ end
48
58
  when GraphQL::Schema::InputObject.singleton_class
49
59
  type_for_constant(unwrapped_type)
50
60
  when Module
@@ -120,6 +120,7 @@ module Tapioca
120
120
  "sorbet-runtime",
121
121
  "sorbet-static-and-runtime",
122
122
  "debug",
123
+ "irb",
123
124
  "fakefs",
124
125
  ].freeze,
125
126
  T::Array[String],
@@ -80,8 +80,6 @@ module Tapioca
80
80
  def load_rails_engines
81
81
  return if engines.empty?
82
82
 
83
- normalize_eager_load_paths_configuration!
84
-
85
83
  with_rails_application do
86
84
  run_initializers
87
85
 
@@ -112,7 +110,7 @@ module Tapioca
112
110
  autoloader = Zeitwerk::Loader.new
113
111
 
114
112
  engines.each do |engine|
115
- engine.config.all_eager_load_paths.each do |path|
113
+ eager_load_paths(engine).each do |path|
116
114
  # Zeitwerk only accepts existing directories in `push_dir`.
117
115
  next unless File.directory?(path)
118
116
  # We should not add directories that are already managed by a Zeitwerk loader.
@@ -133,7 +131,7 @@ module Tapioca
133
131
  # We can't use `Rails::Engine#eager_load!` directly because it will raise as soon as it encounters
134
132
  # an error, which is not what we want. We want to try to load as much as we can.
135
133
  engines.each do |engine|
136
- engine.config.all_eager_load_paths.each do |load_path|
134
+ eager_load_paths(engine).each do |load_path|
137
135
  Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
138
136
  require_dependency file
139
137
  end
@@ -181,19 +179,6 @@ module Tapioca
181
179
  .reject { |engine| gem_in_app_dir?(project_path, engine.config.root.to_path) }
182
180
  end
183
181
 
184
- # Rails 7.2 renamed `eager_load_paths` to `all_eager_load_paths`, which maintains the same original functionality.
185
- # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some
186
- # engine paths. The following commit is the change:
187
- # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
188
- #
189
- # Here we make sure that the new `all_eager_load_paths` is always defined for every Rails version below 7.2, so
190
- # that we can use it everywhere
191
- def normalize_eager_load_paths_configuration!
192
- return if Rails::VERSION::MAJOR >= 7 && Rails::VERSION::MINOR >= 2
193
-
194
- engines.each { |e| e.config.all_eager_load_paths = e.config.eager_load_paths }
195
- end
196
-
197
182
  sig { params(path: String).void }
198
183
  def safe_require(path)
199
184
  require path
@@ -239,6 +224,17 @@ module Tapioca
239
224
 
240
225
  require(file)
241
226
  end
227
+
228
+ # Rails 7.2 renamed `eager_load_paths` to `all_eager_load_paths`, which maintains the same original functionality.
229
+ # The `eager_load_paths` method still exists, but doesn't return all paths anymore and causes Tapioca to miss some
230
+ # engine paths. The following commit is the change:
231
+ # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
232
+ sig { params(engine: T.class_of(Rails::Engine)).returns(T::Array[String]) }
233
+ def eager_load_paths(engine)
234
+ config = engine.config
235
+
236
+ (config.respond_to?(:all_eager_load_paths) && config.all_eager_load_paths) || config.eager_load_paths
237
+ end
242
238
  end
243
239
  end
244
240
  end
@@ -27,7 +27,15 @@ module Tapioca
27
27
 
28
28
  return Set.new unless gem_engine
29
29
 
30
- paths = gem_engine.config.all_eager_load_paths.flat_map do |load_path|
30
+ # https://github.com/rails/rails/commit/ebfca905db14020589c22e6937382e6f8f687664
31
+ config = gem_engine.config
32
+ eager_load_paths = if config.respond_to?(:all_eager_load_paths)
33
+ config.all_eager_load_paths
34
+ else
35
+ config.eager_load_paths
36
+ end
37
+
38
+ paths = eager_load_paths.flat_map do |load_path|
31
39
  Pathname.glob("#{load_path}/**/*.rb")
32
40
  end
33
41
 
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Tapioca
5
- VERSION = "0.11.10"
5
+ VERSION = "0.11.12"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tapioca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.10
4
+ version: 0.11.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ufuk Kayserilioglu
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2023-10-31 00:00:00.000000000 Z
14
+ date: 2023-11-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -59,22 +59,22 @@ dependencies:
59
59
  name: rbi
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
63
- - !ruby/object:Gem::Version
64
- version: 0.1.0
65
62
  - - ">="
66
63
  - !ruby/object:Gem::Version
67
- version: 0.1.0
64
+ version: 0.1.4
65
+ - - "<"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.2'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.1.0
75
72
  - - ">="
76
73
  - !ruby/object:Gem::Version
77
- version: 0.1.0
74
+ version: 0.1.4
75
+ - - "<"
76
+ - !ruby/object:Gem::Version
77
+ version: '0.2'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: sorbet-static-and-runtime
80
80
  requirement: !ruby/object:Gem::Requirement