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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 204b9044b82e140fcb0c87f82694eaca05f8faaf
4
- data.tar.gz: fe7e76808a74897bce2b183b40936a10eef9321f
3
+ metadata.gz: 6b110a7587fc6883bb078c87696ce7c28da8e1bb
4
+ data.tar.gz: c30e9dcb81d96355bf80d6b99e8e24ea8ebdb479
5
5
  SHA512:
6
- metadata.gz: ffb82d4d7746932561ef10c859068406d20aed862c8e4a77c396dd8aefe2751f18a12939cd2758d64b7994b445610c78c2778ea9e4f29d66d56d735092d587b4
7
- data.tar.gz: 758480842267758497851cc222297f433c8b3c7e067f3f166830b5e63462f98aeeac61b5a394355dd962c1f19be3926075890adeb1d8bef2b7b10ba13a7e5554
6
+ metadata.gz: 97d9590d610ea1d27fc140170e8eb429fad9761896c636023f37fd437c8bfe631b3b96104c9bb4e5d42c5780e99c8f2b23a9b42260eae29a2c2541549e6cd9c8
7
+ data.tar.gz: 78c1b9a86f56e1dc8f7421506836d2412dce24b32ae80ff17ed528730a2196f6ea6e2473b997ad6908d0925850e15c6c101a8b38d8e04927c0beff03a64ba530
@@ -1,3 +1,3 @@
1
1
  module SewingKit
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -30,7 +30,9 @@ module SewingKit
30
30
 
31
31
  private
32
32
  def node_env
33
- ENV['NODE_ENV'] || Rails.env.to_s
33
+ env = ENV['NODE_ENV'] || Rails.env.to_s
34
+ env = 'development' if env == 'test'
35
+ env
34
36
  end
35
37
  end
36
38
  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.5.1
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-07-24 00:00:00.000000000 Z
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
@@ -1,8 +0,0 @@
1
- import * as styles from './App.scss';
2
-
3
- export default function App() {
4
- const node = document.createElement('div');
5
- node.textContent = 'Hello world!';
6
- node.className = styles.App;
7
- return node;
8
- }
@@ -1,4 +0,0 @@
1
- .App {
2
- font-size: 4rem;
3
- font-weight: bold;
4
- }
@@ -1,3 +0,0 @@
1
- import App from './App';
2
-
3
- export default App;
@@ -1,5 +0,0 @@
1
- import App from './components/App';
2
-
3
- document.body.appendChild(
4
- App()
5
- );
@@ -1,10 +0,0 @@
1
- import * as React from 'react';
2
- import {Content, Header} from '@shopify/quilt';
3
-
4
- export default function App() {
5
- return (
6
- <Content header={<Header>TODO</Header>}>
7
- <div className={styles.App}>Hello world!</div>
8
- </Content>
9
- );
10
- }
@@ -1,4 +0,0 @@
1
- .App {
2
- font-size: 4rem;
3
- font-weight: bold;
4
- }
@@ -1,3 +0,0 @@
1
- import App from './App';
2
-
3
- export default App;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import {render} from 'react-dom';
3
- import App from './components/App';
4
-
5
- const node = document.getElementById('app');
6
- render(<App />, node);
@@ -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
@@ -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
@@ -1,5 +0,0 @@
1
- module.exports = function() {
2
- assetDevServerHost: 'localhost',
3
- assetDevServerPort: 9876,
4
- assetDevServerPath: 'assets/',
5
- }
@@ -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
@@ -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
- }
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["tslint-config-shopify"]
3
- }