isomorfeus-asset-manager 0.14.20 → 0.14.21

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: 15e19c2ab4639a61a42f664e583b6f3351d7ca6325c4e44d1b4e8559c47cec00
4
- data.tar.gz: f6b336dcfe1a43d38f05c3d54d13a2c046ba0827ff7d591e0871d01774ea003b
3
+ metadata.gz: f5cf524bb95ea6eaa13f38dc97708c888bf03b4f25471ee75daa1037bf2ae2e2
4
+ data.tar.gz: 95a07004dd5d82c9cb92ea7284109c363e0917752fcb5f73454c04789260dfe6
5
5
  SHA512:
6
- metadata.gz: b58edf4ade9d3b7cbec0267aed55e3d03eddd6ddca57a0eb3855ddb3c91eb998a2498a4528fbc249ffc1b4b4722a8739fbcf50e766539e1fc5202aa6fc891894
7
- data.tar.gz: 7f0d0c3c8684cb75e969a62752aa2bf1db34d91069d925ad55aa38115ddc9da57ab276603353e02d58feebab55b26ac38e06962844a461137a50624adc66b94a
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);
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.20'
3
+ VERSION = '0.14.21'
4
4
  end
5
5
  end
@@ -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
- unless result['errors'].empty?
89
- result['errors'].each do |e|
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: reson}]}}; })
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.20
4
+ version: 0.14.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann