isomorfeus-asset-manager 0.15.6 → 0.15.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b31900dc226ef52bb361979681a40a62a79d7a382a0f131d8d901bd8a782964
|
4
|
+
data.tar.gz: ffa788333e44093f2460c9d6c17d17c9610a013e24c420580f5d215387e0f0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb80bc0b2b39e93f84f341c412ddb17a2d783d861468e1c75f174679e1cc8cf06b2a5437cac28a7d95f594f2da4d557b1fa78823bb7546b1705c778057a62395
|
7
|
+
data.tar.gz: 938436ac1961a2c6e75472f4149e51caf5a3551b855f4b586b0c1d15d4d8a99b532bce3564bf9f8d938e3d8272257791b55e13de86f34fcf8ec314748ed4a58f
|
@@ -28,7 +28,7 @@ module Isomorfeus
|
|
28
28
|
if Isomorfeus.production?
|
29
29
|
FileUtils.mkdir_p(asset_dir) unless Dir.exist?(asset_dir)
|
30
30
|
FileUtils.mkdir_p(File.join(*[asset_dir].concat(module_name.split('/')[0...-1]))) if module_name.include?('/')
|
31
|
-
File.
|
31
|
+
File.binwrite(out_file, js)
|
32
32
|
else
|
33
33
|
js << "\n//# sourceMappingURL=#{Isomorfeus.assets_path}/#{asset_name}/#{module_name}.rb.js.map\n"
|
34
34
|
@bundle_ruby_modules[module_name] = { js: { raw: js }, map: { raw: Oj.dump(result.source_map.as_json, mode: :strict) }}
|
@@ -38,29 +38,29 @@ module Isomorfeus
|
|
38
38
|
|
39
39
|
def save_entry(asset_key, asset_name, imports_path)
|
40
40
|
entry = File.join(imports_path, asset_key)
|
41
|
-
File.
|
41
|
+
File.binwrite(entry, generate_entry(asset_name))
|
42
42
|
entry
|
43
43
|
end
|
44
44
|
|
45
45
|
def bundle_css(asset_name, output_path)
|
46
46
|
filename = File.join(output_path, asset_name + '.css')
|
47
|
-
@hash[:css][:css] = { raw: File.
|
47
|
+
@hash[:css][:css] = { raw: File.binread(filename) } if File.exist?(filename)
|
48
48
|
end
|
49
49
|
|
50
50
|
def bundle_css_map(asset_name, output_path)
|
51
51
|
filename = File.join(output_path, asset_name + '.css.map')
|
52
|
-
@hash[:css][:map] = { raw: File.
|
52
|
+
@hash[:css][:map] = { raw: File.binread(filename) } if File.exist?(filename)
|
53
53
|
end
|
54
54
|
|
55
55
|
def bundle_js(asset_key, asset_name, imports_path, output_path)
|
56
|
-
js = File.
|
56
|
+
js = File.binread(File.join(output_path, asset_key))
|
57
57
|
js << ruby_imports_to_s(asset_name, imports_path) unless Isomorfeus.production?
|
58
58
|
@hash[:js][:js] = { raw: js }
|
59
59
|
end
|
60
60
|
|
61
61
|
def bundle_js_map(asset_key, output_path)
|
62
62
|
filename = File.join(output_path, asset_key + '.map')
|
63
|
-
@hash[:js][:map] = { raw: File.
|
63
|
+
@hash[:js][:map] = { raw: File.binread(filename) } if File.exist?(filename)
|
64
64
|
end
|
65
65
|
|
66
66
|
def ruby_imports_to_s(asset_name, out_dir)
|
@@ -30,19 +30,19 @@ module Isomorfeus
|
|
30
30
|
result = Opal::Builder.build(ruby_import.resolved_path, { esm: true })
|
31
31
|
FileUtils.mkdir_p(asset_dir) unless Dir.exist?(asset_dir)
|
32
32
|
FileUtils.mkdir_p(File.join(*[asset_dir].concat(module_name.split('/')[0...-1]))) if module_name.include?('/')
|
33
|
-
File.
|
33
|
+
File.binwrite(out_file, result.to_s)
|
34
34
|
end
|
35
35
|
nil
|
36
36
|
end
|
37
37
|
|
38
38
|
def save_entry(asset_key, asset_name, imports_path)
|
39
39
|
entry = File.join(imports_path, asset_key)
|
40
|
-
File.
|
40
|
+
File.binwrite(entry, generate_entry(asset_name))
|
41
41
|
entry
|
42
42
|
end
|
43
43
|
|
44
44
|
def bundle_js(asset_key, asset_name, imports_path, output_path)
|
45
|
-
js = File.
|
45
|
+
js = File.binread(File.join(output_path, asset_key))
|
46
46
|
@hash[:js][:js] = { raw: js }
|
47
47
|
end
|
48
48
|
|
@@ -56,7 +56,7 @@ module Isomorfeus
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def compile_ruby(file)
|
59
|
-
source = File.
|
59
|
+
source = File.binread(file)
|
60
60
|
module_file = file[(Isomorfeus.app_root.size + 1)..-1]
|
61
61
|
compiler = Opal::Compiler.new(source, requirable: true, file: module_file)
|
62
62
|
{ javascript: compiler.compile }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-asset-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brotli
|