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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/react_manifest/railtie.rb +9 -30
- data/lib/react_manifest/version.rb +1 -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: 6153beb7645daac936d839aff620b863726d7689b179e1800b2fdff008005b84
|
|
4
|
+
data.tar.gz: 66aa7e569b4dda47e88401903c45ce29785d792f6bd4441e7e197f5869c2a5af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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,
|
|
7
|
-
#
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|