isomorfeus-asset-manager 0.14.18 → 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: bb5692cfccf4e21f3b11bcced2aa8af148990c7d19ade752ea87ddcf1f1bdcc5
4
- data.tar.gz: af7ea87cb6b73ab1c532eba91d155770bd101ada53a3eeb3c3ef934fcd730328
3
+ metadata.gz: f5cf524bb95ea6eaa13f38dc97708c888bf03b4f25471ee75daa1037bf2ae2e2
4
+ data.tar.gz: 95a07004dd5d82c9cb92ea7284109c363e0917752fcb5f73454c04789260dfe6
5
5
  SHA512:
6
- metadata.gz: e2e9b716e6ab17554d8d2adcf799ca0267eecf42bbc8f6383c352dbfe2713ebda4d391ff3a257c88b007edd572d1528b47ba0f751af0cb8225c03fd41084dba9
7
- data.tar.gz: 80e14c295ad90176cabb32d22d13bc6a324f4ff5e78743d9c0ce66a8458a00dd0a7f18a379662575c9d05deb56582c47bebdd8be75ef57ffa1ddd7d18e4f9d73
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,7 +78,7 @@ module Isomorfeus
78
78
 
79
79
  self.hmr_listener = nil
80
80
  self.asset_manager_hmr_channel = :isomorfeus_asset_manager_module_updates
81
- self.asset_manager_hmr_dirs = %w[channels components data locales operations policies]
81
+ self.asset_manager_hmr_dirs = %w[channels components data imports locales operations policies server]
82
82
  self.hmr_websocket_path = '/_asset_manager_hmr_websocket'
83
83
  self.assets_path = '/assets'
84
84
  self.assets = {
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.18'
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(w, 'error')
91
- unless w['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
@@ -176,7 +167,9 @@ module Isomorfeus
176
167
  splitting: false,
177
168
  target: '#{asset.browser? ? 'es6' : 'node16' }',
178
169
  write: true
179
- }).then((result) => { global.res_meta = result.metafile; return result; });
170
+ })
171
+ .then((result) => { global.res_meta = result.metafile; return result; }, (reason) => { return { result: { errors: [{text: reason}]}}; })
172
+ .catch((error) => { return { result: { errors: [{text: error.message}]}}; });
180
173
  JAVASCRIPT
181
174
  if analyze
182
175
  analysis = @context.await <<~JAVASCRIPT
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.14.18
4
+ version: 0.14.21
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-02-21 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.7.0
61
+ version: 3.7.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.7.0
68
+ version: 3.7.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: oj
71
71
  requirement: !ruby/object:Gem::Requirement