frails 0.5.0 → 0.8.1

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
  SHA256:
3
- metadata.gz: 4a5dc3c71ad5adadae28c1dd72b8b2dbff630c6b51d93084b3dce0b6902eed42
4
- data.tar.gz: 580fe686a4e0e93779571144fbc3ccd9d55398cb1a67683310068310903954bf
3
+ metadata.gz: 40e800d031dda8188539dcd2de1a7a39dcb8a8b92febb17f15c17584822d7413
4
+ data.tar.gz: 571f9743b449c15ad36138f304921c8bce4b2749195699378dd63fe51cfca378
5
5
  SHA512:
6
- metadata.gz: 28ee475ad7e401f72434510f8ed2fce9d05ecf57640ab13f7655e897b3995d3f422d9dfdec946f763c88cf7ce0282c531d280da23c641040ea39708923618ece
7
- data.tar.gz: a3142865ffd21446af2f877c30938fe6b91ea3eedf550d6dc585478ed6c87f15fa7b7fa7e3676f9592ea68cd8580529c4af35cd07e61976d62e557a8298d22a6
6
+ metadata.gz: c488c6f79278e55cc8597958119fa9584d62fa3c092886297096601a290103f1b31b3cba2278f0530f54370f36a7cd5e7682e99e1f756344bef26a70fcb00d9b
7
+ data.tar.gz: a870cde84bdc3672353ad26197271159db22eeefa429a027e584babc2eb6499aaf035812adee88e36e2fae3feb28534ad46ea677ed31d7b4045f93ddcd18d5ea
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ Autotest.add_hook :initialize do |at|
4
+ at.add_exception %r{^\./test/dummy}
5
+ at.add_exception %r{^\./test/internal/(?:log|public|tmp|app/assets)}
6
+ end
data/.gitignore CHANGED
@@ -8,4 +8,11 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .DS_Store
11
- *.log
11
+ *.log
12
+ .byebug_history
13
+ test/dummy/node_modules
14
+ test/dummy/tmp
15
+ test/dummy/log
16
+ test/internal/node_modules
17
+ test/internal/tmp
18
+ test/internal/log
@@ -1,12 +1,21 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.4
3
+ Exclude:
4
+ - test/dummy/**/*
5
+ - node_modules/**/*
3
6
  Style/Documentation:
4
7
  Enabled: false
5
8
  Style/ModuleFunction:
6
9
  Enabled: false
10
+ Style/ClassVars:
11
+ Enabled: false
7
12
  Style/ClassAndModuleChildren:
8
13
  Enabled: false
9
- Metrics/LineLength:
14
+ Naming/MethodParameterName:
15
+ Enabled: false
16
+ Metrics/MethodLength:
17
+ Max: 20
18
+ Layout/LineLength:
10
19
  Max: 100
11
20
  Layout/IndentationConsistency:
12
21
  EnforcedStyle: indented_internal_methods
data/Gemfile CHANGED
@@ -8,12 +8,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
8
8
  # development dependencies will be added by default to the :development group.
9
9
  gemspec
10
10
 
11
- # Declare any dependencies that are still in development here instead of in
12
- # your gemspec. These might include edge Rails or gems from your path or
13
- # Git. Remember to move these dependencies to your gemspec before releasing
14
- # your gem to rubygems.org.
15
-
16
- # To use a debugger
17
- # gem 'byebug', group: [:development, :test]
18
-
19
11
  gem 'rubocop', require: false
12
+ gem 'combustion'
13
+ gem 'minitest', '~> 5.0'
14
+ gem 'minitest-autotest'
15
+ gem 'minitest-focus'
16
+ gem 'autotest-suffix'
17
+ gem 'mocha'
@@ -1,161 +1,116 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frails (0.4.0)
4
+ frails (0.8.1)
5
+ activesupport (>= 6.0)
5
6
  nokogiri (>= 1.10.4)
6
7
  rack-proxy (>= 0.6.5)
7
- rails (>= 6.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (6.0.0)
13
- actionpack (= 6.0.0)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- actionmailbox (6.0.0)
17
- actionpack (= 6.0.0)
18
- activejob (= 6.0.0)
19
- activerecord (= 6.0.0)
20
- activestorage (= 6.0.0)
21
- activesupport (= 6.0.0)
22
- mail (>= 2.7.1)
23
- actionmailer (6.0.0)
24
- actionpack (= 6.0.0)
25
- actionview (= 6.0.0)
26
- activejob (= 6.0.0)
27
- mail (~> 2.5, >= 2.5.4)
28
- rails-dom-testing (~> 2.0)
29
- actionpack (6.0.0)
30
- actionview (= 6.0.0)
31
- activesupport (= 6.0.0)
32
- rack (~> 2.0)
12
+ actionpack (6.0.3.2)
13
+ actionview (= 6.0.3.2)
14
+ activesupport (= 6.0.3.2)
15
+ rack (~> 2.0, >= 2.0.8)
33
16
  rack-test (>= 0.6.3)
34
17
  rails-dom-testing (~> 2.0)
35
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.0.0)
37
- actionpack (= 6.0.0)
38
- activerecord (= 6.0.0)
39
- activestorage (= 6.0.0)
40
- activesupport (= 6.0.0)
41
- nokogiri (>= 1.8.5)
42
- actionview (6.0.0)
43
- activesupport (= 6.0.0)
19
+ actionview (6.0.3.2)
20
+ activesupport (= 6.0.3.2)
44
21
  builder (~> 3.1)
