rails-hyperstack 1.0.alpha1.5 → 1.0.alpha1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c8b7f53db3107e49c7b59eab1b4cc9d5548ef6cfee842fb971fa516b1b75469
4
- data.tar.gz: b05b41840ccf479ff2011fa70dc35a879715100d99a4e33d2a1d1817d9c9e330
3
+ metadata.gz: f5c953e4e7193e6a181228ee9f26d393c2ff02d74db4ddfd723114c24058270c
4
+ data.tar.gz: fb1af29e5892577461c9872b239dfedc52b3662ae340bae24206fe425ad77a86
5
5
  SHA512:
6
- metadata.gz: 2c1a4c77d0def6a0895879f776ede450bc63e33ff96d555df70a19e33b666c9f510cd8c96bdad218446477386c1d31ac51961daae461189274b4024cbaf5513e
7
- data.tar.gz: aa53c533efc6d297c77a3f34ae5f2f0385868685270f1c7f5742b75d980d61a6f32dfda4ccd9137edd0abdda3a471ba39b2ba86973afdc5709dc33401625fc2a
6
+ metadata.gz: da214eb2d241d180c3fe25310ed3892ccb32778078ca00e6ab132609155525fed4cc3608cd81c9fccd1e40792e25b86096313dd740ef3cdb5fe0d8670fed3440
7
+ data.tar.gz: 1031939b40797726856d4cf56dbe2296e73493c82b19886f189117bf9ff81e934f5a1d96484971c5988be2bd9ed7815b3e438b45b371ca6449e567f85a1c6d3a
data/.gitignore CHANGED
@@ -11,6 +11,7 @@ capybara-*.html
11
11
  **.orig
12
12
  rerun.txt
13
13
  pickle-email-*.html
14
+ TestApp/
14
15
 
15
16
  # TODO Comment out these rules if you are OK with secrets being uploaded to the repo
16
17
  config/initializers/secret_token.rb
@@ -50,3 +51,8 @@ bower.json
50
51
  # ignore Gemfile.locks https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
51
52
  /spec/test_app/Gemfile.lock
52
53
  /Gemfile.lock
54
+
55
+ node_modules
56
+ package.json
57
+ spec/test_app
58
+ yarn.lock
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile CHANGED
@@ -6,5 +6,6 @@ gem 'hyper-operation', path: '../hyper-operation'
6
6
  gem 'hyper-model', path: '../hyper-model'
7
7
  gem 'hyper-router', path: '../hyper-router'
8
8
  gem 'hyper-spec', path: '../hyper-spec'
9
- gem 'rails', '~> 5.2'
9
+ gem 'webpacker' # TODO: figure out why these two are necessary!
10
+ gem 'turbolinks'
10
11
  gemspec
data/Rakefile CHANGED
@@ -1,25 +1,35 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'pry'
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
5
6
 
6
7
  namespace :spec do
7
8
  task :prepare do
9
+ rails_version = `bundle info rails`.match(/\* rails \((.+)\)/)[1]
10
+ opal_version = `bundle info opal`.match(/\* opal \((.+)\)/)[1]
8
11
  Dir.chdir('spec') do
9
12
  sh('rm -rf test_app')
10
- sh('bundle exec rails new test_app')
11
- Dir.chdir('test_app') do
12
- sh('bundle exec rails g hyperstack:install')
13
- sh('mv Gemfile _Gemfile_')
14
- sh('bundle exec rails generate model Sample name:string description:text')
15
- sh('mv app/models/sample.rb app/hyperstack/models/sample.rb')
16
- sh('bundle exec rake db:migrate')
17
- sh('bundle exec rails dev:cache')
13
+ Bundler.with_unbundled_env do
14
+ sh("rails _#{rails_version}_ new test_app -T")
15
+ end
16
+ Bundler.with_unbundled_env do
17
+ Dir.chdir('test_app') do
18
+ sh('cat ../gems.rb >> Gemfile')
19
+ sh("echo 'gem \"opal\", \"#{opal_version}\"' >> Gemfile")
20
+ sh("bundle update")
21
+ sh('spring stop')
22
+ sh('bundle exec rails g hyperstack:install')
23
+ sh('bundle exec rails generate model Sample name:string description:text')
24
+ sh('mv app/models/sample.rb app/hyperstack/models/sample.rb')
25
+ sh("cat ../server_side_sample.rb >> app/models/sample.rb")
26
+ sh('bundle exec rake db:migrate')
27
+ sh('RAILS_ENV=test bundle exec rake db:setup')
28
+ # sh('bundle exec rails dev:cache') # not tested yet...
29
+ end
18
30
  end
19
31
  end
20
32
  end
21
33
  end
22
34
 
23
- task :default do
24
-
25
- end
35
+ task :default => :spec
@@ -37,7 +37,7 @@
37
37
 
38
38
  <%=" "* @indent %> before_unmount do
39
39
  <%=" "* @indent %> # cleanup any thing before component is destroyed
40
- <%=" "* @indent %> # note timers are broadcast receivers are cleaned up
40
+ <%=" "* @indent %> # note timers and broadcast receivers are cleaned up
41
41
  <%=" "* @indent %> # automatically
42
42
  <%=" "* @indent %> end
43
43
 
@@ -9,17 +9,6 @@ module Hyperstack
9
9
  class_option 'webpack-only', type: :boolean
10
10
  class_option 'hyper-model-only', type: :boolean
11
11
 
12
- def add_component
13
- if skip_adding_component?
14
- # normally this is handled by the hyper:component
15
- # generator, but if we are skipping it we will check it
16
- # now.
17
- insure_hyperstack_loader_installed
18
- else
19
- generate 'hyper:router App --add-route'
20
- end
21
- end
22
-
23
12
  def add_hotloader
24
13
  return if skip_hotloader?
25
14
  unless Hyperstack.imported? 'hyperstack/hotloader'
@@ -37,82 +26,32 @@ hot-loader: bundle exec hyperstack-hotloader -p 25222 -d app/hyperstack
37
26
  end
38
27
  end
39
28
 
