isomorfeus-asset-manager 0.13.6 → 0.13.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: 8f62fe52ee6d4738fef710f256872f92ea7e0fb2d8d2f6d3d8a2c84396b2ea17
4
- data.tar.gz: b17d3595fbaadae59c9323dc3b5a619d8a4ab4acb128828fd5a9120d90e41ff0
3
+ metadata.gz: be010df3a50e5e269faac6199f11ae7ac6908af167c5abdb6dd51ce2c346bf3b
4
+ data.tar.gz: c693e47aa3df6073524bfd8795f62ddc270c9699084d318097396c0fc8b82030
5
5
  SHA512:
6
- metadata.gz: 0f8c095b32f449b0e4cb80fa5eec4c72dc47ce42f435081dab51aefb53cb32b526c4bf3f5a1b8f3858ed29369d4138035ec15c5c68fd84e7c19848c690c2aaf4
7
- data.tar.gz: 6d1d16f1daac50a28157bae85b7d236d1e8346e091a82ba08d833947fcc2d686c78c82e46aae5e1c101bd8c23a95b6f06c08f1af451c2ec9eb30a6c1d939e43e
6
+ metadata.gz: e14e3dcfe2cb812a581ba6715d3bf1b0c3365f54fe4133bacd602b1acdcb31602ad91fa33f687e2b5e756ed7f0b7c8e18884d8e0b5bad4bf31e55f4b2066f5f5
7
+ data.tar.gz: 809cb32e666acbdb5eddb810352694b9ea54184d991c2b7631bc08b5d630d86aef9be41e039bb868dbf397b4e11b19cab725e903abd415f51b93e9793b47cb18
@@ -18,7 +18,7 @@ module Isomorfeus
18
18
  @assets_path_size = @assets_path.size
19
19
  end
20
20
  rescue Exception => e
21
- STDERR.puts "#{e.message}\n#{e.backtrace.join("\n")}\n"
21
+ STDERR.puts "#{e.message}\n#{e.backtrace&.join("\n")}\n"
22
22
  end
23
23
 
24
24
  def call(env)
@@ -115,7 +115,7 @@ module Isomorfeus
115
115
  @app.call(env)
116
116
  end
117
117
  rescue Exception => e
118
- STDERR.puts "#{e.message}\n#{e.backtrace.join("\n")}\n"
118
+ STDERR.puts "#{e.message}\n#{e.backtrace&.join("\n")}\n"
119
119
  @app.call(env)
120
120
  end
121
121
 
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.13.6'
3
+ VERSION = '0.13.7'
4
4
  end
5
5
  end
@@ -1,5 +1,36 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
+ @@app_common_imports = false
4
+ @@app_web_imports = false
5
+ @@app_ssr_imports = false
6
+
7
+ def self.add_app_imports
8
+ imports_path = File.expand_path(File.join(Isomorfeus.app_root, 'imports'))
9
+ if Dir.exist?(imports_path)
10
+ unless @@app_common_imports
11
+ common_imports_file = File.join(imports_path, 'common.js')
12
+ if File.exist?(common_imports_file)
13
+ Isomorfeus.add_common_js_import(common_imports_file)
14
+ @@app_common_imports = true
15
+ end
16
+ end
17
+ unless @@app_web_imports
18
+ web_imports_file = File.join(imports_path, 'web.js')
19
+ if File.exist?(web_imports_file)
20
+ Isomorfeus.add_web_js_import(web_imports_file)
21
+ @@app_web_imports = true
22
+ end
23
+ end
24
+ unless @@app_ssr_imports
25
+ ssr_imports_file = File.join(imports_path, 'ssr.js')
26
+ if File.exist?(ssr_imports_file)
27
+ Isomorfeus.add_ssr_js_import(ssr_imports_file)
28
+ @@app_ssr_imports
29
+ end
30
+ end
31
+ end
32
+ end
33
+
3
34
  def initialize
4
35
  Isomorfeus.set_node_paths
5
36
 
@@ -9,19 +40,10 @@ module Isomorfeus
9
40
  FileUtils.mkdir_p(@imports_path)
10
41
  FileUtils.mkdir_p(@output_path)
11
42
  @server_path = File.join(Isomorfeus.app_root, 'server')
43
+ self.class.add_app_imports
12
44
 
13
45
  @context = ExecJS.permissive_compile(init_js)
14
46
 
15
- imports_path = File.expand_path(File.join(Isomorfeus.app_root, 'imports'))
16
- if Dir.exist?(imports_path)
17
- common_imports_file = File.join(imports_path, 'common.js')
18
- Isomorfeus.add_common_js_import(common_imports_file) if File.exist?(common_imports_file)
19
- web_imports_file = File.join(imports_path, 'web.js')
20
- Isomorfeus.add_web_js_import(web_imports_file) if File.exist?(web_imports_file)
21
- ssr_imports_file = File.join(imports_path, 'ssr.js')
22
- Isomorfeus.add_ssr_js_import(ssr_imports_file) if File.exist?(ssr_imports_file)
23
- end
24
-
25
47
  init_hmr_listener if Isomorfeus.development? && !Isomorfeus.hmr_listener
26
48
  end
27
49
 
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.13.6
4
+ version: 0.13.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: 2021-11-11 00:00:00.000000000 Z
11
+ date: 2021-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: isomorfeus-iodine