45
22
  erubi (~> 1.4)
46
23
  rails-dom-testing (~> 2.0)
47
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.0.0)
49
- activesupport (= 6.0.0)
50
- globalid (>= 0.3.6)
51
- activemodel (6.0.0)
52
- activesupport (= 6.0.0)
53
- activerecord (6.0.0)
54
- activemodel (= 6.0.0)
55
- activesupport (= 6.0.0)
56
- activestorage (6.0.0)
57
- actionpack (= 6.0.0)
58
- activejob (= 6.0.0)
59
- activerecord (= 6.0.0)
60
- marcel (~> 0.3.1)
61
- activesupport (6.0.0)
25
+ activesupport (6.0.3.2)
62
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
63
27
  i18n (>= 0.7, < 2)
64
28
  minitest (~> 5.1)
65
29
  tzinfo (~> 1.1)
66
- zeitwerk (~> 2.1, >= 2.1.8)
67
- ast (2.4.0)
68
- builder (3.2.3)
69
- concurrent-ruby (1.1.5)
70
- crass (1.0.4)
30
+ zeitwerk (~> 2.2, >= 2.2.2)
31
+ ast (2.4.1)
32
+ autotest-suffix (1.1.0)
33
+ builder (3.2.4)
34
+ combustion (1.3.0)
35
+ activesupport (>= 3.0.0)
36
+ railties (>= 3.0.0)
37
+ thor (>= 0.14.6)
38
+ concurrent-ruby (1.1.6)
39
+ crass (1.0.6)
71
40
  erubi (1.9.0)
72
- globalid (0.4.2)
73
- activesupport (>= 4.2.0)
74
- i18n (1.6.0)
41
+ i18n (1.8.5)
75
42
  concurrent-ruby (~> 1.0)
76
- jaro_winkler (1.5.3)
77
- loofah (2.3.0)
43
+ loofah (2.6.0)
78
44
  crass (~> 1.0.2)
79
45
  nokogiri (>= 1.5.9)
80
- mail (2.7.1)
81
- mini_mime (>= 0.1.1)
82
- marcel (0.3.3)
83
- mimemagic (~> 0.3.2)
84
- method_source (0.9.2)
85
- mimemagic (0.3.3)
86
- mini_mime (1.0.2)
46
+ method_source (1.0.0)
87
47
  mini_portile2 (2.4.0)
88
- minitest (5.12.2)
89
- nio4r (2.5.2)
90
- nokogiri (1.10.4)
48
+ minitest (5.14.1)
49
+ minitest-autotest (1.1.1)
50
+ minitest-server (~> 1.0)
51
+ path_expander (~> 1.0)
52
+ minitest-focus (1.2.1)
53
+ minitest (>= 4, < 6)
54
+ minitest-server (1.0.6)
55
+ minitest (~> 5.0)
56
+ mocha (1.11.2)
57
+ nokogiri (1.10.10)
91
58
  mini_portile2 (~> 2.4.0)
92
- parallel (1.17.0)
93
- parser (2.6.4.1)
94
- ast (~> 2.4.0)
95
- rack (2.0.7)
59
+ parallel (1.19.2)
60
+ parser (2.7.1.4)
61
+ ast (~> 2.4.1)
62
+ path_expander (1.1.0)
63
+ rack (2.2.3)
96
64
  rack-proxy (0.6.5)
97
65
  rack
98
66
  rack-test (1.1.0)
99
67
  rack (>= 1.0, < 3)
100
- rails (6.0.0)
101
- actioncable (= 6.0.0)
102
- actionmailbox (= 6.0.0)
103
- actionmailer (= 6.0.0)
104
- actionpack (= 6.0.0)
105
- actiontext (= 6.0.0)
106
- actionview (= 6.0.0)
107
- activejob (= 6.0.0)
108
- activemodel (= 6.0.0)
109
- activerecord (= 6.0.0)
110
- activestorage (= 6.0.0)
111
- activesupport (= 6.0.0)
112
- bundler (>= 1.3.0)
113
- railties (= 6.0.0)
114
- sprockets-rails (>= 2.0.0)
115
68
  rails-dom-testing (2.0.3)
