sewing_kit 0.128.0 → 0.129.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 +5 -1
- data/lib/generators/sewing_kit/install_generator.rb +4 -4
- data/lib/sewing_kit/version.rb +1 -1
- data/lib/sewing_kit/webpack/compiler.rb +1 -1
- data/lib/sewing_kit/webpack/dev.rb +3 -3
- data/lib/sewing_kit/webpack/helper.rb +2 -2
- data/lib/sewing_kit/webpack/manifest.rb +2 -2
- data/lib/sewing_kit/webpack/manifest/development.rb +5 -3
- data/lib/sewing_kit/webpack/manifest/production.rb +1 -1
- data/lib/tasks/sewing_kit.rake +8 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 192f93794571de06b57d5125eec9da37d1331c3dbb47a2c530e29d6f4693cb47
|
4
|
+
data.tar.gz: d06a650795388f99d0680e007e7402b8d964562be69610aa92032e9e24abdac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 773c4e613be0301501b9d8e31b12bce81027f7aaf39aabafa87c07a5a76430498b6c39d81801f4af44b1ea48e47cf127edddca88e7c2031dc22c44ffc202fe58
|
7
|
+
data.tar.gz: 056bdc1ff814b70f35ffac31bcba3b7d95560002437272f8e615ae93d8e6a4bdcb49bb08b0d8db9961c99f88488ff3cd616cb991b044c125578ca41f660455de
|
data/README.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
Zero configuration, high performance front end development at organization scale.
|
4
4
|
|
5
|
-
`sewing_kit`
|
5
|
+
`sewing_kit` can be used in a Rails application instead of [Webpacker](https://github.com/rails/webpacker), allowing to embed bundled/compiled javascript in erb pages.
|
6
|
+
|
7
|
+
For a more complete and modern stack with performance-as-a-feature, consider [quilt_rails](https://github.com/Shopify/quilt/tree/master/gems/quilt_rails).
|
8
|
+
|
9
|
+
For details on configuring and usage of the `sewing-kit` node package, see the [sewing-kit README](/README.md).
|
6
10
|
|
7
11
|
## Quick Start
|
8
12
|
|
@@ -19,16 +19,16 @@ module SewingKit
|
|
19
19
|
@javascript_path = options[:javascript_path]
|
20
20
|
|
21
21
|
if Project.uses_webpacker?
|
22
|
-
warn
|
22
|
+
warn("
|
23
23
|
WARNING: We've detected you currently have webpacker config at config/webpacker.yml.
|
24
24
|
You may experience conflicts between sewing-kit and webpacker's behaviour as build tools.
|
25
25
|
If your app was made with `rails new`, try rerunning it with `--skip-webpack-install --skip-javascript`
|
26
|
-
"
|
26
|
+
")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def create_config_files
|
31
|
-
say
|
31
|
+
say("Creating JS tooling config files")
|
32
32
|
copy_file("editorconfig", ".editorconfig")
|
33
33
|
copy_file("eslintignore", ".eslintignore")
|
34
34
|
copy_file("prettierignore", ".prettierignore")
|
@@ -39,7 +39,7 @@ module SewingKit
|
|
39
39
|
|
40
40
|
def install_js_dependencies
|
41
41
|
return if options.skip_yarn?
|
42
|
-
say
|
42
|
+
say("Installing javascript dependencies")
|
43
43
|
system("yarn add @shopify/sewing-kit")
|
44
44
|
system("yarn add typescript")
|
45
45
|
end
|
data/lib/sewing_kit/version.rb
CHANGED
@@ -8,7 +8,7 @@ module SewingKit
|
|
8
8
|
def initialize
|
9
9
|
super(
|
10
10
|
"nodejs is not installed. " \
|
11
|
-
"Try creating a `.
|
11
|
+
"Try creating a `.buildpacks` file in the root of the project with following content:
|
12
12
|
|
13
13
|
https://github.com/heroku/heroku-buildpack-nodejs.git
|
14
14
|
https://github.com/heroku/heroku-buildpack-ruby.git
|
@@ -39,13 +39,13 @@ module SewingKit
|
|
39
39
|
|
40
40
|
def handle_exit
|
41
41
|
return if $ERROR_INFO.nil?
|
42
|
-
Process.kill
|
42
|
+
Process.kill('SIGTERM', pid)
|
43
43
|
rescue Errno::ESRCH
|
44
44
|
nil
|
45
45
|
end
|
46
46
|
|
47
47
|
def detach
|
48
|
-
Process.detach
|
48
|
+
Process.detach(pid)
|
49
49
|
end
|
50
50
|
|
51
51
|
def command
|
@@ -54,7 +54,7 @@ module SewingKit
|
|
54
54
|
heap_config,
|
55
55
|
sewing_kit_bin,
|
56
56
|
'dev',
|
57
|
-
'--
|
57
|
+
'--log-level',
|
58
58
|
log_level,
|
59
59
|
].compact.concat(options)
|
60
60
|
|
@@ -16,7 +16,7 @@ module SewingKit
|
|
16
16
|
|
17
17
|
assets = SewingKit::Webpack::Manifest.asset_dependencies(entrypoint_name, request.user_agent)
|
18
18
|
|
19
|
-
raise UnknownAssetError, "#{entrypoint_name} was not found in manifest." if raise_unknown_error?
|
19
|
+
raise UnknownAssetError, "#{entrypoint_name} was not found in manifest." if raise_unknown_error?(assets)
|
20
20
|
return [] unless assets && assets[extension]
|
21
21
|
|
22
22
|
dependencies = assets[extension]
|
@@ -56,7 +56,7 @@ module SewingKit
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def create_asset_tag(tag_type, asset, tag_options)
|
59
|
-
raise ArgumentError, "Invalid tag type: #{tag_type}" unless [:script, :link].include?
|
59
|
+
raise ArgumentError, "Invalid tag type: #{tag_type}" unless [:script, :link].include?(tag_type)
|
60
60
|
|
61
61
|
options = tag_options.clone
|
62
62
|
|
@@ -24,14 +24,14 @@ module SewingKit
|
|
24
24
|
# Raised if the node-generated manifest cannot be read from the filesystem.
|
25
25
|
class ManifestLoadError < StandardError
|
26
26
|
def initialize(path, cause)
|
27
|
-
super
|
27
|
+
super("Could not load manifest from #{path} (original error #{cause})")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
# Raised if the node-generated manifest returns unparseable JSON.
|
32
32
|
class ManifestParseError < StandardError
|
33
33
|
def initialize(cause)
|
34
|
-
super
|
34
|
+
super("Could not parse manifest JSON (original error #{cause})")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -43,7 +43,9 @@ module SewingKit
|
|
43
43
|
return normalize_metadata(result)
|
44
44
|
end
|
45
45
|
rescue => e
|
46
|
-
Rails.logger.warn
|
46
|
+
Rails.logger.warn(
|
47
|
+
"[sewing_kit] could not read manifest from #{@metadata_path}; falling back to node. #{e}"
|
48
|
+
)
|
47
49
|
@metadata_path = nil
|
48
50
|
end
|
49
51
|
|
@@ -81,8 +83,8 @@ module SewingKit
|
|
81
83
|
|
82
84
|
class OnlyUseInProductionError < StandardError
|
83
85
|
def initialize
|
84
|
-
super
|
85
|
-
"for deploying assets to a CDN. Do not use it in development."
|
86
|
+
super("The SewingKit::Webpack::Manifest#manifest is intended "\
|
87
|
+
"for deploying assets to a CDN. Do not use it in development.")
|
86
88
|
end
|
87
89
|
end
|
88
90
|
end
|
data/lib/tasks/sewing_kit.rake
CHANGED
@@ -29,3 +29,11 @@ if Rake::Task.task_defined?("assets:precompile")
|
|
29
29
|
else
|
30
30
|
Rake::Task.define_task("assets:precompile" => %w(sewing_kit:build))
|
31
31
|
end
|
32
|
+
|
33
|
+
unless Rake::Task.task_defined?('assets:clean')
|
34
|
+
namespace :assets do
|
35
|
+
task :clean do
|
36
|
+
# This empty task is to offer the same interface than sprockets and webpacker
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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.
|
4
|
+
version: 0.129.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-
|
11
|
+
date: 2020-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.89.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.89.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rubocop-git
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.1.3
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-shopify
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.0.5
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.0.5
|
97
111
|
description:
|
98
112
|
email:
|
99
113
|
- chris.sauve@shopify.com
|