opal-webpack-loader 0.11.3 → 0.11.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/opal-webpack-compile-server +0 -1
- data/bin/opal-webpack-windows-compile-server +7 -4
- data/bin/owl-compiler +7 -4
- data/lib/opal-webpack-loader/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e7e5f3b220d06e291ef7a5805237d73c53b27313766b7891e0bc18a8b00ccc8
|
4
|
+
data.tar.gz: 5d1078190a7c4b286de96c8114e9692728b87f6063c558c7de5737e3513f4b0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4bd10876231791a4a9368212950c81e1b8f007daa895db6ae95d0c01571a3ea3672650e35bda7765c74b06e02000a1164deb264dc22980e413d290bae9cc3e4
|
7
|
+
data.tar.gz: 70ba5421ca317f15126577d6990d30d9b354ee1c6864b28518756d07d99b9df13a25912331fe67a8e6034a1d4f9fc40da5e8941cc2aa7402d21b5f540bedfefd
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'digest'
|
3
3
|
require 'oj'
|
4
|
-
require 'c_lexer'
|
5
4
|
require 'optparse'
|
6
5
|
require 'opal/paths'
|
7
6
|
require 'opal/source_map'
|
@@ -64,6 +63,10 @@ modules_to_require.each do |mod|
|
|
64
63
|
require mod
|
65
64
|
end
|
66
65
|
|
66
|
+
def compiler_options_digest(compiler_options)
|
67
|
+
@compiler_options_digest ||= Digest::SHA1.hexdigest(Oj.dump(compiler_options, mode: :strict))
|
68
|
+
end
|
69
|
+
|
67
70
|
def compile(request, cache, compiler_options)
|
68
71
|
begin
|
69
72
|
request_json = Oj.load(request.chop!, mode: :strict)
|
@@ -73,7 +76,7 @@ def compile(request, cache, compiler_options)
|
|
73
76
|
source = File.read(filename)
|
74
77
|
if cache
|
75
78
|
source_digest = Digest::SHA1.hexdigest(source)
|
76
|
-
key = "owl_#{compiler_options_digest}_#{source_digest}_#{compile_source_map}"
|
79
|
+
key = "owl_#{compiler_options_digest(compiler_options)}_#{source_digest}_#{compile_source_map}"
|
77
80
|
result_json = cache.get(key)
|
78
81
|
return result_json if result_json
|
79
82
|
end
|
@@ -95,6 +98,7 @@ end
|
|
95
98
|
if ARGV[0] == 'start'
|
96
99
|
number_of_instances = ARGV[1].to_i
|
97
100
|
number_of_instances == 4 if number_of_instances == 0
|
101
|
+
number_of_instances == 16 if number_of_instances > 16
|
98
102
|
else
|
99
103
|
raise 'arguments must be either "stop" or "start number_of_instances"'
|
100
104
|
exit(1)
|
@@ -112,8 +116,7 @@ begin
|
|
112
116
|
STDERR.puts "Exiting with drama."
|
113
117
|
exit(0)
|
114
118
|
else
|
115
|
-
|
116
|
-
result
|
119
|
+
compile(request, cache, compiler_options)
|
117
120
|
end
|
118
121
|
end
|
119
122
|
end.run
|
data/bin/owl-compiler
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'digest'
|
3
3
|
require 'oj'
|
4
|
-
require 'c_lexer'
|
5
4
|
require 'optparse'
|
6
5
|
require 'opal/paths'
|
7
6
|
require 'opal/source_map'
|
@@ -73,19 +72,23 @@ compile_source_map = compile_server_options[:source_map]
|
|
73
72
|
filename = compile_server_options[:source_file]
|
74
73
|
source = File.read(filename)
|
75
74
|
compiler_options.merge!(es6_modules: true)
|
76
|
-
|
75
|
+
|
76
|
+
def compiler_options_digest(compiler_options)
|
77
|
+
@compiler_options_digest ||= Digest::SHA1.hexdigest(Oj.dump(compiler_options, mode: :strict))
|
78
|
+
end
|
77
79
|
|
78
80
|
begin
|
79
81
|
if compile_server_options[:cache]
|
80
82
|
source_digest = Digest::SHA1.hexdigest(source)
|
81
|
-
key = "owl_#{compiler_options_digest}_#{source_digest}_#{compile_source_map}"
|
83
|
+
key = "owl_#{compiler_options_digest(compiler_options)}_#{source_digest}_#{compile_source_map}"
|
82
84
|
result_json = compile_server_options[:cache].get(key)
|
83
85
|
if result_json
|
84
86
|
STDOUT.puts result_json
|
85
87
|
exit 0
|
86
88
|
end
|
87
89
|
end
|
88
|
-
|
90
|
+
|
91
|
+
c = Opal::Compiler.new(source, compiler_options.merge(file: filename))
|
89
92
|
result = { 'javascript' => c.compile }
|
90
93
|
if compile_source_map
|
91
94
|
result['source_map'] = c.source_map.as_json
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-webpack-loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: c_lexer
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: dalli
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|