proscenium 0.22.1-x86_64-darwin → 0.22.3-x86_64-darwin
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/lib/proscenium/css_module/transformer.rb +8 -4
- data/lib/proscenium/ext/proscenium +0 -0
- data/lib/proscenium/ext/proscenium.h +9 -1
- data/lib/proscenium/importer.rb +23 -6
- data/lib/proscenium/manifest.rb +13 -3
- data/lib/proscenium/react_componentable.rb +1 -1
- data/lib/proscenium/resolver.rb +10 -4
- data/lib/proscenium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45ab4d57293d54d501e66f96a6a7b64f4ca64e3b7d90a61f3d7584a346fe8ac3
|
|
4
|
+
data.tar.gz: '08a15f6cd9b008e93df08daacc3682de6233fa0b47df81fc7d738026612a7ff9'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ecc3d18d1c8e68b0a233b7e3d1e0a7ae84502161b995e0ac1174503042f66fea761c85938ce5c662aed5d2d95b53e2f6f90841b80966a4a34040f8b209635794
|
|
7
|
+
data.tar.gz: ed359387aa663f169d9c5b97dd48f01a173869ce365d1f592399aa830ba8db6432e8eab8d8c118aeca1e01c31168cbb5cf861678a12f6edb185f47aa2c263114
|
|
@@ -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
|
-
|
|
70
|
-
digest = Importer.import(
|
|
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
|
-
|
|
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,
|
|
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
|
//
|
data/lib/proscenium/importer.rb
CHANGED
|
@@ -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.
|
|
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]
|
|
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]
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
data/lib/proscenium/manifest.rb
CHANGED
|
@@ -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 |
|
|
22
|
+
JSON.parse(Proscenium.config.manifest_path.read)['outputs'].each do |outpath, details|
|
|
22
23
|
next if !details.key?('entryPoint')
|
|
23
24
|
|
|
24
|
-
|
|
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] :
|
|
47
|
+
loaded? ? manifest[key] : nil
|
|
38
48
|
end
|
|
39
49
|
end
|
|
40
50
|
end
|
data/lib/proscenium/resolver.rb
CHANGED
|
@@ -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}/, "
|
|
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
|
|
27
|
+
vpath = path.delete_prefix(Rails.root.to_s)
|
|
28
|
+
[Proscenium::Manifest[vpath], vpath]
|
|
25
29
|
else
|
|
26
|
-
Builder.resolve
|
|
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
|
data/lib/proscenium/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.22.3
|
|
5
5
|
platform: x86_64-darwin
|
|
6
6
|
authors:
|
|
7
7
|
- Joel Moss
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi
|