sorbet_view 0.13.0 → 0.14.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
- data/lib/sorbet_view/version.rb +1 -1
- data/lib/tapioca/dsl/compilers/sorbet_view.rb +11 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ede229bcbb60f79ae3891cba29f839c6e5737a541dbd2d1c26f6be3378674b8c
|
|
4
|
+
data.tar.gz: 6539d5195412dea23c96267f80ede29ff192a2b9e8864ffee8b8593551ab7dfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b47257331e75255363278cb2d689e80fe931e71221a69b93e798bd9fd091b112b064fcdc27da775231272ed77cc08551f17ecad8324315ca4a7d3f4e17c32c59
|
|
7
|
+
data.tar.gz: a0cb7fae99758703b4985eb10702b059a6774b763d682ffeb59a1fb0ac69b440260a779a790a2b39d433b6bcce0a464d650c3f58221e4bab30459586643729cb
|
data/lib/sorbet_view/version.rb
CHANGED
|
@@ -151,18 +151,28 @@ module Tapioca
|
|
|
151
151
|
config = ::SorbetView::Configuration.load
|
|
152
152
|
compiler = ::SorbetView::Compiler::TemplateCompiler.new(config: config)
|
|
153
153
|
output_manager = ::SorbetView::FileSystem::OutputManager.new(config.output_dir)
|
|
154
|
+
compiled_ruby_paths = Set.new
|
|
154
155
|
|
|
155
156
|
templates = ::SorbetView::FileSystem::ProjectScanner.scan(config)
|
|
156
157
|
templates.each do |path|
|
|
157
158
|
result = compiler.compile_file(path)
|
|
158
159
|
output_manager.write(result)
|
|
160
|
+
compiled_ruby_paths << result.source_map.ruby_path
|
|
159
161
|
end
|
|
160
162
|
|
|
161
163
|
component_compiler = ::SorbetView::Compiler::ComponentCompiler.new(config: config)
|
|
162
164
|
components = ::SorbetView::FileSystem::ProjectScanner.scan_components(config)
|
|
163
165
|
components.each do |path|
|
|
164
166
|
results = component_compiler.compile_file(path)
|
|
165
|
-
results.each
|
|
167
|
+
results.each do |result|
|
|
168
|
+
output_manager.write(result)
|
|
169
|
+
compiled_ruby_paths << result.source_map.ruby_path
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Clean stale compiled files
|
|
174
|
+
Dir.glob(File.join(config.output_dir, '**', '*.rb')).each do |f|
|
|
175
|
+
File.delete(f) unless compiled_ruby_paths.include?(f)
|
|
166
176
|
end
|
|
167
177
|
rescue StandardError => e
|
|
168
178
|
$stderr.puts "[SorbetView] compile_all_templates failed: #{e.class}: #{e.message}"
|