sewing_kit 0.123.0 → 0.124.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/sewing_kit/railtie.rb +1 -0
- data/lib/sewing_kit/version.rb +1 -1
- data/lib/sewing_kit/webpack/server.rb +49 -0
- data/lib/tasks/sewing_kit.rake +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3a05925e10dba45f77fcf36f23bf1f0d777ab6993f7994f3b216169dde31dd7
|
4
|
+
data.tar.gz: ca891a9517eaca9dbcacef5c838c626e587a1111f9a58105b12abf3e8adbcab4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b297f9c114a00b3925933df21d8109d04e0123b6234790c25bc136e5393543f1f8cc04d683b47f86d0999c7bf344a679fe9cb111e5add3f75e5a645d4bef3940
|
7
|
+
data.tar.gz: '06347349fc9a1f1c5ef451205d9c28a7005e528282540f42c43e605ee4c6112d51c881171831100551ab793e30210b4c4d9e8075fd08d67ecfc417a5be44ea73'
|
data/README.md
CHANGED
@@ -161,6 +161,9 @@ NODE_ENV=production SK_SIMULATE_PRODUCTION=1 bundle exec rake assets:precompile
|
|
161
161
|
NODE_ENV=production SK_SIMULATE_PRODUCTION=1 dev run
|
162
162
|
```
|
163
163
|
|
164
|
+
If your application includes a node server (eg. uses `quilt_rails`), you can run the node server in a separate terminal window with:
|
165
|
+
`bin/rails sewing_kit:server:start`
|
166
|
+
|
164
167
|
Note:
|
165
168
|
|
166
169
|
- Code changes will not be automatically recompiled in this state
|
data/lib/sewing_kit/railtie.rb
CHANGED
data/lib/sewing_kit/version.rb
CHANGED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SewingKit
|
4
|
+
module Webpack
|
5
|
+
class Server
|
6
|
+
class DefaultEntrypointMissing < StandardError
|
7
|
+
def initialize
|
8
|
+
super(
|
9
|
+
"Default entrypoint build/server/main.js is missing."
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
raise DefaultEntrypointMissing unless File.exist?(default_entrypoint)
|
16
|
+
|
17
|
+
result = Kernel.system(
|
18
|
+
{},
|
19
|
+
*command,
|
20
|
+
chdir: Rails.root.to_s,
|
21
|
+
out: $stdout,
|
22
|
+
err: $stderr
|
23
|
+
)
|
24
|
+
|
25
|
+
unless result
|
26
|
+
puts "sewing_kit:server:start failed"
|
27
|
+
exit(1)
|
28
|
+
end
|
29
|
+
|
30
|
+
result
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def command
|
36
|
+
command_list = [
|
37
|
+
'node',
|
38
|
+
default_entrypoint,
|
39
|
+
].compact
|
40
|
+
|
41
|
+
command_list.join(' ')
|
42
|
+
end
|
43
|
+
|
44
|
+
def default_entrypoint
|
45
|
+
'build/server/main.js'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/lib/tasks/sewing_kit.rake
CHANGED
@@ -12,6 +12,14 @@ namespace :sewing_kit do
|
|
12
12
|
compiler = SewingKit::Webpack::Compiler.new
|
13
13
|
compiler.compile
|
14
14
|
end
|
15
|
+
|
16
|
+
namespace :server do
|
17
|
+
desc "Starts the production server"
|
18
|
+
task start: :environment do
|
19
|
+
server = SewingKit::Webpack::Server.new
|
20
|
+
server.start
|
21
|
+
end
|
22
|
+
end
|
15
23
|
end
|
16
24
|
|
17
25
|
if Rake::Task.task_defined?("assets:precompile")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sewing_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.124.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Sauve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/sewing_kit/webpack/manifest/development.rb
|
124
124
|
- lib/sewing_kit/webpack/manifest/production.rb
|
125
125
|
- lib/sewing_kit/webpack/manifest/test_with_no_assets.rb
|
126
|
+
- lib/sewing_kit/webpack/server.rb
|
126
127
|
- lib/sewing_kit/webpack/webpack.rb
|
127
128
|
- lib/tasks/sewing_kit.rake
|
128
129
|
homepage: https://github.com/Shopify/sewing-kit/tree/master/gems/sewing_kit
|