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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ddd4cdea781d69ee2a7201e5a1790b2d301e7b4594676062694e21b70ad0ccb
4
- data.tar.gz: 7e5896931aba1f74b73f536fac8d17008e969c4867aa331334606e56cc26575c
3
+ metadata.gz: ede229bcbb60f79ae3891cba29f839c6e5737a541dbd2d1c26f6be3378674b8c
4
+ data.tar.gz: 6539d5195412dea23c96267f80ede29ff192a2b9e8864ffee8b8593551ab7dfc
5
5
  SHA512:
6
- metadata.gz: '058e840d95cb4860d469f116e316f97d7ee624c8c7b5160bd77d36ce8f34b686d519187652a508d177853030d625ac120fc4e6c09d4805a64ac56818757e9030'
7
- data.tar.gz: c08fcd9435a1529a84ef8a7c1be7ca020bc4678aefe109fbe1772a50a4caf988043383ff8092533fa7aa3ee1418fb3d29b96381cbbd7f3d3d887c2a640a6bff0
6
+ metadata.gz: b47257331e75255363278cb2d689e80fe931e71221a69b93e798bd9fd091b112b064fcdc27da775231272ed77cc08551f17ecad8324315ca4a7d3f4e17c32c59
7
+ data.tar.gz: a0cb7fae99758703b4985eb10702b059a6774b763d682ffeb59a1fb0ac69b440260a779a790a2b39d433b6bcce0a464d650c3f58221e4bab30459586643729cb
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module SorbetView
5
- VERSION = '0.13.0'
5
+ VERSION = '0.14.0'
6
6
  end
@@ -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 { |result| output_manager.write(result) }
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}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuma