proscenium 0.22.1-x86_64-linux → 0.22.3-x86_64-linux

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: 89a3b3c57c117f57579a301ba8e137e9d3c1bc328dbde17744dbf83a0044698e
4
- data.tar.gz: 04be1d48ae1a314fdd7bff6e24f418d2bcab73608544df7ad407a6826e5a9f5f
3
+ metadata.gz: fecf2b97a7604dab567f331b9293d66b192fc8fd16c700a07a2f709f4a9248a8
4
+ data.tar.gz: ad94a7bb10bae3aef5900b1b61d6152e8ec869316fc92e930a394a974d5e1e90
5
5
  SHA512:
6
- metadata.gz: 765ac1842f9ecfc6552b49912538512f3639d410e961325020db5cb7bcf92487e7e224a59457c321c683b727492afa69539d93d136522999965bf8f6567e7397
7
- data.tar.gz: 46c6b9d0d018b2f3e8e4891adc3251902b75b996d9ba3b099a37d09931be4a74e463a35b28874e6b9ffdfcc8501d71ed3bcad2a44fc6a743d4fdcea3edb589c6
6
+ metadata.gz: c0d24a29259ccb5f2e8e64041b2ce0bfaecdac75d53f9d0ccc336507af24cd3c00ffa2eedab4dfe5e53cec94afc5d61d769dc8b68f9e1964ad793b7ca2d45b87
7
+ data.tar.gz: 28c1ef751beacc5ef618f39f8c597d412b04228a9ec7d7027f85c601169ecf11505da90ed3a43642ad519d5e663200836965cd05a17481869552d654bc4e500d
@@ -66,11 +66,15 @@ module Proscenium
66
66
  raise Proscenium::CssModule::TransformError.new(original_name, 'CSS module path not given')
67
67
  end
68
68
 
69
- resolved_path = Resolver.resolve(path.to_s)
70
- digest = Importer.import(resolved_path)
69
+ manifest_path, non_manifest_path = Resolver.resolve(path.to_s, as_array: true)
70
+ digest = Importer.import(manifest_path || non_manifest_path, digest: lambda {
71
+ Utils.digest non_manifest_path
72
+ })
71
73
 
72
74
  transformed_path = ''
73
- transformed_path = "__#{resolved_path[1..].gsub(%r{[@/.+]}, '-')}" if Rails.env.development?
75
+ if Rails.env.development?
76
+ transformed_path = "__#{non_manifest_path[1..].gsub(%r{[@/.+]}, '-')}"
77
+ end
74
78
  transformed_name = name.to_s
75
79
  transformed_name = if transformed_name.start_with?('_')
76
80
  "_#{transformed_name[1..]}-#{digest}#{transformed_path}"
@@ -78,7 +82,7 @@ module Proscenium
78
82
  "#{transformed_name}-#{digest}#{transformed_path}"
79
83
  end
80
84
 
81
- [transformed_name, resolved_path]
85
+ [transformed_name, non_manifest_path]
82
86
  end
83
87
  end
84
88
  end
Binary file
@@ -12,6 +12,8 @@
12
12
 
13
13
  #ifndef GO_CGO_GOSTRING_TYPEDEF
14
14
  typedef struct { const char *p; ptrdiff_t n; } _GoString_;
15
+ extern size_t _GoStringLen(_GoString_ s);
16
+ extern const char *_GoStringPtr(_GoString_ s);
15
17
  #endif
16
18
 
17
19
  #endif
@@ -57,10 +59,16 @@ typedef size_t GoUintptr;
57
59
  typedef float GoFloat32;
58
60
  typedef double GoFloat64;
59
61
  #ifdef _MSC_VER
62
+ #if !defined(__cplusplus) || _MSVC_LANG <= 201402L
60
63
  #include <complex.h>
61
64
  typedef _Fcomplex GoComplex64;
62
65
  typedef _Dcomplex GoComplex128;
63
66
  #else
67
+ #include <complex>
68
+ typedef std::complex<float> GoComplex64;
69
+ typedef std::complex<double> GoComplex128;
70
+ #endif
71
+ #else
64
72
  typedef float _Complex GoComplex64;
65
73
  typedef double _Complex GoComplex128;
66
74
  #endif