116
69
  activesupport (>= 4.2.0)
117
70
  nokogiri (>= 1.6)
118
- rails-html-sanitizer (1.2.0)
119
- loofah (~> 2.2, >= 2.2.2)
120
- railties (6.0.0)
121
- actionpack (= 6.0.0)
122
- activesupport (= 6.0.0)
71
+ rails-html-sanitizer (1.3.0)
72
+ loofah (~> 2.3)
73
+ railties (6.0.3.2)
74
+ actionpack (= 6.0.3.2)
75
+ activesupport (= 6.0.3.2)
123
76
  method_source
124
77
  rake (>= 0.8.7)
125
78
  thor (>= 0.20.3, < 2.0)
126
79
  rainbow (3.0.0)
127
- rake (13.0.0)
128
- rubocop (0.74.0)
129
- jaro_winkler (~> 1.5.1)
80
+ rake (13.0.1)
81
+ regexp_parser (1.7.1)
82
+ rexml (3.2.4)
83
+ rubocop (0.89.0)
130
84
  parallel (~> 1.10)
131
- parser (>= 2.6)
85
+ parser (>= 2.7.1.1)
132
86
  rainbow (>= 2.2.2, < 4.0)
87
+ regexp_parser (>= 1.7)
88
+ rexml
89
+ rubocop-ast (>= 0.1.0, < 1.0)
133
90
  ruby-progressbar (~> 1.7)
134
- unicode-display_width (>= 1.4.0, < 1.7)
91
+ unicode-display_width (>= 1.4.0, < 2.0)
92
+ rubocop-ast (0.3.0)
93
+ parser (>= 2.7.1.4)
135
94
  ruby-progressbar (1.10.1)
136
- sprockets (3.7.2)
137
- concurrent-ruby (~> 1.0)
138
- rack (> 1, < 3)
139
- sprockets-rails (3.2.1)
140
- actionpack (>= 4.0)
141
- activesupport (>= 4.0)
142
- sprockets (>= 3.0.0)
143
- thor (0.20.3)
95
+ thor (1.0.1)
144
96
  thread_safe (0.3.6)
145
- tzinfo (1.2.5)
97
+ tzinfo (1.2.7)
146
98
  thread_safe (~> 0.1)
147
- unicode-display_width (1.6.0)
148
- websocket-driver (0.7.1)
149
- websocket-extensions (>= 0.1.0)
150
- websocket-extensions (0.1.4)
151
- zeitwerk (2.1.10)
99
+ unicode-display_width (1.7.0)
100
+ zeitwerk (2.4.0)
152
101
 
153
102
  PLATFORMS
154
103
  ruby
155
104
 
156
105
  DEPENDENCIES
106
+ autotest-suffix
107
+ combustion
157
108
  frails!
109
+ minitest (~> 5.0)
110
+ minitest-autotest
111
+ minitest-focus
112
+ mocha
158
113
  rubocop
159
114
 
160
115
  BUNDLED WITH
