sewing_kit 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sewing_kit/version.rb +1 -1
- data/lib/sewing_kit/webpack/compiler.rb +3 -1
- metadata +2 -18
- data/lib/install/app/basic/components/App/App.js +0 -8
- data/lib/install/app/basic/components/App/App.scss +0 -4
- data/lib/install/app/basic/components/App/index.js +0 -3
- data/lib/install/app/basic/index.js +0 -5
- data/lib/install/app/quilt/components/App/App.js +0 -10
- data/lib/install/app/quilt/components/App/App.scss +0 -4
- data/lib/install/app/quilt/components/App/index.js +0 -3
- data/lib/install/app/quilt/index.js +0 -6
- data/lib/install/bin/webpack.tt +0 -12
- data/lib/install/patchwork/component_generator.rb +0 -0
- data/lib/install/patchwork/install_generator.rb +0 -73
- data/lib/install/patchwork/section_generator.rb +0 -0
- data/lib/install/sewing-kit.config.js +0 -5
- data/lib/install/template.rb +0 -101
- data/lib/install/tsconfig.json +0 -35
- data/lib/install/tslint.json +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b110a7587fc6883bb078c87696ce7c28da8e1bb
|
4
|
+
data.tar.gz: c30e9dcb81d96355bf80d6b99e8e24ea8ebdb479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97d9590d610ea1d27fc140170e8eb429fad9761896c636023f37fd437c8bfe631b3b96104c9bb4e5d42c5780e99c8f2b23a9b42260eae29a2c2541549e6cd9c8
|
7
|
+
data.tar.gz: 78c1b9a86f56e1dc8f7421506836d2412dce24b32ae80ff17ed528730a2196f6ea6e2473b997ad6908d0925850e15c6c101a8b38d8e04927c0beff03a64ba530
|
data/lib/sewing_kit/version.rb
CHANGED
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.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Sauve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -46,22 +46,6 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
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
49
|
- lib/sewing_kit.rb
|
66
50
|
- lib/sewing_kit/rails.rb
|
67
51
|
- lib/sewing_kit/railtie.rb
|
data/lib/install/bin/webpack.tt
DELETED
@@ -1,12 +0,0 @@
|
|
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
|
@@ -1,73 +0,0 @@
|
|
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
|
data/lib/install/template.rb
DELETED
@@ -1,101 +0,0 @@
|
|
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
|
data/lib/install/tsconfig.json
DELETED
@@ -1,35 +0,0 @@
|
|
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/install/tslint.json
DELETED