andromeda_cms 0.6.0 → 0.6.2

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: 3e28cb7d39787447bf6360e6bfc15477843f77cdab11b1fad64b47cc17be65b2
4
- data.tar.gz: bd742b08aaf8ddb578cbb3b0417433c6c399e74b99484bbbde059c76037e6704
3
+ metadata.gz: 64670cf71e6544d5427eeb01b7fbd90eda3a717dbb28379dd836df5662d24563
4
+ data.tar.gz: 7966c38ad14347e3161f3a8f7018daa5438dddb00aacfee099e9d2c014e500d9
5
5
  SHA512:
6
- metadata.gz: '09057949a55b6029eab67c488989e6a7f4cfd14d67468b7517a07b3eddfbcbd70a2bf1118c5daaaec7663a5a62387efefd0a560315bf640d869221976098f55c'
7
- data.tar.gz: 8d92e0d40e78db9985dceb71ec227c89f02a7fc245102d32521bb6de2d243f375f591ddbbfbd52397d0c62371cb6bb0a9f84fbef22b0d10ed911bf98c7adc4a8
6
+ metadata.gz: b6fe4b7a80ca8828ef6ecfeb77ec1ceb8ec5717df836bd6f68e328adc5e9fdb162e1607d26b92167d7420639874c5a203ea25bcf7325d5952a4acbb1f76b76c3
7
+ data.tar.gz: 5db3fa88aab475e40522a9024d8d22f8887ec106fad290fbfec7b18addb13ab68dba3db3e48e080d43603c3c50a6439e14c6b0fec912ba40a8dba270fae82799
data/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.2] - 2026-10-09
9
+
10
+ ### Fixed
11
+
12
+ - `assets:precompile` no longer leaves out `tailwind.css` when an
13
+ application partial rendered during `andromeda:build` calls `image_tag` or
14
+ `asset_path`. Propshaft caches its file list on the first lookup, so a
15
+ fresh build (an empty `app/assets/builds/`) shipped without the files
16
+ written afterwards and every page raised `Propshaft::MissingAssetError`.
17
+ `andromeda:build` now discards that cache when it finishes, whether or not
18
+ the build succeeds.
19
+
20
+ ## [0.6.1] - 2026-10-09
21
+
22
+ ### Fixed
23
+
24
+ - `assets:precompile` no longer leaves out files written after
25
+ `andromeda:build`, such as `tailwind.css` from `tailwindcss:build`.
26
+ Checking a bare image path asked Propshaft's load path, which caches its
27
+ file list on the first lookup, so a fresh build (an empty
28
+ `app/assets/builds/`) shipped without them and every page raised
29
+ `Propshaft::MissingAssetError`. The check now looks at the files directly.
30
+
8
31
  ## [0.6.0] - 2026-10-08
9
32
 
10
33
  ### Added
@@ -166,6 +189,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
166
189
  - Generators: `andromeda:install`, `andromeda:collection`,
167
190
  `andromeda:component` and `andromeda:import_astro`.
168
191
 
192
+ [0.6.2]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.6.2
193
+ [0.6.1]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.6.1
169
194
  [0.6.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.6.0
170
195
  [0.5.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.5.0
171
196
  [0.4.2]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.2
@@ -76,20 +76,45 @@ module Andromeda
76
76
  # back to a plain /assets path for anything it cannot find, so without
77
77
  # this check a typo only shows up as a 404 in production.
78
78
  #
79
+ # This looks at the files directly instead of calling `load_path.find`:
80
+ # Propshaft memoizes its file list on the first lookup, and the same load
81
+ # path is later used by assets:precompile. Asking it during andromeda:build
82
+ # would hide every file written afterwards (tailwind.css from
83
+ # tailwindcss:build, images copied by `publish`) from the precompile.
84
+ #
79
85
  # @return [Boolean, nil] nil when there is no Propshaft load path to ask
80
86
  # (no asset pipeline, or Sprockets), so callers can skip the check.
81
87
  def exists?(logical_path)
82
88
  load_path = pipeline_load_path
83
89
  return nil if load_path.nil?
84
90
 
85
- !load_path.find(logical_path).nil?
91
+ path = logical_path.to_s
92
+ return false if path.start_with?("/") || path.split("/").include?("..")
93
+ return false if File.basename(path).start_with?(".")
94
+
95
+ load_path.paths.any? { |directory| File.file?(File.join(directory.to_s, path)) }
96
+ end
97
+
98
+ # Discards Propshaft's memoized file list. Propshaft builds it on the first
99
+ # lookup, and app partials rendered during `andromeda:build` can trigger
100
+ # that through `asset_path`. Files written afterwards (tailwind.css from
101
+ # tailwindcss:build, images copied by `publish`) would then be missing from
102
+ # assets:precompile, so the build calls this when it finishes. `clear_cache`
103
+ # is private API; if a Propshaft release renames it, skipping the reset is
104
+ # better than breaking the build.
105
+ def reset_pipeline_cache
106
+ load_path = pipeline_load_path
107
+ return if load_path.nil?
108
+
109
+ load_path.send(:clear_cache) if load_path.respond_to?(:clear_cache, true)
110
+ nil
86
111
  end
87
112
 
88
113
  def pipeline_load_path
89
114
  return nil unless defined?(::Rails) && ::Rails.respond_to?(:application) && ::Rails.application
90
115
 
91
116
  assets = ::Rails.application.assets
92
- assets.respond_to?(:load_path) && assets.load_path.respond_to?(:find) ? assets.load_path : nil
117
+ assets.respond_to?(:load_path) && assets.load_path.respond_to?(:paths) ? assets.load_path : nil
93
118
  rescue StandardError
94
119
  nil
95
120
  end
@@ -210,6 +210,8 @@ module Andromeda
210
210
 
211
211
  results
212
212
  end
213
+ ensure
214
+ Andromeda::Assets.reset_pipeline_cache
213
215
  end
214
216
 
215
217
  def self.default_entry_classes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Andromeda
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: andromeda_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LIMHAUS Inc.