161
- 2.0.2
116
+ 2.1.4
data/README.md CHANGED
@@ -8,6 +8,13 @@ Frails is a modern asset pipeline for [Rails](https://rubyonrails.org), built on
8
8
  - Full Webpack control without fighting with the likes of Webpacker.
9
9
  - Embrace modern front end practices.
10
10
 
11
+ PLUS...
12
+
13
+ - Side loaded layouts, views and partials.
14
+ - Components
15
+ - React + SSR
16
+ - Ruby/HTML
17
+
11
18
  ## Installation
12
19
 
13
20
  Frails is designed to work only within a Rails application, so must be installed in an existing Rails app. It also requires Node.js and a valid `package.json` file in your app root.
@@ -61,14 +68,6 @@ module.exports = {
61
68
  }
62
69
  ```
63
70
 
64
- ### Compilation for Production
65
-
66
- To take advantage of Rails asset host functionality, we recommend that you compile your assets using the provided Rake task:
67
-
68
- $ rails frails:compile
69
-
70
- This will ensure that you assets respect the `asset_host` configuration.
71
-
72
71
  ### Rails Helpers
73
72
 
74
73
  #### `javascript_pack_tag`
@@ -187,34 +186,26 @@ module.exports = {
187
186
  {
188
187
  // Partials - modules (local)
189
188
  test: /app\/views\/.+(\/_([\w-_]+)\.css)$/,
190
- use: ["style-loader", "css-loader"]
189
+ use: ["style-loader", "css-loader"],
191
190
  },
192
191
  {
193
192
  // Layouts and views - no CSS modules (global)
194
193
  test: /app\/views\/.+(\/[^_]([\w-_]+)\.css)$/,
195
- use: ["style-loader", "css-loader"]
196
- }
197
- ]
198
- }
194
+ use: ["style-loader", "css-loader"],
195
+ },
196
+ ],
197
+ },
199
198
  };
200
199
  ```
201
200
 
202
201
  ## Configuration
203
202
 
204
- Frails is built to be as simple as possible, so has very few configuration options. But if you really must change the defaults, just set any of the following environment variables. Of course, if you do change any of these options, be sure to modify your Webpack config accordingly.
205
-
206
- Be sure to install dotenv-flow package and add that to the very top of your primary webpack config:
207
-
208
- ```javascript
209
- require("dotenv-flow").config();
210
- ```
211
-
212
- ### Options
203
+ Frails is built to be as simple as possible, so has very few configuration options:
213
204
 
214
- - `ENV['FRAILS_DEV_SERVER_PORT']` - The HTTP port that Rails will proxy asset requests to. (default: `8080`)
215
- - `ENV['FRAILS_DEV_SERVER_HOST']` - The HTTP host that Rails will proxy asset requests to. (default: `localhost`)
216
- - `ENV['FRAILS_PUBLIC_OUTPUT_PATH']` - The public path where Webpack will output its build to, relative to your app's `/public` directory. (default: `assets`)
217
- - `ENV['FRAILS_MANIFEST_PATH']` - Path to the produced Webpack manifest file, relative to the `public_output_path`. (default: `manifest.json`)
205
+ - `Frails.dev_server_host` - The HTTP port that Rails will proxy asset requests to. (default: `8080`)
206
+ - `Frails.dev_server_path` - The HTTP host that Rails will proxy asset requests to. (default: `localhost`)
207
+ - `Frails.public_output_path` - The public path where Webpack will output its build to, relative to your app's `/public` directory. (default: `assets`)
208
+ - `Frails.manifest_path` - Path to the produced Webpack manifest file, relative to the `public_output_path`. (default: `manifest.json`)
218
209
 
219
210
  ## Development
220
211
 
@@ -226,6 +217,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
226
217
 
227
218
  Bug reports and pull requests are welcome on GitHub at https://github.com/joelmoss/frails.
228
219
 
229
- ## Thanks...
220
+ ## Thanks
230
221
 
231
222
  A huge thank you goes out to the peeps behind [Webpacker](https://github.com/rails/webpacker). Frails has borrowed heavily from Webpacker, particularly for the dev server proxy and minifest code. 🙏
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ require 'rake/testtask'
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
7
7
  t.libs << 'test'
8
- t.libs << 'lib'
9
8
  t.test_files = FileList['test/**/*_test.rb']
9
+ t.verbose = true
10
10
  end
11
11
 
12
12
  task default: :test
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ targets: {
7
+ node: "current",
8
+ },
9
+ },
10
+ ],
11
+ ],
12
+ };
data/bin/test CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
- $: << File.expand_path("../test", __dir__)
2
+ # frozen_string_literal: true
3
3
 
4
- require "bundler/setup"
5
- require "rails/plugin/test"
4
+ $LOAD_PATH << File.expand_path('../test', __dir__)
5
+
6
+ require 'bundler/setup'
7
+ require 'rails/plugin/test'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+
6
+ Bundler.require :default, :development
7
+
8
+ Combustion.initialize! :all
9
+ run Combustion::Application
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- $LOAD_PATH.push File.expand_path('lib', __dir__)
4
-
5
- require 'frails/version'
3
+ require_relative 'lib/frails/version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'frails'
@@ -12,14 +10,8 @@ Gem::Specification.new do |spec|
12
10
 
13
11
  spec.summary = 'A Modern [F]ront End on [Rails] and Webpack'
14
12
  spec.homepage = 'https://github.com/joelmoss/frails'
15
-
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
- # to allow pushing to a single host or delete this section to allow pushing to any host.
18
- unless spec.respond_to?(:metadata)
19
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
20
- end
21
-
22
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
23
15
 
24
16
  spec.metadata['homepage_uri'] = spec.homepage
25
17
  spec.metadata['source_code_uri'] = spec.homepage
@@ -34,7 +26,7 @@ Gem::Specification.new do |spec|
34
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
27
  spec.require_paths = ['lib']
36
28
 
37
- spec.add_dependency 'nokogiri', '>= 1.10.4'
29
+ spec.add_dependency 'activesupport', '>= 6.0'
30
+ spec.add_dependency 'nokogiri', '>= 1.10.4'
38
31
  spec.add_dependency 'rack-proxy', '>= 0.6.5'
39
- spec.add_dependency 'rails', '>= 6.0'
40
32
  end