react-manifest-rails 0.2.33 → 0.2.34

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.
@@ -1,3 +1,3 @@
1
1
  module ReactManifest
2
- VERSION = "0.2.33".freeze
2
+ VERSION = "0.2.34".freeze
3
3
  end
@@ -163,13 +163,16 @@ module ReactManifest
163
163
  bundle_name = ctrl[:bundle_name]
164
164
  files = js_files_in_controller(ctrl[:path], config)
165
165
  bundle_files[bundle_name].concat(files)
166
+ isolated = config.isolated_app_dirs.include?(ctrl[:name])
166
167
 
167
168
  files.each do |file_path|
168
169
  extract_defined_symbols(file_path).each do |symbol|
169
170
  next unless symbol.match?(/\A[A-Z][A-Za-z0-9_]*\z/)
170
171
 
171
172
  # Keep first writer to ensure deterministic behavior if a symbol is duplicated.
172
- symbol_to_bundle[symbol] ||= bundle_name
173
+ # Isolated dirs never register into the shared symbol index (see
174
+ # Generator#build_controller_context for the full rationale).
175
+ symbol_to_bundle[symbol] ||= bundle_name unless isolated
173
176
  bundle_own_symbols[bundle_name] << symbol
174
177
  end
175
178
  end
@@ -211,14 +214,14 @@ module ReactManifest
211
214
 
212
215
  def extract_defined_symbols(file_path)
213
216
  content = File.read(file_path, encoding: "utf-8")
214
- SymbolExtractor.extract_definitions(content)
217
+ SymbolExtractor.extract_definitions(content, file_path: file_path)
215
218
  rescue Errno::ENOENT, Errno::EACCES, Encoding::InvalidByteSequenceError
216
219
  []
217
220
  end
218
221
 
219
222
  def extract_used_component_symbols(file_path)
220
223
  content = File.read(file_path, encoding: "utf-8")
221
- SymbolExtractor.extract_usages(content)
224
+ SymbolExtractor.extract_usages(content, file_path: file_path)
222
225
  rescue Errno::ENOENT, Errno::EACCES, Encoding::InvalidByteSequenceError
223
226
  []
224
227
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-manifest-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.33
4
+ version: 0.2.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan
@@ -119,6 +119,20 @@ dependencies:
119
119
  - - "~>"
120
120
  - !ruby/object:Gem::Version
121
121
  version: '3.0'
122
+ - !ruby/object:Gem::Dependency
123
+ name: mini_racer
124
+ requirement: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ type: :development
130
+ prerelease: false
131
+ version_requirements: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
122
136
  description: |
123
137
  react-manifest-rails automatically generates per-controller Sprockets manifest
124
138
  files for Rails applications using react-rails + Sprockets. It eliminates the
@@ -137,6 +151,7 @@ files:
137
151
  - lib/react_manifest.rb
138
152
  - lib/react_manifest/application_analyzer.rb
139
153
  - lib/react_manifest/application_migrator.rb
154
+ - lib/react_manifest/ast_extractor.rb
140
155
  - lib/react_manifest/configuration.rb
141
156
  - lib/react_manifest/dependency_map.rb
142
157
  - lib/react_manifest/generator.rb
@@ -149,6 +164,11 @@ files:
149
164
  - lib/react_manifest/sprockets_manifest_patcher.rb
150
165
  - lib/react_manifest/symbol_extractor.rb
151
166
  - lib/react_manifest/tree_classifier.rb
167
+ - lib/react_manifest/vendor/ast_extractor.js
168
+ - lib/react_manifest/vendor/build/README.md
169
+ - lib/react_manifest/vendor/build/entry.js
170
+ - lib/react_manifest/vendor/build/package-lock.json
171
+ - lib/react_manifest/vendor/build/package.json
152
172
  - lib/react_manifest/version.rb
153
173
  - lib/react_manifest/view_helpers.rb
154
174
  - lib/react_manifest/watcher.rb