40
- def insure_yarn_loaded
41
- return if skip_webpack?
42
- begin
43
- yarn_version = `yarn --version`
44
- raise Errno::ENOENT if yarn_version.blank?
45
- rescue Errno::ENOENT
46
- raise Thor::Error.new("please insure nodejs is installed and the yarn command is available if using webpacker")
47
- end
48
- end
49
-
50
- def add_webpacker_manifests
51
- return if skip_webpack?
52
- create_file 'app/javascript/packs/client_and_server.js', <<-JAVASCRIPT
53
- //app/javascript/packs/client_and_server.js
54
- // these packages will be loaded both during prerendering and on the client
55
- React = require('react'); // react-js library
56
- History = require('history'); // react-router history library
57
- ReactRouter = require('react-router'); // react-router js library
58
- ReactRouterDOM = require('react-router-dom'); // react-router DOM interface
59
- ReactRailsUJS = require('react_ujs'); // interface to react-rails
60
- // to add additional NPM packages run `yarn add package-name@version`
61
- // then add the require here.
62
- JAVASCRIPT
63
- create_file 'app/javascript/packs/client_only.js', <<-JAVASCRIPT
64
- //app/javascript/packs/client_only.js
65
- // add any requires for packages that will run client side only
66
- ReactDOM = require('react-dom'); // react-js client side code
67
- jQuery = require('jquery'); // remove if you don't need jQuery
68
- // to add additional NPM packages call run yarn add package-name@version
69
- // then add the require here.
70
- JAVASCRIPT
71
- append_file 'config/initializers/assets.rb' do
72
- <<-RUBY
73
- Rails.application.config.assets.paths << Rails.root.join('public', 'packs', 'js').to_s
74
- RUBY
75
- end
76
- inject_into_file 'config/environments/test.rb', before: /^end/ do
77
- <<-RUBY
78
-
79
- # added by hyperstack installer
80
- config.assets.paths << Rails.root.join('public', 'packs-test', 'js').to_s
81
- RUBY
82
- end
83
- end
84
-
85
- def add_webpacks
86
- return if skip_webpack?
87
- yarn 'react', '16'
88
- yarn 'react-dom', '16'
89
- yarn 'react-router', '^5.0.0'
90
- yarn 'react-router-dom', '^5.0.0'
91
- # yarn 'history'#, '4.2' this will be brought in by react-router
92
- yarn 'react_ujs', '^2.5.0'
93
- yarn 'jquery', '^3.4.1'
94
- end
29
+ def install_webpack
30
+ return super unless skip_webpack?
95
31
 
96
- def cancel_react_source_import
97
- return if skip_webpack?
98
32
  inject_into_initializer(
99
- "Hyperstack.cancel_import 'react/react-source-browser' "\
100
- '# bring your own React and ReactRouter via Yarn/Webpacker'
33
+ "Hyperstack.import 'react/react-source-browser' "\
34
+ "# bring in hyperstack's copy of react, comment this out "\
35
+ "if you bring it in from webpacker\n"
101
36
  )
102
37
  end
103
38
 
104
- def install_webpacker
105
- return if skip_webpack?
106
- gem 'webpacker'
107
- Bundler.with_clean_env do
108
- run 'bundle install'
39
+ def add_component
40
+ # add_component AFTER webpack so component generator webpack check works
41
+ if skip_adding_component?
42
+ # normally this is handled by the hyper:component
43
+ # generator, but if we are skipping it we will check it
44
+ # now.
45
+ insure_hyperstack_loader_installed
46
+ check_javascript_link_directory
47
+ else
48
+ generate 'hyper:router App --add-route'
109
49
  end
110
- run 'bundle exec rails webpacker:install'
111
50
  end
112
51
 
113
52
  def create_policies_directory
114
53
  return if skip_hyper_model?
115
- policy_file = File.join('app', 'policies', 'application_policy.rb')
54
+ policy_file = Rails.root.join('app', 'policies', 'hyperstack', 'application_policy.rb')
116
55
  unless File.exist? policy_file
117
56
  create_file policy_file, <<-RUBY
118
57
  # #{policy_file}
