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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad8a311afdf9ea5efa60527866ac02247e3c91189a636aa78c9dde602f304e0f
4
- data.tar.gz: 65e3897e31a73ae2ec5b3756672a35ccfda44df1d3cffa22a7473193aaf40b3a
3
+ metadata.gz: c3a05925e10dba45f77fcf36f23bf1f0d777ab6993f7994f3b216169dde31dd7
4
+ data.tar.gz: ca891a9517eaca9dbcacef5c838c626e587a1111f9a58105b12abf3e8adbcab4
5
5
  SHA512:
6
- metadata.gz: 9c0706c23cb462eb4240def360fcfc0d2afd158f3b3db2846290ddcbea176ea94b00ec3a9cbf2471c372ea8cef7668a625bb55fca2f0e8429c8514ee59cc2d65
7
- data.tar.gz: d255523fbb50e830708ac1dfaec86aede73ab3b815e0653627cf51488c16f25a234effceea37b177dd9cb28d46a30fa4bff5c7c4160820c7d610eff2796d1ea4
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
@@ -5,6 +5,7 @@ require 'rails/railtie'
5
5
  require 'sewing_kit/webpack/compiler'
6
6
  require 'sewing_kit/webpack/helper'
7
7
  require 'sewing_kit/webpack/dev'
8
+ require 'sewing_kit/webpack/server'
8
9
 
9
10
  module SewingKit
10
11
  class Railtie < ::Rails::Railtie
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SewingKit
3
- VERSION = "0.123.0"
3
+ VERSION = "0.124.0"
4
4
  end
@@ -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
@@ -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.123.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-08 00:00:00.000000000 Z
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