react-manifest-rails 0.2.27 → 0.2.28

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: 95a89b37c1332d074e881e5676c346540b069ecbeafc7dd42526ce53f24a0285
4
- data.tar.gz: e351a53101a5b3c91f31e8fd9279e221fd0a345c56d7f6d003ca5a6d5280624f
3
+ metadata.gz: 6153beb7645daac936d839aff620b863726d7689b179e1800b2fdff008005b84
4
+ data.tar.gz: 66aa7e569b4dda47e88401903c45ce29785d792f6bd4441e7e197f5869c2a5af
5
5
  SHA512:
6
- metadata.gz: 5fa34a6989ccedc7a1b459e3ba68365ec16c82606069c319c7c093d7440cfe4a7e223a4e617e4b25fa1f4b5ab345c73e80fd2f0e0d12d0773121d5221cb2aefa
7
- data.tar.gz: eb604c20d10c84b9bf0abd6091e346eed18cb05063d88de4f1f8ec8e034dfe399db51c3c66d4ca0d7f8d67e9f1e57cc0c84823804c5da45e5d04e23467a4b55b
6
+ metadata.gz: 580ee8eb2684d6c344b7d1296ad5057cc08ffb3ce7ffded990ed3b90cd068e253929eb89512b80367d51a01b01d663130c4ee268dc073e71305867e042b5a47d
7
+ data.tar.gz: e0773a33f8b3fdda718199402b377e2a93bb0777970e43e031ebea9f14f4d1e5cdb0c8e54d3e3326ee8a47a3367c392b962a90ca629ccb80e5e71465ee220a5f
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.28] - 2026-05-11
11
+
12
+ ### Fixed
13
+ - Boot generation now runs after app initializers (`config/initializers/`) have loaded, so the generator always uses the fully-configured `ux_root` and related settings. Previously the initializer ran during the Railtie phase (before `config/initializers/`), causing it to silently generate against default paths and produce unchanged manifests.
14
+
10
15
  ## [0.2.27] - 2026-05-11
11
16
 
12
17
  ### Fixed
@@ -3,28 +3,23 @@ require "rails/railtie"
3
3
  module ReactManifest
4
4
  class Railtie < Rails::Railtie
5
5
  # ----------------------------------------------------------------
6
- # In development, generate once on boot if expected manifests are missing.
7
- # This makes first-run setup deterministic even before any file change event.
6
+ # In development, always regenerate manifests on boot so that files
7
+ # added between restarts (e.g. via git merge) are picked up immediately.
8
+ # The generator is idempotent — it skips writes when content is unchanged.
8
9
  # ----------------------------------------------------------------
9
- initializer "react_manifest.ensure_manifests" do
10
+ initializer "react_manifest.ensure_manifests", after: :load_config_initializers do
10
11
  next unless Rails.env.development?
11
12
 
12
13
  config = ReactManifest.configuration
13
- # Private class method: call via send from the initializer instance context.
14
- missing = self.class.send(:missing_manifest_bundles, config)
15
- next if missing.empty?
16
-
17
- message = "[ReactManifest] Missing manifests on boot: #{missing.join(', ')}. Generating now..."
18
- Rails.logger&.info(message)
19
- $stdout.puts(message) if config.stdout_logging?
20
14
 
21
15
  begin
22
16
  results = ReactManifest::Generator.new(config).run!
23
17
  written = results.count { |r| r[:status] == :written }
24
- unchanged = results.count { |r| r[:status] == :unchanged }
25
- done = "[ReactManifest] Boot generation complete: #{written} written, #{unchanged} unchanged"
26
- Rails.logger&.info(done)
27
- $stdout.puts(done) if config.stdout_logging?
18
+ if written.positive?
19
+ done = "[ReactManifest] Boot generation complete: #{written} written"
20
+ Rails.logger&.info(done)
21
+ $stdout.puts(done) if config.stdout_logging?
22
+ end
28
23
  rescue StandardError => e
29
24
  error = "[ReactManifest] Could not generate manifests on boot: #{e.message}"
30
25
  Rails.logger&.warn(error)
@@ -99,21 +94,5 @@ module ReactManifest
99
94
  Rake::Task["assets:precompile"].enhance(["react_manifest:generate"])
100
95
  end
101
96
  end
102
-
103
- class << self
104
- private
105
-
106
- def missing_manifest_bundles(config)
107
- expected_manifest_bundles(config).reject do |bundle_name|
108
- File.exist?(File.join(config.abs_manifest_dir, "#{bundle_name}.js")) ||
109
- File.exist?(File.join(config.abs_output_dir, "#{bundle_name}.js"))
110
- end
111
- end
112
-
113
- def expected_manifest_bundles(config)
114
- classification = ReactManifest::TreeClassifier.new(config).classify
115
- ([config.shared_bundle] + classification.controller_dirs.map { |ctrl| ctrl[:bundle_name] }).uniq
116
- end
117
- end
118
97
  end
119
98
  end
@@ -1,3 +1,3 @@
1
1
  module ReactManifest
2
- VERSION = "0.2.27".freeze
2
+ VERSION = "0.2.28".freeze
3
3
  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.27
4
+ version: 0.2.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Noonan