@@ -87,7 +95,7 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
87
95
  extern "C" {
88
96
  #endif
89
97
 
90
- extern void reset_config();
98
+ extern void reset_config(void);
91
99
 
92
100
  // Build the given `path` using the `config`.
93
101
  //
@@ -28,18 +28,26 @@ module Proscenium
28
28
  self.imported ||= {}
29
29
 
30
30
  filepath = "/node_modules/#{filepath}" if filepath.start_with?('@rubygems/')
31
- css_module = filepath.end_with?('.module.css')
31
+ css_module = filepath.match?(/\.module(-\$[a-z0-9]+\$)?\.css$/i)
32
32
 
33
33
  unless self.imported.key?(filepath)
34
34
  if sideloaded
35
35
  ActiveSupport::Notifications.instrument 'sideload.proscenium', identifier: filepath,
36
36
  sideloaded: do
37
37
  self.imported[filepath] = { ** }
38
- self.imported[filepath][:digest] = Utils.digest(filepath) if css_module
38
+ self.imported[filepath][:digest] ||= Utils.digest(filepath) if css_module
39
+
40
+ if self.imported[filepath][:digest].is_a?(Proc)
41
+ self.imported[filepath][:digest] = self.imported[filepath][:digest].call
42
+ end
39
43
  end
40
44
  else
41
45
  self.imported[filepath] = { ** }
42
- self.imported[filepath][:digest] = Utils.digest(filepath) if css_module
46
+ self.imported[filepath][:digest] ||= Utils.digest(filepath) if css_module
47
+
48
+ if self.imported[filepath][:digest].is_a?(Proc)
49
+ self.imported[filepath][:digest] = self.imported[filepath][:digest].call
50
+ end
43
51
  end
44
52
  end
45
53
 
@@ -103,9 +111,18 @@ module Proscenium
103
111
  sideloaded = []
104
112
 
105
113
  extensions.find do |x|
106
- if (fp = filepath.sub_ext(x)).exist?
107
- sideloaded << import(Resolver.resolve(fp.to_s), sideloaded: filepath, **options)
108
- end
114
+ next unless (fp = filepath.sub_ext(x)).exist?
115
+
116
+ sideloaded << if extensions.include?('.module.css')
117
+ manifest_path, non_manifest_path = Resolver.resolve(fp.to_s,
118
+ as_array: true)
119
+ import(manifest_path || non_manifest_path,
120
+ sideloaded: filepath,
121
+ digest: -> { Utils.digest non_manifest_path },
122
+ **options)
123
+ else
124
+ import(Resolver.resolve(fp.to_s), sideloaded: filepath, **options)
125
+ end
109
126
  end
110
127
 
111
128
  sideloaded
@@ -12,16 +12,26 @@ module Proscenium
12
12
  end
13
13
 
14
14
  def load!
15
+ public_path = Rails.configuration.paths['public'].first
15
16
  self.manifest = {}
16
17
  self.loaded = false
17
18
 
18
19
  if Proscenium.config.manifest_path.exist?
19
20
  self.loaded = true
20
21
 
21
- JSON.parse(Proscenium.config.manifest_path.read)['outputs'].each do |output_path, details|
22
+ JSON.parse(Proscenium.config.manifest_path.read)['outputs'].each do |outpath, details|
22
23
  next if !details.key?('entryPoint')
23
24
 
24
- manifest[details['entryPoint']] = "/#{output_path.delete_prefix('public/')}"
25
+ outpath = outpath.delete_prefix "#{public_path}/"
26
+
27
+ ep = details['entryPoint']
28
+ ep = if (gem = BundledGems.paths.find { |_, v| ep.start_with? "#{v}/" })
29
+ "@rubygems/#{gem[0]}#{ep.delete_prefix(gem[1])}"
30
+ else
31
+ ep.delete_prefix(Rails.root.to_s)
32
+ end
33
+
34
+ manifest[ep] = "/#{outpath}"
25
35
  end
26
36
  end
27
37
 
@@ -34,7 +44,7 @@ module Proscenium
34
44
  end
35
45
 
36
46
  def [](key)
37
- loaded? ? manifest[key] : "/#{key}"
47
+ loaded? ? manifest[key] : nil
38
48
  end
39
49
  end
40
50
  end
@@ -45,7 +45,7 @@ module Proscenium
45
45
 
46
46
  class_methods do
47
47
  def sideload(options)
48
- Importer.import manager, **options, js: { type: 'module' }
48
+ Importer.import Resolver.resolve(manager.to_s), **options, js: { type: 'module' }
49
49
  end
50
50
  end
51
51
 
@@ -10,8 +10,10 @@ module Proscenium
10
10
  # Resolve the given `path` to a fully qualified URL path.
11
11
  #
12
12
  # @param path [String] URL path, file system path, or bare specifier (ie. NPM package).
13
+ # @param as_array [Boolean] whether or not to return both the manifest path and
14
+ # non-manifest path as an array. Only returns the resolved path if false (default).
13
15
  # @return [String] URL path.
14
- def self.resolve(path)
16
+ def self.resolve(path, as_array: false)
15
17
  self.resolved ||= {}
16
18
 
17
19
  if path.start_with?('./', '../')
@@ -19,12 +21,16 @@ module Proscenium
19
21
  end
20
22
 
21
23
  self.resolved[path] ||= if (gem = BundledGems.paths.find { |_, v| path.start_with? "#{v}/" })
22
- path.sub(/^#{gem.last}/, "/node_modules/@rubygems/#{gem.first}")
24
+ vpath = path.sub(/^#{gem.last}/, "@rubygems/#{gem.first}")
25
+ [Proscenium::Manifest[vpath], "/node_modules/#{vpath}"]
23
26
  elsif path.start_with?("#{Rails.root}/")
24
- path.delete_prefix Rails.root.to_s
27
+ vpath = path.delete_prefix(Rails.root.to_s)
28
+ [Proscenium::Manifest[vpath], vpath]
25
29
  else
26
- Builder.resolve path
30
+ [Proscenium::Manifest[path], Builder.resolve(path)]
27
31
  end
32
+
33
+ as_array ? self.resolved[path] : self.resolved[path][0] || self.resolved[path][1]
28
34
  end
29
35
  end
30
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.22.1'
4
+ VERSION = '0.22.3'
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.1
4
+ version: 0.22.3
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-04 00:00:00.000000000 Z
11
+ date: 2025-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi