jass 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/jass.rb +5 -1
- data/lib/jass/bundle_processor.rb +1 -1
- data/lib/jass/compiler.rb +12 -13
- data/lib/jass/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95641950492674a99916446a6d882688c23243dcd8ff0c9ba38f1e3d2fea2ff9
|
4
|
+
data.tar.gz: 9ed749532e4a8c83351be13a813fdf2520af2eb9731b8a67fde2f37aae53a2ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 661a93b773e96410c86d1a48ec7db15fcf23e57c7bb06338baeffbb865e1c60c058e367aee1fdea192543dcd3465f7f14cafae744a734cfb7a8fdcacd0995328
|
7
|
+
data.tar.gz: 34dc9f49a4d355b69580ad3287da7d08e675f2cc06864acaa89273f37ceda7ef96b61dc00eb9e11e08f860a5f4cfc4c5f6fa97fcfeb8fc69fd9ac936b75f6ebe
|
data/LICENSE
CHANGED
data/lib/jass.rb
CHANGED
@@ -7,7 +7,7 @@ require 'active_support/all'
|
|
7
7
|
|
8
8
|
module Jass
|
9
9
|
class << self
|
10
|
-
attr_accessor :vendor_modules_root, :plugins
|
10
|
+
attr_accessor :vendor_modules_root, :plugins, :input_options
|
11
11
|
|
12
12
|
def modules_root
|
13
13
|
File.join(File.dirname(__FILE__), '..', 'vendor')
|
@@ -23,6 +23,10 @@ module Jass
|
|
23
23
|
@compiler = nil
|
24
24
|
end
|
25
25
|
|
26
|
+
def input_options
|
27
|
+
@input_options || {}
|
28
|
+
end
|
29
|
+
|
26
30
|
def compiler
|
27
31
|
@compiler ||= Jass::Compiler.new
|
28
32
|
end
|
@@ -16,7 +16,7 @@ module Jass
|
|
16
16
|
dependencies = Set.new(input.fetch(:metadata).fetch(:dependencies))
|
17
17
|
globals = input.fetch(:metadata).fetch(:globals, {})
|
18
18
|
bundle_root = Pathname.new(filename).dirname
|
19
|
-
bundle = Jass.compiler.bundle(filename,
|
19
|
+
bundle = Jass.compiler.bundle(filename, Jass.input_options, globals: globals)
|
20
20
|
dependencies += bundle.fetch('map').fetch('sources').map { |dep| Sprockets::URIUtils.build_file_digest_uri(bundle_root.join(dep).to_s) }
|
21
21
|
|
22
22
|
{ data: bundle.fetch('code'),
|
data/lib/jass/compiler.rb
CHANGED
@@ -50,32 +50,31 @@ module Jass
|
|
50
50
|
function :js_bundle, <<~JS
|
51
51
|
function(entry, moduleDirectories, inputOptions, outputOptions) {
|
52
52
|
inputOptions = inputOptions || {};
|
53
|
-
outputOptions = outputOptions || {}
|
53
|
+
outputOptions = outputOptions || {};
|
54
|
+
var inputDefaultOptions = {
|
55
|
+
input: entry,
|
56
|
+
treeshake: false,
|
57
|
+
plugins: [
|
58
|
+
...__plugins__,
|
59
|
+
nodeResolve({ customResolveOptions: { moduleDirectory: moduleDirectories }}),
|
60
|
+
commonjs()
|
61
|
+
]
|
62
|
+
};
|
54
63
|
// TODO: throw error unless moduleDirectories
|
55
|
-
Object.assign(inputOptions,
|
56
|
-
{ input: entry,
|
57
|
-
treeshake: false,
|
58
|
-
plugins: [
|
59
|
-
...__plugins__,
|
60
|
-
nodeResolve({ customResolveOptions: { moduleDirectory: moduleDirectories }}),
|
61
|
-
commonjs()
|
62
|
-
]
|
63
|
-
}
|
64
|
-
);
|
65
64
|
Object.assign(outputOptions,
|
66
65
|
{ format: 'iife',
|
67
66
|
sourcemap: true,
|
68
67
|
exports: 'none'
|
69
68
|
}
|
70
69
|
);
|
71
|
-
var promise = rollup.rollup(inputOptions)
|
70
|
+
var promise = rollup.rollup({ ...inputDefaultOptions, ...inputOptions })
|
72
71
|
.then(bundle => bundle.generate(outputOptions))
|
73
72
|
.then(bundle => { return { code: send('compile', bundle.code), map: bundle.map }; });
|
74
73
|
return promise;
|
75
74
|
}
|
76
75
|
JS
|
77
76
|
|
78
|
-
def bundle(entry, input_options =
|
77
|
+
def bundle(entry, input_options = Jass.input_options, output_options = {})
|
79
78
|
js_bundle(entry, self.class.node_paths, input_options, output_options)
|
80
79
|
end
|
81
80
|
|
data/lib/jass/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
version: '5.0'
|
109
109
|
description: ES6 support for the Rails asset pipeline
|
110
110
|
email:
|
111
|
-
-
|
111
|
+
- mtgrosse@gmx.net
|
112
112
|
executables: []
|
113
113
|
extensions: []
|
114
114
|
extra_rdoc_files: []
|