sewing_kit 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/lib/install/app/basic/components/App/App.js +8 -0
- data/lib/install/app/basic/components/App/App.scss +4 -0
- data/lib/install/app/basic/components/App/index.js +3 -0
- data/lib/install/app/basic/index.js +5 -0
- data/lib/install/app/quilt/components/App/App.js +10 -0
- data/lib/install/app/quilt/components/App/App.scss +4 -0
- data/lib/install/app/quilt/components/App/index.js +3 -0
- data/lib/install/app/quilt/index.js +6 -0
- data/lib/install/bin/webpack.tt +12 -0
- data/lib/install/patchwork/component_generator.rb +0 -0
- data/lib/install/patchwork/install_generator.rb +73 -0
- data/lib/install/patchwork/section_generator.rb +0 -0
- data/lib/install/sewing-kit.config.js +5 -0
- data/lib/install/template.rb +101 -0
- data/lib/install/tsconfig.json +35 -0
- data/lib/install/tslint.json +3 -0
- data/lib/sewing_kit.rb +5 -0
- data/lib/sewing_kit/rails.rb +1 -0
- data/lib/sewing_kit/railtie.rb +32 -0
- data/lib/sewing_kit/version.rb +3 -0
- data/lib/sewing_kit/webpack/compiler.rb +41 -0
- data/lib/sewing_kit/webpack/dev.rb +72 -0
- data/lib/sewing_kit/webpack/helper.rb +76 -0
- data/lib/sewing_kit/webpack/manifest.rb +65 -0
- data/lib/tasks/sewing_kit.rake +20 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 431a33c19363e493c74124b1f416b5d471b36e0a
|
4
|
+
data.tar.gz: 61cf9620bea767548234570e668e06e5959bddcc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0ef8fb8b4705914731c8bf9bd1a5f923ccac21f77b51f334dbde35d53ec79f19c7b7070fb788144e17222869d044775816bbc1ca0a99748072d495ec7c2d4613
|
7
|
+
data.tar.gz: ca77a8b18313019c03ed0524688663c13016d3994573288d20a837410fbd35baf1ebdc14c1cf56285cd486418c1c69e90394169b3ac6268310ebdbf301954a1e
|
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= shebang %>
|
2
|
+
|
3
|
+
NODE_ENV = ENV["NODE_ENV"] || ENV["RAILS_ENV"] || "development"
|
4
|
+
APP_PATH = File.expand_path('../', __dir__)
|
5
|
+
VENDOR_PATH = File.expand_path('../vendor', __dir__)
|
6
|
+
|
7
|
+
WEBPACK_BIN = "./node_modules/.bin/webpack"
|
8
|
+
WEBPACK_CONFIG = "#{APP_PATH}/config/sewing-kit.config.js"
|
9
|
+
|
10
|
+
Dir.chdir(APP_PATH) do
|
11
|
+
exec "NODE_ENV=#{NODE_ENV} #{WEBPACK_BIN} --config #{WEBPACK_CONFIG} #{ARGV.join(" ")}"
|
12
|
+
end
|
File without changes
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Patchwork
|
2
|
+
class InstallGenerator < ::Rails::Generators::Base
|
3
|
+
attr_accessor :wants_react
|
4
|
+
attr_accessor :wants_typescript
|
5
|
+
|
6
|
+
source_root File.expand_path("./templates", __FILE__)
|
7
|
+
|
8
|
+
desc "Install everything you need for a basic Patchwork integration"
|
9
|
+
|
10
|
+
def add_webpack_rails_to_gemfile
|
11
|
+
gem 'webpack-rails'
|
12
|
+
end
|
13
|
+
|
14
|
+
# def ask_about_react
|
15
|
+
# wants_react = yes?("Would you like to use React for this project?")
|
16
|
+
# wants_typescript = yes?("Would you like to use TypeScript for this project?")
|
17
|
+
# end
|
18
|
+
|
19
|
+
def augment_package_json
|
20
|
+
# TODO: linting, tests, build
|
21
|
+
end
|
22
|
+
|
23
|
+
# def copy_webpack_config
|
24
|
+
# copy_file "sewing-kit.config.js", "config/sewing-kit.config.js"
|
25
|
+
# end
|
26
|
+
|
27
|
+
# def copy_typescript_config
|
28
|
+
# return unless wants_typescript
|
29
|
+
# copy_file "tsconfig.json", "tsconfig.json"
|
30
|
+
# end
|
31
|
+
|
32
|
+
def create_entry_point
|
33
|
+
empty_directory "app/ui"
|
34
|
+
|
35
|
+
elsif wants_react
|
36
|
+
directory "app/quilt", "app/ui"
|
37
|
+
else
|
38
|
+
directory "app/basic", "app/ui"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# def add_to_gitignore
|
43
|
+
# append_to_file ".gitignore" do
|
44
|
+
# <<-EOF.strip_heredoc
|
45
|
+
# # Added by patchwork
|
46
|
+
# /node_modules
|
47
|
+
# /public/webpack
|
48
|
+
# EOF
|
49
|
+
# end
|
50
|
+
# end
|
51
|
+
|
52
|
+
# def install_javascript_dependencies
|
53
|
+
# dependencies = ["webpack", "@shopify/patchwork"]
|
54
|
+
# dependencies.concat(["react", "react-dom", "@shopify/quilt"]) if wants_react
|
55
|
+
|
56
|
+
# run "yarn add --dev #{dependencies.join(" ")}"
|
57
|
+
# end
|
58
|
+
|
59
|
+
# def run_bundle_install
|
60
|
+
# run "bundle install" if yes?("Would you like us to run 'bundle install' for you?")
|
61
|
+
# end
|
62
|
+
|
63
|
+
# def whats_next
|
64
|
+
# puts <<-EOF.strip_heredoc
|
65
|
+
# We've set up the basics of a modern FED stack for you, but you'll still
|
66
|
+
# need to:
|
67
|
+
# 1. Add the 'main' entry point in to your layout, and
|
68
|
+
# 2. Run 'foreman start' to run the webpack-dev-server and rails server
|
69
|
+
# Thanks for using Patchwork!
|
70
|
+
# EOF
|
71
|
+
# end
|
72
|
+
# end
|
73
|
+
end
|
File without changes
|
@@ -0,0 +1,101 @@
|
|
1
|
+
TEMPLATE_PATH = File.dirname(__FILE__)
|
2
|
+
|
3
|
+
# Questions
|
4
|
+
|
5
|
+
wants_react = true#yes?("Would you like to use React for this project?")
|
6
|
+
wants_typescript = true#yes?("Would you like to use TypeScript for this project?")
|
7
|
+
|
8
|
+
# Entry point
|
9
|
+
|
10
|
+
if wants_react
|
11
|
+
directory "#{TEMPLATE_PATH}/app/quilt", "app/ui"
|
12
|
+
else
|
13
|
+
directory "#{TEMPLATE_PATH}/app/basic", "app/ui"
|
14
|
+
end
|
15
|
+
|
16
|
+
# Binaries
|
17
|
+
|
18
|
+
directory "#{TEMPLATE_PATH}/bin", "bin"
|
19
|
+
chmod "bin", 0755 & ~File.umask, verbose: false
|
20
|
+
|
21
|
+
# Other
|
22
|
+
|
23
|
+
append_to_file ".gitignore", <<-EOS.strip_heredoc
|
24
|
+
|
25
|
+
# Added by sewing_kit
|
26
|
+
/node_modules
|
27
|
+
/public/patckwork
|
28
|
+
EOS
|
29
|
+
|
30
|
+
# Configuration
|
31
|
+
|
32
|
+
## package.json
|
33
|
+
|
34
|
+
package_json_path = File.expand_path "./package.json", destination_root
|
35
|
+
package_json = File.exists?(package_json_path) ? JSON.parse(File.read(package_json_path)) : Hash.new
|
36
|
+
scripts = package_json.fetch("scripts", Hash.new)
|
37
|
+
|
38
|
+
unless scripts.key?("lint")
|
39
|
+
scripts["lint"] = wants_typescript ? "tslint ./app" : "eslint ./app --max-warnings 0"
|
40
|
+
end
|
41
|
+
|
42
|
+
unless scripts.key?("test")
|
43
|
+
scripts["test"] = ""
|
44
|
+
end
|
45
|
+
|
46
|
+
unless scripts.key?("check")
|
47
|
+
scripts["check"] = "yarn run lint && yarn run test"
|
48
|
+
end
|
49
|
+
|
50
|
+
unless wants_typescript
|
51
|
+
scripts["eslintConfig"] = {
|
52
|
+
"extends": [
|
53
|
+
wants_react ? "plugin:shopify/react" : "plugin:shopify/esnext"
|
54
|
+
]
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
package_json["scripts"] = scripts
|
59
|
+
create_file package_json_path, JSON.pretty_generate(package_json, indent: " ")
|
60
|
+
|
61
|
+
## other
|
62
|
+
|
63
|
+
copy_file "#{TEMPLATE_PATH}/sewing-kit.config.js", "config/sewing-kit.config.js"
|
64
|
+
|
65
|
+
if wants_typescript
|
66
|
+
copy_file "#{TEMPLATE_PATH}/tsconfig.json", "tsconfig.json"
|
67
|
+
copy_file "#{TEMPLATE_PATH}/tslint.json", "tslint.json"
|
68
|
+
empty_directory "config/typescript/modules"
|
69
|
+
else
|
70
|
+
copy_file "#{TEMPLATE_PATH}/.eslintignore", ".eslintignore"
|
71
|
+
end
|
72
|
+
|
73
|
+
# Dependencies
|
74
|
+
|
75
|
+
dev_dependencies = %w(webpack@2.2.0 file:../../sewing-kit)
|
76
|
+
|
77
|
+
if wants_typescript
|
78
|
+
# dev_dependencies.concat(["typescript", "tslint", "tslint-config-shopify"])
|
79
|
+
dev_dependencies.concat %w(typescript tslint)
|
80
|
+
else
|
81
|
+
dev_dependencies.concat %w(eslint eslint-plugin-shopify)
|
82
|
+
end
|
83
|
+
|
84
|
+
run "yarn add --dev #{dev_dependencies.join(" ")}"
|
85
|
+
|
86
|
+
dependencies = []
|
87
|
+
dependencies.concat %w(react react-dom file:../../quilt) if wants_react
|
88
|
+
|
89
|
+
run "yarn add #{dependencies.join(" ")}"
|
90
|
+
|
91
|
+
# Finishing up
|
92
|
+
|
93
|
+
puts <<-EOS.strip_heredoc
|
94
|
+
We've set up the basics of a modern FED stack for you, but you'll still
|
95
|
+
need to:
|
96
|
+
|
97
|
+
1. Add the 'main' entry point in to your layout, and
|
98
|
+
2. Run 'foreman start' to run the webpack-dev-server and rails server
|
99
|
+
|
100
|
+
Thanks for using Sewing Kit!
|
101
|
+
EOS
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"baseUrl": ".",
|
4
|
+
"rootDir": ".",
|
5
|
+
"target": "es6",
|
6
|
+
"module": "es2015",
|
7
|
+
"moduleResolution": "node",
|
8
|
+
"jsx": "react",
|
9
|
+
"strictNullChecks": true,
|
10
|
+
"noImplicitAny": true,
|
11
|
+
"experimentalDecorators": true,
|
12
|
+
"typeRoots": [
|
13
|
+
"./node_modules/@types"
|
14
|
+
],
|
15
|
+
"paths": {
|
16
|
+
"*": [
|
17
|
+
"*",
|
18
|
+
"app/ui/*"
|
19
|
+
]
|
20
|
+
},
|
21
|
+
"lib": [
|
22
|
+
"dom",
|
23
|
+
"es2015",
|
24
|
+
"es2016",
|
25
|
+
"es2017",
|
26
|
+
"dom.iterable",
|
27
|
+
"scripthost"
|
28
|
+
]
|
29
|
+
},
|
30
|
+
"include": [
|
31
|
+
"node_modules/@shopify/patchwork/typescript",
|
32
|
+
"config/typescript/**/*",
|
33
|
+
"app/**/*"
|
34
|
+
]
|
35
|
+
}
|
data/lib/sewing_kit.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "sewing_kit/railtie" if defined? Rails
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rails'
|
2
|
+
require 'rails/railtie'
|
3
|
+
require 'sewing_kit/webpack/compiler'
|
4
|
+
require 'sewing_kit/webpack/helper'
|
5
|
+
require 'sewing_kit/webpack/dev'
|
6
|
+
|
7
|
+
module SewingKit
|
8
|
+
class Railtie < ::Rails::Railtie
|
9
|
+
initializer "sewing_kit.initialize_webpack" do
|
10
|
+
if Rails.env.development? && Rails.const_defined?(:Server)
|
11
|
+
webpack_dev = SewingKit::Webpack::Dev.new
|
12
|
+
webpack_dev.start
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
config.after_initialize do
|
17
|
+
ActiveSupport.on_load(:action_view) do
|
18
|
+
include SewingKit::Webpack::Helper
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
config.sewing_kit = ActiveSupport::OrderedOptions.new
|
23
|
+
config.sewing_kit.webpack = ActiveSupport::OrderedOptions.new
|
24
|
+
config.sewing_kit.webpack.manifest_dir = 'tmp/sewing-kit'
|
25
|
+
config.sewing_kit.webpack.manifest_filename = 'sewing-kit-manifest.json'
|
26
|
+
config.sewing_kit.webpack.verbose = false
|
27
|
+
|
28
|
+
rake_tasks do
|
29
|
+
load "tasks/sewing_kit.rake"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module SewingKit
|
2
|
+
module Webpack
|
3
|
+
class Compiler
|
4
|
+
def compile
|
5
|
+
result = Kernel.system(
|
6
|
+
{ 'NODE_ENV' => node_env },
|
7
|
+
*command,
|
8
|
+
chdir: Rails.root.to_s,
|
9
|
+
out: $stdout,
|
10
|
+
err: $stderr,
|
11
|
+
)
|
12
|
+
|
13
|
+
if !result
|
14
|
+
puts "sewing-kit compile failed with error code #{$?}"
|
15
|
+
exit(1)
|
16
|
+
end
|
17
|
+
result
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def command
|
23
|
+
[
|
24
|
+
'node_modules/.bin/sewing-kit',
|
25
|
+
'compile',
|
26
|
+
'--config-file',
|
27
|
+
'config/sewing-kit.config.js',
|
28
|
+
'--target',
|
29
|
+
'client',
|
30
|
+
'--env',
|
31
|
+
node_env,
|
32
|
+
].reject(&:empty?)
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def node_env
|
37
|
+
ENV['NODE_ENV'] || Rails.env.to_s
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module SewingKit
|
2
|
+
module Webpack
|
3
|
+
class Dev
|
4
|
+
attr_accessor :pid
|
5
|
+
|
6
|
+
def start
|
7
|
+
@pid = spawn
|
8
|
+
detach
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def command
|
14
|
+
cmd = [
|
15
|
+
'node_modules/.bin/sewing-kit',
|
16
|
+
'dev',
|
17
|
+
'--config-file',
|
18
|
+
'config/sewing-kit.config.js',
|
19
|
+
'--target',
|
20
|
+
'client',
|
21
|
+
'--env',
|
22
|
+
node_env
|
23
|
+
]
|
24
|
+
|
25
|
+
if hmr?
|
26
|
+
cmd += ['--hot', '--hot-host', hot_host]
|
27
|
+
else
|
28
|
+
cmd += ['--lazy', '--super-speed']
|
29
|
+
end
|
30
|
+
|
31
|
+
cmd += ['--verbose'] if ::Rails.configuration.sewing_kit.webpack.verbose
|
32
|
+
|
33
|
+
cmd
|
34
|
+
end
|
35
|
+
|
36
|
+
def spawn
|
37
|
+
Kernel.spawn(
|
38
|
+
{ 'NODE_ENV' => node_env },
|
39
|
+
*command,
|
40
|
+
chdir: Rails.root.to_s,
|
41
|
+
out: $stdout,
|
42
|
+
err: $stderr,
|
43
|
+
) || exit(1)
|
44
|
+
end
|
45
|
+
|
46
|
+
def detach
|
47
|
+
Process.detach pid
|
48
|
+
end
|
49
|
+
|
50
|
+
def hmr?
|
51
|
+
@hmr ||= ENV['SK_DISABLE_HMR'] != 'true'
|
52
|
+
end
|
53
|
+
|
54
|
+
def hot_host
|
55
|
+
if host = ::Rails.configuration.sewing_kit.webpack.asset_host
|
56
|
+
if host.is_a?(Proc) || host.respond_to?(:call)
|
57
|
+
host.call(nil, nil)
|
58
|
+
else
|
59
|
+
host
|
60
|
+
end
|
61
|
+
else
|
62
|
+
"/"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
def node_env
|
68
|
+
ENV['NODE_ENV'] || Rails.env.to_s
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'action_view/helpers'
|
3
|
+
require 'sewing_kit/webpack/manifest'
|
4
|
+
|
5
|
+
module SewingKit
|
6
|
+
module Webpack
|
7
|
+
module Helper
|
8
|
+
include ActionView::Helpers
|
9
|
+
|
10
|
+
def webpack_asset_paths(source, extension: 'js')
|
11
|
+
return '' unless source.present?
|
12
|
+
|
13
|
+
paths = SewingKit::Webpack::Manifest.asset_paths(source)
|
14
|
+
|
15
|
+
return '' unless paths[extension]
|
16
|
+
|
17
|
+
[paths[extension]].flatten.reject { |path| path =~ /.*\.map$/ }
|
18
|
+
end
|
19
|
+
|
20
|
+
def sewing_kit_link_tag(*paths)
|
21
|
+
return '' if Rails.env.development?
|
22
|
+
|
23
|
+
options = paths.extract_options!
|
24
|
+
|
25
|
+
tags = paths.uniq.map { |path|
|
26
|
+
create_asset_tag(:link, path, options)
|
27
|
+
}
|
28
|
+
|
29
|
+
safe_join(tags, "\n")
|
30
|
+
end
|
31
|
+
|
32
|
+
def sewing_kit_script_tag(*paths)
|
33
|
+
options = paths.extract_options!
|
34
|
+
|
35
|
+
tags = paths.uniq.map { |path|
|
36
|
+
create_asset_tag(:script, path, options)
|
37
|
+
}
|
38
|
+
|
39
|
+
safe_join(tags, "\n")
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def create_asset_tag(tag_type, path, tag_options)
|
45
|
+
raise ArgumentError, "Invalid tag type: #{tag_type}" unless [:script, :link].include? tag_type
|
46
|
+
|
47
|
+
options = tag_options.clone
|
48
|
+
|
49
|
+
if tag_options[:integrity]
|
50
|
+
file_hash = extract_hash(path)
|
51
|
+
options[:integrity] = file_hash ? encode_hash(file_hash) : nil
|
52
|
+
end
|
53
|
+
|
54
|
+
case tag_type
|
55
|
+
when :script
|
56
|
+
content_tag(:script, '', options.reverse_merge(src: path))
|
57
|
+
when :link
|
58
|
+
tag(:link, options.reverse_merge(href: path, rel: 'stylesheet'))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def encode_hash(hash)
|
63
|
+
# sewing-kit's default config places a sha256 hash in the filename. Browsers expect integrity
|
64
|
+
# to be the Base64 encoded version of the binary hash prefixed with the hashing algorithm
|
65
|
+
binary_hash = Array(hash).pack('H*')
|
66
|
+
"sha256-#{Base64.strict_encode64(binary_hash)}"
|
67
|
+
end
|
68
|
+
|
69
|
+
def extract_hash(path)
|
70
|
+
# Consumes sewing-kit's [name]-[chunkhash].[ext] format
|
71
|
+
return unless path =~ /.*-[A-Za-z0-9]{64}\.(js|css)/
|
72
|
+
path.rpartition('-').last.split('.').first
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
module SewingKit
|
4
|
+
module Webpack
|
5
|
+
# Webpack manifest loading, caching & entry point retrieval
|
6
|
+
class Manifest
|
7
|
+
# Raised if we can't read our webpack manifest for whatever reason
|
8
|
+
class ManifestLoadError < StandardError
|
9
|
+
def initialize(message, orig)
|
10
|
+
super "#{message} (original error #{orig})"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# Raised if a supplied entry point does not exist in the webpack manifest
|
15
|
+
class EntryPointMissingError < StandardError
|
16
|
+
end
|
17
|
+
|
18
|
+
class << self
|
19
|
+
# :nodoc:
|
20
|
+
def asset_paths(source)
|
21
|
+
paths = manifest[source]
|
22
|
+
if paths
|
23
|
+
paths
|
24
|
+
else
|
25
|
+
raise EntryPointMissingError, "Can't find entry point '#{source}' in webpack manifest"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def manifest
|
30
|
+
if ::Rails.env.production?
|
31
|
+
# Cache at class level, as JSON loading/parsing can be expensive.
|
32
|
+
@manifest ||= load_manifest
|
33
|
+
else
|
34
|
+
# Cache if we're outside of production; manifest may change.
|
35
|
+
load_manifest
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def manifest_bundled?
|
42
|
+
!manifest["errors"].any? { |error| error.include? "Module build failed" }
|
43
|
+
end
|
44
|
+
|
45
|
+
def load_manifest
|
46
|
+
data = load_static_manifest
|
47
|
+
JSON.parse(data)
|
48
|
+
end
|
49
|
+
|
50
|
+
def load_static_manifest
|
51
|
+
File.read(static_manifest_path)
|
52
|
+
rescue => e
|
53
|
+
raise ManifestLoadError.new("Could not load compiled manifest from #{static_manifest_path} - have you run `rake sewing_kit:compile`?", e)
|
54
|
+
end
|
55
|
+
|
56
|
+
def static_manifest_path
|
57
|
+
::Rails.root.join(
|
58
|
+
::Rails.configuration.sewing_kit.webpack.manifest_dir,
|
59
|
+
::Rails.configuration.sewing_kit.webpack.manifest_filename
|
60
|
+
)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
TEMPLATE_PATH = File.expand_path("../install/template.rb", File.dirname(__FILE__))
|
2
|
+
|
3
|
+
namespace :sewing_kit do
|
4
|
+
desc "Install all of Shopify’s modern FED tooling"
|
5
|
+
task :install do
|
6
|
+
exec "./bin/rails app:template LOCATION=#{TEMPLATE_PATH}"
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Build webpack asset bundles"
|
10
|
+
task :compile => :environment do
|
11
|
+
compiler = SewingKit::Webpack::Compiler.new
|
12
|
+
compiler.compile
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
if Rake::Task.task_defined?('assets:precompile')
|
17
|
+
Rake::Task['assets:precompile'].enhance do
|
18
|
+
Rake::Task['sewing_kit:compile'].invoke
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sewing_kit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.6
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Sauve
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.2.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.2.0
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- chris.sauve@shopify.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- README.md
|
49
|
+
- lib/install/app/basic/components/App/App.js
|
50
|
+
- lib/install/app/basic/components/App/App.scss
|
51
|
+
- lib/install/app/basic/components/App/index.js
|
52
|
+
- lib/install/app/basic/index.js
|
53
|
+
- lib/install/app/quilt/components/App/App.js
|
54
|
+
- lib/install/app/quilt/components/App/App.scss
|
55
|
+
- lib/install/app/quilt/components/App/index.js
|
56
|
+
- lib/install/app/quilt/index.js
|
57
|
+
- lib/install/bin/webpack.tt
|
58
|
+
- lib/install/patchwork/component_generator.rb
|
59
|
+
- lib/install/patchwork/install_generator.rb
|
60
|
+
- lib/install/patchwork/section_generator.rb
|
61
|
+
- lib/install/sewing-kit.config.js
|
62
|
+
- lib/install/template.rb
|
63
|
+
- lib/install/tsconfig.json
|
64
|
+
- lib/install/tslint.json
|
65
|
+
- lib/sewing_kit.rb
|
66
|
+
- lib/sewing_kit/rails.rb
|
67
|
+
- lib/sewing_kit/railtie.rb
|
68
|
+
- lib/sewing_kit/version.rb
|
69
|
+
- lib/sewing_kit/webpack/compiler.rb
|
70
|
+
- lib/sewing_kit/webpack/dev.rb
|
71
|
+
- lib/sewing_kit/webpack/helper.rb
|
72
|
+
- lib/sewing_kit/webpack/manifest.rb
|
73
|
+
- lib/tasks/sewing_kit.rake
|
74
|
+
homepage:
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 2.0.0
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
requirements: []
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.5.2
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Shopify’s modern front-end tooling, nicely packaged for Rails
|
98
|
+
test_files: []
|