@@ -121,38 +60,56 @@ Rails.application.config.assets.paths << Rails.root.join('public', 'packs', 'js'
121
60
  # The following policy will open up full access (but only in development)
122
61
  # The policy system is very flexible and powerful. See the documentation
123
62
  # for complete details.
124
- class Hyperstack::ApplicationPolicy
125
- # Allow any session to connect:
126
- always_allow_connection
127
- # Send all attributes from all public models
128
- regulate_all_broadcasts { |policy| policy.send_all }
129
- # Allow all changes to models
130
- allow_change(to: :all, on: [:create, :update, :destroy]) { true }
131
- # allow remote access to all scopes - i.e. you can count or get a list of ids
132
- # for any scope or relationship
133
- ApplicationRecord.regulate_scope :all
134
- end unless Rails.env.production?
63
+ module Hyperstack
64
+ class ApplicationPolicy
65
+ # Allow any session to connect:
66
+ always_allow_connection
67
+ # Send all attributes from all public models
68
+ regulate_all_broadcasts { |policy| policy.send_all }
69
+ # Allow all changes to models
70
+ allow_change(to: :all, on: [:create, :update, :destroy]) { true }
71
+ end unless Rails.env.production?
72
+ end
135
73
  RUBY
136
74
  end
137
75
  end
138
76
 
139
77
  def move_and_update_application_record
140
78
  return if skip_hyper_model?
141
- rails_app_record_file = File.join('app', 'models', 'application_record.rb')
142
- hyper_app_record_file = File.join('app', 'hyperstack', 'models', 'application_record.rb')
79
+ rails_app_record_file = Rails.root.join('app', 'models', 'application_record.rb')
80
+ hyper_app_record_file = Rails.root.join('app', 'hyperstack', 'models', 'application_record.rb')
143
81
  unless File.exist? hyper_app_record_file
144
- empty_directory File.join('app', 'hyperstack', 'models')
82
+ empty_directory Rails.root.join('app', 'hyperstack', 'models')
145
83
  `mv #{rails_app_record_file} #{hyper_app_record_file}`
146
- create_file rails_app_record_file, <<-RUBY
147
- # #{rails_app_record_file}
148
- # the presence of this file prevents rails migrations from recreating application_record.rb
149
- # see https://github.com/rails/rails/issues/29407
84
+ inject_into_file hyper_app_record_file, before: /^end/, verbose: false do
85
+ " # allow remote access to all scopes - i.e. you can count or get a list of ids\n"\
86
+ " # for any scope or relationship\n"\
87
+ " ApplicationRecord.regulate_scope :all unless Hyperstack.env.production?\n"
88
+ end
150
89
 
151
- require 'models/application_record.rb'
152
- RUBY
90
+ # create_file rails_app_record_file, <<-RUBY
91
+ # # #{rails_app_record_file}
92
+ # # the presence of this file prevents rails migrations from recreating application_record.rb
93
+ # # see https://github.com/rails/rails/issues/29407
94
+ #
95
+ # require 'models/application_record.rb'
96
+ # RUBY
153
97
  end
154
98
  end
155
99
 
100
+ def turn_on_transport
101
+ inject_into_initializer <<-RUBY
102
+
103
+ # transport controls how push (websocket) communications are
104
+ # implemented. The default is :none.
105
+ # Other possibilities are :action_cable, :pusher (see www.pusher.com)
106
+ # or :simple_poller which is sometimes handy during system debug.
107
+
108
+ Hyperstack.transport = :action_cable # :pusher, :simple_poller or :none
109
+
110
+ RUBY
111
+ end
112
+
156
113
  def add_engine_route
157
114
  return if skip_hyper_model?
158
115
  route 'mount Hyperstack::Engine => \'/hyperstack\' # this route should be first in the routes file so it always matches'
@@ -174,7 +131,7 @@ require 'models/application_record.rb'
174
131
  say '👩‍✈️ Basic development policy defined. See app/policies/application_policy.rb 👨🏽‍✈️', :green
175
132
  say '💽 HyperModel installed. Move any Active Record models to the app/hyperstack/models to access them from the client 📀', :green
176
133
  end
177
- if File.exist?(init = File.join('config', 'initializers', 'hyperstack.rb'))
134
+ if File.exist?(init = Rails.root.join('config', 'initializers', 'hyperstack.rb'))
178
135
  say "☑️ Check #{init} for other configuration options. ☑️", :green
179
136
  end
180
137
  unless skip_hotloader?
@@ -182,6 +139,8 @@ require 'models/application_record.rb'
182
139
  end
183
140
 
184
141
  say "\n\n"
142
+
143
+ warnings.each { |warning| say "#{warning}", :yellow }
185
144
  end
186
145
 
187
146
  private
@@ -205,7 +164,7 @@ require 'models/application_record.rb'
205
164
  def new_rails_app?
206
165
  # check to see if there are any routes set up and remember it, cause we might add a route in the process
207
166
  @new_rails_app ||= begin
208
- route_file = File.join('config', 'routes.rb')
167
+ route_file = Rails.root.join('config', 'routes.rb')
209
168
  count = File.foreach(route_file).inject(0) do |c, line|
210
169
  line = line.strip
211
170
  next c if line.empty?
@@ -216,52 +175,5 @@ require 'models/application_record.rb'
216
175
  count <= 2
217
176
  end
218
177
  end
219
-
220
- def inject_into_initializer(s)
221
- file_name = File.join('config', 'initializers', 'hyperstack.rb')
222
- if File.exist?(file_name)
223
- prepend_to_file(file_name) { "#{s}\n" }
224
- else
225
- create_file file_name, <<-RUBY
226
- #{s}
227
- # set the component base class
228
-
229
- Hyperstack.component_base_class = 'HyperComponent' # i.e. 'ApplicationComponent'
230
-
231
- # prerendering is default :off, you should wait until your
232
- # application is relatively well debugged before turning on.
233
-
234
- Hyperstack.prerendering = :off # or :on
235
-
236
- # transport controls how push (websocket) communications are
237
- # implemented. The default is :action_cable.
238
- # Other possibilities are :pusher (see www.pusher.com) or
239
- # :simple_poller which is sometimes handy during system debug.
240
-
241
- Hyperstack.transport = :action_cable # or :none, :pusher, :simple_poller
242
-
243
- # add this line if you need jQuery AND ARE NOT USING WEBPACK
244
- # Hyperstack.import 'hyperstack/component/jquery', client_only: true
245
-
246
- # change definition of on_error to control how errors such as validation
247
- # exceptions are reported on the server
248
- module Hyperstack
249
- def self.on_error(operation, err, params, formatted_error_message)
250
- ::Rails.logger.debug(
251
- "\#{formatted_error_message}\\n\\n" +
252
- Pastel.new.red(
253
- 'To further investigate you may want to add a debugging '\\
254
- 'breakpoint to the on_error method in config/initializers/hyperstack.rb'
255
- )
256
- )
257
- end
258
- end if Rails.env.development?
259
- RUBY
260
- end
261
- # whenever we modify the initializer its best to empty the cache, BUT
262
- # we only need to it once per generator execution
263
- run 'rm -rf tmp/cache' unless @cache_emptied_already
264
- @cache_emptied_already = true
265
- end
266
178
  end
267
179
  end
@@ -6,9 +6,15 @@ module Rails
6
6
 
7
7
  protected
8
8
 
9
+ def warnings
10
+ @warnings ||= []
11
+ end
12
+
9
13
  def create_component_file(template)
10
14
  clear_cache
11
15
  insure_hyperstack_loader_installed
16
+ check_javascript_link_directory
17
+ added = webpack_check
12
18
  insure_base_component_class_exists
13
19
  @no_help = options.key?('no-help')
14
20
  self.components.each do |component|
@@ -17,46 +23,80 @@ module Rails
17
23
  @file_name = component_array.last
18
24
  @indent = 0
19
25
  template template,
20
- File.join('app', 'hyperstack', 'components',
26
+ Rails.root.join('app', 'hyperstack', 'components',
21
27
  *@modules.map(&:downcase),
22
28
  "#{@file_name.underscore}.rb")
23
29
  end
24
30
  add_route
31
+ return unless added
32
+
33
+ say '📦 Webpack integrated with Hyperstack. '\
34
+ 'Add javascript assets to app/javascript/packs/client_only.js and /client_and_server.js 📦', :green
25
35
  end
26
36
 
27
37
 
28
38
  def clear_cache
29
- run 'rm -rf tmp/cache' unless Dir.exist?(File.join('app', 'hyperstack'))
39
+ run 'rm -rf tmp/cache' unless Dir.exist?(Rails.root.join('app', 'hyperstack'))
30
40
  end
31
41
 
32
42
  def insure_hyperstack_loader_installed
33
- application_js = File.join(
43
+ hyperstack_loader = %r{//=\s+require\s+hyperstack-loader\s+}
44
+ application_js = Rails.root.join(
34
45
  'app', 'assets', 'javascripts', 'application.js'
35
46
  )
36
- require_tree = %r{//=\s+require_tree\s+}
37
- hyperstack_loader = %r{//=\s+require\s+hyperstack-loader\s+}
38
- unless File.foreach(application_js).any? { |l| l =~ hyperstack_loader }
39
- if File.foreach(application_js).any? { |l| l =~ require_tree }
40
- inject_into_file 'app/assets/javascripts/application.js', before: require_tree do
41
- "//= require hyperstack-loader\n"
47
+ if File.exist? application_js
48
+ unless File.foreach(application_js).any? { |l| l =~ hyperstack_loader }
49
+ require_tree = %r{//=\s+require_tree\s+}
50
+ if File.foreach(application_js).any? { |l| l =~ require_tree }
51
+ inject_into_file 'app/assets/javascripts/application.js', verbose: false, before: require_tree do
52
+ "//= require hyperstack-loader\n"
53
+ end
54
+ else
55
+ warnings <<
56
+ " ***********************************************************\n"\
57
+ " * Could not add `//= require hyperstack-loader` directive *\n"\
58
+ " * to the app/assets/application.js file. *\n"\
59
+ " * Normally this directive is added just before the *\n"\
60
+ " * `//= require_tree .` directive at the end of the file, *\n"\
61
+ " * but no require_tree directive was found. You need to *\n"\
62
+ " * manually add `//= require hyperstack-loader` to the *\n"\
63
+ " * app/assets/application.js file. *\n"\
64
+ " ***********************************************************\n"
65
+ end
66
+ end
67
+ else
68
+ create_file application_js, "//= require hyperstack-loader\n"
69
+ warnings <<
70
+ " ***********************************************************\n"\
71
+ " * Could not find the app/assets/application.js file. *\n"\
72
+ " * We created one for you, and added the *\n"\
73
+ " * `<%= javascript_include_tag 'application' %>` to your *\n"\
74
+ " * `html.erb` files immediately after any *\n"\
75
+ " * `<%= javascript_pack 'application' %>` tags we found. *\n"\
76
+ " ***********************************************************\n"
77
+ application_pack_tag =
78
+ /\s*\<\%\=\s+javascript_pack_tag\s+(\'|\")application(\'|\").*\%\>.*$/
79
+ Dir.glob(Rails.root.join('app', 'views', '**', '*.erb')) do |file|
80
+ if File.foreach(file).any? { |l| l =~ application_pack_tag }
81
+ inject_into_file file, verbose: false, after: application_pack_tag do
82
+ "\n <%= javascript_include_tag 'application' %>"
83
+ end
42
84
  end
43
- else
44
- puts " ***********************************************************\n"\
45
- " * Could not add `//= require hyperstack-loader` directive *\n"\
46
- " * to the app/assets/application.js file. *\n"\
47
- " * Normally this directive is added just before the *\n"\
48
- " * `//= require_tree .` directive at the end of the file, *\n"\
49
- " * but no require_tree directive was found. You need to *\n"\
50
- " * manually add `//= require hyperstack-loader` to the *\n"\
51
- " * app/assets/application.js file. *\n"\
52
- " ***********************************************************\n"
53
85
  end
54
86
  end
55
87
  end
56
88
 
89
+ def check_javascript_link_directory
90
+ manifest_js_file = Rails.root.join("app", "assets", "config", "manifest.js")
91
+ return unless File.exist? manifest_js_file
92
+ return unless File.readlines(manifest_js_file).grep(/javascripts \.js/).empty?
93
+
94
+ append_file manifest_js_file, "//= link_directory ../javascripts .js\n", verbose: false
95
+ end
96
+
57
97
  def insure_base_component_class_exists
58
98
  @component_base_class = options['base-class'] || Hyperstack.component_base_class
59
- file_name = File.join(
99
+ file_name = Rails.root.join(
60
100
  'app', 'hyperstack', 'components', "#{@component_base_class.underscore}.rb"
61
101
  )
62
102
  template 'hyper_component_template.rb', file_name unless File.exist? file_name
@@ -64,19 +104,20 @@ module Rails
64
104
 
65
105
  def add_to_manifest(manifest, &block)
66
106
  if File.exist? "app/javascript/packs/#{manifest}"
67
- append_file "app/javascript/packs/#{manifest}", &block
107
+ append_file "app/javascript/packs/#{manifest}", verbose: false, &block
68
108
  else
69
- create_file "app/javascript/packs/#{manifest}", &block
109
+ create_file "app/javascript/packs/#{manifest}", verbose: false, &block
70
110
  end
71
111
  end
72
112
 
73
113
  def add_route
74
114
  return unless options['add-route']
75
115
  if self.components.count > 1
76
- puts " ***********************************************************\n"\
77
- " * The add-route option ignored because more than one *\n"\
78
- " * component is being generated. *\n"\
79
- " ***********************************************************\n"
116
+ warnings <<
117
+ " ***********************************************************\n"\
118
+ " * The add-route option ignored because more than one *\n"\
119
+ " * component is being generated. *\n"\
120
+ " ***********************************************************\n"
80
121
  return
81
122
  end
82
123
  action_name = (@modules+[@file_name.underscore]).join('__')
@@ -94,6 +135,154 @@ module Rails
94
135
  return if system("yarn add #{package}#{'@' + version if version}")
95
136
  raise Thor::Error.new("yarn failed to install #{package} with version #{version}")
96
137
  end
138
+
139
+ def install_webpack
140
+ insure_yarn_loaded
141
+ add_webpacker_manifests
142
+ add_webpacks
143
+ cancel_react_source_import
144
+ install_webpacker
145
+ end
146
+
147
+ def inject_into_initializer(s)
148
+ file_name = Rails.root.join('config', 'initializers', 'hyperstack.rb')
149
+ if File.exist?(file_name)
150
+ prepend_to_file(file_name, verbose: false) { "#{s}\n" }
151
+ else
152
+ create_file file_name, <<-RUBY
153
+ #{s}
154
+
155
+ # server_side_auto_require will patch the ActiveSupport Dependencies module
156
+ # so that you can define classes and modules with files in both the
157
+ # app/hyperstack/xxx and app/xxx directories. For example you can split
158
+ # a Todo model into server and client related definitions and place this
159
+ # in `app/hyperstack/models/todo.rb`, and place any server only definitions in
160
+ # `app/models/todo.rb`.
161
+
162
+ require "hyperstack/server_side_auto_require.rb"
163
+
164
+ # set the component base class
165
+
166
+ Hyperstack.component_base_class = 'HyperComponent' # i.e. 'ApplicationComponent'
167
+
168
+ # prerendering is default :off, you should wait until your
169
+ # application is relatively well debugged before turning on.
170
+
171
+ Hyperstack.prerendering = :off # or :on
172
+
173
+ # add this line if you need jQuery AND ARE NOT USING WEBPACK
174
+ # Hyperstack.import 'hyperstack/component/jquery', client_only: true
175
+
176
+ # change definition of on_error to control how errors such as validation
177
+ # exceptions are reported on the server
178
+ module Hyperstack
179
+ def self.on_error(operation, err, params, formatted_error_message)
180
+ ::Rails.logger.debug(
181
+ "\#{formatted_error_message}\\n\\n" +
182
+ Pastel.new.red(
183
+ 'To further investigate you may want to add a debugging '\\
184
+ 'breakpoint to the on_error method in config/initializers/hyperstack.rb'
185
+ )
186
+ )
187
+ end
188
+ end if Rails.env.development?
189
+ RUBY
190
+ end
191
+ # whenever we modify the initializer its best to empty the cache, BUT
192
+ # we only need to it once per generator execution
193
+ run 'rm -rf tmp/cache' unless @cache_emptied_already
194
+ @cache_emptied_already = true
195
+ end
196
+
197
+ private
198
+
199
+ def webpack_check
200
+ return unless defined? ::Webpacker
201
+
202
+ client_and_server = Rails.root.join("app", "javascript", "packs", "client_only.js")
203
+ return if File.exist? client_and_server
204
+
205
+ # Dir.chdir(Rails.root.join.to_s) { run 'bundle exec rails hyperstack:install:webpack' }
206
+
207
+ # say "warning: you are running webpacker, but the hyperstack webpack files have not been created.\n"\
208
+ # " Suggest you run bundle exec rails hyperstack:install:webpack soon.\n"\
209
+ # " Or to avoid this warning create an empty file named app/javascript/packs/client_only.js",
210
+ # :red
211
+ install_webpack
212
+ true
213
+ end
214
+
215
+ def insure_yarn_loaded
216
+ begin
217
+ yarn_version = `yarn --version`
218
+ raise Errno::ENOENT if yarn_version.blank?
219
+ rescue Errno::ENOENT
220
+ raise Thor::Error.new("please insure nodejs is installed and the yarn command is available if using webpacker")
221
+ end
222
+ end
223
+
224
+ def add_webpacker_manifests
225
+ create_file 'app/javascript/packs/client_and_server.js', <<-JAVASCRIPT
226
+ //app/javascript/packs/client_and_server.js
227
+ // these packages will be loaded both during prerendering and on the client
228
+ React = require('react'); // react-js library
229
+ createReactClass = require('create-react-class'); // backwards compatibility with ECMA5
230
+ History = require('history'); // react-router history library
231
+ ReactRouter = require('react-router'); // react-router js library
232
+ ReactRouterDOM = require('react-router-dom'); // react-router DOM interface
233
+ ReactRailsUJS = require('react_ujs'); // interface to react-rails
234
+ // to add additional NPM packages run `yarn add package-name@version`
235
+ // then add the require here.
236
+ JAVASCRIPT
237
+ create_file 'app/javascript/packs/client_only.js', <<-JAVASCRIPT
238
+ //app/javascript/packs/client_only.js
239
+ // add any requires for packages that will run client side only
240
+ ReactDOM = require('react-dom'); // react-js client side code
241
+ jQuery = require('jquery'); // remove if you don't need jQuery
242
+ // to add additional NPM packages call run yarn add package-name@version
243
+ // then add the require here.
244
+ JAVASCRIPT
245
+ append_file 'config/initializers/assets.rb', verbose: false do
246
+ <<-RUBY
247
+ Rails.application.config.assets.paths << Rails.root.join('public', 'packs', 'js').to_s
248
+ RUBY
249
+ end
250
+ inject_into_file 'config/environments/test.rb', verbose: false, before: /^end/ do
251
+ <<-RUBY
252
+
253
+ # added by hyperstack installer
254
+ config.assets.paths << Rails.root.join('public', 'packs-test', 'js').to_s
255
+ RUBY
256
+ end
257
+ end
258
+
259
+ def add_webpacks
260
+ yarn 'react', '16'
261
+ yarn 'react-dom', '16'
262
+ yarn 'react-router', '^5.0.0'
263
+ yarn 'react-router-dom', '^5.0.0'
264
+ yarn 'react_ujs', '^2.5.0'
265
+ yarn 'jquery', '^3.4.1'
266
+ yarn 'create-react-class'
267
+ end
268
+
269
+ def cancel_react_source_import
270
+ inject_into_initializer(
271
+ "# Hyperstack.import 'react/react-source-browser' "\
272
+ "# uncomment this line if you want hyperstack to use its copy of react"
273
+ )
274
+ end
275
+
276
+ def install_webpacker
277
+ return if defined?(::Webpacker)
278
+
279
+ gem "webpacker"
280
+ Bundler.with_unbundled_env do
281
+ run "bundle install"
282
+ end
283
+ `spring stop`
284
+ Dir.chdir(Rails.root.join.to_s) { run 'bundle exec rails webpacker:install' }
285
+ end
97
286
  end
98
287
  end
99
288
  end
@@ -214,7 +214,7 @@ hot-loader: bundle exec hyperstack-hotloader -p 25222 -d app/hyperstack
214
214
  end
215
215
 
216
216
  def install
217
- Bundler.with_clean_env do
217
+ Bundler.with_unbundled_env do
218
218
  run "bundle install"
219
219
  end
220
220
  run 'bundle exec rails webpacker:install'
@@ -6,39 +6,64 @@ module Rails
6
6
 
7
7
  protected
8
8
 
9
+ def warnings
10
+ @warnings ||= []
11
+ end
12
+
9
13
  def clear_cache
10
- run 'rm -rf tmp/cache' unless Dir.exists?(File.join('app', 'hyperstack'))
14
+ run 'rm -rf tmp/cache' unless Dir.exists?(Rails.root.join('app', 'hyperstack'))
11
15
  end
12
16
 
13
17
  def insure_hyperstack_loader_installed
14
- application_js = File.join(
18
+ hyperstack_loader = %r{//=\s+require\s+hyperstack-loader\s+}
19
+ application_js = Rails.root.join(
15
20
  'app', 'assets', 'javascripts', 'application.js'
16
21
  )
17
- require_tree = %r{//=\s+require_tree\s+}
18
- hyperstack_loader = %r{//=\s+require\s+hyperstack-loader\s+}
19
- unless File.foreach(application_js).any? { |l| l =~ hyperstack_loader }
20
- if File.foreach(application_js).any? { |l| l =~ require_tree }
21
- inject_into_file 'app/assets/javascripts/application.js', before: require_tree do
22
- "//= require hyperstack-loader\n"
22
+ if File.exist? application_js
23
+ unless File.foreach(application_js).any? { |l| l =~ hyperstack_loader }
24
+ require_tree = %r{//=\s+require_tree\s+}
25
+ if File.foreach(application_js).any? { |l| l =~ require_tree }
26
+ inject_into_file 'app/assets/javascripts/application.js', before: require_tree do
27
+ "//= require hyperstack-loader\n"
28
+ end
29
+ else
30
+ warnings <<
31
+ " ***********************************************************\n"\
32
+ " * Could not add `//= require hyperstack-loader` directive *\n"\
33
+ " * to the app/assets/application.js file. *\n"\
34
+ " * Normally this directive is added just before the *\n"\
35
+ " * `//= require_tree .` directive at the end of the file, *\n"\
36
+ " * but no require_tree directive was found. You need to *\n"\
37
+ " * manually add `//= require hyperstack-loader` to the *\n"\
38
+ " * app/assets/application.js file. *\n"\
39
+ " ***********************************************************\n"
40
+ end
41
+ end
42
+ else
43
+ create_file application_js, "//= require hyperstack-loader\n"
44
+ warnings <<
45
+ " ***********************************************************\n"\
46
+ " * Could not find the app/assets/application.js file. *\n"\
47
+ " * We created one for you, and added the *\n"\
48
+ " * `<%= javascript_include_tag 'application' %>` to your *\n"\
49
+ " * `html.erb` files immediately after any *\n"\
50
+ " * `<%= javascript_pack 'application' %>` tags we found. *\n"\
51
+ " ***********************************************************\n"
52
+ application_pack_tag =
53
+ /\s*\<\%\=\s+javascript_pack_tag\s+(\'|\")application(\'|\").*\%\>.*$/
54
+ Dir.glob(Rails.root.join('app', 'views', '**', '*.erb')) do |file|
55
+ if File.foreach(file).any? { |l| l =~ application_pack_tag }
56
+ inject_into_file file, after: application_pack_tag do
57
+ "\n <%= javascript_include_tag 'application' %>"
58
+ end
23
59
  end
24
- else
25
- puts " ***********************************************************\n"\
26
- " * Could not add `//= require hyperstack-loader` directive *\n"\
27
- " * to the app/assets/application.js file. *\n"\
28
- " * Normally this directive is added just before the *\n"\
29
- " * `//= require_tree .` directive at the end of the file, *\n"\
30
- " * but no require_tree directive was found. You need to *\n"\
31
- " * manually add `//= require hyperstack-loader` to the *\n"\
32
- " * app/assets/application.js file. *\n"\
33
- " ***********************************************************\n"
34
60
  end
35
61
  end
36
62
  end
37
63
 
38
-
39
64
  def insure_base_component_class_exists
40
65
  @component_base_class = options['base-class']
41
- file_name = File.join(
66
+ file_name = Rails.root.join(
42
67
  'app', 'hyperstack', 'components', "#{@component_base_class.underscore}.rb"
43
68
  )
44
69
  template 'hyper_component_template.rb', file_name unless File.exists? file_name
@@ -55,7 +80,8 @@ module Rails
55
80
  def add_route
56
81
  return unless options['add-route']
57
82
  if self.components.count > 1
58
- puts " ***********************************************************\n"\
83
+ warnings <<
84
+ " ***********************************************************\n"\
59
85
  " * The add-route option ignored because more than one *\n"\
60
86
  " * component is being generated. *\n"\
61
87
  " ***********************************************************\n"
@@ -0,0 +1,39 @@
1
+ Rails.configuration.autoloader = :classic
2
+
3
+ module ActiveSupport
4
+ module Dependencies
5
+ HYPERSTACK_DIR = "hyperstack"
6
+ class << self
7
+ alias original_require_or_load require_or_load
8
+
9
+ # before requiring_or_loading a file, first check if
10
+ # we have the same file in the server side directory
11
+ # and add that as a dependency
12
+
13
+ def require_or_load(file_name, const_path = nil)
14
+ add_server_side_dependency(file_name)
15
+ original_require_or_load(file_name, const_path)
16
+ end
17
+
18
+ # search the filename path from the end towards the beginning
19
+ # for the HYPERSTACK_DIR directory. If found, remove it from
20
+ # the filename, and if a ruby file exists at that location then
21
+ # add it as a dependency
22
+
23
+ def add_server_side_dependency(file_name)
24
+ path = File.expand_path(file_name.chomp(".rb"))
25
+ .split(File::SEPARATOR).reverse
26
+ hs_index = path.find_index(HYPERSTACK_DIR)
27
+
28
+ return unless hs_index # no hyperstack directory here
29
+
30
+ new_path = (path[0..hs_index - 1] + path[hs_index + 1..-1]).reverse
31
+ load_path = new_path.join(File::SEPARATOR)
32
+
33
+ return unless File.exist? "#{load_path}.rb"
34
+
35
+ require_dependency load_path
36
+ end
37
+ end
38
+ end
39
+ end
@@ -1,3 +1,3 @@
1
1
  module Hyperstack
2
- ROUTERVERSION = VERSION = '1.0.alpha1.5'
2
+ ROUTERVERSION = VERSION = '1.0.alpha1.6'
3
3
  end
@@ -1,6 +1,5 @@
1
1
  require 'hyperstack-config'
2
2
  require 'rails/generators'
3
- require 'hyper-state'
4
3
 
5
4
  # remove these once lap29 is released ...
6
5
  Hyperstack.js_import 'react/react-source-browser', client_only: true, defines: ['ReactDOM', 'React']
@@ -21,11 +20,11 @@ begin
21
20
  require 'opal-rails'
22
21
  require 'hyper-model'
23
22
  require 'hyper-router'
23
+ require 'mini_racer'
24
24
  rescue LoadError
25
25
  end
26
26
  require 'react-rails'
27
27
  require 'opal-browser'
28
- require 'mini_racer'
29
28
  require 'hyperstack/version'
30
29
 
31
30
  class RailsHyperstack < Rails::Railtie
@@ -57,43 +57,35 @@ You can control how much of the stack gets installed as well:
57
57
  spec.add_dependency 'hyper-model', Hyperstack::VERSION
58
58
  spec.add_dependency 'hyper-router', Hyperstack::ROUTERVERSION
59
59
  spec.add_dependency 'hyperstack-config', Hyperstack::VERSION
60
- spec.add_dependency 'opal-rails', '~> 0.9.4'
60
+ spec.add_dependency 'opal-rails' #, '~> 2.0'
61
61
 
62
62
  spec.add_dependency 'opal-browser', '~> 0.2.0'
63
63
  spec.add_dependency 'react-rails', '>= 2.4.0', '< 2.5.0'
64
- spec.add_dependency 'mini_racer', '~> 0.2.4'
65
- spec.add_dependency 'libv8', '~> 6.7.0'
66
- spec.add_dependency 'rails', '>= 4.0.0'
64
+ # spec.add_dependency 'mini_racer', '~> 0.2.6'
65
+ # spec.add_dependency 'libv8', '~> 7.3.492.27.1'
66
+ spec.add_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0'
67
67
 
68
-
69
- # spec.add_development_dependency 'sqlite3', '~> 1.3.6' # see https://github.com/rails/rails/issues/35153
70
- # #spec.add_development_dependency 'chromedriver-helper'
71
- # spec.add_development_dependency 'geminabox', '>= 0.13.11'
72
-
73
-
74
- spec.add_development_dependency 'bundler', ['>= 1.17.3', '< 2.1']
68
+ spec.add_development_dependency 'bundler'
75
69
  spec.add_development_dependency 'chromedriver-helper'
76
70
  spec.add_development_dependency 'hyper-spec', Hyperstack::VERSION
77
71
  spec.add_development_dependency 'pry'
78
72
  spec.add_development_dependency 'puma'
79
73
  spec.add_development_dependency 'bootsnap'
80
- #spec.add_development_dependency 'rake', '~> 10.0'
81
- spec.add_development_dependency 'rspec'
74
+ spec.add_development_dependency 'rspec-rails'
82
75
  spec.add_development_dependency 'rubocop', '~> 0.51.0'
83
- spec.add_development_dependency 'sqlite3', '~> 1.3.6' # see https://github.com/rails/rails/issues/35153
84
- spec.add_development_dependency 'sass-rails', '~> 5.0'
76
+ spec.add_development_dependency 'sqlite3', '~> 1.4' # was 1.3.6 -- see https://github.com/rails/rails/issues/35153
77
+ spec.add_development_dependency 'sass-rails', '>= 5.0'
85
78
  # Use Uglifier as compressor for JavaScript assets
86
79
  spec.add_development_dependency 'uglifier', '>= 1.3.0'
87
80
  # See https://github.com/rails/execjs#readme for more supported runtimes
88
81
  # gem 'mini_racer', platforms: :ruby
89
82
 
90
83
  # Use CoffeeScript for .coffee assets and views
91
- spec.add_development_dependency 'coffee-rails', '~> 4.2'
84
+ #spec.add_development_dependency 'coffee-rails', '~> 4.2'
92
85
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
93
86
  spec.add_development_dependency 'turbolinks', '~> 5'
94
87
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
95
88
  spec.add_development_dependency 'jbuilder', '~> 2.5'
96
89
  spec.add_development_dependency 'foreman'
97
90
  spec.add_development_dependency 'database_cleaner'
98
-
99
91
  end
data/spec/gems.rb ADDED
@@ -0,0 +1,10 @@
1
+ gem 'rails-hyperstack', path: '../..'
2
+ gem 'hyperstack-config', path: '../../../hyperstack-config'
3
+ gem 'hyper-state', path: '../../../hyper-state'
4
+ gem 'hyper-component', path: '../../../hyper-component'
5
+ gem 'hyper-operation', path: '../../../hyper-operation'
6
+ gem 'hyper-model', path: '../../../hyper-model'
7
+ gem 'hyper-router', path: '../../../hyper-router'
8
+ gem 'hyper-spec', path: '../../../hyper-spec'
9
+
10
+ gem 'pry'
@@ -1,24 +1,30 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
- describe 'rails-hyperstack' do
4
- it 'builds a working app', js: true do
5
- visit '/'
6
- expect(page).to have_content('App')
3
+ describe "rails-hyperstack" do
4
+ it "builds a working app", js: true do
5
+ visit "/"
6
+ expect(page).to have_content("App")
7
7
  end
8
- it 'installs hyper-model and friends', js: true do
9
- visit '/'
10
- expect_promise do
8
+
9
+ it "installs hyper-model and friends", js: true do
10
+ visit "/"
11
+ expect do
11
12
  Hyperstack::Model.load { Sample.count }
12
- end.to eq(0)
13
- evaluate_ruby do
14
- Sample.create(name: 'sample1', description: 'the first sample')
13
+ end.on_client_to eq(0)
14
+ on_client do
15
+ Sample.create(name: "sample1", description: "the first sample")
15
16
  end
16
17
  wait_for_ajax
17
18
  expect(Sample.count).to eq(1)
18
- expect(Sample.first.name).to eq('sample1')
19
- expect(Sample.first.description).to eq('the first sample')
20
- expect_evaluate_ruby do
21
- Sample.count
22
- end.to eq(1)
19
+ expect(Sample.first.name).to eq("sample1")
20
+ expect(Sample.first.description).to eq("the first sample")
21
+ expect { Sample.count }.on_client_to eq(1)
22
+ end
23
+
24
+ it "implements server_side_auto_require", js: true do
25
+ expect(Sample.super_secret_server_side_method).to be true
26
+ expect do
27
+ Sample.respond_to? :super_secret_server_side_method
28
+ end.on_client_to be_falsy
23
29
  end
24
30
  end
@@ -0,0 +1,5 @@
1
+ class Sample < ApplicationRecord
2
+ def self.super_secret_server_side_method
3
+ true
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-hyperstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.alpha1.5
4
+ version: 1.0.alpha1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Boutet
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-06-19 00:00:00.000000000 Z
14
+ date: 2021-03-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: hyper-model
@@ -19,56 +19,56 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.alpha1.5
22
+ version: 1.0.alpha1.6
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.alpha1.5
29
+ version: 1.0.alpha1.6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: hyper-router
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.0.alpha1.5
36
+ version: 1.0.alpha1.6
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 1.0.alpha1.5
43
+ version: 1.0.alpha1.6
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: hyperstack-config
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 1.0.alpha1.5
50
+ version: 1.0.alpha1.6
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 1.0.alpha1.5
57
+ version: 1.0.alpha1.6
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: opal-rails
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - "~>"
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 0.9.4
64
+ version: '0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 0.9.4
71
+ version: '0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: opal-browser
74
74
  requirement: !ruby/object:Gem::Requirement
@@ -103,68 +103,40 @@ dependencies:
103
103
  - - "<"
104
104
  - !ruby/object:Gem::Version
105
105
  version: 2.5.0
106
- - !ruby/object:Gem::Dependency
107
- name: mini_racer
108
- requirement: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - "~>"
111
- - !ruby/object:Gem::Version
112
- version: 0.2.4
113
- type: :runtime
114
- prerelease: false
115
- version_requirements: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - "~>"
118
- - !ruby/object:Gem::Version
119
- version: 0.2.4
120
- - !ruby/object:Gem::Dependency
121
- name: libv8
122
- requirement: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - "~>"
125
- - !ruby/object:Gem::Version
126
- version: 6.7.0
127
- type: :runtime
128
- prerelease: false
129
- version_requirements: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - "~>"
132
- - !ruby/object:Gem::Version
133
- version: 6.7.0
134
106
  - !ruby/object:Gem::Dependency
135
107
  name: rails
136
108
  requirement: !ruby/object:Gem::Requirement
137
109
  requirements:
138
110
  - - ">="
139
111
  - !ruby/object:Gem::Version
140
- version: 4.0.0
112
+ version: 5.0.0
113
+ - - "<"
114
+ - !ruby/object:Gem::Version
115
+ version: '7.0'
141
116
  type: :runtime
142
117
  prerelease: false
143
118
  version_requirements: !ruby/object:Gem::Requirement
144
119
  requirements:
145
120
  - - ">="
146
121
  - !ruby/object:Gem::Version
147
- version: 4.0.0
122
+ version: 5.0.0
123
+ - - "<"
124
+ - !ruby/object:Gem::Version
125
+ version: '7.0'
148
126
  - !ruby/object:Gem::Dependency
149
127
  name: bundler
150
128
  requirement: !ruby/object:Gem::Requirement
151
129
  requirements:
152
130
  - - ">="
153
131
  - !ruby/object:Gem::Version
154
- version: 1.17.3
155
- - - "<"
156
- - !ruby/object:Gem::Version
157
- version: '2.1'
132
+ version: '0'
158
133
  type: :development
159
134
  prerelease: false
160
135
  version_requirements: !ruby/object:Gem::Requirement
161
136
  requirements:
162
137
  - - ">="
163
138
  - !ruby/object:Gem::Version
164
- version: 1.17.3
165
- - - "<"
166
- - !ruby/object:Gem::Version
167
- version: '2.1'
139
+ version: '0'
168
140
  - !ruby/object:Gem::Dependency
169
141
  name: chromedriver-helper
170
142
  requirement: !ruby/object:Gem::Requirement
@@ -185,14 +157,14 @@ dependencies:
185
157
  requirements:
186
158
  - - '='
187
159
  - !ruby/object:Gem::Version
188
- version: 1.0.alpha1.5
160
+ version: 1.0.alpha1.6
189
161
  type: :development
190
162
  prerelease: false
191
163
  version_requirements: !ruby/object:Gem::Requirement
192
164
  requirements:
193
165
  - - '='
194
166
  - !ruby/object:Gem::Version
195
- version: 1.0.alpha1.5
167
+ version: 1.0.alpha1.6
196
168
  - !ruby/object:Gem::Dependency
197
169
  name: pry
198
170
  requirement: !ruby/object:Gem::Requirement
@@ -236,7 +208,7 @@ dependencies:
236
208
  - !ruby/object:Gem::Version
237
209
  version: '0'
238
210
  - !ruby/object:Gem::Dependency
239
- name: rspec
211
+ name: rspec-rails
240
212
  requirement: !ruby/object:Gem::Requirement
241
213
  requirements:
242
214
  - - ">="
@@ -269,26 +241,26 @@ dependencies:
269
241
  requirements:
270
242
  - - "~>"
271
243
  - !ruby/object:Gem::Version
272
- version: 1.3.6
244
+ version: '1.4'
273
245
  type: :development
274
246
  prerelease: false
275
247
  version_requirements: !ruby/object:Gem::Requirement
276
248
  requirements:
277
249
  - - "~>"
278
250
  - !ruby/object:Gem::Version
279
- version: 1.3.6
251
+ version: '1.4'
280
252
  - !ruby/object:Gem::Dependency
281
253
  name: sass-rails
282
254
  requirement: !ruby/object:Gem::Requirement
283
255
  requirements:
284
- - - "~>"
256
+ - - ">="
285
257
  - !ruby/object:Gem::Version
286
258
  version: '5.0'
287
259
  type: :development
288
260
  prerelease: false
289
261
  version_requirements: !ruby/object:Gem::Requirement
290
262
  requirements:
291
- - - "~>"
263
+ - - ">="
292
264
  - !ruby/object:Gem::Version
293
265
  version: '5.0'
294
266
  - !ruby/object:Gem::Dependency
@@ -305,20 +277,6 @@ dependencies:
305
277
  - - ">="
306
278
  - !ruby/object:Gem::Version
307
279
  version: 1.3.0
308
- - !ruby/object:Gem::Dependency
309
- name: coffee-rails
310
- requirement: !ruby/object:Gem::Requirement
311
- requirements:
312
- - - "~>"
313
- - !ruby/object:Gem::Version
314
- version: '4.2'
315
- type: :development
316
- prerelease: false
317
- version_requirements: !ruby/object:Gem::Requirement
318
- requirements:
319
- - - "~>"
320
- - !ruby/object:Gem::Version
321
- version: '4.2'
322
280
  - !ruby/object:Gem::Dependency
323
281
  name: turbolinks
324
282
  requirement: !ruby/object:Gem::Requirement
@@ -385,6 +343,7 @@ extensions: []
385
343
  extra_rdoc_files: []
386
344
  files:
387
345
  - ".gitignore"
346
+ - ".ruby-version"
388
347
  - ".travis.yml"
389
348
  - Gemfile
390
349
  - Rakefile
@@ -400,11 +359,14 @@ files:
400
359
  - lib/generators/hyperstack/install_mui_generator.rb
401
360
  - lib/generators/install/hyperstack_generator.rb
402
361
  - lib/generators/install/hyperstack_generator_base.rb
362
+ - lib/hyperstack/server_side_auto_require.rb
403
363
  - lib/hyperstack/version.rb
404
364
  - lib/rails-hyperstack.rb
405
365
  - lib/tasks/hyperstack/install.rake
406
366
  - rails-hyperstack.gemspec
367
+ - spec/gems.rb
407
368
  - spec/rails_hyperstack_spec.rb
369
+ - spec/server_side_sample.rb
408
370
  - spec/spec_helper.rb
409
371
  homepage: http://hyperstack.org
410
372
  licenses:
@@ -459,7 +421,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
459
421
  - !ruby/object:Gem::Version
460
422
  version: 1.3.1
461
423
  requirements: []
462
- rubygems_version: 3.0.4
424
+ rubygems_version: 3.0.8
463
425
  signing_key:
464
426
  specification_version: 4
465
427
  summary: Hyperstack for Rails with generators