esbuild 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esbuild/service.rb +10 -3
- data/lib/esbuild/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74bfb670d772c9e5c9f595470e2f2c243057d5f4c2dcc4644e28d8c9e668f43d
|
4
|
+
data.tar.gz: 18c21c7834dc6d1d665b0de5931b2961efc0a71427611004c68ca233461cc790
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1a477b1a57e7c0b073bf3d123c159274739fce3b58aeb5e248034d323153e4c804c13db837c23bd0bd98813d582bc6336bc524c16dc4cdb0696bcdca3fa4672
|
7
|
+
data.tar.gz: a712ba20891c4cf0099acdd035ac4eb398057e342f9e39b2660e98e0bb83b2d95d7109180bf12d4da1f52481e1f08ffbd5e1bf0308bbdac6c5355f1f4dec378c
|
data/lib/esbuild/service.rb
CHANGED
@@ -21,8 +21,9 @@ module Esbuild
|
|
21
21
|
@serve_callbacks = Concurrent::Map.new
|
22
22
|
@buffer = String.new(encoding: Encoding::BINARY)
|
23
23
|
|
24
|
-
child_read, child_stdout =
|
25
|
-
child_stdin, @child_write =
|
24
|
+
child_read, child_stdout = create_pipes
|
25
|
+
child_stdin, @child_write = create_pipes
|
26
|
+
|
26
27
|
bin = binary_path
|
27
28
|
pid = spawn(bin, "--service=#{ESBUILD_VERSION}", "--ping", out: child_stdout, err: :err, in: child_stdin)
|
28
29
|
child_stdin.close
|
@@ -36,7 +37,6 @@ module Esbuild
|
|
36
37
|
@build_key += 1
|
37
38
|
opts = Flags.flags_for_build_options(options)
|
38
39
|
on_rebuild = opts[:watch]&.fetch(:on_rebuild, nil)
|
39
|
-
|
40
40
|
request = {
|
41
41
|
"command" => "build",
|
42
42
|
"key" => key,
|
@@ -252,6 +252,13 @@ module Esbuild
|
|
252
252
|
def binary_path
|
253
253
|
ENV["ESBUILD_BINARY_PATH"] || File.expand_path("../../bin/esbuild", __dir__)
|
254
254
|
end
|
255
|
+
|
256
|
+
def create_pipes
|
257
|
+
r, w = IO.pipe(Encoding::BINARY, Encoding::BINARY, binmode: true)
|
258
|
+
r.set_encoding(Encoding::BINARY)
|
259
|
+
w.set_encoding(Encoding::BINARY)
|
260
|
+
[r, w]
|
261
|
+
end
|
255
262
|
end
|
256
263
|
|
257
264
|
class BuildFailureError < StandardError
|
data/lib/esbuild/version.rb
CHANGED