shakapacker 7.0.0.rc.0 → 7.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +4 -8
  3. data/.github/workflows/dummy.yml +21 -0
  4. data/.github/workflows/generator.yml +37 -0
  5. data/.github/workflows/jest.yml +2 -2
  6. data/.github/workflows/js-lint.yml +2 -2
  7. data/.github/workflows/rubocop.yml +1 -1
  8. data/.github/workflows/ruby-backward-compatibility.yml +2 -6
  9. data/.github/workflows/ruby.yml +2 -6
  10. data/.gitignore +3 -0
  11. data/CHANGELOG.md +16 -18
  12. data/CONTRIBUTING.md +76 -20
  13. data/README.md +3 -1
  14. data/Rakefile +44 -8
  15. data/docs/deployment.md +1 -2
  16. data/lib/install/binstubs.rb +3 -1
  17. data/lib/install/config/webpack/webpack.config.js +3 -2
  18. data/lib/install/template.rb +27 -15
  19. data/lib/shakapacker/deprecation_helper.rb +4 -5
  20. data/lib/shakapacker/version.rb +1 -1
  21. data/lib/tasks/shakapacker/check_binstubs.rake +14 -10
  22. data/lib/tasks/shakapacker/compile.rake +1 -6
  23. data/package/index.js +16 -0
  24. data/package/utils/helpers.js +1 -1
  25. data/package.json +1 -1
  26. data/spec/dummy/.browserslistrc +1 -0
  27. data/spec/dummy/.gitignore +20 -0
  28. data/spec/dummy/.prettierrc.yaml +4 -0
  29. data/spec/dummy/Gemfile +63 -0
  30. data/spec/dummy/Procfile.dev +5 -0
  31. data/spec/dummy/Procfile.dev-static +9 -0
  32. data/spec/dummy/README.md +1 -0
  33. data/spec/dummy/Rakefile +6 -0
  34. data/spec/dummy/app/assets/config/manifest.js +2 -0
  35. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  36. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  37. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  38. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  39. data/spec/dummy/app/controllers/hello_world_controller.rb +9 -0
  40. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  41. data/spec/dummy/app/javascript/Globals.d.ts +3 -0
  42. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css +25 -0
  43. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorld.tsx +47 -0
  44. data/spec/dummy/app/javascript/bundles/HelloWorld/components/HelloWorldServer.tsx +5 -0
  45. data/spec/dummy/app/javascript/bundles/HelloWorld/components/logo.svg +7 -0
  46. data/spec/dummy/app/javascript/packs/application.js +17 -0
  47. data/spec/dummy/app/javascript/packs/hello-world-bundle.ts +8 -0
  48. data/spec/dummy/app/javascript/packs/server-bundle.ts +8 -0
  49. data/spec/dummy/app/jobs/application_job.rb +7 -0
  50. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  51. data/spec/dummy/app/models/application_record.rb +3 -0
  52. data/spec/dummy/app/models/concerns/.keep +0 -0
  53. data/spec/dummy/app/views/hello_world/index.html.erb +2 -0
  54. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  55. data/spec/dummy/app/views/layouts/hello_world.html.erb +13 -0
  56. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  57. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  58. data/spec/dummy/babel.config.js +30 -0
  59. data/spec/dummy/bin/bundle +114 -0
  60. data/spec/dummy/bin/dev +30 -0
  61. data/spec/dummy/bin/dev-static +30 -0
  62. data/spec/dummy/bin/rails +9 -0
  63. data/spec/dummy/bin/rake +9 -0
  64. data/spec/dummy/bin/setup +33 -0
  65. data/spec/dummy/bin/shakapacker +13 -0
  66. data/spec/dummy/bin/shakapacker-dev-server +13 -0
  67. data/spec/dummy/bin/spring +17 -0
  68. data/spec/dummy/bin/yarn +18 -0
  69. data/spec/dummy/config/application.rb +32 -0
  70. data/spec/dummy/config/boot.rb +4 -0
  71. data/spec/dummy/config/cable.yml +10 -0
  72. data/spec/dummy/config/credentials.yml.enc +1 -0
  73. data/spec/dummy/config/database.yml +25 -0
  74. data/spec/dummy/config/environment.rb +5 -0
  75. data/spec/dummy/config/environments/development.rb +54 -0
  76. data/spec/dummy/config/environments/production.rb +106 -0
  77. data/spec/dummy/config/environments/test.rb +49 -0
  78. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  79. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  80. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  81. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  82. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  83. data/spec/dummy/config/initializers/inflections.rb +16 -0
  84. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  85. data/spec/dummy/config/initializers/react_on_rails.rb +58 -0
  86. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  87. data/spec/dummy/config/locales/en.yml +33 -0
  88. data/spec/dummy/config/puma.rb +38 -0
  89. data/spec/dummy/config/routes.rb +6 -0
  90. data/spec/dummy/config/shakapacker.yml +62 -0
  91. data/spec/dummy/config/spring.rb +6 -0
  92. data/spec/dummy/config/storage.yml +34 -0
  93. data/spec/dummy/config/webpack/ServerClientOrBoth.js +34 -0
  94. data/spec/dummy/config/webpack/clientWebpackConfig.js +15 -0
  95. data/spec/dummy/config/webpack/commonWebpackConfig.js +18 -0
  96. data/spec/dummy/config/webpack/development.js +32 -0
  97. data/spec/dummy/config/webpack/production.js +9 -0
  98. data/spec/dummy/config/webpack/serverWebpackConfig.js +116 -0
  99. data/spec/dummy/config/webpack/test.js +7 -0
  100. data/spec/dummy/config/webpack/webpack.config.js +24 -0
  101. data/spec/dummy/config.ru +5 -0
  102. data/spec/dummy/db/seeds.rb +7 -0
  103. data/spec/dummy/lib/assets/.keep +0 -0
  104. data/spec/dummy/lib/tasks/.keep +0 -0
  105. data/spec/dummy/package.json +44 -0
  106. data/spec/dummy/postcss.config.js +12 -0
  107. data/spec/dummy/public/404.html +67 -0
  108. data/spec/dummy/public/422.html +67 -0
  109. data/spec/dummy/public/500.html +66 -0
  110. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  111. data/spec/dummy/public/apple-touch-icon.png +0 -0
  112. data/spec/dummy/public/favicon.ico +0 -0
  113. data/spec/dummy/public/robots.txt +1 -0
  114. data/spec/dummy/spec/rails_helper.rb +118 -0
  115. data/spec/dummy/spec/spec_helper.rb +96 -0
  116. data/spec/dummy/spec/system/hello_world_spec.rb +19 -0
  117. data/spec/dummy/tsconfig.json +21 -0
  118. data/spec/dummy/vendor/.keep +0 -0
  119. data/spec/dummy/yarn.lock +4697 -0
  120. data/spec/generator_specs/e2e_template/files/app/controllers/home_controller.rb +4 -0
  121. data/spec/generator_specs/e2e_template/files/app/javascript/components/App.js +12 -0
  122. data/spec/generator_specs/e2e_template/files/app/javascript/packs/application.js +10 -0
  123. data/spec/generator_specs/e2e_template/files/app/views/home/index.html.erb +2 -0
  124. data/spec/generator_specs/e2e_template/files/app/views/layouts/application.html.erb +17 -0
  125. data/spec/generator_specs/e2e_template/files/config/routes.rb +3 -0
  126. data/spec/generator_specs/e2e_template/files/spec/system/test_react_component_renders_spec.rb +13 -0
  127. data/spec/generator_specs/e2e_template/template.rb +21 -0
  128. data/spec/generator_specs/generator_spec.rb +169 -0
  129. data/spec/{configuration_spec.rb → shakapacker/configuration_spec.rb} +10 -10
  130. data/spec/{dev_server_runner_spec.rb → shakapacker/dev_server_runner_spec.rb} +1 -1
  131. data/spec/{engine_rake_tasks_spec.rb → shakapacker/engine_rake_tasks_spec.rb} +2 -2
  132. data/spec/{manifest_spec.rb → shakapacker/manifest_spec.rb} +1 -1
  133. data/spec/shakapacker/rake_tasks_spec.rb +93 -0
  134. data/spec/{spec_helper_initializer.rb → shakapacker/spec_helper_initializer.rb} +1 -1
  135. data/spec/shakapacker/test_app/config/webpack/webpack.config.js +0 -0
  136. data/spec/shakapacker/test_app/some.config.js +0 -0
  137. data/spec/{version_checker_spec.rb → shakapacker/version_checker_spec.rb} +9 -9
  138. data/spec/{webpack_runner_spec.rb → shakapacker/webpack_runner_spec.rb} +1 -1
  139. metadata +170 -64
  140. data/gemfiles/Gemfile-rails.5.2.x +0 -9
  141. data/spec/rake_tasks_spec.rb +0 -34
  142. /data/docs/{developing_webpacker.md → developing_shakapacker.md} +0 -0
  143. /data/spec/backward_compatibility_specs/{command_spec_bc.rb → command_spec.rb} +0 -0
  144. /data/spec/backward_compatibility_specs/{compiler_spec_bc.rb → compiler_spec.rb} +0 -0
  145. /data/spec/backward_compatibility_specs/{compiler_strategy_spec_bc.rb → compiler_strategy_spec.rb} +0 -0
  146. /data/spec/backward_compatibility_specs/{configuration_spec_bc.rb → configuration_spec.rb} +0 -0
  147. /data/spec/backward_compatibility_specs/{dev_server_runner_spec_bc.rb → dev_server_runner_spec.rb} +0 -0
  148. /data/spec/backward_compatibility_specs/{dev_server_spec_bc.rb → dev_server_spec.rb} +0 -0
  149. /data/spec/backward_compatibility_specs/{digest_strategy_spec_bc.rb → digest_strategy_spec.rb} +0 -0
  150. /data/spec/backward_compatibility_specs/{engine_rake_tasks_spec_bc.rb → engine_rake_tasks_spec.rb} +0 -0
  151. /data/spec/backward_compatibility_specs/{env_spec_bc.rb → env_spec.rb} +0 -0
  152. /data/spec/backward_compatibility_specs/{helper_spec_bc.rb → helper_spec.rb} +0 -0
  153. /data/spec/backward_compatibility_specs/{instance_spec_bc.rb → instance_spec.rb} +0 -0
  154. /data/spec/backward_compatibility_specs/{manifest_spec_bc.rb → manifest_spec.rb} +0 -0
  155. /data/spec/backward_compatibility_specs/{mtime_strategy_spec_bc.rb → mtime_strategy_spec.rb} +0 -0
  156. /data/spec/backward_compatibility_specs/{rake_tasks_spec_bc.rb → rake_tasks_spec.rb} +0 -0
  157. /data/spec/backward_compatibility_specs/{webpack_runner_spec_bc.rb → webpack_runner_spec.rb} +0 -0
  158. /data/spec/backward_compatibility_specs/{webpacker_spec_bc.rb → webpacker_spec.rb} +0 -0
  159. /data/spec/{test_app/config/webpack/webpack.config.js → dummy/app/assets/images/.keep} +0 -0
  160. /data/spec/{test_app/some.config.js → dummy/app/controllers/concerns/.keep} +0 -0
  161. /data/spec/{command_spec.rb → shakapacker/command_spec.rb} +0 -0
  162. /data/spec/{compiler_spec.rb → shakapacker/compiler_spec.rb} +0 -0
  163. /data/spec/{compiler_strategy_spec.rb → shakapacker/compiler_strategy_spec.rb} +0 -0
  164. /data/spec/{dev_server_spec.rb → shakapacker/dev_server_spec.rb} +0 -0
  165. /data/spec/{digest_strategy_spec.rb → shakapacker/digest_strategy_spec.rb} +0 -0
  166. /data/spec/{env_spec.rb → shakapacker/env_spec.rb} +0 -0
  167. /data/spec/{helper_spec.rb → shakapacker/helper_spec.rb} +0 -0
  168. /data/spec/{instance_spec.rb → shakapacker/instance_spec.rb} +0 -0
  169. /data/spec/{mtime_strategy_spec.rb → shakapacker/mtime_strategy_spec.rb} +0 -0
  170. /data/spec/{webpacker_spec.rb → shakapacker/shakapacker_spec.rb} +0 -0
  171. /data/spec/{test_app → shakapacker/test_app}/.gitignore +0 -0
  172. /data/spec/{test_app → shakapacker/test_app}/Rakefile +0 -0
  173. /data/spec/{test_app → shakapacker/test_app}/app/javascript/entrypoints/application.js +0 -0
  174. /data/spec/{test_app → shakapacker/test_app}/app/javascript/entrypoints/generated/something.js +0 -0
  175. /data/spec/{test_app → shakapacker/test_app}/app/javascript/entrypoints/multi_entry.css +0 -0
  176. /data/spec/{test_app → shakapacker/test_app}/app/javascript/entrypoints/multi_entry.js +0 -0
  177. /data/spec/{test_app → shakapacker/test_app}/bin/shakapacker +0 -0
  178. /data/spec/{test_app → shakapacker/test_app}/bin/shakapacker-dev-server +0 -0
  179. /data/spec/{test_app → shakapacker/test_app}/config/application.rb +0 -0
  180. /data/spec/{test_app → shakapacker/test_app}/config/environment.rb +0 -0
  181. /data/spec/{test_app → shakapacker/test_app}/config/initializers/inspect_autoload_paths.rb +0 -0
  182. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker.yml +0 -0
  183. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_css_extract_ignore_order_warnings.yml +0 -0
  184. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_defaults_fallback.yml +0 -0
  185. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_manifest_path.yml +0 -0
  186. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_nested_entries.yml +0 -0
  187. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_no_precompile.yml +0 -0
  188. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_other_location.yml +0 -0
  189. /data/spec/{test_app → shakapacker/test_app}/config/shakapacker_public_root.yml +0 -0
  190. /data/spec/{test_app → shakapacker/test_app}/config.ru +0 -0
  191. /data/spec/{test_app → shakapacker/test_app}/package.json +0 -0
  192. /data/spec/{test_app → shakapacker/test_app}/public/packs/manifest.json +0 -0
  193. /data/spec/{test_app → shakapacker/test_app}/yarn.lock +0 -0
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ def installed?(process)
5
+ IO.popen "#{process} -v"
6
+ rescue Errno::ENOENT
7
+ false
8
+ end
9
+
10
+ def run(process)
11
+ system "#{process} start -f Procfile.dev"
12
+ rescue Errno::ENOENT
13
+ warn <<~MSG
14
+ ERROR:
15
+ Please ensure `Procfile.dev` exists in your project!
16
+ MSG
17
+ exit!
18
+ end
19
+
20
+ if installed? "overmind"
21
+ run "overmind"
22
+ elsif installed? "foreman"
23
+ run "foreman"
24
+ else
25
+ warn <<~MSG
26
+ NOTICE:
27
+ For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them.
28
+ MSG
29
+ exit!
30
+ end
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ def installed?(process)
5
+ IO.popen "#{process} -v"
6
+ rescue Errno::ENOENT
7
+ false
8
+ end
9
+
10
+ def run(process)
11
+ system "#{process} start -f Procfile.dev-static"
12
+ rescue Errno::ENOENT
13
+ warn <<~MSG
14
+ ERROR:
15
+ Please ensure `Procfile.dev-static` exists in your project!
16
+ MSG
17
+ exit!
18
+ end
19
+
20
+ if installed? "overmind"
21
+ run "overmind"
22
+ elsif installed? "foreman"
23
+ run "foreman"
24
+ else
25
+ warn <<~MSG
26
+ NOTICE:
27
+ For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them.
28
+ MSG
29
+ exit!
30
+ end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?("spring")
6
+ end
7
+ APP_PATH = File.expand_path("../config/application", __dir__)
8
+ require_relative "../config/boot"
9
+ require "rails/commands"
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?("spring")
6
+ end
7
+ require_relative "../config/boot"
8
+ require "rake"
9
+ Rake.application.run
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+ require "fileutils"
3
+
4
+ # path to your application root.
5
+ APP_ROOT = File.expand_path("..", __dir__)
6
+
7
+ def system!(*args)
8
+ system(*args) || abort("\n== Command #{args} failed ==")
9
+ end
10
+
11
+ FileUtils.chdir APP_ROOT do
12
+ # This script is a way to setup or update your development environment automatically.
13
+ # This script is idempotent, so that you can run it at anytime and get an expectable outcome.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts "== Installing dependencies =="
17
+ system! "gem install bundler --conservative"
18
+ system("bundle check") || system!("bundle install")
19
+
20
+ # puts "\n== Copying sample files =="
21
+ # unless File.exist?('config/database.yml')
22
+ # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
23
+ # end
24
+
25
+ puts "\n== Preparing database =="
26
+ system! "bin/rails db:prepare"
27
+
28
+ puts "\n== Removing old logs and tempfiles =="
29
+ system! "bin/rails log:clear tmp:clear"
30
+
31
+ puts "\n== Restarting application server =="
32
+ system! "bin/rails restart"
33
+ end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENV["RAILS_ENV"] ||= "development"
4
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
5
+
6
+ require "bundler/setup"
7
+ require "shakapacker"
8
+ require "shakapacker/webpack_runner"
9
+
10
+ APP_ROOT = File.expand_path("..", __dir__)
11
+ Dir.chdir(APP_ROOT) do
12
+ Shakapacker::WebpackRunner.run(ARGV)
13
+ end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENV["RAILS_ENV"] ||= "development"
4
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
5
+
6
+ require "bundler/setup"
7
+ require "shakapacker"
8
+ require "shakapacker/dev_server_runner"
9
+
10
+ APP_ROOT = File.expand_path("..", __dir__)
11
+ Dir.chdir(APP_ROOT) do
12
+ Shakapacker::DevServerRunner.run(ARGV)
13
+ end
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads Spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem "spring", spring.version
15
+ require "spring/binstub"
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ APP_ROOT = File.expand_path("..", __dir__)
4
+ Dir.chdir(APP_ROOT) do
5
+ yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
6
+ select { |dir| File.expand_path(dir) != __dir__ }.
7
+ product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"]).
8
+ map { |dir, file| File.expand_path(file, dir) }.
9
+ find { |file| File.executable?(file) }
10
+
11
+ if yarn
12
+ exec yarn, *ARGV
13
+ else
14
+ $stderr.puts "Yarn executable was not detected in the system."
15
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
16
+ exit 1
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ require_relative "boot"
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ require "active_record/railtie"
8
+ require "active_storage/engine"
9
+ require "action_controller/railtie"
10
+ require "action_mailer/railtie"
11
+ require "action_mailbox/engine"
12
+ require "action_text/engine"
13
+ require "action_view/railtie"
14
+ require "action_cable/engine"
15
+ # require "sprockets/railtie"
16
+ require "rails/test_unit/railtie"
17
+
18
+ # Require the gems listed in Gemfile, including any gems
19
+ # you've limited to :test, :development, or :production.
20
+ Bundler.require(*Rails.groups)
21
+
22
+ module TestReactOnRailsV12SsrV2
23
+ class Application < Rails::Application
24
+ # Initialize configuration defaults for originally generated Rails version.
25
+ config.load_defaults 6.0
26
+
27
+ # Settings in config/environments/* take precedence over those specified here.
28
+ # Application configuration can go into files in config/initializers
29
+ # -- all .rb files in that directory are automatically loaded after loading
30
+ # the framework and any gems in your application.
31
+ end
32
+ end
@@ -0,0 +1,4 @@
1
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2
+
3
+ require "bundler/setup" # Set up gems listed in the Gemfile.
4
+ require "bootsnap/setup" # Speed up boot time by caching expensive operations.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: test
6
+
7
+ production:
8
+ adapter: redis
9
+ url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10
+ channel_prefix: test_react_on_rails_v12_ssr_v2_production
@@ -0,0 +1 @@
1
+ 8PZY1LVGqpHC5No5f/ki/TLf/IcIrjTr6JdDJ4i+DXmlXrq2nIMrZmFvB3AnKDFxTEAP2exz74XMcJKWaT1i9Q8zAD/+AsFfjlPBej7uzv19T8zOMnEbDawQng2FHwHRtrEQlLa45V+qXjpFz52aBK+tiUgwc6C+aokQBibUs84LpYI3GHcrAXHEuZeYC72YDjJN/r3kDlRyJWTNIAEWGyKRxmIecSGYihmLpStLTqbn6QGCB85usriXx9oSBG2CtQbVDDnfL1H8QmU3VC7YzFaF3SREchDGB29TXeqHACvke9hMiEO8k4met+xwgBW6USX7gBAVofVmFyJa0DCelsiDfTeLI/qUpbkK5+XSGDSFXQTBC6SiipODgu1ZKP2G6yZiXEOlXUuCA/OR99JaT944qLqd2H6LdGFw--RqILZtg0csYBK/g/--vlbHBLNZBD64UMHC16MEGQ==
@@ -0,0 +1,25 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,54 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable/disable caching. By default caching is disabled.
16
+ # Run rails dev:cache to toggle caching.
17
+ if Rails.root.join("tmp", "caching-dev.txt").exist?
18
+ config.action_controller.perform_caching = true
19
+ config.action_controller.enable_fragment_cache_logging = true
20
+
21
+ config.cache_store = :memory_store
22
+ config.public_file_server.headers = {
23
+ "Cache-Control" => "public, max-age=#{2.days.to_i}"
24
+ }
25
+ else
26
+ config.action_controller.perform_caching = false
27
+
28
+ config.cache_store = :null_store
29
+ end
30
+
31
+ # Store uploaded files on the local file system (see config/storage.yml for options).
32
+ config.active_storage.service = :local
33
+
34
+ # Don't care if the mailer can't send.
35
+ config.action_mailer.raise_delivery_errors = false
36
+
37
+ config.action_mailer.perform_caching = false
38
+
39
+ # Print deprecation notices to the Rails logger.
40
+ config.active_support.deprecation = :log
41
+
42
+ # Raise an error on page load if there are pending migrations.
43
+ config.active_record.migration_error = :page_load
44
+
45
+ # Highlight code that triggered database queries in logs.
46
+ config.active_record.verbose_query_logs = true
47
+
48
+ # Raises error for missing translations.
49
+ # config.action_view.raise_on_missing_translations = true
50
+
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
+ end
@@ -0,0 +1,106 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
18
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
19
+ # config.require_master_key = true
20
+
21
+ # Disable serving static files from the `/public` folder by default since
22
+ # Apache or NGINX already handles this.
23
+ config.public_file_server.enabled = true # ENV['RAILS_SERVE_STATIC_FILES'].present?
24
+
25
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
26
+ # config.action_controller.asset_host = 'http://assets.example.com'
27
+
28
+ # Specifies the header that your server uses for sending files.
29
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
30
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
31
+
32
+ # Store uploaded files on the local file system (see config/storage.yml for options).
33
+ config.active_storage.service = :local
34
+
35
+ # Mount Action Cable outside main process or domain.
36
+ # config.action_cable.mount_path = nil
37
+ # config.action_cable.url = 'wss://example.com/cable'
38
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
39
+
40
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
41
+ # config.force_ssl = true
42
+
43
+ # Use the lowest log level to ensure availability of diagnostic information
44
+ # when problems arise.
45
+ config.log_level = :debug
46
+
47
+ # Prepend all log lines with the following tags.
48
+ config.log_tags = [ :request_id ]
49
+
50
+ # Use a different cache store in production.
51
+ # config.cache_store = :mem_cache_store
52
+
53
+ # Use a real queuing backend for Active Job (and separate queues per environment).
54
+ # config.active_job.queue_adapter = :resque
55
+ # config.active_job.queue_name_prefix = "test_react_on_rails_v12_ssr_v2_production"
56
+
57
+ config.action_mailer.perform_caching = false
58
+
59
+ # Ignore bad email addresses and do not raise email delivery errors.
60
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
61
+ # config.action_mailer.raise_delivery_errors = false
62
+
63
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64
+ # the I18n.default_locale when a translation cannot be found).
65
+ config.i18n.fallbacks = true
66
+
67
+ # Send deprecation notices to registered listeners.
68
+ config.active_support.deprecation = :notify
69
+
70
+ # Use default logging formatter so that PID and timestamp are not suppressed.
71
+ config.log_formatter = ::Logger::Formatter.new
72
+
73
+ # Use a different logger for distributed setups.
74
+ # require 'syslog/logger'
75
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
76
+
77
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
78
+ logger = ActiveSupport::Logger.new(STDOUT)
79
+ logger.formatter = config.log_formatter
80
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
81
+ end
82
+
83
+ # Do not dump schema after migrations.
84
+ config.active_record.dump_schema_after_migration = false
85
+
86
+ # Inserts middleware to perform automatic connection switching.
87
+ # The `database_selector` hash is used to pass options to the DatabaseSelector
88
+ # middleware. The `delay` is used to determine how long to wait after a write
89
+ # to send a subsequent read to the primary.
90
+ #
91
+ # The `database_resolver` class is used by the middleware to determine which
92
+ # database is appropriate to use based on the time delay.
93
+ #
94
+ # The `database_resolver_context` class is used by the middleware to set
95
+ # timestamps for the last write to the primary. The resolver uses the context
96
+ # class timestamps to determine how long to wait before reading from the
97
+ # replica.
98
+ #
99
+ # By default Rails will store a last write timestamp in the session. The
100
+ # DatabaseSelector middleware is designed as such you can define your own
101
+ # strategy for connection switching and pass that into the middleware through
102
+ # these configuration options.
103
+ # config.active_record.database_selector = { delay: 2.seconds }
104
+ # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
105
+ # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
106
+ end
@@ -0,0 +1,49 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ config.cache_classes = false
10
+ config.action_view.cache_template_loading = true
11
+
12
+ # Do not eager load code on boot. This avoids loading your whole application
13
+ # just for the purpose of running a single test. If you are using a tool that
14
+ # preloads Rails for running tests, you may have to set it to true.
15
+ config.eager_load = false
16
+
17
+ # Configure public file server for tests with Cache-Control for performance.
18
+ config.public_file_server.enabled = true
19
+ config.public_file_server.headers = {
20
+ "Cache-Control" => "public, max-age=#{1.hour.to_i}"
21
+ }
22
+
23
+ # Show full error reports and disable caching.
24
+ config.consider_all_requests_local = true
25
+ config.action_controller.perform_caching = false
26
+ config.cache_store = :null_store
27
+
28
+ # Raise exceptions instead of rendering exception templates.
29
+ config.action_dispatch.show_exceptions = false
30
+
31
+ # Disable request forgery protection in test environment.
32
+ config.action_controller.allow_forgery_protection = false
33
+
34
+ # Store uploaded files on the local file system in a temporary directory.
35
+ config.active_storage.service = :test
36
+
37
+ config.action_mailer.perform_caching = false
38
+
39
+ # Tell Action Mailer not to deliver emails to the real world.
40
+ # The :test delivery method accumulates sent emails in the
41
+ # ActionMailer::Base.deliveries array.
42
+ config.action_mailer.delivery_method = :test
43
+
44
+ # Print deprecation notices to the stderr.
45
+ config.active_support.deprecation = :stderr
46
+
47
+ # Raises error for missing translations.
48
+ # config.action_view.raise_on_missing_translations = true
49
+ end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,28 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Set the nonce only to specific directives
23
+ # Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
24
+
25
+ # Report CSP violations to a specified URI
26
+ # For further information see the following documentation:
27
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
28
+ # Rails.application.config.content_security_policy_report_only = true
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ # See https://github.com/shakacode/react_on_rails/blob/master/docs/guides/configuration.md
4
+ # for many more options.
5
+
6
+ ReactOnRails.configure do |config|
7
+ # This configures the script to run to build the production assets by webpack. Set this to nil
8
+ # if you don't want react_on_rails building this file for you.
9
+ # If nil, then the standard shakacode/shakapacker assets:precompile will run
10
+ # config.build_production_command = nil
11
+
12
+ ################################################################################
13
+ ################################################################################
14
+ # TEST CONFIGURATION OPTIONS
15
+ # Below options are used with the use of this test helper:
16
+ # ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
17
+ ################################################################################
18
+
19
+ # If you are using this in your spec_helper.rb (or rails_helper.rb):
20
+ #
21
+ # ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
22
+ #
23
+ # with rspec then this controls what yarn command is run
24
+ # to automatically refresh your webpack assets on every test run.
25
+ #
26
+ # Alternately, you can remove the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets`
27
+ # and set the config/webpacker.yml option for test to true.
28
+ config.build_test_command = "RAILS_ENV=test bin/webpacker"
29
+
30
+ ################################################################################
31
+ ################################################################################
32
+ # SERVER RENDERING OPTIONS
33
+ ################################################################################
34
+ # This is the file used for server rendering of React when using `(prerender: true)`
35
+ # If you are never using server rendering, you should set this to "".
36
+ # Note, there is only one server bundle, unlike JavaScript where you want to minimize the size
37
+ # of the JS sent to the client. For the server rendering, React on Rails creates a pool of
38
+ # JavaScript execution instances which should handle any component requested.
39
+ #
40
+ # While you may configure this to be the same as your client bundle file, this file is typically
41
+ # different. You should have ONE server bundle which can create all of your server rendered
42
+ # React components.
43
+ #
44
+ config.server_bundle_js_file = "server-bundle.js"
45
+
46
+ ################################################################################
47
+ ################################################################################
48
+ # FILE SYSTEM BASED COMPONENT REGISTRY
49
+ ################################################################################
50
+ # `components_subdirectory` is the name of the matching directories that contain automatically registered components
51
+ # for use in the Rails views. The default is nil, you can enable the feature by updating it in the next line.
52
+ # config.components_subdirectory = "ror_components"
53
+ #
54
+ # For automated component registry, `render_component` view helper method tries to load bundle for component from
55
+ # generated directory. default is false, you can pass option at the time of individual usage or update the default
56
+ # in the following line
57
+ config.auto_load_bundle = false
58
+ end
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end