proscenium 0.22.7 → 0.23.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: 833310e2c7baf939a7a645e834c305ba313588c61d2de15ae6a53a0550868fe4
4
- data.tar.gz: ae4c28be7b5d284dd1ed8a374ace89b1bff10662ec3b89d5994f424f38412dcd
3
+ metadata.gz: 27ae49cf9cbd0d570911f008936dd3e4e999c4f2202d918ec18a9e260034f6fb
4
+ data.tar.gz: 5b595fd86167552c6a285d7fc4eab69ad9fade2cbf2ee203d1d763444172b075
5
5
  SHA512:
6
- metadata.gz: 50878e106ecbbb6db2de077dc9d9d1758b82ef7416dffb4573af1c6203a4dd01069689f96e8c48a9e907c3a4752423f36beca9e334ddddb4d7abfa6415f84575
7
- data.tar.gz: 73427a00493b4d883d78a30bc260d68d82bdcd9009326a05a53fec995dbb56034da92c364352009a54910b0bf401842e02569ca53074f957cf738676efcc0656
6
+ metadata.gz: a319a36456cae9e28367b0650c5cb65db30b4ee9c6b58eb8cdbca82f319613fb291a6c77a7d58efb461efd7ae5fe06b428f74e787a2333f3479ebee54c589313
7
+ data.tar.gz: 0f119f606962d38a02e29efb7b32016901f75fa78da15f1c0684ce8617302b4b518c7b158b7347a1e9de586bb27c164672bf457317ddcc71d549eecb6d464224
Binary file
@@ -27,34 +27,41 @@ module Proscenium
27
27
  def import(filepath = nil, sideloaded: false, **)
28
28
  self.imported ||= {}
29
29
 
30
- return if self.imported.key?(filepath)
31
-
32
30
  digest = nil
33
31
 
34
32
  if filepath.end_with?('.module.css')
35
- manifest_path, non_manifest_path, abs_path = Resolver.resolve(filepath, as_array: true)
36
- digest = Utils.css_module_digest(abs_path)
37
- filepath = Array(manifest_path || non_manifest_path)[0]
33
+ if self.imported.key?(filepath)
34
+ digest = self.imported[filepath][:digest]
35
+ abs_path = self.imported[filepath][:abs_path]
36
+ else
37
+ manifest_path, non_manifest_path, abs_path = Resolver.resolve(filepath, as_array: true)
38
+ digest = Utils.css_module_digest(abs_path)
39
+ filepath = Array(manifest_path || non_manifest_path)[0]
38
40
 
39
- if sideloaded
40
- ActiveSupport::Notifications.instrument 'sideload.proscenium', identifier: filepath,
41
- sideloaded: do
41
+ if sideloaded
42
+ ActiveSupport::Notifications.instrument 'sideload.proscenium', identifier: filepath,
43
+ sideloaded: do
44
+ self.imported[filepath] = { ** }
45
+ self.imported[filepath][:digest] = digest
46
+ self.imported[filepath][:abs_path] = abs_path
47
+ end
48
+ else
42
49
  self.imported[filepath] = { ** }
43
50
  self.imported[filepath][:digest] = digest
51
+ self.imported[filepath][:abs_path] = abs_path
44
52
  end
45
- else
46
- self.imported[filepath] = { ** }
47
- self.imported[filepath][:digest] = digest
48
53
  end
49
54
 
50
55
  transformed_path = ''
51
- if !Rails.env.production?
56
+ if Proscenium.config.debug || Rails.env.development?
52
57
  rel_path = Pathname.new(abs_path).relative_path_from(Rails.root).sub_ext('')
53
58
  transformed_path = "_#{rel_path.to_s.gsub(%r{[@/.+]}, '-')}"
54
59
  end
55
60
 
56
61
  "#{digest}#{transformed_path}"
57
62
  else
63
+ return if self.imported.key?(filepath)
64
+
58
65
  Array(Resolver.resolve(filepath)).each do |fp|
59
66
  if sideloaded
60
67
  ActiveSupport::Notifications.instrument 'sideload.proscenium', identifier: fp,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.22.7'
4
+ VERSION = '0.23.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.7
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-14 00:00:00.000000000 Z
11
+ date: 2026-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi