isomorfeus-asset-manager 0.14.20 → 0.14.21
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: f5cf524bb95ea6eaa13f38dc97708c888bf03b4f25471ee75daa1037bf2ae2e2
|
4
|
+
data.tar.gz: 95a07004dd5d82c9cb92ea7284109c363e0917752fcb5f73454c04789260dfe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01b7e6f0ca7eb49ab6bbbd2f96cf05e1e525cadcb0ea2b641a58bd98fe5a20404fd95890408e37a51e965fa6f6a2d144fedb369601bd0093898e2fb152db1998
|
7
|
+
data.tar.gz: f784e2c97646fb1247220317200362043bf720f35d4b2e243c97f51f32a6828f8b53c23ab8721eb73c856c9221d50b72c92c650b6652117eaee92c704e2827b8
|
@@ -94,6 +94,11 @@ module Isomorfeus
|
|
94
94
|
catch { console.log('Isomorfeus Asset Manager could not update locale ', update.locale) }
|
95
95
|
return;
|
96
96
|
}
|
97
|
+
if (typeof update.reload !== 'undefined') {
|
98
|
+
console.log('Isomorfeus Asset Manager reloading page, updating javascript import ', update.reload);
|
99
|
+
setTimeout(function() { window.location.reload(true); }, 500);
|
100
|
+
return;
|
101
|
+
}
|
97
102
|
let start_index = 'Opal.modules[\\"'.length;
|
98
103
|
let end_index = update.javascript.indexOf('"', start_index);
|
99
104
|
let opal_module_name = update.javascript.substr(start_index, end_index - start_index);
|
@@ -78,22 +78,10 @@ module Isomorfeus
|
|
78
78
|
{ javascript: compiler.compile }
|
79
79
|
end
|
80
80
|
|
81
|
-
def print_message(m, level)
|
82
|
-
l = m['location']
|
83
|
-
STDERR.puts "#{l['file']}:#{l['line']}:#{l['column']}: #{level}: #{m['text']}"
|
84
|
-
STDERR.puts " #{l['line']} | #{l['lineText']}\n\n"
|
85
|
-
end
|
86
81
|
|
87
82
|
def handle_errors(asset_key, result)
|
88
|
-
|
89
|
-
|
90
|
-
print_message(e, 'error')
|
91
|
-
unless e['notes'].empty?
|
92
|
-
e['notes'].each do |n|
|
93
|
-
print_message(n, 'note')
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
83
|
+
result = result['result']
|
84
|
+
if result && !(result['errors'].nil? || result['errors'].empty?)
|
97
85
|
raise "Asset Manager: error bundling '#{asset_key}'"
|
98
86
|
end
|
99
87
|
end
|
@@ -137,6 +125,9 @@ module Isomorfeus
|
|
137
125
|
elsif file.end_with?('.yml') || file.end_with?('.mo') || file.end_with?('.po')
|
138
126
|
Isomorfeus.server_requires_reload!
|
139
127
|
update_json = Oj.dump({ locale: file }, mode: :strict)
|
128
|
+
elsif file.end_with?('.js')
|
129
|
+
Isomorfeus.assets.each_value { |asset| asset.unbundle! }
|
130
|
+
update_json = Oj.dump({ reload: file }, mode: :strict)
|
140
131
|
else
|
141
132
|
update_json = Oj.dump({ error: "Don't know how to update #{file}!" }, mode: :strict)
|
142
133
|
end
|
@@ -177,7 +168,7 @@ module Isomorfeus
|
|
177
168
|
target: '#{asset.browser? ? 'es6' : 'node16' }',
|
178
169
|
write: true
|
179
170
|
})
|
180
|
-
.then((result) => { global.res_meta = result.metafile; return result; }, (reason) => { return { result: { errors: [{text:
|
171
|
+
.then((result) => { global.res_meta = result.metafile; return result; }, (reason) => { return { result: { errors: [{text: reason}]}}; })
|
181
172
|
.catch((error) => { return { result: { errors: [{text: error.message}]}}; });
|
182
173
|
JAVASCRIPT
|
183
174
|
if analyze
|