sewing_kit 0.27.2 → 0.27.3

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
  SHA1:
3
- metadata.gz: 82b56d2fde25a89c489676d3726d426d70de12bb
4
- data.tar.gz: 45fb02c608830031960c3ae278f26048fe146412
3
+ metadata.gz: 54caa1fe8a4c60c1040e465c857f5d255c111964
4
+ data.tar.gz: 80662d8a0a5c5995ab9a4294ff2ee3b002aa759a
5
5
  SHA512:
6
- metadata.gz: 75023c4bf3810f14c5269b5e73e00cb73d2bf8262c71301ac54024408dae172333b2d71aec38bd70b43f5231fe076fb324add22206583b6a96b1cf53ccf0e99a
7
- data.tar.gz: 5ff0c63902bae55d5ff14dbf59962d1bac7964ea5f2a163772a7b996779f7a0befa3b853fc502b018a479ca21118d6ae00e2e4523e412653222f546c8f3a88f9
6
+ metadata.gz: 69db1d5bb726b8dd4189175b1556f5b053688f5a7252a26f990d10e09a58c3e3843afab12e83704e8118c7db12a5fd18ba18fd361c53ccda241cd6602bda2708
7
+ data.tar.gz: 57cce427b05e3de2b2b795ad0ef0cf7bc137b927f4a9121a5c64915cc6d8bbf77bdefbe04a2c616006f3eeb4151ae95ce85364a97eed1e0edb68d2ce86937289
data/README.md CHANGED
@@ -28,7 +28,7 @@ sewing_kit looks for JavaScript in `app/ui/index.js`. The code in `index.js` (a
28
28
  The `main` bundle is imported into `erb` files using Rails helpers:
29
29
 
30
30
  ```erb
31
- <%= sewing_kit_link_tag *sewing_kit_assets('main') %>
31
+ <%= sewing_kit_link_tag *sewing_kit_assets('main', extension: 'css') %>
32
32
  <%= sewing_kit_script_tag *sewing_kit_assets('main') %>
33
33
  ```
34
34
 
@@ -82,6 +82,11 @@ A typical Polaris app will use React to render views and components. The follow
82
82
  └── Home.js
83
83
  ```
84
84
 
85
+ ## Which version of sewing-kit can I use?
86
+ Assume that the sewing_kit gem's latest minor version requires _at least_ the same minor version of the sewing-kit package.
87
+
88
+ If sewing-kit makes a breaking change, this gem's minor version will be bumped to match the required sewing-kit version.
89
+
85
90
  ## Transitioning from sprockets-commoner
86
91
  It is currently not recommended to use `sprockets-commoner` and `sewing_kit` in the same project.
87
92
  Minimally, it is required that the project does not have its own `babel-*` libraries that `sewing-kit` currently has as [dependencies](https://github.com/Shopify/sewing-kit/blob/master/package.json#L97~L102).
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SewingKit
3
- VERSION = "0.27.2"
3
+ VERSION = "0.27.3"
4
4
  end
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
+ require 'sewing_kit/webpack/webpack'
3
+
2
4
  module SewingKit
3
5
  module Webpack
4
6
  class Compiler
5
7
  def compile
8
+ raise NodeSewingKitNotRunnable, node_env unless File.exist?('node_modules/.bin/sewing-kit')
9
+
6
10
  result = Kernel.system(
7
11
  { 'NODE_ENV' => node_env },
8
12
  *command,
@@ -6,25 +6,6 @@ module SewingKit
6
6
  module Webpack
7
7
  # Webpack manifest loading, caching & entry point retrieval
8
8
  class Manifest
9
- # Raised if the node sewing-kit isn't installed/runnable.
10
- class NodeSewingKitNotRunnable < StandardError
11
- def initialize(mode, cause)
12
- env_message = if 'production' == mode
13
- "\nIf this is a container build, try:\n" \
14
- " - Adding `YARN_PRODUCTION=false` to your pipeline's environment variables\n" \
15
- " - Adding the node buildpack: https://github.com/heroku/heroku-buildpack-nodejs"
16
- else
17
- "Try `yarn add --dev @shopify/sewing-kit`"
18
- end
19
-
20
- super(
21
- "Could not fetch manifest because node sewing-kit is not runnable. " \
22
- "#{env_message}\n" \
23
- "Original error #{cause}"
24
- )
25
- end
26
- end
27
-
28
9
  class NodeSewingKitManifestMissing < StandardError
29
10
  def initialize(mode, node_error_message)
30
11
  env_message = if 'production' == mode
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require 'sewing_kit/webpack/webpack'
3
+
2
4
  module SewingKit
3
5
  module Webpack
4
6
  class Manifest
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ def highlight(message)
4
+ "\u001b[1m\u001b[37m#{message}\u001b[39m\u001b[22m"
5
+ end
6
+
7
+ module SewingKit
8
+ module Webpack
9
+ # Raised if the node sewing-kit isn't installed/runnable.
10
+ class NodeSewingKitNotRunnable < StandardError
11
+ def initialize(mode, cause = nil)
12
+ env_message = if 'development' == mode
13
+ "Try `yarn add --dev @shopify/sewing-kit`"
14
+ else
15
+ "\nIf this is a container build, try:\n" \
16
+ " - Adding #{highlight('https://github.com/heroku/heroku-buildpack-nodejs')} to your " \
17
+ "#{highlight('.buildpacks')} file\n" \
18
+ " - Adding #{highlight('YARN_PRODUCTION=false')} to your pipeline's environment variables\n" \
19
+ end
20
+
21
+ super(
22
+ "sewing-kit is not runnable.\n" \
23
+ "#{env_message}\n" +
24
+ (cause ? "Original error #{cause}" : '')
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
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.27.2
4
+ version: 0.27.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Sauve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-21 00:00:00.000000000 Z
11
+ date: 2018-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -85,6 +85,7 @@ files:
85
85
  - lib/sewing_kit/webpack/manifest/base.rb
86
86
  - lib/sewing_kit/webpack/manifest/development.rb
87
87
  - lib/sewing_kit/webpack/manifest/production.rb
88
+ - lib/sewing_kit/webpack/webpack.rb
88
89
  - lib/tasks/sewing_kit.rake
89
90
  homepage:
90
91
  licenses:
@@ -109,5 +110,5 @@ rubyforge_project:
109
110
  rubygems_version: 2.6.14
110
111
  signing_key:
111
112
  specification_version: 4
112
- summary: Shopifys modern front-end tooling, nicely packaged for Rails
113
+ summary: Shopify's modern front-end tooling, nicely packaged for Rails
113
114
  test_files: []